[cal10n-dev] [GIT] Compiler assisted localization library branch, master, updated. 27f1ec582de95317643cc8004bbe18672bb31e07

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Mon Aug 31 22:25:42 CEST 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Compiler assisted localization library".

The branch, master has been updated
       via  27f1ec582de95317643cc8004bbe18672bb31e07 (commit)
      from  6d8150c8fd78796ff2b5db2baf703ccd350fedd1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=cal10n.git;a=commit;h=27f1ec582de95317643cc8004bbe18672bb31e07
http://github.com/ceki/cal10n/commit/27f1ec582de95317643cc8004bbe18672bb31e07

commit 27f1ec582de95317643cc8004bbe18672bb31e07
Author: Sebastien Pennec <ceki at qos.ch>
Date:   Mon Aug 31 22:25:19 2009 +0200

    - experimenting with class loading on linux

diff --git a/cal10n-api/src/main/java/ch/qos/cal10n/verifier/MessageCodeVerifier.java b/cal10n-api/src/main/java/ch/qos/cal10n/verifier/MessageCodeVerifier.java
index 0146e1f..2be14a8 100644
--- a/cal10n-api/src/main/java/ch/qos/cal10n/verifier/MessageCodeVerifier.java
+++ b/cal10n-api/src/main/java/ch/qos/cal10n/verifier/MessageCodeVerifier.java
@@ -49,10 +49,14 @@ public class MessageCodeVerifier implements IMessageCodeVerifier {
     this.enumTypeAsStr = enumClass.getName();
   }
 
+  public MessageCodeVerifier() {
+    System.out.println("lkkkkkkkkkkkkkk="+this.getClass().getClassLoader());
+  }
   @SuppressWarnings("unchecked")
   public MessageCodeVerifier(String enumTypeAsStr) {
     this.enumTypeAsStr = enumTypeAsStr;
     String errMsg = "Failed to find enum class [" + enumTypeAsStr + "]";
+    System.out.println("lkkkkkkkkkkkkkk="+this.getClass().getClassLoader());
     try {
       this.enumType = (Class<? extends Enum<?>>) Class.forName(enumTypeAsStr);
     } catch (ClassNotFoundException e) {
diff --git a/maven-cal10n-plugin/src/main/java/ch/qos/cal10n/plugins/VerifyMojo.java b/maven-cal10n-plugin/src/main/java/ch/qos/cal10n/plugins/VerifyMojo.java
index 2575157..8a702ce 100644
--- a/maven-cal10n-plugin/src/main/java/ch/qos/cal10n/plugins/VerifyMojo.java
+++ b/maven-cal10n-plugin/src/main/java/ch/qos/cal10n/plugins/VerifyMojo.java
@@ -27,6 +27,7 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
 import java.util.Set;
@@ -147,6 +148,7 @@ public class VerifyMojo extends AbstractMojo {
       URLClassLoader cl = (URLClassLoader) buildClassLoader();
       Class<?> cla = Class.forName(Cal10nConstants.MessageCodeVerifier_FQCN, true, cl);
 
+      cla.newInstance();
       
       Constructor<?> cons = cla.getConstructor(String.class);
       IMessageCodeVerifier imcv = (IMessageCodeVerifier) cons
@@ -162,11 +164,14 @@ public class VerifyMojo extends AbstractMojo {
   }
 
   ClassLoader buildClassLoader() {
-    ArrayList<URL> classpathURLArray = new ArrayList<URL>();
-    classpathURLArray.add(toURL(outputDirectory));
-    classpathURLArray.addAll(getDirectDependencies());
+    ArrayList<URL> classpathURLList = new ArrayList<URL>();
+    classpathURLList.add(toURL(outputDirectory));
+    classpathURLList.addAll(getDirectDependencies());
     ClassLoader parentCL = this.getClass().getClassLoader();
-    return new ThisFirstClassLoader(classpathURLArray.toArray(new URL[] {}), parentCL);
+    
+    URL[] classpathURLArray = classpathURLList.toArray(new URL[] {});
+    System.out.println("classpathURLArray="+Arrays.toString(classpathURLArray));
+    return new ThisFirstClassLoader(classpathURLArray, parentCL);
   }
 
   List<URL> getDirectDependencies() {
@@ -179,7 +184,7 @@ public class VerifyMojo extends AbstractMojo {
         URL url = new URL("file:/" + pathOfArtifact);
         urlList.add(url);
       } catch (MalformedURLException e) {
-        e.printStackTrace();
+        getLog().info("Failed to build URL", e);
       }
     }
     return urlList;

-----------------------------------------------------------------------

Summary of changes:
 .../qos/cal10n/verifier/MessageCodeVerifier.java   |    4 ++++
 .../java/ch/qos/cal10n/plugins/VerifyMojo.java     |   15 ++++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Compiler assisted localization library


More information about the cal10n-dev mailing list