Compare commits

..

1 Commits

Author SHA1 Message Date
bhe-talendbj
e986a2f106 fix(TUP-29227): set default prompt value if it is null 2020-11-19 10:52:52 +08:00
2 changed files with 6 additions and 25 deletions

View File

@@ -320,7 +320,8 @@ public class JobContextManager implements IContextManager {
contextParam = new JobContextParameter();
contextParam.setContext(context);
contextParam.setName(contextParamType.getName());
contextParam.setPrompt(contextParamType.getPrompt());
contextParam.setPrompt(
contextParamType.getPrompt() == null ? (contextParamType.getName() + "?") : contextParamType.getPrompt());
contextParam.setInternalId(contextParamType.getInternalId());
originalParamerters.add(contextParam.getName());
boolean exists = true;

View File

@@ -28,7 +28,6 @@ import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -61,25 +60,10 @@ public class CustomUriManager {
private final Object reloadingLock = new Object();
private CustomUriManager() {
IFolder resourcePath = getResourcePath();
try {
Assert.isNotNull(resourcePath);
customURIObject = loadResources(resourcePath, RepositoryConstants.PROJECT_SETTINGS_CUSTOM_URI_MAP);
customURIObject = loadResources(getResourcePath(), RepositoryConstants.PROJECT_SETTINGS_CUSTOM_URI_MAP);
} catch (Exception e) {
ExceptionHandler.process(e);
try {
if (resourcePath != null) {
customURIObject = loadResources(resourcePath.getLocation().toPortableString(),
RepositoryConstants.PROJECT_SETTINGS_CUSTOM_URI_MAP);
}
} catch (Exception e1) {
ExceptionHandler.process(e1);
/**
* Seems dangrous to load an empty json here, because it may overwrite the existing one
*/
// customURIObject = new JSONObject();
}
}
}
@@ -279,14 +263,10 @@ public class CustomUriManager {
public void reloadCustomMapping() {
try {
if (isNeedReload || customURIObject == null) {
if (isNeedReload) {
synchronized (reloadingLock) {
if (isNeedReload || customURIObject == null) {
if (customURIObject == null) {
customURIObject = new JSONObject();
} else {
customURIObject.clear();
}
if (isNeedReload) {
customURIObject.clear();
JSONObject loadResources = loadResources(getResourcePath(),
RepositoryConstants.PROJECT_SETTINGS_CUSTOM_URI_MAP);
customURIObject.putAll(loadResources);