maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1462923 - in /maven/shared/trunk: file-management/src/main/java/org/apache/maven/shared/model/fileset/mappers/ maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/ maven-shared-utils/src/main/java/org/apac...
Date Sun, 31 Mar 2013 10:57:08 GMT
Author: olamy
Date: Sun Mar 31 10:57:08 2013
New Revision: 1462923

URL: http://svn.apache.org/r1462923
Log:
prefer TCCL.loadClass over Class.forName

Modified:
    maven/shared/trunk/file-management/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperUtil.java
    maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/DefaultDependencyGraphBuilder.java
    maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/Java7Support.java
    maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java

Modified: maven/shared/trunk/file-management/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperUtil.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/file-management/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperUtil.java?rev=1462923&r1=1462922&r2=1462923&view=diff
==============================================================================
--- maven/shared/trunk/file-management/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperUtil.java
(original)
+++ maven/shared/trunk/file-management/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperUtil.java
Sun Mar 31 10:57:08 2013
@@ -117,7 +117,7 @@ public final class MapperUtil
 
         try
         {
-            FileNameMapper m = (FileNameMapper) Class.forName( classname ).newInstance();
+            FileNameMapper m = (FileNameMapper) Thread.currentThread().getContextClassLoader().loadClass(
classname ).newInstance();
 
             m.setFrom( mapper.getFrom() );
             m.setTo( mapper.getTo() );

Modified: maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/DefaultDependencyGraphBuilder.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/DefaultDependencyGraphBuilder.java?rev=1462923&r1=1462922&r2=1462923&view=diff
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/DefaultDependencyGraphBuilder.java
(original)
+++ maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/DefaultDependencyGraphBuilder.java
Sun Mar 31 10:57:08 2013
@@ -75,7 +75,7 @@ public class DefaultDependencyGraphBuild
     {
         try
         {
-            Class.forName( "org.apache.maven.project.DependencyResolutionRequest" ); // Maven
3 specific
+            Thread.currentThread().getContextClassLoader().loadClass( "org.apache.maven.project.DependencyResolutionRequest"
); // Maven 3 specific
 
             return false;
         }

Modified: maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/Java7Support.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/Java7Support.java?rev=1462923&r1=1462922&r2=1462923&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/Java7Support.java
(original)
+++ maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/Java7Support.java
Sun Mar 31 10:57:08 2013
@@ -42,8 +42,8 @@ public class Java7Support
         boolean isJava7x = true;
         try
         {
-            Class<?> files = Class.forName( "java.nio.file.Files" );
-            Class<?> path = Class.forName( "java.nio.file.Path" );
+            Class<?> files = Thread.currentThread().getContextClassLoader().loadClass(
"java.nio.file.Files" );
+            Class<?> path = Thread.currentThread().getContextClassLoader().loadClass(
"java.nio.file.Path" );
             isSymbolicLink = files.getMethod( "isSymbolicLink", path );
             toPath = File.class.getMethod( "toPath" );
         } catch (ClassNotFoundException e)

Modified: maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java?rev=1462923&r1=1462922&r2=1462923&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java
(original)
+++ maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java
Sun Mar 31 10:57:08 2013
@@ -131,7 +131,7 @@ public class Xpp3DomBuilder
     private static XMLReader instantiate( String s ){
         try
         {
-            Class<?> aClass = Class.forName(  s );
+            Class<?> aClass = Thread.currentThread().getContextClassLoader().loadClass(
s );
             return (XMLReader) aClass.newInstance();
         }
         catch ( ClassNotFoundException e )



Mime
View raw message