From c0f01b977386766352dd01d116c9f80b9f683ebe Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 15 Jul 2019 13:44:08 +0200 Subject: [PATCH 1/3] [java-decompiler] fixes versions of test dependencies to make one stupid AI happy (TPV-2349) GitOrigin-RevId: abc48a40d5911f2a37bf6c6ca35ed230d5f014ac --- build.gradle | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index e6483db..9694117 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,4 @@ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. apply plugin: 'java' compileJava { @@ -12,8 +13,8 @@ sourceSets { repositories { jcenter() } dependencies { - testCompile 'junit:junit:4.+' - testCompile 'org.assertj:assertj-core:3.+' + testCompile 'junit:junit:4.12' + testCompile 'org.assertj:assertj-core:3.12.2' } jar { From 877b0bb707e4ca54a74d03ff18bb290822959161 Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Tue, 23 Jul 2019 16:40:07 -0600 Subject: [PATCH 2/3] there's no need to use , because String is final sometimes it's necessary, e.g. when we're substituting any generic with the real type GitOrigin-RevId: a8c453813b04213f7e24dd80bc7ccec4eb78efcb --- .../decompiler/modules/decompiler/exps/AnnotationExprent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AnnotationExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AnnotationExprent.java index c9c9c7f..c1d7551 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AnnotationExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AnnotationExprent.java @@ -17,10 +17,10 @@ public class AnnotationExprent extends Exprent { public static final int ANNOTATION_SINGLE_ELEMENT = 3; private final String className; - private final List parNames; + private final List parNames; private final List parValues; - public AnnotationExprent(String className, List parNames, List parValues) { + public AnnotationExprent(String className, List parNames, List parValues) { super(EXPRENT_ANNOTATION); this.className = className; this.parNames = parNames; From 14255d2f890e2738f99a77980806e12f0688c1e2 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Thu, 25 Jul 2019 12:28:31 +0700 Subject: [PATCH 3/3] Extract common parts from 'if' GitOrigin-RevId: 60ebdfdb9588caf907ef111e3ed08e799c0a7d17 --- src/org/jetbrains/java/decompiler/main/AssertProcessor.java | 3 +-- .../decompiler/modules/decompiler/stats/SwitchStatement.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/main/AssertProcessor.java b/src/org/jetbrains/java/decompiler/main/AssertProcessor.java index a5f8d72..b0e7b71 100644 --- a/src/org/jetbrains/java/decompiler/main/AssertProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/AssertProcessor.java @@ -320,7 +320,6 @@ public class AssertProcessor { key.equals(InterpreterUtil.makeUniqueKey(fdparam.getName(), fdparam.getDescriptor().descriptorString)); } } - return false; } else { if (exprent.type == Exprent.EXPRENT_FIELD) { @@ -328,7 +327,7 @@ public class AssertProcessor { return classname.equals(fdparam.getClassname()) && key.equals(InterpreterUtil.makeUniqueKey(fdparam.getName(), fdparam.getDescriptor().descriptorString)); } - return false; } + return false; } } diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SwitchStatement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SwitchStatement.java index 6633d80..ab48ecc 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SwitchStatement.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SwitchStatement.java @@ -122,7 +122,6 @@ public class SwitchStatement extends Statement { for (int j = 0; j < edges.size(); j++) { if (edges.get(j) == default_edge) { buf.appendIndent(indent).append("default:").appendLineSeparator(); - tracer.incrementCurrentSourceLine(); } else { buf.appendIndent(indent).append("case "); @@ -139,8 +138,8 @@ public class SwitchStatement extends Statement { } buf.append(":").appendLineSeparator(); - tracer.incrementCurrentSourceLine(); } + tracer.incrementCurrentSourceLine(); } buf.append(ExprProcessor.jmpWrapper(stat, indent + 1, false, tracer));