mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 06:17:44 +00:00
Renamed EclipseParserPatcher to EclipsePatcher, as it patches not just the parser, but also the CompilationUnitDeclaration class so we can store our AST in it for caching purposes.
This commit is contained in:
1 parent
7bbf7789f8
commit
00452d0e95
2 files changed
+5
-5
No files matched your search
@@ -78,7 +78,7 @@
|
||||
</jar>
|
||||
<jar basedir="build/eclipse.agent" destfile="dist/lombok.eclipse.agent-${lombok.version}.jar">
|
||||
<manifest>
|
||||
<attribute name="Premain-Class" value="lombok.eclipse.agent.EclipseParserPatcher" />
|
||||
<attribute name="Premain-Class" value="lombok.eclipse.agent.EclipsePatcher" />
|
||||
<attribute name="Can-Redefine-Classes" value="true" />
|
||||
</manifest>
|
||||
</jar>
|
||||
|
||||
@@ -14,8 +14,8 @@ import java.util.jar.JarFile;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class EclipseParserPatcher {
|
||||
private EclipseParserPatcher() {}
|
||||
public class EclipsePatcher {
|
||||
private EclipsePatcher() {}
|
||||
|
||||
private static class Patcher implements ClassFileTransformer {
|
||||
@Override public byte[] transform(ClassLoader loader, String className,
|
||||
@@ -71,10 +71,10 @@ public class EclipseParserPatcher {
|
||||
}
|
||||
|
||||
private static String findPathOfOurClassloader() throws Exception {
|
||||
ClassLoader loader = EclipseParserPatcher.class.getClassLoader();
|
||||
ClassLoader loader = EclipsePatcher.class.getClassLoader();
|
||||
if ( loader == null ) loader = ClassLoader.getSystemClassLoader();
|
||||
|
||||
URI uri = loader.getResource(EclipseParserPatcher.class.getName().replace('.', '/') + ".class").toURI();
|
||||
URI uri = loader.getResource(EclipsePatcher.class.getName().replace('.', '/') + ".class").toURI();
|
||||
Pattern p = Pattern.compile("^jar:file:([^\\!]+)\\!.*\\.class$");
|
||||
Matcher m = p.matcher(uri.toString());
|
||||
if ( !m.matches() ) return ".";
|
||||
|
||||
Reference in new issue
Block a user