You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since latest version of Eclipse (I'd say at least 2021-12), I am under the impression that Eclipse fails at inspecting the context of variable/evaluating/properly displaying the *.class I am stepping into.
This affects expressions and conditional breakpoints since the context is being used to compile conditional expressions: the debugger is practically useless without those.
The screenshot below provides 4 examples of problem with the debug mode, from which I fail to understand why it fails while it was not:
Screenshot
Description
a Tomcat 8.5 Server launch and Spring 5 (no spring boot)
a JUnit 3 unit test with Spring 3 (sic)
a JUnit 4 unit test for issue HHH-15142; we can see the breadcumb and local variables being lost
same project as eclipse_no_debug_context_03.png; unlike before, the local variables are resolved;
In all these screenshot, we can see the breadcumb not displaying the enclosing type/file: this is strange because the editor title is properly set, and the window title also references the JAR from which the source file comes (but I don't know if it should read "junit-4.13.2-sources.jar" and not "junit-4.13.2.jar".
The first two screenshot were taken from a work related project which I can't attach here.
In Eclipse, go to File > Import > Import Maven project
Browse to where GIT repository was cloned
Go to type org.hibernate.query.spi.QueryParameterBindingValidator and put a breakpoint at line 53 where the "Parameter value [%s] did not match expected type [%s (%s)]" should be.
Put a breakpoint to org.hibernate.query.spi.QueryParameterBindingValidator line 53
Go to JPAUnitTestCase
Run it as JUnit 4 test (the default F11 will try to use JUnit Jupiter and find nothing)
Wait for Eclipse to switch/ask to use Debug perspective
Navigate the stack trace
The table below shows when it fails: some JAR are from Maven, while other are from Eclipse bundle.
I don't understand the rational that explain why the first one is a PackageFragmentRootSourceContainer, which works, and the last fails (ExternalArchiveSourceContainer), but I find it strange for it to reference the sources.jar rather than the jar itself.
The ExternalArchiveSourceContainer is used when importing project as Maven and as "simple" Java project :
I transformed the reproducer project of https://github.com/schauder/issue-HHH-15142 into a "simple Java project" (eg: not a "Import as Maven project") : it is present here, but without its JAR dependencies (= 44M)
Clone the referenced project: git clone https://github.com/glhez/issue-HHH-15142.git
In a terminal, go the directory and execute maven:
Once done, the project and its launch (JPAUnitTestCase.launch) can be imported in Eclipse using "Import Java Project" (not "Maven Project").
We can see the same problem, perhaps not at the same location since I can browse Hibernate finely : this happens in the JUNIT 4 part:
There are
no debug information in expressions, which is another (frustrating) problem I have with Eclipse, since it should know the project from which a launch comes
no information while hovering the junit 4 class
I did not try conditional breakpoint, but I think they would fail because "There a no java context".
Versions:
Java 17 + Eclipse 2022-03 Eclipse 2022-06
M2E - Maven Integration for Eclipse (includes Incubating components) 1.20.1.20220227-1319 org.eclipse.m2e.feature.feature.group Eclipse.org - m2e
M2E - POM Editor using LemMinX language server (includes Incubating components) 1.18.4.20220127-1634 org.eclipse.m2e.lemminx.feature.feature.group Eclipse.org - m2e
M2E - SLF4J over Logback Logging (optional) 1.17.2.20211002-1029 org.eclipse.m2e.logback.feature.feature.group Eclipse.org - m2e
The Eclipse installation has been installed using Oomph and Eclipse 2022-06 as its base.
Hello,
Since latest version of Eclipse (I'd say at least 2021-12), I am under the impression that Eclipse fails at inspecting the context of variable/evaluating/properly displaying the *.class I am stepping into.
This affects expressions and conditional breakpoints since the context is being used to compile conditional expressions: the debugger is practically useless without those.
The screenshot below provides 4 examples of problem with the debug mode, from which I fail to understand why it fails while it was not:
In all these screenshot, we can see the breadcumb not displaying the enclosing type/file: this is strange because the editor title is properly set, and the window title also references the JAR from which the source file comes (but I don't know if it should read "junit-4.13.2-sources.jar" and not "junit-4.13.2.jar".
The first two screenshot were taken from a work related project which I can't attach here.
The last two screenshots were taken using the sample project from issue HHH-15142 (https://github.com/schauder/issue-HHH-15142 and spring-projects/spring-data-jpa#2472):
org.hibernate.query.spi.QueryParameterBindingValidator
and put a breakpoint at line 53 where the "Parameter value [%s] did not match expected type [%s (%s)]" should be.org.hibernate.query.spi.QueryParameterBindingValidator
line 53JPAUnitTestCase
The table below shows when it fails: some JAR are from Maven, while other are from Eclipse bundle.
QueryParameterBindingValidator.validate(Type, Object, TemporalType) line: 53
QueryParameterBindingValidator.validate(Type, Object) line: 27
QueryParameterBindingImpl<T>.validate(T) line: 90
QueryParameterBindingImpl<T>.setBindValue(T) line: 55
QueryImpl<R>(AbstractProducedQuery<R>).setParameter(String, Object) line: 501
QueryImpl<R>(AbstractProducedQuery<R>).setParameter(String, Object) line: 122
CriteriaCompiler$1$1.bind(TypedQuery) line: 141
CriteriaQueryImpl$1.buildCompiledQuery(SharedSessionContractImplementor, InterpretedParameterMetadata) line: 364
CriteriaCompiler.compile(CompilableCriteria) line: 171
SessionImpl(AbstractSharedSessionContract).createQuery(CriteriaQuery<T>) line: 774
SessionImpl(AbstractSessionImpl).createQuery(CriteriaQuery) line: 23
JPAUnitTestCase.hhh123Test() line: 65
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 498
FrameworkMethod$1.runReflectiveCall() line: 59
FrameworkMethod$1(ReflectiveCallable).run() line: 12
FrameworkMethod.invokeExplosively(Object, Object...) line: 56
InvokeMethod.evaluate() line: 17
RunBefores.evaluate() line: 26
RunAfters.evaluate() line: 27
ParentRunner$3.evaluate() line: 306
BlockJUnit4ClassRunner$1.evaluate() line: 100
JUnit4(ParentRunner<T>).runLeaf(Statement, Description, RunNotifier) line: 366
JUnit4(BlockJUnit4ClassRunner).runChild(FrameworkMethod, RunNotifier) line: 103
JUnit4(BlockJUnit4ClassRunner).runChild(Object, RunNotifier) line: 63
ParentRunner$4.run() line: 331
ParentRunner$1.schedule(Runnable) line: 79
JUnit4(ParentRunner<T>).runChildren(RunNotifier) line: 329
ParentRunner<T>.access$100(ParentRunner, RunNotifier) line: 66
ParentRunner$2.evaluate() line: 293
ParentRunner$3.evaluate() line: 306
JUnit4(ParentRunner<T>).run(RunNotifier) line: 413
JUnit4TestReference.run(TestExecution) line: 93
TestExecution.run(ITestReference[]) line: 40
RemoteTestRunner.runTests(String[], String, TestExecution) line: 529
RemoteTestRunner.runTests(TestExecution) line: 756
RemoteTestRunner.run() line: 452
RemoteTestRunner.main(String[]) line: 210
When I right click on a method in the stacktrace, I do have the "Source lookup info" (which to my understanding of
plugin.xml
comes from m2e-core, and especially this class: https://github.com/eclipse-m2e/m2e-core/blob/4e7ba8113e8cff1d84a05918addd8c27a108d591/org.eclipse.m2e.sourcelookup.ui/src/org/eclipse/m2e/sourcelookup/ui/internal/OpenSourceLookupInfoDialogCommandHandler.java )The information it returns shows there are 3 kind of source containers:
I don't understand the rational that explain why the first one is a
PackageFragmentRootSourceContainer
, which works, and the last fails (ExternalArchiveSourceContainer
), but I find it strange for it to reference the sources.jar rather than the jar itself.The
ExternalArchiveSourceContainer
is used when importing project as Maven and as "simple" Java project :git clone https://github.com/glhez/issue-HHH-15142.git
We can see the same problem, perhaps not at the same location since I can browse Hibernate finely : this happens in the JUNIT 4 part:
There are
I did not try conditional breakpoint, but I think they would fail because "There a no java context".
Versions:
Java 17 +
Eclipse 2022-03Eclipse 2022-06M2E - Maven Integration for Eclipse (includes Incubating components) 1.20.1.20220227-1319 org.eclipse.m2e.feature.feature.group Eclipse.org - m2e
M2E - POM Editor using LemMinX language server (includes Incubating components) 1.18.4.20220127-1634 org.eclipse.m2e.lemminx.feature.feature.group Eclipse.org - m2e
M2E - SLF4J over Logback Logging (optional) 1.17.2.20211002-1029 org.eclipse.m2e.logback.feature.feature.group Eclipse.org - m2e
The Eclipse installation has been installed using Oomph and Eclipse 2022-06 as its base.
Note: I originally created the bug here https://bugs.eclipse.org/bugs/show_bug.cgi?id=579535 without much updates on it.
The text was updated successfully, but these errors were encountered: