The real NPE problem was already fixed in
c52bf8a8 by Hannu, but this
adds some SLF4J logging.
gitlab #77
Change-Id: I9ce2e1efca375046b0b5f8a5dd483e1e288d594a
package org.simantics.scl.osgi.internal;
package org.simantics.scl.osgi.internal;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import org.simantics.scl.compiler.module.repository.UpdateListener;
import org.simantics.scl.compiler.source.EncodedTextualModuleSource;
import org.simantics.scl.compiler.types.Type;
import org.simantics.scl.compiler.module.repository.UpdateListener;
import org.simantics.scl.compiler.source.EncodedTextualModuleSource;
import org.simantics.scl.compiler.types.Type;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import gnu.trove.set.hash.THashSet;
public class BundleModuleSource extends EncodedTextualModuleSource implements UpdateListener.Observable {
import gnu.trove.set.hash.THashSet;
public class BundleModuleSource extends EncodedTextualModuleSource implements UpdateListener.Observable {
+ private static final Logger LOGGER = LoggerFactory.getLogger(BundleModuleSource.class);
+
public static final ImportDeclaration[] DEFAULT_IMPORTS = new ImportDeclaration[] {
new ImportDeclaration("Builtin", ""),
new ImportDeclaration("StandardLibrary", "")
public static final ImportDeclaration[] DEFAULT_IMPORTS = new ImportDeclaration[] {
new ImportDeclaration("Builtin", ""),
new ImportDeclaration("StandardLibrary", "")
}
return digest.digest();
} catch (NoSuchAlgorithmException e) {
}
return digest.digest();
} catch (NoSuchAlgorithmException e) {
+ LOGGER.error("No SHA1 algorithm available", e);
return new byte[0];
} finally {
stream.close();
}
} catch(IOException e) {
return new byte[0];
} finally {
stream.close();
}
} catch(IOException e) {
+ LOGGER.error("Could not compute digest for {}", this);
return false;
return Files.exists(path);
} catch (IOException e) {
return false;
return Files.exists(path);
} catch (IOException e) {
+ LOGGER.debug("Could not check if {} is updateable", this, e);
@Override
public void update(String newSourceText) {
try {
@Override
public void update(String newSourceText) {
try {
return;
Files.write(path, newSourceText.getBytes(Charset.forName("UTF-8")));
} catch(IOException e) {
return;
Files.write(path, newSourceText.getBytes(Charset.forName("UTF-8")));
} catch(IOException e) {
+ LOGGER.error("Could not update {} with {}", this, newSourceText, e);