diff options
author | Eric Bruneton <ebruneton@free.fr> | 2022-03-26 14:55:10 +0100 |
---|---|---|
committer | Eric Bruneton <ebruneton@free.fr> | 2022-03-26 14:55:10 +0100 |
commit | f6c053c1b6a08a7c505f8645ff56b7518f68098c (patch) | |
tree | fe511c1e74b41e427ad638619e2a72ad26edfcbc | |
parent | 9ea493b9863ce77bf6d208ba24e7c4f9538a7b61 (diff) | |
download | ow2-asm-f6c053c1b6a08a7c505f8645ff56b7518f68098c.tar.gz |
Fix some code smells found by SonarQube.
-rw-r--r-- | asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceValue.java | 2 | ||||
-rw-r--r-- | asm-util/src/main/java/org/objectweb/asm/util/CheckMethodAdapter.java | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceValue.java b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceValue.java index dd63c241..540ccbbb 100644 --- a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceValue.java +++ b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceValue.java @@ -65,7 +65,7 @@ public class SourceValue implements Value { * short, int, float, object and array types, and 2 for long and double. */ public SourceValue(final int size) { - this(size, new SmallSet<AbstractInsnNode>()); + this(size, new SmallSet<>()); } /** diff --git a/asm-util/src/main/java/org/objectweb/asm/util/CheckMethodAdapter.java b/asm-util/src/main/java/org/objectweb/asm/util/CheckMethodAdapter.java index 5c75923d..6586e754 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/CheckMethodAdapter.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/CheckMethodAdapter.java @@ -352,7 +352,7 @@ public class CheckMethodAdapter extends MethodVisitor { * @param methodvisitor the method visitor to which this adapter must delegate calls. */ public CheckMethodAdapter(final MethodVisitor methodvisitor) { - this(methodvisitor, new HashMap<Label, Integer>()); + this(methodvisitor, new HashMap<>()); } /** @@ -462,9 +462,7 @@ public class CheckMethodAdapter extends MethodVisitor { } else { analyzer.analyzeAndComputeMaxs("dummy", this); } - } catch (IndexOutOfBoundsException e) { - throwError(analyzer, e); - } catch (AnalyzerException e) { + } catch (IndexOutOfBoundsException | AnalyzerException e) { throwError(analyzer, e); } if (methodVisitor != null) { |