apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.63k stars 841 forks source link

Cannot call clone() method on native arrays during debug #7638

Open dyorgio opened 1 month ago

dyorgio commented 1 month ago

Apache NetBeans version

Apache NetBeans 22

What happened

Cannot call clone method on native arrays during debug session (watcher/expression)

Language / Project Type / NetBeans Component

Java Debugger

How to reproduce

Starts java program in debug mode and try to call clone on a native array variable.

Did this work correctly in an earlier version?

No / Don't know

Operating System

macOS

JDK

Azul Zulu 21

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

matthiasblaesing commented 1 month ago

What is a "native array variable"? What happens? What do you expect?

dyorgio commented 1 month ago

hi @matthiasblaesing

I believe that problem is in this line:

https://github.com/apache/netbeans/blob/03aa32d15aba53f980e095b1a8efa6700c515331/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java#L443

Any method could be called in a native array reference.... but I believe that some methods may be enabled, like: toString, equals, hashcode and clone right?

matthiasblaesing commented 1 month ago

@dyorgio you need to provide steps to reproduce. That includes necessary sample source. At this point I have zero idea what you are talking about.

dyorgio commented 1 month ago

Sorry, sometimes it is clear in your mind, but not outside 😝

here:

Captura de Tela 2024-08-05 às 16 11 05
matthiasblaesing commented 1 month ago

That makes more sense. Thank you