added spaces after if and inside the ternary operator

This commit is contained in:
Egor.Ushakov
2017-04-04 17:03:49 +03:00
parent e09e303e71
commit d706718b1b
15 changed files with 44 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -485,9 +485,9 @@ public class FunctionExprent extends Exprent {
return res.append(".length");
case FUNCTION_IIF:
return wrapOperandString(lstOperands.get(0), true, indent, tracer)
.append("?")
.append(" ? ")
.append(wrapOperandString(lstOperands.get(1), true, indent, tracer))
.append(":")
.append(" : ")
.append(wrapOperandString(lstOperands.get(2), true, indent, tracer));
case FUNCTION_IPP:
return wrapOperandString(lstOperands.get(0), true, indent, tracer).append("++");
@@ -501,27 +501,27 @@ public class FunctionExprent extends Exprent {
return wrapOperandString(lstOperands.get(0), true, indent, tracer).append(" instanceof ").append(wrapOperandString(lstOperands.get(1), true, indent, tracer));
case FUNCTION_LCMP: // shouldn't appear in the final code
return wrapOperandString(lstOperands.get(0), true, indent, tracer).prepend("__lcmp__(")
.append(",")
.append(", ")
.append(wrapOperandString(lstOperands.get(1), true, indent, tracer))
.append(")");
case FUNCTION_FCMPL: // shouldn't appear in the final code
return wrapOperandString(lstOperands.get(0), true, indent, tracer).prepend("__fcmpl__(")
.append(",")
.append(", ")
.append(wrapOperandString(lstOperands.get(1), true, indent, tracer))
.append(")");
case FUNCTION_FCMPG: // shouldn't appear in the final code
return wrapOperandString(lstOperands.get(0), true, indent, tracer).prepend("__fcmpg__(")
.append(",")
.append(", ")
.append(wrapOperandString(lstOperands.get(1), true, indent, tracer))
.append(")");
case FUNCTION_DCMPL: // shouldn't appear in the final code
return wrapOperandString(lstOperands.get(0), true, indent, tracer).prepend("__dcmpl__(")
.append(",")
.append(", ")
.append(wrapOperandString(lstOperands.get(1), true, indent, tracer))
.append(")");
case FUNCTION_DCMPG: // shouldn't appear in the final code
return wrapOperandString(lstOperands.get(0), true, indent, tracer).prepend("__dcmpg__(")
.append(",")
.append(", ")
.append(wrapOperandString(lstOperands.get(1), true, indent, tracer))
.append(")");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -115,7 +115,7 @@ public class IfExprent extends Exprent {
@Override
public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
tracer.addMapping(bytecode);
return condition.toJava(indent, tracer).enclose("if(", ")");
return condition.toJava(indent, tracer).enclose("if (", ")");
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -144,7 +144,7 @@ public class CatchAllStatement extends Statement {
tracer.incrementCurrentSourceLine();
if (monitor != null) {
buf.appendIndent(indent+1).append("if(").append(monitor.toJava(indent, tracer)).append(") {").appendLineSeparator();
buf.appendIndent(indent+1).append("if (").append(monitor.toJava(indent, tracer)).append(") {").appendLineSeparator();
tracer.incrementCurrentSourceLine();
}