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

identityHashCode(this) returns randomly negative values causing exception. #121

Open
roizpi opened this issue Dec 7, 2016 · 1 comment

Comments

@roizpi
Copy link

roizpi commented Dec 7, 2016

Reported Class name: GroovyContentHandlerFactory.java

The failure scenario is as follows:

Being the generated name: SmooksVisitor_-194858501_3, its returned hash value is sometimes negative (others not), throwing the following exception:

org.milyn.cdr.SmooksConfigurationException: Error constructing class from Groovy script

This seems to be related with the environment running over Linux.

The code causing the problem is:
private synchronized String createClassName() {
StringBuilder className = new StringBuilder();

className.append("SmooksVisitor_");
// This line gives random positive or negative values. At least over Linux.
className.append(System.identityHashCode(this));
className.append("_");
className.append(classGenCount++);

return className.toString();
}

@roizpi
Copy link
Author

roizpi commented Dec 7, 2016

This may help fixing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant