[java] correct Java version in .class file editor notification (IDEA-156371)

This commit is contained in:
Roman Shevchenko
2016-05-20 18:04:17 +02:00
parent 3ffc218d54
commit c2a144b7bb
2 changed files with 6 additions and 1 deletions
@@ -175,7 +175,9 @@ public class AttachSourcesNotificationProvider extends EditorNotifications.Provi
int major = stream.readUnsignedShort();
StringBuilder info = new StringBuilder().append("bytecode version: ").append(major).append('.').append(minor);
LanguageLevel level = ClsParsingUtil.getLanguageLevelByVersion(major);
if (level != null) info.append(" (").append(level.getName()).append(')');
if (level != null) {
info.append(" (").append(level == LanguageLevel.JDK_1_3 ? level.getName() + " or older" : level.getName()).append(')');
}
return info.toString();
}
}
@@ -200,6 +200,9 @@ public class ClsParsingUtil {
case Opcodes.V1_8:
return LanguageLevel.JDK_1_8;
case Opcodes.V1_8 + 1:
return LanguageLevel.JDK_1_9;
default:
return null;
}