Cleanup (minor optimization)

master
Roman Shevchenko 8 years ago
parent 7628ddfd2c
commit 9d5a863e4d
  1. 13
      src/org/jetbrains/java/decompiler/modules/decompiler/exps/ExitExprent.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2015 JetBrains s.r.o. * Copyright 2000-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -27,7 +27,6 @@ import org.jetbrains.java.decompiler.struct.attr.StructExceptionsAttribute;
import org.jetbrains.java.decompiler.struct.gen.VarType; import org.jetbrains.java.decompiler.struct.gen.VarType;
import org.jetbrains.java.decompiler.struct.match.MatchEngine; import org.jetbrains.java.decompiler.struct.match.MatchEngine;
import org.jetbrains.java.decompiler.struct.match.MatchNode; import org.jetbrains.java.decompiler.struct.match.MatchNode;
import org.jetbrains.java.decompiler.struct.match.IMatchable.MatchProperties;
import org.jetbrains.java.decompiler.util.InterpreterUtil; import org.jetbrains.java.decompiler.util.InterpreterUtil;
import java.util.ArrayList; import java.util.ArrayList;
@ -83,14 +82,14 @@ public class ExitExprent extends Exprent {
tracer.addMapping(bytecode); tracer.addMapping(bytecode);
if (exitType == EXIT_RETURN) { if (exitType == EXIT_RETURN) {
TextBuffer buffer = new TextBuffer(); TextBuffer buffer = new TextBuffer("return");
if (retType.type != CodeConstants.TYPE_VOID) { if (retType.type != CodeConstants.TYPE_VOID) {
buffer.append(" "); buffer.append(' ');
ExprProcessor.getCastedExprent(value, retType, buffer, indent, false, tracer); ExprProcessor.getCastedExprent(value, retType, buffer, indent, false, tracer);
} }
return buffer.prepend("return"); return buffer;
} }
else { else {
MethodWrapper method = (MethodWrapper)DecompilerContext.getProperty(DecompilerContext.CURRENT_METHOD_WRAPPER); MethodWrapper method = (MethodWrapper)DecompilerContext.getProperty(DecompilerContext.CURRENT_METHOD_WRAPPER);
@ -115,9 +114,9 @@ public class ExitExprent extends Exprent {
if (classname != null) { if (classname != null) {
VarType exType = new VarType(classname, true); VarType exType = new VarType(classname, true);
TextBuffer buffer = new TextBuffer(); TextBuffer buffer = new TextBuffer("throw ");
ExprProcessor.getCastedExprent(value, exType, buffer, indent, false, tracer); ExprProcessor.getCastedExprent(value, exType, buffer, indent, false, tracer);
return buffer.prepend("throw "); return buffer;
} }
} }
} }

Loading…
Cancel
Save