Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion javassist-maven-plugin-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Copy link
Owner

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

<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion javassist-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Copy link
Owner

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

<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why defrost twice?

Copy link
Owner

Choose a reason for hiding this comment

The 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();

Expand Down Expand Up @@ -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;

Expand All @@ -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);
}
Expand Down