-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added defrost force flag for processing 3rd grade dependent class files #6
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
<parent> | ||
<groupId>nl.topicus.plugins</groupId> | ||
<artifactId>javassist-maven-plugin-parent</artifactId> | ||
<version>2.2-SNAPSHOT</version> | ||
<version>2.2.1-SNAPSHOT</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make this 2.2-SNAPSHOT |
||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,9 @@ public class JavassistMojo extends AbstractMojo implements ILogger { | |
@Parameter(property = "exclusions") | ||
private List<String> exclusions; | ||
|
||
@Parameter(property = "forceDefrost") | ||
private boolean forceDefrost; | ||
|
||
@Parameter(property = "outputDirectory", defaultValue = "${project.build.outputDirectory}") | ||
private String outputDirectory; | ||
|
||
|
@@ -127,6 +130,11 @@ public final void transform(final List<String> classPaths) | |
|
||
public void writeFile(CtClass candidateClass, String targetDirectory) | ||
throws Exception { | ||
if (forceDefrost) { | ||
error("FORCE DEFROSTING "+candidateClass.getName()); | ||
candidateClass.defrost(); | ||
candidateClass.defrost(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why defrost twice? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code will never be reached as line 98 checks for frozen classes. |
||
} | ||
candidateClass.getClassFile().compact(); | ||
candidateClass.rebuildClassFile(); | ||
|
||
|
@@ -212,7 +220,7 @@ private List<URL> generateClassPathUrls(Iterable<String> classpathElements) { | |
} | ||
|
||
private void loadClassPath(final ClassLoader contextClassLoader, | ||
final List<URL> urls) { | ||
final List<URL> urls) { | ||
if (urls.size() <= 0) | ||
return; | ||
|
||
|
@@ -231,7 +239,7 @@ private URL resolveUrl(final String resource) { | |
|
||
@Override | ||
public void addMessage(File file, int line, int pos, String message, | ||
Throwable e) { | ||
Throwable e) { | ||
buildContext.addMessage(file, line, pos, message, | ||
BuildContext.SEVERITY_ERROR, e); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this 2.2-SNAPSHOT