From a7955b2458ec035524363a77e0b95aaa6fc0bc9d Mon Sep 17 00:00:00 2001 From: pasynkov Date: Tue, 16 Dec 2014 18:34:47 +0100 Subject: [PATCH 1/6] make public for Upsource --- .../openapi/editor/colors/impl/AbstractColorsScheme.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java index cd070861ee50..d9dce154db7b 100644 --- a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java +++ b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java @@ -349,7 +349,7 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme { attr.setErrorStripeColor(defaultColor); } } - private static final Map DEFAULT_ERROR_STRIPE_COLOR = new THashMap(); + public static final Map DEFAULT_ERROR_STRIPE_COLOR = new THashMap(); static { DEFAULT_ERROR_STRIPE_COLOR.put(CodeInsightColors.ERRORS_ATTRIBUTES.getExternalName(), Color.red); DEFAULT_ERROR_STRIPE_COLOR.put(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES.getExternalName(), Color.red); From 5ebabf673072be716772a0d4242740783ac06451 Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Tue, 16 Dec 2014 18:47:46 +0100 Subject: [PATCH 2/6] comment --- platform/util/src/com/intellij/util/lang/UrlClassLoader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/util/src/com/intellij/util/lang/UrlClassLoader.java b/platform/util/src/com/intellij/util/lang/UrlClassLoader.java index 7661baa44cb5..acbdb38a3a7c 100644 --- a/platform/util/src/com/intellij/util/lang/UrlClassLoader.java +++ b/platform/util/src/com/intellij/util/lang/UrlClassLoader.java @@ -46,6 +46,9 @@ public class UrlClassLoader extends ClassLoader { @NonNls static final String CLASS_EXTENSION = ".class"; static { + // Since Java 7 classloading is parallel on parallel capable classloader (http://docs.oracle.com/javase/7/docs/technotes/guides/lang/cl-mt.html) + // Parallel classloading avoids deadlocks like https://youtrack.jetbrains.com/issue/IDEA-131621 + // Unless explicitly disabled, request parallel loading capability via reflection due to current platform's Java 6 baseline // todo[r.sh] drop condition in IDEA 15 // todo[r.sh] drop reflection after migrating to Java 7+ boolean parallelLoader = Boolean.parseBoolean(System.getProperty("idea.parallel.class.loader", "true")); From fa18abfab35a303be82b3f8138197ba45fa5d9be Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Tue, 16 Dec 2014 21:09:04 +0300 Subject: [PATCH 3/6] Fall back to resolving super class expression if its type is not PyClassLikeType (PY-11541) This chanage fixes a regression that was introduced in the fix to PY-11541 for AST-based 'str' class in __builtins__.py. Currently 'basestring' has type 'str | unicode' for Python 3. This means that it is not added to the list of the class-like super types of 'str'. Now we try to resolve super class exrpressions to classes as a fall back mechanism and return the types of these classes. --- .../jetbrains/python/psi/impl/PyClassImpl.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java b/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java index 1b432994924c..a94f11e3d2c9 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java @@ -1190,7 +1190,23 @@ public class PyClassImpl extends PyBaseElementImpl implements PyCla continue; } final PyType type = context.getType(expression); - result.add(type instanceof PyClassLikeType ? (PyClassLikeType)type : null); + PyClassLikeType classLikeType = null; + if (type instanceof PyClassLikeType) { + classLikeType = (PyClassLikeType)type; + } + else { + final PsiReference ref = expression.getReference(); + if (ref != null) { + final PsiElement resolved = ref.resolve(); + if (resolved instanceof PyClass) { + final PyType resolvedType = context.getType((PyClass)resolved); + if (resolvedType instanceof PyClassLikeType) { + classLikeType = (PyClassLikeType)resolvedType; + } + } + } + } + result.add(classLikeType); } } final PyBuiltinCache builtinCache = PyBuiltinCache.getInstance(this); From 44bf42b33904ab8f791122558ef81cdbb7cd22a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Tue, 16 Dec 2014 19:10:36 +0100 Subject: [PATCH 4/6] run icons.gant --- .../resources/icons/OpenTerminal_13x13@2x.png | Bin 1091 -> 955 bytes .../edu/learn-python/gen/icons/StudyIcons.java | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/terminal/resources/icons/OpenTerminal_13x13@2x.png b/plugins/terminal/resources/icons/OpenTerminal_13x13@2x.png index de3cf3c60ac8f00a5a16d459fe8e16384d7dd8e0..80364d2c6bef9fff892c9350ebba59cfff29a4c5 100644 GIT binary patch literal 955 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI13?%1G+4F~iftew|C&cyt|Np;#|9<`Y^~Q}G zV`F1KefpG_m)Fci`#goGmk|NJ*{@Beo!Ph6np_Zh7oXL0G{>*Mclc>O5-K}y~4 zNSWQncK^iEkFI(xdVK%?^*c9u{r#=gl_lfU^;^ALf%&kpK{S`r5e;6RxE#i#E_F4I hhh~Pv`YgH4%235F*`IqwdIl({JYD@<);T3K0RU$Aeg6Oe literal 1091 zcmaJ=Pe>F|93C;m1cM?djbIvsEZUi!an+q+H`|@jTybPsms}y!*_o$1=*$~up6$BF z=#WAdp+qPmbT$w?2ufkLQl30_km}H74}~HK2KGi>?a(&x=KbOOzTfxzz26&)cHFD1 zsIDLgqB7Dd#qeD1j`C9cpPgL!ji)NqoIsthAEgx=5FrgF0U0rr0T2U{ak)ek-8S7y6R=GY>6PHw`Oh7 zneB+H*+G@psHQt)AR}M_10aRW7(=EbWP;S8u7KC>F+-7u5HuL1j!Y%wC@Df4ko9!E zNA+?n*~rsuy^m+v+a%{@>loI{aJ+|Q1z)4UHju|3g`?S8zYvpJj$`3nkV+wB2@I1? zr|EPZ4ebGj<$0d*atz0LFv8=Enn=lbOsA%xAOT0UbqndxBwa-%2}e+n!cLD;Fsu_< z(>X2^E*O(hEQY1MZb}89EdL*B7$;~4#lWfGe+oPCQ426J;J^`E#TVCKt_dvf6Q!^i_OmSw zEZgk!i=hzT$Vqi|em@`baRsgf)e!@jsKC`uxnfbS+X;q+BTK;69|5h!h6Z_ggo<(*Y=&{~^{;y_9O341mnU6|Hz$1$Ox)}??&|Ne56i7v3?>Vh2ohn$rtNqFPA-=yng>~qOGDd zO6QpI&he?StFJCLUV8JCpqHQIs$LJbE|f>CzNzFl<%0HO?N;t%?fTeS)yfcgzRWw< kmiqdVy7BH)>lLD;jL6M}KLkqh58Y=SY3`8ThWj4>0R;7O)c^nh diff --git a/python/edu/learn-python/gen/icons/StudyIcons.java b/python/edu/learn-python/gen/icons/StudyIcons.java index 477e5ed54364..f1db45d83e73 100644 --- a/python/edu/learn-python/gen/icons/StudyIcons.java +++ b/python/edu/learn-python/gen/icons/StudyIcons.java @@ -13,7 +13,7 @@ public class StudyIcons { return IconLoader.getIcon(path, StudyIcons.class); } - public static final Icon EducationalProjectType = load("/icons/com/jetbrains/python/edu/EducationalProjectType.png"); // 32x32 + public static final Icon EducationalProjectType = load("/icons/com/jetbrains/python/edu/EducationalProjectType.png"); // 16x16 public static final Icon Lesson = load("/icons/com/jetbrains/python/edu/Lesson.png"); // 16x16 public static final Icon LessonCompl = load("/icons/com/jetbrains/python/edu/LessonCompl.png"); // 16x16 public static final Icon Prev = load("/icons/com/jetbrains/python/edu/prev.png"); // 16x16 From 984255e539e2ddff79746170d74323ada631f405 Mon Sep 17 00:00:00 2001 From: nik Date: Tue, 16 Dec 2014 21:47:16 +0300 Subject: [PATCH 5/6] SegmentArrayWithData: fixed contradictory comparison in range check --- .../intellij/openapi/editor/ex/util/SegmentArrayWithData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/core-impl/src/com/intellij/openapi/editor/ex/util/SegmentArrayWithData.java b/platform/core-impl/src/com/intellij/openapi/editor/ex/util/SegmentArrayWithData.java index 8463c49b339f..27f65f9f1e88 100644 --- a/platform/core-impl/src/com/intellij/openapi/editor/ex/util/SegmentArrayWithData.java +++ b/platform/core-impl/src/com/intellij/openapi/editor/ex/util/SegmentArrayWithData.java @@ -31,7 +31,7 @@ public class SegmentArrayWithData extends SegmentArray { } public void setElementAt(int i, int startOffset, int endOffset, int data) { - if (data < 0 && data > Short.MAX_VALUE) throw new IndexOutOfBoundsException("data out of short range" + data); + if (data < 0 || data > Short.MAX_VALUE) throw new IndexOutOfBoundsException("data out of short range" + data); setElementAt(i, startOffset, endOffset); myData = reallocateArray(myData, i+1); myData[i] = (short)data; From 7715e85c7e4cc2eeb2356d3d88d0ec012842b379 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 16 Dec 2014 20:23:25 +0100 Subject: [PATCH 6/6] IDEA-133851 (no-runtime annotations ignored by inspection) --- .../daemon/impl/analysis/AnnotationsHighlightUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java index 642a8edb755f..ffbacaad7f08 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java @@ -701,7 +701,7 @@ public class AnnotationsHighlightUtil { } @Nullable - private static RetentionPolicy getRetentionPolicy(PsiClass annotation) { + public static RetentionPolicy getRetentionPolicy(@NotNull PsiClass annotation) { PsiModifierList modifierList = annotation.getModifierList(); if (modifierList != null) { PsiAnnotation retentionAnno = modifierList.findAnnotation(CommonClassNames.JAVA_LANG_ANNOTATION_RETENTION);