-
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
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 ? |
d42cd43
to
d0cc028
Compare
please update review if you still plan to finish review
d0cc028
to
46e0b07
Compare
updated possible changes as per review |
@@ -47,11 +47,12 @@ public class HotCodeReplaceErrorDialog extends ErrorDialogWithToggle { | |||
/** | |||
* Creates a new dialog which can terminate, disconnect or restart the given debug target. | |||
* | |||
* @param target the debug target | |||
* @see ErrorDialogWithToggle#ErrorDialogWithToggle(Shell, String, String, IStatus, String, String, IPreferenceStore) | |||
* @param target |
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.
javadoc should either document all parameters or none.
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.
Only auto format was applied here. seems like an existing doc typo. I have cleared the single param now.
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaHotCodeReplaceListener.java
Outdated
Show resolved
Hide resolved
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
* | ||
* @return boolean | ||
*/ | ||
public boolean getHcrDebugErrorPref() { |
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.
a getter that returns a boolean could also be name "is"Something i.e. istHcrDebugErrorPref()
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.
Okay, renamed it. thanks
i did not see any issue that prevent from merging today. |
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
46e0b07
to
888bb7b
Compare
Thank you @jukzi and @iloveeclipse |
@SougandhS thanks for bringing this forward. One thing I noticed from the screenshot is that it now looks a bit like a child of the other checkbox so maybe align them on the left? |
Sure, will do the suggested alignment in another PR 👍 |
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