Skip to content

Commit

Permalink
More fixage to the way init happens.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpw committed Nov 8, 2015
1 parent 0d79d5a commit 7465233
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/org/jetbrains/java/decompiler/main/DecompilerContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ private DecompilerContext(Map<String, Object> properties) {
this.properties = properties;
}

public static void initContext(Map<String, Object> propertiesCustom) {
public static void initContext(Map<String, Object> propertiesCustom, IFernflowerLogger logger) {
Map<String, Object> properties = new HashMap<String, Object>(IFernflowerPreferences.DEFAULTS);
if (propertiesCustom != null) {
properties.putAll(propertiesCustom);
}
currentContext.set(new DecompilerContext(properties));
setLogger(logger);
// Default a no-op renamer factory if none is provided
if (DecompilerContext.getProperty(RENAMER_FACTORY) != null) {
try {
currentContext.get().renamerFactory = Class.forName((String) DecompilerContext.getProperty(RENAMER_FACTORY)).asSubclass(IVariableNamingFactory.class).newInstance();
} catch (Exception e) {
e.printStackTrace();
System.err.println("Error loading renamer factory class");
getLogger().writeMessage("Error loading renamer factory class", e);
}
}
if (DecompilerContext.getNamingFactory() == null) {
Expand Down
4 changes: 1 addition & 3 deletions src/org/jetbrains/java/decompiler/main/Fernflower.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ public class Fernflower implements IDecompiledData {

public Fernflower(IBytecodeProvider provider, IResultSaver saver, Map<String, Object> options, IFernflowerLogger logger) {
structContext = new StructContext(saver, this, new LazyLoader(provider));
DecompilerContext.setLogger(logger);
DecompilerContext.initContext(options);
DecompilerContext.initContext(options,logger);
DecompilerContext.setCounterContainer(new CounterContainer());
DecompilerContext.setLogger(logger);

if (DecompilerContext.getOption(IFernflowerPreferences.INCLUDE_ENTIRE_CLASSPATH)) {
addAllClasspath();
Expand Down

0 comments on commit 7465233

Please sign in to comment.