directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r718196 - /directory/sandbox/kayyagari/apacheds-olm/src/main/java/org/apache/directory/olm/util/CodeEnhancer.java
Date Mon, 17 Nov 2008 08:55:33 GMT
Author: kayyagari
Date: Mon Nov 17 00:55:33 2008
New Revision: 718196

URL: http://svn.apache.org/viewvc?rev=718196&view=rev
Log:
cleaned up code, fixed a bug related to the updated interface names

Modified:
    directory/sandbox/kayyagari/apacheds-olm/src/main/java/org/apache/directory/olm/util/CodeEnhancer.java

Modified: directory/sandbox/kayyagari/apacheds-olm/src/main/java/org/apache/directory/olm/util/CodeEnhancer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/apacheds-olm/src/main/java/org/apache/directory/olm/util/CodeEnhancer.java?rev=718196&r1=718195&r2=718196&view=diff
==============================================================================
--- directory/sandbox/kayyagari/apacheds-olm/src/main/java/org/apache/directory/olm/util/CodeEnhancer.java
(original)
+++ directory/sandbox/kayyagari/apacheds-olm/src/main/java/org/apache/directory/olm/util/CodeEnhancer.java
Mon Nov 17 00:55:33 2008
@@ -105,12 +105,6 @@
             return;
         }
 
-        //        if( isAttribute( interfaces ) )
-        //        {
-        //            LOG.warn( "TODO need to enance Attributes for dirty tracking of underlying
collection of multi valued attributes." );
-        //            return;
-        //        }
-
         ClassWriter w = new DebuggingClassWriter( ClassWriter.COMPUTE_MAXS ); // use CustomDebuggingClassWriter
for additional features
         getGenerator( r ).generateClass( w );
         byte[] b = w.toByteArray();
@@ -138,21 +132,6 @@
     }
 
 
-    private boolean isAttribute( String[] interfaces )
-    {
-        for ( String s : interfaces )
-        {
-            s = s.replace( "/", "." );// class file doesn't contain a '.' in a FQCN
-            if ( s.equals( "org.apache.directory.olm.Attribute" ) )
-            {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-
     private boolean canEnhance( String[] interfaces )
     {
         boolean isAttribute = false;
@@ -161,7 +140,8 @@
         for ( String s : interfaces )
         {
             s = s.replace( "/", "." );// class file doesn't contain a '.' in a FQCN
-            if ( s.equals( "org.apache.directory.olm.Attribute" ) )
+            if ( s.equals( "org.apache.directory.olm.MultiValueAttribute" ) 
+                || s.equals( "org.apache.directory.olm.SingleValueAttribute" ) )
             {
                 isAttribute = true;
             }
@@ -190,6 +170,14 @@
             }
         }
     }
+    
+    public static void main( String[] args ) throws Exception
+    {
+        CodeEnhancer ce = new CodeEnhancer();
+
+        File rootDir = new File( "/opt/workspace/apacheds-olm/target/classes" );
+        ce.enhanceAll( rootDir.listFiles() );
+    }
 
 }
 



Mime
View raw message