use of org.eclipse.che.commons.annotation.Nullable in project che by eclipse.
the class VariableNodeDataAdapter method getNodeByPath.
/** {@inheritDoc} */
@Override
@Nullable
public MutableVariable getNodeByPath(@NotNull MutableVariable root, @NotNull List<String> relativeNodePath) {
MutableVariable localRoot = root;
for (int i = 0; i < relativeNodePath.size(); i++) {
String path = relativeNodePath.get(i);
if (localRoot != null) {
List<MutableVariable> variables = new ArrayList<>(localRoot.getVariables());
localRoot = null;
for (int j = 0; j < variables.size(); j++) {
MutableVariable variable = variables.get(i);
if (variable.getName().equals(path)) {
localRoot = variable;
break;
}
}
if (i == (relativeNodePath.size() - 1)) {
return localRoot;
}
}
}
return null;
}
use of org.eclipse.che.commons.annotation.Nullable in project che by eclipse.
the class LanguageServerRegistryImpl method findServer.
@Nullable
protected LanguageServer findServer(String extension, String projectPath) throws LanguageServerException {
ProjectExtensionKey projectKey = createProjectKey(projectPath, extension);
for (LanguageServerLauncher launcher : extensionToLauncher.get(extension)) {
if (!projectToServer.containsKey(projectKey)) {
synchronized (launcher) {
if (!projectToServer.containsKey(projectKey)) {
LanguageServer server = initializer.initialize(launcher, projectPath);
projectToServer.put(projectKey, server);
}
}
}
return projectToServer.get(projectKey);
}
return null;
}
Aggregations