X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.osgi%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fosgi%2Finternal%2FBundleModuleSource.java;h=fc9799de706d6625e401d47dd3320aa7a900cc91;hb=2e6e3e26554e638342cf1241374d8816b7536349;hp=92385a1ed3f9be600ffb0ea33d0ff5e10cda913b;hpb=4f38bc070c3e1e40d02bd8da64cc93a798c9aace;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/BundleModuleSource.java b/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/BundleModuleSource.java index 92385a1ed..fc9799de7 100644 --- a/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/BundleModuleSource.java +++ b/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/BundleModuleSource.java @@ -54,7 +54,7 @@ public class BundleModuleSource extends EncodedTextualModuleSource implements Up } @Override - protected ImportDeclaration[] getBuiltinImports(UpdateListener listener) { + public ImportDeclaration[] getBuiltinImports(UpdateListener listener) { if(bundle.getSymbolicName().equals("org.simantics.scl.runtime")) return DEFAULT_IMPORTS_FOR_STANDARD_LIBRARY; else @@ -146,7 +146,10 @@ public class BundleModuleSource extends EncodedTextualModuleSource implements Up @Override public boolean isUpdateable() { try { - return Files.exists(getPath()); + Path path = getPath(); + if(path == null) + return false; + return Files.exists(path); } catch (IOException e) { return false; } @@ -156,6 +159,8 @@ public class BundleModuleSource extends EncodedTextualModuleSource implements Up public void update(String newSourceText) { try { Path path = getPath(); + if(path == null) + return; Files.write(path, newSourceText.getBytes(Charset.forName("UTF-8"))); } catch(IOException e) { e.printStackTrace();