-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a non-delegating class loader to support transforming classes wit…
…h same name as JRE's built-in classes Fixes #29
- Loading branch information
Showing
5 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
end-to-end-tests/src/test/java/com/sun/javafx/application/LauncherImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright © 2013-2014 Esko Luontola <www.orfjackal.net> | ||
// This software is released under the Apache License 2.0. | ||
// The license text is at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
package com.sun.javafx.application; | ||
|
||
import net.orfjackal.retrolambda.test.ClasspathTest; | ||
|
||
/** | ||
* @see ClasspathTest#prefers_classes_in_explicit_classpath_over_classes_in_the_JRE | ||
*/ | ||
@SuppressWarnings("UnusedDeclaration") | ||
public class LauncherImpl { | ||
|
||
public Runnable foo() { | ||
return () -> { | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
retrolambda/src/main/java/net/orfjackal/retrolambda/NonDelegatingClassLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright © 2013-2014 Esko Luontola <www.orfjackal.net> | ||
// This software is released under the Apache License 2.0. | ||
// The license text is at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
package net.orfjackal.retrolambda; | ||
|
||
import java.net.*; | ||
|
||
public class NonDelegatingClassLoader extends URLClassLoader { | ||
|
||
public NonDelegatingClassLoader(URL[] urls) { | ||
super(urls); | ||
} | ||
|
||
@Override | ||
public Class<?> loadClass(String name) throws ClassNotFoundException { | ||
Class<?> c = findLoadedClass(name); | ||
if (c != null) { | ||
return c; | ||
} | ||
try { | ||
return findClass(name); | ||
} catch (ClassNotFoundException e) { | ||
return super.loadClass(name); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters