-
Notifications
You must be signed in to change notification settings - Fork 321
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
use reflection to read perprojectinfo.rootPathToResolvedEntries #3124
Conversation
It is really not sufficient just to use? Just wondering...
|
d90c16c
to
7e7ff86
Compare
org.eclipse.xtext.xbase.ui/src/org/eclipse/xtext/xbase/ui/validation/XbaseUIValidator.java
Outdated
Show resolved
Hide resolved
Any reason to hold this PR open? |
i need a review |
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.
LGTM :-)
} | ||
|
||
return result; | ||
} | ||
|
||
|
||
protected final boolean isJdtCoreVersionAtLeast3390 = JavaCore.getPlugin().getBundle().getVersion().compareTo(new Version(3, 39, 0)) >= 0; |
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.
Is there any reason why this isn't a private static final constant? I know it's nit picky, but I'm just wondering?
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.
in case somebody wants to override the method below
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.
That's a reason for making it protected. Why not make it static?
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.
The validator is very long-living (one instance per Xbase language that is installed). I don't mind making this static or not, but it won't make much of a difference.
protected Map<IPath, IClasspathEntry> getRootPathToResolvedEntries(PerProjectInfo info) { | ||
if (isJdtCoreVersionAtLeast3390) { | ||
try { | ||
Method m = PerProjectInfo.class.getDeclaredMethod("getRootPathToResolvedEntries"); |
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.
Nit:
We could you MethodHandles.findGetter and MethodHandles.findVirtual to obtain a MethodHandle once and use that throughout the lifecyle of this class.
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.
am not familiar with that api
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.
#3128
something like this?
Signed-off-by: Christian Dietrich <[email protected]>
Signed-off-by: Sebastian Zarnekow <[email protected]>
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.
I'm fine with the PR, but I seem to understand that this one is superseded by #3128 is that right?
no the other one is pred against this. so i will chain merge once the builds are through |
use method handles for reflection
See eclipse/Xpect#353 #3123