commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1104506 - in /incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/internal: ClassCacheImpl.java Entry.java
Date Tue, 17 May 2011 20:00:52 GMT
Author: simonetripodi
Date: Tue May 17 20:00:52 2011
New Revision: 1104506

URL: http://svn.apache.org/viewvc?rev=1104506&view=rev
Log:
Entry members made private, used proper getters/setters to access

Modified:
    incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/ClassCacheImpl.java
    incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/Entry.java

Modified: incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/ClassCacheImpl.java
URL: http://svn.apache.org/viewvc/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/ClassCacheImpl.java?rev=1104506&r1=1104505&r2=1104506&view=diff
==============================================================================
--- incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/ClassCacheImpl.java
(original)
+++ incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/ClassCacheImpl.java
Tue May 17 20:00:52 2011
@@ -89,13 +89,13 @@ public class ClassCacheImpl
 
         while ( entry != null )
         {
-            if ( entry.key == key )
+            if ( entry.getKey() == key )
             {
-                result = entry.value;
+                result = entry.getValue();
                 break;
             }
 
-            entry = entry.next;
+            entry = entry.getNext();
         }
 
         return result;
@@ -122,31 +122,31 @@ public class ClassCacheImpl
         }
         else
         {
-            if ( entry.key == key )
+            if ( entry.getKey() == key )
             {
-                result = entry.value;
-                entry.value = value;
+                result = entry.getValue();
+                entry.setValue( value );
             }
             else
             {
                 while ( true )
                 {
-                    if ( entry.key == key )
+                    if ( entry.getKey() == key )
                     {
                         /* replace value */
-                        result = entry.value;
-                        entry.value = value;
+                        result = entry.getValue();
+                        entry.setValue( value );
                         break;
                     }
 
-                    if ( entry.next == null )
+                    if ( entry.getNext() == null )
                     {
                         /* add value */
-                        entry.next = new Entry<T>( key, value );
+                        entry.setNext( new Entry<T>( key, value ) );
                         break;
                     }
 
-                    entry = entry.next;
+                    entry = entry.getNext();
                 }
             }
         }

Modified: incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/Entry.java
URL: http://svn.apache.org/viewvc/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/Entry.java?rev=1104506&r1=1104505&r2=1104506&view=diff
==============================================================================
--- incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/Entry.java (original)
+++ incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/Entry.java Tue May
17 20:00:52 2011
@@ -25,11 +25,11 @@ package org.apache.commons.ognl.internal
 class Entry<T>
 {
 
-    Entry<T> next;
+    private Entry<T> next;
 
-    Class<T> key;
+    private final Class<T> key;
 
-    T value;
+    private T value;
 
     public Entry( Class<T> key, T value )
     {
@@ -37,6 +37,31 @@ class Entry<T>
         this.value = value;
     }
 
+    public Class<T> getKey()
+    {
+        return key;
+    }
+
+    public T getValue()
+    {
+        return value;
+    }
+
+    public void setValue( T value )
+    {
+        this.value = value;
+    }
+
+    public Entry<T> getNext()
+    {
+        return next;
+    }
+
+    public void setNext( Entry<T> next )
+    {
+        this.next = next;
+    }
+
     @Override
     public String toString()
     {



Mime
View raw message