matthiasblaesing commented on code in PR #7972:
URL: https://github.com/apache/netbeans/pull/7972#discussion_r1847168788
##########
java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/CallStackFrameImpl.java:
##########
@@ -314,7 +314,11 @@ private synchronized void initStrata() {
} else {
// Check Nashorn:
String sourcePath = getSourcePath(null);
- if (sourcePath.startsWith("jdk/nashorn/internal/scripts/") ||
// NOI18N
+ if
(sourcePath.startsWith("org/openjdk/nashorn/internal/scripts/") || //
NOI18N
+
sourcePath.startsWith("org\\openjdk\\nashorn\\internal\\scripts\\")) { //
NOI18N
+ s = "JS";
// NOI18N
+ as = Collections.singletonList(s);
+ } else if
(sourcePath.startsWith("jdk/nashorn/internal/scripts/") || // NOI18N
Review Comment:
Nitpick: There is no real reason for two if blocks. It might be helpful for
future readers to adjust line 315 to read "Check Nashorn (as part of JDK and
independent distribution)".
```suggestion
if
(sourcePath.startsWith("org/openjdk/nashorn/internal/scripts/") || //
NOI18N
sourcePath.startsWith("org\\openjdk\\nashorn\\internal\\scripts\\") || //
NOI18N
sourcePath.startsWith("jdk/nashorn/internal/scripts/")
|| // NOI18N
```
##########
java/debugger.jpda.js/src/org/netbeans/modules/debugger/jpda/js/vars/JSVariable.java:
##########
@@ -101,7 +101,7 @@ public static JSVariable createIfScriptObject(JPDADebugger
debugger, ObjectVaria
if (classType == null) {
return null;
}
- boolean isScript =
classType.isInstanceOf("jdk.nashorn.internal.runtime.ScriptObject"); // NOI18N
+ boolean isScript =
classType.isInstanceOf("org.openjdk.nashorn.internal.runtime.ScriptObject"); //
NOI18N
Review Comment:
Missing OR?
```suggestion
boolean isScript =
classType.isInstanceOf("jdk.nashorn.internal.runtime.ScriptObject") || //
NOI18N
classType.isInstanceOf("org.openjdk.nashorn.internal.runtime.ScriptObject"); //
NOI18N
```
##########
java/debugger.jpda.js/src/org/netbeans/modules/debugger/jpda/js/vars/JSVariable.java:
##########
@@ -52,7 +52,7 @@ protected JSVariable(JPDADebugger debugger, Variable
valueInfoDesc) {
JPDAClassType classType = ((ObjectVariable)
valueObjectVar).getClassType();
if (classType != null) {
String className = classType.getName();
- if (!className.startsWith("jdk.nashorn") &&
!String.class.getName().equals(className)) { // NOI18N
+ if (!!className.startsWith("jdk.nashorn") &&
!className.startsWith("org.openjdk.nashorn") &&
!String.class.getName().equals(className)) { // NOI18N
Review Comment:
The value of first condition was inverted. I assume this was meant:
```suggestion
if (!className.startsWith("jdk.nashorn") &&
!className.startsWith("org.openjdk.nashorn") &&
!String.class.getName().equals(className)) { // NOI18N
```
##########
java/debugger.jpda.js/src/org/netbeans/modules/debugger/jpda/js/StepIntoJSHandler.java:
##########
@@ -64,7 +64,7 @@
@LazyActionsManagerListener.Registration(path="netbeans-JPDASession/Java")
public class StepIntoJSHandler extends LazyActionsManagerListener implements
PropertyChangeListener {
- private static final String SCRIPT_ACCESS_CLASS =
"jdk.nashorn.internal.runtime.ScriptFunctionData"; // NOI18N
+ private static final String SCRIPT_ACCESS_CLASS =
"org.openjdk.nashorn.internal.runtime.ScriptFunctionData"; // NOI18N
Review Comment:
If I'm not mistaken, this also need to be duplicated so that both in-jdk and
external nashorn are supported.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists