maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject git commit: o More jdk1.5 migration
Date Fri, 12 Apr 2013 17:26:04 GMT
Updated Branches:
  refs/heads/master 5dbb88844 -> a883a3afc


o More jdk1.5 migration


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/a883a3af
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/a883a3af
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/a883a3af

Branch: refs/heads/master
Commit: a883a3afc98377930bf1de22aa086f4c5746e300
Parents: 5dbb888
Author: Kristian Rosenvold <krosenvold@apache.org>
Authored: Fri Apr 12 19:26:01 2013 +0200
Committer: Kristian Rosenvold <krosenvold@apache.org>
Committed: Fri Apr 12 19:26:01 2013 +0200

----------------------------------------------------------------------
 .../apache/maven/surefire/booter/JdkReflector.java |   64 ---------------
 .../apache/maven/surefire/booter/Classpath.java    |    9 +-
 2 files changed, 4 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a883a3af/surefire-api/src/main/java/org/apache/maven/surefire/booter/JdkReflector.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/booter/JdkReflector.java
b/surefire-api/src/main/java/org/apache/maven/surefire/booter/JdkReflector.java
deleted file mode 100644
index cf1eb54..0000000
--- a/surefire-api/src/main/java/org/apache/maven/surefire/booter/JdkReflector.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.apache.maven.surefire.booter;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import org.apache.maven.surefire.util.NestedRuntimeException;
-import org.apache.maven.surefire.util.ReflectionUtils;
-
-/**
- * Does reflection based invocation of misc jdk method
- * <p/>
- *
- * @author Kristian Rosenvold
- */
-public class JdkReflector
-{
-    private final Method assertionStatusMethod;
-
-
-    public JdkReflector()
-    {
-        assertionStatusMethod = ReflectionUtils.tryGetMethod( ClassLoader.class, "setDefaultAssertionStatus",
-                                                              new Class[]{ boolean.class
} );
-    }
-
-    public void invokeAssertionStatusMethod( ClassLoader classLoader, boolean enableAssertions
)
-    {
-        if ( assertionStatusMethod != null )
-        {
-            try
-            {
-                Object[] args = new Object[]{ enableAssertions ? Boolean.TRUE : Boolean.FALSE
};
-                assertionStatusMethod.invoke( classLoader, args );
-            }
-            catch ( IllegalAccessException e )
-            {
-                throw new NestedRuntimeException( "Unable to access the assertion enablement
method", e );
-            }
-            catch ( InvocationTargetException e )
-            {
-                throw new NestedRuntimeException( "Unable to invoke the assertion enablement
method", e );
-            }
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a883a3af/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
index 93c3f00..a667a9c 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
@@ -35,7 +35,6 @@ import java.util.List;
  */
 public class Classpath
 {
-    private static final JdkReflector jdkReflector = new JdkReflector();
 
     public static Classpath join( Classpath firstClasspath, Classpath secondClasspath )
     {
@@ -92,12 +91,12 @@ public class Classpath
         }
     }
 
-    public List getClassPath()
+    public List<String> getClassPath()
     {
         return Collections.unmodifiableList( elements );
     }
 
-    public List getAsUrlList()
+    public List<URL> getAsUrlList()
         throws MalformedURLException
     {
         List<URL> urls = new ArrayList<URL>();
@@ -151,9 +150,9 @@ public class Classpath
             }
             if ( parent != null )
             {
-                jdkReflector.invokeAssertionStatusMethod( parent, enableAssertions );
+                parent.setDefaultAssertionStatus( enableAssertions );
             }
-            jdkReflector.invokeAssertionStatusMethod( classLoader, enableAssertions );
+            classLoader.setDefaultAssertionStatus( enableAssertions );
             return classLoader;
         }
         catch ( MalformedURLException e )


Mime
View raw message