-
Notifications
You must be signed in to change notification settings - Fork 139
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
IrritantSet needs unsigned right shift for GROUP4 and higher #2006
Comments
TODO: Remove after eclipse-jdt/eclipse.jdt.core#2006 fix. Signed-off-by: Alexander Kriegisch <[email protected]>
Needs eclipse-aspectj/eclipse.jdt.core#ed6050bb. See also eclipse-jdt/eclipse.jdt.core#2006. Signed-off-by: Alexander Kriegisch <[email protected]>
@stephan-herrmann , thanks for following up |
once more, AspectJ and Object Teams are in the same boat, see https://gitlab.eclipse.org/eclipse/objectteams/objectteams/-/commit/f7e999fd8596154ec814bbb706924571f355e178?page=4#a2886c9b208acdadf0499f59322c3382a041c832_302_304 The signed overflow only occurs once group 4 is used, because that's when the high-bit ( JDT hasn't yet reached this situation. So, feel free to apply that change in AspectJ with or without quoting my authorship :) |
Hi @stephan-herrmann. Thanks for the qualified feedback with valuable information. Let me recap the situation from my personal perspective, simultaneously asking you to reconsider and fix the bug upstream:
I.e., it is a (known!) bug in JDT Core. Why would you refuse to fix it there? Imagine, in 3 or 7 years JDT Core starts using group 4. Someone else than you spends debugging time for a third time and fixes the problem once more. Then, all forks sync the change and maybe have to refactor to adjust to a slightly different way this is done, e.g. the 4 right-shift operations being factored out into an extra method (just making up an example). Does that make much sense? Is is economic in the efficiency and effectiveness sense? The bug is there, and the class header explicitly states that the class is designed to use up to 8 groups. Lines 29 to 30 in a9231ed
Lines 39 to 48 in a9231ed
Why not fix it now? Then the next fellow developer could just "reveal subsequent groups as needed" instead of fixing a bug unknown to him but known to multiple forks afterwards. |
@kriegaex you beat me to it: meanwhile I, too, had thoughts of reframing the discussion: on the one hand, there is no wrong behaviour in JDT at this point, so if we call it a bug, it's dormant to this point. OTOH, I would need to promise that I will take care the very moment JDT opens GROUP4, but at that distant point of future I may no longer be aware/around. So, yes I will reopen in order to make this part of the implementation safe for the future. Historical note: I vaguely remember a discussion with Philippe Mulet (!) back in 2008, when Object Teams was the first to break the previous barrier of 64 irritants :) So - yes - we language extenders are driving things now and then. |
fixes #2006 * Apply the correct shift operator * Add a test which will start running once IrritantSet.GROUP4 is enabled in JDT
…-jdt#2029) fixes eclipse-jdt#2006 * Apply the correct shift operator * Add a test which will start running once IrritantSet.GROUP4 is enabled in JDT
…-jdt#2029) fixes eclipse-jdt#2006 * Apply the correct shift operator * Add a test which will start running once IrritantSet.GROUP4 is enabled in JDT
…-jdt#2029) fixes eclipse-jdt#2006 * Apply the correct shift operator * Add a test which will start running once IrritantSet.GROUP4 is enabled in JDT
…-jdt#2029) fixes eclipse-jdt#2006 * Apply the correct shift operator * Add a test which will start running once IrritantSet.GROUP4 is enabled in JDT
@stephan-herrmann: Lately, you activated
IrritantSet.GROUP3
in commit 4989c7f:eclipse.jdt.core/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java
Lines 39 to 48 in 8004cb6
Because AspectJ fork already used
GROUP3
before, I moved our group up toGROUP4
. But now, methods likeeclipse.jdt.core/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java
Lines 289 to 293 in 8004cb6
yield
group
indexes of -4 instead of the expected positive value, leading to index-out-of-bounds exceptions. I am not sure it is 100% correct, but changing all right shift operations to unsigned right shift seems to solve the problem.Please, consider this patch and tell me if it is correct. I do not know the code at all, I am not sure. But if so, feel free to commit and just add
Co-authored-by: Alexander Kriegisch <[email protected]>
to the commit message. I am currently busy on another branch and cannot easily create a PR.The text was updated successfully, but these errors were encountered: