mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
[ZEPPELIN-2403] checkstyle fix
This commit is contained in:
parent
fd25c467ac
commit
a5f1327243
2 changed files with 19 additions and 22 deletions
|
|
@ -28,7 +28,6 @@ import java.util.Properties;
|
|||
import java.util.Set;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
import com.google.gson.internal.StringMap;
|
||||
import org.apache.zeppelin.dep.Dependency;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -37,6 +36,7 @@ import com.google.gson.JsonArray;
|
|||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.internal.StringMap;
|
||||
|
||||
import static org.apache.zeppelin.notebook.utility.IdHashes.generateId;
|
||||
|
||||
|
|
@ -436,24 +436,24 @@ public class InterpreterSetting {
|
|||
// For backward compatibility of interpreter.json format after ZEPPELIN-2403
|
||||
public void convertFlatPropertiesToPropertiesWithWidgets() {
|
||||
StringMap newProperties = new StringMap();
|
||||
if (properties != null && properties instanceof StringMap) {
|
||||
StringMap p = (StringMap) properties;
|
||||
if (properties != null && properties instanceof StringMap) {
|
||||
StringMap p = (StringMap) properties;
|
||||
|
||||
for (Object o : p.entrySet()) {
|
||||
Map.Entry entry = (Map.Entry) o;
|
||||
if (!(entry.getValue() instanceof StringMap)) {
|
||||
StringMap newProperty = new StringMap();
|
||||
newProperty.put("name", entry.getKey());
|
||||
newProperty.put("value", entry.getValue());
|
||||
newProperty.put("type", InterpreterPropertyType.TEXTAREA.getValue());
|
||||
newProperties.put(entry.getKey().toString(), newProperty);
|
||||
} else {
|
||||
// already converted
|
||||
return;
|
||||
}
|
||||
for (Object o : p.entrySet()) {
|
||||
Map.Entry entry = (Map.Entry) o;
|
||||
if (!(entry.getValue() instanceof StringMap)) {
|
||||
StringMap newProperty = new StringMap();
|
||||
newProperty.put("name", entry.getKey());
|
||||
newProperty.put("value", entry.getValue());
|
||||
newProperty.put("type", InterpreterPropertyType.TEXTAREA.getValue());
|
||||
newProperties.put(entry.getKey().toString(), newProperty);
|
||||
} else {
|
||||
// already converted
|
||||
return;
|
||||
}
|
||||
|
||||
this.properties = newProperties;
|
||||
}
|
||||
|
||||
this.properties = newProperties;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@
|
|||
|
||||
package org.apache.zeppelin.interpreter;
|
||||
|
||||
import static java.nio.file.attribute.PosixFilePermission.OWNER_READ;
|
||||
import static java.nio.file.attribute.PosixFilePermission.OWNER_WRITE;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
|
@ -158,7 +155,7 @@ public class InterpreterSettingManager {
|
|||
/**
|
||||
* Remember this method doesn't keep current connections after being called
|
||||
*/
|
||||
private void loadFromFile() {
|
||||
private void loadFromFile() {
|
||||
if (!Files.exists(interpreterBindingPath)) {
|
||||
// nothing to read
|
||||
return;
|
||||
|
|
@ -261,7 +258,7 @@ public class InterpreterSettingManager {
|
|||
} catch (UnsupportedOperationException e) {
|
||||
// File system does not support Posix file permissions (likely windows) - continue anyway.
|
||||
logger.warn("unable to setPosixFilePermissions on '{}'.", interpreterBindingPath);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
FileOutputStream fos = new FileOutputStream(interpreterBindingPath.toFile(), false);
|
||||
|
|
|
|||
Loading…
Reference in a new issue