jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1156999 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
Date Fri, 12 Aug 2011 08:13:06 GMT
Author: angela
Date: Fri Aug 12 08:13:06 2011
New Revision: 1156999

URL: http://svn.apache.org/viewvc?rev=1156999&view=rev
Log:
minor improvement

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java?rev=1156999&r1=1156998&r2=1156999&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
Fri Aug 12 08:13:06 2011
@@ -110,6 +110,7 @@ public class PropertyImpl extends ItemIm
         return (PropertyState) state;
     }
 
+    @Override
     protected synchronized ItemState getOrCreateTransientItemState()
             throws RepositoryException {
 
@@ -132,6 +133,7 @@ public class PropertyImpl extends ItemIm
         }
     }
 
+    @Override
     protected void makePersistent() throws InvalidItemStateException {
         if (!isTransient()) {
             log.debug(this + " (" + id + "): there's no transient state to persist");
@@ -308,8 +310,7 @@ public class PropertyImpl extends ItemIm
         // free old values as necessary
         InternalValue[] oldValues = thisState.getValues();
         if (oldValues != null) {
-            for (int i = 0; i < oldValues.length; i++) {
-                InternalValue old = oldValues[i];
+            for (InternalValue old : oldValues) {
                 if (old != null && old.getType() == BINARY) {
                     // make sure temporarily allocated data is discarded
                     // before overwriting it
@@ -442,6 +443,7 @@ public class PropertyImpl extends ItemIm
     /**
      * {@inheritDoc}
      */
+    @Override
     public Name getQName() {
         return ((PropertyId) id).getName();
     }
@@ -519,6 +521,7 @@ public class PropertyImpl extends ItemIm
         final Binary binary = getValue().getBinary();
         // make sure binary is disposed after stream had been consumed
         return new AutoCloseInputStream(binary.getStream()) {
+            @Override
             public void close() throws IOException {
                 super.close();
                 binary.dispose();
@@ -775,11 +778,11 @@ public class PropertyImpl extends ItemIm
         if (values != null) {
             // check type of values
             int firstValueType = UNDEFINED;
-            for (int i = 0; i < values.length; i++) {
-                if (values[i] != null) {
+            for (Value value : values) {
+                if (value != null) {
                     if (firstValueType == UNDEFINED) {
-                        firstValueType = values[i].getType();
-                    } else if (firstValueType != values[i].getType()) {
+                        firstValueType = value.getType();
+                    } else if (firstValueType != value.getType()) {
                         throw new ValueFormatException(
                                 "inhomogeneous type of values");
                     }
@@ -871,6 +874,7 @@ public class PropertyImpl extends ItemIm
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isNode() {
         return false;
     }
@@ -878,6 +882,7 @@ public class PropertyImpl extends ItemIm
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getName() throws RepositoryException {
         // check state of this instance
         sanityCheck();
@@ -887,6 +892,7 @@ public class PropertyImpl extends ItemIm
     /**
      * {@inheritDoc}
      */
+    @Override
     public void accept(ItemVisitor visitor) throws RepositoryException {
         // check state of this instance
         sanityCheck();
@@ -897,6 +903,7 @@ public class PropertyImpl extends ItemIm
     /**
      * {@inheritDoc}
      */
+    @Override
     public Node getParent() throws RepositoryException {
         return getParent(true);
     }



Mime
View raw message