Merge remote branch 'origin/master'
@@ -0,0 +1,2 @@
|
||||
IDS_JDK_ONLY=true
|
||||
IDS_JDK_ENV_VAR=IDEA_JDK_64
|
||||
@@ -151,10 +151,11 @@ private layoutWin(Map args, String home, Paths paths) {
|
||||
|
||||
winScripts(target, home, "idea.bat", args)
|
||||
winVMOptions(target, null, "idea.exe", "idea64.exe")
|
||||
String launcherProperties = "$home/build/conf/ideaCE-launcher.properties"
|
||||
List resourcePaths = ["$home/community-resources/src", "$home/platform/icons/src"]
|
||||
buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher.exe", "$target/bin/idea.exe", appInfoFile(), launcherProperties, resourcePaths)
|
||||
buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher64.exe", "$target/bin/idea64.exe", appInfoFile(), launcherProperties, resourcePaths)
|
||||
buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher.exe", "$target/bin/idea.exe", appInfoFile(),
|
||||
"$home/build/conf/ideaCE-launcher.properties", null, resourcePaths)
|
||||
buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher64.exe", "$target/bin/idea64.exe", appInfoFile(),
|
||||
"$home/build/conf/ideaCE64-launcher.properties", null, resourcePaths)
|
||||
}
|
||||
|
||||
private layoutMac(Map _args, String home, Paths paths) {
|
||||
|
||||
@@ -52,8 +52,8 @@ binding.setVariable("isEap", {
|
||||
return "true" == p("component.version.eap")
|
||||
})
|
||||
|
||||
binding.setVariable("mem32", "-server -Xms128m -Xmx512m -XX:MaxPermSize=250m -XX:ReservedCodeCacheSize=64m -XX:+UseCodeCacheFlushing -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+UseParNewGC")
|
||||
binding.setVariable("mem64", "-Xms128m -Xmx750m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=96m -XX:+UseCodeCacheFlushing -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+UseParNewGC")
|
||||
binding.setVariable("mem32", "-server -Xms128m -Xmx512m -XX:MaxPermSize=250m -XX:ReservedCodeCacheSize=64m -XX:+UseCodeCacheFlushing -XX:+UseConcMarkSweepGC -XX:+UseParNewGC")
|
||||
binding.setVariable("mem64", "-Xms128m -Xmx750m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=96m -XX:+UseCodeCacheFlushing -XX:+UseConcMarkSweepGC -XX:+UseParNewGC")
|
||||
binding.setVariable("common_vmoptions", "-ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true")
|
||||
|
||||
binding.setVariable("vmOptions", { "$common_vmoptions ${isEap() ? '-XX:+HeapDumpOnOutOfMemoryError' : ''}".trim() })
|
||||
@@ -727,9 +727,20 @@ private void fixIdeaPropertiesEol(List paths, String eol) {
|
||||
}
|
||||
}
|
||||
|
||||
binding.setVariable("buildWinLauncher", { String ch, String inputPath, String outputPath, String appInfo, String launcherProperties, List resourcePaths ->
|
||||
binding.setVariable("buildWinLauncher", { String ch, String inputPath, String outputPath, String appInfo, String launcherProperties, String pathsSelector, List resourcePaths ->
|
||||
projectBuilder.stage("winLauncher")
|
||||
|
||||
File launcherPropertiesTempFile = null;
|
||||
if (pathsSelector != null) {
|
||||
String propertiesContent = new File(launcherProperties).text
|
||||
if (propertiesContent.contains("__PRODUCT_PATHS_SELECTOR__")) {
|
||||
propertiesContent = propertiesContent.replace("__PRODUCT_PATHS_SELECTOR__", pathsSelector)
|
||||
launcherPropertiesTempFile = File.createTempFile("launcher", ".properties")
|
||||
launcherPropertiesTempFile.write(propertiesContent)
|
||||
launcherProperties = launcherPropertiesTempFile.getAbsolutePath()
|
||||
}
|
||||
}
|
||||
|
||||
ant.java(classname: "com.pme.launcher.LauncherGeneratorMain", fork: "true") {
|
||||
arg(value: inputPath)
|
||||
arg(value: appInfo)
|
||||
@@ -748,4 +759,8 @@ binding.setVariable("buildWinLauncher", { String ch, String inputPath, String ou
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (launcherPropertiesTempFile != null) {
|
||||
launcherPropertiesTempFile.delete()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -458,9 +458,11 @@ public class AnnotationsHighlightUtil {
|
||||
public static HighlightInfo checkTargetAnnotationDuplicates(PsiAnnotation annotation) {
|
||||
PsiJavaCodeReferenceElement nameRef = annotation.getNameReferenceElement();
|
||||
if (nameRef == null) return null;
|
||||
|
||||
PsiElement resolved = nameRef.resolve();
|
||||
if (!(resolved instanceof PsiClass) ||
|
||||
!CommonClassNames.TARGET_ANNOTATION_FQ_NAME.equals(((PsiClass) resolved).getQualifiedName())) return null;
|
||||
if (!(resolved instanceof PsiClass) || !CommonClassNames.JAVA_LANG_ANNOTATION_TARGET.equals(((PsiClass)resolved).getQualifiedName())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
PsiNameValuePair[] attributes = annotation.getParameterList().getAttributes();
|
||||
if (attributes.length < 1) return null;
|
||||
@@ -483,6 +485,7 @@ public class AnnotationsHighlightUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static HighlightInfo checkFunctionalInterface(PsiAnnotation annotation) {
|
||||
final String errorMessage = LambdaUtil.checkFunctionalInterface(annotation);
|
||||
if (errorMessage != null) {
|
||||
|
||||
@@ -311,7 +311,6 @@ public class SimplifyBooleanExpressionFix implements IntentionAction {
|
||||
}
|
||||
catch (IncorrectOperationException e) {
|
||||
resultExpression = null;
|
||||
LOG.error("lExpr: " + lExpr.getText() + "; op: " + javaToken.getText() + "; rExpr: " + operand.getText() + "; top: " + expression.getText());
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -15,15 +15,19 @@
|
||||
*/
|
||||
package com.intellij.refactoring.introduceField;
|
||||
|
||||
import com.intellij.codeInsight.TestFrameworks;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.LocalSearchScope;
|
||||
import com.intellij.psi.search.searches.ReferencesSearch;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.refactoring.RefactoringBundle;
|
||||
import com.intellij.refactoring.ui.TypeSelectorManager;
|
||||
import com.intellij.ui.NonFocusableCheckBox;
|
||||
import com.intellij.ui.StateRestoringCheckBox;
|
||||
import com.intellij.util.Processor;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -93,7 +97,7 @@ public abstract class IntroduceFieldCentralPanel {
|
||||
refElement instanceof PsiParameter ||
|
||||
(refElement instanceof PsiField && !((PsiField)refElement).hasInitializer())) &&
|
||||
!PsiTreeUtil.isAncestor(initializer, refElement, true)) {
|
||||
return updateInitializationPlaceModel();
|
||||
return updateInitializationPlaceModel(initializedInSetUp(refElement));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,6 +108,28 @@ public abstract class IntroduceFieldCentralPanel {
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean initializedInSetUp(PsiElement refElement) {
|
||||
if (refElement instanceof PsiField && hasSetUpChoice()) {
|
||||
final PsiMethod setUpMethod = TestFrameworks.getInstance().findSetUpMethod(((PsiField)refElement).getContainingClass());
|
||||
if (setUpMethod != null) {
|
||||
final Processor<PsiReference> initializerSearcher = new Processor<PsiReference>() {
|
||||
@Override
|
||||
public boolean process(PsiReference reference) {
|
||||
final PsiElement referenceElement = reference.getElement();
|
||||
if (referenceElement instanceof PsiExpression) {
|
||||
return !PsiUtil.isAccessedForWriting((PsiExpression)referenceElement);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
if (!ReferencesSearch.search(refElement, new LocalSearchScope(setUpMethod)).forEach(initializerSearcher)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract BaseExpressionToFieldHandler.InitializationPlace getInitializerPlace();
|
||||
protected abstract void initializeInitializerPlace(PsiExpression initializerExpression,
|
||||
BaseExpressionToFieldHandler.InitializationPlace ourLastInitializerPlace);
|
||||
@@ -279,5 +305,7 @@ public abstract class IntroduceFieldCentralPanel {
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract boolean updateInitializationPlaceModel();
|
||||
protected abstract boolean updateInitializationPlaceModel(boolean initializedInsetup);
|
||||
|
||||
protected abstract boolean hasSetUpChoice();
|
||||
}
|
||||
|
||||
@@ -195,14 +195,25 @@ public class IntroduceFieldDialogPanel extends IntroduceFieldCentralPanel {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean updateInitializationPlaceModel() {
|
||||
protected boolean updateInitializationPlaceModel(boolean initializedInSetup) {
|
||||
myRbInFieldDeclaration.setEnabled(false);
|
||||
myRbInConstructor.setEnabled(false);
|
||||
if (myRbInSetUp != null) myRbInSetUp.setEnabled(false);
|
||||
enableFinal(false);
|
||||
if (myRbInSetUp != null){
|
||||
if (!initializedInSetup) {
|
||||
myRbInSetUp.setEnabled(false);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasSetUpChoice() {
|
||||
return myRbInSetUp != null;
|
||||
}
|
||||
|
||||
public void setInitializeInFieldDeclaration() {
|
||||
myRbInFieldDeclaration.setSelected(true);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class IntroduceFieldPopupPanel extends IntroduceFieldCentralPanel {
|
||||
}
|
||||
|
||||
final PsiMethod setUpMethod = TestFrameworks.getInstance().findSetUpMethod(myParentClass);
|
||||
final boolean setupEnabled = myInitialisersPlaceModel.getIndexOf(BaseExpressionToFieldHandler.InitializationPlace.IN_SETUP_METHOD) > -1;
|
||||
final boolean setupEnabled = hasSetUpChoice();
|
||||
if (ourLastInitializerPlace == BaseExpressionToFieldHandler.InitializationPlace.IN_SETUP_METHOD &&
|
||||
setupEnabled && (myInitializerExpression != null && PsiTreeUtil.isAncestor(setUpMethod, myInitializerExpression, false) ||
|
||||
TestFrameworks.getInstance().isTestClass(myParentClass))) {
|
||||
@@ -187,13 +187,22 @@ public class IntroduceFieldPopupPanel extends IntroduceFieldCentralPanel {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean updateInitializationPlaceModel() {
|
||||
protected boolean updateInitializationPlaceModel(boolean initializedInSetup) {
|
||||
myInitialisersPlaceModel.removeElement(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION);
|
||||
myInitialisersPlaceModel.removeElement(BaseExpressionToFieldHandler.InitializationPlace.IN_CONSTRUCTOR);
|
||||
myInitialisersPlaceModel.removeElement(BaseExpressionToFieldHandler.InitializationPlace.IN_SETUP_METHOD);
|
||||
if (!initializedInSetup) {
|
||||
myInitialisersPlaceModel.removeElement(BaseExpressionToFieldHandler.InitializationPlace.IN_SETUP_METHOD);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasSetUpChoice() {
|
||||
return myInitialisersPlaceModel.getIndexOf(BaseExpressionToFieldHandler.InitializationPlace.IN_SETUP_METHOD) > -1;
|
||||
}
|
||||
|
||||
public void setInitializeInFieldDeclaration() {
|
||||
LOG.assertTrue(myInitializerCombo != null);
|
||||
myInitializerCombo.setSelectedItem(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION);
|
||||
|
||||
@@ -87,6 +87,11 @@ public class IsConstantExpressionVisitor extends JavaElementVisitor {
|
||||
for (PsiExpression operand : expression.getOperands()) {
|
||||
operand.accept(this);
|
||||
if (!myIsConstant) return;
|
||||
final PsiType type = operand.getType();
|
||||
if (type != null && !(type instanceof PsiPrimitiveType) && !type.equalsToText(CommonClassNames.JAVA_LANG_STRING)) {
|
||||
myIsConstant = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -154,6 +154,9 @@ public class TypesDistinctProver {
|
||||
PsiType type2,
|
||||
PsiClass boundClass1,
|
||||
PsiClass boundClass2) {
|
||||
if (boundClass1 == null || boundClass2 == null) {
|
||||
return false;
|
||||
}
|
||||
if (boundClass1.isInterface() && boundClass2.isInterface()) return false;
|
||||
if (boundClass1.isInterface()) {
|
||||
return !(boundClass2.hasModifierProperty(PsiModifier.FINAL) ? InheritanceUtil.isInheritorOrSelf(boundClass2, boundClass1, true) : true);
|
||||
|
||||
@@ -376,7 +376,7 @@ public class PsiImplUtil {
|
||||
if (!annotationType.isAnnotationType()) return null;
|
||||
PsiModifierList modifierList = annotationType.getModifierList();
|
||||
if (modifierList == null) return null;
|
||||
PsiAnnotation target = modifierList.findAnnotation(CommonClassNames.TARGET_ANNOTATION_FQ_NAME);
|
||||
PsiAnnotation target = modifierList.findAnnotation(CommonClassNames.JAVA_LANG_ANNOTATION_TARGET);
|
||||
if (target == null) return DEFAULT_TARGETS; // if omitted it is applicable to all but Java 8 TYPE_USE/TYPE_PARAMETERS targets
|
||||
|
||||
PsiAnnotationMemberValue value = target.findAttributeValue(null);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2013 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.
|
||||
@@ -303,10 +303,6 @@ public class StubBuildingVisitor<T> extends ClassVisitor {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitAttribute(final Attribute attr) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitInnerClass(final String name, final String outerName, final String innerName, final int access) {
|
||||
if ((access & Opcodes.ACC_SYNTHETIC) != 0) return;
|
||||
@@ -339,13 +335,15 @@ public class StubBuildingVisitor<T> extends ClassVisitor {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public FieldVisitor visitField(final int access, final String name, final String desc, final String signature, final Object value) {
|
||||
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
|
||||
if ((access & Opcodes.ACC_SYNTHETIC) != 0) return null;
|
||||
if (!isCorrectName(name)) return null;
|
||||
|
||||
final byte flags = PsiFieldStubImpl.packFlags((access & Opcodes.ACC_ENUM) != 0, (access & Opcodes.ACC_DEPRECATED) != 0, false);
|
||||
final PsiFieldStub stub = new PsiFieldStubImpl(myResult, name, fieldType(desc, signature), constToString(value), flags);
|
||||
final PsiModifierListStub modList = new PsiModifierListStubImpl(stub, packFieldFlags(access));
|
||||
byte flags = PsiFieldStubImpl.packFlags((access & Opcodes.ACC_ENUM) != 0, (access & Opcodes.ACC_DEPRECATED) != 0, false);
|
||||
TypeInfo type = fieldType(desc, signature);
|
||||
String initializer = constToString(value, "boolean".equals(type.text.getString()));
|
||||
PsiFieldStub stub = new PsiFieldStubImpl(myResult, name, type, initializer, flags);
|
||||
PsiModifierListStub modList = new PsiModifierListStubImpl(stub, packFieldFlags(access));
|
||||
return new AnnotationCollectingVisitor(modList);
|
||||
}
|
||||
|
||||
@@ -358,7 +356,8 @@ public class StubBuildingVisitor<T> extends ClassVisitor {
|
||||
catch (ClsFormatException e) {
|
||||
return fieldTypeViaDescription(desc);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return fieldTypeViaDescription(desc);
|
||||
}
|
||||
}
|
||||
@@ -536,7 +535,7 @@ public class StubBuildingVisitor<T> extends ClassVisitor {
|
||||
@Override
|
||||
public void visit(final String name, final Object value) {
|
||||
valuePairPrefix(name);
|
||||
myBuilder.append(constToString(value));
|
||||
myBuilder.append(constToString(value, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -696,13 +695,21 @@ public class StubBuildingVisitor<T> extends ClassVisitor {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static String constToString(@Nullable Object value) {
|
||||
private static String constToString(@Nullable Object value, boolean isBoolean) {
|
||||
if (value == null) return null;
|
||||
|
||||
if (value instanceof String) return "\"" + StringUtil.escapeStringCharacters((String)value) + "\"";
|
||||
if (value instanceof Integer || value instanceof Boolean) return value.toString();
|
||||
if (value instanceof Boolean) return value.toString();
|
||||
if (value instanceof Long) return value.toString() + "L";
|
||||
|
||||
if (value instanceof Integer) {
|
||||
if (isBoolean) {
|
||||
if (value.equals(0)) return "false";
|
||||
if (value.equals(1)) return "true";
|
||||
}
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
if (value instanceof Double) {
|
||||
final double d = ((Double)value).doubleValue();
|
||||
if (Double.isInfinite(d)) {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
@interface Foo {
|
||||
String value();
|
||||
}
|
||||
|
||||
@Foo(<error descr="Attribute value must be constant">"myclass: " + Bar.class</error>)
|
||||
class Bar {}
|
||||
|
||||
@Foo("myclass: Bazz")
|
||||
class Bazz{}
|
||||
|
||||
@Foo("myclass:" + "Bazz1")
|
||||
class Bazz1{}
|
||||
|
||||
@Foo(Const.CONST + Const.CONST)
|
||||
class Bazz2{}
|
||||
|
||||
@Foo(<error descr="Incompatible types. Found: 'java.lang.Class<FooBar>', required: 'java.lang.String'">FooBar.class</error>)
|
||||
class FooBar {}
|
||||
|
||||
class Const {
|
||||
public static final String CONST = "const";
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Simplify boolean expression" "false"
|
||||
class A {
|
||||
{
|
||||
String a = "", b= "", c = "";
|
||||
boolean bb = a + + b <caret>== c;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
// IntelliJ API Decompiler stub source generated from a class file
|
||||
// Implementation of methods is not available
|
||||
|
||||
package pkg;
|
||||
|
||||
class Booleans {
|
||||
public static final boolean RELEASE = true;
|
||||
public static final boolean DEBUG = false;
|
||||
public static final boolean PROFILE = false;
|
||||
public static final boolean LOGV = false;
|
||||
public static final boolean LOGD = true;
|
||||
|
||||
Booleans() { /* compiled code */ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package pkg;
|
||||
|
||||
class Booleans {
|
||||
public static final boolean RELEASE = true;
|
||||
public static final boolean DEBUG = false;
|
||||
public static final boolean PROFILE = false;
|
||||
public static final boolean LOGV = false;
|
||||
public static final boolean LOGD = true;
|
||||
}
|
||||
@@ -172,4 +172,5 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
|
||||
public void testAmbiguousMethodCallIDEA100314() { doTest(false, false); }
|
||||
public void testInstanceMemberNotAccessibleInStaticContext() { doTest(false, false); }
|
||||
public void testRejectedTypeParamsForConstructor() { doTest(false, false); }
|
||||
public void testAnnotationArgs() throws Exception { doTest(false, false);}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ public class ClsMirrorBuildingTest extends LightIdeaTestCase {
|
||||
public void testMethodReceiver() { doTest(); }
|
||||
public void testPackageInfo() { doTest("package-info"); }
|
||||
public void testEA40568() { doTest(); }
|
||||
public void testBooleans() { doTest(); }
|
||||
|
||||
private void doTest() {
|
||||
doTest(getTestName(false));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2013 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.
|
||||
@@ -118,7 +118,7 @@ public class RedundantCastUtil {
|
||||
|
||||
@Override
|
||||
protected void addToResults(@NotNull PsiTypeCastExpression typeCast){
|
||||
if (!isTypeCastSemantical(typeCast)) {
|
||||
if (!isTypeCastSemantic(typeCast)) {
|
||||
myFoundCasts.add(typeCast);
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public class RedundantCastUtil {
|
||||
}
|
||||
|
||||
protected void addToResults(@NotNull PsiTypeCastExpression typeCast){
|
||||
if (!isTypeCastSemantical(typeCast)) {
|
||||
if (!isTypeCastSemantic(typeCast)) {
|
||||
isRedundant = true;
|
||||
}
|
||||
}
|
||||
@@ -446,7 +446,7 @@ public class RedundantCastUtil {
|
||||
if (parent instanceof PsiReturnStatement) return;
|
||||
if (parent instanceof PsiTypeCastExpression) return;
|
||||
|
||||
if (isTypeCastSemantical(typeCast)) return;
|
||||
if (isTypeCastSemantic(typeCast)) return;
|
||||
|
||||
PsiTypeElement typeElement = typeCast.getCastType();
|
||||
if (typeElement == null) return;
|
||||
@@ -511,7 +511,13 @@ public class RedundantCastUtil {
|
||||
return result.get().booleanValue();
|
||||
}
|
||||
|
||||
/** @deprecated use {@link #isTypeCastSemantic(PsiTypeCastExpression)} (to remove in IDEA 14) */
|
||||
@SuppressWarnings({"UnusedDeclaration", "SpellCheckingInspection"})
|
||||
public static boolean isTypeCastSemantical(PsiTypeCastExpression typeCast) {
|
||||
return isTypeCastSemantic(typeCast);
|
||||
}
|
||||
|
||||
public static boolean isTypeCastSemantic(PsiTypeCastExpression typeCast) {
|
||||
PsiExpression operand = typeCast.getOperand();
|
||||
if (operand == null) return false;
|
||||
|
||||
|
||||
@@ -33,14 +33,18 @@ public interface CommonClassNames {
|
||||
@NonNls String JAVA_LANG_THROWABLE = "java.lang.Throwable";
|
||||
@NonNls String JAVA_LANG_EXCEPTION = "java.lang.Exception";
|
||||
@NonNls String JAVA_LANG_ERROR = "java.lang.Error";
|
||||
@NonNls String JAVA_LANG_ASSERTION_ERROR = "java.lang.AssertionError";
|
||||
@NonNls String JAVA_LANG_RUNTIME_EXCEPTION = "java.lang.RuntimeException";
|
||||
@NonNls String JAVA_LANG_AUTO_CLOSEABLE = "java.lang.AutoCloseable";
|
||||
|
||||
@NonNls String JAVA_LANG_ITERABLE = "java.lang.Iterable";
|
||||
@NonNls String JAVA_UTIL_ITERATOR = "java.util.Iterator";
|
||||
|
||||
@NonNls String JAVA_LANG_RUNNABLE = "java.lang.Runnable";
|
||||
|
||||
@NonNls String JAVA_LANG_DEPRECATED = "java.lang.Deprecated";
|
||||
|
||||
@NonNls String JAVA_LANG_ANNOTATION_TARGET = "java.lang.annotation.Target";
|
||||
@NonNls String JAVA_LANG_ANNOTATION_INHERITED = "java.lang.annotation.Inherited";
|
||||
@NonNls String JAVA_LANG_ANNOTATION_ANNOTATION = "java.lang.annotation.Annotation";
|
||||
|
||||
@@ -50,7 +54,10 @@ public interface CommonClassNames {
|
||||
@NonNls String JAVA_UTIL_COLLECTIONS = "java.util.Collections";
|
||||
@NonNls String JAVA_UTIL_COLLECTION = "java.util.Collection";
|
||||
@NonNls String JAVA_UTIL_MAP = "java.util.Map";
|
||||
@NonNls String JAVA_UTIL_MAP_ENTRY = "java.util.Map.Entry";
|
||||
@NonNls String JAVA_UTIL_HASH_MAP = "java.util.HashMap";
|
||||
@NonNls String JAVA_UTIL_LIST = "java.util.List";
|
||||
@NonNls String JAVA_UTIL_ARRAY_LIST = "java.util.ArrayList";
|
||||
@NonNls String JAVA_UTIL_SET = "java.util.Set";
|
||||
@NonNls String JAVA_UTIL_PROPERTIES = "java.util.Properties";
|
||||
@NonNls String JAVA_UTIL_PROPERTY_RESOURCE_BUNDLE = "java.util.PropertyResourceBundle";
|
||||
@@ -59,11 +66,9 @@ public interface CommonClassNames {
|
||||
@NonNls String JAVA_UTIL_DICTIONARY = "java.util.Dictionary";
|
||||
@NonNls String JAVA_UTIL_COMPARATOR = "java.util.Comparator";
|
||||
|
||||
/** @deprecated not that common (to remove in IDEA 13) */
|
||||
@SuppressWarnings("UnusedDeclaration") @NonNls String JAVA_SQL_DATE = "java.sql.Date";
|
||||
|
||||
@NonNls String JAVA_IO_SERIALIZABLE = "java.io.Serializable";
|
||||
@NonNls String JAVA_IO_EXTERNALIZABLE = "java.io.Externalizable";
|
||||
@NonNls String JAVA_IO_FILE = "java.io.File";
|
||||
|
||||
@NonNls String JAVA_LANG_STRING = "java.lang.String";
|
||||
@NonNls String JAVA_LANG_STRING_SHORT = "String";
|
||||
@@ -83,17 +88,17 @@ public interface CommonClassNames {
|
||||
|
||||
@NonNls String JAVA_LANG_CLONEABLE = "java.lang.Cloneable";
|
||||
@NonNls String JAVA_LANG_COMPARABLE = "java.lang.Comparable";
|
||||
@NonNls String CLASS_FILE_EXTENSION = ".class";
|
||||
|
||||
@NonNls String JAVA_UTIL_CONCURRENT_FUTURE = "java.util.concurrent.Future";
|
||||
@NonNls String JAVA_UTIL_ARRAY_LIST = "java.util.ArrayList";
|
||||
@NonNls String JAVA_UTIL_CONCURRENT_CALLABLE = "java.util.concurrent.Callable";
|
||||
|
||||
@NonNls String JAVA_LANG_INVOKE_MH_POLYMORPHIC = "java.lang.invoke.MethodHandle.PolymorphicSignature";
|
||||
@NonNls String TARGET_ANNOTATION_FQ_NAME = "java.lang.annotation.Target";
|
||||
@NonNls String JAVA_LANG_RUNNABLE = "java.lang.Runnable";
|
||||
@NonNls String JAVA_IO_FILE = "java.io.File";
|
||||
@NonNls String JAVA_LANG_ASSERTION_ERROR = "java.lang.AssertionError";
|
||||
@NonNls String JAVA_UTIL_CONCURRENT_CALLABLE = "java.util.concurrent.Callable";
|
||||
@NonNls String JAVA_UTIL_MAP_ENTRY = "java.util.Map.Entry";
|
||||
@NonNls String JAVA_UTIL_HASH_MAP = "java.util.HashMap";
|
||||
|
||||
@NonNls String CLASS_FILE_EXTENSION = ".class";
|
||||
|
||||
/** @deprecated not that common (to remove in IDEA 13) */
|
||||
@SuppressWarnings("UnusedDeclaration") @NonNls String JAVA_SQL_DATE = "java.sql.Date";
|
||||
|
||||
/** @deprecated use {@link #JAVA_LANG_ANNOTATION_TARGET} (to remove in IDEA 14) */
|
||||
@SuppressWarnings("UnusedDeclaration") @NonNls String TARGET_ANNOTATION_FQ_NAME = JAVA_LANG_ANNOTATION_TARGET;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 648 B After Width: | Height: | Size: 651 B |
|
After Width: | Height: | Size: 442 B |
|
After Width: | Height: | Size: 908 B |
|
After Width: | Height: | Size: 731 B |
|
After Width: | Height: | Size: 213 B |
|
After Width: | Height: | Size: 213 B |
|
After Width: | Height: | Size: 500 B |
|
After Width: | Height: | Size: 502 B |
|
After Width: | Height: | Size: 345 B |
|
After Width: | Height: | Size: 606 B |
|
After Width: | Height: | Size: 611 B |
|
After Width: | Height: | Size: 383 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 109 B After Width: | Height: | Size: 185 B |
|
After Width: | Height: | Size: 263 B |
|
After Width: | Height: | Size: 263 B |
|
After Width: | Height: | Size: 183 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 589 B |
|
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 207 B |
|
After Width: | Height: | Size: 342 B |
|
After Width: | Height: | Size: 358 B |
|
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
|
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 283 B |
|
After Width: | Height: | Size: 523 B |
|
After Width: | Height: | Size: 675 B |
|
Before Width: | Height: | Size: 641 B After Width: | Height: | Size: 613 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 546 B |
|
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 177 B |
|
After Width: | Height: | Size: 285 B |
|
After Width: | Height: | Size: 286 B |
|
After Width: | Height: | Size: 177 B |
|
After Width: | Height: | Size: 388 B |
|
After Width: | Height: | Size: 468 B |
|
After Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 263 B |
|
After Width: | Height: | Size: 371 B |
|
After Width: | Height: | Size: 371 B |
|
After Width: | Height: | Size: 266 B |
|
After Width: | Height: | Size: 201 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 790 B |
|
After Width: | Height: | Size: 804 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 429 B After Width: | Height: | Size: 447 B |
|
After Width: | Height: | Size: 897 B |
|
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 613 B |
|
After Width: | Height: | Size: 627 B |
|
After Width: | Height: | Size: 327 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 351 B |
|
After Width: | Height: | Size: 729 B |
|
Before Width: | Height: | Size: 124 B After Width: | Height: | Size: 375 B |
|
After Width: | Height: | Size: 653 B |
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 389 B |
|
After Width: | Height: | Size: 658 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 395 B |
|
After Width: | Height: | Size: 719 B |
|
Before Width: | Height: | Size: 320 B After Width: | Height: | Size: 275 B |
|
After Width: | Height: | Size: 451 B |
|
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 471 B |
|
After Width: | Height: | Size: 945 B |
|
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 215 B |
|
After Width: | Height: | Size: 393 B |
|
Before Width: | Height: | Size: 397 B After Width: | Height: | Size: 404 B |
|
After Width: | Height: | Size: 793 B |
|
Before Width: | Height: | Size: 388 B After Width: | Height: | Size: 463 B |
|
After Width: | Height: | Size: 975 B |
|
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 471 B |
|
After Width: | Height: | Size: 945 B |
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 285 B |