summaryrefslogtreecommitdiff
path: root/platform/platform-impl/src/com/intellij
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-08-29 10:40:28 -0700
committerTor Norbye <tnorbye@google.com>2013-08-29 10:40:35 -0700
commit932259520ebaedeb2ccf4b7594bad50c700963d7 (patch)
tree2b52334b8a019d9652625b1432deac11a7c4b31e /platform/platform-impl/src/com/intellij
parente47d04f1f804b9e725b768725da436af6788f19b (diff)
downloadidea-932259520ebaedeb2ccf4b7594bad50c700963d7.tar.gz
Snapshot 1c7917945d4706cdbb32b599f81abd05c0251e32 from idea/132.27 branch of git://git.jetbrains.org/idea/community.git
1c79179: 2013-08-29 Yann Cébron - DevKit: smart EP "implementation" highlighting/completion f3a83bc: 2013-08-29 Roman Shevchenko - IDEA-112827 (NPE in error reporter) 464a45b: 2013-08-29 Anna Kozlova - move pin button to the right side of popup (IDEA-112435) 1635be8: 2013-08-29 Yann Cébron - Dom EPs: add some <with> tags 6bcac42: 2013-08-29 Roman Shevchenko - IDEA-112824 (suppress SVN logging for normal use) 16d0ba4: 2013-08-29 Anna Kozlova - NPE 285509c4c: 2013-08-28 Max Medvedev - IDEA-111110 Groovy: Introduce Field Refactoring doesn't suggest to choose destination class 5415af1: 2013-08-28 Yann Cébron - Merge remote-tracking branch 'origin/master' 8462f3b: 2013-08-28 Dmitry Jemerov - cleanup 2ad6100: 2013-08-28 Yann Cébron - Merge remote-tracking branch 'origin/master' 9de8bfc: 2013-08-28 Dmitry Jemerov - Merge branch 'master' of git://github.com/niktrop/intellij-community into pull92 6315415: 2013-08-28 Dmitry Jemerov - cleanup 7281b73: 2013-08-28 Dmitry Jemerov - Merge branch 'cjfm3' of git://github.com/max-kammerer/intellij-community into pull87 6e31350: 2013-08-28 Dmitry Jemerov - fix couple of issues with https://github.com/JetBrains/intellij-community/pull/94 3695aa0: 2013-08-28 Dmitry Jemerov - Merge branch 'master' of git://github.com/asedunov/intellij-community into pull94 ce2c15f: 2013-08-28 Yann Cébron - fix javadoc @see link 6794ead: 2013-08-28 Anna Kozlova - skip adverts when server doesn't accept provided info 851da00: 2013-08-28 Anna Kozlova - skip advs in tests and headless mode cddbc28: 2013-08-28 Anna Kozlova - EA-48802 - assert: JavaFileManagerBase.findClass 1eafaae: 2013-08-28 Anna Kozlova - EA-49147 - NPE: UnusedDeclarationInspection.isReadObjectMethod f1a2040: 2013-08-28 Anna Kozlova - EA-49155 - NPE: JavaChangeSignatureDialog.doCalculateSignature 2684709: 2013-08-28 Dmitry Jemerov - MalformedFormatStringInspectionTest fixed ce8088e: 2013-08-28 Evgeny Gerashchenko - Removed extra checking for duplicate annotations in one file. It is performed when reading file anyway. 9d4c7ca: 2013-08-28 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' 2fd8641: 2013-08-28 Eugene Kudelevsky - add possibility to setup lookup element for XML attribute values; IDEA-102167 layout_* attributes should go first 3b065b1: 2013-08-28 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' d8d9168: 2013-08-28 Dmitry Trofimov - Libs update. 28a95a6: 2013-08-28 Alexey Kudravtsev - compilation d4a0d69: 2013-08-28 Alexey Kudravtsev - notnull f9f8006: 2013-08-28 Alexey Kudravtsev - moved to appropriate package 4d058f8: 2013-08-28 Alexey Kudravtsev - cleanup 111301a: 2013-08-28 Alexey Kudravtsev - extra method 01e59b0: 2013-08-28 Alexey Kudravtsev - doc da966ae: 2013-08-28 Alexey Kudravtsev - cleanup 7503616: 2013-08-28 Alexey Kudravtsev - add method to javaversionservice 7d6de4f: 2013-08-28 Alexey Kudravtsev - notnull dee081f: 2013-08-27 Alexey Kudravtsev - statistics dd327c0: 2013-08-28 Dmitry Trofimov - Focus fixes. 7231931: 2013-08-28 Vladimir Krivosheev - WEB-8988 Return "open in browser" in context menu 2102255: 2013-08-28 Roman Shevchenko - app: install-over range extended for next EAPs ddad3bb: 2013-08-28 Dmitry Avdeev - IDEA-112728 Can't create new task from tasks menu in toolbar: no need to fix lost typing for Go To Task a8160c2: 2013-08-28 Dmitry Avdeev - typo 7328cbd: 2013-08-28 Dmitry Avdeev - cleanup abbdb5a: 2013-08-28 Dmitry Avdeev - cleanup a5c8503: 2013-08-28 Dmitry Avdeev - do not allow empty task name e8daf37: 2013-08-28 Dmitry Avdeev - simplified dff28d3: 2013-08-28 Dmitry Avdeev - simplified 38513a8: 2013-08-28 Dmitry Avdeev - cleanup c09dd55: 2013-08-28 Vladimir Krivosheev - VariablesGroup — avoid array copy 8f3c91f: 2013-08-28 Roman Shevchenko - java: correct character escaping in decompiler 9a19e30: 2013-08-28 Dmitry Trofimov - Fixed hiding and activating of the terminal (PY-10669). df672ba: 2013-08-28 Dmitry Trofimov - Terminal system settings refactored. 4653b54: 2013-08-28 Anna Kozlova - unknown features equality fixed 2896270: 2013-08-28 Anna Kozlova - ensure read access ccff3af: 2013-08-28 Anna Kozlova - suggest to download plugins by unknown run configurations 9c8a3d2: 2013-08-28 Konstantin Bulenkov - include os.arch and jdk build number in about 861984c: 2013-08-28 Denis Fokin - IDEA-108265. We should not do anything if an empty array is passed. a6b3441: 2013-08-28 Sergey Simonchik - EA-49063 - AIOOBE: ScriptRunnerUtil$ScriptOutput.onTextAvailable 845ee5c: 2013-08-28 Vladimir Krivosheev - value nullability 36121a2: 2013-08-28 Konstantin Kolosovsky - Merge branch 'svn1_8_new' 1515b70: 2013-08-28 Mikhail Golubev - Merge remote-tracking branch 'origin/master' 33d684e0: 2013-08-28 Mikhail Golubev - IDEA-110012 Not all Redmine Issues Available on "Open Task" (Limited to 100?) 39899b1: 2013-08-28 Bas Leijdekkers - IDEA-112782 (Change signature dialog shows unexpected 'cannot resolve symbol' message) e469928: 2013-08-28 Anna Kozlova - accept test config methods in non-test classes (IDEA-112537) b53abed: 2013-08-27 Anna Kozlova - fix typo 3074f49: 2013-08-28 Dmitry Avdeev - IDEA-112781 Open YouTrack task: Create changelist doesn't work with SVN ? 43c8897: 2013-08-27 Dmitry Avdeev - cleanup ff6217a: 2013-08-28 Kirill Likhodedov - Annotate overriding methods 8e2d0e1: 2013-08-28 Roman Shevchenko - terminal: platform's Guava should be good enough for the plugin 2055780: 2013-08-27 Roman Shevchenko - EA-49123 (do not load extensions from static initializer) 116dc30: 2013-08-27 Roman Shevchenko - EA-49235 (check proxy port) 2b4f96f: 2013-08-27 Roman Shevchenko - EA-49235 (code readability) ed03bca: 2013-08-27 Roman Shevchenko - EA-49142 (NPE, cleanup) e6053d0: 2013-08-27 Roman Shevchenko - EA-49102 (face user with printing errors) a748474: 2013-08-28 Vladimir Krivosheev - 4.1.0. update netty (now it is not patched build, https://github.com/netty/netty/pull/1762) 3c60901: 2013-08-28 Konstantin Bulenkov - better selection for mixed languages 20decc3: 2013-08-28 Konstantin Bulenkov - fix selection for files with multiple languages 878ad26: 2013-08-27 Max Medvedev - IDEA-111100 Groovy: Introduce Variable/Parameter Refactorings don't suggest to replace occurrences if applied to expressions inside code blocks 8a60662: 2013-08-27 Max Medvedev - IDEA-110981 Groovy: "Split into declaration and assignment" intention leaves unnecessary "=" if applied to closures 77912c1: 2013-08-27 Max Medvedev - IDEA-111101 Groovy: In-Place Introduce Field: Alt+I mnemonic doesn't work in the refactoring preview 088f68e: 2013-08-27 Max Medvedev - IDEA-111027 Groovy: In-Place Introduce Variable: PIEAE at GrInplaceIntroducer.<init> on introducing a variable within one-line method/closure a2210a4: 2013-08-27 Aleksei Sedunov - Extract inheritor candidate check into separate InheritanceChecker interface f40be5e: 2013-08-27 Alexander Zolotov - Filter moduleAwareConfigurables by module cf7704f: 2013-08-26 Alexander Zolotov - WEB-6452 SASS suggests functions at the top, instead of property values 165ccf7: 2013-08-27 Konstantin Kolosovsky - IDEA-94942 Fixed diff, annotate errors in history view after rename/move 7b6396a: 2013-08-27 Dmitry Jemerov - branch number 132 e176d25: 2013-08-27 Sergey Evdokimov - IDEA-112754 Maven import: NCDFE for org/jetbrains/plugins/groovy/util/ClassInstanceCache 43c49f6: 2013-08-27 Sergey Evdokimov - IDEA-112754 Maven import: NCDFE for org/jetbrains/plugins/groovy/util/ClassInstanceCache 377dd45: 2013-08-27 Konstantin Bulenkov - fix memory leak 203fb69: 2013-08-27 Sergey Simonchik - WEB-9011 Karma plugin ignored tests 3b896f2: 2013-08-27 Sergey Evdokimov - Make project unignored when new module is created by ignored project 9ae29c6: 2013-08-27 Sergey Evdokimov - Remove maven project from project tree when user deletes module. +review CR-IC-2084 0f0f39e: 2013-08-27 Vladimir Krivosheev - cleanup, Overrides 3dddec4: 2013-08-27 Vladimir Krivosheev - cleanup a2fff55: 2013-08-27 Aleksey Pivovarov - Github: Add API function for loading Commit Comments 9bd1660: 2013-08-27 Aleksey Pivovarov - fix IndexOutOfBoundsException on inserting empty collection to empty model 46b8998: 2013-08-27 Nadya Zabrodina - exception during annotate copied file fixed 66640b2: 2013-08-27 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' c597bcc: 2013-08-27 Sergey Evdokimov - Remove maven project from project tree when user deletes module. +review CR-IC-2084 33e932a: 2013-08-27 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' 7cc9cca: 2013-08-27 Vladislav.Soroka - IDEA-79466 gradle support should generate web module configuration 42e649d: 2013-08-27 Dmitry Jemerov - better names for couple of new classes added to API 5c70eaf: 2013-08-27 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' 2e0f1fa: 2013-08-27 Dmitry Trofimov - Update lib. dcc2c4b: 2013-08-27 Dmitry Trofimov - Override isRetina. 05b716b: 2013-08-27 nik - processing dependencies in JPS: @NotNull annotations and javadoc added 6314b6e: 2013-08-27 Dmitry Trofimov - Fixed for Retina. 9d1886c: 2013-08-27 Dmitry Avdeev - navigatable xsd documentation 0f389c5: 2013-08-27 Vladimir Krivosheev - hide internal class XValuePresenterAdapter a0386eb: 2013-08-27 Mikhail Golubev - Merge remote-tracking branch 'origin/master' 53248dc: 2013-08-27 Vladimir Krivosheev - fix createPresenter d0355b3: 2013-08-27 Sergey Evdokimov - Remove maven project from project tree when user deletes module. +review CR-IC @Anton.Makeev fb48f62: 2013-08-27 Sergey Evdokimov - Optimization of MavenProjectsTree.isManagedFile() 6b123aa: 2013-08-27 nik - JPS dependencies enumerator: convenient method added d4579e1: 2013-08-27 Dmitry Avdeev - UrlPsiReference promoted 3b1feea: 2013-08-27 Dmitry Avdeev - cleanup ee18443: 2013-08-27 Dmitry Avdeev - cleanup ca2484e: 2013-08-27 Dmitry Avdeev - cleanup c9e045b: 2013-08-27 Vladimir Krivosheev - 1) methods "void setPresentation(@NonNls String name, @Nullable Icon icon, @NonNls @Nullable String type, @NonNls @NotNull String separator, @NonNls @NotNull String value, boolean hasChildren);" and "void setPresentation(@NonNls String name, @Nullable Icon icon, @NonNls @Nullable String type, @NonNls @NotNull String value, boolean hasChildren);" b38d58a: 2013-08-27 Konstantin Kolosovsky - IDEA-94942 Fixed treating svn client warnings as errors 8cab12c: 2013-08-27 Dmitry Jemerov - separate UI and non-UI parts of MalformedFormatStringInspection 93e3fa6: 2013-08-20 Jason Holmes - Custom "Malformed format string" inspection b9f6fde: 2013-08-27 nik - actions to mark/unmark roots in Project View refactored to support custom root types 0455e46: 2013-08-27 Aleksey Pivovarov - Github: remove useless listener 7f40613: 2013-08-27 Aleksey Pivovarov - Github: reset User on token change c8a5402: 2013-08-27 Aleksey Pivovarov - Github: change layout 89769be: 2013-08-27 Aleksey Pivovarov - Github: add test 0d8ab04: 2013-08-27 Aleksey Pivovarov - Github: comment cba103c: 2013-08-27 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' d6ca049: 2013-08-27 Anna Kozlova - allow autoPopup after custom symbols (IDEA-112571) a70c338: 2013-08-27 Konstantin Bulenkov - IDEA-110846 File Structure pop-up doesn't work properly for template languages 4896775: 2013-08-27 Konstantin Bulenkov - recent files duplicates 05835fa: 2013-08-27 Fedor Korotkov - WEB-6328 Add support for HTML5 <main> element 2407d7b: 2013-08-27 Anna Kozlova - allow to call getValue without readAction as it was before 29cb25d: 2013-08-27 Dmitry Avdeev - fixing the leak 7d3932a: 2013-08-27 Dmitry Avdeev - IDEA-112708 Static classes in JSP class block are considered an error f6dbce2: 2013-08-26 Mikhail Golubev - IDEA-112605 Task management: can't add Generic server: NoClassDefFoundError: XPathFileType 82c1dc1: 2013-08-27 Konstantin Kolosovsky - Merge branch 'svn1_8_new' 08d46f1: 2013-08-27 Alexey Kudravtsev - highlightVisitor moves and cleanup e0fec9d: 2013-08-27 Alexey Kudravtsev - Merge remote-tracking branch 'origin/master' e9b1dfc: 2013-08-27 Anna Kozlova - dumb smart lambda completion (IDEA-112553) 6da30a4: 2013-08-26 Alexey Kudravtsev - calculate column/offset: optimisation of the no-tabs case c0990c4: 2013-08-26 Alexey Kudravtsev - race conditions? 135e250: 2013-08-26 Alexey Kudravtsev - notnull, cleanup 75b28ba: 2013-08-26 Alexey Kudravtsev - file was not rehighlighted on some changes 5647d35: 2013-08-26 Sergey Evdokimov - Make myManagedFilesPaths a Set to avoid duplication. 680dd76: 2013-08-27 Aleksey Pivovarov - Github: fix memory leak on Exception in setUp(); e3092b7: 2013-08-27 Dmitry Avdeev - IDEA-112611 Task management: DVCS: closing a task fails: "Cannot delete the branch master" d12d4fe: 2013-08-27 Anna Kozlova - logging for EA-49099 - PIEAE: PsiAnchor$StubIndexReference.getStartOffset 3cc53fe: 2013-08-27 Anna Kozlova - revert changes in api 10fbef9: 2013-08-27 Roman Shevchenko - Test data updated a5455ba: 2013-08-27 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' 8ed3ae8: 2013-08-27 Dmitry Trofimov - Updated lib. e6df583: 2013-08-27 Dmitry Trofimov - Added guava lib to terminal. 1853090: 2013-08-27 Dmitry Trofimov - Draw image Retina support. a7ebcaf: 2013-08-27 Dmitry Trofimov - Open session action moved to constructor. 5176bfa: 2013-08-26 Sergey Evdokimov - Fix maven tests 291f740: 2013-08-26 Vladimir Krivosheev - we must check if any port free too 18d4be6: 2013-08-26 Vassiliy Kudryashov - IDEA-70769 Settings panel: increase speed of scrollbars 0c76aca: 2013-08-26 Vassiliy Kudryashov - IDEA-112524 Working directory for default rake tasks is changed to $MODULE_DIR$ after project's reopening e2b7f6b: 2013-08-26 Konstantin Bulenkov - pattern dependent delay 1916142: 2013-08-26 Vladimir Krivosheev - cleanup 3da9dcd: 2013-08-26 Vladimir Krivosheev - done: custom binary request handler e02eba9: 2013-08-26 Aleksey Pivovarov - Github: do not produce dozens of notifications 8e41d59: 2013-08-26 Aleksey Pivovarov - Simplify 78c800d: 2013-08-26 Aleksey Pivovarov - Github: respect 'max' parameter 3afb19f: 2013-08-26 Maxim.Mossienko - proper versioning of stub index when persistent enumerator version changes c853e9e: 2013-08-26 Eugene Kudelevsky - IDEA-112376 add "importFilter" extension point to force using FQN when importing class 31281a9: 2013-08-26 Kirill Likhodedov - [git] Don't write empty lines to LOG.debug. 493b9fb: 2013-08-26 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' 60384ba: 2013-08-26 Dmitry Trofimov - Enable Run local terminal action for Windows. bfa8e61: 2013-08-26 Dmitry Jemerov - stupid typo fixed 04a76c3: 2013-08-26 Anna Kozlova - IDEA-112555 Bad code is green with method references on instance 8f5139d: 2013-08-26 Denis Fokin - IDEA-108265. Now user is asked whether the project should be opened in a new frame. da958ab: 2013-08-26 Natalia Ukhorskaya - Decompile chars, bytes and shorts correctly 8008709: 2013-08-26 Roman Shevchenko - java: incorrect annotation decoding fixed 9f07ea5: 2013-08-26 Roman Shevchenko - logging e07c905: 2013-08-26 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' e81832d: 2013-08-26 Dmitry Trofimov - This update fixes pty on windows. e36607b: 2013-08-26 Konstantin Bulenkov - new renderer 9ea47a5: 2013-08-26 nik - source roots editors: obtain icons for content tree from extension d52dfb8: 2013-08-26 nik - constants moved 710d3ba: 2013-08-26 niktrop - Code style fixed aa8832d: 2013-08-26 Sergey Simonchik - code style: two subsequent ifs merged to reduce inner indent ed88487: 2013-08-26 Konstantin Kolosovsky - IDEA-94942 Provide detailed error messages to user instead of general ones e0df7a3: 2013-08-26 Vassiliy Kudryashov - IDEA-112524 Working directory for default rake tasks is changed to $MODULE_DIR$ after project's reopening e60a55b: 2013-08-26 nik - source roots editors refactored: root type specific UI moved to extension 928ea20: 2013-08-26 Mikhail Golubev - Merge remote-tracking branch 'origin/master' 70d526d: 2013-08-26 Anna Kozlova - guardedBy itself support (IDEA-112565) 2e23cb8: 2013-08-26 Anna Kozlova - restore bytecode viewer for java classes 89dffc9: 2013-08-26 Anna Kozlova - cal property name: accept without any other checks non-letter prefixes (IDEA-112585) bab044f: 2013-08-26 Vladimir Krivosheev - restore Alarm.cancelRequest dd817dc: 2013-08-26 Sergey Simonchik - simplification 7046dc4: 2013-08-26 niktrop - Some refactoring for reusing GenerateEquals UI in scala plugin 44e4219: 2013-08-26 Sergey Evdokimov - IDEA-112529 Maven: code completion could work in file path value with property references 867be29: 2013-08-26 Denis Fokin - Jumplist libraries changes. This is a release version of dll with eliminated MSVCRT dependencies. 7b0029d: 2013-08-26 Anton Makeev - CIDR: language tests in windows +review CR-OC @micha 9bef3a2: 2013-08-26 Konstantin Kolosovsky - IDEA-94942 Updated cleanup behavior after previous command failed 8447776: 2013-08-26 Mikhail Golubev - Remove SelectorBasedResponseHandler#getSelectorFileType, delegate to #getResponseType instead. Add missing @NotNull annotation, update doc comments. d7ecb44: 2013-08-26 Anna Kozlova - treat classes with before/after methods as test classes for bad declared exceptions (IDEA-112537) 4be2bcf: 2013-08-26 Anna Kozlova - restore suggestion to remove 'abstract' when method has body c57c308: 2013-08-26 Anna Kozlova - local can be final inside lambda body (IDEA-112630) b8170a6: 2013-08-26 Vladimir Krivosheev - isValuesCustomSorted, add or not SortValuesAction (alphabetically sort) TODO: this action should be moved to "Variables" as gear action b56b744: 2013-08-26 Mikhail Golubev - Merge remote-tracking branch 'origin/master' ba7e194: 2013-08-23 Mikhail Golubev - Migrate Assembla to new GenericRepository dd0885d: 2013-08-23 Mikhail Golubev - Refactor TemplateVariable aa94a3c: 2013-08-23 Mikhail Golubev - Add several tests of date parsing 0e7e61e: 2013-08-23 Mikhail Golubev - Reflective PsiElements creation in JqlParserDefinition a5f3011: 2013-08-26 Konstantin Kolosovsky - IDEA-94942 Short refactoring (removed duplication) 01cd38b: 2013-08-26 Sergey Simonchik - unnecessary line removed 7c34a2a: 2013-08-26 Dmitry Avdeev - IDEA-60895 No completion for enumerated and boolean values of xml tags 8b83a30: 2013-08-26 Vladislav.Soroka - gradle: cosmetic UI fix 8ee6a76: 2013-08-26 Roman Shevchenko - Convenient debug logging cde5373: 2013-08-26 Dmitry Avdeev - IDEA-60895 No completion for enumerated and boolean values of xml tags 75d9b47: 2013-08-24 Max Medvedev - IDEA-112621 Groovy: Remove explicit type declaration intention d1c29fb: 2013-08-23 Max Medvedev - separate visit methods for all types of classes, enums, interfaces, annotation types, and anonymous classes 5eca3d0: 2013-08-23 Max Medvedev - Byte code viewer shows byte code for groovy scripts c96d27f: 2013-08-23 Max Medvedev - Convert anonymous class to closure: don't insert 'as Runnable' if groovy version is at least 2.2 7e993a0: 2013-08-23 Max Medvedev - IDEA-112560 process only applicable mixins to a ref c33dc4a: 2013-08-26 Roman Shevchenko - platform: unified loading of system libraries (done right) d492a6f: 2013-08-25 Roman Shevchenko - logging 2f2b546: 2013-08-25 Roman Shevchenko - IDEA-112462 (allow plugins to extend lib search path) 2a39bf2: 2013-08-25 Maxim.Mossienko - restart lexer from 0 offset when searching from start a0858dbf: 2013-08-25 Maxim.Mossienko - 20% more compact compiler caches (-50M for IDEA project) 5ce3373: 2013-08-25 Maxim.Mossienko - IDEA-111918 Find: comments / string literals only: just 1 entry is found in each comment or literal 68ffc65: 2013-08-25 Maxim.Mossienko - faster contol + shift + N / control + N by default eb67af1: 2013-08-24 Vassiliy Kudryashov - IDEA-107413 Cannot drag'n'drop more than one item in Changes View d5ed7b5: 2013-08-24 nik - store properties of source folder in JPS element b3dd357: 2013-08-24 nik - typo 5b8b1ff: 2013-08-24 Kirill Likhodedov - Merge remote-tracking branch 'origin/master' 0dd284a: 2013-08-24 Kirill Likhodedov - Better assertion error in the DefaultLogger 3146c0b: 2013-08-23 Bas Leijdekkers - foreach can also initialize field 6356a11: 2013-08-23 Konstantin Bulenkov - completely refacrored 6ad3452: 2013-08-23 Anna Kozlova - show conflict on invert boolean and method references (IDEA-112572) 4726276: 2013-08-23 Anna Kozlova - extract method from lambda body: accept parameters of parent method (IDEA-112570) 16a5e32: 2013-08-23 Gregory.Shrago - EditorEx: permanent header API edc3497: 2013-08-23 Konstantin Kolosovsky - IDEA-94942 Content retrieval from svn refactored to ClientFactory model 0f40312: 2013-08-23 Mikhail Golubev - Change JqlQuery methods, JqlTerminalClause should extend JqlClause c335f2b: 2013-08-23 Mikhail Golubev - IDEA-111811 Task management: JIRA: JQL: code completion suggests nothing after closing parenthesis 6e6972a: 2013-08-23 Konstantin Kolosovsky - IDEA-94942 Annotate action e9d5412: 2013-08-23 Mikhail Golubev - Update description of NATIVE_SEARCH feature in TaskRepository 3c948a8: 2013-08-22 Konstantin Kolosovsky - IDEA-94942 Code cleanup - unused parameters removed 64706df: 2013-08-22 Konstantin Kolosovsky - IDEA-112184 0e41cad: 2013-08-22 Konstantin Kolosovsky - IDEA-94942 Simple property client to fix SvnMergeProvider.isBinary implementation 8091bb0: 2013-08-22 Konstantin Kolosovsky - IDEA-94942 Implemented file conflicts resolving Updated "svn info" result parsing 040f405: 2013-08-21 Konstantin Kolosovsky - IDEA-94942 SvnBindClient - unsupported methods removed cef0440: 2013-08-21 Konstantin Kolosovsky - IDEA-94942 "bindSvn" module classes moved to "svn4idea" SvnBindClient unsupported methods will be removed in next commit (to track change like "rename" instead of "delete" + "add" to preserve history) 6c36a93: 2013-08-20 Konstantin Kolosovsky - IDEA-112184 Added logging to detect authentication issues 928c01e: 2013-08-07 Konstantin Kolosovsky - IDEA-94942 - Basic svn 1.8 test support d880599: 2013-08-20 Konstantin Kolosovsky - IDEA-94942 Small text fixes Ignoring tests for old/not used functionality 71384c1: 2013-08-19 Konstantin Kolosovsky - IDEA-94942 Copy and move actions a5f7e7c: 2013-08-19 Konstantin Kolosovsky - IDEA-94942 Delete action e197c08: 2013-08-19 Konstantin Kolosovsky - IDEA-94942 Fixed authentication for svn protocol c28c127: 2013-08-19 Konstantin Kolosovsky - IDEA-94942 Short add, revert commands refactoring e06a346: 2013-08-19 Konstantin Kolosovsky - IDEA-94942 Revert action Fixed status command for single file Fixed status result parsing for normal (non-modified versioned) file 0f66f9d: 2013-08-19 Konstantin Kolosovsky - IDEA-94942 Logging and comments for some commands c928fe5: 2013-08-16 Konstantin Kolosovsky - IDEA-94942 Force command line client usage if working copy of svn 1.8 format detected d6e4e38: 2013-08-16 Konstantin Kolosovsky - IDEA-94942 Fixed "add" action output parsing for binary files 1236be5: 2013-08-15 Konstantin Kolosovsky - IDEA-94942 Small refactoring and fixes after review e05b576: 2013-08-15 Konstantin Kolosovsky - IDEA-94942 "Add" action for files and directories ccf6085: 2013-08-15 Konstantin Kolosovsky - IDEA-94942 "Subversion" -> "Show History" for files and folders aba7390: 2013-08-14 Konstantin Kolosovsky - IDEA-94942 Add command refactored 555d597: 2013-08-14 Konstantin Kolosovsky - IDEA-94942 Fixing status, info commands to use correct arguments b083f31: 2013-08-14 Konstantin Kolosovsky - IDEA-94942 Diff provider (without revision properties) Small command refactoring f657dc8: 2013-08-13 Konstantin Kolosovsky - IDEA-94942 Authentication updates Authentication for remote status command Result parsing for remote info command 2 way SSL support (could be issues with ordinary password entering after 2 way SSL) 2785122: 2013-07-29 Konstantin Kolosovsky - IDEA-94942 initial svn 1.8 support with already existing command line functionality 857bfd5: 2013-08-12 max-kammerer - Update CoreJavaFileManagerTest.java 13539bc: 2013-08-09 Mikhael Bogdanov - CoreJavaFileManager.findClass: properly resolve $ in inner class names Change-Id: Ica3d3d647183983bcd88ce2fb3450deb86343cdb
Diffstat (limited to 'platform/platform-impl/src/com/intellij')
-rw-r--r--platform/platform-impl/src/com/intellij/execution/process/ScriptRunnerUtil.java50
-rw-r--r--platform/platform-impl/src/com/intellij/ide/actions/AboutDialog.java6
-rw-r--r--platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java42
-rw-r--r--platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerMain.java42
-rw-r--r--platform/platform-impl/src/com/intellij/idea/StartupUtil.java5
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/editor/ex/EditorEx.java4
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/editor/ex/RangeHighlighterEx.java5
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java125
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java37
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java9
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java1
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java14
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/PluginsAdvertiser.java161
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/PluginsAdvertiserDialog.java95
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/UnknownFeature.java57
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/UnknownFeaturesCollector.java90
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/vfs/impl/jar/JarHandler.java38
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeGlassPaneImpl.java2
-rw-r--r--platform/platform-impl/src/com/intellij/psi/impl/UrlPsiReference.java55
-rw-r--r--platform/platform-impl/src/com/intellij/ui/win/RecentProjectApplication.java39
-rw-r--r--platform/platform-impl/src/com/intellij/ui/win/RecentTasks.java8
-rw-r--r--platform/platform-impl/src/com/intellij/ui/win/SocketControlHelper.java2
-rw-r--r--platform/platform-impl/src/com/intellij/util/SingletonInstancesCache.java35
23 files changed, 747 insertions, 175 deletions
diff --git a/platform/platform-impl/src/com/intellij/execution/process/ScriptRunnerUtil.java b/platform/platform-impl/src/com/intellij/execution/process/ScriptRunnerUtil.java
index 0b84ea50b956..a58aaa130465 100644
--- a/platform/platform-impl/src/com/intellij/execution/process/ScriptRunnerUtil.java
+++ b/platform/platform-impl/src/com/intellij/execution/process/ScriptRunnerUtil.java
@@ -89,9 +89,7 @@ public final class ScriptRunnerUtil {
if (outputTypeFilter.value(outputType)) {
final String text = event.getText();
outputBuilder.append(text);
- if (LOG.isDebugEnabled()) {
- LOG.debug(text);
- }
+ LOG.debug(text);
}
}
});
@@ -116,34 +114,19 @@ public final class ScriptRunnerUtil {
@Nullable VirtualFile scriptFile,
String[] parameters,
@Nullable Charset charset) throws ExecutionException {
- ExecutionException ex;
- try {
- return doExecute(exePath, workingDirectory, scriptFile, parameters, charset);
- }
- catch (ExecutionException e) {
- ex = e;
- }
- boolean rerun = SystemInfo.isMac;
- if (rerun) {
+ if (SystemInfo.isMac) {
File exeFile = new File(exePath);
- rerun = !exeFile.isAbsolute();
- }
- if (rerun) {
- File originalExeFile = PathEnvironmentVariableUtil.findInOriginalPath(exePath);
- rerun = originalExeFile == null;
- }
- if (rerun) {
- File exeFile = PathEnvironmentVariableUtil.findInPath(exePath);
- if (exeFile != null) {
- try {
- return doExecute(exeFile.getAbsolutePath(), workingDirectory, scriptFile, parameters, charset);
- } catch (ExecutionException e) {
- LOG.info("Standby command failed too", e);
- throw ex;
+ if (!exeFile.isAbsolute() && !exePath.contains(File.separator)) {
+ File originalResolvedExeFile = PathEnvironmentVariableUtil.findInOriginalPath(exePath);
+ if (originalResolvedExeFile == null) {
+ File resolvedExeFile = PathEnvironmentVariableUtil.findInPath(exePath);
+ if (resolvedExeFile != null) {
+ exePath = resolvedExeFile.getAbsolutePath();
+ }
}
}
}
- throw ex;
+ return doExecute(exePath, workingDirectory, scriptFile, parameters, charset);
}
@NotNull
@@ -164,8 +147,8 @@ public final class ScriptRunnerUtil {
commandLine.setWorkDirectory(workingDirectory);
}
- LOG.debug("Command line: " + commandLine.getCommandLineString());
- LOG.debug("Command line env: " + commandLine.getEnvironment());
+ LOG.debug("Command line: ", commandLine.getCommandLineString());
+ LOG.debug("Command line env: ", commandLine.getEnvironment());
if (charset == null) {
charset = ObjectUtils.notNull(EncodingManager.getInstance().getDefaultCharset(), CharsetToolkit.UTF8_CHARSET);
@@ -190,8 +173,7 @@ public final class ScriptRunnerUtil {
@Nullable String workingDirectory,
long timeout,
Condition<Key> scriptOutputType,
- @NonNls String... parameters)
- throws ExecutionException {
+ @NonNls String... parameters) throws ExecutionException {
final OSProcessHandler processHandler = execute(exePathString, workingDirectory, scriptFile, parameters);
ScriptOutput output = new ScriptOutput(scriptOutputType);
@@ -202,19 +184,19 @@ public final class ScriptRunnerUtil {
LOG.warn("Process did not complete in " + timeout / 1000 + "s");
throw new ExecutionException(ExecutionBundle.message("script.execution.timeout", String.valueOf(timeout / 1000)));
}
- LOG.debug("script output: " + output.myFilteredOutput);
+ LOG.debug("script output: ", output.myFilteredOutput);
return output;
}
public static class ScriptOutput extends ProcessAdapter {
private final Condition<Key> myScriptOutputType;
public final StringBuilder myFilteredOutput;
- public final StringBuilder myMergedOutput;
+ public final StringBuffer myMergedOutput;
private ScriptOutput(Condition<Key> scriptOutputType) {
myScriptOutputType = scriptOutputType;
myFilteredOutput = new StringBuilder();
- myMergedOutput = new StringBuilder();
+ myMergedOutput = new StringBuffer();
}
public String getFilteredOutput() {
diff --git a/platform/platform-impl/src/com/intellij/ide/actions/AboutDialog.java b/platform/platform-impl/src/com/intellij/ide/actions/AboutDialog.java
index 9b7e7545486a..86a1e731892f 100644
--- a/platform/platform-impl/src/com/intellij/ide/actions/AboutDialog.java
+++ b/platform/platform-impl/src/com/intellij/ide/actions/AboutDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -193,7 +193,9 @@ public class AboutDialog extends JDialog {
myLines.add(new AboutBoxLine(""));
final Properties properties = System.getProperties();
- myLines.add(new AboutBoxLine(IdeBundle.message("aboutbox.jdk", properties.getProperty("java.version", "unknown")), true, null));
+ final String javaVersion = properties.getProperty("java.runtime.version", properties.getProperty("java.version", "unknown"));
+ final String arch = properties.getProperty("os.arch", "");
+ myLines.add(new AboutBoxLine(IdeBundle.message("aboutbox.jdk", javaVersion, arch), true, null));
appendLast();
myLines.add(new AboutBoxLine(IdeBundle.message("aboutbox.vm", properties.getProperty("java.vm.name", "unknown"),
properties.getProperty("java.vendor", "unknown"))));
diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java b/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java
index 2883afaf0125..b28c8318e241 100644
--- a/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java
+++ b/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,16 +18,9 @@ package com.intellij.ide.plugins;
import com.intellij.CommonBundle;
import com.intellij.icons.AllIcons;
import com.intellij.ide.IdeBundle;
-import com.intellij.notification.Notification;
-import com.intellij.notification.NotificationListener;
-import com.intellij.notification.NotificationType;
-import com.intellij.notification.Notifications;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
-import com.intellij.openapi.application.ApplicationNamesInfo;
-import com.intellij.openapi.application.ex.ApplicationEx;
-import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.extensions.PluginId;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.ui.DialogWrapper;
@@ -35,12 +28,8 @@ import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.Function;
import com.intellij.util.net.IOExceptionDialog;
-import com.intellij.xml.util.XmlStringUtil;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import javax.swing.*;
-import javax.swing.event.HyperlinkEvent;
import java.io.IOException;
import java.util.*;
@@ -162,7 +151,7 @@ public class ActionInstallPlugin extends AnAction implements DumbAware {
}
if (needToRestart) {
- notifyPluginsWereInstalled(list.size() == 1 ? list.get(0).getName() : null);
+ PluginManagerMain.notifyPluginsWereInstalled(list.size() == 1 ? list.get(0).getName() : null);
}
}
}
@@ -268,33 +257,6 @@ public class ActionInstallPlugin extends AnAction implements DumbAware {
}
}
- private static void notifyPluginsWereInstalled(@Nullable String pluginName) {
- final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
- final boolean restartCapable = app.isRestartCapable();
- String message =
- restartCapable ? IdeBundle.message("message.idea.restart.required", ApplicationNamesInfo.getInstance().getFullProductName())
- : IdeBundle.message("message.idea.shutdown.required", ApplicationNamesInfo.getInstance().getFullProductName());
- message += "<br><a href=";
- message += restartCapable ? "\"restart\">Restart now" : "\"shutdown\">Shutdown";
- message += "</a>";
- Notifications.Bus.notify(new Notification("Plugins Lifecycle Group",
- pluginName != null ? "Plugin \'" + pluginName + "\' was successfully installed" : "Plugins were installed",
- XmlStringUtil.wrapInHtml(message), NotificationType.INFORMATION,
- new NotificationListener() {
- @Override
- public void hyperlinkUpdate(@NotNull Notification notification,
- @NotNull HyperlinkEvent event) {
- notification.expire();
- if (restartCapable) {
- app.restart(true);
- }
- else {
- app.exit(true);
- }
- }
- }));
- }
-
public PluginTable getPluginTable() {
return host.getPluginTable();
diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerMain.java b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerMain.java
index 9eb33fb76c29..7b93211c15c4 100644
--- a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerMain.java
+++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerMain.java
@@ -21,10 +21,17 @@ import com.intellij.ide.BrowserUtil;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.ui.search.SearchUtil;
import com.intellij.ide.ui.search.SearchableOptionsRegistrar;
+import com.intellij.notification.Notification;
+import com.intellij.notification.NotificationListener;
+import com.intellij.notification.NotificationType;
+import com.intellij.notification.Notifications;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.ApplicationNamesInfo;
import com.intellij.openapi.application.PathManager;
+import com.intellij.openapi.application.ex.ApplicationEx;
+import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.*;
import com.intellij.openapi.project.DumbAwareAction;
@@ -37,6 +44,7 @@ import com.intellij.ui.*;
import com.intellij.util.concurrency.SwingWorker;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.update.UiNotifyConnector;
+import com.intellij.xml.util.XmlStringUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -294,7 +302,7 @@ public abstract class PluginManagerMain implements Disposable {
public static boolean downloadPlugins(final List<PluginNode> plugins,
final List<IdeaPluginDescriptor> allPlugins,
final Runnable onSuccess,
- final Runnable cleanup) throws IOException {
+ @Nullable final Runnable cleanup) throws IOException {
final boolean[] result = new boolean[1];
try {
ProgressManager.getInstance().run(new Task.Backgroundable(null, IdeBundle.message("progress.download.plugins"), true, PluginManagerUISettings.getInstance()) {
@@ -307,7 +315,7 @@ public abstract class PluginManagerMain implements Disposable {
}
}
finally {
- cleanup.run();
+ if (cleanup != null) cleanup.run();
}
}
});
@@ -514,6 +522,36 @@ public abstract class PluginManagerMain implements Disposable {
return false;
}
+
+ public static void notifyPluginsWereInstalled(@Nullable String pluginName) {
+ final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
+ final boolean restartCapable = app.isRestartCapable();
+ String message =
+ restartCapable ? IdeBundle.message("message.idea.restart.required", ApplicationNamesInfo.getInstance().getFullProductName())
+ : IdeBundle.message("message.idea.shutdown.required", ApplicationNamesInfo.getInstance().getFullProductName());
+ message += "<br><a href=";
+ message += restartCapable ? "\"restart\">Restart now" : "\"shutdown\">Shutdown";
+ message += "</a>";
+ Notifications.Bus.notify(new Notification("Plugins Lifecycle Group",
+ pluginName != null
+ ? "Plugin \'" + pluginName + "\' was successfully installed"
+ : "Plugins were installed",
+ XmlStringUtil.wrapInHtml(message), NotificationType.INFORMATION,
+ new NotificationListener() {
+ @Override
+ public void hyperlinkUpdate(@NotNull Notification notification,
+ @NotNull HyperlinkEvent event) {
+ notification.expire();
+ if (restartCapable) {
+ app.restart(true);
+ }
+ else {
+ app.exit(true);
+ }
+ }
+ }));
+ }
+
protected class SortByStatusAction extends ToggleAction {
protected SortByStatusAction(final String title) {
diff --git a/platform/platform-impl/src/com/intellij/idea/StartupUtil.java b/platform/platform-impl/src/com/intellij/idea/StartupUtil.java
index 2417910a504b..33ef82f86443 100644
--- a/platform/platform-impl/src/com/intellij/idea/StartupUtil.java
+++ b/platform/platform-impl/src/com/intellij/idea/StartupUtil.java
@@ -30,6 +30,7 @@ import com.intellij.ui.AppUIUtil;
import com.intellij.util.Consumer;
import com.intellij.util.EnvironmentUtil;
import com.intellij.util.SnappyInitializer;
+import com.intellij.util.lang.UrlClassLoader;
import com.intellij.util.text.DateFormatUtilRt;
import com.sun.jna.Native;
import org.jetbrains.annotations.NonNls;
@@ -246,7 +247,7 @@ public class StartupUtil {
if (SystemInfo.isWin2kOrNewer && !Main.isHeadless()) {
try {
- System.loadLibrary("focusKiller");
+ UrlClassLoader.loadPlatformLibrary("focusKiller");
log.info("Using \"FocusKiller\" library to prevent focus stealing.");
}
catch (Throwable t) {
@@ -273,7 +274,7 @@ public class StartupUtil {
ApplicationNamesInfo namesInfo = ApplicationNamesInfo.getInstance();
log.info("IDE: " + namesInfo.getFullProductName() + " (build #" + appInfo.getBuild() + ", " +
DateFormatUtilRt.formatBuildDate(appInfo.getBuildDate()) + ")");
- log.info("OS: " + SystemInfoRt.OS_NAME + " (" + SystemInfoRt.OS_VERSION + ")");
+ log.info("OS: " + SystemInfoRt.OS_NAME + " (" + SystemInfoRt.OS_VERSION + ", " + SystemInfo.OS_ARCH + ")");
log.info("JRE: " + System.getProperty("java.runtime.version", "-") + " (" + System.getProperty("java.vendor", "-") + ")");
log.info("JVM: " + System.getProperty("java.vm.version", "-") + " (" + System.getProperty("java.vm.name", "-") + ")");
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/ex/EditorEx.java b/platform/platform-impl/src/com/intellij/openapi/editor/ex/EditorEx.java
index 87c4b7fe2875..81f7870073ae 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/ex/EditorEx.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/ex/EditorEx.java
@@ -57,6 +57,10 @@ public interface EditorEx extends Editor {
EditorHighlighter getHighlighter();
+ JComponent getPermanentHeaderComponent();
+
+ void setPermanentHeaderComponent(JComponent component);
+
void setHighlighter(@NotNull EditorHighlighter highlighter);
void setColorsScheme(@NotNull EditorColorsScheme scheme);
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/ex/RangeHighlighterEx.java b/platform/platform-impl/src/com/intellij/openapi/editor/ex/RangeHighlighterEx.java
index 767b5f9aa82e..abf776ae6b9b 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/ex/RangeHighlighterEx.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/ex/RangeHighlighterEx.java
@@ -19,13 +19,14 @@
* User: max
* Date: Jun 10, 2002
* Time: 5:54:59 PM
- * To change template for new interface use
+ * To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package com.intellij.openapi.editor.ex;
import com.intellij.openapi.editor.markup.RangeHighlighter;
import com.intellij.openapi.editor.markup.TextAttributes;
+import org.jetbrains.annotations.NotNull;
public interface RangeHighlighterEx extends RangeHighlighter, RangeMarkerEx {
boolean isAfterEndOfLine();
@@ -37,5 +38,5 @@ public interface RangeHighlighterEx extends RangeHighlighter, RangeMarkerEx {
@Override
long getId();
- void setTextAttributes(TextAttributes textAttributes);
+ void setTextAttributes(@NotNull TextAttributes textAttributes);
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java b/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java
index c4bb90b90a8a..4c09c612e038 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java
@@ -41,9 +41,9 @@ import java.util.Arrays;
import java.util.List;
public class EditorUtil {
-
+
private static final Logger LOG = Logger.getInstance("#" + EditorUtil.class.getName());
-
+
private EditorUtil() { }
public static int getLastVisualLineColumnNumber(@NotNull Editor editor, final int line) {
@@ -136,14 +136,14 @@ public class EditorUtil {
result += calcColumnNumber(editor, softWrap.getText(), softWrapStartOffset, softWrapEndOffset);
return result;
}
-
+
CharSequence editorInfo;
if (editor instanceof EditorImpl) {
editorInfo = ((EditorImpl)editor).dumpState();
}
else {
editorInfo = "editor's class: " + editor.getClass()
- + ", all soft wraps: " + editor.getSoftWrapModel().getSoftWrapsForRange(0, document.getTextLength())
+ + ", all soft wraps: " + editor.getSoftWrapModel().getSoftWrapsForRange(0, document.getTextLength())
+ ", fold regions: " + Arrays.toString(editor.getFoldingModel().getAllFoldRegions());
}
LogMessageEx.error(LOG, "Can't calculate last visual column", String.format(
@@ -151,7 +151,7 @@ public class EditorUtil {
+ "the target logical line: %s. Editor info: %s",
line, resultLogLine, resVisStart, resVisEnd, softWraps, editorInfo
));
-
+
return resVisEnd.column;
}
@@ -294,36 +294,43 @@ public class EditorUtil {
"Starting calcSoftWrapUnawareOffset(). Target range: [%d; %d), target column number to map: %d, tab size: %d, "
+ "x: %d, current column: %d%n", start, end, columnNumber, tabSize, x, currentColumn[0]));
}
-
+
// The main problem in a calculation is that target text may contain tabulation symbols and every such symbol may take different
// number of logical columns to represent. E.g. it takes two columns if tab size is four and current column is two; three columns
// if tab size is four and current column is one etc. So, first of all we check if there are tabulation symbols at the target
// text fragment.
boolean useOptimization = true;
- boolean hasNonTabs = false;
- boolean hasTabs = false;
- int scanEndOffset = Math.min(end, start + columnNumber - currentColumn[0] + 1);
- for (int i = start; i < scanEndOffset; i++) {
- char c = text.charAt(i);
- if (debugBuffer != null) {
- debugBuffer.append(String.format("Found symbol '%c' at the offset %d%n", c, i));
- }
- if (c == '\t') {
- hasTabs = true;
- if (hasNonTabs) {
- useOptimization = false;
- break;
+ boolean hasTabs;
+ if ((editor instanceof EditorImpl) && !((EditorImpl)editor).hasTabs()) {
+ hasTabs = false;
+ useOptimization = true;
+ }
+ else {
+ boolean hasNonTabs = false;
+ hasTabs = false;
+ int scanEndOffset = Math.min(end, start + columnNumber - currentColumn[0] + 1);
+ for (int i = start; i < scanEndOffset; i++) {
+ char c = text.charAt(i);
+ if (debugBuffer != null) {
+ debugBuffer.append(String.format("Found symbol '%c' at the offset %d%n", c, i));
+ }
+ if (c == '\t') {
+ hasTabs = true;
+ if (hasNonTabs) {
+ useOptimization = false;
+ break;
+ }
+ }
+ else {
+ hasNonTabs = true;
}
- }
- else {
- hasNonTabs = true;
}
}
if (debugBuffer != null) {
debugBuffer.append(String.format("Has tabs: %b, use optimisation: %b%n", hasTabs, useOptimization));
}
-
+
// Perform optimized processing if possible. 'Optimized' here means the processing when we exactly know how many logical
// columns are occupied by tabulation symbols.
if (useOptimization) {
@@ -454,16 +461,23 @@ public class EditorUtil {
SoftWrap softWrap = editor.getSoftWrapModel().getSoftWrap(start);
useOptimization = softWrap == null;
}
+ boolean hasTabs = true;
if (useOptimization) {
- boolean hasNonTabs = false;
- for (int i = start; i < offset; i++) {
- if (text.charAt(i) == '\t') {
- if (hasNonTabs) {
- useOptimization = false;
- break;
+ if ((editor instanceof EditorImpl) && !((EditorImpl)editor).hasTabs()) {
+ hasTabs = false;
+ }
+ else {
+ boolean hasNonTabs = false;
+ for (int i = start; i < offset; i++) {
+ if (text.charAt(i) == '\t') {
+ if (hasNonTabs) {
+ useOptimization = false;
+ break;
+ }
+ }
+ else {
+ hasNonTabs = true;
}
- } else {
- hasNonTabs = true;
}
}
}
@@ -471,27 +485,26 @@ public class EditorUtil {
if (editor == null || useOptimization) {
int shift = 0;
- for (int i = start; i < offset; i++) {
- char c = text.charAt(i);
- if (c == '\n' || c == '\r') {
- String editorInfo = editor instanceof EditorImpl ? ". Editor info: " + ((EditorImpl)editor).dumpState() : "";
- String documentInfo;
- if (text instanceof Dumpable) {
- documentInfo = ((Dumpable)text).dumpState();
- }
- else {
- documentInfo = "Text holder class: " + text.getClass();
- }
- LogMessageEx.error(
- LOG, "detected incorrect offset -> column number calculation",
- String.format(
- "Symbol: '%c', its index: %d, given start: %d, given offset: %d, given tab size: %d. %s%s",
- c, i, start, offset, tabSize, documentInfo, editorInfo
- )
- );
+ Document document = editor == null ? null : editor.getDocument();
+ if (document != null && start < offset-1 && document.getLineNumber(start) != document.getLineNumber(offset-1)) {
+ String editorInfo = editor instanceof EditorImpl ? ". Editor info: " + ((EditorImpl)editor).dumpState() : "";
+ String documentInfo;
+ if (text instanceof Dumpable) {
+ documentInfo = ((Dumpable)text).dumpState();
}
- if (c == '\t') {
- shift += getTabLength(i + shift - start, tabSize) - 1;
+ else {
+ documentInfo = "Text holder class: " + text.getClass();
+ }
+ LogMessageEx.error(
+ LOG, "detected incorrect offset -> column number calculation",
+ "start: " + start + ", given offset: " + offset+", given tab size: " + tabSize + ". "+documentInfo+ editorInfo);
+ }
+ if (hasTabs) {
+ for (int i = start; i < offset; i++) {
+ char c = text.charAt(i);
+ if (c == '\t') {
+ shift += getTabLength(i + shift - start, tabSize) - 1;
+ }
}
}
return offset - start + shift;
@@ -580,7 +593,7 @@ public class EditorUtil {
char c = text.charAt(i);
int prevX = x;
switch (c) {
- case '\t':
+ case '\t':
x = nextTabStop(x, editor);
result += columnsNumber(x - prevX, spaceSize);
break;
@@ -666,10 +679,10 @@ public class EditorUtil {
/**
* Delegates to the {@link #calcSurroundingRange(Editor, VisualPosition, VisualPosition)} with the
* {@link CaretModel#getVisualPosition() caret visual position} as an argument.
- *
+ *
* @param editor target editor
* @return surrounding logical positions
- * @see #calcSurroundingRange(Editor, VisualPosition, VisualPosition)
+ * @see #calcSurroundingRange(Editor, VisualPosition, VisualPosition)
*/
public static Pair<LogicalPosition, LogicalPosition> calcCaretLineRange(@NotNull Editor editor) {
return calcSurroundingRange(editor, editor.getCaretModel().getVisualPosition(), editor.getCaretModel().getVisualPosition());
@@ -719,7 +732,7 @@ public class EditorUtil {
}
line = foldEndLine;
}
-
+
LogicalPosition second = editor.visualToLogicalPosition(new VisualPosition(end.line, 0));
for (
@@ -739,7 +752,7 @@ public class EditorUtil {
}
line = foldEndLine;
}
-
+
if (second.line >= document.getLineCount()) {
second = editor.offsetToLogicalPosition(document.getTextLength());
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
index 840fbde65485..fcef9aa8dff7 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
@@ -152,6 +152,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
@NotNull private final EditorComponentImpl myEditorComponent;
@NotNull private final EditorGutterComponentImpl myGutterComponent;
private final TraceableDisposable myTraceableDisposable = new TraceableDisposable(new Throwable());
+ private volatile boolean hasTabs; // optimisation flag: when editor contains no tabs it is dramatically easier to calculate positions
static {
ComplementaryFontsRegistry.getFontAbleToDisplay(' ', 0, 0, UIManager.getFont("Label.font").getFamily()); // load costly font info
@@ -518,6 +519,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
}
});
}
+ updateHasTabsFlag(document.getCharsSequence());
}
public static boolean isPresentationMode(Project project) {
@@ -1693,6 +1695,16 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
Point caretLocation = visualPositionToXY(getCaretModel().getVisualPosition());
int scrollOffset = caretLocation.y - myCaretUpdateVShift;
getScrollingModel().scrollVertically(scrollOffset);
+ updateHasTabsFlag(e.getNewFragment());
+ }
+
+ private void updateHasTabsFlag(CharSequence newChars) {
+ if (!hasTabs) {
+ hasTabs = StringUtil.contains(newChars, 0, newChars.length(), '\t');
+ }
+ }
+ public boolean hasTabs() {
+ return hasTabs;
}
public boolean isScrollToCaret() {
@@ -1930,7 +1942,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
@Override
public void setHeaderComponent(JComponent header) {
myHeaderPanel.removeAll();
- header = header == null ? getUserData(PERMANENT_HEADER) : header;
+ header = header == null ? getPermanentHeaderComponent() : header;
if (header != null) {
myHeaderPanel.add(header);
}
@@ -1940,13 +1952,23 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
@Override
public boolean hasHeaderComponent() {
- return myHeaderPanel.getComponentCount() > 0;
+ JComponent header = getHeaderComponent();
+ return header != null && header != getPermanentHeaderComponent();
+ }
+
+ @Nullable
+ public JComponent getPermanentHeaderComponent() {
+ return getUserData(PERMANENT_HEADER);
+ }
+
+ public void setPermanentHeaderComponent(@Nullable JComponent component) {
+ putUserData(PERMANENT_HEADER, component);
}
@Override
@Nullable
public JComponent getHeaderComponent() {
- if (hasHeaderComponent()) {
+ if (myHeaderPanel.getComponentCount() > 0) {
return (JComponent)myHeaderPanel.getComponent(0);
}
return null;
@@ -2464,7 +2486,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
// there then.
VisualPosition selectionStartPosition = getSelectionModel().getSelectionStartPosition();
VisualPosition selectionEndPosition = getSelectionModel().getSelectionEndPosition();
- if (selectionStartPosition == null || selectionEndPosition == null || selectionStartPosition.equals(selectionEndPosition)) {
+ if (selectionStartPosition.equals(selectionEndPosition)) {
return;
}
@@ -2525,7 +2547,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
// there then.
VisualPosition selectionStartPosition = getSelectionModel().getSelectionStartPosition();
VisualPosition selectionEndPosition = getSelectionModel().getSelectionEndPosition();
- if (selectionStartPosition == null || selectionEndPosition == null || selectionStartPosition.equals(selectionEndPosition)) {
+ if (selectionStartPosition.equals(selectionEndPosition)) {
return;
}
@@ -3968,8 +3990,9 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
int x = myGutterComponent.convertX(e.getX());
- if (x >= myGutterComponent.getLineNumberAreaOffset() &&
- x < myGutterComponent.getLineNumberAreaOffset() + myGutterComponent.getLineNumberAreaWidth()) {
+ int lineNumberAreaOffset = EditorGutterComponentImpl.getLineNumberAreaOffset();
+ if (x >= lineNumberAreaOffset &&
+ x < lineNumberAreaOffset + myGutterComponent.getLineNumberAreaWidth()) {
return EditorMouseEventArea.LINE_NUMBERS_AREA;
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java
index 051fdbfb0790..25803d922ee2 100644
--- a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java
@@ -359,7 +359,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements NamedJDOME
// currently there are 6 of them and restoration does not happen very often so just iteration is enough
if (type == PlainTextFileType.INSTANCE && !fileTypeName.equals(type.getName())) {
for (FileType fileType: getRegisteredFileTypes()) {
- if (fileType.equals(fileType.getName())) {
+ if (fileTypeName.equals(fileType.getName())) {
return fileType;
}
}
@@ -367,10 +367,6 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements NamedJDOME
return type;
}
- private static class FileTypeDetectorHolder {
- private static final FileTypeDetector[] FILE_TYPE_DETECTORS = Extensions.getExtensions(FileTypeDetector.EP_NAME);
- }
-
private static final AtomicInteger DETECTED_COUNT = new AtomicInteger();
private static final int DETECT_BUFFER_SIZE = 8192;
@@ -403,8 +399,9 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements NamedJDOME
else {
text = null;
}
+
FileType detected = null;
- for (FileTypeDetector detector : FileTypeDetectorHolder.FILE_TYPE_DETECTORS) {
+ for (FileTypeDetector detector : Extensions.getExtensions(FileTypeDetector.EP_NAME)) {
detected = detector.detect(file, byteSequence, text);
if (detected != null) break;
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java
index cc6a59bec70d..6cca11c2f737 100644
--- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java
+++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java
@@ -698,6 +698,7 @@ public class OptionsEditor extends JPanel implements DataProvider, Place.Navigat
JScrollPane scroll = ScrollPaneFactory.createScrollPane(c);
scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
+ scroll.getVerticalScrollBar().setUnitIncrement(10);
scroll.setBorder(null);
add(scroll, BorderLayout.CENTER);
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java
index 6e7b914d4cbd..b7be05b24e5c 100644
--- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java
+++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ public class DetectedPluginsPanel extends OrderPanel<PluginDownloader> {
private static JEditorPane myDescriptionPanel = new JEditorPane();
- protected DetectedPluginsPanel() {
+ public DetectedPluginsPanel() {
super(PluginDownloader.class);
final JTable entryTable = getEntryTable();
entryTable.setTableHeader(null);
@@ -111,20 +111,24 @@ public class DetectedPluginsPanel extends OrderPanel<PluginDownloader> {
}
public boolean isChecked(final PluginDownloader downloader) {
- return !UpdateChecker.getDisabledToUpdatePlugins().contains(downloader.getPluginId());
+ return !getSkippedPlugins().contains(downloader.getPluginId());
}
public void setChecked(final PluginDownloader downloader, final boolean checked) {
if (checked) {
- UpdateChecker.getDisabledToUpdatePlugins().remove(downloader.getPluginId());
+ getSkippedPlugins().remove(downloader.getPluginId());
} else {
- UpdateChecker.getDisabledToUpdatePlugins().add(downloader.getPluginId());
+ getSkippedPlugins().add(downloader.getPluginId());
}
for (Listener listener : myListeners) {
listener.stateChanged();
}
}
+ protected Set<String> getSkippedPlugins() {
+ return UpdateChecker.getDisabledToUpdatePlugins();
+ }
+
public void addStateListener(Listener l) {
myListeners.add(l);
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/PluginsAdvertiser.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/PluginsAdvertiser.java
new file mode 100644
index 000000000000..24615ca1bc14
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/PluginsAdvertiser.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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.openapi.updateSettings.impl.pluginsAdvertisement;
+
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import com.intellij.ide.plugins.*;
+import com.intellij.notification.*;
+import com.intellij.openapi.application.Application;
+import com.intellij.openapi.application.ApplicationInfo;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.extensions.PluginId;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.progress.Task;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.startup.StartupActivity;
+import com.intellij.openapi.updateSettings.impl.PluginDownloader;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.net.HttpConfigurable;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import javax.swing.event.HyperlinkEvent;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class PluginsAdvertiser implements StartupActivity {
+ private static final Logger LOG = Logger.getInstance("#" + PluginsAdvertiser.class.getName());
+
+ public static List<PluginId> retrieve(UnknownFeature unknownFeature) {
+ final String featureType = unknownFeature.getFeatureType();
+ final String implementationName = unknownFeature.getImplementationName();
+ final String buildNumber = ApplicationInfo.getInstance().getBuild().asString();
+ final String pluginRepositoryUrl = "http://plugins.jetbrains.com/feature/getImplementations?" +
+ "featureType=" + featureType +
+ "&implementationName=" + implementationName +
+ "&build=" + buildNumber;
+ try {
+ HttpURLConnection connection = HttpConfigurable.getInstance().openHttpConnection(pluginRepositoryUrl);
+ connection.connect();
+ final InputStreamReader streamReader = new InputStreamReader(connection.getInputStream());
+ try {
+ final JsonElement jsonRootElement = new JsonParser().parse(streamReader);
+ final List<PluginId> result = new ArrayList<PluginId>();
+ for (JsonElement jsonElement : jsonRootElement.getAsJsonArray()) {
+ final JsonObject jsonObject = jsonElement.getAsJsonObject();
+ final JsonElement pluginId = jsonObject.get("pluginId");
+ result.add(PluginId.getId(StringUtil.unquoteString(pluginId.toString())));
+ }
+ return result;
+ }
+ finally {
+ streamReader.close();
+ }
+ }
+ catch (IOException e) {
+ LOG.info(e);
+ return null;
+ }
+ }
+
+ @Override
+ public void runActivity(@NotNull final Project project) {
+ final UnknownFeaturesCollector collectorSuggester = UnknownFeaturesCollector.getInstance(project);
+ final Set<UnknownFeature> unknownFeatures = collectorSuggester.getUnknownFeatures();
+ if (unknownFeatures.isEmpty()) return;
+ final Runnable runnable = new Runnable() {
+ public void run() {
+ final Application application = ApplicationManager.getApplication();
+ if (application.isUnitTestMode() || application.isHeadlessEnvironment()) return;
+ ProgressManager.getInstance().run(new Task.Backgroundable(project, "Search for non-bundled plugins in plugin repository...") {
+ private final Set<PluginDownloader> myPlugins = new HashSet<PluginDownloader>();
+ private List<IdeaPluginDescriptor> myAllPlugins;
+
+ @Override
+ public void run(@NotNull ProgressIndicator indicator) {
+ int idx = 0;
+ final Set<PluginId> ids = new HashSet<PluginId>();
+ for (UnknownFeature feature : unknownFeatures) {
+ indicator.setText("Searching for: " + feature.getFeatureType());
+ final List<PluginId> pluginId = retrieve(feature);
+ if (pluginId != null) {
+ //do not suggest to download disabled plugins
+ final List<String> disabledPlugins = PluginManagerCore.getDisabledPlugins();
+ for (PluginId id : pluginId) {
+ if (!disabledPlugins.contains(id.getIdString())) {
+ ids.add(id);
+ }
+ }
+ }
+ indicator.setFraction(idx++ / unknownFeatures.size());
+ }
+
+ try {
+ myAllPlugins = RepositoryHelper.loadPluginsFromRepository(indicator);
+ for (IdeaPluginDescriptor loadedPlugin : myAllPlugins) {
+ if (ids.contains(loadedPlugin.getPluginId())) {
+ myPlugins.add(PluginDownloader.createDownloader(loadedPlugin));
+ }
+ }
+ }
+ catch (Exception ignore) {
+ //no notification to show
+ }
+ }
+
+ @Override
+ public void onSuccess() {
+ if (!myPlugins.isEmpty()) {
+ final String displayId = "Plugins Suggestion";
+ new NotificationGroup(displayId, NotificationDisplayType.STICKY_BALLOON, true)
+ .createNotification(displayId, "Features covered by non-bundled plugins are detected.<br>" +
+ "<a href=\"configure\">Configure plugins...</a><br>" +
+ "<a href=\"ignore\">Ignore All</a>", NotificationType.INFORMATION, new NotificationListener() {
+ @Override
+ public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
+ if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
+ final String description = event.getDescription();
+ if ("ignore".equals(description)) {
+ for (UnknownFeature feature : unknownFeatures) {
+ collectorSuggester.ignoreFeature(feature);
+ }
+ } else if ("configure".equals(description)) {
+ LOG.assertTrue(myAllPlugins != null);
+ new PluginsAdvertiserDialog(myProject, myPlugins.toArray(new PluginDownloader[myPlugins.size()]), myAllPlugins).show();
+ }
+ notification.expire();
+ }
+ }
+ }).notify(project);
+ }
+ }
+ });
+ }
+ };
+
+ SwingUtilities.invokeLater(runnable);
+ }
+}
+
diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/PluginsAdvertiserDialog.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/PluginsAdvertiserDialog.java
new file mode 100644
index 000000000000..a092d2a5b850
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/PluginsAdvertiserDialog.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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.openapi.updateSettings.impl.pluginsAdvertisement;
+
+import com.intellij.ide.plugins.IdeaPluginDescriptor;
+import com.intellij.ide.plugins.PluginManagerMain;
+import com.intellij.ide.plugins.PluginNode;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.updateSettings.impl.DetectedPluginsPanel;
+import com.intellij.openapi.updateSettings.impl.PluginDownloader;
+import com.intellij.ui.TableUtil;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+* User: anna
+*/
+public class PluginsAdvertiserDialog extends DialogWrapper {
+ private static final Logger LOG = Logger.getInstance("#" + PluginsAdvertiserDialog.class.getName());
+
+ private final PluginDownloader[] myUploadedPlugins;
+ private final List<IdeaPluginDescriptor> myAllPlugins;
+ private final HashSet<String> mySkippedPlugins = new HashSet<String>();
+
+ PluginsAdvertiserDialog(@Nullable Project project, PluginDownloader[] plugins, List<IdeaPluginDescriptor> allPlugins) {
+ super(project);
+ myUploadedPlugins = plugins;
+ myAllPlugins = allPlugins;
+ setTitle("Choose Plugins to Install");
+ init();
+ }
+
+ @Nullable
+ @Override
+ protected JComponent createCenterPanel() {
+ final DetectedPluginsPanel foundPluginsPanel = new DetectedPluginsPanel() {
+ @Override
+ protected Set<String> getSkippedPlugins() {
+ return mySkippedPlugins;
+ }
+ };
+
+ for (PluginDownloader uploadedPlugin : myUploadedPlugins) {
+ foundPluginsPanel.add(uploadedPlugin);
+ }
+ TableUtil.ensureSelectionExists(foundPluginsPanel.getEntryTable());
+ return foundPluginsPanel;
+ }
+
+ @Override
+ protected void doOKAction() {
+ final List<PluginNode> nodes = new ArrayList<PluginNode>();
+ for (PluginDownloader downloader : myUploadedPlugins) {
+ if (!mySkippedPlugins.contains(downloader.getPluginId())) {
+ final PluginNode pluginNode = PluginDownloader.createPluginNode(null, downloader);
+ if (pluginNode != null) {
+ nodes.add(pluginNode);
+ }
+ }
+ }
+ try {
+ PluginManagerMain.downloadPlugins(nodes, myAllPlugins, new Runnable() {
+ @Override
+ public void run() {
+ PluginManagerMain.notifyPluginsWereInstalled(null);
+ }
+ }, null);
+ }
+ catch (IOException e) {
+ LOG.error(e);
+ }
+ super.doOKAction();
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/UnknownFeature.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/UnknownFeature.java
new file mode 100644
index 000000000000..13640ef0a3fd
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/UnknownFeature.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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.openapi.updateSettings.impl.pluginsAdvertisement;
+
+/**
+ * User: anna
+ */
+public class UnknownFeature {
+ private final String myFeatureType;
+ private final String myImplementationName;
+
+ public UnknownFeature(String featureType, String implementationName) {
+ myFeatureType = featureType;
+ myImplementationName = implementationName;
+ }
+
+ public String getFeatureType() {
+ return myFeatureType;
+ }
+
+ public String getImplementationName() {
+ return myImplementationName;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ UnknownFeature feature = (UnknownFeature)o;
+
+ if (!myFeatureType.equals(feature.myFeatureType)) return false;
+ if (!myImplementationName.equals(feature.myImplementationName)) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = myFeatureType.hashCode();
+ result = 31 * result + myImplementationName.hashCode();
+ return result;
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/UnknownFeaturesCollector.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/UnknownFeaturesCollector.java
new file mode 100644
index 000000000000..0bd1410f012e
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/UnknownFeaturesCollector.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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.openapi.updateSettings.impl.pluginsAdvertisement;
+
+import com.intellij.openapi.components.*;
+import com.intellij.openapi.project.Project;
+import org.jdom.Element;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * User: anna
+ */
+@State(
+ name = "UnknownFeatures",
+ storages = {
+ @Storage(
+ file = StoragePathMacros.WORKSPACE_FILE
+ )}
+)
+public class UnknownFeaturesCollector implements PersistentStateComponent<Element> {
+ @NonNls private static final String FEATURE_ID = "featureType";
+ @NonNls private static final String IMPLEMENTATION_NAME = "implementationName";
+
+ private final Set<UnknownFeature> myUnknownFeatures = new HashSet<UnknownFeature>();
+ private final Set<UnknownFeature> myIgnoredUnknownFeatures = new HashSet<UnknownFeature>();
+
+ public static UnknownFeaturesCollector getInstance(Project project) {
+ return ServiceManager.getService(project, UnknownFeaturesCollector.class);
+ }
+
+ public void registerUnknownRunConfiguration(String configurationName) {
+ registerUnknownFeature("com.intellij.configurationType", configurationName);
+ }
+
+ public void registerUnknownFeature(String featureType, String implementationName) {
+ final UnknownFeature feature = new UnknownFeature(featureType, implementationName);
+ if (!myIgnoredUnknownFeatures.contains(feature)) {
+ myUnknownFeatures.add(feature);
+ }
+ }
+
+ public void ignoreFeature(UnknownFeature feature) {
+ myIgnoredUnknownFeatures.add(feature);
+ }
+
+ public Set<UnknownFeature> getUnknownFeatures() {
+ return myUnknownFeatures;
+ }
+
+ @Nullable
+ @Override
+ public Element getState() {
+ if (myIgnoredUnknownFeatures.isEmpty()) return null;
+
+ final Element ignored = new Element("ignored");
+ for (UnknownFeature feature : myIgnoredUnknownFeatures) {
+ final Element option = new Element("option");
+ option.setAttribute(FEATURE_ID, feature.getFeatureType());
+ option.setAttribute(IMPLEMENTATION_NAME, feature.getImplementationName());
+ ignored.addContent(option);
+ }
+ return ignored;
+ }
+
+ @Override
+ public void loadState(Element state) {
+ myIgnoredUnknownFeatures.clear();
+ for (Element element : state.getChildren()) {
+ myIgnoredUnknownFeatures.add(
+ new UnknownFeature(element.getAttributeValue(FEATURE_ID), element.getAttributeValue(IMPLEMENTATION_NAME)));
+ }
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/jar/JarHandler.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/jar/JarHandler.java
index eb46fc8e7a99..7f0b5e8a4e9d 100644
--- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/jar/JarHandler.java
+++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/jar/JarHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,10 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-/*
- * @author max
- */
package com.intellij.openapi.vfs.impl.jar;
import com.intellij.notification.NotificationGroup;
@@ -48,6 +44,9 @@ import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
+/**
+ * @author max
+ */
public class JarHandler extends JarHandlerBase {
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vfs.impl.jar.JarHandler");
@@ -111,6 +110,8 @@ public class JarHandler extends JarHandlerBase {
private File getMirrorWithContentHash(File originalFile,
FileAttributes originalAttributes) {
File mirrorFile = null;
+ String jarDir = getJarsDir();
+
try {
String path = originalFile.getPath();
CacheLibraryInfo info = CacheLibraryInfo.ourCachedLibraryInfo.get(path);
@@ -120,7 +121,7 @@ public class JarHandler extends JarHandlerBase {
if (originalAttributes.length == info.myFileLength &&
Math.abs(originalAttributes.lastModified - info.myModificationTime) <= FS_TIME_RESOLUTION
) {
- mirrorFile = new File(new File(getJarsDir()), info.mySnapshotPath);
+ mirrorFile = new File(new File(jarDir), info.mySnapshotPath);
mirrorFileAttributes = FileSystemUtil.getAttributes(mirrorFile);
if (mirrorFileAttributes != null &&
mirrorFileAttributes.length == originalAttributes.length &&
@@ -139,7 +140,7 @@ public class JarHandler extends JarHandlerBase {
File tempJarFile = null;
try {
- tempJarFile = FileUtil.createTempFile(new File(getJarsDir()), originalFile.getName(), "", true, false);
+ tempJarFile = FileUtil.createTempFile(new File(jarDir), originalFile.getName(), "", true, false);
os = new DataOutputStream(new FileOutputStream(tempJarFile));
is = new FileInputStream(originalFile);
byte[] buffer = new byte[20 * 1024];
@@ -154,10 +155,13 @@ public class JarHandler extends JarHandlerBase {
sha1.update(buffer, 0, read);
os.write(buffer, 0, read);
}
- } catch (IOException ex) {
- reportIOErrorWithJars(originalFile, mirrorFile != null ? mirrorFile:tempJarFile, ex);
+ }
+ catch (IOException ex) {
+ File target = mirrorFile != null ? mirrorFile : tempJarFile != null ? tempJarFile : new File(jarDir);
+ reportIOErrorWithJars(originalFile, target, ex);
return originalFile;
- } catch (NoSuchAlgorithmException ex) {
+ }
+ catch (NoSuchAlgorithmException ex) {
assert false;
return originalFile; // should never happen for sha1
}
@@ -167,7 +171,7 @@ public class JarHandler extends JarHandlerBase {
}
byte[] digest = sha1.digest();
- mirrorFile = new File(new File(getJarsDir()), getSnapshotName(originalFile.getName(), digest));
+ mirrorFile = new File(new File(jarDir), getSnapshotName(originalFile.getName(), digest));
mirrorFileAttributes = FileSystemUtil.getAttributes(mirrorFile);
if (mirrorFileAttributes == null ||
@@ -193,7 +197,7 @@ public class JarHandler extends JarHandlerBase {
CacheLibraryInfo.ourCachedLibraryInfo.force();
return mirrorFile;
} catch (IOException ex) {
- reportIOErrorWithJars(originalFile, mirrorFile != null ? mirrorFile: new File(getJarsDir(), originalFile.getName()), ex);
+ reportIOErrorWithJars(originalFile, mirrorFile != null ? mirrorFile: new File(jarDir, originalFile.getName()), ex);
return originalFile;
}
}
@@ -314,13 +318,13 @@ public class JarHandler extends JarHandlerBase {
}
};
- private void reportIOErrorWithJars(File original, File mirror, IOException e) {
+ private void reportIOErrorWithJars(File original, File target, IOException e) {
LOG.warn(e);
- final String path = original.getPath();
- final String message = VfsBundle.message("jar.copy.error.message", path, mirror.getPath(), e.getMessage());
-
- ERROR_COPY_NOTIFICATION.getValue().createNotification(message, NotificationType.ERROR).notify(null);
+ String path = original.getPath();
myFileSystem.setNoCopyJarForPath(path);
+
+ String message = VfsBundle.message("jar.copy.error.message", path, target.getPath(), e.getMessage());
+ ERROR_COPY_NOTIFICATION.getValue().createNotification(message, NotificationType.ERROR).notify(null);
}
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeGlassPaneImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeGlassPaneImpl.java
index 19af1b1b1cd1..09de7d3ddcfb 100644
--- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeGlassPaneImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeGlassPaneImpl.java
@@ -139,6 +139,8 @@ public class IdeGlassPaneImpl extends JPanel implements IdeGlassPaneEx, IdeEvent
final boolean pureMouse1Event = (me.getModifiersEx() | button1) == button1;
if (pureMouse1Event && me.getClickCount() <= 1 && !me.isPopupTrigger()) {
final Point point = SwingUtilities.convertPoint(meComponent, me.getPoint(), myRootPane.getContentPane());
+ JMenuBar menuBar = myRootPane.getJMenuBar();
+ point.y += menuBar != null ? menuBar.getHeight() : 0;
final Component target =
SwingUtilities.getDeepestComponentAt(myRootPane.getContentPane().getParent(), point.x, point.y);
diff --git a/platform/platform-impl/src/com/intellij/psi/impl/UrlPsiReference.java b/platform/platform-impl/src/com/intellij/psi/impl/UrlPsiReference.java
new file mode 100644
index 000000000000..9a52a5691815
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/psi/impl/UrlPsiReference.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2009 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.psi.impl;
+
+import com.intellij.ide.BrowserUtil;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReferenceBase;
+import org.jetbrains.annotations.NotNull;
+
+public class UrlPsiReference extends PsiReferenceBase<PsiElement> {
+ public UrlPsiReference(PsiElement element) {
+ super(element);
+ }
+
+ public PsiElement resolve() {
+ return new FakePsiElement() {
+ public PsiElement getParent() {
+ return getElement();
+ }
+
+ @Override
+ public String getName() {
+ return getValue();
+ }
+
+ @Override
+ public void navigate(boolean requestFocus) {
+ BrowserUtil.launchBrowser(getValue());
+ }
+ };
+ }
+
+ @NotNull
+ public Object[] getVariants() {
+ return EMPTY_ARRAY;
+ }
+
+ @Override
+ public boolean isSoft() {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/platform/platform-impl/src/com/intellij/ui/win/RecentProjectApplication.java b/platform/platform-impl/src/com/intellij/ui/win/RecentProjectApplication.java
new file mode 100644
index 000000000000..9561c77b02d6
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/ui/win/RecentProjectApplication.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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.ui.win;
+
+import com.intellij.ide.impl.ProjectUtil;
+import com.intellij.openapi.diff.ApplicationStarterBase;
+
+
+/**
+ * @author Denis Fokin
+ */
+public class RecentProjectApplication extends ApplicationStarterBase {
+ public RecentProjectApplication() {
+ super("reopen", 1);
+ }
+
+ @Override
+ public String getUsageMessage() {
+ return String.format("This command is used for internal purpose only.");
+ }
+
+ @Override
+ protected void processCommand(String[] args) throws Exception {
+ ProjectUtil.openProject(args[1], null, false);
+ }
+} \ No newline at end of file
diff --git a/platform/platform-impl/src/com/intellij/ui/win/RecentTasks.java b/platform/platform-impl/src/com/intellij/ui/win/RecentTasks.java
index 12ad39f4cea2..3ba433abd2a5 100644
--- a/platform/platform-impl/src/com/intellij/ui/win/RecentTasks.java
+++ b/platform/platform-impl/src/com/intellij/ui/win/RecentTasks.java
@@ -16,6 +16,7 @@
package com.intellij.ui.win;
import com.intellij.idea.StartupUtil;
+import com.intellij.util.lang.UrlClassLoader;
import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -29,7 +30,7 @@ public class RecentTasks {
new WeakReference<Thread>(Thread.currentThread());
static {
- System.loadLibrary("jumpListBridge");
+ UrlClassLoader.loadPlatformLibrary("jumpListBridge");
}
private synchronized static void init() {
@@ -54,7 +55,12 @@ public class RecentTasks {
clearNative();
}
+ /**
+ * Use #clearNative method instead of passing empty array of tasks.
+ * @param tasks
+ */
public synchronized static void addTasks(final Task[] tasks) {
+ if (tasks.length == 0) return;
init();
checkThread();
addTasksNativeForCategory("Recent", tasks);
diff --git a/platform/platform-impl/src/com/intellij/ui/win/SocketControlHelper.java b/platform/platform-impl/src/com/intellij/ui/win/SocketControlHelper.java
index 84372bf5c9cd..b2f7738d6c7d 100644
--- a/platform/platform-impl/src/com/intellij/ui/win/SocketControlHelper.java
+++ b/platform/platform-impl/src/com/intellij/ui/win/SocketControlHelper.java
@@ -46,7 +46,7 @@ public class SocketControlHelper {
DataOutputStream out = new DataOutputStream(socket.getOutputStream());
try {
- out.writeUTF(ACTIVATE_COMMAND + new File(".").getAbsolutePath() + "\0" + pathToProject);
+ out.writeUTF(ACTIVATE_COMMAND + new File(".").getAbsolutePath() + "\0" + "reopen" + "\0" + pathToProject);
out.flush();
String response = in.readUTF();
if (response.equals("ok")) {
diff --git a/platform/platform-impl/src/com/intellij/util/SingletonInstancesCache.java b/platform/platform-impl/src/com/intellij/util/SingletonInstancesCache.java
new file mode 100644
index 000000000000..5d7810bbb824
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/util/SingletonInstancesCache.java
@@ -0,0 +1,35 @@
+package com.intellij.util;
+
+import com.intellij.util.containers.ConcurrentHashMap;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Sergey Evdokimov
+ */
+public class SingletonInstancesCache {
+
+ private static final ConcurrentHashMap<String, Object> CACHE = new ConcurrentHashMap<String, Object>();
+
+ private SingletonInstancesCache() {
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> T getInstance(@NotNull String className, ClassLoader classLoader) {
+ Object res = CACHE.get(className);
+ if (res == null) {
+ try {
+ res = classLoader.loadClass(className).newInstance();
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ Object oldValue = CACHE.putIfAbsent(className, res);
+ if (oldValue != null) {
+ res = oldValue;
+ }
+ }
+
+ return (T)res;
+ }
+}