From ab14fd7d1248de979b2a69b59aaadc645a05acca Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Mon, 19 Jan 2015 16:28:07 +0300 Subject: [PATCH] decompiler: fixed NPE with disabled line mapping --- .../org/jetbrains/java/decompiler/IdeaDecompiler.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/java-decompiler/plugin/src/org/jetbrains/java/decompiler/IdeaDecompiler.java b/plugins/java-decompiler/plugin/src/org/jetbrains/java/decompiler/IdeaDecompiler.java index 93650c2da4af..72e0f4f06512 100644 --- a/plugins/java-decompiler/plugin/src/org/jetbrains/java/decompiler/IdeaDecompiler.java +++ b/plugins/java-decompiler/plugin/src/org/jetbrains/java/decompiler/IdeaDecompiler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -183,8 +183,9 @@ public class IdeaDecompiler extends ClassFileDecompilers.Light { } decompiler.decompileContext(); - file.putUserData(LineNumbersMapping.LINE_NUMBERS_MAPPING_KEY, - new ExactMatchLineNumbersMapping(saver.myMapping)); + if (saver.myMapping != null) { + file.putUserData(LineNumbersMapping.LINE_NUMBERS_MAPPING_KEY, new ExactMatchLineNumbersMapping(saver.myMapping)); + } return saver.myResult; } @@ -344,7 +345,7 @@ public class IdeaDecompiler extends ClassFileDecompilers.Light { private static class ExactMatchLineNumbersMapping implements LineNumbersMapping { private int[] myMapping; - private ExactMatchLineNumbersMapping(int[] mapping) { + private ExactMatchLineNumbersMapping(@NotNull int[] mapping) { myMapping = mapping; }