Skip to content

Commit

Permalink
[eclipse] Update the API for the contributions to the classpath.
Browse files Browse the repository at this point in the history
see #1027

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Nov 12, 2020
1 parent 73a3efb commit c3a7d3d
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 56 deletions.
Expand Up @@ -309,12 +309,12 @@ public void setLaunchingFlags(ILaunchConfigurationWorkingCopy configuration, Boo

@Override
public void setProjectName(ILaunchConfigurationWorkingCopy configuration, String projectName) {
configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, Strings.emptyToNull(projectName));
}

@Override
public void setAgent(ILaunchConfigurationWorkingCopy configuration, String agentFullyQualifiedName) {
configuration.setAttribute(ATTR_AGENT_NAME, agentFullyQualifiedName);
configuration.setAttribute(ATTR_AGENT_NAME, Strings.emptyToNull(agentFullyQualifiedName));
}

@Override
Expand All @@ -334,26 +334,26 @@ public void setAgentLaunchingArguments(ILaunchConfigurationWorkingCopy configura

@Override
public void setSRELaunchingArguments(ILaunchConfigurationWorkingCopy configuration, String arguments) {
configuration.setAttribute(ATTR_SARL_RUNTIME_ENVIRONMENT_ARGUMENTS, arguments);
configuration.setAttribute(ATTR_SARL_RUNTIME_ENVIRONMENT_ARGUMENTS, Strings.emptyToNull(arguments));
}

@Override
public void setExtraSRELaunchingArguments(ILaunchConfigurationWorkingCopy configuration, String contributorId,
String arguments) {
final String attrName = contributorId + ATTR_EXTRA_SARL_RUNTIME_ENVIRONMENT_ARGUMENTS;
configuration.setAttribute(attrName, arguments);
configuration.setAttribute(attrName, Strings.emptyToNull(arguments));
}

@Override
public void setJRELaunchingArguments(ILaunchConfigurationWorkingCopy configuration, String arguments) {
configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, arguments);
configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, Strings.emptyToNull(arguments));
}

@Override
public void setExtraJRELaunchingArguments(ILaunchConfigurationWorkingCopy configuration, String contributorId,
String arguments) {
final String attrName = contributorId + ATTR_EXTRA_VM_ARGUMENTS;
configuration.setAttribute(attrName, arguments);
configuration.setAttribute(attrName, Strings.emptyToNull(arguments));
}

@Override
Expand Down Expand Up @@ -597,7 +597,7 @@ public String getExtraClasspathProvider(ILaunchConfiguration configuration, Stri
@Override
public void setExtraClasspathProvider(ILaunchConfigurationWorkingCopy configuration, String contributorId, String classpathContainerId) {
final String attrName = contributorId + ATTR_EXTRA_CLASSPATH_PROVIDER;
configuration.setAttribute(attrName, classpathContainerId);
configuration.setAttribute(attrName, Strings.emptyToNull(classpathContainerId));
}

@Override
Expand All @@ -606,7 +606,7 @@ public List<String> getExtraClasspathProviders(ILaunchConfiguration configuratio
try {
for (final String key : configuration.getAttributes().keySet()) {
if (key.endsWith(ATTR_EXTRA_CLASSPATH_PROVIDER)) {
final String value = Strings.nullToEmpty(configuration.getAttribute(key, (String) null));
final String value = configuration.getAttribute(key, (String) null);
if (!Strings.isNullOrEmpty(value)) {
identifiers.add(value);
}
Expand Down

0 comments on commit c3a7d3d

Please sign in to comment.