Merge remote-tracking branch 'origin/master'

This commit is contained in:
Konstantin Bulenkov
2016-08-11 21:55:00 +02:00
157 changed files with 2369 additions and 1311 deletions
+9
View File
@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="automaton">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/automaton.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
@@ -1,19 +1,3 @@
/*
* Copyright 2000-2016 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* The following code was generated by JFlex 1.7.0-SNAPSHOT tweaked for IntelliJ platform */
/* It's an automatically generated code. Do not modify it. */
@@ -144,12 +128,12 @@ class _RegExLexer implements FlexLexer {
/* The ZZ_CMAP_A table has 3056 entries */
static final char ZZ_CMAP_A[] = zzUnpackCMap(
"\10\0\2\65\1\60\1\61\1\62\1\60\22\0\1\55\1\70\1\0\1\71\1\17\1\0\1\64\1\53"+
"\1\4\1\5\1\21\1\22\1\57\1\47\1\3\1\0\1\2\7\46\2\1\1\63\1\0\1\52\1\67\1\66"+
"\1\20\1\0\2\26\1\35\1\33\1\43\1\41\1\27\1\50\1\36\2\13\3\56\1\13\1\40\1\42"+
"\1\31\1\32\2\13\3\31\1\13\1\30\1\10\1\12\1\11\1\16\1\14\1\0\1\25\1\26\1\34"+
"\1\33\2\25\1\54\1\50\1\36\1\13\1\51\2\13\1\24\1\13\1\37\1\13\1\24\1\31\1\24"+
"\1\45\2\31\1\44\1\13\1\27\1\6\1\23\1\7\7\0\1\61\24\0\1\13\12\0\1\13\4\0\1"+
"\10\0\2\66\1\61\1\62\1\63\1\61\22\0\1\56\1\71\1\0\1\72\1\17\1\0\1\65\1\55"+
"\1\4\1\5\1\21\1\22\1\60\1\51\1\3\1\0\1\2\7\50\2\1\1\64\1\0\1\54\1\70\1\67"+
"\1\20\1\0\2\30\1\37\1\35\1\45\1\43\1\31\1\52\1\40\2\13\3\57\1\13\1\42\1\44"+
"\1\33\1\34\2\13\3\33\1\13\1\32\1\10\1\12\1\11\1\16\1\14\1\0\1\25\1\26\1\36"+
"\1\35\2\25\1\27\1\52\1\40\1\13\1\53\2\13\1\24\1\13\1\41\1\13\1\24\1\33\1\24"+
"\1\47\2\33\1\46\1\13\1\31\1\6\1\23\1\7\7\0\1\62\24\0\1\13\12\0\1\13\4\0\1"+
"\13\5\0\27\13\1\0\12\13\4\0\14\13\16\0\5\13\7\0\1\13\1\0\1\13\1\0\5\13\1\0"+
"\2\13\2\0\4\13\1\0\1\13\6\0\1\13\1\0\3\13\1\0\1\13\1\0\4\13\1\0\23\13\1\0"+
"\13\13\10\0\6\13\1\0\26\13\2\0\1\13\6\0\10\13\10\0\13\13\5\0\3\13\15\0\12"+
@@ -173,7 +157,7 @@ class _RegExLexer implements FlexLexer {
"\1\13\5\0\17\13\1\0\16\13\2\0\14\13\13\0\1\13\15\0\7\13\7\0\16\13\15\0\2\13"+
"\12\15\3\0\3\13\11\0\4\13\1\0\4\13\3\0\2\13\11\0\10\13\1\0\1\13\1\0\1\13\1"+
"\0\1\13\1\0\6\13\1\0\7\13\1\0\1\13\3\0\3\13\1\0\7\13\3\0\4\13\2\0\6\13\14"+
"\0\2\61\7\0\1\13\15\0\1\13\2\0\1\13\4\0\1\13\2\0\12\13\1\0\1\13\3\0\5\13\6"+
"\0\2\62\7\0\1\13\15\0\1\13\2\0\1\13\4\0\1\13\2\0\12\13\1\0\1\13\3\0\5\13\6"+
"\0\1\13\1\0\1\13\1\0\1\13\1\0\4\13\1\0\13\13\2\0\4\13\5\0\5\13\4\0\1\13\4"+
"\0\2\13\13\0\5\13\6\0\4\13\3\0\2\13\14\0\10\13\7\0\10\13\1\0\7\13\6\0\2\13"+
"\12\0\5\13\5\0\2\13\3\0\7\13\6\0\3\13\12\15\2\13\13\0\11\13\2\0\27\13\2\0"+
@@ -207,16 +191,17 @@ class _RegExLexer implements FlexLexer {
"\1\10\1\36\1\2\1\37\1\40\1\37\1\41\1\42"+
"\1\43\1\44\1\45\1\46\1\1\1\47\1\50\2\51"+
"\1\52\1\53\1\0\1\54\1\55\1\56\1\57\1\60"+
"\1\10\1\61\1\62\1\63\2\64\1\65\1\66\1\67"+
"\1\70\1\55\1\71\1\72\2\10\1\73\1\74\1\75"+
"\1\76\1\77\1\100\1\101\1\102\1\0\1\103\1\104"+
"\1\105\1\106\1\107\1\0\1\110\1\111\1\112\2\67"+
"\1\70\1\55\1\113\1\114\1\115\1\116\1\117\1\120"+
"\1\121\1\122\1\0\1\111\1\123\2\67\1\70\1\124"+
"\1\125\1\111\1\67\1\70\1\67\1\126\4\67";
"\1\10\1\61\1\62\1\10\1\62\1\63\2\64\1\65"+
"\1\66\1\67\1\70\1\55\1\71\1\72\1\10\1\73"+
"\1\74\1\75\1\76\1\77\1\100\1\101\1\102\1\0"+
"\1\103\1\104\1\105\1\106\1\107\1\0\1\110\1\111"+
"\1\0\1\112\1\113\1\114\2\67\1\70\1\55\1\115"+
"\1\116\1\117\1\120\1\121\1\122\1\0\1\111\1\0"+
"\1\123\2\67\1\70\1\124\1\125\1\111\1\67\1\70"+
"\1\67\1\126\4\67";
private static int [] zzUnpackAction() {
int [] result = new int[130];
int [] result = new int[133];
int offset = 0;
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
return result;
@@ -241,26 +226,26 @@ class _RegExLexer implements FlexLexer {
private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\72\0\164\0\256\0\350\0\u0122\0\u015c\0\u0196"+
"\0\u01d0\0\u020a\0\u0244\0\u027e\0\u02b8\0\u02f2\0\u032c\0\u032c"+
"\0\u0366\0\u032c\0\u032c\0\u03a0\0\u03da\0\u032c\0\u032c\0\u032c"+
"\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u0414"+
"\0\u032c\0\u044e\0\u032c\0\u0488\0\u032c\0\u032c\0\u032c\0\u032c"+
"\0\u032c\0\u04c2\0\u032c\0\u04fc\0\u032c\0\u0536\0\u032c\0\u032c"+
"\0\u03a0\0\u032c\0\u032c\0\u032c\0\u0570\0\u05aa\0\u032c\0\u032c"+
"\0\u032c\0\u032c\0\u032c\0\u05e4\0\u061e\0\u032c\0\u0658\0\u032c"+
"\0\u0692\0\u06cc\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c"+
"\0\u0706\0\u032c\0\u032c\0\u032c\0\u0740\0\u077a\0\u07b4\0\u032c"+
"\0\u032c\0\u07ee\0\u0828\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c"+
"\0\u032c\0\u032c\0\u032c\0\u0862\0\u089c\0\u032c\0\u032c\0\u032c"+
"\0\u032c\0\u08d6\0\u032c\0\u0910\0\u032c\0\u094a\0\u0984\0\u09be"+
"\0\u09f8\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c"+
"\0\u032c\0\u0a32\0\u0a6c\0\u032c\0\u0aa6\0\u032c\0\u0ae0\0\u0692"+
"\0\u032c\0\u032c\0\u0b1a\0\u0b54\0\u0b8e\0\u032c\0\u0bc8\0\u0c02"+
"\0\u0c3c\0\u0c76";
"\0\0\0\73\0\166\0\261\0\354\0\u0127\0\u0162\0\u019d"+
"\0\u01d8\0\u0213\0\u024e\0\u0289\0\u02c4\0\u02ff\0\u033a\0\u033a"+
"\0\u0375\0\u033a\0\u033a\0\u03b0\0\u03eb\0\u033a\0\u033a\0\u033a"+
"\0\u033a\0\u033a\0\u033a\0\u033a\0\u033a\0\u033a\0\u033a\0\u0426"+
"\0\u033a\0\u0461\0\u033a\0\u049c\0\u033a\0\u033a\0\u033a\0\u033a"+
"\0\u033a\0\u04d7\0\u033a\0\u0512\0\u033a\0\u054d\0\u033a\0\u033a"+
"\0\u03b0\0\u033a\0\u033a\0\u033a\0\u0588\0\u05c3\0\u033a\0\u033a"+
"\0\u033a\0\u033a\0\u033a\0\u05fe\0\u0639\0\u033a\0\u0674\0\u033a"+
"\0\u06af\0\u06ea\0\u033a\0\u033a\0\u033a\0\u033a\0\u0725\0\u0760"+
"\0\u033a\0\u033a\0\u079b\0\u033a\0\u033a\0\u033a\0\u07d6\0\u0811"+
"\0\u084c\0\u033a\0\u033a\0\u0887\0\u033a\0\u033a\0\u033a\0\u033a"+
"\0\u033a\0\u033a\0\u033a\0\u033a\0\u08c2\0\u08fd\0\u033a\0\u033a"+
"\0\u033a\0\u033a\0\u0938\0\u033a\0\u0973\0\u09ae\0\u033a\0\u033a"+
"\0\u033a\0\u09e9\0\u0a24\0\u0a5f\0\u0a9a\0\u033a\0\u033a\0\u033a"+
"\0\u033a\0\u033a\0\u033a\0\u0ad5\0\u0b10\0\u0b4b\0\u033a\0\u0b86"+
"\0\u033a\0\u0bc1\0\u06af\0\u033a\0\u033a\0\u0bfc\0\u0c37\0\u0c72"+
"\0\u033a\0\u0cad\0\u0ce8\0\u0d23\0\u0d5e";
private static int [] zzUnpackRowMap() {
int [] result = new int[130];
int [] result = new int[133];
int offset = 0;
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
return result;
@@ -285,78 +270,81 @@ class _RegExLexer implements FlexLexer {
private static final String ZZ_TRANS_PACKED_0 =
"\3\17\1\20\1\21\1\22\1\23\1\17\1\24\1\17"+
"\1\25\3\17\1\26\1\27\1\30\1\31\1\32\1\33"+
"\23\17\1\34\5\17\1\35\2\17\1\36\1\17\1\36"+
"\2\17\1\36\3\17\1\37\12\17\1\40\57\17\1\41"+
"\25\17\1\34\4\17\1\35\2\17\1\36\1\17\1\36"+
"\2\17\1\36\3\17\1\37\12\17\1\40\60\17\1\41"+
"\2\42\4\41\1\43\3\41\1\44\1\41\1\42\1\45"+
"\5\41\22\44\1\42\1\41\2\44\2\41\1\44\1\41"+
"\1\44\1\46\12\41\11\47\1\50\46\47\3\0\25\47"+
"\1\51\41\47\3\0\7\47\6\17\1\23\1\17\1\52"+
"\1\53\1\54\3\17\1\26\30\17\1\34\10\17\1\55"+
"\1\17\1\55\1\17\1\56\1\55\4\17\6\57\1\60"+
"\1\57\1\61\1\57\1\25\15\57\1\62\1\57\1\62"+
"\2\57\1\62\2\57\1\62\15\57\1\62\13\57\5\63"+
"\1\64\5\63\1\65\10\63\22\65\1\63\1\66\2\65"+
"\2\63\1\65\1\63\1\65\4\63\1\67\6\63\60\11"+
"\1\70\11\11\13\63\1\44\10\63\22\44\2\63\2\44"+
"\2\63\1\44\1\63\1\44\7\63\1\71\16\63\1\44"+
"\10\63\22\44\2\63\2\44\1\63\1\72\1\44\1\63"+
"\1\44\20\63\1\64\5\63\1\44\10\63\22\44\2\63"+
"\2\44\2\63\1\44\1\63\1\44\14\63\2\42\2\63"+
"\1\64\5\63\1\44\1\63\1\42\6\63\22\44\1\42"+
"\1\63\2\44\2\63\1\44\1\63\1\44\13\63\13\73"+
"\1\44\2\73\1\26\5\73\22\44\2\73\2\44\2\73"+
"\1\44\1\73\1\44\4\73\1\74\6\73\112\0\1\75"+
"\62\0\1\76\4\0\1\77\53\0\1\100\1\101\1\102"+
"\4\103\1\100\1\104\1\100\1\104\1\105\2\100\1\104"+
"\5\103\2\106\3\107\3\110\1\111\2\112\2\113\1\105"+
"\1\114\1\105\1\115\1\116\1\117\1\120\1\121\1\122"+
"\2\100\1\123\1\124\1\105\1\100\1\124\1\100\1\124"+
"\2\100\1\124\4\100\43\0\1\125\27\0\2\42\12\0"+
"\1\42\30\0\1\42\24\0\2\44\10\0\3\44\6\0"+
"\23\44\1\0\2\44\2\0\1\44\1\0\1\44\24\0"+
"\1\126\4\0\1\77\44\0\1\127\6\0\1\100\1\101"+
"\1\102\4\103\1\100\1\104\1\130\1\104\1\105\2\100"+
"\1\104\5\103\2\106\3\107\3\110\1\111\2\112\2\113"+
"\1\105\1\114\1\105\1\115\1\116\1\117\1\120\1\121"+
"\1\122\2\100\1\123\1\124\1\105\1\100\1\124\1\100"+
"\1\124\2\100\1\124\4\100\64\0\1\131\20\0\1\65"+
"\10\0\22\65\2\0\2\65\2\0\1\65\1\0\1\65"+
"\26\0\1\66\10\0\22\66\2\0\2\66\2\0\1\66"+
"\1\0\1\66\24\0\1\132\64\0\1\133\33\0\1\134"+
"\11\0\1\135\1\136\7\0\1\137\2\0\1\137\1\140"+
"\1\141\1\142\11\0\1\143\61\0\2\101\43\0\1\101"+
"\25\0\1\144\43\0\1\144\23\0\72\145\1\0\2\146"+
"\3\0\1\147\16\0\2\146\4\0\3\146\3\0\1\146"+
"\1\0\1\146\2\0\1\146\24\0\2\150\22\0\2\150"+
"\4\0\3\150\3\0\1\150\1\0\1\150\2\0\1\150"+
"\24\0\1\101\1\151\43\0\1\151\75\0\1\152\1\153"+
"\70\0\1\154\1\155\70\0\1\156\14\0\1\157\71\0"+
"\1\160\1\161\1\0\5\162\1\0\64\162\2\0\1\163"+
"\43\0\1\163\24\0\2\164\22\0\2\164\4\0\3\164"+
"\3\0\1\164\1\0\1\164\2\0\1\164\24\0\2\165"+
"\4\0\1\166\15\0\2\165\4\0\3\165\3\0\1\165"+
"\1\0\1\165\2\0\1\165\24\0\2\167\22\0\2\167"+
"\4\0\3\167\3\0\1\167\1\0\1\167\2\0\1\167"+
"\24\0\1\101\1\170\43\0\1\170\23\0\5\162\1\171"+
"\64\162\2\0\1\172\43\0\1\172\24\0\2\173\4\0"+
"\1\164\15\0\2\173\4\0\3\173\3\0\1\173\1\0"+
"\1\173\2\0\1\173\24\0\2\174\22\0\2\174\4\0"+
"\3\174\3\0\1\174\1\0\1\174\2\0\1\174\24\0"+
"\2\175\4\0\1\164\15\0\2\175\4\0\3\175\3\0"+
"\1\175\1\0\1\175\2\0\1\175\24\0\2\176\22\0"+
"\2\176\4\0\3\176\3\0\1\176\1\0\1\176\2\0"+
"\1\176\24\0\2\177\4\0\1\164\15\0\2\177\4\0"+
"\3\177\3\0\1\177\1\0\1\177\2\0\1\177\24\0"+
"\2\200\4\0\1\164\15\0\2\200\4\0\3\200\3\0"+
"\1\200\1\0\1\200\2\0\1\200\24\0\2\201\4\0"+
"\1\164\15\0\2\201\4\0\3\201\3\0\1\201\1\0"+
"\1\201\2\0\1\201\24\0\2\202\4\0\1\164\15\0"+
"\2\202\4\0\3\202\3\0\1\202\1\0\1\202\2\0"+
"\1\202\24\0\2\202\4\0\1\166\15\0\2\202\4\0"+
"\3\202\3\0\1\202\1\0\1\202\2\0\1\202\23\0";
"\5\41\24\44\1\42\1\41\2\44\3\41\1\44\1\46"+
"\12\41\11\47\1\50\47\47\3\0\25\47\1\51\42\47"+
"\3\0\7\47\6\17\1\23\1\17\1\52\1\53\1\54"+
"\3\17\1\26\32\17\1\34\7\17\1\55\1\17\1\55"+
"\1\17\1\56\1\55\4\17\6\57\1\60\1\57\1\61"+
"\1\57\1\25\17\57\1\62\1\57\1\62\2\57\1\62"+
"\2\57\1\62\14\57\1\62\13\57\5\63\1\64\5\63"+
"\1\65\10\63\24\65\1\63\1\66\2\65\3\63\1\65"+
"\4\63\1\67\6\63\61\11\1\70\11\11\13\63\1\44"+
"\10\63\24\44\2\63\2\44\3\63\1\44\7\63\1\71"+
"\16\63\1\44\10\63\24\44\2\63\2\44\1\63\1\72"+
"\1\63\1\44\20\63\1\64\5\63\1\44\10\63\24\44"+
"\2\63\2\44\3\63\1\44\14\63\2\42\2\63\1\64"+
"\5\63\1\44\1\63\1\42\6\63\24\44\1\42\1\63"+
"\2\44\3\63\1\44\13\63\13\73\1\44\2\73\1\26"+
"\5\73\24\44\2\73\2\44\3\73\1\44\4\73\1\74"+
"\6\73\113\0\1\75\63\0\1\76\4\0\1\77\54\0"+
"\1\100\1\101\1\102\4\103\1\100\1\104\1\100\1\104"+
"\1\105\2\100\1\104\5\103\2\106\1\107\1\110\3\111"+
"\3\112\1\113\2\114\2\115\1\105\1\116\1\105\1\117"+
"\1\120\1\121\1\122\1\123\1\124\2\100\1\125\1\105"+
"\1\100\1\125\1\100\1\125\2\100\1\125\4\100\45\0"+
"\1\126\26\0\2\42\12\0\1\42\32\0\1\42\23\0"+
"\2\44\10\0\3\44\6\0\25\44\1\0\2\44\3\0"+
"\1\44\24\0\1\127\4\0\1\77\45\0\1\130\6\0"+
"\1\100\1\101\1\102\4\103\1\100\1\104\1\131\1\104"+
"\1\105\2\100\1\104\5\103\2\106\1\107\1\110\3\111"+
"\3\112\1\113\2\114\2\115\1\105\1\116\1\105\1\117"+
"\1\120\1\121\1\122\1\123\1\124\2\100\1\125\1\105"+
"\1\100\1\125\1\100\1\125\2\100\1\125\4\100\65\0"+
"\1\132\20\0\1\65\10\0\24\65\2\0\2\65\3\0"+
"\1\65\26\0\1\66\10\0\24\66\2\0\2\66\3\0"+
"\1\66\24\0\1\133\65\0\1\134\35\0\1\135\11\0"+
"\1\136\1\137\6\0\1\140\2\0\1\140\1\141\1\142"+
"\1\143\11\0\1\144\62\0\2\101\45\0\1\101\24\0"+
"\1\145\45\0\1\145\30\0\1\146\140\0\1\147\1\150"+
"\15\0\73\151\1\0\2\152\3\0\1\153\16\0\2\152"+
"\1\0\1\152\4\0\3\152\3\0\1\152\1\0\1\152"+
"\2\0\1\152\23\0\2\154\22\0\2\154\1\0\1\154"+
"\4\0\3\154\3\0\1\154\1\0\1\154\2\0\1\154"+
"\23\0\1\101\1\155\45\0\1\155\76\0\1\156\1\157"+
"\71\0\1\160\13\0\1\161\72\0\1\162\1\163\1\0"+
"\5\164\1\0\65\164\2\0\1\165\45\0\1\165\51\0"+
"\1\166\44\0\2\167\22\0\2\167\1\0\1\167\4\0"+
"\3\167\3\0\1\167\1\0\1\167\2\0\1\167\23\0"+
"\2\170\4\0\1\171\15\0\2\170\1\0\1\170\4\0"+
"\3\170\3\0\1\170\1\0\1\170\2\0\1\170\23\0"+
"\2\172\22\0\2\172\1\0\1\172\4\0\3\172\3\0"+
"\1\172\1\0\1\172\2\0\1\172\23\0\1\101\1\173"+
"\45\0\1\173\22\0\5\164\1\174\65\164\2\0\1\175"+
"\45\0\1\175\31\0\1\111\64\0\2\176\4\0\1\167"+
"\15\0\2\176\1\0\1\176\4\0\3\176\3\0\1\176"+
"\1\0\1\176\2\0\1\176\23\0\2\177\22\0\2\177"+
"\1\0\1\177\4\0\3\177\3\0\1\177\1\0\1\177"+
"\2\0\1\177\23\0\2\200\4\0\1\167\15\0\2\200"+
"\1\0\1\200\4\0\3\200\3\0\1\200\1\0\1\200"+
"\2\0\1\200\23\0\2\201\22\0\2\201\1\0\1\201"+
"\4\0\3\201\3\0\1\201\1\0\1\201\2\0\1\201"+
"\23\0\2\202\4\0\1\167\15\0\2\202\1\0\1\202"+
"\4\0\3\202\3\0\1\202\1\0\1\202\2\0\1\202"+
"\23\0\2\203\4\0\1\167\15\0\2\203\1\0\1\203"+
"\4\0\3\203\3\0\1\203\1\0\1\203\2\0\1\203"+
"\23\0\2\204\4\0\1\167\15\0\2\204\1\0\1\204"+
"\4\0\3\204\3\0\1\204\1\0\1\204\2\0\1\204"+
"\23\0\2\205\4\0\1\167\15\0\2\205\1\0\1\205"+
"\4\0\3\205\3\0\1\205\1\0\1\205\2\0\1\205"+
"\23\0\2\205\4\0\1\171\15\0\2\205\1\0\1\205"+
"\4\0\3\205\3\0\1\205\1\0\1\205\2\0\1\205"+
"\22\0";
private static int [] zzUnpackTrans() {
int [] result = new int[3248];
int [] result = new int[3481];
int offset = 0;
offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
return result;
@@ -397,13 +385,14 @@ class _RegExLexer implements FlexLexer {
"\10\0\1\1\5\0\2\11\1\1\2\11\2\1\12\11"+
"\1\1\1\11\1\1\1\11\1\1\5\11\1\1\1\11"+
"\1\1\1\11\1\1\2\11\1\1\3\11\2\1\5\11"+
"\2\1\1\11\1\0\1\11\2\1\6\11\1\1\3\11"+
"\3\1\2\11\2\1\10\11\1\0\1\1\4\11\1\0"+
"\1\11\1\1\1\11\4\1\10\11\1\0\1\1\1\11"+
"\1\1\1\11\2\1\2\11\3\1\1\11\4\1";
"\2\1\1\11\1\0\1\11\2\1\4\11\2\1\2\11"+
"\1\1\3\11\3\1\2\11\1\1\10\11\1\0\1\1"+
"\4\11\1\0\1\11\1\1\1\0\3\11\4\1\6\11"+
"\1\0\1\1\1\0\1\11\1\1\1\11\2\1\2\11"+
"\3\1\1\11\4\1";
private static int [] zzUnpackAttribute() {
int [] result = new int[130];
int [] result = new int[133];
int offset = 0;
offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
return result;
@@ -1094,23 +1083,23 @@ class _RegExLexer implements FlexLexer {
}
case 159: break;
case 74:
{ if (xmlSchemaMode) { yypushback(1); return RegExpTT.CHAR_CLASS; } else return RegExpTT.CTRL;
{ yybegin(NAMED_GROUP); return RegExpTT.RUBY_NAMED_GROUP_CALL;
}
case 160: break;
case 75:
{ yybegin(NAMED_GROUP); return RegExpTT.RUBY_NAMED_GROUP_REF;
{ yybegin(QUOTED_NAMED_GROUP); return RegExpTT.RUBY_QUOTED_NAMED_GROUP_CALL;
}
case 161: break;
case 76:
{ yybegin(QUOTED_NAMED_GROUP); return RegExpTT.RUBY_QUOTED_NAMED_GROUP_REF;
{ if (xmlSchemaMode) { yypushback(1); return RegExpTT.CHAR_CLASS; } else return RegExpTT.CTRL;
}
case 162: break;
case 77:
{ yybegin(NAMED_GROUP); return RegExpTT.RUBY_NAMED_GROUP_CALL;
{ yybegin(NAMED_GROUP); return RegExpTT.RUBY_NAMED_GROUP_REF;
}
case 163: break;
case 78:
{ yybegin(QUOTED_NAMED_GROUP); return RegExpTT.RUBY_QUOTED_NAMED_GROUP_CALL;
{ yybegin(QUOTED_NAMED_GROUP); return RegExpTT.RUBY_QUOTED_NAMED_GROUP_REF;
}
case 164: break;
case 79:
@@ -113,6 +113,7 @@ public final class DefaultRegExpPropertiesProvider {
{"w", "Word character: [a-zA-Z_0-9]"},
{"W", "Nonword character: [^\\w]"},
{"b", "Word boundary"},
{"b{g}", "Unicode extended grapheme cluster boundary"},
{"B", "Non-word boundary"},
{"A", "Beginning of the input"},
{"G", "End of the previous match"},
@@ -36,6 +36,23 @@ public interface RegExpLanguageHost {
return true;
}
default boolean supportsBoundary(RegExpBoundary boundary) {
switch (boundary.getType()) {
case UNICODE_EXTENDED_GRAPHEME:
return false;
case LINE_START:
case LINE_END:
case WORD:
case NON_WORD:
case BEGIN:
case END:
case END_NO_LINE_TERM:
case PREVIOUS_MATCH:
default:
return true;
}
}
default boolean supportsLiteralBackspace(RegExpChar aChar) {
return true;
}
@@ -131,6 +131,11 @@ public final class RegExpLanguageHosts extends ClassExtension<RegExpLanguageHost
return host == null || host.supportsPossessiveQuantifiers();
}
public boolean supportsBoundary(@Nullable final RegExpBoundary boundary) {
final RegExpLanguageHost host = findRegExpHost(boundary);
return host == null || host.supportsBoundary(boundary);
}
public boolean supportsSimpleClass(@Nullable final RegExpSimpleClass simpleClass) {
final RegExpLanguageHost host = findRegExpHost(simpleClass);
return host == null || host.supportsSimpleClass(simpleClass);
@@ -23,7 +23,7 @@ public interface RegExpBoundary extends RegExpAtom {
*/
enum Type {
LINE_START, LINE_END,
WORD, NON_WORD,
WORD, UNICODE_EXTENDED_GRAPHEME, NON_WORD,
BEGIN, END, END_NO_LINE_TERM,
PREVIOUS_MATCH
}
@@ -37,19 +37,20 @@ public class RegExpBoundaryImpl extends RegExpElementImpl implements RegExpBound
} else if (type == RegExpTT.DOLLAR) {
return Type.LINE_END;
} else {
assert type == RegExpTT.BOUNDARY;
final String s = getUnescapedText();
if (s.equals("\\b")) {
return Type.WORD;
} else if (s.equals("\\B))")) {
} else if (s.equals("\\b{g}")) {
return Type.UNICODE_EXTENDED_GRAPHEME;
} else if (s.equals("\\B")) {
return Type.NON_WORD;
} else if (s.equals("\\A))")) {
} else if (s.equals("\\A")) {
return Type.BEGIN;
} else if (s.equals("\\Z))")) {
} else if (s.equals("\\Z")) {
return Type.END_NO_LINE_TERM;
} else if (s.equals("\\z))")) {
} else if (s.equals("\\z")) {
return Type.END;
} else if (s.equals("\\G))")) {
} else if (s.equals("\\G")) {
return Type.PREVIOUS_MATCH;
}
}
@@ -106,7 +106,7 @@ META1 = {ESCAPE} | {LBRACKET} | "^"
META2= {DOT} | "$" | "?" | "*" | "+" | "|" | {LBRACE} | {LPAREN} | {RPAREN}
CONTROL="t" | "n" | "r" | "f" | "a" | "e"
BOUNDARY="b" | "B" | "A" | "z" | "Z" | "G"
BOUNDARY="b" | "b{g}"| "B" | "A" | "z" | "Z" | "G"
CLASS="w" | "W" | "s" | "S" | "d" | "D" | "v" | "V" | "X"
XML_CLASS="c" | "C" | "i" | "I"
@@ -130,6 +130,13 @@ public final class RegExpAnnotator extends RegExpElementVisitor implements Annot
return false;
}
@Override
public void visitRegExpBoundary(RegExpBoundary boundary) {
if (!myLanguageHosts.supportsBoundary(boundary)) {
myHolder.createErrorAnnotation(boundary, "Unsupported boundary");
}
}
@Override
public void visitSimpleClass(RegExpSimpleClass simpleClass) {
if (!myLanguageHosts.supportsSimpleClass(simpleClass)) {
@@ -60,7 +60,7 @@ public class RegExpCompletionTest extends CodeInsightFixtureTestCase {
public void testBackSlashVariants() throws Throwable {
List<String> nameList =
new ArrayList<>(Arrays.asList("d", "D", "s", "S", "w", "W", "b", "B", "A", "G", "Z", "z", "Q", "E",
"t", "n", "r", "f", "a", "e", "h", "H", "v", "V", "R", "X"));
"t", "n", "r", "f", "a", "e", "h", "H", "v", "V", "R", "X", "b{g}"));
for (String[] stringArray : DefaultRegExpPropertiesProvider.getInstance().getAllKnownProperties()) {
nameList.add("p{" + stringArray[0] + "}");
}
+4
View File
@@ -8,6 +8,10 @@
<pattern><![CDATA[<weak_warning descr="Redundant character escape">\;</weak_warning>]]></pattern>
<expected>OK</expected>
</test>
<test host="com.intellij.psi.impl.JavaRegExpHost">
<pattern>\b \b{g} \B \A \z \Z \G</pattern>
<expected>OK</expected>
</test>
</simple>
<quantifiers>
<test verify="false" info="true">
+1 -1
View File
@@ -21,7 +21,7 @@ INSTALLATION INSTRUCTIONS
4. [OPTIONAL] To adjust the value of the JVM heap size, create
~/.@@system_selector@@/@@product@@.vmoptions (or @@product@@64.vmoptions
if using a 64-bit JDK), and set the -Xms and -Xms paramters. To see how
if using a 64-bit JDK), and set the -Xms and -Xmx parameters. To see how
to do this, you can reference the vmoptions file under
"{installation home}/bin" as a model.
@@ -72,7 +72,7 @@ class CommunityLibraryLicenses {
new LibraryLicense(name: "ASM Bytecode Manipulation Framework", libraryName: "ASM", version: "6.0-ALPHA (with patches by JetBrains)",
license: "BSD", url: "http://asm.objectweb.org/", licenseUrl: "http://asm.objectweb.org/license.html"),
new LibraryLicense(name: "assertJ", version: "3", license: "Apache 2.0", url: "https://github.com/joel-costigliola/assertj-core"),
new LibraryLicense(name: "Automaton", libraryName: "automaton.jar", version: "1.11", license: "BSD", url: "http://www.brics.dk/automaton/",
new LibraryLicense(name: "Automaton", libraryName: "automaton", version: "1.11", license: "BSD", url: "http://www.brics.dk/automaton/",
licenseUrl: "http://www.opensource.org/licenses/bsd-license.php"),
new LibraryLicense(name: "Axis", libraryName: "axis-1.4", version: "1.4", license: "Apache 2.0", url: "http://ws.apache.org/axis/",
licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0.html"),
@@ -62,23 +62,24 @@ class DistributionJARsBuilder {
this.allPlugins = allPlugins
buildContext.ant.patternset(id: RESOURCES_INCLUDED) {
include(name: "**/*.properties")
include(name: "fileTemplates/**/*")
include(name: "inspectionDescriptions/**/*")
include(name: "intentionDescriptions/**/*")
include(name: "tips/**/*")
include(name: "search/**/*")
include(name: "fileTemplates/**")
include(name: "inspectionDescriptions/**")
include(name: "intentionDescriptions/**")
include(name: "tips/**")
include(name: "search/**")
}
buildContext.ant.patternset(id: RESOURCES_EXCLUDED) {
exclude(name: "**/*.properties")
exclude(name: "fileTemplates/**/*")
exclude(name: "fileTemplates/**")
exclude(name: "fileTemplates")
exclude(name: "inspectionDescriptions/**/*")
exclude(name: "inspectionDescriptions/**")
exclude(name: "inspectionDescriptions")
exclude(name: "intentionDescriptions/**/*")
exclude(name: "intentionDescriptions/**")
exclude(name: "intentionDescriptions")
exclude(name: "tips/**/*")
exclude(name: "tips/**")
exclude(name: "tips")
exclude(name: "search/**")
}
}
@@ -163,17 +164,23 @@ class DistributionJARsBuilder {
jar("forms_rt.jar") { module("forms_rt") }
productLayout.additionalPlatformModules.entrySet().findAll { it.value != "resources_en.jar" }.each {
productLayout.additionalPlatformModules.entrySet().findAll { it.value != productLayout.mainJarName }.each {
def moduleName = it.key
jar(it.value) {
module(moduleName)
module(moduleName) {
ant.patternset(refid: resourcesExcluded)
}
}
}
jar("resources_en.jar", true) {
productLayout.additionalPlatformModules.entrySet().findAll { it.value == "resources_en.jar"}.each {
modulePatches([it.key])
module(it.key)
productLayout.additionalPlatformModules.keySet().each {
modulePatches([it]) {
ant.patternset(refid: resourcesIncluded)
}
module(it) {
ant.patternset(refid: resourcesIncluded)
}
}
module("platform-resources-en")
module("coverage-common") {
@@ -191,6 +198,14 @@ class DistributionJARsBuilder {
module("coverage-common") {
ant.patternset(refid: resourcesExcluded)
}
productLayout.additionalPlatformModules.entrySet().findAll {it.value == productLayout.mainJarName}.each {
modulePatches([it.key]) {
ant.patternset(refid: resourcesExcluded)
}
module(it.key) {
ant.patternset(refid: resourcesExcluded)
}
}
productLayout.additionalJarsToUnpackIntoMainJar.each {
ant.zipfileset(src: it)
}
@@ -144,10 +144,10 @@ class LayoutBuilder {
* Include the patched outputs of {@code moduleNames} modules to the current place in the layout. This method is supposed to be called
* in the {@code body} of {@link #jar} with 'preserveDuplicates' set to {@code true}
*/
def modulePatches(Collection<String> moduleNames) {
def modulePatches(Collection<String> moduleNames, Closure body = {}) {
moduleNames.each {
moduleOutputPatches.get(it)?.each {
ant.fileset(dir: it)
ant.fileset(dir: it, body)
}
}
}
+1
View File
@@ -56,6 +56,7 @@ done
# Make sure *.p12 is imported into local KeyChain
security unlock-keychain -p ${PASSWORD} /Users/${USERNAME}/Library/Keychains/login.keychain
echo "signing ${EXPLODED}/$BUILD_NAME"
codesign -v --deep --force -s "${CODESIGN_STRING}" ${EXPLODED}/"$BUILD_NAME"
echo "signing is done"
echo "check sign"
@@ -104,7 +104,7 @@ public class RendererConfiguration implements Cloneable, JDOMExternalizable {
}
public void addRenderer(NodeRenderer renderer) {
myRepresentationNodes.add(renderer);
myRepresentationNodes.add(0, renderer);
}
@TestOnly
@@ -31,6 +31,7 @@ import com.intellij.debugger.ui.tree.UserExpressionDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.JavaCodeFragment;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiCodeFragment;
import com.intellij.psi.PsiType;
@@ -72,7 +73,11 @@ public class UserExpressionDescriptorImpl extends EvaluationDescriptor implement
if (psiClassAndType.first == null) {
throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.invalid.type.name", myTypeName));
}
return createCodeFragment(psiClassAndType.first);
PsiCodeFragment fragment = createCodeFragment(psiClassAndType.first);
if (fragment instanceof JavaCodeFragment) {
((JavaCodeFragment)fragment).setThisType(psiClassAndType.second);
}
return fragment;
}
public ValueDescriptorImpl getParentDescriptor() {
@@ -48,7 +48,7 @@ import java.util.List;
*/
public class CustomFieldInplaceEditor extends XDebuggerTreeInplaceEditor {
private final UserExpressionDescriptorImpl myDescriptor;
private final EnumerationChildrenRenderer myRenderer;
protected final EnumerationChildrenRenderer myRenderer;
public CustomFieldInplaceEditor(@NotNull XDebuggerTreeNode node,
@Nullable UserExpressionDescriptorImpl descriptor,
@@ -79,20 +79,26 @@ public class CustomFieldInplaceEditor extends XDebuggerTreeInplaceEditor {
@Override
protected List<Pair<String, TextWithImports>> getRendererChildren() {
if (renderer != null) {
return renderer.getChildren();
if (myRenderer != null) {
return myRenderer.getChildren();
}
String name = getTypeName(descriptor);
EnumerationChildrenRenderer enumerationChildrenRenderer = new EnumerationChildrenRenderer();
enumerationChildrenRenderer.setAppendDefaultChildren(true);
Renderer lastRenderer = descriptor.getLastRenderer();
if (lastRenderer instanceof CompoundNodeRenderer &&
!(((CompoundNodeRenderer)lastRenderer).getChildrenRenderer() instanceof ExpressionChildrenRenderer)) {
((CompoundNodeRenderer)lastRenderer).setChildrenRenderer(enumerationChildrenRenderer);
}
else {
String name = getTypeName(descriptor);
EnumerationChildrenRenderer enumerationChildrenRenderer = new EnumerationChildrenRenderer();
enumerationChildrenRenderer.setAppendDefaultChildren(true);
NodeRenderer renderer =
NodeRendererSettings.getInstance().createCompoundTypeRenderer(name, name, null, enumerationChildrenRenderer);
renderer.setEnabled(true);
NodeRendererSettings.getInstance().getCustomRenderers().addRenderer(renderer);
NodeRendererSettings.getInstance().fireRenderersChanged();
return enumerationChildrenRenderer.getChildren();
}
return enumerationChildrenRenderer.getChildren();
}
}.show());
}
@@ -82,7 +82,7 @@ public class JavaDebuggerEditorsProvider extends XDebuggerEditorsProviderBase {
@Nullable PsiElement context,
boolean isPhysical) {
TextWithImports text = TextWithImportsImpl.fromXExpression(expression);
if (text != null && context != null) {
if (text != null) {
CodeFragmentFactory factory = DebuggerUtilsEx.findAppropriateCodeFragmentFactory(text, context);
JavaCodeFragment codeFragment = factory.createPresentationCodeFragment(text, context, project);
codeFragment.forceResolveScope(GlobalSearchScope.allScope(project));
@@ -105,11 +105,12 @@ public class HighlightMethodUtil {
PsiUtil.getAccessModifier(superAccessLevel));
TextRange textRange;
if (includeRealPositionInfo) {
if (modifierList.hasModifierProperty(PsiModifier.PACKAGE_LOCAL)) {
PsiElement keyword = PsiUtil.findModifierInList(modifierList, accessModifier);
if (keyword == null) {
// in case of package-private or some crazy third-party plugin where some access modifier implied even if it's absent
textRange = method.getNameIdentifier().getTextRange();
}
else {
PsiElement keyword = PsiUtil.findModifierInList(modifierList, accessModifier);
textRange = keyword.getTextRange();
}
}
@@ -365,7 +366,7 @@ public class HighlightMethodUtil {
highlightInfo = checkVarargParameterErasureToBeAccessible((MethodCandidateInfo)resolveResult, methodCall);
}
if (highlightInfo == null && resolveResult instanceof MethodCandidateInfo) {
if (highlightInfo == null) {
final String errorMessage = ((MethodCandidateInfo)resolveResult).getInferenceErrorMessage();
if (errorMessage != null) {
highlightInfo = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).descriptionAndTooltip(errorMessage).range(fixRange).create();
@@ -26,8 +26,9 @@ public class ChangeToAppendUtil {
if (concatenation == null) return null;
final PsiType type = appendable.getType();
if (type == null) return null;
final StringBuilder result =
buildAppendExpression(concatenation, type.equalsToText("java.lang.Appendable"), new StringBuilder(appendable.getText()));
final boolean useStringValueOf = !type.equalsToText(CommonClassNames.JAVA_LANG_STRING_BUFFER) &&
!type.equalsToText(CommonClassNames.JAVA_LANG_STRING_BUILDER);
final StringBuilder result = buildAppendExpression(concatenation, useStringValueOf, new StringBuilder(appendable.getText()));
if (result == null) return null;
final PsiElementFactory factory = JavaPsiFacade.getElementFactory(appendable.getProject());
return factory.createExpressionFromText(result.toString(), appendable);
@@ -24,6 +24,7 @@ import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.InheritanceUtil;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
@@ -35,6 +36,7 @@ public class ChangeToAppendFix implements IntentionAction {
private final IElementType myTokenType;
private final PsiType myLhsType;
private final PsiAssignmentExpression myAssignmentExpression;
private volatile TypeInfo myTypeInfo;
public ChangeToAppendFix(@NotNull IElementType eqOpSign, @NotNull PsiType lType, @NotNull PsiAssignmentExpression assignmentExpression) {
myTokenType = eqOpSign;
@@ -47,9 +49,8 @@ public class ChangeToAppendFix implements IntentionAction {
public String getText() {
return QuickFixBundle.message("change.to.append.text",
ChangeToAppendUtil.buildAppendExpression(myAssignmentExpression.getRExpression(),
myLhsType.equalsToText("java.lang.Appendable"),
new StringBuilder(
myAssignmentExpression.getLExpression().getText())));
getTypeInfo().myUseStringValueOf,
new StringBuilder(myAssignmentExpression.getLExpression().getText())));
}
@NotNull
@@ -63,9 +64,7 @@ public class ChangeToAppendFix implements IntentionAction {
return JavaTokenType.PLUSEQ == myTokenType &&
myAssignmentExpression.isValid() &&
PsiManager.getInstance(project).isInProject(myAssignmentExpression) &&
(myLhsType.equalsToText(CommonClassNames.JAVA_LANG_STRING_BUILDER) ||
myLhsType.equalsToText(CommonClassNames.JAVA_LANG_STRING_BUFFER) ||
myLhsType.equalsToText("java.lang.Appendable"));
getTypeInfo().myAppendable;
}
@Override
@@ -81,4 +80,33 @@ public class ChangeToAppendFix implements IntentionAction {
if (appendExpression == null) return;
myAssignmentExpression.replace(appendExpression);
}
@NotNull
private TypeInfo getTypeInfo() {
if (myTypeInfo != null) return myTypeInfo;
myTypeInfo = calculateTypeInfo();
return myTypeInfo;
}
@NotNull
private TypeInfo calculateTypeInfo() {
if (myLhsType.equalsToText(CommonClassNames.JAVA_LANG_STRING_BUILDER) ||
myLhsType.equalsToText(CommonClassNames.JAVA_LANG_STRING_BUFFER)) {
return new TypeInfo(true, false);
}
if (InheritanceUtil.isInheritor(myLhsType, "java.lang.Appendable")) {
return new TypeInfo(true, true);
}
return new TypeInfo(false, false);
}
private static class TypeInfo {
private final boolean myAppendable;
private final boolean myUseStringValueOf;
TypeInfo(boolean appendable, boolean useStringValueOf) {
myAppendable = appendable;
myUseStringValueOf = useStringValueOf;
}
}
}
@@ -48,12 +48,14 @@ import com.intellij.ui.HyperlinkAdapter;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.util.ArrayUtil;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.HashMap;
import com.intellij.util.containers.HashSet;
import com.intellij.util.text.CharArrayUtil;
import com.intellij.util.text.DateFormatUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import gnu.trove.TObjectHashingStrategy;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -77,12 +79,28 @@ import java.util.function.Predicate;
public class UnusedDeclarationPresentation extends DefaultInspectionToolPresentation {
private final Map<String, Set<RefEntity>> myPackageContents = Collections.synchronizedMap(new HashMap<String, Set<RefEntity>>());
private final Set<RefEntity> myIgnoreElements = new HashSet<>();
private final Set<RefEntity> myIgnoreElements = ContainerUtil.newConcurrentSet(TObjectHashingStrategy.IDENTITY);
private final Map<RefEntity, UnusedDeclarationHint> myFixedElements = ContainerUtil.newConcurrentMap(TObjectHashingStrategy.IDENTITY);
private WeakUnreferencedFilter myFilter;
private DeadHTMLComposer myComposer;
@NonNls private static final String DELETE = "delete";
@NonNls private static final String COMMENT = "comment";
@NonNls private static final String [] HINTS = {COMMENT, DELETE};
private enum UnusedDeclarationHint {
COMMENT("Commented out"),
DELETE("Deleted");
private final String myDescription;
UnusedDeclarationHint(String description) {
myDescription = description;
}
public String getDescription() {
return myDescription;
}
}
public UnusedDeclarationPresentation(@NotNull InspectionToolWrapper toolWrapper, @NotNull GlobalInspectionContextImpl context) {
super(toolWrapper, context);
@@ -150,9 +168,9 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta
@NonNls Element hintsElement = new Element("hints");
for (String hint : HINTS) {
for (UnusedDeclarationHint hint : UnusedDeclarationHint.values()) {
@NonNls Element hintElement = new Element("hint");
hintElement.setAttribute("value", hint);
hintElement.setAttribute("value", hint.toString().toLowerCase());
hintsElement.addContent(hintElement);
}
element.addContent(hintsElement);
@@ -206,7 +224,12 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta
final Project project = getContext().getProject();
if (isDisposed() || project.isDisposed()) return;
SafeDeleteHandler.invoke(project, psiElements, false,
() -> removeElements(refElements, project, myToolWrapper));
() -> {
removeElements(refElements, project, myToolWrapper);
for (RefEntity ref : refElements) {
myFixedElements.put(ref, UnusedDeclarationHint.DELETE);
}
});
});
return false; //refresh after safe delete dialog is closed
@@ -278,6 +301,9 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta
entryPointsManager.removeEntryPoint(refElement);
}
for (RefElement ref : deletedRefs) {
myFixedElements.put(ref, UnusedDeclarationHint.COMMENT);
}
return true;
}
}
@@ -375,6 +401,27 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta
return entryPointsNode;
}
@NotNull
@Override
public RefElementNode createRefNode(@NotNull RefEntity entity) {
return new RefElementNode(entity, this) {
@Nullable
@Override
public String getCustomizedTailText() {
final UnusedDeclarationHint hint = myFixedElements.get(getElement());
if (hint != null) {
return hint.getDescription();
}
return super.getCustomizedTailText();
}
@Override
public boolean isQuickFixAppliedFromView() {
return myFixedElements.containsKey(getElement());
}
};
}
@Override
public void updateContent() {
getTool().checkForReachableRefs(getContext());
@@ -18,13 +18,16 @@ package com.intellij.psi.formatter.java;
import com.intellij.formatting.*;
import com.intellij.lang.ASTNode;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.formatter.common.ExtraRangesProvider;
import com.intellij.psi.formatter.common.NodeIndentRangesCalculator;
import com.intellij.psi.impl.source.codeStyle.ShiftIndentInsideHelper;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
public class LeafBlock implements ASTBlock{
public class LeafBlock implements ASTBlock, ExtraRangesProvider {
private int myStartOffset = -1;
private final ASTNode myNode;
private final Wrap myWrap;
@@ -108,4 +111,16 @@ public class LeafBlock implements ASTBlock{
myStartOffset = startOffset;
// if (startOffset != -1) assert startOffset == myNode.getTextRange().getStartOffset();
}
@Override
@Nullable
public List<TextRange> getExtraRangesToFormat(@NotNull FormattingRangesInfo info) {
int startOffset = getTextRange().getStartOffset();
if (info.isOnInsertedLine(startOffset) && myNode.getTextLength() == 1 && myNode.textContains('}')) {
ASTNode parent = myNode.getTreeParent();
return new NodeIndentRangesCalculator(parent).calculateExtraRanges();
}
return null;
}
}
@@ -24,10 +24,7 @@ import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.psi.PsiElement;
import org.intellij.lang.regexp.DefaultRegExpPropertiesProvider;
import org.intellij.lang.regexp.RegExpLanguageHost;
import org.intellij.lang.regexp.psi.RegExpChar;
import org.intellij.lang.regexp.psi.RegExpGroup;
import org.intellij.lang.regexp.psi.RegExpNamedGroupRef;
import org.intellij.lang.regexp.psi.RegExpSimpleClass;
import org.intellij.lang.regexp.psi.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -94,6 +91,24 @@ public class JavaRegExpHost implements RegExpLanguageHost {
return hasAtLeastJdkVersion(regExpChar, JavaSdkVersion.JDK_1_7);
}
@Override
public boolean supportsBoundary(RegExpBoundary boundary) {
switch (boundary.getType()) {
case UNICODE_EXTENDED_GRAPHEME:
return hasAtLeastJdkVersion(boundary, JavaSdkVersion.JDK_1_9);
case LINE_START:
case LINE_END:
case WORD:
case NON_WORD:
case BEGIN:
case END:
case END_NO_LINE_TERM:
case PREVIOUS_MATCH:
default:
return true;
}
}
@Override
public boolean supportsSimpleClass(RegExpSimpleClass simpleClass) {
switch(simpleClass.getKind()) {
@@ -114,7 +114,7 @@ class X {
}
fun `ignore test inserted closing brace`() {
fun `test inserted closing brace`() {
myLineRange = TextRange(6, 6)
check(
"""
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
@@ -26,7 +26,7 @@ import java.lang.annotation.*;
* clause ::= args '-&gt;' effect<br>
* args ::= ((arg ',')* arg )?<br>
* arg ::= value-constraint<br>
* value-constraint ::= 'any' | 'null' | '!null' | 'false' | 'true'<br>
* value-constraint ::= '_' | 'null' | '!null' | 'false' | 'true'<br>
* effect ::= value-constraint | 'fail' <p>
*
* The constraints denote the following:<br>
+1 -9
View File
@@ -14,15 +14,7 @@
<orderEntry type="module" module-name="extensions" exported="" />
<orderEntry type="library" exported="" name="picocontainer" level="project" />
<orderEntry type="module" module-name="platform-resources-en" exported="" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../lib/automaton.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="automaton" level="project" />
<orderEntry type="library" name="CGLIB" level="project" />
</component>
</module>
@@ -18,6 +18,7 @@ package com.intellij.lexer;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import com.intellij.util.SystemProperties;
import org.jetbrains.annotations.NotNull;
/**
@@ -26,6 +27,7 @@ import org.jetbrains.annotations.NotNull;
public class FlexAdapter extends LexerBase {
private static final Logger LOG = Logger.getInstance(FlexAdapter.class);
private static final boolean logLexerErrors = SystemProperties.getBooleanProperty("log.flex.adapter.errors", true); // Used by Upsource
private final FlexLexer myFlex;
@@ -105,13 +107,17 @@ public class FlexAdapter extends LexerBase {
myTokenType = myFlex.advance();
myTokenEnd = myFlex.getTokenEnd();
}
catch (Exception e) {
LOG.error(myFlex.getClass().getName(), e);
catch (Exception e) {
if (logLexerErrors) {
LOG.error(myFlex.getClass().getName(), e);
}
myTokenType = TokenType.WHITE_SPACE;
myTokenEnd = myBufferEnd;
}
catch (Error e) {
LOG.error(myFlex.getClass().getName(), e);
if (logLexerErrors) {
LOG.error(myFlex.getClass().getName(), e);
}
myTokenType = TokenType.WHITE_SPACE;
myTokenEnd = myBufferEnd;
}
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.passwordSafe
package com.intellij.credentialStore
import com.intellij.ide.passwordSafe.PasswordStorage
import com.intellij.ide.passwordSafe.impl.providers.masterKey.windows.WindowsCryptUtils
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.BufferExposingByteArrayOutputStream
import com.intellij.openapi.util.io.setOwnerPermissions
@@ -29,15 +29,19 @@ import java.nio.file.NoSuchFileException
import java.nio.file.Path
import java.nio.file.Paths
import java.security.Key
import java.security.MessageDigest
import java.security.SecureRandom
import java.util.Base64
import java.util.concurrent.atomic.AtomicBoolean
import javax.crypto.spec.SecretKeySpec
internal val LOG = Logger.getInstance(FileCredentialStore::class.java)
class FileCredentialStore(keyToValue: Map<String, String>? = null, baseDirectory: Path = Paths.get(PathManager.getConfigPath()), var memoryOnly: Boolean = false) : PasswordStorage, CredentialStore {
override fun get(key: String) = getPassword(null, key)
override fun set(key: String, password: ByteArray?) {
val string = password?.toString(Charsets.UTF_8)
password?.fill(0)
setPassword(key, string)
}
class FileCredentialStore(keyToValue: Map<String, String>? = null, baseDirectory: Path = Paths.get(PathManager.getConfigPath()), var memoryOnly: Boolean = false) : PasswordStorage {
private val db = ContainerUtil.newConcurrentMap<String, String>()
private val dbFile = baseDirectory.resolve("pdb")
@@ -132,10 +136,10 @@ class FileCredentialStore(keyToValue: Map<String, String>? = null, baseDirectory
override fun getPassword(requestor: Class<*>?, key: String): String? {
val rawKey = getRawKey(key, requestor)
// try old key - as hash
var value = db.get(rawKey)
if (value == null) {
value = db.remove(toOldKey(MessageDigest.getInstance("SHA-256").digest(rawKey.toByteArray())))
if (value == null && (requestor != null || key.contains('/'))) {
// try old key - as hash
value = db.remove(toOldKey(rawKey))
if (value != null) {
db.put(rawKey, value)
needToSave.set(true)
@@ -163,16 +167,6 @@ class FileCredentialStore(keyToValue: Map<String, String>? = null, baseDirectory
}
}
internal fun getRawKey(key: String, requestor: Class<*>?) = if (requestor == null) key else "${requestor.name}/$key"
internal fun toOldKey(hash: ByteArray) = "old-hashed-key|" + Base64.getEncoder().encodeToString(hash)
internal fun generate(): ByteArray {
val bytes = ByteArray(16)
SecureRandom().nextBytes(bytes)
return bytes
}
interface MasterKeyStorage {
fun get(): ByteArray?
@@ -1,75 +0,0 @@
/*
* Copyright 2000-2016 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.passwordSafe
import com.intellij.ide.passwordSafe.macOs.deleteGenericPassword
import com.intellij.ide.passwordSafe.macOs.findGenericPassword
import com.intellij.ide.passwordSafe.macOs.isMacOsCredentialStoreSupported
import com.intellij.ide.passwordSafe.macOs.saveGenericPassword
import com.intellij.openapi.diagnostic.catchAndLog
import com.intellij.util.SystemProperties
import java.security.MessageDigest
private class MacOsCredentialStore(serviceName: String) : PasswordStorage {
private val serviceName = serviceName.toByteArray()
override fun getPassword(requestor: Class<*>?, key: String): String? {
val rawKey = getRawKey(key, requestor)
// try old key - as hash
@Suppress("CanBeVal")
var value: String?
try {
value = findGenericPassword(serviceName, rawKey)
}
catch (e: Throwable) {
LOG.error(e)
return null
}
if (value == null) {
LOG.catchAndLog {
val oldKey = toOldKey(MessageDigest.getInstance("SHA-256").digest(rawKey.toByteArray()))
value = findGenericPassword(serviceName, oldKey)
if (value != null) {
LOG.catchAndLog { deleteGenericPassword(serviceName, oldKey) }
saveGenericPassword(serviceName, key, value!!)
}
}
}
return value
}
override fun setPassword(requestor: Class<*>?, key: String, value: String?) {
LOG.catchAndLog {
val rawKey = getRawKey(key, requestor)
if (value == null) {
deleteGenericPassword(serviceName, rawKey)
}
else {
saveGenericPassword(serviceName, rawKey, value)
}
}
}
}
private class MacOsCredentialStoreFactory : CredentialStoreFactory {
override fun create(): PasswordStorage? {
if (isMacOsCredentialStoreSupported && SystemProperties.getBooleanProperty("use.mac.keychain", true)) {
return MacOsCredentialStore("IntelliJ Platform")
}
return null
}
}
@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.passwordSafe.config
package com.intellij.credentialStore
import com.intellij.credentialStore.PasswordSafeSettings.ProviderType
import com.intellij.ide.passwordSafe.PasswordSafe
import com.intellij.ide.passwordSafe.config.PasswordSafeSettings.ProviderType
import com.intellij.ide.passwordSafe.impl.PasswordSafeImpl
import com.intellij.layout.*
import com.intellij.layout.CCFlags.*
@@ -15,10 +15,13 @@
*/
package com.intellij.ide.passwordSafe.impl
import com.intellij.ide.passwordSafe.*
import com.intellij.ide.passwordSafe.config.PasswordSafeSettings
import com.intellij.ide.passwordSafe.config.PasswordSafeSettings.ProviderType
import com.intellij.ide.passwordSafe.config.PasswordSafeSettingsListener
import com.intellij.credentialStore.FileCredentialStore
import com.intellij.credentialStore.LOG
import com.intellij.credentialStore.PasswordSafeSettings
import com.intellij.credentialStore.PasswordSafeSettings.ProviderType
import com.intellij.credentialStore.PasswordSafeSettingsListener
import com.intellij.ide.passwordSafe.PasswordSafe
import com.intellij.ide.passwordSafe.PasswordStorage
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.ex.ApplicationInfoEx
import com.intellij.openapi.components.SettingsSavingComponent
@@ -126,7 +129,7 @@ class PasswordSafeImpl(/* public - backward compatibility */val settings: Passwo
private fun createPersistentCredentialStore(existing: FileCredentialStore? = null, convertFileStore: Boolean = false): PasswordStorage {
LOG.catchAndLog {
for (factory in CredentialStoreFactory.CREDENTIAL_STORE_FACTORY.extensions) {
for (factory in com.intellij.credentialStore.CredentialStoreFactory.CREDENTIAL_STORE_FACTORY.extensions) {
val store = factory.create() ?: continue
if (convertFileStore) {
LOG.catchAndLog {
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.passwordSafe;
package com.intellij.credentialStore;
import com.intellij.ide.passwordSafe.PasswordStorage;
import com.intellij.openapi.extensions.ExtensionPointName;
import org.jetbrains.annotations.Nullable;
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.passwordSafe.config;
package com.intellij.credentialStore;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.PersistentStateComponent;
@@ -0,0 +1,35 @@
/*
* Copyright 2000-2016 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.credentialStore
import com.intellij.openapi.diagnostic.Logger
import java.security.MessageDigest
import java.util.*
internal val LOG = Logger.getInstance(CredentialStore::class.java)
internal interface CredentialStore {
fun get(key: String): String?
// passed byte array will be cleared
fun set(key: String, password: ByteArray?)
}
internal fun getRawKey(key: String, requestor: Class<*>?) = if (requestor == null) key else "${requestor.name}/$key"
internal fun toOldKey(hash: ByteArray) = "old-hashed-key|" + Base64.getEncoder().encodeToString(hash)
internal fun toOldKey(newKey: String) = toOldKey(MessageDigest.getInstance("SHA-256").digest(newKey.toByteArray()))
@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.passwordSafe
package com.intellij.credentialStore
import com.intellij.ide.ApplicationLoadListener
import com.intellij.ide.passwordSafe.config.PasswordSafeSettings
import com.intellij.ide.passwordSafe.impl.providers.ByteArrayWrapper
import com.intellij.ide.passwordSafe.impl.providers.EncryptionUtil
import com.intellij.ide.passwordSafe.impl.providers.masterKey.EnterPasswordComponent
@@ -0,0 +1,91 @@
package com.intellij.credentialStore.linux
import com.intellij.credentialStore.CredentialStore
import com.intellij.credentialStore.LOG
import com.intellij.jna.DisposableMemory
import com.sun.jna.Library
import com.sun.jna.Native
import com.sun.jna.Pointer
private val LIBRARY by lazy { Native.loadLibrary("secret-1", SecretLibrary::class.java) as SecretLibrary }
private const val SECRET_SCHEMA_NONE = 0
private const val SECRET_SCHEMA_ATTRIBUTE_STRING = 0
// explicitly create pointer to be explicitly dispose it to avoid sensitive data in the memory
internal fun stringPointer(data: ByteArray): DisposableMemory {
val pointer = DisposableMemory(data.size + 1L)
pointer.write(0, data, 0, data.size)
pointer.setByte(data.size.toLong(), 0.toByte())
return pointer
}
// we use default collection, it seems no way to use custom
internal class SecretCredentialStore(schemeName: String) : CredentialStore {
private val keyAttributeNamePointer by lazy { stringPointer("key".toByteArray()) }
private val scheme by lazy { LIBRARY.secret_schema_new(schemeName, SECRET_SCHEMA_NONE, keyAttributeNamePointer, SECRET_SCHEMA_ATTRIBUTE_STRING, null) }
override fun get(key: String): String? {
val keyPointer = stringPointer(key.toByteArray())
return checkError("secret_password_lookup_sync") { errorRef ->
LIBRARY.secret_password_lookup_sync(scheme, null, errorRef, keyAttributeNamePointer, keyPointer, null)
}
}
override fun set(key: String, password: ByteArray?) {
val keyPointer = stringPointer(key.toByteArray())
if (password == null) {
checkError("secret_password_store_sync") { errorRef ->
LIBRARY.secret_password_clear_sync(scheme, null, errorRef, keyAttributeNamePointer, keyPointer, null)
}
return
}
val passwordPointer = stringPointer(password)
password.fill(0)
checkError("secret_password_store_sync") { errorRef ->
try {
LIBRARY.secret_password_store_sync(scheme, null, keyPointer, passwordPointer, null, errorRef, keyAttributeNamePointer, keyPointer, null)
}
finally {
passwordPointer.dispose()
keyPointer.dispose()
}
}
}
}
private inline fun <T> checkError(method: String, task: (errorRef: Array<GErrorStruct?>) -> T): T {
val errorRef = arrayOf<GErrorStruct?>(null)
val result = task(errorRef)
val error = errorRef.get(0)
if (error != null && error.code !== 0) {
LOG.error("$method error code ${error.code}, error message ${error.message}")
}
return result
}
// we use sync API to simplify - client will use postponed write
private interface SecretLibrary : Library {
fun secret_schema_new(name: String, flags: Int, vararg attributes: Any?): Pointer
fun secret_password_store_sync(scheme: Pointer, collection: Pointer?, label: Pointer, password: Pointer, cancellable: Pointer?, error: Array<GErrorStruct?>, vararg attributes: Pointer?)
fun secret_password_lookup_sync(scheme: Pointer, cancellable: Pointer?, error: Array<GErrorStruct?>, vararg attributes: Pointer?): String
fun secret_password_clear_sync(scheme: Pointer, cancellable: Pointer?, error: Array<GErrorStruct?>, vararg attributes: Pointer?)
}
@Suppress("unused")
class GErrorStruct : com.sun.jna.Structure() {
@JvmField
var domain = 0
@JvmField
var code = 0
@JvmField
var message: String? = null
override fun getFieldOrder() = listOf("domain", "code", "message")
}
@@ -13,10 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.passwordSafe.macOs
package com.intellij.credentialStore.macOs
import com.intellij.ide.passwordSafe.LOG
import com.intellij.credentialStore.CredentialStore
import com.intellij.credentialStore.LOG
import com.intellij.openapi.util.SystemInfo
import com.sun.jna.Library
import com.sun.jna.Native
import com.sun.jna.Pointer
@@ -27,12 +29,25 @@ private val LIBRARY by lazy {
Native.loadLibrary("Security", MacOsKeychainLibrary::class.java) as MacOsKeychainLibrary
}
fun saveGenericPassword(serviceName: ByteArray, accountName: String, password: String) {
saveGenericPassword(serviceName, accountName, password.toByteArray())
}
private const val errSecItemNotFound = -25300
private const val errSecInvalidRecord = -67701
private fun saveGenericPassword(serviceName: ByteArray, accountName: String, passwordData: ByteArray) {
saveGenericPassword(serviceName, accountName, passwordData, passwordData.size)
internal class KeyChainCredentialStore(serviceName: String) : CredentialStore {
private val serviceName = serviceName.toByteArray()
override fun get(key: String): String? {
return findGenericPassword(serviceName, key)
}
override fun set(key: String, password: ByteArray?) {
if (password == null) {
deleteGenericPassword(serviceName, key)
return
}
saveGenericPassword(serviceName, key, password, password.size)
password.fill(0)
}
}
fun findGenericPassword(serviceName: ByteArray, accountName: String): String? {
@@ -50,17 +65,22 @@ fun findGenericPassword(serviceName: ByteArray, accountName: String): String? {
fun deleteGenericPassword(serviceName: ByteArray, accountName: String) {
val itemRef = arrayOf<Pointer?>(null)
val accountNameBytes = accountName.toByteArray()
checkForError("find (for delete)", LIBRARY.SecKeychainFindGenericPassword(null, serviceName.size, serviceName, accountNameBytes.size, accountNameBytes, null, null, itemRef))
val pointer = itemRef[0]
val code = LIBRARY.SecKeychainFindGenericPassword(null, serviceName.size, serviceName, accountNameBytes.size, accountNameBytes, null, null, itemRef)
if (code == errSecItemNotFound || code == errSecInvalidRecord) {
return
}
checkForError("find (for delete)", code)
val pointer = itemRef.get(0)
if (pointer != null) {
checkForError("delete", LIBRARY.SecKeychainItemDelete(pointer))
LIBRARY.CFRelease(pointer)
}
}
// http://developer.apple.com/mac/library/DOCUMENTATION/Security/Reference/keychainservices/Reference/reference.html
// https://developer.apple.com/library/mac/documentation/Security/Reference/keychainservices/index.html
// It is very, very important to use CFRelease/SecKeychainItemFreeContent You must do it, otherwise you can get "An invalid record was encountered."
interface MacOsKeychainLibrary : com.sun.jna.Library {
private interface MacOsKeychainLibrary : Library {
fun SecKeychainAddGenericPassword(keychain: Pointer?, serviceNameLength: Int, serviceName: ByteArray, accountNameLength: Int, accountName: ByteArray, passwordLength: Int, passwordData: ByteArray, itemRef: Pointer? = null): Int
fun SecKeychainItemModifyContent(/*SecKeychainItemRef*/ itemRef: Pointer, /*SecKeychainAttributeList**/ attrList: Pointer?, length: Int, data: ByteArray): Int
@@ -89,35 +109,38 @@ interface MacOsKeychainLibrary : com.sun.jna.Library {
fun SecKeychainItemFreeContent(/*SecKeychainAttributeList*/attrList: Pointer?, data: Pointer?)
}
private fun saveGenericPassword(serviceName: ByteArray, accountName: String, password: ByteArray, passwordSize: Int) {
fun saveGenericPassword(serviceName: ByteArray, accountName: String, password: ByteArray, passwordSize: Int = password.size) {
val accountNameBytes = accountName.toByteArray()
val itemRef = arrayOf<Pointer?>(null)
checkForError("find (for save)", LIBRARY.SecKeychainFindGenericPassword(null, serviceName.size, serviceName, accountNameBytes.size, accountNameBytes, null, null, itemRef))
val library = LIBRARY
checkForError("find (for save)", library.SecKeychainFindGenericPassword(null, serviceName.size, serviceName, accountNameBytes.size, accountNameBytes, null, null, itemRef))
val pointer = itemRef[0]
if (pointer == null) {
checkForError("save (new)", LIBRARY.SecKeychainAddGenericPassword(null, serviceName.size, serviceName, accountNameBytes.size, accountNameBytes, passwordSize, password))
checkForError("save (new)", library.SecKeychainAddGenericPassword(null, serviceName.size, serviceName, accountNameBytes.size, accountNameBytes, passwordSize, password))
}
else {
checkForError("save (update)", LIBRARY.SecKeychainItemModifyContent(pointer, null, passwordSize, password))
LIBRARY.CFRelease(pointer)
checkForError("save (update)", library.SecKeychainItemModifyContent(pointer, null, passwordSize, password))
library.CFRelease(pointer)
}
}
private fun checkForError(message: String, code: Int) {
if (code != 0 && code != /* errSecItemNotFound, always returned from find it seems */-25300) {
val translated = LIBRARY.SecCopyErrorMessageString(code, null)
val builder = StringBuilder(message).append(": ")
if (translated == null) {
builder.append(code)
}
else {
val buf = CharArray(LIBRARY.CFStringGetLength(translated).toInt())
for (i in 0..buf.size - 1) {
buf[i] = LIBRARY.CFStringGetCharacterAtIndex(translated, i.toLong())
}
LIBRARY.CFRelease(translated)
builder.append(buf).append(" (").append(code).append(')')
}
LOG.error(builder.toString())
if (code == 0 || code == errSecItemNotFound) {
return
}
val translated = LIBRARY.SecCopyErrorMessageString(code, null)
val builder = StringBuilder(message).append(": ")
if (translated == null) {
builder.append(code)
}
else {
val buf = CharArray(LIBRARY.CFStringGetLength(translated).toInt())
for (i in 0..buf.size - 1) {
buf[i] = LIBRARY.CFStringGetCharacterAtIndex(translated, i.toLong())
}
LIBRARY.CFRelease(translated)
builder.append(buf).append(" (").append(code).append(')')
}
LOG.error(builder.toString())
}
@@ -0,0 +1,119 @@
/*
* Copyright 2000-2016 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.credentialStore
import com.intellij.credentialStore.linux.SecretCredentialStore
import com.intellij.credentialStore.macOs.KeyChainCredentialStore
import com.intellij.credentialStore.macOs.isMacOsCredentialStoreSupported
import com.intellij.ide.passwordSafe.PasswordStorage
import com.intellij.openapi.diagnostic.catchAndLog
import com.intellij.openapi.util.SystemInfo
import com.intellij.util.SystemProperties
import com.intellij.util.concurrency.QueueProcessor
import com.intellij.util.containers.ContainerUtil
private const val nullPassword = "\u0000"
private class CredentialStoreWrapper(private val store: CredentialStore) : PasswordStorage {
private val fallbackStore = lazy { FileCredentialStore(memoryOnly = true) }
private val queueProcessor = QueueProcessor<() -> Unit>({
it()
})
private val postponedCredentials = ContainerUtil.newConcurrentMap<String, String>()
override fun getPassword(requestor: Class<*>?, key: String): String? {
val rawKey = getRawKey(key, requestor)
postponedCredentials.get(rawKey)?.let {
return if (it == nullPassword) null else it
}
var store = if (fallbackStore.isInitialized()) fallbackStore.value else store
// try old key - as hash
@Suppress("CanBeVal")
var value: String?
try {
value = store.get(rawKey)
}
catch (e: UnsatisfiedLinkError) {
store = fallbackStore.value
LOG.error(e)
value = store.get(rawKey)
}
catch (e: Throwable) {
LOG.error(e)
return null
}
if (value == null) {
LOG.catchAndLog {
val oldKey = toOldKey(rawKey)
value = store.get(oldKey)
if (value != null) {
LOG.catchAndLog { store.set(oldKey, null) }
store.set(key, value!!.toByteArray())
}
}
}
return value
}
override fun setPassword(requestor: Class<*>?, key: String, value: String?) {
LOG.catchAndLog {
val store = if (fallbackStore.isInitialized()) fallbackStore.value else store
val rawKey = getRawKey(key, requestor)
val passwordData = value?.toByteArray()
if (fallbackStore.isInitialized()) {
store.set(rawKey, passwordData)
}
else {
postponedCredentials.put(rawKey, value ?: nullPassword)
queueProcessor.add {
if (!fallbackStore.isInitialized()) {
LOG.catchAndLog {
store.set(rawKey, passwordData)
postponedCredentials.remove(rawKey)
return@add
}
}
fallbackStore.value.set(rawKey, passwordData)
postponedCredentials.remove(rawKey)
}
}
}
}
}
private class MacOsCredentialStoreFactory : CredentialStoreFactory {
override fun create(): PasswordStorage? {
if (isMacOsCredentialStoreSupported && SystemProperties.getBooleanProperty("use.mac.keychain", true)) {
return CredentialStoreWrapper(KeyChainCredentialStore("IntelliJ Platform"))
}
return null
}
}
private class LinuxSecretCredentialStoreFactory : CredentialStoreFactory {
override fun create(): PasswordStorage? {
if (SystemInfo.isLinux && SystemProperties.getBooleanProperty("use.linux.keychain", true)) {
return CredentialStoreWrapper(SecretCredentialStore("com.intellij.credentialStore.Credential"))
}
return null
}
}
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.passwordSafe
package com.intellij.credentialStore
import com.intellij.testFramework.RuleChain
import com.intellij.testFramework.TemporaryDirectory
@@ -0,0 +1,32 @@
package com.intellij.credentialStore.linux
import com.intellij.openapi.util.SystemInfo
import com.intellij.testFramework.UsefulTestCase
import org.assertj.core.api.Assertions.assertThat
import org.junit.Test
import java.math.BigInteger
import java.util.*
class LinuxSecretTest {
@Test
fun test() {
if (!SystemInfo.isLinux || UsefulTestCase.IS_UNDER_TEAMCITY) {
return
}
val store = SecretCredentialStore("com.intellij.test")
val pass = BigInteger(128, Random()).toString(32)
store.set("test", pass.toByteArray())
assertThat(store.get("test")).isEqualTo(pass)
store.set("test", null)
assertThat(store.get("test")).isNull()
val unicodePassword = "Gr\u00FCnwald"
store.set("test", unicodePassword.toByteArray())
assertThat(store.get("test")).isEqualTo(unicodePassword)
store.set(unicodePassword, pass.toByteArray())
assertThat(store.get(unicodePassword)).isEqualTo(pass)
}
}
@@ -13,14 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.passwordSafe
package com.intellij.credentialStore
import com.intellij.ide.passwordSafe.impl.providers.masterKey.PasswordDatabase
import com.intellij.openapi.util.JDOMUtil
import com.intellij.testFramework.ApplicationRule
import com.intellij.testFramework.runInEdtAndWait
import com.intellij.util.xmlb.XmlSerializer
import org.assertj.core.api.Assertions.assertThat
import org.junit.ClassRule
import org.junit.Test
@@ -74,7 +74,7 @@ public abstract class InspectionRVContentProvider {
@NotNull
public RefElementNode createNode(@NotNull InspectionToolPresentation presentation) {
return ReadAction.compute(() -> new RefElementNode(myEntity, presentation));
return ReadAction.compute(() -> presentation.createRefNode(myEntity));
}
@Nullable
@@ -271,7 +271,7 @@ public class QuickFixAction extends AnAction implements CustomComponentAction {
}
}
private static void refreshViews(@NotNull Project project, @NotNull RefEntity[] refElements, @NotNull InspectionToolWrapper toolWrapper) {
protected static void refreshViews(@NotNull Project project, @NotNull RefEntity[] refElements, @NotNull InspectionToolWrapper toolWrapper) {
final Set<PsiElement> ignoredElements = new HashSet<>();
for (RefEntity element : refElements) {
final PsiElement psiElement = element instanceof RefElement ? ((RefElement)element).getElement() : null;
@@ -48,6 +48,12 @@ public interface InspectionToolPresentation extends ProblemDescriptionsProcessor
@NotNull InspectionTreeNode parentNode,
final boolean showStructure,
final boolean groupBySeverity);
@NotNull
default RefElementNode createRefNode(@NotNull RefEntity entity) {
return new RefElementNode(entity, this);
}
void updateContent();
boolean hasReportedProblems();
@@ -69,7 +69,7 @@ class InspectionTreeCellRenderer extends ColoredTreeCellRenderer {
if (node.isExcluded(myView.getExcludedManager())) {
return attributes.derive(attributes.getStyle() | SimpleTextAttributes.STYLE_STRIKEOUT, null, null, null);
}
if (node instanceof ProblemDescriptionNode && ((ProblemDescriptionNode)node).isQuickFixAppliedFromView()) {
if (node instanceof SuppressableInspectionTreeNode && ((SuppressableInspectionTreeNode)node).isQuickFixAppliedFromView()) {
return attributes.derive(-1, SimpleTextAttributes.GRAYED_ATTRIBUTES.getFgColor(), null, null);
}
if (!node.isValid()) {
@@ -169,6 +169,7 @@ public class ProblemDescriptionNode extends SuppressableInspectionTreeNode {
return XmlStringUtil.stripHtml(ProblemDescriptorUtil.renderDescriptionMessage(descriptor, element, TRIM_AT_TREE_END));
}
@Override
public boolean isQuickFixAppliedFromView() {
return (myDescriptor != null && myPresentation.isProblemResolved(getElement(), myDescriptor)) && !isAlreadySuppressedFromView();
}
@@ -134,6 +134,11 @@ public class RefElementNode extends SuppressableInspectionTreeNode {
super.visitProblemSeverities(counter);
}
@Override
public boolean isQuickFixAppliedFromView() {
return false;
}
@Nullable
@Override
public String getCustomizedTailText() {
@@ -60,6 +60,8 @@ public abstract class SuppressableInspectionTreeNode extends CachedInspectionTre
return usrObj != null && myView.getSuppressedNodes(myPresentation.getToolWrapper().getShortName()).contains(usrObj);
}
public abstract boolean isQuickFixAppliedFromView();
@Nullable
@Override
public String getCustomizedTailText() {
@@ -43,6 +43,7 @@ import com.intellij.ui.components.JBList;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.util.Consumer;
import com.intellij.util.concurrency.Semaphore;
import com.intellij.util.containers.ContainerUtil;
import org.jdom.Attribute;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
@@ -190,22 +191,13 @@ extends BeforeRunTaskProvider<RunConfigurationBeforeRunProvider.RunConfigurableB
return false;
}
List<ExecutionTarget> targets = ApplicationManager.getApplication().runReadAction(new Computable<List<ExecutionTarget>>() {
@Override
public List<ExecutionTarget> compute() {
return ExecutionTargetManager.getTargetsFor(env.getProject(), settings);
}
});
if (targets.isEmpty()) {
ExecutionTarget compatibleTarget = getCompatibleTarget(env, settings);
if (compatibleTarget == null) {
return false;
}
final ExecutionEnvironment environment = builder.target(targets.get(0)).build();
final ExecutionEnvironment environment = builder.target(compatibleTarget).build();
environment.setExecutionId(env.getExecutionId());
if (!ExecutionTargetManager.canRun(settings, environment.getExecutionTarget())) {
return false;
}
if (!environment.getRunner().canRun(executorId, environment.getRunProfile())) {
return false;
@@ -216,6 +208,22 @@ extends BeforeRunTaskProvider<RunConfigurationBeforeRunProvider.RunConfigurableB
}
}
@Nullable
private static ExecutionTarget getCompatibleTarget(@NotNull ExecutionEnvironment env, @NotNull RunnerAndConfigurationSettings settings) {
if (ExecutionTargetManager.canRun(settings, env.getExecutionTarget())) {
return env.getExecutionTarget();
}
List<ExecutionTarget> targets = ApplicationManager.getApplication().runReadAction(new Computable<List<ExecutionTarget>>() {
@Override
public List<ExecutionTarget> compute() {
return ExecutionTargetManager.getTargetsFor(env.getProject(), settings);
}
});
return ContainerUtil.getFirstItem(targets);
}
public static boolean doRunTask(final String executorId, final ExecutionEnvironment environment, ProgramRunner<?> runner) {
final Semaphore targetDone = new Semaphore();
final Ref<Boolean> result = new Ref<>(false);
@@ -407,11 +407,6 @@ public class ShowUsagesAction extends AnAction implements PopupAction {
public UsageNode valueOf(UsageNode node) {
return node;
}
@Override
public boolean isCellEditable(UsageNode node) {
return usageView.isOriginUsage(node.getUsage());
}
};
List<ColumnInfo<UsageNode, UsageNode>> list = Collections.nCopies(cols, o);
return list.toArray(new ColumnInfo[list.size()]);
@@ -652,7 +647,7 @@ public class ShowUsagesAction extends AnAction implements PopupAction {
new DumbAwareAction() {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
cancel(popup);
cancel(popup[0]);
showDialogAndFindUsages(handler, popupPosition, editor, maxUsages);
}
}.registerCustomShortcutSet(new CustomShortcutSet(shortcut.getFirstKeyStroke()), table);
@@ -662,13 +657,13 @@ public class ShowUsagesAction extends AnAction implements PopupAction {
new DumbAwareAction() {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
cancel(popup);
cancel(popup[0]);
searchEverywhere(options, handler, editor, popupPosition, maxUsages);
}
}.registerCustomShortcutSet(new CustomShortcutSet(shortcut.getFirstKeyStroke()), table);
}
InplaceButton settingsButton = createSettingsButton(handler, popupPosition, editor, maxUsages, () -> cancel(popup));
InplaceButton settingsButton = createSettingsButton(handler, popupPosition, editor, maxUsages, () -> cancel(popup[0]));
ActiveComponent spinningProgress = new ActiveComponent.Adapter() {
@Override
@@ -726,7 +721,7 @@ public class ShowUsagesAction extends AnAction implements PopupAction {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
hideHints();
cancel(popup);
cancel(popup[0]);
FindUsagesManager findUsagesManager = ((FindManagerImpl)FindManager.getInstance(usageView.getProject())).getFindUsagesManager();
findUsagesManager.findUsages(handler.getPrimaryElements(), handler.getSecondaryElements(), handler, options,
FindSettings.getInstance().isSkipResultsWithOneUsage());
@@ -747,9 +742,9 @@ public class ShowUsagesAction extends AnAction implements PopupAction {
};
}
private static void cancel(@Nullable JBPopup... popup) {
if (popup != null && popup.length>0 && popup[0] != null) {
popup[0].cancel();
private static void cancel(@Nullable JBPopup popup) {
if (popup != null) {
popup.cancel();
}
}
@@ -957,6 +952,13 @@ public class ShowUsagesAction extends AnAction implements PopupAction {
newSelection = table.getSelectedRow();
}
else {
// do not pre-select the usage under caret by default
if (newSelection == 0 && table.getModel().getRowCount() > 1) {
Object valueInTopRow = table.getModel().getValueAt(0, 0);
if (valueInTopRow instanceof UsageNode && usageView.isOriginUsage(((UsageNode)valueInTopRow).getUsage())) {
newSelection++;
}
}
table.getSelectionModel().setSelectionInterval(newSelection, newSelection);
}
ScrollingUtil.ensureIndexIsVisible(table, newSelection, 0);
@@ -307,7 +307,7 @@ public abstract class AbstractNavBarUI implements NavBarUI {
@Override
public void doPaintNavBarPanel(Graphics2D g, Rectangle r, boolean mainToolbarVisible, boolean undocked) {
g.setColor(getBackgroundColor());
if (!UIUtil.isUnderAquaLookAndFeel() && mainToolbarVisible) {
if (mainToolbarVisible) {
g.fillRect(0, 0, r.width, r.height);
}
}
@@ -53,7 +53,10 @@ import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.*;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.wm.IdeFocusManager;
@@ -88,7 +91,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.event.DocumentEvent;
import javax.swing.event.ListSelectionEvent;
@@ -389,9 +391,6 @@ public abstract class ChooseByNameBase {
if (myModel.getPromptText() != null) {
JLabel label = new JLabel(myModel.getPromptText());
if (UIUtil.isUnderAquaLookAndFeel()) {
label.setBorder(new CompoundBorder(new EmptyBorder(0, 9, 0, 0), label.getBorder()));
}
label.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
caption2Tools.add(label, BorderLayout.WEST);
}
+1 -9
View File
@@ -16,17 +16,9 @@
<orderEntry type="module" module-name="forms_rt" exported="" />
<orderEntry type="library" name="commons-codec" level="project" />
<orderEntry type="module" module-name="platform-resources-en" exported="" />
<orderEntry type="library" name="automaton" level="project" />
<orderEntry type="library" name="OroMatcher" level="project" />
<orderEntry type="module" module-name="icons" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../lib/automaton.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="projectModel-api" exported="" />
<orderEntry type="library" name="Netty" level="project" />
<orderEntry type="library" name="proxy-vole" level="project" />
@@ -87,7 +87,7 @@ public class FileChooser {
@Nullable final Project project,
@Nullable final VirtualFile toSelect,
@NotNull final Consumer<List<VirtualFile>> callback) {
chooseFiles(descriptor, project, KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(), toSelect, callback);
chooseFiles(descriptor, project, KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(), toSelect, callback);
}
/**
@@ -17,7 +17,6 @@ package com.intellij.openapi.ui;
import com.intellij.openapi.ui.popup.JBPopup;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.ui.components.JBList;
@@ -27,7 +26,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.ComboPopup;
import javax.swing.table.TableCellEditor;
import java.awt.*;
@@ -242,14 +240,7 @@ public class ComboBox<E> extends ComboBoxWithWidePopup<E> implements AWTEventLis
}
public final void setEditor(final ComboBoxEditor editor) {
ComboBoxEditor _editor = editor;
if (SystemInfo.isMac && UIUtil.isUnderAquaLookAndFeel()) {
if (editor instanceof UIResource) {
_editor = new FixedComboBoxEditor();
}
}
super.setEditor(new MyEditor(this, _editor));
super.setEditor(new MyEditor(this, editor));
}
public final Dimension getMinimumSize() {
@@ -266,23 +257,6 @@ public class ComboBox<E> extends ComboBoxWithWidePopup<E> implements AWTEventLis
return new Dimension(width, UIUtil.fixComboBoxHeight(preferredSize.height));
}
@Override
public Insets getInsets() {
Insets insets = super.getInsets();
if (SystemInfo.isMac && UIUtil.isUnderAquaLookAndFeel() && isEditable) {
insets.right += 2;
}
return insets;
}
@Override
public boolean hasFocus() {
if (SystemInfo.isMac && UIUtil.isUnderAquaLookAndFeel() && myPaintingNow && isEditable) {
return false;
}
return super.hasFocus();
}
protected Dimension getOriginalPreferredSize() {
return super.getPreferredSize();
}
@@ -98,6 +98,8 @@ public interface BalloonBuilder {
@NotNull
BalloonBuilder setRequestFocus(boolean requestFocus);
BalloonBuilder setHideOnCloseClick(boolean hideOnCloseClick);
/**
* Links target balloon life cycle to the given object. I.e. current balloon will be auto-hide and collected as soon
* as given anchor is disposed.
@@ -19,61 +19,62 @@ import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.atomic.AtomicLong;
import java.util.zip.GZIPInputStream;
public class CompressedBytesReadAwareGZIPInputStream extends GZIPInputStream {
private final BytesReadAwareInputStream myInputStream;
/**
* A stream for reading compressed data in the GZIP file format.
* Total amount of compressed read bytes can be accessed via {@link #getCompressedBytesRead()}.
*
* Note that this implementation is not thread safe.
*/
public class CountingGZIPInputStream extends GZIPInputStream {
private final CountingInputStream myInputStream;
private CompressedBytesReadAwareGZIPInputStream(@NotNull BytesReadAwareInputStream inputStream) throws IOException {
private CountingGZIPInputStream(@NotNull CountingInputStream inputStream) throws IOException {
super(inputStream);
myInputStream = inputStream;
}
public long getCompressedBytesRead() {
return myInputStream.myBytesRead.get();
return myInputStream.myBytesRead;
}
@NotNull
public static CompressedBytesReadAwareGZIPInputStream create(@NotNull InputStream inputStream) throws IOException {
return new CompressedBytesReadAwareGZIPInputStream(new BytesReadAwareInputStream(inputStream));
public static CountingGZIPInputStream create(@NotNull InputStream inputStream) throws IOException {
return new CountingGZIPInputStream(new CountingInputStream(inputStream));
}
private static class BytesReadAwareInputStream extends InputStream {
private static class CountingInputStream extends InputStream {
private final InputStream myInputStream;
private final AtomicLong myBytesRead = new AtomicLong(0);
private long myBytesRead = 0;
public BytesReadAwareInputStream(@NotNull InputStream inputStream) {
public CountingInputStream(@NotNull InputStream inputStream) {
myInputStream = inputStream;
}
public int read() throws IOException {
long bytesReadBefore = myBytesRead.get();
int data = myInputStream.read();
myBytesRead.compareAndSet(bytesReadBefore, bytesReadBefore + 1);
myBytesRead++;
return data;
}
@Override
public int read(@NotNull byte[] b) throws IOException {
long bytesReadBefore = myBytesRead.get();
int bytesRead = myInputStream.read(b);
myBytesRead.compareAndSet(bytesReadBefore, bytesReadBefore + bytesRead);
myBytesRead += bytesRead;
return bytesRead;
}
@Override
public int read(@NotNull byte[] b, int off, int len) throws IOException {
long bytesReadBefore = myBytesRead.get();
int bytesRead = myInputStream.read(b, off, len);
myBytesRead.compareAndSet(bytesReadBefore, bytesReadBefore + bytesRead);
myBytesRead += bytesRead;
return bytesRead;
}
public long skip(long n) throws IOException {
long bytesReadBefore = myBytesRead.get();
long bytesSkipped = myInputStream.skip(n);
myBytesRead.compareAndSet(bytesReadBefore, bytesReadBefore + bytesSkipped);
myBytesRead += bytesSkipped;
return bytesSkipped;
}
@@ -278,8 +278,7 @@ public final class HttpRequests {
if (myInputStream == null) {
myInputStream = getConnection().getInputStream();
if (myBuilder.myGzip && "gzip".equalsIgnoreCase(getConnection().getContentEncoding())) {
//noinspection IOResourceOpenedButNotSafelyClosed
myInputStream = CompressedBytesReadAwareGZIPInputStream.create(myInputStream);
myInputStream = CountingGZIPInputStream.create(myInputStream);
}
}
return myInputStream;
@@ -21,7 +21,7 @@ import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.util.ObjectUtils;
import com.intellij.util.SystemProperties;
import com.intellij.util.io.CompressedBytesReadAwareGZIPInputStream;
import com.intellij.util.io.CountingGZIPInputStream;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -188,7 +188,7 @@ public class NetUtils {
indicator.setIndeterminate(true);
}
}
CompressedBytesReadAwareGZIPInputStream gzipStream = ObjectUtils.tryCast(inputStream, CompressedBytesReadAwareGZIPInputStream.class);
CountingGZIPInputStream gzipStream = ObjectUtils.tryCast(inputStream, CountingGZIPInputStream.class);
final byte[] buffer = new byte[8 * 1024];
int count;
int bytesWritten = 0;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -137,11 +137,13 @@ public class CustomizationUtil {
@Override
public boolean accept(Object node) {
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)node;
if (treeNode.isLeaf()) {
Object userObject = treeNode.getUserObject();
if (treeNode.isLeaf() && !(userObject instanceof Group)) {
return true;
}
final ActionUrl url = getActionUrl(new TreePath(treeNode.getPath()), 0);
url.getGroupPath().add(((Group)treeNode.getUserObject()).getName());
ActionUrl url = getActionUrl(new TreePath(treeNode.getPath()), 0);
String groupName = ((Group)userObject).getName();
url.getGroupPath().add(groupName);
final TreePath treePath = getTreePath(defaultTree, url);
if (treePath != null) {
final DefaultMutableTreeNode visited = (DefaultMutableTreeNode)treePath.getLastPathComponent();
@@ -152,7 +154,7 @@ public class CustomizationUtil {
//customizations at the new place
url.getGroupPath().remove(url.getParentGroup());
if (actions.contains(url)){
url.getGroupPath().add(((Group)treeNode.getUserObject()).getName());
url.getGroupPath().add(groupName);
actions.addAll(schema.getChildActions(url));
}
}
@@ -54,6 +54,7 @@ import com.intellij.ui.mac.foundation.MacUtil;
import com.intellij.util.IJSwingUtilities;
import com.intellij.util.ReflectionUtil;
import com.intellij.util.ui.JBInsets;
import com.intellij.util.ui.OwnerOptional;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -175,18 +176,16 @@ public class DialogWrapperPeerImpl extends DialogWrapperPeer implements FocusTra
*/
protected DialogWrapperPeerImpl(@NotNull DialogWrapper wrapper, @NotNull Component parent, boolean canBeParent) {
myWrapper = wrapper;
if (!parent.isShowing()) {
throw new IllegalArgumentException("parent must be showing: " + parent);
}
myWindowManager = null;
Application application = ApplicationManager.getApplication();
if (application != null && application.hasComponent(WindowManager.class)) {
myWindowManager = (WindowManagerEx)WindowManager.getInstance();
}
Window owner = parent instanceof Window ? (Window)parent : (Window)SwingUtilities.getAncestorOfClass(Window.class, parent);
if (!(owner instanceof Dialog) && !(owner instanceof Frame)) {
owner = JOptionPane.getRootFrame();
Window owner = OwnerOptional.fromComponent(parent).get();
if (!owner.isShowing()) {
throw new IllegalArgumentException("owner must be showing: " + owner);
}
createDialog(owner, canBeParent);
}
@@ -219,7 +218,7 @@ public class DialogWrapperPeerImpl extends DialogWrapperPeer implements FocusTra
@Deprecated
public DialogWrapperPeerImpl(@NotNull DialogWrapper wrapper,final Window owner, final boolean canBeParent, final boolean applicationModalIfPossible) {
this(wrapper, owner, canBeParent, applicationModalIfPossible ? DialogWrapper.IdeModalityType.IDE : DialogWrapper.IdeModalityType.PROJECT);
this(wrapper, owner, canBeParent, applicationModalIfPossible ? DialogWrapper.IdeModalityType.IDE : DialogWrapper.IdeModalityType.PROJECT);
}
@Override
@@ -496,7 +495,7 @@ public class DialogWrapperPeerImpl extends DialogWrapperPeer implements FocusTra
if (StackingPopupDispatcher.getInstance().isPopupFocused()) return;
JTree tree = UIUtil.getParentOfType(JTree.class, focusOwner);
JTable table = UIUtil.getParentOfType(JTable.class, focusOwner);
if (tree != null || table != null) {
if (hasNoEditingTreesOrTablesUpward(focusOwner)) {
e.getPresentation().setEnabled(true);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -184,8 +184,14 @@ public final class StripeButton extends AnchoredButton implements ActionListener
myDragPane = findLayeredPane(e);
if (myDragPane == null) return;
final BufferedImage image = UIUtil.createImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB);
paint(image.getGraphics());
int width = getWidth() - 1; // -1 because StripeButtonUI.paint will not paint 1 pixel in case (anchor == ToolWindowAnchor.LEFT)
int height = getHeight() - 1; // -1 because StripeButtonUI.paint will not paint 1 pixel in case (anchor.isHorizontal())
BufferedImage image = UIUtil.createImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics graphics = image.getGraphics();
graphics.setColor(UIUtil.getBgFillColor(getParent()));
graphics.fillRect(0, 0, width, height);
paint(graphics);
graphics.dispose();
myDragButtonImage = new JLabel(new JBImageIcon(image)) {
public String toString() {
@@ -105,8 +105,8 @@ public class WelcomeBalloonLayoutImpl extends BalloonLayoutImpl {
});
myPopupBalloon =
new BalloonImpl(pane, BORDER_COLOR, new Insets(0, 0, 0, 0), FILL_COLOR, true, false, false, false, true, 0, false, false, null,
false, 0, 0, 0, 0, false, null, null, false, false, false, null, false);
new BalloonImpl(pane, BORDER_COLOR, new Insets(0, 0, 0, 0), FILL_COLOR, true, false, false, true, false, true, 0, false, false,
null, false, 0, 0, 0, 0, false, null, null, false, false, false, null, false);
myPopupBalloon.setAnimationEnabled(false);
myPopupBalloon.setShadowBorderProvider(
new NotificationBalloonShadowBorderProvider(FILL_COLOR, BORDER_COLOR));
@@ -157,7 +157,7 @@ public class BalloonImpl implements Balloon, IdeTooltip.Ui {
}
}
if (UIUtil.isCloseClick(me)) {
if (myHideOnCloseClick && UIUtil.isCloseClick(me)) {
if (isInsideBalloon(me)) {
hide();
me.consume();
@@ -291,6 +291,7 @@ public class BalloonImpl implements Balloon, IdeTooltip.Ui {
private Runnable myHideListener;
private final boolean myHideOnKey;
private final boolean myHideOnAction;
private final boolean myHideOnCloseClick;
private final boolean myRequestFocus;
private Component myOriginalFocusOwner;
private final boolean myEnableButtons;
@@ -302,6 +303,7 @@ public class BalloonImpl implements Balloon, IdeTooltip.Ui {
boolean hideOnMouse,
boolean hideOnKey,
boolean hideOnAction,
boolean hideOnCloseClick,
boolean showPointer,
boolean enableButtons,
long fadeoutTime,
@@ -328,6 +330,7 @@ public class BalloonImpl implements Balloon, IdeTooltip.Ui {
myHideOnMouse = hideOnMouse;
myHideOnKey = hideOnKey;
myHideOnAction = hideOnAction;
myHideOnCloseClick = hideOnCloseClick;
myShowPointer = showPointer;
myEnableButtons = enableButtons;
myHideOnFrameResize = hideOnFrameResize;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -15,6 +15,7 @@
*/
package com.intellij.ui;
import com.intellij.jna.DisposableMemory;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.wm.IdeFrame;
@@ -70,17 +71,6 @@ class Win7TaskBar {
boolean FlashWindow(WinDef.HWND hwnd, boolean bInvert);
}
private static class MyMemory extends Memory {
private MyMemory(long size) {
super(size);
}
@Override
public synchronized void dispose() {
super.dispose();
}
}
private static boolean ourInitialized = true;
static {
@@ -162,7 +152,7 @@ class Win7TaskBar {
return new Object();
}
MyMemory memory = new MyMemory(ico.length);
DisposableMemory memory = new DisposableMemory(ico.length);
try {
memory.write(0, ico, 0, ico.length);
@@ -26,18 +26,15 @@ import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.fileChooser.PathChooserDialog;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.popup.StackingPopupDispatcher;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.IdeFrame;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.ui.UIBundle;
import com.intellij.ui.popup.AbstractPopup;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Consumer;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.OwnerOptional;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -54,23 +51,25 @@ import java.util.stream.Stream;
public class MacPathChooserDialog implements PathChooserDialog {
private final FileDialog myFileDialog;
private FileDialog myFileDialog;
private final FileChooserDescriptor myFileChooserDescriptor;
private final Component myParent;
private final String myTitle;
public MacPathChooserDialog(FileChooserDescriptor descriptor, Component parent, Project project) {
//StackingPopupDispatcher.getInstance().hidePersistentPopups();
//myDisposeActions.add(() -> StackingPopupDispatcher.getInstance().restorePersistentPopups());
myFileDialog = parent != null
? createFileDialogWithOwner(findOwnerByComponent(parent), descriptor.getTitle(), FileDialog.LOAD)
: createFileDialogWithoutOwner(descriptor.getTitle(), FileDialog.LOAD);
myFileChooserDescriptor = descriptor;
myParent = parent;
myTitle = getChooserTitle(descriptor);
Consumer<Dialog> dialogConsumer = owner -> myFileDialog = new FileDialog(owner, myTitle, FileDialog.LOAD);
Consumer<Frame> frameConsumer = owner -> myFileDialog = new FileDialog(owner, myTitle, FileDialog.LOAD);
OwnerOptional
.fromComponent(parent)
.ifDialog(dialogConsumer)
.ifFrame(frameConsumer)
.ifNull(frameConsumer);
}
private static String getChooserTitle(final FileChooserDescriptor descriptor) {
@@ -139,64 +138,6 @@ public class MacPathChooserDialog implements PathChooserDialog {
}
}
@NotNull
private static Window findOwnerByComponent(@NotNull Component component) {
return (component instanceof Window) ? (Window) component : SwingUtilities.getWindowAncestor(component);
}
@NotNull
private static FileDialog createFileDialogWithOwner(@NotNull Window owner, String title, int mode) {
FileDialog fileDialog;
IdePopupManager manager = IdeEventQueue.getInstance().getPopupManager();
if (manager.isPopupWindow(owner)) {
manager.closeAllPopups();
owner = owner.getOwner();
while (owner != null
&& !(owner instanceof Dialog)
&& !(owner instanceof Frame)) {
owner = owner.getOwner();
}
}
if (owner instanceof Dialog) {
Dialog ownerDialog = (Dialog)owner;
if (ownerDialog.isModal()) {
owner = ownerDialog;
}
else {
while (owner instanceof Dialog && !((Dialog)owner).isModal()) {
owner = owner.getOwner();
}
}
}
if (owner == null) {
fileDialog = createFileDialogWithoutOwner(title, mode);
}
else {
if (owner instanceof Frame) {
if (owner instanceof IdeFrame.Child) {
IdeFrame.Child ideFrameChild = (IdeFrame.Child)owner;
owner = WindowManager.getInstance().getFrame(ideFrameChild.getProject());
}
fileDialog = new FileDialog((Frame)owner, title, mode);
}
else if (owner instanceof Dialog) {
fileDialog = new FileDialog((Dialog)owner, title, mode);
}
else {
throw new RuntimeException("Owner should be a frame or a dialog");
}
}
return fileDialog;
}
@NotNull
private static FileDialog createFileDialogWithoutOwner(String title, int load) {
// This is bad. But sometimes we do not have any windows at all.
@@ -61,6 +61,7 @@ public class BalloonPopupBuilderImpl implements BalloonBuilder {
private int myPositionChangeXShift;
private int myPositionChangeYShift;
private boolean myHideOnAction = true;
private boolean myHideOnCloseClick = true;
private boolean myDialogMode;
private String myTitle;
private Insets myContentInsets = JBUI.insets(2);
@@ -153,6 +154,12 @@ public class BalloonPopupBuilderImpl implements BalloonBuilder {
return this;
}
@Override
public BalloonBuilder setHideOnCloseClick(boolean hideOnCloseClick) {
myHideOnCloseClick = hideOnCloseClick;
return this;
}
@NotNull
@Override
public BalloonBuilder setAnimationCycle(int time) {
@@ -256,10 +263,10 @@ public class BalloonPopupBuilderImpl implements BalloonBuilder {
@Override
public Balloon createBalloon() {
final BalloonImpl result = new BalloonImpl(
myContent, myBorder, myBorderInsets, myFill, myHideOnMouseOutside, myHideOnKeyOutside, myHideOnAction, myShowCallout, myCloseButtonEnabled,
myFadeoutTime, myHideOnFrameResize, myHideOnLinkClick, myClickHandler, myCloseOnClick, myAnimationCycle, myCalloutShift,
myPositionChangeXShift, myPositionChangeYShift, myDialogMode, myTitle, myContentInsets, myShadow, mySmallVariant, myBlockClicks,
myLayer, myRequestFocus);
myContent, myBorder, myBorderInsets, myFill, myHideOnMouseOutside, myHideOnKeyOutside, myHideOnAction, myHideOnCloseClick,
myShowCallout, myCloseButtonEnabled, myFadeoutTime, myHideOnFrameResize, myHideOnLinkClick, myClickHandler, myCloseOnClick,
myAnimationCycle, myCalloutShift, myPositionChangeXShift, myPositionChangeYShift, myDialogMode, myTitle, myContentInsets, myShadow,
mySmallVariant, myBlockClicks, myLayer, myRequestFocus);
if (myStorage != null && myAnchor != null) {
List<Balloon> balloons = myStorage.get(myAnchor);
@@ -0,0 +1,104 @@
/*
* Copyright 2000-2016 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.util.ui;
import com.intellij.ide.IdeEventQueue;
import com.intellij.ide.IdePopupManager;
import com.intellij.openapi.wm.IdeFrame;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.util.Consumer;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.awt.*;
/**
* @author Denis Fokin
*/
public class OwnerOptional {
@NotNull
private static Window findOwnerByComponent(@NotNull Component component) {
return (component instanceof Window) ? (Window) component : SwingUtilities.getWindowAncestor(component);
}
private Window myPermanentOwner;
private OwnerOptional(Window permanentOwner) {
this.myPermanentOwner = permanentOwner;
}
public static OwnerOptional fromComponent (Component parentComponent) {
Window owner = findOwnerByComponent(parentComponent);
IdePopupManager manager = IdeEventQueue.getInstance().getPopupManager();
if (manager.isPopupWindow(owner)) {
manager.closeAllPopups();
owner = owner.getOwner();
while (owner != null
&& !(owner instanceof Dialog)
&& !(owner instanceof Frame)) {
owner = owner.getOwner();
}
}
if (owner instanceof Dialog) {
Dialog ownerDialog = (Dialog)owner;
if (ownerDialog.isModal()) {
owner = ownerDialog;
}
else {
while (owner instanceof Dialog && !((Dialog)owner).isModal()) {
owner = owner.getOwner();
}
}
}
return new OwnerOptional(owner);
}
public OwnerOptional ifDialog(Consumer<Dialog> consumer) {
if (myPermanentOwner instanceof Dialog) {
consumer.consume((Dialog)myPermanentOwner);
}
return this;
}
public OwnerOptional ifNull(Consumer<Frame> consumer) {
consumer.consume((Frame)this.myPermanentOwner);
return this;
}
public OwnerOptional ifFrame(Consumer<Frame> consumer) {
if (myPermanentOwner instanceof Frame) {
if (myPermanentOwner instanceof IdeFrame.Child) {
IdeFrame.Child ideFrameChild = (IdeFrame.Child)myPermanentOwner;
myPermanentOwner = WindowManager.getInstance().getFrame(ideFrameChild.getProject());
}
consumer.consume((Frame)this.myPermanentOwner);
}
return this;
}
public Window get() {
return myPermanentOwner;
}
}
@@ -1027,6 +1027,10 @@ action.XDebugger.RemoveWatch.text=Remove Watch
action.XDebugger.RemoveAllWatches.text=Remove All Watches
action.XDebugger.NewWatch.text=New Watch...
action.XDebugger.EditWatch.text=Edit...
action.XDebugger.CopyWatch.text=Duplicate Watch
action.XDebugger.MoveWatchUp.text=Move Watch Up
action.XDebugger.MoveWatchDown.text=Move Watch Down
action.XDebugger.SwitchWatchesInVariables.text=Show watches in variables tab
action.XDebugger.AutoTooltip.text=Value auto tooltip
action.XDebugger.AutoTooltip.description=Toggles if value tooltip is shown automatically on mouse over
action.XDebugger.Inline.text=Show Values Inline
@@ -70,7 +70,7 @@ xdebugger.button.evaluate=E&valuate
xdebugger.evaluate.dialog.close=Close
xdebugger.dialog.title.evaluate.expression=Evaluate Expression
xdebugger.evaluate.label.expression=Expression:
xdebugger.evaluate.addtowatches.hint=Use Control+Shift+Enter to add to Watches
xdebugger.evaluate.addtowatches.hint=Use {0} to add to Watches
dialog.title.evaluate.code.fragment=Evaluate Code Fragment
button.text.code.fragment.mode=Code Fragment &Mode
button.text.expression.mode=Expression &Mode
@@ -111,7 +111,6 @@ stack.frame.loading.text=Loading\u2026
invalid.frame=<invalid frame>
xdebugger.drag.text.0.elements={0} elements
xdebugger.drop.text.add.to.watches=Add to watches
debugger.session.tab.show.watches.in.variables=Show watches in variables tab
debugger.frames.not.available=Frames are not available
debugger.threads.not.available=Threads are not available
@@ -269,6 +269,6 @@
<extensionPoint name="settingsSummaryFactory" interface="com.intellij.settingsSummary.ProblemType"/>
<extensionPoint name="credentialStore" interface="com.intellij.ide.passwordSafe.CredentialStoreFactory"/>
<extensionPoint name="credentialStore" interface="com.intellij.credentialStore.CredentialStoreFactory"/>
</extensionPoints>
</idea-plugin>
@@ -159,13 +159,13 @@
<applicationService serviceInterface="com.intellij.ide.passwordSafe.impl.providers.masterKey.PasswordDatabase"
serviceImplementation="com.intellij.ide.passwordSafe.impl.providers.masterKey.PasswordDatabase"/>
<applicationService serviceInterface="com.intellij.ide.passwordSafe.config.PasswordSafeSettings"
serviceImplementation="com.intellij.ide.passwordSafe.config.PasswordSafeSettings"/>
<applicationService serviceInterface="com.intellij.credentialStore.PasswordSafeSettings"
serviceImplementation="com.intellij.credentialStore.PasswordSafeSettings"/>
<applicationService serviceInterface="com.intellij.ide.passwordSafe.PasswordSafe"
serviceImplementation="com.intellij.ide.passwordSafe.impl.PasswordSafeImpl"/>
<ApplicationLoadListener implementation="com.intellij.ide.passwordSafe.PasswordDatabaseConvertor"/>
<ApplicationLoadListener implementation="com.intellij.credentialStore.PasswordDatabaseConvertor"/>
<applicationConfigurable parentId="preferences.general" instance="com.intellij.ide.passwordSafe.config.PasswordSafeConfigurable" id="application.passwordSafe"
<applicationConfigurable parentId="preferences.general" instance="com.intellij.credentialStore.PasswordSafeConfigurable" id="application.passwordSafe"
displayName="Passwords"/>
<applicationService serviceInterface="com.intellij.execution.process.ColoredOutputTypeRegistry"
serviceImplementation="com.intellij.execution.process.ColoredOutputTypeRegistry"/>
@@ -444,6 +444,7 @@
<additionalTextAttributes scheme="Default" file="idea/FindViewColorsScheme.xml"/>
<additionalTextAttributes scheme="Darcula" file="idea/FindViewColorsScheme.xml"/>
<credentialStore implementation="com.intellij.ide.passwordSafe.MacOsCredentialStoreFactory" os="mac"/>
<credentialStore implementation="com.intellij.credentialStore.MacOsCredentialStoreFactory" os="mac"/>
<credentialStore implementation="com.intellij.credentialStore.LinuxSecretCredentialStoreFactory" os="linux"/>
</extensions>
</idea-plugin>
@@ -738,6 +738,10 @@
text="Duplicate Watch" use-shortcut-of="EditorDuplicate"/>
<action id="XDebugger.RemoveWatch" class="com.intellij.xdebugger.impl.frame.actions.XRemoveWatchAction" icon="AllIcons.Actions.Delete"
use-shortcut-of="$Delete"/>
<action id="XDebugger.MoveWatchUp" class="com.intellij.xdebugger.impl.frame.actions.XMoveWatchUp" use-shortcut-of="MethodUp"/>
<action id="XDebugger.MoveWatchDown" class="com.intellij.xdebugger.impl.frame.actions.XMoveWatchDown" use-shortcut-of="MethodDown"/>
<action id="XDebugger.SwitchWatchesInVariables" class="com.intellij.xdebugger.impl.frame.actions.XSwitchWatchesInVariables"
icon="AllIcons.Debugger.Watches"/>
<action id="XDebugger.RemoveAllWatches" class="com.intellij.xdebugger.impl.frame.actions.XRemoveAllWatchesAction"/>
<action id="XDebugger.MuteBreakpoints" class="com.intellij.xdebugger.impl.actions.MuteBreakpointAction"
icon="AllIcons.Debugger.MuteBreakpoints"/>
@@ -817,6 +821,10 @@
<group id="XDebugger.Watches.Tree.Toolbar">
<reference ref="XDebugger.NewWatch"/>
<reference ref="XDebugger.RemoveWatch"/>
<reference ref="XDebugger.MoveWatchUp"/>
<reference ref="XDebugger.MoveWatchDown"/>
<reference ref="XDebugger.CopyWatch"/>
<reference ref="XDebugger.SwitchWatchesInVariables"/>
</group>
<group id="XDebugger.Inspect.Tree.Popup">
@@ -60,7 +60,7 @@ public class BalloonTest {
//pane.setBorder(new LineBorder(Color.blue));
balloon.set(new BalloonImpl(
new JLabel("Content"), Color.black, null , MessageType.ERROR.getPopupBackground(), true, true, true, true, true, 0, true, false, null,
new JLabel("Content"), Color.black, null , MessageType.ERROR.getPopupBackground(), true, true, true, true, true, true, 0, true, false, null,
false, 500, 25, 0, 0, false, "This is the title", JBUI.insets(2), true, false, false, Balloon.Layer.normal, false));
balloon.get().setShowPointer(true);
@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="util" exported="" />
<orderEntry type="module" module-name="extensions" exported="" />
<orderEntry type="module" module-name="core-api" exported="" />
<orderEntry type="library" exported="" name="picocontainer" level="project" />
<orderEntry type="module" module-name="bootstrap" />
<orderEntry type="library" exported="" name="commons-codec" level="project" />
<orderEntry type="module" module-name="platform-resources-en" exported="" />
<orderEntry type="module" module-name="icons" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../lib/automaton.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="projectModel-api" exported="" />
<orderEntry type="module" module-name="editor-ui-api" exported="" />
</component>
</module>
@@ -15,15 +15,7 @@
<orderEntry type="module" module-name="bootstrap" />
<orderEntry type="module" module-name="platform-resources-en" exported="" />
<orderEntry type="module" module-name="icons" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../lib/automaton.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="automaton" level="project" />
<orderEntry type="module" module-name="projectModel-api" exported="" />
</component>
</module>
@@ -59,7 +59,7 @@ public class LightProjectDescriptor {
@NotNull
public Module createMainModule(@NotNull Project project) {
return createModule(project, "light_idea_test_case.iml");
return createModule(project, FileUtil.join(FileUtil.getTempDirectory(), "light_idea_test_case.iml"));
}
protected Module createModule(@NotNull Project project, @NotNull String moduleFilePath) {
@@ -69,7 +69,7 @@ public class LightProjectDescriptor {
//temporary workaround for IDEA-147530: otherwise if someone saved module with this name before the created module will get its settings
FileUtil.delete(imlFile);
}
return ModuleManager.getInstance(project).newModule(imlFile.getAbsolutePath(), getModuleType().getId());
return ModuleManager.getInstance(project).newModule(moduleFilePath, getModuleType().getId());
});
}
+25
View File
@@ -0,0 +1,25 @@
/*
* Copyright 2000-2016 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.jna
import com.sun.jna.Memory
class DisposableMemory(size: Long) : Memory(size) {
@Synchronized public override fun dispose() {
super.dispose()
}
}
@@ -238,14 +238,15 @@ public class XBreakpointManagerImpl implements XBreakpointManager, PersistentSta
@NotNull
public <B extends XBreakpoint<?>> Collection<? extends B> getBreakpoints(@NotNull final XBreakpointType<B,?> type) {
ApplicationManager.getApplication().assertReadAccessAllowed();
Collection<? extends XBreakpointBase<?,?,?>> breakpoints = myBreakpoints.get(type);
Collection<? extends B> regular = breakpoints != null ? Collections.unmodifiableCollection((Collection<? extends B>)breakpoints) : Collections.emptyList();
final XBreakpointBase<?, ?, ?> defaultBreakpoint = myDefaultBreakpoints.get(type);
if (defaultBreakpoint == null) return regular;
List<B> result = new ArrayList<>();
result.add((B)defaultBreakpoint);
result.addAll(regular);
B defaultBreakpoint = getDefaultBreakpoint(type);
if (defaultBreakpoint != null) {
result.add(defaultBreakpoint);
}
Collection<XBreakpointBase<?, ?, ?>> breakpoints = myBreakpoints.get(type);
if (breakpoints != null) {
result.addAll((Collection<? extends B>)breakpoints);
}
return result;
}
@@ -22,6 +22,7 @@ import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CustomShortcutSet;
import com.intellij.openapi.editor.ex.util.EditorUtil;
import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.FixedSizeButton;
import com.intellij.openapi.ui.popup.PopupStep;
@@ -72,7 +73,9 @@ public class ExpressionInputComponent extends EvaluationInputComponent {
}
});
myMainPanel.add(historyButton, BorderLayout.EAST);
final JBLabel help = new JBLabel(XDebuggerBundle.message("xdebugger.evaluate.addtowatches.hint"), SwingConstants.RIGHT);
final JBLabel help = new JBLabel(XDebuggerBundle.message("xdebugger.evaluate.addtowatches.hint",
KeymapUtil.getKeystrokeText(XDebuggerEvaluationDialog.ADD_WATCH_KEYSTROKE)),
SwingConstants.RIGHT);
help.setBorder(JBUI.Borders.empty(2, 0, 6, 0));
help.setComponentStyle(UIUtil.ComponentStyle.SMALL);
help.setFontColor(UIUtil.FontColor.BRIGHTER);
@@ -22,6 +22,7 @@ import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.WindowManager;
@@ -58,6 +59,10 @@ import java.awt.event.KeyEvent;
public class XDebuggerEvaluationDialog extends DialogWrapper {
public static final DataKey<XDebuggerEvaluationDialog> KEY = DataKey.create("DEBUGGER_EVALUATION_DIALOG");
//can not use new SHIFT_DOWN_MASK etc because in this case ActionEvent modifiers do not match
private static final int ADD_WATCH_MODIFIERS = (SystemInfo.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK) | InputEvent.SHIFT_MASK;
static KeyStroke ADD_WATCH_KEYSTROKE = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, ADD_WATCH_MODIFIERS);
private final JPanel myMainPanel;
private final JPanel myResultPanel;
private final XDebuggerTreePanel myTreePanel;
@@ -120,7 +125,7 @@ public class XDebuggerEvaluationDialog extends DialogWrapper {
doOKAction();
addToWatches();
}
}.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK)), getRootPane(), myDisposable);
}.registerCustomShortcutSet(new CustomShortcutSet(ADD_WATCH_KEYSTROKE), getRootPane(), myDisposable);
new AnAction() {
@Override
@@ -171,7 +176,7 @@ public class XDebuggerEvaluationDialog extends DialogWrapper {
@Override
public void actionPerformed(ActionEvent e) {
super.actionPerformed(e);
if ((e.getModifiers() & (InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK)) == (InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK)) {
if ((e.getModifiers() & ADD_WATCH_MODIFIERS) == ADD_WATCH_MODIFIERS) {
addToWatches();
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -17,6 +17,7 @@ package com.intellij.xdebugger.impl.frame;
import com.intellij.openapi.actionSystem.DataKey;
import com.intellij.xdebugger.XExpression;
import com.intellij.xdebugger.impl.ui.tree.nodes.WatchNode;
import com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode;
import org.jetbrains.annotations.NotNull;
@@ -15,7 +15,6 @@
*/
package com.intellij.xdebugger.impl.frame;
import com.intellij.icons.AllIcons;
import com.intellij.ide.DataManager;
import com.intellij.ide.dnd.DnDEvent;
import com.intellij.ide.dnd.DnDManager;
@@ -23,11 +22,14 @@ import com.intellij.ide.dnd.DnDNativeTarget;
import com.intellij.openapi.CompositeDisposable;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.impl.ActionToolbarImpl;
import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.EmptyRunnable;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.ui.*;
import com.intellij.ui.CaptionPanel;
import com.intellij.ui.ClickListener;
import com.intellij.ui.DoubleClickListener;
import com.intellij.ui.ListenerUtil;
import com.intellij.ui.border.CustomLineBorder;
import com.intellij.util.Alarm;
import com.intellij.util.containers.ContainerUtil;
@@ -40,7 +42,7 @@ import com.intellij.xdebugger.frame.XStackFrame;
import com.intellij.xdebugger.impl.XDebugSessionImpl;
import com.intellij.xdebugger.impl.actions.XDebuggerActions;
import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl;
import com.intellij.xdebugger.impl.frame.actions.XWatchesTreeActionBase;
import com.intellij.xdebugger.impl.ui.DebuggerSessionTabBase;
import com.intellij.xdebugger.impl.ui.DebuggerUIUtil;
import com.intellij.xdebugger.impl.ui.XDebugSessionData;
import com.intellij.xdebugger.impl.ui.XDebugSessionTab;
@@ -57,7 +59,10 @@ import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.event.*;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -75,8 +80,6 @@ public class XWatchesViewImpl extends XVariablesView implements DnDNativeTarget,
super(session);
myWatchesInVariables = watchesInVariables;
ActionManager actionManager = ActionManager.getInstance();
XDebuggerTree tree = getTree();
createNewRootNode(null);
@@ -101,74 +104,19 @@ public class XWatchesViewImpl extends XVariablesView implements DnDNativeTarget,
}
}.registerCustomShortcutSet(CommonShortcuts.getPaste(), tree, myDisposables);
ToolbarDecorator decorator = ToolbarDecorator.createDecorator(getTree());
ActionToolbarImpl toolbar = (ActionToolbarImpl)ActionManager.getInstance().createActionToolbar(
ActionPlaces.DEBUGGER_TOOLBAR,
DebuggerSessionTabBase.getCustomizedActionGroup(XDebuggerActions.WATCHES_TREE_TOOLBAR_GROUP),
!myWatchesInVariables);
toolbar.setBorder(new CustomLineBorder(CaptionPanel.CNT_ACTIVE_BORDER_COLOR, 0, 0,
myWatchesInVariables ? 0 : 1,
myWatchesInVariables ? 1 : 0));
toolbar.setTargetComponent(tree);
decorator.setAddAction(button -> executeAction(XDebuggerActions.XNEW_WATCH));
decorator.setAddIcon(AllIcons.Debugger.NewWatch);
decorator.setAddActionName(actionManager.getAction(XDebuggerActions.XNEW_WATCH).getTemplatePresentation().getText());
AnAction removeWatchAction = actionManager.getAction(XDebuggerActions.XREMOVE_WATCH);
decorator.setRemoveAction(button -> executeAction(XDebuggerActions.XREMOVE_WATCH));
decorator.setRemoveActionName(removeWatchAction.getTemplatePresentation().getText());
decorator.setRemoveActionUpdater(e -> {
removeWatchAction.update(e);
return e.getPresentation().isEnabled();
});
decorator.addExtraAction(AnActionButton.fromAction(actionManager.getAction(XDebuggerActions.XCOPY_WATCH)));
decorator.addExtraAction(
new ToggleActionButton(XDebuggerBundle.message("debugger.session.tab.show.watches.in.variables"), AllIcons.Debugger.Watches) {
@Override
public boolean isSelected(AnActionEvent e) {
XDebugSessionTab tab = session.getSessionTab();
return tab == null || tab.isWatchesInVariables();
}
@Override
public void setSelected(AnActionEvent e, boolean state) {
XDebugSessionTab tab = session.getSessionTab();
if (tab != null) {
tab.setWatchesInVariables(!tab.isWatchesInVariables());
}
}
});
decorator.setMoveUpAction(button -> {
List<? extends WatchNode> nodes = XWatchesTreeActionBase.getSelectedNodes(getTree(), WatchNode.class);
assert nodes.size() == 1;
myRootNode.moveUp(nodes.get(0));
updateSessionData();
});
decorator.setMoveUpActionUpdater(e -> {
List<? extends WatchNode> nodes = XWatchesTreeActionBase.getSelectedNodes(getTree(), WatchNode.class);
if (nodes.size() != 1) return false;
return myRootNode.getIndex(nodes.get(0)) > 0;
});
decorator.setMoveUpActionName("Move Watch Up");
decorator.setMoveDownAction(button -> {
List<? extends WatchNode> nodes = XWatchesTreeActionBase.getSelectedNodes(getTree(), WatchNode.class);
assert nodes.size() == 1;
myRootNode.moveDown(nodes.get(0));
updateSessionData();
});
decorator.setMoveDownActionUpdater(e -> {
List<? extends WatchNode> nodes = XWatchesTreeActionBase.getSelectedNodes(getTree(), WatchNode.class);
if (nodes.size() != 1) return false;
return myRootNode.getIndex(nodes.get(0)) < myRootNode.getWatchChildren().size() - 1;
});
decorator.setMoveDownActionName("Move Watch Down");
CustomLineBorder border = new CustomLineBorder(CaptionPanel.CNT_ACTIVE_BORDER_COLOR,
SystemInfo.isMac ? 1 : 0, 0,
SystemInfo.isMac ? 0 : 1, 0);
decorator.setToolbarBorder(border);
decorator.setPanelBorder(BorderFactory.createEmptyBorder());
getPanel().removeAll();
if (myWatchesInVariables) {
decorator.setToolbarPosition(ActionToolbarPosition.LEFT);
}
else {
if (!myWatchesInVariables) {
getTree().getEmptyText().setText(XDebuggerBundle.message("debugger.no.watches"));
}
getPanel().add(decorator.createPanel());
getPanel().add(toolbar.getComponent(), myWatchesInVariables ? BorderLayout.WEST : BorderLayout.NORTH);
installEditListeners();
}
@@ -362,6 +310,16 @@ public class XWatchesViewImpl extends XVariablesView implements DnDNativeTarget,
updateSessionData();
}
public void moveWatchUp(WatchNode node) {
myRootNode.moveUp(node);
updateSessionData();
}
public void moveWatchDown(WatchNode node) {
myRootNode.moveDown(node);
updateSessionData();
}
public void updateSessionData() {
List<XExpression> watchExpressions = ContainerUtil.newArrayList();
List<? extends WatchNode> children = myRootNode.getWatchChildren();
@@ -0,0 +1,56 @@
/*
* Copyright 2000-2016 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.xdebugger.impl.frame.actions;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.ui.CommonActionsPanel;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.xdebugger.impl.frame.XWatchesView;
import com.intellij.xdebugger.impl.frame.XWatchesViewImpl;
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
import com.intellij.xdebugger.impl.ui.tree.nodes.WatchNodeImpl;
import com.intellij.xdebugger.impl.ui.tree.nodes.WatchesRootNode;
import com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* @author egor
*/
public class XMoveWatchDown extends XWatchesTreeActionBase {
public XMoveWatchDown() {
getTemplatePresentation().setIcon(CommonActionsPanel.Buttons.DOWN.getIcon());
}
protected boolean isEnabled(@NotNull AnActionEvent e, @NotNull XDebuggerTree tree) {
List<? extends WatchNodeImpl> nodes = getSelectedNodes(tree, WatchNodeImpl.class);
if (nodes.size() == 1) {
XDebuggerTreeNode root = tree.getRoot();
if (root instanceof WatchesRootNode) {
return root.getIndex(nodes.get(0)) < ((WatchesRootNode)root).getWatchChildren().size() - 1;
}
}
return false;
}
@Override
protected void perform(@NotNull AnActionEvent e, @NotNull XDebuggerTree tree, @NotNull XWatchesView watchesView) {
if (watchesView instanceof XWatchesViewImpl) {
((XWatchesViewImpl)watchesView).moveWatchDown(ContainerUtil.getFirstItem(getSelectedNodes(tree, WatchNodeImpl.class)));
}
}
}
@@ -0,0 +1,56 @@
/*
* Copyright 2000-2016 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.xdebugger.impl.frame.actions;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.ui.CommonActionsPanel;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.xdebugger.impl.frame.XWatchesView;
import com.intellij.xdebugger.impl.frame.XWatchesViewImpl;
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
import com.intellij.xdebugger.impl.ui.tree.nodes.WatchNodeImpl;
import com.intellij.xdebugger.impl.ui.tree.nodes.WatchesRootNode;
import com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* @author egor
*/
public class XMoveWatchUp extends XWatchesTreeActionBase {
public XMoveWatchUp() {
getTemplatePresentation().setIcon(CommonActionsPanel.Buttons.UP.getIcon());
}
protected boolean isEnabled(@NotNull AnActionEvent e, @NotNull XDebuggerTree tree) {
List<? extends WatchNodeImpl> nodes = getSelectedNodes(tree, WatchNodeImpl.class);
if (nodes.size() == 1) {
XDebuggerTreeNode root = tree.getRoot();
if (root instanceof WatchesRootNode) {
return root.getIndex(nodes.get(0)) > 0;
}
}
return false;
}
@Override
protected void perform(@NotNull AnActionEvent e, @NotNull XDebuggerTree tree, @NotNull XWatchesView watchesView) {
if (watchesView instanceof XWatchesViewImpl) {
((XWatchesViewImpl)watchesView).moveWatchUp(ContainerUtil.getFirstItem(getSelectedNodes(tree, WatchNodeImpl.class)));
}
}
}
@@ -15,6 +15,7 @@
*/
package com.intellij.xdebugger.impl.frame.actions;
import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.xdebugger.impl.frame.XWatchesView;
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
@@ -30,7 +31,13 @@ public class XRemoveWatchAction extends XWatchesTreeActionBase {
@Override
public void update(AnActionEvent e) {
XDebuggerTree tree = XDebuggerTree.getTree(e);
e.getPresentation().setEnabledAndVisible(tree != null && !getSelectedNodes(tree, WatchNodeImpl.class).isEmpty());
boolean enabled = tree != null && !getSelectedNodes(tree, WatchNodeImpl.class).isEmpty();
if (ActionPlaces.DEBUGGER_TOOLBAR.equals(e.getPlace())) {
e.getPresentation().setEnabled(enabled);
}
else {
e.getPresentation().setEnabledAndVisible(enabled);
}
}
@Override
@@ -0,0 +1,39 @@
/*
* Copyright 2000-2016 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.xdebugger.impl.frame.actions;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.xdebugger.impl.ui.XDebugSessionTab;
/**
* @author egor
*/
public class XSwitchWatchesInVariables extends ToggleAction {
@Override
public boolean isSelected(AnActionEvent e) {
XDebugSessionTab tab = e.getData(XDebugSessionTab.TAB_KEY);
return tab == null || tab.isWatchesInVariables();
}
@Override
public void setSelected(AnActionEvent e, boolean state) {
XDebugSessionTab tab = e.getData(XDebugSessionTab.TAB_KEY);
if (tab != null) {
tab.setWatchesInVariables(!tab.isWatchesInVariables());
}
}
}
@@ -56,7 +56,7 @@ public abstract class DebuggerSessionTabBase extends RunTab {
.initFocusContent(DebuggerContentInfo.CONSOLE_CONTENT, LayoutViewOptions.STARTUP, new LayoutAttractionPolicy.FocusOnce(false));
}
protected static ActionGroup getCustomizedActionGroup(final String id) {
public static ActionGroup getCustomizedActionGroup(final String id) {
return (ActionGroup)CustomActionsSchema.getInstance().getCorrectedAction(id);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -26,5 +26,6 @@ public class XDebugTabCustomizableActionGroupProvider extends CustomizableAction
public void registerGroups(CustomizableActionGroupRegistrar registrar) {
registrar.addCustomizableActionGroup(XDebuggerActions.TOOL_WINDOW_TOP_TOOLBAR_GROUP, "Debug Tool Window Top Toolbar");
registrar.addCustomizableActionGroup(XDebuggerActions.TOOL_WINDOW_LEFT_TOOLBAR_GROUP, "Debug Tool Window Left Toolbar");
registrar.addCustomizableActionGroup(XDebuggerActions.WATCHES_TREE_TOOLBAR_GROUP, "Debug Watches Toolbar");
}
}
@@ -2527,22 +2527,22 @@
key="replace.diamond.with.explicit.type.arguments.name" groupBundle="messages.InspectionsBundle"
groupKey="group.names.code.style.issues" enabledByDefault="true" level="INFORMATION"
implementationClass="com.siyeh.ig.style.ReplaceDiamondWithExplicitTypeArgumentsInspection"/>
<localInspection groupPath="Java" language="JAVA" shortName="ReplaceLambdaWithAnonymous" bundle="com.siyeh.InspectionGadgetsBundle"
key="replace.lambda.with.anonymous.name" groupBundle="messages.InspectionsBundle"
<localInspection groupPath="Java" language="JAVA" shortName="LambdaCanBeReplacedWithAnonymous" bundle="com.siyeh.InspectionGadgetsBundle"
key="lambda.can.be.replaced.with.anonymous.name" groupBundle="messages.InspectionsBundle"
groupKey="group.names.code.style.issues" enabledByDefault="true" level="INFORMATION"
implementationClass="com.siyeh.ig.style.ReplaceLambdaWithAnonymousInspection"/>
implementationClass="com.siyeh.ig.style.LambdaCanBeReplacedWithAnonymousInspection"/>
<localInspection groupPath="Java" language="JAVA" shortName="MethodRefCanBeReplacedWithLambda" bundle="com.siyeh.InspectionGadgetsBundle"
key="method.ref.can.be.replaced.with.lambda.name" groupBundle="messages.InspectionsBundle"
groupKey="group.names.code.style.issues" enabledByDefault="true" level="INFORMATION"
implementationClass="com.siyeh.ig.style.MethodRefCanBeReplacedWithLambdaInspection"/>
<localInspection groupPath="Java" language="JAVA" shortName="SplitTryWithMultipleResources" bundle="com.siyeh.InspectionGadgetsBundle"
key="split.try.with.multiple.resources.name" groupBundle="messages.InspectionsBundle"
<localInspection groupPath="Java" language="JAVA" shortName="TryStatementWithMultipleResources" bundle="com.siyeh.InspectionGadgetsBundle"
key="try.statement.with.multiple.resources.name" groupBundle="messages.InspectionsBundle"
groupKey="group.names.code.style.issues" enabledByDefault="true" level="INFORMATION"
implementationClass="com.siyeh.ig.exceptions.SplitTryWithMultipleResourcesInspection"/>
<localInspection groupPath="Java" language="JAVA" shortName="SplitMultiCatch" bundle="com.siyeh.InspectionGadgetsBundle"
key="split.multi.catch.name" groupBundle="messages.InspectionsBundle"
implementationClass="com.siyeh.ig.exceptions.TryStatementWithMultipleResourcesInspection"/>
<localInspection groupPath="Java" language="JAVA" shortName="MultiCatchCanBeSplit" bundle="com.siyeh.InspectionGadgetsBundle"
key="multi.catch.can.be.split.name" groupBundle="messages.InspectionsBundle"
groupKey="group.names.code.style.issues" enabledByDefault="true" level="INFORMATION"
implementationClass="com.siyeh.ig.exceptions.SplitMultiCatchInspection"/>
implementationClass="com.siyeh.ig.exceptions.MultiCatchCanBeSplitInspection"/>
<localInspection groupPath="Java" language="JAVA" shortName="SingleElementAnnotation" bundle="com.siyeh.InspectionGadgetsBundle"
key="single.element.annotation.name" groupBundle="messages.InspectionsBundle"
groupKey="group.names.code.style.issues" enabledByDefault="true" level="INFORMATION"
@@ -2163,14 +2163,14 @@ infer.lambda.parameter.type.name=Infer lambda parameter type
infer.lambda.parameter.type.descriptor=Expand lambda to {0} -> '{'...'}'
replace.diamond.with.explicit.type.arguments.name=Replace diamond with explicit type arguments
replace.diamond.with.explicit.type.arguments.descriptor=Replace '<>' with explicit type arguments
replace.lambda.with.anonymous.name=Replace lambda with anonymous class
replace.lambda.with.anonymous.descriptor=Replace lambda with anonymous class
lambda.can.be.replaced.with.anonymous.name=Lambda can be replaced with anonymous class
lambda.can.be.replaced.with.anonymous.quickfix=Replace lambda with anonymous class
method.ref.can.be.replaced.with.lambda.name=Method reference can be replaced with lambda
method.ref.can.be.replaced.with.lambda.quickfix=Replace method reference with lambda
split.try.with.multiple.resources.name=Split Try Statement with Multiple Resources
split.try.with.multiple.resources.descriptor=Split 'try' statement with multiple resources
split.multi.catch.name=Split Multi-Catch into Separate Catch Blocks
split.multi.catch.descriptor=Split multi-catch into separate 'catch' blocks
try.statement.with.multiple.resources.name=Try statement with multiple resources can be split
try.statement.with.multiple.resources.quickfix=Split 'try' statement with multiple resources
multi.catch.can.be.split.name=Multi-catch can be split into separate catch blocks
multi.catch.can.be.split.quickfix=Split multi-catch into separate 'catch' blocks
assertion.can.be.if.name=Assertion can be replaced with if statement
assert.can.be.if.quickfix=Replace 'assert' with 'if' statement
if.can.be.assertion.name=If statement can be replaced with assertion
@@ -30,19 +30,19 @@ import org.jetbrains.annotations.Nullable;
import static com.intellij.util.ObjectUtils.assertNotNull;
public class SplitMultiCatchInspection extends BaseInspection {
public class MultiCatchCanBeSplitInspection extends BaseInspection {
@Nls
@NotNull
@Override
public String getDisplayName() {
return InspectionGadgetsBundle.message("split.multi.catch.name");
return InspectionGadgetsBundle.message("multi.catch.can.be.split.name");
}
@NotNull
@Override
protected String buildErrorString(Object... infos) {
return InspectionGadgetsBundle.message("split.multi.catch.descriptor");
return getDisplayName();
}
@Override
@@ -123,7 +123,7 @@ public class SplitMultiCatchInspection extends BaseInspection {
@NotNull
@Override
public String getName() {
return InspectionGadgetsBundle.message("split.multi.catch.descriptor");
return InspectionGadgetsBundle.message("multi.catch.can.be.split.quickfix");
}
@Nls
@@ -31,19 +31,19 @@ import org.jetbrains.annotations.Nullable;
/**
* @author Bas Leijdekkers
*/
public class SplitTryWithMultipleResourcesInspection extends BaseInspection {
public class TryStatementWithMultipleResourcesInspection extends BaseInspection {
@Nls
@NotNull
@Override
public String getDisplayName() {
return InspectionGadgetsBundle.message("split.try.with.multiple.resources.name");
return InspectionGadgetsBundle.message("try.statement.with.multiple.resources.name");
}
@NotNull
@Override
protected String buildErrorString(Object... infos) {
return InspectionGadgetsBundle.message("split.try.with.multiple.resources.descriptor");
return getDisplayName();
}
@Override
@@ -136,7 +136,7 @@ public class SplitTryWithMultipleResourcesInspection extends BaseInspection {
@NotNull
@Override
public String getName() {
return InspectionGadgetsBundle.message("split.try.with.multiple.resources.descriptor");
return InspectionGadgetsBundle.message("try.statement.with.multiple.resources.quickfix");
}
@Nls

Some files were not shown because too many files have changed in this diff Show More