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

Compatibility fix for jdk 1.7 regarding sun.awt.X11GraphicsEnvironment #6

Closed
duns opened this issue Sep 26, 2012 · 1 comment
Closed
Milestone

Comments

@duns
Copy link
Member

duns commented Sep 26, 2012

There is a problem in freehep-vectorgraphics
(org.freehep.graphics2d.PixelGraphics2D class) that was recently reported by
dCache people - they ran into it once they switched to jdk1.7.

isDisplayLocal() in the sun.awt.X11GraphicsEnvironment implementation is now
an instance rather than a static method, and thus cannot be called via
reflection with the first parameter of the Method.invoke(.) method being
null. I attach a patch that fixes it.

@duns
Copy link
Member Author

duns commented Sep 26, 2012

# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
100,102c100,105
<             Method method = clazz.getMethod("isDisplayLocal", null);
<             Boolean result = (Boolean) method.invoke(null, null);
<             displayLocal = result.booleanValue();
---
>             Method method = clazz.getMethod("isDisplayLocal");
>             try {
>               displayLocal = (Boolean) method.invoke(clazz.newInstance()); // since JDK 1.7
>             } catch (InstantiationException x) {
>               displayLocal = (Boolean) method.invoke(null);
>             }

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

No branches or pull requests

1 participant