Skip to content

Commit e55f864

Browse files
Remove the usage of JDK internal API to avoid breaking JDK 16 (#364)
1 parent 64d4243 commit e55f864

File tree

8 files changed

+15
-22
lines changed

8 files changed

+15
-22
lines changed

com.microsoft.java.debug.core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.microsoft.java</groupId>
77
<artifactId>java-debug-parent</artifactId>
8-
<version>0.30.0</version>
8+
<version>0.30.1</version>
99
</parent>
1010
<artifactId>com.microsoft.java.debug.core</artifactId>
1111
<packaging>jar</packaging>

com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/LaunchUtils.java

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@
1616
import java.io.IOException;
1717
import java.math.BigInteger;
1818
import java.nio.file.Files;
19-
import java.nio.file.InvalidPathException;
2019
import java.nio.file.Path;
21-
import java.nio.file.Paths;
2220
import java.security.MessageDigest;
2321
import java.security.NoSuchAlgorithmException;
2422
import java.util.ArrayList;
2523
import java.util.HashSet;
2624
import java.util.List;
2725
import java.util.Set;
26+
import java.util.UUID;
2827
import java.util.jar.Attributes;
2928
import java.util.jar.JarOutputStream;
3029
import java.util.jar.Manifest;
@@ -33,8 +32,6 @@
3332

3433
import org.apache.commons.lang3.ArrayUtils;
3534

36-
import sun.security.action.GetPropertyAction;
37-
3835
public class LaunchUtils {
3936
private static Set<Path> tempFilesInUse = new HashSet<>();
4037

@@ -109,16 +106,12 @@ public static void releaseTempLaunchFile(Path tempFile) {
109106

110107
private static synchronized Path getTmpDir() throws IOException {
111108
if (tmpdir == null) {
109+
Path tmpfile = Files.createTempFile("", UUID.randomUUID().toString());
110+
tmpdir = tmpfile.getParent();
112111
try {
113-
tmpdir = Paths.get(java.security.AccessController.doPrivileged(new GetPropertyAction("java.io.tmpdir")));
114-
} catch (NullPointerException | InvalidPathException e) {
115-
Path tmpfile = Files.createTempFile("", ".tmp");
116-
tmpdir = tmpfile.getParent();
117-
try {
118-
Files.deleteIfExists(tmpfile);
119-
} catch (Exception ex) {
120-
// do nothing
121-
}
112+
Files.deleteIfExists(tmpfile);
113+
} catch (Exception ex) {
114+
// do nothing
122115
}
123116
}
124117

com.microsoft.java.debug.plugin/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<classpathentry kind="src" path="src/main/java"/>
77
<classpathentry exported="true" kind="lib" path="lib/rxjava-2.1.1.jar"/>
88
<classpathentry exported="true" kind="lib" path="lib/reactive-streams-1.0.0.jar"/>
9-
<classpathentry exported="true" kind="lib" path="lib/com.microsoft.java.debug.core-0.30.0.jar" sourcepath="/com.microsoft.java.debug.core"/>
9+
<classpathentry exported="true" kind="lib" path="lib/com.microsoft.java.debug.core-0.30.1.jar" sourcepath="/com.microsoft.java.debug.core"/>
1010
<classpathentry kind="output" path="target/classes"/>
1111
</classpath>

com.microsoft.java.debug.plugin/META-INF/MANIFEST.MF

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: Java Debug Server Plugin
44
Bundle-SymbolicName: com.microsoft.java.debug.plugin;singleton:=true
5-
Bundle-Version: 0.30.0
5+
Bundle-Version: 0.30.1
66
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
77
Bundle-ActivationPolicy: lazy
88
Bundle-Activator: com.microsoft.java.debug.plugin.internal.JavaDebuggerServerPlugin
@@ -24,4 +24,4 @@ Bundle-ClassPath: lib/commons-io-2.5.jar,
2424
.,
2525
lib/rxjava-2.1.1.jar,
2626
lib/reactive-streams-1.0.0.jar,
27-
lib/com.microsoft.java.debug.core-0.30.0.jar
27+
lib/com.microsoft.java.debug.core-0.30.1.jar

com.microsoft.java.debug.plugin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.microsoft.java</groupId>
77
<artifactId>java-debug-parent</artifactId>
8-
<version>0.30.0</version>
8+
<version>0.30.1</version>
99
</parent>
1010
<artifactId>com.microsoft.java.debug.plugin</artifactId>
1111
<packaging>eclipse-plugin</packaging>
@@ -45,7 +45,7 @@
4545
<artifactItem>
4646
<groupId>com.microsoft.java</groupId>
4747
<artifactId>com.microsoft.java.debug.core</artifactId>
48-
<version>0.30.0</version>
48+
<version>0.30.1</version>
4949
</artifactItem>
5050
</artifactItems>
5151
</configuration>

com.microsoft.java.debug.repository/category.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<site>
3-
<bundle id="com.microsoft.java.debug.plugin" version="0.30.0">
3+
<bundle id="com.microsoft.java.debug.plugin" version="0.30.1">
44
<category name="javadebug" />
55
</bundle>
66
<category-def name="javadebug" label="Java Debug Server"/>

com.microsoft.java.debug.repository/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.microsoft.java</groupId>
66
<artifactId>java-debug-parent</artifactId>
7-
<version>0.30.0</version>
7+
<version>0.30.1</version>
88
</parent>
99
<artifactId>com.microsoft.java.debug.repository</artifactId>
1010
<packaging>eclipse-repository</packaging>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<name>${base.name} :: Parent</name>
77
<description>The Java Debug Server is an implementation of Visual Studio Code (VSCode) Debug Protocol. It can be used in Visual Studio Code to debug Java programs.</description>
88
<url>https://github.com/Microsoft/java-debug</url>
9-
<version>0.30.0</version>
9+
<version>0.30.1</version>
1010
<packaging>pom</packaging>
1111
<properties>
1212
<base.name>Java Debug Server for Visual Studio Code</base.name>

0 commit comments

Comments
 (0)