-
Notifications
You must be signed in to change notification settings - Fork 49
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
Ignore HCR Failures for current session #347 #558
base: master
Are you sure you want to change the base?
Conversation
Hi @jukzi , |
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaHotCodeReplaceListener.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ErrorDialogWithToggle.java
Outdated
Show resolved
Hide resolved
As this seems to be new feature can it wait for M1? |
Yeah sure, no problem 👍 |
d780561
to
1a41681
Compare
1a41681
to
34717d0
Compare
This pull request changes some projects for the first time in this development cycle.
An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patch
Further information are available in Common Build Issues - Missing version increments. |
Hi @jukzi , can you try committing again ? |
/** | ||
* Preference storage for active debug session. | ||
*/ | ||
public static final Map<String, Object> debugSessionVariables = new ConcurrentHashMap<>(); |
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.
Wjy is this a static map and why it is a map at all? If with the the "session" the whole Eclipse session meant, no map is needed, a Boolean flag will be enough. If with the "session" a specific debug session meant, the code is plain wrong as it would affect all other debug sessions runnijg in parallel or after the current one.
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.
This can be used to store pref values only for current debug session. other pref values can also be added.
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.
other pref values in the sense other features preferences value only for current debug session in future if it requires.
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.
This can be used to store pref values only for current debug session
Then a static map is wrong. Try to start two sessions in parallel.
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.
other pref values in the sense other features preferences value only for current debug session in future if it requires.
If future requires, the code can be refactored.
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.
will remove static then.
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.
other pref values in the sense other features preferences value only for current debug session in future if it requires.
If future requires, the code can be refactored.
will replace it with boolean flag as you suggested since its more appropriate.
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 wasnt able to check without static but now I have modified it further to make it more debug sessions specific.
- Tested with parallel debug launches
024d81c
to
fe1273b
Compare
ba0149c
to
42d462f
Compare
@@ -43,25 +47,37 @@ public class ErrorDialogWithToggle extends ErrorDialog { | |||
/** | |||
* The message displayed to the user, with the toggle button | |||
*/ | |||
private String fToggleMessage= null; | |||
private String fToggleMessage1 = null; |
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.
Style: please don't initialize fields to default values, java does it automatically, but during debugging you will jump from field to field just because of this meaningless instructions here.
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.
will remove default initialization
fStore.setValue(fPreferenceKey, !getToggleButton().getSelection()); | ||
if (fToggleButton2 != null) { | ||
try { | ||
JDIDebugTarget.hcrDebugSessionErrors.put(target.getName(), fToggleButton2.getSelection()); |
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.
This is inappropriate place / dependency. The ErrorDialogWithToggle
has no relationship to JDIDebugTarget
and shouldn't have.
The HotCodeReplaceErrorDialog
class that extends this dialog is the right place for HCR related code.
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.
Yes, but I couldn't find any ways to access same from JavaHotCodeReplaceListener class, which checks the boolean value.
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.
for every HCR failures a new instance of HotCodeReplaceErrorDialog
created for the current launch, so JDIDebugTarget is leveraged for checking the boolean as it is same for the launches
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ErrorDialogWithToggle.java
Show resolved
Hide resolved
org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java
Outdated
Show resolved
Hide resolved
47e421d
to
c40c922
Compare
c40c922
to
ce76980
Compare
ce76980
to
d42cd43
Compare
Hi @iloveeclipse, could u please check this again when u have time ? |
Is it possible to include this in M2 ? |
Adds a checkbox to the HCR error alert box that allows users to ignore HCR failures only for the current debug session, rather than applying it to all future debug sessions. Fixes : eclipse-jdt#347
d42cd43
to
d0cc028
Compare
please update review if you still plan to finish review
Enhancement : #347
Adds a checkbox to the HCR error alert box that allows users to ignore HCR failures only for the current debug session, rather than applying it to all future debug sessions.
Fixes : #347
What it does
How to test
Author checklist