[OLINGO-575] Remove java warnings part 3

This commit is contained in:
Christian Amend 2015-03-09 15:36:13 +01:00
parent 436a431a25
commit 422d4a6ea4
6 changed files with 35 additions and 39 deletions

View File

@ -143,7 +143,7 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
final TransactionItems items,
final List<EntityLinkDesc> delayedUpdates,
final PersistenceChanges changeset) {
int posNumber = pos;
items.put(handler, null);
final ODataEntity entity = handler.getEntity();
@ -195,8 +195,8 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
URIUtils.getURI(service.getClient().getServiceRoot(), editLink.toASCIIString()), type));
} else {
if (!items.contains(target)) {
pos = processEntityContext(target, pos, items, delayedUpdates, changeset);
pos++;
posNumber = processEntityContext(target, posNumber, items, delayedUpdates, changeset);
posNumber++;
}
final Integer targetPos = items.get(target);
@ -243,14 +243,14 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
final AttachedEntityStatus processedStatus = queue(handler, entity, changeset);
if (processedStatus != null) {
// insert into the process queue
LOG.debug("{}: Insert '{}' into the process queue", pos, handler);
items.put(handler, pos);
LOG.debug("{}: Insert '{}' into the process queue", posNumber, handler);
items.put(handler, posNumber);
} else {
pos--;
posNumber--;
}
if (processedStatus != AttachedEntityStatus.DELETED) {
int startingPos = pos;
int startingPos = posNumber;
if (handler.getEntity().isMediaEntity() && handler.isChanged()) {
// update media properties
@ -260,9 +260,9 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
: URIUtils.getURI(
service.getClient().getServiceRoot(), handler.getEntity().getEditLink().toASCIIString());
queueUpdate(handler, targetURI, entity, changeset);
pos++;
items.put(handler, pos);
LOG.debug("{}: Update media properties for '{}' into the process queue", pos, handler);
posNumber++;
items.put(handler, posNumber);
LOG.debug("{}: Update media properties for '{}' into the process queue", posNumber, handler);
}
// update media content
@ -276,9 +276,9 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
queueUpdateMediaEntity(handler, targetURI, handler.getStreamChanges(), changeset);
// update media info (use null key)
pos++;
items.put(null, pos);
LOG.debug("{}: Update media info for '{}' into the process queue", pos, handler);
posNumber++;
items.put(null, posNumber);
LOG.debug("{}: Update media info for '{}' into the process queue", posNumber, handler);
}
}
@ -291,13 +291,13 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
queueUpdateMediaResource(handler, targetURI, streamedChanges.getValue(), changeset);
// update media info (use null key)
pos++;
items.put(handler, pos);
LOG.debug("{}: Update media info (null key) for '{}' into the process queue", pos, handler);
posNumber++;
items.put(handler, posNumber);
LOG.debug("{}: Update media info (null key) for '{}' into the process queue", posNumber, handler);
}
}
return pos;
return posNumber;
}
protected void processDelayedUpdates(
@ -305,12 +305,12 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
int pos,
final TransactionItems items,
final PersistenceChanges changeset) {
int posNumber = pos;
for (EntityLinkDesc delayedUpdate : delayedUpdates) {
if (StringUtils.isBlank(delayedUpdate.getReference())) {
pos++;
items.put(delayedUpdate.getSource(), pos);
posNumber++;
items.put(delayedUpdate.getSource(), posNumber);
final ODataEntity changes =
service.getClient().getObjectFactory().newEntity(delayedUpdate.getSource().getEntity().getTypeName());
@ -357,8 +357,8 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
if (queueUpdateLinkViaRef(
delayedUpdate.getSource(), sourceURI, URI.create(delayedUpdate.getReference()), changeset)) {
pos++;
items.put(delayedUpdate.getSource(), pos);
posNumber++;
items.put(delayedUpdate.getSource(), posNumber);
}
}
}

View File

@ -28,13 +28,9 @@ import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.fit.AbstractBaseTestITCase;
import org.apache.olingo.fit.tecsvc.TecSvcConst;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PingITCase extends AbstractBaseTestITCase{
private static final Logger LOG = LoggerFactory.getLogger(PingITCase.class);
private static final String SERVICE_URI = TecSvcConst.BASE_URI + "/";
private static final String REDIRECT_URI = TecSvcConst.BASE_URI;

View File

@ -96,7 +96,7 @@ public class ODataEntityCreateRequestImpl<E extends ODataEntity>
*/
private class ODataEntityCreateResponseImpl extends AbstractODataResponse implements ODataEntityCreateResponse<E> {
private E entity = null;
private E resEntity = null;
private ODataEntityCreateResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
@ -110,19 +110,19 @@ public class ODataEntityCreateRequestImpl<E extends ODataEntity>
@Override
@SuppressWarnings("unchecked")
public E getBody() {
if (entity == null) {
if (resEntity == null) {
try {
final ResWrap<Entity> resource = odataClient.getDeserializer(ODataFormat.fromString(getAccept())).
toEntity(getRawResponse());
entity = (E) odataClient.getBinder().getODataEntity(resource);
resEntity = (E) odataClient.getBinder().getODataEntity(resource);
} catch (final ODataDeserializerException e) {
throw new IllegalArgumentException(e);
} finally {
this.close();
}
}
return entity;
return resEntity;
}
}
}

View File

@ -97,7 +97,7 @@ public class ODataPropertyUpdateRequestImpl extends AbstractODataBasicRequest<OD
*/
private class ODataPropertyUpdateResponseImpl extends AbstractODataResponse implements ODataPropertyUpdateResponse {
private ODataProperty property = null;
private ODataProperty resProperty = null;
private ODataPropertyUpdateResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
@ -107,19 +107,19 @@ public class ODataPropertyUpdateRequestImpl extends AbstractODataBasicRequest<OD
@Override
public ODataProperty getBody() {
if (property == null) {
if (resProperty == null) {
try {
final ResWrap<Property> resource = odataClient.getDeserializer(ODataFormat.fromString(getAccept())).
toProperty(getRawResponse());
property = odataClient.getBinder().getODataProperty(resource);
resProperty = odataClient.getBinder().getODataProperty(resource);
} catch (final ODataDeserializerException e) {
throw new IllegalArgumentException(e);
} finally {
this.close();
}
}
return property;
return resProperty;
}
}
}

View File

@ -94,7 +94,7 @@ public class ODataValueUpdateRequestImpl extends AbstractODataBasicRequest<OData
*/
private class ODataValueUpdateResponseImpl extends AbstractODataResponse implements ODataValueUpdateResponse {
private ODataPrimitiveValue value = null;
private ODataPrimitiveValue resValue = null;
private ODataValueUpdateResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
@ -104,11 +104,11 @@ public class ODataValueUpdateRequestImpl extends AbstractODataBasicRequest<OData
@Override
public ODataPrimitiveValue getBody() {
if (value == null) {
if (resValue == null) {
final ODataFormat format = ODataFormat.fromString(getAccept());
try {
value = odataClient.getObjectFactory().newPrimitiveValueBuilder().
resValue = odataClient.getObjectFactory().newPrimitiveValueBuilder().
setType(format == ODataFormat.TEXT_PLAIN
? EdmPrimitiveTypeKind.String : EdmPrimitiveTypeKind.Stream).
setValue(getRawResponse()).
@ -119,7 +119,7 @@ public class ODataValueUpdateRequestImpl extends AbstractODataBasicRequest<OData
this.close();
}
}
return value;
return resValue;
}
}
}

View File

@ -117,7 +117,7 @@ public class ODataObjectFactoryImpl implements ODataObjectFactory {
@Override
public ODataCollectionValue<ODataValue> newCollectionValue(final String typeName) {
return new ODataCollectionValueImpl(typeName);
return new ODataCollectionValueImpl<ODataValue>(typeName);
}
@Override