Skip to content

Commit a0d53fa

Browse files
SarikaSinhatrancexpressmickaelistriaditi0023jukzi
authored
Merge Master to Beta Java 21 (#286)
* Remove use of OPTION_JdtDebugCompileMode with OPTION_IgnoreUnnamedModuleForSplitPackage This change replaces use of OPTION_JdtDebugCompileMode with OPTION_IgnoreUnnamedModuleForSplitPackage, since the latter does what we need better and doesn't cause the side effects that the first option causes. Goal is to later on remove OPTION_JdtDebugCompileMode in JDT core. Fixes: #260 Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com> * Detect JVM installs at startup (#231) * Detect JVM installs at startup Fixes #230 * Delete classpath argument files upon shutdown. Fixes #240 (#242) Store classpath argument files in bundle state location, not in workspace - Avoids that workspace is contaminated with temporary files. - Delete classpath argument files upon shutdown. - Version bump org.eclipse.jdt.launching. See https://github.com/eclipse-platform/eclipse.platform.debug/issues/84 Fixes #240 * Avoid reusing of not thread-safe SimpleDateFormat SimpleDateFormat.format(new Date()); returns same string as immutable and thread-safe DateTimeFormatter.format(new Date().toInstant()) * Avoid potential Threadlocal.set(null) memory leak (#249) Threadlocal.set(null) keeps a reference to ThreadLocal.this see https://rules.sonarsource.com/java/RSPEC-5164 Co-authored-by: Jörg Kubitz <jkubitz-eclipse@gmx.de> * Change how JrtPackageFragmentRoots are printed in Source tab (#266) - currently all JrtPackageFragmentRoots are printed using the path which is the same for all modules extracted from a jrt-fs.jar - change this to print the module name followed by the full jrt-fs.jar path - fixes #633 * JavaSnippetEditor: fix missing synchronize (#259) * JavaSnippetEditor: fix missing synchronize * JavaSnippetEditor: Adding "this." for non static field access --------- Co-authored-by: Jörg Kubitz <jkubitz-eclipse@gmx.de> * LaunchingPlugin: use try-with-resource (#252) to close streams in case of Exceptions. Co-authored-by: Jörg Kubitz <jkubitz-eclipse@gmx.de> * Add missing "static" modifier for constants (#256) To reduce memory per instance Co-authored-by: Jörg Kubitz <jkubitz-eclipse@gmx.de> * [trivial] Fixed "Redundant specification of type arguments" warnings Reported by official SDK build since 4.29 for whatever reason See for example https://download.eclipse.org/eclipse/downloads/drops4/I20230621-1800/compilelogs/plugins/org.eclipse.jdt.debug.jdi.tests_1.1.0.v20230328-1614/@dot.html#OTHER_WARNINGS * Records with inner records breaks breakpoint toggling fixes #270 Boundary for Breakpoint should be checked * Touch bundles affected by the new ecj version See eclipse-platform/eclipse.platform.releng.aggregator#1184 * Fix html links in VMInstall(Type) Extension-Point documentation * Re-throw underlying exceptions in OpenFromClipboardTests #27 (#279) Replace call to Display::syncExec with call to Display::syncCall in the private method getJavaElementMatches. snycCall does not hide exceptions, it re-throws them to the calling thread (which helps debugging). Don't catch exceptions in the helper class "Accessor", re-throw them so the calling tests can show a more meaningful stack-trace when they fail. * Use typed for-each loop Avoiding type-casts makes code easier to read. * Avoid wrapping primitives for toString() see https://rules.sonarsource.com/java/RSPEC-2131 * ReferenceTypeImpl: compare Array content instead of instance comparison. https://stackoverflow.com/questions/8777257/equals-vs-arrays-equals-in-java * VMInstallTests: fix random ConcurrentModificationException #202 by using threadsafe datastructures. * Set console stream encoding for java >= 19 - eclipse.platform.debug#124 https://github.com/eclipse-platform/eclipse.platform.debug/issues/124 * FileHashing: avoid getCanonicalFile() getCanonicalFile() is slow on windows / JDK17 - can costs even more then calculating the SHA1 of the file content, which it is supposed to avoid. * Instead use normalized path. It does not matter that multiple files could be the same due to symbolic links, it will just recalculate their SHA1 for all of them - which is still faster. * Also read all file attributes at once. * Refactor XML parsing * Fix path decoding of URL to File containing space (fixes #64) A space in an URL is encoded as "%20" and has to be decoded to " ". Otherwise a debugged JAR rooted in a path containing space is not opening class file but java file editor. * Add MacOS support for detecting VM installs at start up (#276) - fixes #265 * require org.eclipse.core.runtime 3.29.0 --------- Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com> Co-authored-by: Simeon Andreev <simeon.danailov.andreev@gmail.com> Co-authored-by: Mickael Istria <mistria@redhat.com> Co-authored-by: Diethard Ohrt <130975899+diti0023@users.noreply.github.com> Co-authored-by: Jörg Kubitz <jkubitz-eclipse@gmx.de> Co-authored-by: Jörg Kubitz <51790620+jukzi@users.noreply.github.com> Co-authored-by: Jeff Johnston <jjohnstn@redhat.com> Co-authored-by: Andrey Loskutov <loskutov@gmx.de> Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net> Co-authored-by: Federico Jeanne <2205684+fedejeanne@users.noreply.github.com>
1 parent 536efe9 commit a0d53fa

File tree

79 files changed

+879
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+879
-448
lines changed

org.eclipse.jdt.debug.jdi.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: JDI Tests
44
Bundle-SymbolicName: org.eclipse.jdt.debug.jdi.tests; singleton:=true
5-
Bundle-Version: 1.1.0.qualifier
5+
Bundle-Version: 1.1.100.qualifier
66
Bundle-ClassPath: .
77
Bundle-Vendor: Eclipse
88
Require-Bundle: org.junit,

org.eclipse.jdt.debug.jdi.tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</parent>
1919
<groupId>org.eclipse.jdt</groupId>
2020
<artifactId>org.eclipse.jdt.debug.jdi.tests</artifactId>
21-
<version>1.1.0-SNAPSHOT</version>
21+
<version>1.1.100-SNAPSHOT</version>
2222
<packaging>eclipse-test-plugin</packaging>
2323
<properties>
2424
<code.ignoredWarnings>${tests.ignoredWarnings}</code.ignoredWarnings>

org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassTypeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void testJDIInvokeMethodFail() {
200200
Exception good = null;
201201
Exception oops = null;
202202
try {
203-
fType.invokeMethod(thread, inv2, new ArrayList<Value>(), 0);
203+
fType.invokeMethod(thread, inv2, new ArrayList<>(), 0);
204204
} catch (InvocationException exc) {
205205
good = exc;
206206
} catch (Exception exc) {

org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/HeapWalkingTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ public void testGetInstanceCountsNullAttrib() {
7575
public void testGetInstanceCountsUnsupported() {
7676
if(is16OrGreater()) {
7777
try {
78-
fVM.instanceCounts(new ArrayList<ReferenceType>());
78+
fVM.instanceCounts(new ArrayList<>());
7979
}
8080
catch(UnsupportedOperationException uoe) {
8181
fail("Threw unsupported exception in 1.6 VM");
8282
}
8383
}
8484
else {
8585
try {
86-
fVM.instanceCounts(new ArrayList<ReferenceType>());
86+
fVM.instanceCounts(new ArrayList<>());
8787
fail("No exception for non 1.6 VM");
8888
}
8989
catch(UnsupportedOperationException uoe) {}

org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ObjectReferenceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public void testJDIInvokeMethodFail() {
260260
Method inv = ct.concreteMethodByName("invoke4", "()J");
261261
Exception good = null, oops = null;
262262
try {
263-
fObject.invokeMethod(thread, inv, new ArrayList<Value>(), 0);
263+
fObject.invokeMethod(thread, inv, new ArrayList<>(), 0);
264264
} catch (ClassNotLoadedException exc) {
265265
oops = exc;
266266
} catch (IncompatibleThreadStateException exc) {

org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadReferenceTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import com.sun.jdi.ReferenceType;
2727
import com.sun.jdi.StackFrame;
2828
import com.sun.jdi.ThreadReference;
29-
import com.sun.jdi.Value;
3029
import com.sun.jdi.event.ThreadDeathEvent;
3130
import com.sun.jdi.event.ThreadStartEvent;
3231
import com.sun.jdi.request.ThreadDeathRequest;
@@ -194,7 +193,7 @@ public void testJDIStop() {
194193
threadDeathClass.newInstance(
195194
thread,
196195
constructor,
197-
new java.util.LinkedList<Value>(),
196+
new java.util.LinkedList<>(),
198197
ClassType.INVOKE_SINGLE_THREADED);
199198
threadDeath.disableCollection();
200199
// This object is going to be used for the lifetime of the VM.

org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/WatchpointEventTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import com.sun.jdi.event.AccessWatchpointEvent;
2121
import com.sun.jdi.event.ModificationWatchpointEvent;
2222
import com.sun.jdi.event.WatchpointEvent;
23-
import com.sun.jdi.request.EventRequest;
2423
import com.sun.jdi.request.EventRequestManager;
2524

2625
/**
@@ -80,9 +79,9 @@ public void localTearDown() {
8079
// Delete the event requests we created in this test
8180
EventRequestManager requestManager = fVM.eventRequestManager();
8281
requestManager.deleteEventRequests(
83-
new ArrayList<EventRequest>(requestManager.accessWatchpointRequests()));
82+
new ArrayList<>(requestManager.accessWatchpointRequests()));
8483
requestManager.deleteEventRequests(
85-
new ArrayList<EventRequest>(requestManager.modificationWatchpointRequests()));
84+
new ArrayList<>(requestManager.modificationWatchpointRequests()));
8685

8786
// Set the value of the "fBool" field back to its original value
8887
resetField();

org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.jdt.debug.tests; singleton:=true
5-
Bundle-Version: 3.12.0.qualifier
5+
Bundle-Version: 3.12.100.qualifier
66
Bundle-ClassPath: javadebugtests.jar
77
Bundle-Activator: org.eclipse.jdt.debug.testplugin.JavaTestPlugin
88
Bundle-Vendor: %providerName
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# To force a version qualifier update, add the bug here
22
Bug 530709 - Comparator errors in jdt debug and jdt ui in I20180204-2000
3+
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1184
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2023 IBM Corporation and others.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
package a.b.c;
15+
public record Test(int a, int b) {
16+
17+
public void x() {
18+
return; // <- Toggling a breakpoint here toggles it on TestInner
19+
}
20+
21+
public int y() {
22+
return a + b; // <- Toggling a breakpoint here toggles it on TestInner
23+
}
24+
25+
public record TestInner() {
26+
static int c;
27+
public void getI() {
28+
System.out.println(c);
29+
}
30+
31+
}
32+
33+
public int z() {
34+
return a + b; // <- Toggling a breakpoint here toggles it here as expected
35+
}
36+
}

0 commit comments

Comments
 (0)