Repository: olingo-odata4
Updated Branches:
  refs/heads/master 436a431a2 -> 422d4a6ea


[OLINGO-575] Remove java warnings part 3


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/422d4a6e
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/422d4a6e
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/422d4a6e

Branch: refs/heads/master
Commit: 422d4a6ea48f07536810cacbc3ed809992b90eb2
Parents: 436a431
Author: Christian Amend <[email protected]>
Authored: Mon Mar 9 15:36:13 2015 +0100
Committer: Christian Amend <[email protected]>
Committed: Mon Mar 9 15:36:52 2015 +0100

----------------------------------------------------------------------
 .../commons/AbstractPersistenceManager.java     | 44 ++++++++++----------
 .../olingo/fit/tecsvc/http/PingITCase.java      |  4 --
 .../cud/ODataEntityCreateRequestImpl.java       |  8 ++--
 .../cud/ODataPropertyUpdateRequestImpl.java     |  8 ++--
 .../cud/ODataValueUpdateRequestImpl.java        |  8 ++--
 .../core/domain/ODataObjectFactoryImpl.java     |  2 +-
 6 files changed, 35 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/422d4a6e/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java
----------------------------------------------------------------------
diff --git 
a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java
 
b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java
index 9081875..238686a 100644
--- 
a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java
+++ 
b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java
@@ -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);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/422d4a6e/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java
----------------------------------------------------------------------
diff --git 
a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java 
b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java
index 5146db9..d772fbe 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java
@@ -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;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/422d4a6e/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityCreateRequestImpl.java
----------------------------------------------------------------------
diff --git 
a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityCreateRequestImpl.java
 
b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityCreateRequestImpl.java
index cb8c295..3dc08a4 100644
--- 
a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityCreateRequestImpl.java
+++ 
b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityCreateRequestImpl.java
@@ -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;
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/422d4a6e/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataPropertyUpdateRequestImpl.java
----------------------------------------------------------------------
diff --git 
a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataPropertyUpdateRequestImpl.java
 
b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataPropertyUpdateRequestImpl.java
index 2fb8484..50b423c 100644
--- 
a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataPropertyUpdateRequestImpl.java
+++ 
b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataPropertyUpdateRequestImpl.java
@@ -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;
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/422d4a6e/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataValueUpdateRequestImpl.java
----------------------------------------------------------------------
diff --git 
a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataValueUpdateRequestImpl.java
 
b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataValueUpdateRequestImpl.java
index 2ad54cb..ddff3b9 100644
--- 
a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataValueUpdateRequestImpl.java
+++ 
b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataValueUpdateRequestImpl.java
@@ -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;
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/422d4a6e/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataObjectFactoryImpl.java
----------------------------------------------------------------------
diff --git 
a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataObjectFactoryImpl.java
 
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataObjectFactoryImpl.java
index 5162555..eb82364 100644
--- 
a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataObjectFactoryImpl.java
+++ 
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataObjectFactoryImpl.java
@@ -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

Reply via email to