Skip to content

Commit

Permalink
Fix the broken due to the changes from the upstream JDI impl class Co…
Browse files Browse the repository at this point in the history
…nnectorImpl$StringArgumentImpl (#374)
  • Loading branch information
testforstephen authored Apr 30, 2021
1 parent 5bb368e commit 71e9ac5
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 15 deletions.
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.microsoft.java</groupId>
<artifactId>java-debug-parent</artifactId>
<version>0.31.0</version>
<version>0.31.1</version>
</parent>
<artifactId>com.microsoft.java.debug.core</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.plugin/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<classpathentry kind="src" path="src/main/java"/>
<classpathentry exported="true" kind="lib" path="lib/rxjava-2.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/reactive-streams-1.0.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/com.microsoft.java.debug.core-0.31.0.jar" sourcepath="/com.microsoft.java.debug.core"/>
<classpathentry exported="true" kind="lib" path="lib/com.microsoft.java.debug.core-0.31.1.jar" sourcepath="/com.microsoft.java.debug.core"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
4 changes: 2 additions & 2 deletions com.microsoft.java.debug.plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Java Debug Server Plugin
Bundle-SymbolicName: com.microsoft.java.debug.plugin;singleton:=true
Bundle-Version: 0.31.0
Bundle-Version: 0.31.1
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Activator: com.microsoft.java.debug.plugin.internal.JavaDebuggerServerPlugin
Expand All @@ -25,4 +25,4 @@ Bundle-ClassPath: lib/commons-io-2.5.jar,
.,
lib/rxjava-2.1.1.jar,
lib/reactive-streams-1.0.0.jar,
lib/com.microsoft.java.debug.core-0.31.0.jar
lib/com.microsoft.java.debug.core-0.31.1.jar
4 changes: 2 additions & 2 deletions com.microsoft.java.debug.plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.microsoft.java</groupId>
<artifactId>java-debug-parent</artifactId>
<version>0.31.0</version>
<version>0.31.1</version>
</parent>
<artifactId>com.microsoft.java.debug.plugin</artifactId>
<packaging>eclipse-plugin</packaging>
Expand Down Expand Up @@ -45,7 +45,7 @@
<artifactItem>
<groupId>com.microsoft.java</groupId>
<artifactId>com.microsoft.java.debug.core</artifactId>
<version>0.31.0</version>
<version>0.31.1</version>
</artifactItem>
</artifactItems>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017 Microsoft Corporation and others.
* Copyright (c) 2017-2021 Microsoft Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -44,11 +44,11 @@ public AdvancedLaunchingConnector(VirtualMachineManagerImpl virtualMachineManage
public Map<String, Argument> defaultArguments() {
Map<String, Argument> defaultArgs = super.defaultArguments();

Argument cwdArg = new AdvancedStringArgumentImpl(DebugUtility.CWD, "Current working directory", DebugUtility.CWD, false);
Argument cwdArg = new JDIStringArgumentImpl(DebugUtility.CWD, "Current working directory", DebugUtility.CWD, false);
cwdArg.setValue(null);
defaultArgs.put(DebugUtility.CWD, cwdArg);

Argument envArg = new AdvancedStringArgumentImpl(DebugUtility.ENV, "Environment variables", DebugUtility.ENV, false);
Argument envArg = new JDIStringArgumentImpl(DebugUtility.ENV, "Environment variables", DebugUtility.ENV, false);
envArg.setValue(null);
defaultArgs.put(DebugUtility.ENV, envArg);

Expand Down Expand Up @@ -117,11 +117,79 @@ private static String[] constructLaunchCommand(Map<String, ? extends Argument> l
return DebugUtility.parseArguments(execString.toString()).toArray(new String[0]);
}

class AdvancedStringArgumentImpl extends StringArgumentImpl implements StringArgument {
private static final long serialVersionUID = 1L;
abstract class JDIArgumentImpl implements Argument {
private static final long serialVersionUID = 8850533280769854833L;
private String name;
private String description;
private String label;
private boolean mustSpecify;

protected JDIArgumentImpl(String name, String description, String label, boolean mustSpecify) {
this.name = name;
this.description = description;
this.label = label;
this.mustSpecify = mustSpecify;
}

@Override
public String name() {
return name;
}

@Override
public String description() {
return description;
}

@Override
public String label() {
return label;
}

@Override
public boolean mustSpecify() {
return mustSpecify;
}

@Override
public abstract String value();

@Override
public abstract void setValue(String value);

@Override
public abstract boolean isValid(String value);

protected AdvancedStringArgumentImpl(String name, String description, String label, boolean mustSpecify) {
@Override
public abstract String toString();
}

class JDIStringArgumentImpl extends JDIArgumentImpl implements StringArgument {
private static final long serialVersionUID = 6009335074727417445L;
private String value;

protected JDIStringArgumentImpl(String name, String description, String label, boolean mustSpecify) {
super(name, description, label, mustSpecify);
}

@Override
public String value() {
return value;
}

@Override
public void setValue(String value) {
this.value = value;
}

@Override
public boolean isValid(String value) {
return true;
}

@Override
public String toString() {
return value;
}
}
}
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.repository/category.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<bundle id="com.microsoft.java.debug.plugin" version="0.31.0">
<bundle id="com.microsoft.java.debug.plugin" version="0.31.1">
<category name="javadebug" />
</bundle>
<category-def name="javadebug" label="Java Debug Server"/>
Expand Down
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.microsoft.java</groupId>
<artifactId>java-debug-parent</artifactId>
<version>0.31.0</version>
<version>0.31.1</version>
</parent>
<artifactId>com.microsoft.java.debug.repository</artifactId>
<packaging>eclipse-repository</packaging>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<name>${base.name} :: Parent</name>
<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>
<url>https://github.com/Microsoft/java-debug</url>
<version>0.31.0</version>
<version>0.31.1</version>
<packaging>pom</packaging>
<properties>
<base.name>Java Debug Server for Visual Studio Code</base.name>
Expand Down

0 comments on commit 71e9ac5

Please sign in to comment.