Snapshot idea/138.1283 from git://git.jetbrains.org/idea/community.git
047cbb9: IDEA-127620 - Clouds: move frameworks to the top level in new module/project wizard - refactoring of import
1d1914f: IDEA-127620 - Clouds: move frameworks to the top level in new module/project wizard - remove from JavaEE group
3206e15: Merge remote-tracking branch 'origin/master'
a513e70: enable injected context for actions in action popups (IDEA-126995)
70c5d69: CommentInjector: improved detection and IDEA-114915 InjectorUtils performance
482cdc2: @MagicConstant added
997dc0b: do not show VM names in run configurations: junit, application (IDEA-126880)
9873768: merge commands to replace duplicates (IDEA-126776)
e9a17df: field can be local: when field is used in method for read it can't be converted to local if used in another methods (IDEA-127159)
f9e6f06: faster LexerEditorHighlighter.checkContentIsEqualTo
6051f49: generic debugger settings: step 3 — root settings (Debugger node content) — Java transformed
bcb94d7: cleanup
a12ac6c: treat Diagnostic.Kind.NOTE as information message, not a warning message (IDEA-105383)
f367dcb: IDEA-127666 Add tooltip to "Project Setting" icon
08d9677: add delegate method to TextFieldWithHistoryWitBrowseButton
ce0d23f: change messages for postfix templates configurable
d7d7e88: platform: syntax compatibility with antiquated Python versions for environment loader
2a10168: SwingHelper moved to platform-impl
0299b30: auto-import context variable declaration type when completing (IDEA-90157)
e353c2f: prefer some well-known java util classes in completion (IDEA-100669)
f81e96e: java chained completion: qualifier class items shouldn't be inserted as constructors
7cb41f8: Update image to visualize the project-based configurable in the Settings dialog.
e1d651b: Cleanup (formatting)
a7e55c6: time limit for constant search
9cce5c7: do not split annotations on multiple lines for params (IDEA-127017)
0aa3890: simplified, added filtering for subsequent parameter pairs: "key, value", "first, second"
d477f91: IDEA-59662: Provide ability to specify right margin (columns) for each file type separately (enabled for PHP)
9b820f7: IDEA-127679 ArrayIndexOutOfBoundsException if no default or focused button is specified
4c997e0: Prevent NPE in AbstractPopup and add corresponding logging
5a49a15: fix inset: VerticalFlowLayout incorrectly uses vertical gap as top inset
ece44da: cleanup
5a46a42: generic debugger settings: step 3 — root settings (Debugger node content)
04518cd: Inspections settings ui: tools not initialized if no necessity to apply inspections filter
da81c5d: ProjectFileIndex#isIgnored renamed to 'isExcluded'
0e67032: Return accidentally removed PyStringLiteralFixer
3089c9c: PY-12877 Complete statement doesn't insert colon for 'with' statement
1c70a28: IG inline fixes: use inline method processor; if simple getter is inlined in simple expr statement - it should be deleted (IDEA-127135)
8835827: logging for (IDEA-127288)
b585c95: inline method: check unique names for this variable in initial class scope (IDEA-127411)
ccc235e: tests: show warning when only ignored tests were detected (IDEA-127660)
ad42de6: vcs: reformat and cleanup
e9fe369: fixed starting jps-builders tests
9d121c2: fix disposeUIResources if merged
2e780d7: turn off contract inference for overrideable methods: fix logic
1bf7333: don't measure MinusculeMatcher performance
2eae3c8: contract inference: take explicit parameter notnull into account (IDEA-127667)
8851417: non-code gutter: get annotations for bytecode psi when highlighting library source
6608b52: generic debugger settings: step 2 — stepping — transform Groovy, all Stepping configurable on one page
e46729f: cleanup
dd0fd0f: ContainerUtil notNullize/nullize
3d30b27: extract EMPTY_SETTINGS_PANEL_PROVIDER
efe0d5a: Inspections settings ui: filter actions in toolbar added
006705c: DefaultVcsRootPolicy refactoring: 'isIgnored' check moved from 'matchesDefaultMapping' implementations to 'getMappingFor'
363b2cd: simplification
12a3d4f: platform: minor optimization (do not rename/delete directory recursively)
9a80d33: vfs: on create/delete notifications mark a child dirty as well
74d6cb2: diff: use separate action for 'roolback' for file (VCS action) and 'roolback' for local changes (LST action)
8b69a0f: diff: fix access to the invalid ranges
1f4de9d: diff: diff from LineStatusTracker
950a80a: IDEA-110611 diff: Ability to revert lines in selection
b6cd05a: diff: small fixes in LineStatusTracker
db873ee: Use Guava's immutable lists instead of static initializers in PySmartEnterProcessor
b1b8116: PY-9176 Converting % to format() doesn't handle multiline string literals
3d377d9: trigger automake for deleted files
1101b55: Merge remote-tracking branch 'origin/master'
3bf8f90: fix paint track
1e1a9c7: IDEA-61550 respect EditorFilter
831cecb: Merge remote-tracking branch 'origin/master'
28dd985: make editor vertical scrollbar bg the same as editor bg on Mac
c3a963a: fix preferred height for JComboBox too
da026c5: override ControlDoubleClick+Left/Right, make new bindings switchable
222d8ef: bind 'clone caret' actions to ControlDoubleClick+Up/Down
41034f6: DirectoryInfo: extracted sub-class
693b2a2: DirectoryIndexTest: renames
a06bd87: Inspections settings ui: added mask and fixed height of severity icon
73dfd94: parameter name folding reducing: - do not inline if parameter length is less than 3 - do not inline if two subsequent parameters has interval names (beginIndex, endIndex; startId, endId; from, to...)
90d58be: DirectoryIndex: removed unnecessary isProjectExcludeRoot method
359bc94: DirectoryInfo simplification: use booleans instead of bit flags because now we have no so many instance of this class (CR-IC-5807)
df51a0d: Inspections settings ui: severity colors in tree showed only for enabled inspections
931d600: Inspections ui: expand/collapse tree fixed
c0d2162: EA-58395 - NPE: PerlMatcher.matches
d203d8f: bytecode-inferred annotations are only available for compiled elements (IDEA-127608)
5c1256f: Merge remote-tracking branch 'origin/master'
bacc3c2: lambda -> method refs: collapse when acceptable method without supers found
3bed881: Merge remote-tracking branch 'origin/master'
dd4ddfb: method ref -> lambda: names based on resolved method (IDEA-126977)
4b7122b: shorten FQNs when insert casts (IDEA-127573)
91f505e: create static method from usage in interface (IDEA-127563)
124d774: generic debugger settings: step 2 — stepping
72a3ffa: Cleanup (formatting)
7016425: Cleanup (two utility classes merged)
ff16ce7: update about graphics
02939b8: add problems listener to update counter
22a3964: +getList() to access configurables list
79a933c: update problems counter for Darcula
b198c6a: add Problems counter
67cbc12: allow to override layouting algorithm
43ab48e: + getErrorsCount()
72925df: pointless expressions: do not simplify a - b - b to a - 0
824f432: workaround for <p/> inside <pre> in javadoc preview in JEditorPane (IDEA-127430)
ae4f3d9: unwrap: adjust caret before RParenth (IDEA-127580)
a46f4ce: anonym -> lambda: disable in case when inferred type differs from type of anonymous class and parameter of param type is used inside (IDEA-127603); BTW param.toString would be also rejected
89dc528: new inference: no substitution during most specific inference by means of new spec (IDEA-127584)
fb786d3: SSR: improve annotation name value pair matching
20cb223: SSR: renaming
6af6e5d: SSR: Nullable annotations
912772c: SSR: remove unnecessary field
1017a77: SSR: remove a bit of dead code
04d10f8: IDEA-127337 Popups in editor sometimes aren't shown on first invocation
f18c04d: jps plugins: added extension to allow plugins contribute to JPS model even if they don't contribute to external build
5c81146: generic debugger settings: step 1 — data views — merge settings (generic and custom) into one page
4a15d1b: add copyright
27fddc2: generic debugger settings: step 1 — data views
e6d092e: cleanup
343e145: cleanup
90cc9e3: cleanup
30c7264: cleanup
31d8039: cleanup
322e539: IDEA-127077 (highlighting test)
4d7f4ab: move PropertiesComponentImpl to core-impl
2495d31: runtime-opcodes support
f3ffe1a: java-analysis-impl doesn't depend on platform-api
68de28e: use JBColor
fd0bb1e: IDEA-127620 - Clouds: move frameworks to the top level in new module/project wizard
0cf69f8: bytecode analysis: resolve only wrt PsiClassOwner (IDEA-127608)
9ca2a55: reverted e442926 because there is no thread visibility problem right now (per discussion with Roman.Shevchenko)
8e74038: additional tracing code for difference of this session and previous session of particular content calculation
bcd970c: Nullable / NotNull
62a0104: revert: Ctrl-N doesn't show after delete; no input field for Ctrl-N etc
9b4912c: lambda: do not start inference from void type (IDEA-127596)
6de6ee1: delegate methods: do not suggest to delegate when delegate would override final (IDEA-127605)
9ff4e24: plugins update dialog layout (IDEA-127462)
f03ca65: create class: filter out generated roots (IDEA-127562)
455fc35: move destination: fix laziness
d93d0ab: Workaround for another JDK bug in cached popups.
a4cdd68: update grails project structure: remove proper instance of ContentEntry (IDEA-120622) using urls since ContentEntry uses default equals/hashcode implementation
14d57e4: Cleanup (formatting)
e35d9d8: IDEA-127077 (incorrect parsing of type annotations)
653ccf4: move to the right module
0e44e1c: Merge remote-tracking branch 'origin/master'
afc422e: fix errors foreground for Darcula
f38dd67: Merge remote-tracking branch 'origin/master'
bbb42a45d: IDEA-126982 (Add an inspection to flag a nonfinal class that only has private constructors)
c54ff24: fix typos
8ae3019: [git tests] assume git version is supported
1e79d7b: [log] Simplify & fix refs comparison API & implementation
dd0a29c: [git] fix refs comparator for the case when refs have equal names
db96ca3: [git] remove trivial test setup
7f6d1ce: [git] rename test class to match the production class name
d94a9bf: simplify:inline variale
a2d93f2: IDEA-126389 FromString ClosureParams Hint should use method.getTypeParametersList() as a context for creating type because method does not process its type parameters in processDeclarations(). Use method as a context if it does not contain type parameter list
a2221d5: IDEA-126334 Correct declaration scope for light parameters and getReturnTypeElementGroovy for light methods
5ccb872: IDEA-126389 FromString ClosureParams Hint should use method.getTypeParametersList() as a context for creating type because method does not process its type parameters in processDeclarations()
b43f06c: make another IG test light
09fafa8: IDEA-127263 ("Conditional Expression With Identical Branches" deleting non-identical branches.)
feeb54a: SSR: remove unused method
d5ce2c1: SSR: match name value pairs when value is not specified
d61fdb0: fix typo
55eb67a: fixing JspAutoImportTest: auto-import classes at statement start
455b352: cleanup. remove unused fields
42c3f0d: change links protocol
05a4407: add hyperlink listener
9906008: Merge remote-tracking branch 'origin/master'
25f1003: stub for ordered scopes problem
7e4a359: Merge branch 'master' of git.labs.intellij.net:idea/community
3559eb7: bundling ecj-4.4 java compiler
0d34ff1: PY-4186 Lettuce BDD tool support (initial commit of lettuce runner)
640c9a6: Merge remote-tracking branch 'origin/master'
e442926: IDEA-117507 NullPointerException on startup of IDEA 13
d2be1f3: disable hard consistency check
5cc3a16: fix mistype in html+ increase space between elements
2dc1b7c: Log popup window size before showing
1a20228: showing build attempt in logs and in title bar only
2df962a: scopes: include module in file pattern as matching would be calculated against it anyway (IDEA-127397)
d60644a: Resize a popup window according to the preferred size of the component instead of its size.
b237157: do not lock UI during plugin download (IDEA-127454)
067ef9e: method refs: check first parameter if it could be a receiver for varargs methods (IDEA-127506)
eff4567: compose error message (IDEA-127534)
3bc9fa3: IDEA-111466 Mac OS X keyboard shortcuts with alt don't work under Oracle Java 7
6bf1409: postfix template fix ternary operator + test
c6ff466: IDEA-111466 Mac OS X keyboard shortcuts with alt don't work under Oracle Java 7
55a8bd4: DebuggerSettings — use PersistentStateComponent instead of deprecated JDOMExternalizable
189f3f5: cleanup
402ccab: DBE-228: column margins
333636c: Replace comma with ampersand
68ec56f: Add groupId for top-level configurable for Junior IDEs.
2ff73e2: don't recreate code fragment psi (IDEA-127039)
5379b77: turn off contract inference for overrideable methods; hopefully, not forever (IDEA-127518)
49a119a: IDEA-121276 Constant conditions: work with arrays
ec7c9a3: JavaConstantExpressionEvaluator: add @Nullable
563ad9e: move DfaValue calculation for expressions to one place
392885a: @NotNull DfaVariableValue.psiVariable
ee1eb2c: store / use buildAttemptInfo taken from file
5de0503: insert delete with renaming logic for Windows into general delete method
0a6a374: Reverted: cast from Short to char is prohibited (1c5a03589e5155633de91051e59255d3ad84414f)
91b8291: IDEA-123863 'Save Project as Template' action leads to deadlock
3aed563: Platform: use presentable names when generate keymaps for help
34f2fb0: grayed call frame view if in library content (the same as in java)
f9982ec: update grails project structure: remove proper instance of ContentEntry (IDEA-120622)
ecbbac9: Merge remote-tracking branch 'origin/master'
9795ec8: extract from internal mode
3b00516: notnull
67b840e: notnull
e4308c8: cleanup
e75bfff: correctly calculate inspection short name in presence of upsource
52d5382: optimisation
1c5a035: cast from Short to char is prohibited
685fdb4: optimisation: getMaybeSuperClassSubstitutor() allows to avoid extra isInheritor() check
60d088f: notnull, cleanup
b5fb827: optimisation
edf6a02: Merge remote-tracking branch 'origin/master'
23586b9: Added coverage.py fixing wrongly optimized imports.
f291cc5: Fixed getting helper.
ecec042: Merge remote-tracking branch 'origin/master'
f997ddb: StringPattern: restore binary compatibility (broken by 64c812e)
145fbae: Merge remote-tracking branch 'origin/master'
642faba: as ignored file set can be quite large, use map without entries for smaller memory footprint (e.g. in snapshot for IDEA-126201 number of ignored files is 126K, size of entries's memory for this number of elements is 2.5M)
067aa19: skip non-java files with given word in literal even before retrieving text / searching the word / finding element at tree (IDEA-126201)
aea7066: allow to pull methods in super interface as default ones when super interface already contains a method with the same signature; remove @Override in such case (IDEA-126988)
7d19e0e: method refs: missed super class substitution (IDEA-126969)
f17f398: 'unmark root' action: allow user to cancel exclusion if excluded folder is selected (IDEA-23537)
d61da37: IDEA-122076, IDEA-122172 Multicaret actions in quick find mode
8b2824d: IDEA-121956 Multiple Carets: Add support for skipping next selection
1ce6009: - catch runtime problems (e.g. IndexOutOfBoundsException from ByteBuffer) when instantiating stub index and retry index creation (IDEA-117596, IDEA-125750), ep2
c455dd4: - catch runtime problems (e.g. IndexOutOfBoundsException from ByteBuffer) when instantiating stub index and retry index creation (IDEA-117596, IDEA-125750) - use deleteWithRenaming to update index version (IDEA-127160)
b0fe937: DirectoryIndex: fixed 'isIgnored' for ignored files
fb4de8d: DirectoryIndex: store info for excluded and ignored directories
df68af8: require that notnull fields be initialized (IDEA-114889)
5a22fdc: IDEA-126660 Incorrect 'condition is always true' for a final field if an overridden method is called from the constructor
a7ec8b7: IDEA-126173 Specify exception type thrown by @NotNull annotations
f4d3703: IDEA-126531 Completion inserts unwanted semicolon
2887069: dfa: take into account known variable values when handling number comparisons (IDEA-126446)
1aa6e7a: add cast to disambiguate method calls when replacing their argument with null (IDEA-126466)
65ccc19: HardcodedContracts: use a utility method
4853112: dfa: we don't replace nontrivial references with constants, so remove the corresponding code and tests
3eea5bc: hardcode Guava Preconditions.checkNotNull contract
6d9cf39: dfa: understand assertThat notnull (IDEA-125977, IDEA-65004)
2a3e157: Merge remote-tracking branch 'origin/master'
f5e85e7: IDEA-126122 (reFS volumes recognized)
be1c5b8: Refactoring: configurable from provider can be null
e568624: Cleanup (file watcher project converted to VS13; generated junk dropped; version info updated)
1e7a9e9: Cleanup (tabs/spaces; formatting)
0262088: cosmetics: add extra offset for project icon and label margins
1695e0c: fix AIOOB in history
2b3dd78: add css styles to Error Pane
ac796ba: wrap errors to html for new project structure dialog
59763f3: Focus logging
3d07af1: SingleInspectionProfilePanel NPE fixed
397e893: IDEA-127478 Tip Of The Day dialog could be shown on incorrect monitor
090b2e5: on case-insensitive file systems perform file name compatibility check using real file names, not the ones taken from dynamically built or stored paths
e77cd8a: imports optimized
444f98b: show tooltip when mouse on "multiscopes" icon in inspections settings ui
b0b0fef: external build: send empty text with statistics message to avoid producing unnecessary output by IDEA Project Runner in TeamCity
970fe60: use ProjectFileIndex (from API) instead of DirectoryIndex (from impl) where possible
d9c45be: libraries scope: use ProjectFileIndex (from API) instead of DirectoryIndex (from impl) where possible
417adc7: notnull
b58808c: js postfix templates -> fix examples and configurable UI
ba3b637: Settings dialog: the project-based configurables are marked with an icon.
6508417: IDEA-127438 Tool windows drag&drop failure under Java 7
ca76151: IDEA-127343 Github: pass ModalityState to PasswordSafe
da5b7e6: use Couple
e98cb25: use Couple
568b881: DBE-228: abbreviate long cell values
abd5dce: notnull
6d84ba6: Add image to visualize the project-based configurable in the Settings dialog.
c32d9db: [vcs] IDEA-107598 Affected paths: consider the whole path when highlighting
f4ee468: Inspections settings ui: new inspections tree (tree replaced by table tree, added icons represent severities)
47de3cf6: LiteralExpressionTokenizer cleanup
120fe08: get rid of group border
1a5cf59: IDEA-127343 Pass ModalityState to PasswordSafe.store/removePassword
0143935: remove trivial javadocs
f3eb2b2: [git] Remove obsolete password aware handler
c4a16ff: Get password called with modality state; unnecessary get password from memory removed for hg auth
bf1f916: restore API for idea-php-symfony2-plugin
c53dc62: check for null
62e5744: unused classes from 'old make' implementation deleted
b8ddfa4: groovy compiler: deleted classes related to old make implementation
42926e1: Fix possible NPE in JiraRepository (EA-58392)
3498760: Introduce live integration tests for Tasks plugin. Add initial version of such tests for Trello
6fd747b: Migrate TrelloRepository to new tasks API
3021914: Remove wrong GSON annotation of 'closed' field in TrelloCard
e2b581a: IDEA-115177 (watcher size check no longer needed)
c9d3e32: vfs: file watcher executable lookup fixed
431f9db: get rid of deprecated code
25c8ccd: EA-58277 (diagnostic)
6037400: don't highlight '*.restartRequired' properties in registry.properties as unused
dfb7e51: registry: use 'restartRequired' property to enforce automatic restart
3305c35: registry: description text corrected
0ffc7d0: CIDR: OC-10422 Current resolve configuration should be preselected in resolve context panel
5f31e2e: show excluded files in Project View, initial (IDEA-23537)
ace6fe4: artifacts: one more unused class from 'old make' implementation deleted
5897a01: deleted old unused deprecated 'build participant' classes
b75d5f2: artifacts: unused classes from 'old make' implementation deleted
3ed24eb: RUBY-15507: we should not wrap configurables in scroll pane
26b2743: ProjectViewPsiTreeChangeListener updates tree more deeply on property changed
77ee53a: Fix again the following changes that were reverted: Fix for nullable composite configurable.
d0cd301: IDEA-126984 Mac OS X: Double line above the editor
c2e6ab0: revert (e3e3224e853ad466cebf13c8b5c7f01d272d8e88 Fix for nullable composite configurable.)
d1ce059: highlight modules
8b6c40d: platform: splash misalignment on Windows fixed
8b35719: devkit: incorrect modification reverted
928feba: JavaHelp 2.0_05
bc13d12: Merge remote-tracking branch 'origin/master'
a9d7da6: added test for default property file in resource bundle editor
160fca0: project: windows update scripts unified
e3e3224: Fix for nullable composite configurable.
a69f781: cleanup
aa16ba2: IDEA-126984 Mac OS X: Double line above the editor
0994232: project: build/update scripts tuned to support home paths with spaces
b9eb20d: EA-57720 - PIEAE: LeafPsiElement.a
1396322: IDEA-127343 Pass ModalityState to PasswordSafe.getPassword
7eb4791: [git] remove obsolete javadoc
4d3abb7: cleanup: remove trivial comments
d8f6d4c: SeverityEditorDialog -- if "mixed" pseudo severity chosen then no default selection
e39d6a2: ScopesAndSeveritiesTable suppress unused declaration inspection
f356442: DBE-321: prevent data tooltip flicker
226e175: Inspection settings UI: multiselection in inspections tree support
68c651e: catch exception when writing content, marking vfs for rebuild (IDEA-125925)
f59b7b3: revert the change that breaks functionality
eac71fe: add tool window id to assertion
349f84a: fix several concurrency issues in Search Everywhere
65824bb: Some configurables requires the dynamic attribute to configure its wrapper properly.
73c7f62: go to action: move Analyze Stacktrace... to the top
5458ff1: IDEA-127232 Fatal Error on startup on Mac Os X
09230b2: IDEA-125671 "Install plugin from disk" action could have different description in Find Action list, because now there are two identical items in the list
35e6c4d: remove suppressions
e83f80f: implicit usage provider for *.description in registry.properties
ddae39a: file path completion fixed
6f1f6cf: Inspection settings UI: creation copy of tool wrapper if new scope inserted
981a3db: remove unused class ColumnInfo$StringColumn
864cd2d: Inspection settings UI: - "ALL" scope moved to last position in table - move scopes in single inspection disabled
4965683: Merge remote-tracking branch 'origin/master'
e488923: cleanup. remove unused methods
d13074e: fix incorrect target element calculation for text editors
e2c4550: typo
219b31c: show display name for certificate configurable
1b4a3c1: larger scope when searching in path / ssr (IDEA-127068)
17a5843: disable plugins if cycle was detected (IDEA-127177)
001a9cf: New inspections settings UI: - nodes for individual scopes deleted from settings tree - added table in right panel to configure scopes&severities - new scope button added to right panel (if only default scope currently available)
de377f8: extract variable missed events (IDEA-127166)
dcb45f2: extract field missed events (IDEA-127167;IDEA-127169)
1d8d358: extract parameter missed after event added (IDEA-127170)
30d945d: local rename events (IDEA-127172; IDEA-127172)
d0b86b6: popup position for injected fragments during inplace refactorings should be calculated over injected editor as caret range marker is against injected document (IDEA-126989)
53de53f: Refactoring of grouping configurables. Use the following registry key to switch on this functionality: ide.file.settings.order.new
088e9a2: Fix tests broken after changes for PY-4073
d5032e5: java: parser changes temporarily reverted
690797e: Using "Batch File Change" events in BuildManager to cancel already running automake session while VCS is updating working tree (IDEA-111673)
4e586b4: replace with foreach
b70bfe3: Platform: do not produce duplicating shortcuts in help keymaps
d65ce21: Merge remote-tracking branch 'origin/master'
6a141b3: [git] rename utility method to a more consistent name
c5129cf: fix layouts: exclude structural search from defaul platform implementations
a9396b6: unused property inspection: search in a narrow scope first
5002c70: contract inference: honor already known parameter values during data flow analysis
704198c: contract inference: exclude contracts not matching the return type
349f900: no ContractInference for compiled elements
f02a497: change foreground and separator color
2e6fb66: move Problems down and change separator
6404449: support "--" separator
aa98745: customize separator
2e376b2: [git] IDEA-126472 IDEA-126473 Notify about external changes modifying the working tree
1a37016: [git] better diagnostics output format
f9a615b: [git] remove unused method
8b2eae6: [git] Remove duplicated code
5dd8682: Merge remote-tracking branch 'origin/master'
91b1e1b: Fixed wrong cast.
44ec294: annotate getPattern / getOptimizedIndexingPattern with @Nullable return info
50d32b8: SSR fix replace test
6521af0: IDEA-127077 (incorrect parsing of type annotations)
5b72fac: Cleanup (warning)
4fd07a5: License dialog: License key: provide precise diagnostic for rejected key After-review
6cb2eab: Remove deprecated Remote Interpreters API.
7d1e1bd: do not propagate exceptions in case of broken bytecode
980b837: fix test
e099a14: gant-based builds: added one more jar required for Kotlin compiler
f36393b: go to action: use gray instead of italic for shortcuts rendering
1c43998: gant-based builds: removed incorrect classpath entry for Kotlin compiler
ffb8b5f: gant-based builds: added jars required for Kotlin compiler to classpath
47eec66: java inheritor cache: use weak map to avoid holding PSI for unnecessary long time
1a78fe7: goto action: restore enabled action preference
8343e8e: goto action: rewrite using a more suitable API, prefer exact matches, fix search everywhere
a24b862: IDEA-127189 Select next/all ocurrence fails with braces
304a69b: IDEA-103025, EA-53787 fix handling of special fonts in soft wrap model
dd4b761: trait field searching test fixed
7c04faa: Merge remote-tracking branch 'origin/master'
bad2fa8: Fixing env tests
dd23104: memory hogging on javaInjections.xml editing
1bbb89c: go to action: proper text attributes for shortcuts
0057fe3: go to action: don't show duplicate group for intention actions
482084c: go to action: missing bg for option descriptors
590ed4c: disable create instance field inside interface (IDEA-127211)
65d11dd: disable generate test method actions outside class (IDEA-127246)
f69f9fd: leave static modifiers in interface methods (IDEA-127255)
42f50f6: sort items in goto action by matching degree (IDEA-112613)
45915b2: show colored matched fragments in goto action (IDEA-112613)
34b51a1: show progress when status bar is switched off (registry: ide.show.progress.without.status.bar)
cdbb650: null check
d5dada4: disposed check
64c812e: StringPattern: cleanup, add StringPatternTest
7fa1b28: remove unnecessary field and getter from SSR ReplaceCommand
472bf3f: java: decompiler fixes (IDEA-127229 et al.)
7ada79c: AnnotationUtil.isInferredAnnotation
c0d76a2: parameter info: don't retrieve inferred annotations in dumb mode
4df5903: IDEA-127127 charset name completion: provide completion for more APIs
b6ea24b: don't duplicate annotations in parameter info
3f7935a: dfa: turn on contract inference from source
b6b76b7: IDEA-127212 Live templates "Use static import if possible" fails sometimes
f372b95: corrected 'isCommunity' check
08b3c7f: disable table speed search for empty tables
51292ab: Merge branch 'svn_18_3'
511f071: IDEA-126911 Do not call "VirtualFile.getFileType()" for directories (while checking if annotate action is enabled)
93e45b9: PY-4073 Add completion for special function attributes
0a5bfb0: Merge remote-tracking branch 'origin/master'
0fcfb36: Merge remote-tracking branch 'origin/master'
86b7bf5: Fix copying .egg files from remote host to libraries folder (PY-13044).
912c0d7: html editor as a error pane
55b4064: do not modify profile file to write default
102bcb2: structural search bundles fixed
bb0b50c: Merge remote-tracking branch 'origin/master'
5253ba2: type migration: make part of platform
3ab8864: Error pane initial
581cf80: structural search: groovy should work in community
76726e8: disposed check
be28458: css synchronizer — support of manual update
7b29836: structural search: make part of platform: enable in community
a5061f3: fix module locations
a3626d6: Merge remote-tracking branch 'origin/master'
695682b: structural search: make part of platform
50e27ec: enable inline redundant local vars in batch mode (IDEA-126957)
49b9f30: EA-58014 (diagnostic)
9d32e98: added incompatible plugin version org.intellij.clojure / 0.2.1.178
c27d829: - properly retrieve set of keys for unsaved documents for their first change - (in extra sanity checks mode) added PHM that stores previous content indexing info to facilitate discovery / fixing assertions about different indexing behavior
0896a25: avoid accessing invalid buffer
159f3c5: Merge remote-tracking branch 'origin/master'
4cc0d5e: IDEA-127183 Windows: Look for 1.8 JVM registry entry by default
f41f9c3: Debugger reader performance fixed, now uses BaseOutpuReader (PY-11393).
cb2159e: Switch on new Alt processing under Windows L&F.
ef8fbc4: notnull
e1445e6: Gradle: IDEA-127217 Tests with spaces aren't wrapped with " " when running specific test as Gradle test
cf1f8c8: fix tests: improved 'isInCommunity' check
bcb38e5: pep8.py updated to version 1.5.7
0970549: Coverage.py updated to version 3.7.1
90f034d: Merge remote-tracking branch 'origin/master'
6ec557a: Try even more to connect.
69a2a4c: path completion: rendering fixed for several matched context helpers
21efa65: cleanup
7494ef6: support for multiple groups in idea.test.group property
00847ed: No need to register MessageBusConnection disposal: it is done automatically
0fb6eab: Suppress "unused" constructor: initialized as a Service
2b6b549: Fix already disposed EA-58257
fc46e99: look for JVM 1.8 first
b7cea46: added caching + minor size opts
63453c3: fix NPE in SSR ReplaceOptions
941c20b: stop usage search on target invalidation (EA-54329)
d75a12f: invalid type diagnostics (EA-58069)
121084a: remove specific Lookup check in intentions pass, daemon is disabled during lookup anyway (EA-58246)
71fd543: WEB-9954 move and rename confusing "Live Edit menu item
5d745b1: check for null for content hashes flush
7073116: fix ConcurrentMapsTest (by Roman)
6d6d15a: IDEA-122254 ("Use static import if possible" checkbox for the Structural Replace dialog)
4febd80: intention should insert static import when replacing assertNull() with assertEquals()
4dd5b62: insert static import when replacing assertEquals() with intention
591d723: insert static import when flipping assert literal outside of test method
90f2ef5: use static import if it is already present for several intentions and inspections
dd2d141: Merge remote-tracking branch 'origin/master'
ae714aa: Win tests should be more stable now
3b3fee8: clear zip file caches on low memory
c81ebf5: Refactoring: create instances of IdeConfigurablesGroup and ProjectConfigurablesGroup in one place.
b83f901: Merge remote-tracking branch 'origin/master'
9c13559: Comment.
ec56a95: skip leading .* in reg exp used for todo pattern when building index: it makes sense for todo highlighting but increases matching due to backtracking enormously (IDEA-74104)
d83e334: IDEA-126836 Formatting adds extra blank line after class header if it ends with comment
6d68662: use 1px separators
e360f62: add utility method to configure 1px separator
23ba8f8: use encoding info when building hash for contents + rebuild content dependent indices upon encoding change
7b8cc6c: Fixed according to CR-IC-5706
93d37fa: don't auto-import classes where class references are prohibited syntactically (IDEA-127190)
f87e56d: bytecode analysis: a comment about lite control flow analysis
90addcd: bytecode analysis: lazy resultOrigins analysis
a7c1c1a: bytecode analysis: lite control flow analysis
8211223: bytecode analysis: no analysis at all if nothing is inferrable
60a6acf: moved method from moduleutils to modulerootmodificationutils
3173594: jetbrains.dic + "unmerged"
c95ca18: support prefix expressions in quick evaluate
8d71285: cleanup
e418bb2: use UIUtil.getSidePanelColor()
bef8a7f: remove border for content component
1835567: + side panel color
105b9a1: @Nullable
ef2875d: IDEA-126927 - CloudFoundry: if the same artifact is deployed to few clouds, one can view the state of the single one only
7c415ca: IDEA-127069 help button added to the Mercurial Update Project dialog
0e12675: Revert "StringUtil: Added wordWrapString() method"
5af9e9f: separator titles for Darcula
b044185: better IDE responsiveness during bytecode indexing
15ed602: svn: Fixed converting SVNStatusType to StatusType - explicitly check values that have non-unique status type names
43b6e08: BytecodeAnalysisIntegrationTest: a more profound test data refresh
525a896: Merge branch 'master' of git+ssh://git.labs.intellij.net/idea/community
fe15e86: bytecode analysis: index version increment
0d24afe: disabled batch evaluator by default, overhead is too high. Enable if needed using registry key debugger.batch.evaluation
0069112: added nontull
062254d: svn: Refactored SvnStatusHandler - moved status type parsing to StatusType class
a884c1b: ignore inferred annotations when checking overriding parameters nullability
b6b6ea1: bytecode analysis: lite persistent hashCode for Configuration
1f05788: bytecode analysis: skipping frames and debug instructions
aa3b189: svn: Refactored StatusType - removed deprecated STATUS_MERGED value
f2d0988: do not capitalize titles
5ba1390: extract CachingEnumerator from PersistentStringEnumerator
1cd8961: IDEA-126973 IDE does not see the use of string resources in libraries
bb0b856: @NotNull
b700084: nullable/notnull/contract intentions available on library sources in Groovy
18afce3: external/inferred annotation gutter markers in Groovy
18dcabb: [vcs] assert annotationProvider != null (otherwise the action shouldn't be enabled)
ff89749: [vcs] Handle all exceptions during annotation similarly. EA-58021
45cd16b: svn: Refactored SvnVcs.svnStatusIs() - method moved to Status class
37423bb: StringUtil: Added wordWrapString() method
228a7f0: IDEA-127144 (No word wrap or horizontal scrolling for ignore list in Proxy dialog)
a570ab1: SSR: remove unused code from replace options
e19e11f: SSR replace handler cleanup
ab42788: IDEA-125021 Improve multi-caret copy-paste logic
8662259: IDEA-127125 Throwable at com.intellij.debugger.ui.breakpoints.BreakpointWithHighlighter.reload
7c0fcae: fixed Breakpoints tests
be3789a: do not calculate source position twice
a22e159: Disable css emmet fuzzy search by default
687fa76: no need for findClass if we have object already
86d795a: ElementPatternCondition: less memory
7801b62: ObjectPattern.oneOf(T...): less memory for single value
394b9f4: GPUB: keyword completion on non-trivial offsets
d9d79ac: resource bundle editor property rename fixed: no property with old invalid name creation after rename
233bdf9: svn: Replaced SVNStatusType (from SVNKit) with custom StatusType enum
5803898: action popups are broken if new project settings dialog option is on
1b4fef2: svn: Replaced SVNEventAction (from SVNKit) with custom EventAction enum
cbcc65f: more robust lookup start offset invalidation tracking (EA-51961 etc)
4703c93: IDEA-75885 Fast invoking shortcut with Alt brings focus to main menu [Windows] IDEA-87408 Hold <ALT> button and select multiple lines vertically does not work as desired
19eb679: Add diagnostic info
40acdf7: License dialog: provide precise diagnostic for rejected key (IDEA-122894, IDEA-125916, IDEA-125917, IDEA-125921)
e28ee1b: display inferred annotations in italic
fe21a09: IDEA-81781 Unintuitive 'Project Files Changed' message box
78b8b2c: Fix emmet tests
b363ad7: notnull
ac8bf17: added comment
d61930f: revert 43b0575239264eef2d4a5299b48f3d2119d8d380
3674c5e: PY-13140 Fix several minor issues found during code review
99058ce: TableView: update only visible column sizes
4a8c1f7: fix BytecodeAnalysisTest?
6563b56: fix BytecodeAnalysisTest?
f6c970f: IDEA-126896 Gradle: Grails integration buildPlugins issues
1ee9d0e: ModuleWithDependentsScope, another minor post-review cleanup
1478698: Fast groovy tests: exclude external system integration tests from FastGroovyTestSuite (e.g. GrailsGradleImportingTest)
43b0575: IDEA-126836 Formatting adds extra blank line after class header if it ends with comment
abcc172: IDEA-127062 Bug when closing splitted editors
ee204e9: IDEA-127045 Unexpected 'step over' behaviour in debugger
a2fb7f6: DBE-60 Windows Authentication for SQL Server
79fc7d2: processing vcs changed text only if we are not processing selected one
0f34d80: Add diagnostic info
f506a15: PY-13140 Underscored names are completed inside import statement
e0ddef7: PY-13140 Top-level module names starting with underscore are not imported via wildcard import
b6eee00: fix PushedFilePropertiesUpdater registration
b9e4b83: BytecodeAnalysisIndex is only in idea
4dfa351: BytecodeAnalysisConverter is only in idea
cb79e2e: if editor has selection, reformat only selected lines, when reformat dialog is not shown. Do not take into account processChangedText flag
76ed9f7: Merge branch 'master' of git.labs.intellij.net:idea/community
c3c78c5: IDEA-93948 Code Style->XML->Other: no preview text for CDATA
d08111d: XML Colors settings: fix description text (missing line breaks)
34dcb63: SSR: remove unnecessary class
472994b: remove some dead code from SSR search dialog
fca4af3: more efficient shortening of class references in SSR
560fb1c: fix not-null assertion
e13715a: fix NPE
9665337: javascript-psi-impl shouldn't depend on lang-impl
2a91d19: fixed XBreakpointManager.testSerialize
f698722: ModuleWithDependentsScope minor post-review cleanup
9d399a3: WEB-12568 Dart autocomplete deletes closing bracket
95673d1: don't use getPackage to check if PSI directory is in source (SCL-7243)
fbbb221: bytecode analysis: copying to prevent indices/enumerators issues
831ab18: bytecode analysis: compound keys - maximizing shared stuff
0ddd915: enable inference bytecode indexing only in internal & test mode
ee888c2: fix AnnotateMethodTest
e0861b8: bytecode analysis: leaking parameters analysis
31d93dc: ProjectBytecodeAnalysis -> service
fbb2825: ignore inferred annotation in @NotNull propagation to overridden methods
1b75318: adapt testdata to inferred jdk annotations
f350b3d: hold inferred @NotNull annotation on a hold reference to avoid UsageViewTest failures
0e53e62: bytecode analysis: assume that errors are due to incorrect bytecode
affe6e0: log bytecode analysis related information with debug level
a11744c: adapt dfa testAlexBug to jdk notnull inference
f98006e: ProjectBytecodeAnalysis: use tree hierarchy to find parameter's declaring method
bfbc9e0: limiting number of elementary steps of bytecode analysis to 30000
8eee4f3: import fix
261018e: logging AnalyzerException
ce0e838: bytecode analysis: increase IDE responsiveness during large class file analysis (e.g. groovy's ArrayUtil)
3357716: bytecode analysis: use separate keys for each file to avoid O(n^2) index removeAssociatedValue
7fc5d9e: make BytecodeAnalysisTest more classloader-agnostic
bd2ebf1: cache enumerator data, remove unnecessary enumerator queries
14ed555: do postponed formatting in JavaChainLookupElement (EA-56040)
ce64501: no contract annotation if method is already @NotNull
1754869: findInferredAnnotations returns @NotNull array
3b75ca1: refresh annotations dir during setUp
6dd49cb: update annotations after mockJDK update
c5f3f23: hashCode via ordinal, copying equations into solver
90e6e0d: myAnnotations are volatile
08811b0: more logging
1e54e26: simple smoke test that inferred annotations are visible to codeInspection
0db25e9: arrays and primitive collections
658b710: aligned with faba
b993ee5: NPE fix (possible dead bytecode instructions)
8de3dfd: using TIntObjectHashMap in analysis (instead of wrappers)
0ea01ef: minimal structures for inferred annotations in memory
861fbc7: reload inferred annotations on root change
92e2f07: checking enumerators during converter initialization
338481d: Bytecode analysis tests
75eb3cb: straightforward solver
7056873: rigid infinum
6220d1a: porting faba features
ecce111: Contract clauses normalization (sorted)
cd2946b: Tuning null -> ... analysis
82e7fd8: Parameters: CNPE join CYCLE = CYCLE
ade7530: stable calls (ported from faba)
657b7af: starting integrations tests
70cc7af: qname may be null (anonymous classes)
f2e3270: smart propagation (resultOrigins analysis)
05486ff: separate indices
eb58968: a proper disposal of app component in the test
1901b35: this is NotNullValue
f8a153e: equals/hashCode for index values
6dcf377: comments + refactoring
383752b: compound indices in action
ff84337: initial implementation for compound keys
d905c85: towards compound keys
68ef299: Refactoring: moving class processing into DataIndexer
c8e0bef: towards compound ids
bacb5f5: extracting converter
655e0ba: poc implementation via indices
eac23b5: indexing
dabdf64: towards indexing
10fda95: emulating touch via special value
e1fce3d: No need for components (with touched flag) in raw equations
44ea307: testing contract annotations
a8717a4: testing hand-coded classes
fb6ce34: Start test for BytecodeAnalysis
8ec604c: using (naively yet) solutions of IntIdSolver in Idea
fc86f2b: full cycle of solving (not tested yet)
1d2c7d5: in progress: internalizing equations
c31fd4a: No need for signatures
41d2da1: poc usage of enumerators
073012d: inferred annotations in gutter
8c57905: Draft implementation of inferring Nullity and Contract annotations
dca785b: stub for inferred annotations
d83c897: @notnull
aeb0b27: allow / skip build attempt number e.g. IU-135.455.10 (IDEA-122579)
604ec3a: Add workaround for CertificateManager *service* to work with old task connectors
b96c582: Rename classes related to legacy JIRA interface to not cause confusion anymore
165465c: IDEA-123972 Display JIRA version under JQL editor field in settings
6708af2: Use simpler test API for performing actions
eb009fc: introduced expandNodesOnLoad in XDebuggerTree
1c3cefb: nice diagnostics for failed assertion about same indexing result from the same content
6b75304: IDEA-127042 Create tip of the day for quick evaluate
b8d6082: add to watches with control+enter from evaluate dialog
86d958c: for nonntrivial file systems (e.g. in tests): build todo data flag should have the same value as todoindex.isAcceptable (cherry picked from commit 5213e01)
962d04b: svn: Refactored SyntheticWorker - reused default DirectoryEntry comparison for sorting
99e9710: IDEA-107376 Goto next / previous splitter not working when show tabs are set to none (Carlos Ortiz)
0ce61f1: notnull
a0f6b0a: svn: Refactored "checking node kind" logic - use utility methods (instead of direct comparison with NodeKind enum values)
2b5e1c1: update breakpoints and execution line highlighters on color scheme change
69be4e2: svn: Refactored RepositoryBrowserDialog - removed duplication and simplified "set action enabled" logic
e438d20: Merge remote-tracking branch 'origin/master'
1cc9650: IDEA-122894 License dialog: License key: provide precise diagnostic for rejected key (cherry picked from commit ff0eada) (cherry picked from commit 29c98ba)
9241cae: Merge remote-tracking branch 'origin/master'
7d896bb: provide completion variants for Charset.forName() in Groovy (IDEA-126595)
e62b6df: IDEA-126973 IDE does not see the use of string resources in libraries
02e5ede: updated javadoc for exit and restart actions
e1d0804: WEB-12677 Emmet: do not expand too long abbreviations
6046586: Emmet: preview editor should have maximum width if softwraps are enabled
be20e87: DOC-3246 IDEA: Update master password dialog panels help
ca5260d: IDEA-79083 Popup lists are sometimes not clickable
8a05f8e: Merge remote-tracking branch 'origin/master'
be76dc1: highlight matches in plugins table
fcd53e5: save search query as a client property
fd6b2c9: add a client property key for search query
febbd75: fix inspection setting
e119956: svn: Simplified node kind values parsing - parse right to NodeKind enum (using jaxb annotations)
6979d52: do not let transient iterator escape as it references nonsharable thread locals
746de0c: diff: fix example in diff editor color settings
3eebc8b: show different icons for muted enabled/disabled breakpoints
1b1a23a: IDEA-120465 Code completion: no Autopopup code completion and inserting pair brackets if Column selection mode is on
9dde9e3: svn: Replaced SVNNodeKind (from SVNKit) with custom NodeKind enum
ed3bf70: split 'force' flag into two different ones: 'force' and 'exitConfirmed', so that now 'force==true' guarantees application shutdown; (fixes also IDEA-127009)
756bc03: performance optimization (following IDEA-CR-337)
7a94893: change storage format for smart backspace configuration (following review CR-IC-5570)
8feafdf: Updated tests due to changes in interface of CommentByLineCommentAction
5d8aeec: IDEA-127074 Executing gradle script fails with error '.../build.gradle' is not a directory
546e0ba: IDEA-88643 delete item from list of breakpoints by pressing delete key: selection should not return to position 1.
4de85a6: IDEA-122513 Can't expand single character property in Spring config
2595051: fix blinking test
51305d0: fix test (following IDEA-124928)
51c9f4a: IDEA-121060 Multiple carets: comment/uncomment works incorrectly
0ddcf6e: IDEA-121060 Multiple carets: comment/uncomment works incorrectly
d51dd50: IDEA-121060 Multiple carets: comment/uncomment works incorrectly
9307f63: svn: Save selected depth for update/integrate operations in configuration
0e44683: svn: Refactored DepthCombo - use custom renderer to display presentable depth labels (instead of separate DepthWithName class)
c20bfe7: svn: Replaced SVNDepth (from SVNKit) with custom Depth enum
0e8564a: Merge remote-tracking branch 'origin/master'
c3e78ad: Add read action.
54474d0: TestDataGuessByExistingFilesUtil: prevent thread starvation and use processor to avoid several huge String collections in the memory (IDEA-127038)
02c1b76: svn: Utilized CommitInfo when parsing "svn list" output and for DirectoryEntry implementation
ac00218: svn: Unified "lock" information parsing for info, status and browse clients (utilized Lock class for all cases)
3ea1e9e: Merge remote-tracking branch 'origin/master'
61c9bc4: highlight matches in selected search result
e3fd6eb: don't add a newline when completing with smart enter shortcut (IDEA-126726)
4029019: EA-57959 - ISE: DomInvocationHandler.getAttributeChild diagnostics
e3c7a70: don't require PerformanceWatcher unresponsiveness threshold to be divisible by unresponsiveness interval (IDEA-127038)
02b931c: diff: fix NPE
dc4f600: Merge remote-tracking branch 'origin/master'
bcc88e8: svn: Replaced SVNLock (from SVNKit) with custom Lock class
f21bc13: svn: Replaced SVNDirEntry (from SVNKit) with custom DirectoryEntry class
8434e55: svn: Fixed NPE in SvnKitBrowseClient (SVNLogClient.doList() logic) - use SVNRevision.UNDEFINED if null is passed
e6f257f: Added multi-associations in win (un)installer with the controls on the option page.
6eb7f53: svn: Replaced ISVNAnnotateHandler (from SVNKit) with custom AnnotationConsumer class
535cb8c: svn: Refactored SvnRemoteFileAnnotation - removed unused fields
56cd6a8: svn: Refactored BaseSvnFileAnnotation - utilized CommitInfo for implementation logic
6916bac: svn: Refactored BaseSvnFileAnnotation - code simplified, duplication and unused code removed, warnings fixed
79f167e: svn: Utilized CommitInfo when parsing "svn annotate" output
5585db2: svn: Replaced SVNCommitInfo (from SVNKit) with custom CommitInfo class
3b0971e: svn: Replaced SVNDiffOptions (from SVNKit) with custom DiffOptions class
58ab1b9: svn: Replaced SVNConflictVersion (from SVNKit) with custom ConflictVersion class
d287078: svn: Fixed "memory leak" error (on application close) after viewing merge source hierarchy details - correctly register dialogs for disposal
ef3bc87: svn: Refactored TreeStructureNode - made not to be generic, renamed
ff2698d: svn: Unified LogEntry and LogEntryPath with corresponding similar classes used for svn executable xml output parsing
00224be: svn: Replaced SVNLogEntryPath (from SVNKit) with custom LogEntryPath class
6a330b5: svn: Replaced SVNLogEntry (from SVNKit) with custom LogEntry class
615f0cb: svn: Refactored parsing of child xml elements collections - use @XmlElementWrapper (instead of intermediate classes)
5ac00c0: svn: Refactored SvnUtil - moved "getPathForProgress" to ProgressEvent
cef6176: svn: Refactored ProgressTracker - removed unused method parameters, make inherit ThrowableConsumer
17cbb94: svn: Replaced SVNEvent (from SVNKit) with custom ProgressEvent class
57e1c41: svn: Preserve several more used fields when converting from SVNStatus to Status
37798c0: svn: Allow @Nullable values when converting SVNKit types to corresponding svn4idea types
ea32a54: IDEA-125627 Added new conflict reason values available in svn 1.8
099870d: svn: Replaced SVNConflictAction, SVNConflictReason, SVNOperation (from SVNKit) with corresponding custom enums
6dc734f: svn: Replaced SVNTreeConflictDescription (from SVNKit) with custom TreeConflictDescription class
57db2a5: svn: Replaced SVNStatus (from SVNKit) with custom Status class
6730240: svn: Replaced SVNInfo (from SVNKit) with custom Info class
b527300: svn: Removed unnecessary IdeaSVNInfo - directly use SVNInfo instead
46fdb20: svn: Refactored UpdateClient - make methods throw SvnBindException (instead of SVNException from SVNKit)
9ccd315: svn: Refactored StatusClient - make methods throw SvnBindException (instead of SVNException from SVNKit)
bb3582d: svn: Refactored RepeatSvnActionThroughBusy - make methods throw VcsException (instead of SVNException from SVNKit)
33b3795: svn: Refactored InfoClient - make methods throw SvnBindException (instead of SVNException from SVNKit)
ab74ce3: svn: Refactored CmdInfoClient - removed duplication, methods extracted/inlined, @NotNull
29f24cf: svn: Refactored CmdInfoClient - inlined "doInfo" methods, removed duplication
17d79f7: svn: Refactored UpdateClient - removed unnecessary methods
19cc497: svn: Refactored StatusClient - removed unnecessary "doStatus" overload method (call replaced with more general overload)
faa09ef: svn: Refactored StatusClient - removed unnecessary methods
b45cfaa: svn: Refactored StatusClient - removed unnecessary "doStatus(File path, boolean remote, boolean collectParentExternals)" overload method (as always invoked with collectParentExternals = false)
ae24d84: svn: Refactored InfoClient - removed unnecessary methods
2e97768: svn: Added some todo items for working copies of 1.8 and greater formats (cleanup, nested working copies file status refresh)
7874cb3: svn: Refactored SvnCheckoutProvider - removed unused parameters, @NotNull
22b2900: svn: Refactored SvnCheckinHandlerFactory - code simplifications, warnings fixes
1ce0847: IDEA-118540 Refactored "committing changes to same repository but from working copies of different formats" detection logic, updated confirmation message
491ac7d: svn: Updated working copy format checks to be "weaker" - to correctly support working copies with greater than svn 1.8 formats
Change-Id: I25f808eb8c86e4bd21610b40ab6b6df310d8e636
diff --git a/.idea/libraries/Eclipse.xml b/.idea/libraries/Eclipse.xml
index 0e496f8..dc3840d 100644
--- a/.idea/libraries/Eclipse.xml
+++ b/.idea/libraries/Eclipse.xml
@@ -1,11 +1,11 @@
<component name="libraryTable">
<library name="Eclipse">
<CLASSES>
- <root url="jar://$PROJECT_DIR$/lib/ecj-4.3.2.jar!/" />
+ <root url="jar://$PROJECT_DIR$/lib/ecj-4.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$PROJECT_DIR$/lib/src/ecjsrc-4.3.2.jar!/" />
+ <root url="jar://$PROJECT_DIR$/lib/src/ecjsrc-4.4.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
diff --git a/.idea/libraries/JavaHelp.xml b/.idea/libraries/JavaHelp.xml
index 458f035..0f5e243 100644
--- a/.idea/libraries/JavaHelp.xml
+++ b/.idea/libraries/JavaHelp.xml
@@ -5,7 +5,7 @@
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$PROJECT_DIR$/lib/src/jhsrc.jar!/src" />
+ <root url="jar://$PROJECT_DIR$/lib/src/jhsrc.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index e0ee0e9..ca7b52d 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -166,10 +166,10 @@
<module fileurl="file://$PROJECT_DIR$/platform/smRunner/smRunner.iml" filepath="$PROJECT_DIR$/platform/smRunner/smRunner.iml" group="platform" />
<module fileurl="file://$PROJECT_DIR$/plugins/cvs/smartcvs-src/smartcvs-src.iml" filepath="$PROJECT_DIR$/plugins/cvs/smartcvs-src/smartcvs-src.iml" group="plugins/VCS/cvs" />
<module fileurl="file://$PROJECT_DIR$/spellchecker/spellchecker.iml" filepath="$PROJECT_DIR$/spellchecker/spellchecker.iml" group="plugins" />
- <module fileurl="file://$PROJECT_DIR$/plugins/structuralsearch/structuralsearch.iml" filepath="$PROJECT_DIR$/plugins/structuralsearch/structuralsearch.iml" />
- <module fileurl="file://$PROJECT_DIR$/plugins/structuralsearch/structuralsearch-java/structuralsearch-java.iml" filepath="$PROJECT_DIR$/plugins/structuralsearch/structuralsearch-java/structuralsearch-java.iml" />
+ <module fileurl="file://$PROJECT_DIR$/platform/structuralsearch/structuralsearch.iml" filepath="$PROJECT_DIR$/platform/structuralsearch/structuralsearch.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/groovy/structuralsearch-groovy/structuralsearch-groovy.iml" filepath="$PROJECT_DIR$/plugins/groovy/structuralsearch-groovy/structuralsearch-groovy.iml" />
- <module fileurl="file://$PROJECT_DIR$/plugins/structuralsearch/structuralsearch-tests.iml" filepath="$PROJECT_DIR$/plugins/structuralsearch/structuralsearch-tests.iml" />
+ <module fileurl="file://$PROJECT_DIR$/java/structuralsearch-java/structuralsearch-java.iml" filepath="$PROJECT_DIR$/java/structuralsearch-java/structuralsearch-java.iml" />
+ <module fileurl="file://$PROJECT_DIR$/platform/structuralsearch/structuralsearch-tests.iml" filepath="$PROJECT_DIR$/platform/structuralsearch/structuralsearch-tests.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/structure-view-api/structure-view-api.iml" filepath="$PROJECT_DIR$/platform/structure-view-api/structure-view-api.iml" group="platform" />
<module fileurl="file://$PROJECT_DIR$/platform/structure-view-impl/structure-view-impl.iml" filepath="$PROJECT_DIR$/platform/structure-view-impl/structure-view-impl.iml" group="platform" />
<module fileurl="file://$PROJECT_DIR$/plugins/svn4idea/svn4idea.iml" filepath="$PROJECT_DIR$/plugins/svn4idea/svn4idea.iml" group="plugins/VCS" />
@@ -185,7 +185,7 @@
<module fileurl="file://$PROJECT_DIR$/plugins/testng/testng.iml" filepath="$PROJECT_DIR$/plugins/testng/testng.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/testng_rt/testng_rt.iml" filepath="$PROJECT_DIR$/plugins/testng_rt/testng_rt.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/platform/testFramework/bootstrap/tests_bootstrap.iml" filepath="$PROJECT_DIR$/platform/testFramework/bootstrap/tests_bootstrap.iml" group="platform" />
- <module fileurl="file://$PROJECT_DIR$/plugins/typeMigration/typeMigration.iml" filepath="$PROJECT_DIR$/plugins/typeMigration/typeMigration.iml" />
+ <module fileurl="file://$PROJECT_DIR$/java/typeMigration/typeMigration.iml" filepath="$PROJECT_DIR$/java/typeMigration/typeMigration.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/ui-designer/ui-designer.iml" filepath="$PROJECT_DIR$/plugins/ui-designer/ui-designer.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/ui-designer-core/ui-designer-core.iml" filepath="$PROJECT_DIR$/plugins/ui-designer-core/ui-designer-core.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/ui-designer/jps-plugin/ui-designer-jps-plugin.iml" filepath="$PROJECT_DIR$/plugins/ui-designer/jps-plugin/ui-designer-jps-plugin.iml" group="plugins" />
diff --git a/bin/WinLauncher/WinLauncher.exe b/bin/WinLauncher/WinLauncher.exe
index 3a08556..66b04fa 100644
--- a/bin/WinLauncher/WinLauncher.exe
+++ b/bin/WinLauncher/WinLauncher.exe
Binary files differ
diff --git a/bin/WinLauncher/WinLauncher64.exe b/bin/WinLauncher/WinLauncher64.exe
index 1daf83c..12a1852 100644
--- a/bin/WinLauncher/WinLauncher64.exe
+++ b/bin/WinLauncher/WinLauncher64.exe
Binary files differ
diff --git a/bin/mac/printenv.py b/bin/mac/printenv.py
index 4d81c1f..64b1d47 100755
--- a/bin/mac/printenv.py
+++ b/bin/mac/printenv.py
@@ -9,6 +9,9 @@
if len(sys.argv) != 2:
raise Error('Exactly one argument expected')
-with open(sys.argv[1], 'w') as f:
+f = open(sys.argv[1], 'w')
+try:
for key, value in os.environ.items():
f.writelines([key, '=', value, '\0'])
+finally:
+ f.close()
diff --git a/bin/win/fsnotifier.exe b/bin/win/fsnotifier.exe
index a545257..7a6118a 100644
--- a/bin/win/fsnotifier.exe
+++ b/bin/win/fsnotifier.exe
Binary files differ
diff --git a/build/conf/nsis/desktop.ini b/build/conf/nsis/desktop.ini
index 478a081..8f590b7 100644
--- a/build/conf/nsis/desktop.ini
+++ b/build/conf/nsis/desktop.ini
@@ -4,23 +4,71 @@
[Field 1]
Type=checkbox
Left=5
-Right=-1
+Right=100
Top=10
Bottom=20
State=0
[Field 2]
Type=checkbox
-Left=5
+Left=120
Right=-1
-Top=25
-Bottom=35
-State=1
+Top=10
+Bottom=20
+State=0
-;[Field 3]
-;Type=checkbox
-;Left=5
-;Right=-1
-;Top=40
-;Bottom=50
-;State=1
\ No newline at end of file
+[Field 3]
+Type=GroupBox
+Left=1
+Right=-1
+Top=35
+Bottom=65
+Text=Create Associations
+
+[Field 4]
+Type=checkbox
+Left=5
+Right=45
+Top=50
+Bottom=60
+State=0
+
+[Field 5]
+Type=checkbox
+Left=50
+Right=90
+Top=50
+Bottom=60
+State=0
+
+[Field 6]
+Type=checkbox
+Left=95
+Right=135
+Top=50
+Bottom=60
+State=0
+
+[Field 7]
+Type=checkbox
+Left=140
+Right=180
+Top=50
+Bottom=60
+State=0
+
+[Field 8]
+Type=checkbox
+Left=185
+Right=225
+Top=50
+Bottom=60
+State=0
+
+[Field 9]
+Type=checkbox
+Left=230
+Right=270
+Top=50
+Bottom=60
+State=0
\ No newline at end of file
diff --git a/build/conf/nsis/idea.nsi b/build/conf/nsis/idea.nsi
index 145d61d..5f31dc3c 100644
--- a/build/conf/nsis/idea.nsi
+++ b/build/conf/nsis/idea.nsi
@@ -12,6 +12,7 @@
; thus ${PRODUCT_WITH_VER} is used for uninstall registry information
!define PRODUCT_REG_VER "${MUI_PRODUCT}\${VER_BUILD}"
+!define INSTALL_OPTION_ELEMENTS 4
Name "${MUI_PRODUCT}"
SetCompressor lzma
; http://nsis.sourceforge.net/Shortcuts_removal_fails_on_Windows_Vista
@@ -25,6 +26,8 @@
!include UAC.nsh
!include "InstallOptions.nsh"
!include StrFunc.nsh
+!include LogicLib.nsh
+
${UnStrStr}
${UnStrLoc}
${UnStrRep}
@@ -97,6 +100,57 @@
StrCpy $9 "Modified"
complete:
FunctionEnd
+
+Function ${un}SplitStr
+Exch $0 ; str
+Push $1 ; inQ
+Push $3 ; idx
+Push $4 ; tmp
+StrCpy $1 0
+StrCpy $3 0
+loop:
+ StrCpy $4 $0 1 $3
+ ${If} $4 == '"'
+ ${If} $1 <> 0
+ StrCpy $0 $0 "" 1
+ IntOp $3 $3 - 1
+ ${EndIf}
+ IntOp $1 $1 !
+ ${EndIf}
+ ${If} $4 == '' ; The end?
+ StrCpy $1 0
+ StrCpy $4 ','
+ ${EndIf}
+ ${If} $4 == ','
+ ${AndIf} $1 = 0
+ StrCpy $4 $0 $3
+ StrCpy $1 $4 "" -1
+ ${IfThen} $1 == '"' ${|} StrCpy $4 $4 -1 ${|}
+ killspace:
+ IntOp $3 $3 + 1
+ StrCpy $0 $0 "" $3
+ StrCpy $1 $0 1
+ StrCpy $3 0
+ StrCmp $1 ',' killspace
+ Push $0 ; Remaining
+ Exch 4
+ Pop $0
+ StrCmp $4 "" 0 moreleft
+ Pop $4
+ Pop $3
+ Pop $1
+ Return
+ moreleft:
+ Exch $4
+ Exch 2
+ Pop $1
+ Pop $3
+ Return
+ ${EndIf}
+ IntOp $3 $3 + 1
+ Goto loop
+FunctionEnd
+
!macroend
!insertmacro INST_UNINST_SWITCH ""
!insertmacro INST_UNINST_SWITCH "un."
@@ -686,6 +740,23 @@
FunctionEnd
+Function DoAssociation
+ ; back up old value of an association
+ ReadRegStr $1 HKCR $R4 ""
+ StrCmp $1 "" skip_backup
+ StrCmp $1 ${PRODUCT_PATHS_SELECTOR} skip_backup
+ WriteRegStr HKCR $R4 "backup_val" $1
+skip_backup:
+ WriteRegStr HKCR $R4 "" "${PRODUCT_PATHS_SELECTOR}"
+ ReadRegStr $0 HKCR ${PRODUCT_PATHS_SELECTOR} ""
+ StrCmp $0 "" 0 command_exists
+ WriteRegStr HKCR ${PRODUCT_PATHS_SELECTOR} "" "${PRODUCT_FULL_NAME}"
+ WriteRegStr HKCR "${PRODUCT_PATHS_SELECTOR}\shell" "" "open"
+ WriteRegStr HKCR "${PRODUCT_PATHS_SELECTOR}\DefaultIcon" "" "$INSTDIR\bin\${PRODUCT_EXE_FILE},0"
+command_exists:
+ WriteRegStr HKCR "${PRODUCT_PATHS_SELECTOR}\shell\open\command" "" \
+ '$INSTDIR\bin\${PRODUCT_EXE_FILE} "%1"'
+FunctionEnd
;------------------------------------------------------------------------------
; Installer sections
@@ -716,6 +787,20 @@
${EndIf}
skip_quicklaunch_shortcut:
+ !insertmacro INSTALLOPTIONS_READ $R1 "Desktop.ini" "Settings" "NumFields"
+ IntCmp $R1 ${INSTALL_OPTION_ELEMENTS} do_association done do_association
+do_association:
+ StrCpy $R2 ${INSTALL_OPTION_ELEMENTS}
+get_user_choice:
+ !insertmacro INSTALLOPTIONS_READ $R3 "Desktop.ini" "Field $R2" "State"
+ StrCmp $R3 1 "" next_association
+ !insertmacro INSTALLOPTIONS_READ $R4 "Desktop.ini" "Field $R2" "Text"
+ call DoAssociation
+next_association:
+ IntOp $R2 $R2 + 1
+ IntCmp $R1 $R2 get_user_choice done get_user_choice
+
+done:
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
; $STARTMENU_FOLDER stores name of IDEA folder in Start Menu,
; save it name in the "MenuFolder" RegValue
@@ -754,27 +839,6 @@
skip_ipr:
-StrCmp "${ASSOCIATION}" "NoAssociation" skip_association
- ; back up old value of an association
- ReadRegStr $1 HKCR ${ASSOCIATION} ""
- StrCmp $1 "" skip_backup
- StrCmp $1 ${PRODUCT_PATHS_SELECTOR} skip_backup
- WriteRegStr HKCR ${ASSOCIATION} "backup_val" $1
-skip_backup:
- WriteRegStr HKCR ${ASSOCIATION} "" "${PRODUCT_PATHS_SELECTOR}"
- ReadRegStr $0 HKCR ${PRODUCT_PATHS_SELECTOR} ""
- StrCmp $0 "" 0 command_exists
- WriteRegStr HKCR ${PRODUCT_PATHS_SELECTOR} "" "${PRODUCT_FULL_NAME}"
- WriteRegStr HKCR "${PRODUCT_PATHS_SELECTOR}\shell" "" "open"
- WriteRegStr HKCR "${PRODUCT_PATHS_SELECTOR}\DefaultIcon" "" "$INSTDIR\bin\${PRODUCT_EXE_FILE},0"
-command_exists:
- WriteRegStr HKCR "${PRODUCT_PATHS_SELECTOR}\shell\open\command" "" \
- '$INSTDIR\bin\${PRODUCT_EXE_FILE} "%1"'
-
-skip_association:
- ; Rest of script
-
-
; readonly section
SectionIn RO
!include "idea_win.nsh"
@@ -842,13 +906,28 @@
!insertmacro MUI_HEADER_TEXT "$(installation_options)" "$(installation_options_prompt)"
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 1" "Text" "$(create_desktop_shortcut)"
call winVersion
- ${If} $0 == "1"
- ;do not ask user about creating quick launch under Windows 7
- !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Settings" "NumFields" "1"
- ${Else}
- !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 2" "Text" "$(create_quick_launch_shortcut)"
- ${EndIf}
-; !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 3" "Text" "$(install_for_current_user_only)"
+ !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 2" "Text" "$(create_quick_launch_shortcut)"
+ ${If} $0 == "1"
+ !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 2" "Flags" "DISABLED"
+ ${EndIf}
+ StrCmp "${ASSOCIATION}" "NoAssociation" skip_association
+ StrCpy $R0 3
+ push "${ASSOCIATION}"
+loop:
+ call SplitStr
+ Pop $0
+ StrCmp $0 "" done
+ IntOp $R0 $R0 + 1
+ !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $R0" "Text" "$0"
+ goto loop
+skip_association:
+ StrCpy $R0 2
+ call winVersion
+ ${If} $0 == "1"
+ IntOp $R0 $R0 - 1
+ ${EndIf}
+done:
+ !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Settings" "NumFields" "$R0"
!insertmacro INSTALLOPTIONS_DISPLAY "Desktop.ini"
FunctionEnd
@@ -931,11 +1010,13 @@
;replace Default str with the backup value (if there is the one) and then delete backup
; $1 - key (for example ".java")
; $2 - name (for example "backup_val")
+ Push $0
ReadRegStr $0 HKCR $1 $2
StrCmp $0 "" "noBackup"
WriteRegStr HKCR $1 "" $0
DeleteRegValue HKCR $1 $2
noBackup:
+ Pop $0
FunctionEnd
Function un.OMDeleteRegKeyIfEmpty
@@ -1140,12 +1221,16 @@
Call un.OMDeleteRegValue
StrCmp "${ASSOCIATION}" "NoAssociation" finish_uninstall
- StrCpy $1 "${ASSOCIATION}"
+ push "${ASSOCIATION}"
+loop:
+ call un.SplitStr
+ Pop $0
+ StrCmp $0 "" finish_uninstall
+ StrCpy $1 $0
StrCpy $2 "backup_val"
Call un.ReturnBackupRegValue
-
+ goto loop
finish_uninstall:
-
StrCpy $1 "$5\${PRODUCT_REG_VER}"
StrCpy $2 "Build"
Call un.OMDeleteRegValue
diff --git a/build/gant.xml b/build/gant.xml
index fff2d97..4b56378 100644
--- a/build/gant.xml
+++ b/build/gant.xml
@@ -15,6 +15,12 @@
<fileset dir="${project.home}/build/kotlinc/jps" erroronmissingdir="false">
<include name="*.jar"/>
</fileset>
+ <fileset dir="${project.home}/build/kotlinc/lib" erroronmissingdir="false">
+ <include name="kotlin-runtime.jar"/>
+ </fileset>
+ <fileset dir="${project.home}/build/kotlinc/plugin" erroronmissingdir="false">
+ <include name="kotlin-plugin.jar"/>
+ </fileset>
<fileset dir="${idea.lib}">
<include name="jdom.jar"/>
<include name="log4j.jar"/>
diff --git a/build/lib/jps/jps-builders.jar b/build/lib/jps/jps-builders.jar
index 05c199b..f937e00 100644
--- a/build/lib/jps/jps-builders.jar
+++ b/build/lib/jps/jps-builders.jar
Binary files differ
diff --git a/build/scripts/layouts.gant b/build/scripts/layouts.gant
index a46a70a..870b2c5 100644
--- a/build/scripts/layouts.gant
+++ b/build/scripts/layouts.gant
@@ -80,8 +80,11 @@
"manifest",
"platform-main",
"remote-servers-java-impl",
+ "structuralsearch",
+ "structuralsearch-java",
"testFramework",
"tests_bootstrap",
+ "typeMigration",
"ui-designer-core"
].flatten()
implementationModules.removeAll(jpsCommonModules) //todo[nik] remove jps modules from platformImplementationModules instead and update layouts of minor IDEs accordingly
@@ -256,7 +259,7 @@
}
dir("plugins") {
- def simplePlugins = ["commander", "copyright", "java-i18n", "hg4idea", "github", "typeMigration"] //, "tasks-time-tracking"]
+ def simplePlugins = ["commander", "copyright", "java-i18n", "hg4idea", "github"] //, "tasks-time-tracking"]
simplePlugins.each {
layoutPlugin it
@@ -534,15 +537,6 @@
}
}
- pluginDir("structuralsearch") {
- dir("lib") {
- jar("structuralsearch.jar") {
- module("structuralsearch")
- module("structuralsearch-java")
- }
- }
- }
-
pluginDir("java-decompiler") {
dir("lib") {
jar("java-decompiler.jar") {
diff --git a/build/scripts/utils.gant b/build/scripts/utils.gant
index e0cb06b..d64c75f 100644
--- a/build/scripts/utils.gant
+++ b/build/scripts/utils.gant
@@ -88,7 +88,7 @@
this[key]
}
catch (MissingPropertyException ignored) {
- projectBuilder.error("Property $key is required")
+ projectBuilder.error("Property '$key' is required")
}
}
@@ -97,7 +97,7 @@
this[key]
}
catch (MissingPropertyException ignored) {
- projectBuilder.info("$key is not defined. Defaulting to $defaultValue")
+ projectBuilder.info("'$key' is not defined. Defaulting to '$defaultValue'")
this[key] = defaultValue
}
}
@@ -112,8 +112,9 @@
})
binding.setVariable("guessHome", {
- // Current file is supposed to be at build/scripts/release.gant path
- new File(requireProperty("gant.file").substring("file:".length())).getParentFile().getParentFile().getParent()
+ // current file is supposed to be at build/scripts/*.gant path
+ String uri = requireProperty("gant.file")
+ new File(new URI(uri).getSchemeSpecificPart()).getParentFile().getParentFile().getParent()
})
binding.setVariable("loadProject", {
diff --git a/build/update.cmd b/build/update.cmd
index 74b4995..558db87 100644
--- a/build/update.cmd
+++ b/build/update.cmd
@@ -10,40 +10,40 @@
:: 4. You quit IntelliJ IDEA
IF NOT EXIST "%JAVA_HOME%\bin\java.exe" (
- ECHO JAVA_HOME must be defined and point to a valid Java installaton
+ ECHO JAVA_HOME must be defined and point to a valid Java installation
EXIT
)
IF NOT EXIST "%WORK_IDEA_HOME%\bin\idea.bat" (
- @ECHO WORK_IDEA_HOME must be defined and point to build you're updating
+ ECHO WORK_IDEA_HOME must be defined and point to IDEA installation you wish to update
EXIT
)
IF NOT EXIST "%DEV_IDEA_HOME%\build\update.cmd" (
- @ECHO DEV_IDEA_HOME must be defined and point to source base your're updating from
+ ECHO DEV_IDEA_HOME must be defined and point to a source base you're updating from
EXIT
)
-ECHO Updating %WORK_IDEA_HOME% from compiled classes at %DEV_IDEA_HOME%
+ECHO Updating "%WORK_IDEA_HOME%" from compiled classes at "%DEV_IDEA_HOME%"
-CD %DEV_IDEA_HOME%
+CD "%DEV_IDEA_HOME%"
SET ANT_HOME=%DEV_IDEA_HOME%\lib\ant
-SET EXEC_ANT="%JAVA_HOME%\bin\java.exe" -Dant.home=%ANT_HOME% -classpath "%ANT_HOME%\lib\ant-launcher.jar" org.apache.tools.ant.launch.Launcher
-CALL %EXEC_ANT% -f build/update.xml %*
+SET EXEC_ANT="%JAVA_HOME%\bin\java.exe" -Dant.home="%ANT_HOME%" -classpath "%ANT_HOME%\lib\ant-launcher.jar" org.apache.tools.ant.launch.Launcher
+%EXEC_ANT% -f build/update.xml
IF NOT ERRORLEVEL 0 GOTO failed
+IF NOT EXIST "%DEV_IDEA_HOME%\out\deploy" GOTO failed
-DEL /Q /S %WORK_IDEA_HOME%\lib
-DEL /Q /S %WORK_IDEA_HOME%\plugins
+RMDIR /Q /S "%WORK_IDEA_HOME%\lib"
+RMDIR /Q /S "%WORK_IDEA_HOME%\plugins"
-XCOPY %DEV_IDEA_HOME%\bin\win\*.dll %WORK_IDEA_HOME%\bin\ /Q /E /Y
-XCOPY %DEV_IDEA_HOME%\bin\win\fsnotifier.exe %WORK_IDEA_HOME%\bin\ /Q /E /Y
-XCOPY %DEV_IDEA_HOME%\bin\win\runnerw.exe %WORK_IDEA_HOME%\bin\ /Q /E /Y
-XCOPY %DEV_IDEA_HOME%\out\deploy\*.* %WORK_IDEA_HOME%\ /Q /E /Y
+XCOPY "%DEV_IDEA_HOME%\bin\win\*.dll" "%WORK_IDEA_HOME%\bin\" /Q /E /Y
+XCOPY "%DEV_IDEA_HOME%\bin\win\*.exe" "%WORK_IDEA_HOME%\bin\" /Q /E /Y
+XCOPY "%DEV_IDEA_HOME%\out\deploy\*.*" "%WORK_IDEA_HOME%\" /Q /E /Y
GOTO done
:failed
-ECHO "Update failed; work IDEA build not modified."
+ECHO Update failed; work IDEA build not modified.
:done
-CD /D %WORK_IDEA_HOME%\bin
+CD /D "%WORK_IDEA_HOME%\bin"
diff --git a/community-resources/src/idea_community_about.png b/community-resources/src/idea_community_about.png
index d5e5a35..79fe896 100644
--- a/community-resources/src/idea_community_about.png
+++ b/community-resources/src/idea_community_about.png
Binary files differ
diff --git a/community-resources/src/idea_community_about@2x.png b/community-resources/src/idea_community_about@2x.png
index 72bc8c6..d7ed6b8 100644
--- a/community-resources/src/idea_community_about@2x.png
+++ b/community-resources/src/idea_community_about@2x.png
Binary files differ
diff --git a/community-tests/src/tests/testGroups.properties b/community-tests/src/tests/testGroups.properties
index 8aa1685..a528fa8 100644
--- a/community-tests/src/tests/testGroups.properties
+++ b/community-tests/src/tests/testGroups.properties
@@ -3,6 +3,7 @@
org.jetbrains.idea.svn.*
org.jetbrains.idea.svn16.*
com.intellij.util.net.ssl.*
+com.intellij.tasks.integration.live.*
[DECOMPILER_TESTS]
org.jetbrains.java.decompiler.*
diff --git a/images/src/META-INF/ImagesPlugin.xml b/images/src/META-INF/ImagesPlugin.xml
index 2c234ff..ef62344 100644
--- a/images/src/META-INF/ImagesPlugin.xml
+++ b/images/src/META-INF/ImagesPlugin.xml
@@ -4,7 +4,7 @@
<extensions defaultExtensionNs="com.intellij">
<errorHandler implementation="com.intellij.diagnostic.ITNReporter"/>
- <applicationConfigurable instance="org.intellij.images.options.impl.OptionsConfigurabe" id="Images" displayName="Images"/>
+ <applicationConfigurable groupId="editor" instance="org.intellij.images.options.impl.OptionsConfigurabe" id="Images" displayName="Images"/>
<fileEditorProvider implementation="org.intellij.images.editor.impl.ImageFileEditorProvider"/>
<selectInTarget implementation="org.intellij.images.thumbnail.impl.ThumbnailSelectInTarget"/>
<applicationService serviceInterface="org.intellij.images.options.OptionsManager"
diff --git a/images/src/org/intellij/images/thumbnail/impl/ThumbnailViewUI.java b/images/src/org/intellij/images/thumbnail/impl/ThumbnailViewUI.java
index cef0e6c..83f7679 100644
--- a/images/src/org/intellij/images/thumbnail/impl/ThumbnailViewUI.java
+++ b/images/src/org/intellij/images/thumbnail/impl/ThumbnailViewUI.java
@@ -300,7 +300,7 @@
Project project = thumbnailView.getProject();
if (!project.isDisposed()) {
ProjectRootManager rootManager = ProjectRootManager.getInstance(project);
- boolean projectIgnored = rootManager.getFileIndex().isIgnored(file);
+ boolean projectIgnored = rootManager.getFileIndex().isExcluded(file);
if (!projectIgnored && !FileTypeManager.getInstance().isFileIgnored(file)) {
ImageFileTypeManager typeManager = ImageFileTypeManager.getInstance();
diff --git a/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java b/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java
index 5cb7a24..ceebef6 100644
--- a/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java
+++ b/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java
@@ -309,7 +309,9 @@
}
public void finished(boolean aborted, int errors, int warnings, final CompileContext compileContext) {
- myEventPublisher.compilationFinished(aborted, errors, warnings, compileContext);
+ if (!myProject.isDisposed()) {
+ myEventPublisher.compilationFinished(aborted, errors, warnings, compileContext);
+ }
if (myDelegate != null) {
myDelegate.finished(aborted, errors, warnings, compileContext);
}
diff --git a/java/compiler/impl/src/com/intellij/compiler/ant/GenerateAntApplication.java b/java/compiler/impl/src/com/intellij/compiler/ant/GenerateAntApplication.java
index b8a27b7..5a957a2 100644
--- a/java/compiler/impl/src/com/intellij/compiler/ant/GenerateAntApplication.java
+++ b/java/compiler/impl/src/com/intellij/compiler/ant/GenerateAntApplication.java
@@ -61,7 +61,7 @@
GenerateAntApplication.LOG.error(e);
}
finally {
- application.exit(true);
+ application.exit(true, true);
}
}
});
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java
index 46584ef..406d165 100644
--- a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java
+++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java
@@ -176,17 +176,6 @@
}
}
- private static boolean containsFileIndexScopes(CompileScope scope) {
- if (scope instanceof CompositeScope) {
- for (CompileScope childScope : ((CompositeScope)scope).getScopes()) {
- if (containsFileIndexScopes(childScope)) {
- return true;
- }
- }
- }
- return scope instanceof FileIndexCompileScope;
- }
-
private void doRebuild(CompileStatusNotification callback, CompilerMessage message, final CompileScope compileScope) {
if (validateCompilerConfiguration(compileScope)) {
startup(compileScope, true, false, callback, message);
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/CompilerUtil.java b/java/compiler/impl/src/com/intellij/compiler/impl/CompilerUtil.java
index 9b227da..67bdb52 100644
--- a/java/compiler/impl/src/com/intellij/compiler/impl/CompilerUtil.java
+++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompilerUtil.java
@@ -20,36 +20,24 @@
*/
package com.intellij.compiler.impl;
-import com.intellij.CommonBundle;
-import com.intellij.compiler.CompilerConfiguration;
-import com.intellij.compiler.impl.javaCompiler.ModuleChunk;
-import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.compiler.CompileContext;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.module.Module;
-import com.intellij.openapi.module.ModuleManager;
-import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
-import com.intellij.openapi.roots.ModuleRootManager;
-import com.intellij.openapi.ui.Messages;
-import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.openapi.vfs.LocalFileSystem;
-import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.newvfs.RefreshQueue;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.util.ThrowableRunnable;
-import com.intellij.util.containers.ContainerUtil;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import java.io.File;
-import java.io.FileFilter;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
public class CompilerUtil {
private static final Logger LOG = Logger.getInstance("#com.intellij.compiler.impl.CompilerUtil");
@@ -62,51 +50,6 @@
return path;
}
- public static void collectFiles(Collection<File> container, File rootDir, FileFilter fileFilter) {
- final File[] files = rootDir.listFiles(fileFilter);
- if (files == null) {
- return;
- }
- for (File file : files) {
- if (file.isDirectory()) {
- collectFiles(container, file, fileFilter);
- }
- else {
- container.add(file);
- }
- }
- }
-
- public static Map<Module, List<VirtualFile>> buildModuleToFilesMap(CompileContext context, VirtualFile[] files) {
- return buildModuleToFilesMap(context, Arrays.asList(files));
- }
-
-
- public static Map<Module, List<VirtualFile>> buildModuleToFilesMap(final CompileContext context, final List<VirtualFile> files) {
- //assertion: all files are different
- final Map<Module, List<VirtualFile>> map = new THashMap<Module, List<VirtualFile>>();
- ApplicationManager.getApplication().runReadAction(new Runnable() {
- public void run() {
- for (VirtualFile file : files) {
- final Module module = context.getModuleByFile(file);
-
- if (module == null) {
- continue; // looks like file invalidated
- }
-
- List<VirtualFile> moduleFiles = map.get(module);
- if (moduleFiles == null) {
- moduleFiles = new ArrayList<VirtualFile>();
- map.put(module, moduleFiles);
- }
- moduleFiles.add(file);
- }
- }
- });
- return map;
- }
-
-
/**
* must not be called inside ReadAction
* @param files
@@ -167,58 +110,6 @@
}
}
- public static void addLocaleOptions(final List<String> commandLine, final boolean launcherUsed) {
- // need to specify default encoding so that javac outputs messages in 'correct' language
- //noinspection HardCodedStringLiteral
- commandLine.add((launcherUsed? "-J" : "") + "-D" + CharsetToolkit.FILE_ENCODING_PROPERTY + "=" + CharsetToolkit.getDefaultSystemCharset().name());
- // javac's VM should use the same default locale that IDEA uses in order for javac to print messages in 'correct' language
- //noinspection HardCodedStringLiteral
- final String lang = System.getProperty("user.language");
- if (lang != null) {
- //noinspection HardCodedStringLiteral
- commandLine.add((launcherUsed? "-J" : "") + "-Duser.language=" + lang);
- }
- //noinspection HardCodedStringLiteral
- final String country = System.getProperty("user.country");
- if (country != null) {
- //noinspection HardCodedStringLiteral
- commandLine.add((launcherUsed? "-J" : "") + "-Duser.country=" + country);
- }
- //noinspection HardCodedStringLiteral
- final String region = System.getProperty("user.region");
- if (region != null) {
- //noinspection HardCodedStringLiteral
- commandLine.add((launcherUsed? "-J" : "") + "-Duser.region=" + region);
- }
- }
-
- public static void addTargetCommandLineSwitch(final ModuleChunk chunk, final List<String> commandLine) {
- String optionValue = null;
- CompilerConfiguration config = null;
- final Module[] modules = chunk.getModules();
- for (Module module : modules) {
- if (config == null) {
- config = CompilerConfiguration.getInstance(module.getProject());
- }
- final String moduleTarget = config.getBytecodeTargetLevel(module);
- if (moduleTarget == null) {
- continue;
- }
- if (optionValue == null) {
- optionValue = moduleTarget;
- }
- else {
- if (moduleTarget.compareTo(optionValue) < 0) {
- optionValue = moduleTarget; // use the lower possible target among modules that form the chunk
- }
- }
- }
- if (optionValue != null) {
- commandLine.add("-target");
- commandLine.add(optionValue);
- }
- }
-
public static void addSourceCommandLineSwitch(final Sdk jdk, LanguageLevel chunkLanguageLevel, @NonNls final List<String> commandLine) {
final String versionString = jdk.getVersionString();
if (StringUtil.isEmpty(versionString)) {
@@ -312,67 +203,4 @@
public static void logDuration(final String activityName, long duration) {
LOG.info(activityName + " took " + duration + " ms: " + duration /60000 + " min " +(duration %60000)/1000 + "sec");
}
-
- public static void clearOutputDirectories(final Collection<File> outputDirectories) {
- final long start = System.currentTimeMillis();
- // do not delete directories themselves, or we'll get rootsChanged() otherwise
- final Collection<File> filesToDelete = new ArrayList<File>(outputDirectories.size() * 2);
- for (File outputDirectory : outputDirectories) {
- File[] files = outputDirectory.listFiles();
- if (files != null) {
- ContainerUtil.addAll(filesToDelete, files);
- }
- }
- if (filesToDelete.size() > 0) {
- FileUtil.asyncDelete(filesToDelete);
-
- // ensure output directories exist
- for (final File file : outputDirectories) {
- file.mkdirs();
- }
- final long clearStop = System.currentTimeMillis();
-
- refreshIODirectories(outputDirectories);
-
- final long refreshStop = System.currentTimeMillis();
-
- logDuration("Clearing output dirs", clearStop - start);
- logDuration("Refreshing output directories", refreshStop - clearStop);
- }
- }
-
- public static void computeIntersectingPaths(final Project project,
- final Collection<VirtualFile> outputPaths,
- final Collection<VirtualFile> result) {
- for (Module module : ModuleManager.getInstance(project).getModules()) {
- final ModuleRootManager rootManager = ModuleRootManager.getInstance(module);
- final VirtualFile[] sourceRoots = rootManager.getSourceRoots();
- for (final VirtualFile outputPath : outputPaths) {
- for (VirtualFile sourceRoot : sourceRoots) {
- if (VfsUtilCore.isAncestor(outputPath, sourceRoot, true) || VfsUtilCore.isAncestor(sourceRoot, outputPath, false)) {
- result.add(outputPath);
- }
- }
- }
- }
- }
-
- public static boolean askUserToContinueWithNoClearing(Project project, Collection<VirtualFile> affectedOutputPaths) {
- final StringBuilder paths = new StringBuilder();
- for (final VirtualFile affectedOutputPath : affectedOutputPaths) {
- if (paths.length() > 0) {
- paths.append(",\n");
- }
- paths.append(affectedOutputPath.getPath().replace('/', File.separatorChar));
- }
- final int answer = Messages.showOkCancelDialog(project,
- CompilerBundle.message("warning.sources.under.output.paths", paths.toString()),
- CommonBundle.getErrorTitle(), Messages.getWarningIcon());
- if (answer == Messages.OK) { // ok
- return true;
- }
- else {
- return false;
- }
- }
}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/InternedPath.java b/java/compiler/impl/src/com/intellij/compiler/impl/InternedPath.java
deleted file mode 100644
index 7914dc2..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/InternedPath.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.compiler.impl;
-
-import com.intellij.util.StringBuilderSpinAllocator;
-import com.intellij.util.containers.StringInterner;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Eugene Zhuravlev
- * Date: Jun 21, 2006
- */
-public class InternedPath {
- private final @NotNull List<String> myValue;
-
- public InternedPath(StringInterner interner, String url, final char separator) {
- myValue = convert(interner, url, separator);
- }
-
- public String toString() {
- return join(myValue, '/');
- }
-
- public static List<String> convert(StringInterner interner, String value, char delim) {
- final List<String> result = new ArrayList<String>();
- int start = 0;
- final int len = value.length();
- for (int idx = 0; idx < len; idx++) {
- if (value.charAt(idx) == delim) {
- result.add(interner.intern(value.substring(start, idx)));
- start = idx + 1;
- }
- }
- if (start < value.length()) {
- result.add(interner.intern(value.substring(start)));
- }
- if (len > 0 && value.charAt(len-1) == delim) { // ends with delimiter
- result.add("");
- }
- return result;
- }
-
- public static String join(List<String> value, char separator) {
- final int size = value.size();
- if (size > 1) {
- final StringBuilder builder = StringBuilderSpinAllocator.alloc();
- try {
- builder.append(value.get(0));
- for (int idx = 1; idx < size; idx++) {
- builder.append(separator).append(value.get(idx));
- }
- return builder.toString();
- }
- finally {
- StringBuilderSpinAllocator.dispose(builder);
- }
- }
- else if (size == 1){
- return value.get(0);
- }
- return "";
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/OutputPathFinder.java b/java/compiler/impl/src/com/intellij/compiler/impl/OutputPathFinder.java
deleted file mode 100644
index 6a712d1..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/OutputPathFinder.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * 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.compiler.impl;
-
-import com.intellij.openapi.util.Pair;
-import com.intellij.openapi.util.io.FileUtil;
-import org.jetbrains.annotations.Nullable;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author Eugene Zhuravlev
- * Date: Apr 6, 2009
- */
-public class OutputPathFinder {
- private final Node myRoot = new Node("");
-
- public OutputPathFinder(Set<File> outputDirs) {
- for (File dir : outputDirs) {
- final String path = FileUtil.toSystemIndependentName(dir.getPath());
- Node node = myRoot;
- int idx = path.startsWith("/")? 1 : 0;
- int slashIndex = path.indexOf('/', idx);
-
- for (; slashIndex >= 0; slashIndex = path.indexOf('/', idx)) {
- final String name = path.substring(idx, slashIndex);
- node = node.addChild(name);
- idx = slashIndex + 1;
- }
-
- if (idx < path.length()) {
- node = node.addChild(path.substring(idx));
- }
-
- node.setData(path);
- }
- }
-
- @Nullable
- public String lookupOutputPath(File outputFile) {
- return lookupOutputPath(outputFile.getPath());
- }
-
- @Nullable
- public String lookupOutputPath(String filePath) {
- final String path = FileUtil.toSystemIndependentName(filePath);
- Node node = myRoot;
- int idx = path.startsWith("/")? 1 : 0;
-
- return findOutputPath(path, idx, node);
- }
-
- private static @Nullable String findOutputPath(final String path, int idx, Node node) {
- while (true) {
- final int slashIndex = path.indexOf('/', idx);
- final String name = slashIndex < idx? path.substring(idx) : path.substring(idx, slashIndex);
- node = node.getChild(name);
- if (node == null) {
- return null;
- }
- if (node.isOutputRoot()) {
- if (node.hasChildren() && slashIndex > idx) {
- final String candidate = findOutputPath(path, slashIndex + 1, node);
- if (candidate != null) {
- return candidate;
- }
- }
- return node.getData();
- }
- if (slashIndex < 0) {
- return null; // end of path reached
- }
- idx = slashIndex + 1;
- }
- }
-
- private static class Node {
- private final String myName;
- @Nullable
- private Object myChildren; // either a Node or a Map<String, Node> or a String or a Pair<String, Node or NodeMap>
-
- private Node(String name) {
- myName = name;
- }
-
- public String getName() {
- return myName;
- }
-
- public boolean isOutputRoot() {
- return myChildren instanceof String || myChildren instanceof Pair;
- }
-
- public boolean hasChildren() {
- return myChildren instanceof Map || myChildren instanceof Pair;
- }
-
- @Nullable
- public String getData() {
- if (myChildren instanceof String) {
- return (String)myChildren;
- }
- if (myChildren instanceof Pair) {
- //noinspection unchecked
- return (String)((Pair)myChildren).first;
- }
- return null;
- }
-
- public void setData(String path) {
- if (myChildren != null) {
- if (myChildren instanceof String) {
- myChildren = path;
- }
- else {
- myChildren = new Pair(path, myChildren instanceof Pair? ((Pair)myChildren).second : myChildren);
- }
- }
- else {
- myChildren = path;
- }
- }
-
- public Node addChild(String childName) {
- if (myChildren == null) {
- final Node node = new Node(childName);
- myChildren = node;
- return node;
- }
- if (myChildren instanceof String) {
- final Node node = new Node(childName);
- myChildren = new Pair(myChildren, node);
- return node;
- }
-
- final Map<String, Node> map;
- if (myChildren instanceof Map) {
- map = (Map<String, Node>)myChildren;
- }
- else if (myChildren instanceof Node) {
- final Node existingChild = (Node)myChildren;
- myChildren = map = new HashMap<String, Node>();
- map.put(existingChild.getName(), existingChild);
- }
- else { // myChildren is a Pair
- Object children = ((Pair)myChildren).second;
- if (children instanceof Map) {
- map = (Map<String, Node>)children;
- }
- else {
- final Node existingChild = (Node)children;
- myChildren = new Pair(((Pair)myChildren).first, map = new HashMap<String, Node>());
- map.put(existingChild.getName(), existingChild);
- }
- }
-
- Node node = map.get(childName);
- if (node == null) {
- map.put(childName, node = new Node(childName));
- }
- return node;
- }
-
- @Nullable
- public Node getChild(String childName) {
- final Object children = myChildren instanceof Pair? ((Pair)myChildren).second : myChildren;
- if (children instanceof Node) {
- final Node childNode = (Node)children;
- return childName.equals(childNode.getName())? childNode : null;
- }
- if (children instanceof Map) {
- return ((Map<String, Node>)myChildren).get(childName);
- }
- return null;
- }
- }
-
-
- public static void main(String[] args) {
- final Set<File> set = new HashSet<File>();
- set.add(new File("/a/b/c"));
- set.add(new File("a/b/d"));
- set.add(new File("a/b/e"));
- set.add(new File("/a/b/f/g"));
- set.add(new File("/a/b/f/g/zzz"));
-
- final OutputPathFinder finder = new OutputPathFinder(set);
-
- System.out.println(finder.lookupOutputPath(new File("a/b")));
- System.out.println(finder.lookupOutputPath(new File("a/b/c/dir1/dir2/File.class")));
- System.out.println(finder.lookupOutputPath(new File("a/b/d/dir1/dir2/File.class")));
- System.out.println(finder.lookupOutputPath(new File("a/b/jjjjj/dir1/dir2/File.class")));
- System.out.println(finder.lookupOutputPath(new File("a/b/e/File.class")));
- System.out.println(finder.lookupOutputPath(new File("a/b/File.class")));
-
- System.out.println(finder.lookupOutputPath(new File("/a/b/f/g/File.class")));
- System.out.println(finder.lookupOutputPath(new File("/a/b/f/g/ttt/yy/File.class")));
- System.out.println(finder.lookupOutputPath(new File("/a/b/f/g/zzz/File.class")));
- System.out.println(finder.lookupOutputPath(new File("/a/b/f/g/zzz/mmm/ttt/File.class")));
-
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/PackagingCompilerAdapter.java b/java/compiler/impl/src/com/intellij/compiler/impl/PackagingCompilerAdapter.java
deleted file mode 100644
index d2f7826..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/PackagingCompilerAdapter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.compiler.impl;
-
-import com.intellij.openapi.compiler.CompileContext;
-import com.intellij.openapi.compiler.PackagingCompiler;
-import com.intellij.openapi.compiler.ValidityState;
-import org.jetbrains.annotations.Nullable;
-
-public class PackagingCompilerAdapter extends FileProcessingCompilerAdapter{
- private final PackagingCompiler myCompiler;
-
- public PackagingCompilerAdapter(CompileContext compileContext, PackagingCompiler compiler) {
- super(compileContext, compiler);
- myCompiler = compiler;
- }
-
- public void processOutdatedItem(CompileContext context, String url, @Nullable ValidityState state) {
- myCompiler.processOutdatedItem(context, url, state);
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/ModuleChunk.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/ModuleChunk.java
deleted file mode 100644
index 513c5da..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/ModuleChunk.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * 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.compiler.impl.javaCompiler;
-
-import com.intellij.compiler.CompilerConfiguration;
-import com.intellij.compiler.CompilerConfigurationImpl;
-import com.intellij.openapi.application.ApplicationManager;
-import com.intellij.openapi.compiler.ex.CompileContextEx;
-import com.intellij.openapi.module.EffectiveLanguageLevelUtil;
-import com.intellij.openapi.module.Module;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.projectRoots.Sdk;
-import com.intellij.openapi.roots.JdkOrderEntry;
-import com.intellij.openapi.roots.ModuleRootManager;
-import com.intellij.openapi.roots.OrderEntry;
-import com.intellij.openapi.roots.OrderEnumerator;
-import com.intellij.openapi.util.Computable;
-import com.intellij.openapi.util.Condition;
-import com.intellij.openapi.vfs.VfsUtil;
-import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.pom.java.LanguageLevel;
-import com.intellij.util.Chunk;
-import com.intellij.util.PathsList;
-import com.intellij.util.StringBuilderSpinAllocator;
-import com.intellij.util.containers.ContainerUtil;
-import com.intellij.util.containers.OrderedSet;
-import gnu.trove.THashMap;
-import org.jetbrains.annotations.NotNull;
-
-import java.io.File;
-import java.util.*;
-
-/**
- * @author Eugene Zhuravlev
- * Date: Sep 29, 2004
- */
-public class ModuleChunk extends Chunk<Module> {
- private final CompileContextEx myContext;
- private final Map<Module, List<VirtualFile>> myModuleToFilesMap = new THashMap<Module, List<VirtualFile>>();
- private final Map<VirtualFile, VirtualFile> myTransformedToOriginalMap = new THashMap<VirtualFile, VirtualFile>();
- private int mySourcesFilter = ALL_SOURCES;
-
- public ModuleChunk(CompileContextEx context, Chunk<Module> chunk, Map<Module, List<VirtualFile>> moduleToFilesMap) {
- super(chunk.getNodes());
- myContext = context;
- for (final Module module : chunk.getNodes()) {
- final List<VirtualFile> files = moduleToFilesMap.get(module);
- // Important!!! Collections in the myModuleToFilesMap must be modifiable copies of the corresponding collections
- // from the moduleToFilesMap. This is needed to support SourceTransforming compilers
- myModuleToFilesMap.put(module, files == null ? Collections.<VirtualFile>emptyList() : new ArrayList<VirtualFile>(files));
- }
- }
-
- public static final int SOURCES = 0x1;
- public static final int TEST_SOURCES = 0x2;
- public static final int ALL_SOURCES = SOURCES | TEST_SOURCES;
-
- public void setSourcesFilter(int filter) {
- mySourcesFilter = filter;
- }
-
- public int getSourcesFilter() {
- return mySourcesFilter;
- }
-
- public void substituteWithTransformedVersion(Module module, int fileIndex, VirtualFile transformedFile) {
- final List<VirtualFile> moduleFiles = getFilesToCompile(module);
- final VirtualFile currentFile = moduleFiles.get(fileIndex);
- moduleFiles.set(fileIndex, transformedFile);
- VirtualFile originalFile = myTransformedToOriginalMap.remove(currentFile);
- if (originalFile == null) {
- originalFile = currentFile;
- }
- myTransformedToOriginalMap.put(transformedFile, originalFile);
- }
-
- public VirtualFile getOriginalFile(VirtualFile file) {
- final VirtualFile original = myTransformedToOriginalMap.get(file);
- return original != null? original : file;
- }
-
- @NotNull
- public List<VirtualFile> getFilesToCompile(Module forModule) {
- return myModuleToFilesMap.get(forModule);
- }
-
- @NotNull
- public List<VirtualFile> getFilesToCompile() {
- if (getModuleCount() == 0) {
- return Collections.emptyList();
- }
- final Set<Module> modules = getNodes();
-
- final List<VirtualFile> filesToCompile = new ArrayList<VirtualFile>();
- for (final Module module : modules) {
- final List<VirtualFile> moduleCompilableFiles = getFilesToCompile(module);
- if (mySourcesFilter == ALL_SOURCES) {
- filesToCompile.addAll(moduleCompilableFiles);
- }
- else {
- for (final VirtualFile file : moduleCompilableFiles) {
- VirtualFile originalFile = myTransformedToOriginalMap.get(file);
- if (originalFile == null) {
- originalFile = file;
- }
- if (mySourcesFilter == TEST_SOURCES) {
- if (myContext.isInTestSourceContent(originalFile)) {
- filesToCompile.add(file);
- }
- }
- else {
- if (!myContext.isInTestSourceContent(originalFile)) {
- filesToCompile.add(file);
- }
- }
- }
- }
- }
- return filesToCompile;
- }
-
- /**
- * @return the jdk. Assumes that the jdk is the same for all modules
- */
- public Sdk getJdk() {
- final Module module = getNodes().iterator().next();
- return ModuleRootManager.getInstance(module).getSdk();
- }
-
- public VirtualFile[] getSourceRoots() {
- return getSourceRoots(mySourcesFilter);
- }
-
- private VirtualFile[] getSourceRoots(final int sourcesFilter) {
- return ApplicationManager.getApplication().runReadAction(new Computable<VirtualFile[]>() {
- public VirtualFile[] compute() {
- return filterRoots(getAllSourceRoots(), getNodes().iterator().next().getProject(), sourcesFilter);
- }
- });
- }
-
- public VirtualFile[] getSourceRoots(final Module module) {
- if (!getNodes().contains(module)) {
- return VirtualFile.EMPTY_ARRAY;
- }
- return ApplicationManager.getApplication().runReadAction(new Computable<VirtualFile[]>() {
- public VirtualFile[] compute() {
- return filterRoots(myContext.getSourceRoots(module), module.getProject(), mySourcesFilter);
- }
- });
- }
-
- private VirtualFile[] filterRoots(VirtualFile[] roots, Project project, final int sourcesFilter) {
- final List<VirtualFile> filteredRoots = new ArrayList<VirtualFile>(roots.length);
- final CompilerConfigurationImpl compilerConfiguration = (CompilerConfigurationImpl)CompilerConfiguration.getInstance(project);
- for (final VirtualFile root : roots) {
- if (sourcesFilter != ALL_SOURCES) {
- if (myContext.isInTestSourceContent(root)) {
- if ((sourcesFilter & TEST_SOURCES) == 0) {
- continue;
- }
- }
- else {
- if ((sourcesFilter & SOURCES) == 0) {
- continue;
- }
- }
- }
- if (compilerConfiguration.isExcludedFromCompilation(root)) {
- continue;
- }
- filteredRoots.add(root);
- }
- return VfsUtil.toVirtualFileArray(filteredRoots);
- }
-
- private VirtualFile[] getAllSourceRoots() {
- final Set<Module> modules = getNodes();
- Set<VirtualFile> roots = new HashSet<VirtualFile>();
- for (final Module module : modules) {
- ContainerUtil.addAll(roots, myContext.getSourceRoots(module));
- }
- return VfsUtil.toVirtualFileArray(roots);
- }
-
- public String getCompilationClasspath() {
- final OrderedSet<VirtualFile> cpFiles = getCompilationClasspathFiles();
- return convertToStringPath(cpFiles);
-
- }
-
- public OrderedSet<VirtualFile> getCompilationClasspathFiles() {
- return getCompilationClasspathFiles(true);
- }
-
- public OrderedSet<VirtualFile> getCompilationClasspathFiles(final boolean exportedOnly) {
- final Set<Module> modules = getNodes();
-
- OrderedSet<VirtualFile> cpFiles = new OrderedSet<VirtualFile>();
- for (final Module module : modules) {
- Collections.addAll(cpFiles, orderEnumerator(module, exportedOnly, new AfterJdkOrderEntryCondition()).getClassesRoots());
- }
- return cpFiles;
- }
-
- private OrderEnumerator orderEnumerator(Module module, boolean exportedOnly, Condition<OrderEntry> condition) {
- OrderEnumerator enumerator = OrderEnumerator.orderEntries(module).compileOnly().satisfying(condition);
- if ((mySourcesFilter & TEST_SOURCES) == 0) {
- enumerator = enumerator.productionOnly();
- }
- enumerator = enumerator.recursively();
- return exportedOnly ? enumerator.exportedOnly() : enumerator;
- }
-
- public String getCompilationBootClasspath() {
- return convertToStringPath(getCompilationBootClasspathFiles());
- }
-
- public OrderedSet<VirtualFile> getCompilationBootClasspathFiles() {
- return getCompilationBootClasspathFiles(true);
- }
-
- public OrderedSet<VirtualFile> getCompilationBootClasspathFiles(final boolean exportedOnly) {
- final Set<Module> modules = getNodes();
- final OrderedSet<VirtualFile> cpFiles = new OrderedSet<VirtualFile>();
- final OrderedSet<VirtualFile> jdkFiles = new OrderedSet<VirtualFile>();
- for (final Module module : modules) {
- Collections.addAll(cpFiles, orderEnumerator(module, exportedOnly, new BeforeJdkOrderEntryCondition(module)).getClassesRoots());
- Collections.addAll(jdkFiles, OrderEnumerator.orderEntries(module).sdkOnly().getClassesRoots());
- }
- cpFiles.addAll(jdkFiles);
- return cpFiles;
- }
-
- private static String convertToStringPath(final OrderedSet<VirtualFile> cpFiles) {
- PathsList classpath = new PathsList();
- classpath.addVirtualFiles(cpFiles);
- return classpath.getPathsString();
- }
-
- //private String tryZipFor(String outputDir) {
- // final File zip = CompilerPathsEx.getZippedOutputPath(myContext.getProject(), outputDir);
- // if (zip.exists()) {
- // try {
- // myContext.commitZip(outputDir); // flush unsaved data if any
- // }
- // catch (IOException e) {
- // LOG.info(e);
- // }
- // return zip.getPath();
- // }
- // return outputDir;
- //}
-
- public int getModuleCount() {
- return getNodes().size();
- }
-
- public Module[] getModules() {
- final Set<Module> nodes = getNodes();
- return nodes.toArray(new Module[nodes.size()]);
- }
-
- public String getSourcePath() {
- return getSourcePath(mySourcesFilter);
- }
-
- public String getSourcePath(final int sourcesFilter) {
- if (getModuleCount() == 0) {
- return "";
- }
- final VirtualFile[] filteredRoots = getSourceRoots(sourcesFilter);
- final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
- try {
- ApplicationManager.getApplication().runReadAction(new Runnable() {
- public void run() {
- for (VirtualFile root : filteredRoots) {
- if (buffer.length() > 0) {
- buffer.append(File.pathSeparatorChar);
- }
- buffer.append(root.getPath().replace('/', File.separatorChar));
- }
- }
- });
- return buffer.toString();
- }
- finally {
- StringBuilderSpinAllocator.dispose(buffer);
- }
- }
-
- //the check for equal language levels is done elsewhere
- public LanguageLevel getLanguageLevel() {
- return EffectiveLanguageLevelUtil.getEffectiveLanguageLevel(getNodes().iterator().next());
- }
-
- public Project getProject() {
- return myContext.getProject();
- }
-
- private static class BeforeJdkOrderEntryCondition implements Condition<OrderEntry> {
- private boolean myJdkFound;
- private final Module myOwnerModule;
-
- private BeforeJdkOrderEntryCondition(Module ownerModule) {
- myOwnerModule = ownerModule;
- }
-
- @Override
- public boolean value(OrderEntry orderEntry) {
- if (orderEntry instanceof JdkOrderEntry && myOwnerModule.equals(orderEntry.getOwnerModule())) {
- myJdkFound = true;
- }
- return !myJdkFound;
- }
- }
-
- private static class AfterJdkOrderEntryCondition implements Condition<OrderEntry> {
- private boolean myJdkFound;
-
- @Override
- public boolean value(OrderEntry orderEntry) {
- if (orderEntry instanceof JdkOrderEntry) {
- myJdkFound = true;
- return false;
- }
- return myJdkFound;
- }
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/eclipse/EclipseSettingsBuilder.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/eclipse/EclipseSettingsBuilder.java
deleted file mode 100644
index 7748223..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/eclipse/EclipseSettingsBuilder.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2000-2012 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.compiler.impl.javaCompiler.eclipse;
-
-import com.intellij.compiler.impl.javaCompiler.javac.JavacSettingsBuilder;
-import com.intellij.openapi.module.Module;
-import com.intellij.util.Chunk;
-import org.jetbrains.jps.model.java.compiler.EclipseCompilerOptions;
-
-import java.util.Collection;
-
-/**
- * @author Eugene Zhuravlev
- * Date: 9/27/12
- */
-public class EclipseSettingsBuilder extends JavacSettingsBuilder {
- public EclipseSettingsBuilder(final EclipseCompilerOptions options) {
- super(options);
- }
-
- @Override
- public EclipseCompilerOptions getOptions() {
- return (EclipseCompilerOptions)super.getOptions();
- }
-
- @Override
- public Collection<String> getOptions(Chunk<Module> chunk) {
- final Collection<String> options = super.getOptions(chunk);
- if (getOptions().PROCEED_ON_ERROR) {
- options.add("-proceedOnError");
- }
- return options;
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacSettingsBuilder.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacSettingsBuilder.java
deleted file mode 100644
index 7be8e1d..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacSettingsBuilder.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.compiler.impl.javaCompiler.javac;
-
-import com.intellij.compiler.CompilerEncodingService;
-import com.intellij.compiler.impl.javaCompiler.ModuleChunk;
-import com.intellij.openapi.module.Module;
-import com.intellij.util.Chunk;
-import org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions;
-
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.StringTokenizer;
-
-public class JavacSettingsBuilder {
- private final JpsJavaCompilerOptions myOptions;
-
- public JavacSettingsBuilder(JpsJavaCompilerOptions options) {
- myOptions = options;
- }
-
- protected JpsJavaCompilerOptions getOptions() {
- return myOptions;
- }
-
- public Collection<String> getOptions(Chunk<Module> chunk) {
- List<String> options = new ArrayList<String>();
- if (getOptions().DEBUGGING_INFO) {
- options.add("-g");
- }
- if (getOptions().DEPRECATION) {
- options.add("-deprecation");
- }
- if (getOptions().GENERATE_NO_WARNINGS) {
- options.add("-nowarn");
- }
- boolean isEncodingSet = false;
- final StringTokenizer tokenizer = new StringTokenizer(getOptions().ADDITIONAL_OPTIONS_STRING, " \t\r\n");
- while(tokenizer.hasMoreTokens()) {
- final String token = tokenizer.nextToken();
- if(!acceptUserOption(token)) {
- continue;
- }
- options.add(token);
- if ("-encoding".equals(token)) {
- isEncodingSet = true;
- }
- }
- if (!isEncodingSet && acceptEncoding()) {
- final Charset charset = CompilerEncodingService.getPreferredModuleEncoding(chunk);
- if (charset != null) {
- options.add("-encoding");
- options.add(charset.name());
- }
- }
- return options;
- }
-
- protected boolean acceptUserOption(String token) {
- return !("-g".equals(token) || "-deprecation".equals(token) || "-nowarn".equals(token));
- }
-
- protected boolean acceptEncoding() {
- return true;
- }
-
- public String getOptionsString(final ModuleChunk chunk) {
- final StringBuilder options = new StringBuilder();
- for (String option : getOptions(chunk)) {
- if (options.length() > 0) {
- options.append(" ");
- }
- options.append(option);
- }
- return options.toString();
- }
-}
\ No newline at end of file
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/BuildInstructionBase.java b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/BuildInstructionBase.java
deleted file mode 100644
index 446dd2e..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/BuildInstructionBase.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.
- */
-
-/**
- * @author cdr
- */
-package com.intellij.compiler.impl.packagingCompiler;
-
-import com.intellij.openapi.compiler.make.BuildInstruction;
-import com.intellij.openapi.util.UserDataHolderBase;
-import com.intellij.openapi.util.io.FileUtil;
-import gnu.trove.THashSet;
-import org.jetbrains.annotations.NonNls;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-
-public abstract class BuildInstructionBase extends UserDataHolderBase implements BuildInstruction, Cloneable {
- private final String myOutputRelativePath;
- private Collection<File> myFilesToDelete;
-
- protected BuildInstructionBase(String outputRelativePath) {
- myOutputRelativePath = outputRelativePath;
- }
-
- public String getOutputRelativePath() {
- return myOutputRelativePath;
- }
-
- public BuildInstructionBase clone() {
- return (BuildInstructionBase)super.clone();
- }
-
- public void addFileToDelete(File file) {
- if (myFilesToDelete == null) {
- myFilesToDelete = new THashSet<File>();
- }
- myFilesToDelete.add(file);
- }
-
- public void collectFilesToDelete(Collection<File> filesToDelete) {
- if (myFilesToDelete != null) {
- filesToDelete.addAll(myFilesToDelete);
- }
- myFilesToDelete = null;
- }
-
- @NonNls
- public String toString() {
- return super.toString();
- }
-
- protected File createTempFile(final String prefix, final String suffix) throws IOException {
- final File tempFile = FileUtil.createTempFile(prefix + "___", suffix);
- addFileToDelete(tempFile);
- return tempFile;
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/DependentJarsEvaluator.java b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/DependentJarsEvaluator.java
deleted file mode 100644
index 9fa4e2c..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/DependentJarsEvaluator.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.compiler.impl.packagingCompiler;
-
-import com.intellij.openapi.util.Pair;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-/**
- * @author nik
- */
-public class DependentJarsEvaluator {
- private final Set<JarInfo> myJars = new LinkedHashSet<JarInfo>();
-
- public void addJarWithDependencies(final JarInfo jarInfo) {
- if (myJars.add(jarInfo)) {
- for (JarDestinationInfo destination : jarInfo.getJarDestinations()) {
- addJarWithDependencies(destination.getJarInfo());
- }
- for (Pair<String, JarInfo> pair : jarInfo.getPackedJars()) {
- addJarWithDependencies(pair.getSecond());
- }
- }
- }
-
- public Set<JarInfo> getJars() {
- return myJars;
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/DestinationInfo.java b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/DestinationInfo.java
deleted file mode 100644
index abda982..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/DestinationInfo.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.compiler.impl.packagingCompiler;
-
-import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.openapi.vfs.LocalFileSystem;
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.annotations.NotNull;
-
-/**
- * @author nik
- */
-public abstract class DestinationInfo {
- private VirtualFile myOutputFile;
- private final String myOutputPath;
- private final String myOutputFilePath;
-
- protected DestinationInfo(@NotNull final String outputPath, @Nullable final VirtualFile outputFile, @NotNull String outputFilePath) {
- myOutputFilePath = outputFilePath;
- myOutputFile = outputFile;
- myOutputPath = outputPath;
- }
-
- @NotNull
- public String getOutputPath() {
- return myOutputPath;
- }
-
- @Nullable
- public VirtualFile getOutputFile() {
- return myOutputFile;
- }
-
- @NotNull
- public String getOutputFilePath() {
- return myOutputFilePath;
- }
-
- public void update() {
- if (myOutputFile != null && !myOutputFile.isValid()) {
- myOutputFile = null;
- }
- if (myOutputFile == null) {
- myOutputFile = LocalFileSystem.getInstance().findFileByPath(myOutputFilePath);
- }
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/ExplodedDestinationInfo.java b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/ExplodedDestinationInfo.java
deleted file mode 100644
index 33a3a8e..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/ExplodedDestinationInfo.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.compiler.impl.packagingCompiler;
-
-import com.intellij.openapi.vfs.VirtualFile;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * @author nik
- */
-public class ExplodedDestinationInfo extends DestinationInfo {
- public ExplodedDestinationInfo(final String outputPath, @Nullable final VirtualFile outputFile) {
- super(outputPath, outputFile, outputPath);
- }
-
- public String toString() {
- return getOutputPath();
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/FileCopyInstructionImpl.java b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/FileCopyInstructionImpl.java
deleted file mode 100644
index 64b5855..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/FileCopyInstructionImpl.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.compiler.impl.packagingCompiler;
-
-import com.intellij.openapi.compiler.make.BuildInstructionVisitor;
-import com.intellij.openapi.compiler.make.FileCopyInstruction;
-import com.intellij.openapi.util.io.FileUtil;
-
-import java.io.File;
-
-public class FileCopyInstructionImpl extends BuildInstructionBase implements FileCopyInstruction {
- private File myFile;
- private boolean myIsDirectory;
-
- public FileCopyInstructionImpl(File source, boolean isDirectory, String outputRelativePath) {
- super(outputRelativePath);
- setFile(source, isDirectory);
- }
-
- public boolean accept(BuildInstructionVisitor visitor) throws Exception {
- return visitor.visitFileCopyInstruction(this);
- }
-
- public String toString() {
- return "Copy " + getFile() + "->" + getOutputRelativePath();
- }
-
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof FileCopyInstruction)) return false;
-
- final FileCopyInstruction item = (FileCopyInstruction) o;
-
- if (getFile() != null ? !FileUtil.filesEqual(getFile(), item.getFile()) : item.getFile() != null) return false;
-
- if (getOutputRelativePath() != null) {
- if (!getOutputRelativePath().equals( item.getOutputRelativePath() )) return false;
- } else if ( item.getOutputRelativePath() != null ) {
- return false;
- }
-
- return true;
- }
-
- public int hashCode() {
- return (getFile() != null ? getFile().hashCode() : 0) +
- (getOutputRelativePath() != null ? getOutputRelativePath().hashCode():0);
- }
-
- public File getFile() {
- return myFile;
- }
-
- public boolean isDirectory() {
- return myIsDirectory;
- }
-
- private void setFile(File file, boolean isDirectory) {
- myFile = file;
- myIsDirectory = isDirectory;
- }
-
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarDestinationInfo.java b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarDestinationInfo.java
deleted file mode 100644
index 5cc45c1..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarDestinationInfo.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.compiler.impl.packagingCompiler;
-
-import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.openapi.vfs.JarFileSystem;
-
-/**
- * @author nik
- */
-public class JarDestinationInfo extends DestinationInfo {
- private static final Logger LOG = Logger.getInstance("#com.intellij.compiler.impl.packagingCompiler.JarDestinationInfo");
- private final String myPathInJar;
- private final JarInfo myJarInfo;
-
- public JarDestinationInfo(final String pathInJar, final JarInfo jarInfo, DestinationInfo jarDestination) {
- super(appendPathInJar(jarDestination.getOutputPath(), pathInJar), jarDestination.getOutputFile(), jarDestination.getOutputFilePath());
- LOG.assertTrue(!pathInJar.startsWith(".."), pathInJar);
- myPathInJar = StringUtil.startsWithChar(pathInJar, '/') ? pathInJar : "/" + pathInJar;
- myJarInfo = jarInfo;
- }
-
- private static String appendPathInJar(String outputPath, String pathInJar) {
- LOG.assertTrue(outputPath.length() > 0 && outputPath.charAt(outputPath.length() - 1) != '/');
- LOG.assertTrue(pathInJar.length() > 0 && pathInJar.charAt(0) != '/');
- return outputPath + JarFileSystem.JAR_SEPARATOR + pathInJar;
- }
-
- public String getPathInJar() {
- return myPathInJar;
- }
-
- public JarInfo getJarInfo() {
- return myJarInfo;
- }
-
- public String toString() {
- return myPathInJar + "(" + getOutputPath() + ")";
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarInfo.java b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarInfo.java
deleted file mode 100644
index 7626ca1..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarInfo.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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.compiler.impl.packagingCompiler;
-
-import com.intellij.openapi.util.Pair;
-import com.intellij.openapi.vfs.VirtualFile;
-
-import java.util.ArrayList;
-import java.util.LinkedHashSet;
-import java.util.List;
-
-/**
- * @author nik
- */
-public class JarInfo {
- private final List<Pair<String, VirtualFile>> myPackedFiles;
- private final LinkedHashSet<Pair<String, JarInfo>> myPackedJars;
- private final List<DestinationInfo> myDestinations;
-
- public JarInfo() {
- myDestinations = new ArrayList<DestinationInfo>();
- myPackedFiles = new ArrayList<Pair<String, VirtualFile>>();
- myPackedJars = new LinkedHashSet<Pair<String, JarInfo>>();
- }
-
- public void addDestination(DestinationInfo info) {
- myDestinations.add(info);
- if (info instanceof JarDestinationInfo) {
- JarDestinationInfo destinationInfo = (JarDestinationInfo)info;
- destinationInfo.getJarInfo().myPackedJars.add(Pair.create(destinationInfo.getPathInJar(), this));
- }
- }
-
- public void addContent(String pathInJar, VirtualFile sourceFile) {
- myPackedFiles.add(Pair.create(pathInJar, sourceFile));
- }
-
- public List<Pair<String, VirtualFile>> getPackedFiles() {
- return myPackedFiles;
- }
-
- public LinkedHashSet<Pair<String, JarInfo>> getPackedJars() {
- return myPackedJars;
- }
-
- public List<JarDestinationInfo> getJarDestinations() {
- final ArrayList<JarDestinationInfo> list = new ArrayList<JarDestinationInfo>();
- for (DestinationInfo destination : myDestinations) {
- if (destination instanceof JarDestinationInfo) {
- list.add((JarDestinationInfo)destination);
- }
- }
- return list;
- }
-
- public List<DestinationInfo> getAllDestinations() {
- return myDestinations;
- }
-
- public String getPresentableDestination() {
- return !myDestinations.isEmpty() ? myDestinations.get(0).getOutputPath() : "";
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarsBuilder.java b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarsBuilder.java
deleted file mode 100644
index c543abe..0000000
--- a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarsBuilder.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright 2000-2014 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.compiler.impl.packagingCompiler;
-
-import com.intellij.openapi.compiler.CompileContext;
-import com.intellij.openapi.compiler.CompilerBundle;
-import com.intellij.openapi.compiler.CompilerMessageCategory;
-import com.intellij.openapi.deployment.DeploymentUtil;
-import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.util.Couple;
-import com.intellij.openapi.util.Pair;
-import com.intellij.openapi.util.io.FileUtil;
-import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.openapi.vfs.VfsUtil;
-import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.packaging.impl.compiler.ArtifactCompilerUtil;
-import com.intellij.util.ArrayUtil;
-import com.intellij.util.graph.CachingSemiGraph;
-import com.intellij.util.graph.DFSTBuilder;
-import com.intellij.util.graph.GraphGenerator;
-import com.intellij.util.io.ZipUtil;
-import gnu.trove.THashSet;
-import org.jetbrains.annotations.NonNls;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.io.*;
-import java.util.*;
-import java.util.jar.JarFile;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-/**
- * @author nik
- */
-public class JarsBuilder {
- private static final Logger LOG = Logger.getInstance("#com.intellij.compiler.impl.packagingCompiler.JarsBuilder");
- private final Set<JarInfo> myJarsToBuild;
- private final FileFilter myFileFilter;
- private final CompileContext myContext;
- private Map<JarInfo, File> myBuiltJars;
-
- public JarsBuilder(Set<JarInfo> jarsToBuild, FileFilter fileFilter, CompileContext context) {
- DependentJarsEvaluator evaluator = new DependentJarsEvaluator();
- for (JarInfo jarInfo : jarsToBuild) {
- evaluator.addJarWithDependencies(jarInfo);
- }
- myJarsToBuild = evaluator.getJars();
- myFileFilter = fileFilter;
- myContext = context;
- }
-
- public boolean buildJars(Set<String> writtenPaths) throws IOException {
- myContext.getProgressIndicator().setText(CompilerBundle.message("packaging.compiler.message.building.archives"));
-
- final JarInfo[] sortedJars = sortJars();
- if (sortedJars == null) {
- return false;
- }
-
- myBuiltJars = new HashMap<JarInfo, File>();
- try {
- for (JarInfo jar : sortedJars) {
- myContext.getProgressIndicator().checkCanceled();
- buildJar(jar);
- }
-
- myContext.getProgressIndicator().setText(CompilerBundle.message("packaging.compiler.message.copying.archives"));
- copyJars(writtenPaths);
- }
- finally {
- deleteTemporaryJars();
- }
-
-
- return true;
- }
-
- private void deleteTemporaryJars() {
- for (File file : myBuiltJars.values()) {
- FileUtil.delete(file);
- }
- }
-
- private void copyJars(final Set<String> writtenPaths) throws IOException {
- for (Map.Entry<JarInfo, File> entry : myBuiltJars.entrySet()) {
- File fromFile = entry.getValue();
- boolean first = true;
- for (DestinationInfo destination : entry.getKey().getAllDestinations()) {
- if (destination instanceof ExplodedDestinationInfo) {
- File toFile = new File(FileUtil.toSystemDependentName(destination.getOutputPath()));
-
- if (first) {
- first = false;
- renameFile(fromFile, toFile, writtenPaths);
- fromFile = toFile;
- }
- else {
- DeploymentUtil.getInstance().copyFile(fromFile, toFile, myContext, writtenPaths, myFileFilter);
- }
-
- }
- }
- }
- }
-
- private static void renameFile(final File fromFile, final File toFile, final Set<String> writtenPaths) throws IOException {
- FileUtil.rename(fromFile, toFile);
- writtenPaths.add(toFile.getPath());
- }
-
- @Nullable
- private JarInfo[] sortJars() {
- final DFSTBuilder<JarInfo> builder = new DFSTBuilder<JarInfo>(GraphGenerator.create(CachingSemiGraph.create(new JarsGraph())));
- if (!builder.isAcyclic()) {
- final Couple<JarInfo> dependency = builder.getCircularDependency();
- String message = CompilerBundle.message("packaging.compiler.error.cannot.build.circular.dependency.found.between.0.and.1",
- dependency.getFirst().getPresentableDestination(),
- dependency.getSecond().getPresentableDestination());
- myContext.addMessage(CompilerMessageCategory.ERROR, message, null, -1, -1);
- return null;
- }
-
- JarInfo[] jars = myJarsToBuild.toArray(new JarInfo[myJarsToBuild.size()]);
- Arrays.sort(jars, builder.comparator());
- jars = ArrayUtil.reverseArray(jars);
- return jars;
- }
-
- public Set<JarInfo> getJarsToBuild() {
- return myJarsToBuild;
- }
-
- private void buildJar(final JarInfo jar) throws IOException {
- if (jar.getPackedFiles().isEmpty() && jar.getPackedJars().isEmpty()) {
- myContext.addMessage(CompilerMessageCategory.WARNING, "Archive '" + jar.getPresentableDestination() + "' has no files so it won't be created", null, -1, -1);
- return;
- }
-
- myContext.getProgressIndicator()
- .setText(CompilerBundle.message("packaging.compiler.message.building.0", jar.getPresentableDestination()));
- File jarFile = FileUtil.createTempFile("artifactCompiler", "tmp");
- myBuiltJars.put(jar, jarFile);
-
- FileUtil.createParentDirs(jarFile);
-
- VirtualFile manifestFile = null;
- for (Pair<String, VirtualFile> pair : jar.getPackedFiles()) {
- if (pair.getFirst().equals(JarFile.MANIFEST_NAME)) {
- manifestFile = pair.getSecond();
- }
- }
- final JarOutputStream jarOutputStream = createJarOutputStream(jarFile, manifestFile);
-
- try {
- final THashSet<String> writtenPaths = new THashSet<String>();
- for (Pair<String, VirtualFile> pair : jar.getPackedFiles()) {
- if (pair.getFirst().equals(JarFile.MANIFEST_NAME)) continue;
- final VirtualFile sourceFile = pair.getSecond();
- if (sourceFile.isInLocalFileSystem()) {
- File file = VfsUtil.virtualToIoFile(sourceFile);
- addFileToJar(jarOutputStream, file, pair.getFirst(), writtenPaths);
- }
- else {
- extractFileAndAddToJar(jarOutputStream, sourceFile, pair.getFirst(), writtenPaths);
- }
- }
-
- for (Pair<String, JarInfo> nestedJar : jar.getPackedJars()) {
- File nestedJarFile = myBuiltJars.get(nestedJar.getSecond());
- if (nestedJarFile != null) {
- addFileToJar(jarOutputStream, nestedJarFile, nestedJar.getFirst(), writtenPaths);
- }
- else {
- LOG.debug("nested jar file " + nestedJar.getFirst() + " for " + jar.getPresentableDestination() + " not found");
- }
- }
- }
- finally {
- jarOutputStream.close();
- }
- }
-
- private static JarOutputStream createJarOutputStream(File jarFile, VirtualFile manifestFile) throws IOException {
- final BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(jarFile));
- final JarOutputStream jarOutputStream;
- if (manifestFile != null) {
- final InputStream manifestStream = manifestFile.getInputStream();
- try {
- jarOutputStream = new JarOutputStream(outputStream, new Manifest(manifestStream));
- }
- finally {
- manifestStream.close();
- }
- }
- else {
- jarOutputStream = new JarOutputStream(outputStream);
- }
- return jarOutputStream;
- }
-
- private void extractFileAndAddToJar(JarOutputStream jarOutputStream, VirtualFile sourceFile, String relativePath, THashSet<String> writtenPaths)
- throws IOException {
- relativePath = addParentDirectories(jarOutputStream, writtenPaths, relativePath);
- myContext.getProgressIndicator().setText2(relativePath);
- if (!writtenPaths.add(relativePath)) return;
-
- final BufferedInputStream input = ArtifactCompilerUtil.getJarEntryInputStream(sourceFile, myContext);
- if (input == null) return;
-
- ZipEntry entry = new ZipEntry(relativePath);
- entry.setTime(ArtifactCompilerUtil.getJarFile(sourceFile).lastModified());
- jarOutputStream.putNextEntry(entry);
- FileUtil.copy(input, jarOutputStream);
- jarOutputStream.closeEntry();
- }
-
- private void addFileToJar(final @NotNull JarOutputStream jarOutputStream, final @NotNull File file, @NotNull String relativePath,
- final @NotNull THashSet<String> writtenPaths) throws IOException {
- if (!file.exists()) {
- return;
- }
-
- relativePath = addParentDirectories(jarOutputStream, writtenPaths, relativePath);
- myContext.getProgressIndicator().setText2(relativePath);
- ZipUtil.addFileToZip(jarOutputStream, file, relativePath, writtenPaths, myFileFilter);
- }
-
- private static String addParentDirectories(JarOutputStream jarOutputStream, THashSet<String> writtenPaths, String relativePath) throws IOException {
- while (StringUtil.startsWithChar(relativePath, '/')) {
- relativePath = relativePath.substring(1);
- }
- int i = relativePath.indexOf('/');
- while (i != -1) {
- String prefix = relativePath.substring(0, i+1);
- if (!writtenPaths.contains(prefix) && prefix.length() > 1) {
- addEntry(jarOutputStream, prefix);
- writtenPaths.add(prefix);
- }
- i = relativePath.indexOf('/', i + 1);
- }
- return relativePath;
- }
-
- private static void addEntry(final ZipOutputStream output, @NonNls final String relativePath) throws IOException {
- ZipEntry e = new ZipEntry(relativePath);
- e.setMethod(ZipEntry.STORED);
- e.setSize(0);
- e.setCrc(0);
- output.putNextEntry(e);
- output.closeEntry();
- }
-
- private class JarsGraph implements GraphGenerator.SemiGraph<JarInfo> {
- public Collection<JarInfo> getNodes() {
- return myJarsToBuild;
- }
-
- public Iterator<JarInfo> getIn(final JarInfo n) {
- Set<JarInfo> ins = new HashSet<JarInfo>();
- for (JarDestinationInfo destination : n.getJarDestinations()) {
- ins.add(destination.getJarInfo());
- }
- return ins.iterator();
- }
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/compiler/progress/CompilerTask.java b/java/compiler/impl/src/com/intellij/compiler/progress/CompilerTask.java
index 395a7a7..f568f2d 100644
--- a/java/compiler/impl/src/com/intellij/compiler/progress/CompilerTask.java
+++ b/java/compiler/impl/src/com/intellij/compiler/progress/CompilerTask.java
@@ -463,6 +463,9 @@
}
private void removeAllContents(Project project, Content notRemove) {
+ if (project.isDisposed()) {
+ return;
+ }
final MessageView messageView = MessageView.SERVICE.getInstance(project);
Content[] contents = messageView.getContentManager().getContents();
for (Content content : contents) {
diff --git a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java
index c32d9ec..03ff006 100644
--- a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java
+++ b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java
@@ -28,6 +28,7 @@
import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.ide.DataManager;
import com.intellij.ide.PowerSaveMode;
+import com.intellij.ide.file.BatchFileChangeListener;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.application.Application;
@@ -246,7 +247,13 @@
for (VFileEvent event : events) {
final VirtualFile eventFile = event.getFile();
- if (eventFile == null || ProjectCoreUtil.isProjectOrWorkspaceFile(eventFile)) {
+ if (eventFile == null) {
+ continue;
+ }
+ if (!eventFile.isValid()) {
+ return true; // should be deleted
+ }
+ if (ProjectCoreUtil.isProjectOrWorkspaceFile(eventFile)) {
continue;
}
@@ -268,6 +275,12 @@
});
+ conn.subscribe(BatchFileChangeListener.TOPIC, new BatchFileChangeListener.Adapter() {
+ public void batchChangeStarted(Project project) {
+ cancelAutoMakeTasks(project);
+ }
+ });
+
EditorFactory.getInstance().getEventMulticaster().addDocumentListener(new DocumentAdapter() {
@Override
public void documentChanged(DocumentEvent e) {
diff --git a/java/compiler/impl/src/com/intellij/compiler/server/DefaultMessageHandler.java b/java/compiler/impl/src/com/intellij/compiler/server/DefaultMessageHandler.java
index e4df975..6a8c974 100644
--- a/java/compiler/impl/src/com/intellij/compiler/server/DefaultMessageHandler.java
+++ b/java/compiler/impl/src/com/intellij/compiler/server/DefaultMessageHandler.java
@@ -48,8 +48,10 @@
*/
public abstract class DefaultMessageHandler implements BuilderMessageHandler {
private static final Logger LOG = Logger.getInstance("#com.intellij.compiler.server.DefaultMessageHandler");
+ public static final long CONSTANT_SEARCH_TIME_LIMIT = 60 * 1000L; // one minute
private final Project myProject;
private final SequentialTaskExecutor myTaskExecutor = new SequentialTaskExecutor(PooledThreadExecutor.INSTANCE);
+ private volatile long myConstantSearchTime = 0L;
protected DefaultMessageHandler(Project project) {
myProject = project;
@@ -119,14 +121,25 @@
boolean canceled = false;
final Ref<Boolean> isSuccess = Ref.create(Boolean.TRUE);
final Set<String> affectedPaths = Collections.synchronizedSet(new HashSet<String>()); // PsiSearchHelper runs multiple threads
+ final long searchStart = System.currentTimeMillis();
try {
- if (isDumbMode()) {
+ if (myConstantSearchTime > CONSTANT_SEARCH_TIME_LIMIT) {
+ // skipping constant search and letting the build rebuild dependent modules
+ isSuccess.set(Boolean.FALSE);
+ LOG.debug("Total constant search time exceeded time limit for this build session");
+ }
+ else if(isDumbMode()) {
// do not wait until dumb mode finishes
isSuccess.set(Boolean.FALSE);
LOG.debug("Constant search task: cannot search in dumb mode");
}
else {
final String qualifiedName = ownerClassName.replace('$', '.');
+
+ handleCompileMessage(sessionId, CmdlineProtoUtil.createCompileProgressMessageResponse(
+ "Searching for usages of changed/removed constants for class " + qualifiedName
+ ).getCompileMessage());
+
final PsiClass[] classes = ApplicationManager.getApplication().runReadAction(new Computable<PsiClass[]>() {
public PsiClass[] compute() {
return JavaPsiFacade.getInstance(myProject).findClasses(qualifiedName, GlobalSearchScope.allScope(myProject));
@@ -202,6 +215,7 @@
throw e;
}
finally {
+ myConstantSearchTime += (System.currentTimeMillis() - searchStart);
if (!canceled) {
notifyConstantSearchFinished(channel, sessionId, ownerClassName, fieldName, isSuccess, affectedPaths);
}
diff --git a/java/compiler/impl/src/com/intellij/openapi/projectRoots/impl/MockJdkWrapper.java b/java/compiler/impl/src/com/intellij/openapi/projectRoots/impl/MockJdkWrapper.java
index c5b6c66..779df52 100644
--- a/java/compiler/impl/src/com/intellij/openapi/projectRoots/impl/MockJdkWrapper.java
+++ b/java/compiler/impl/src/com/intellij/openapi/projectRoots/impl/MockJdkWrapper.java
@@ -93,7 +93,7 @@
@NotNull
public SdkModificator getSdkModificator() {
- return null;
+ return myDelegate.getSdkModificator();
}
public Sdk getDelegate() {
diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactCompilerCompileItem.java b/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactCompilerCompileItem.java
deleted file mode 100644
index b4e1865..0000000
--- a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactCompilerCompileItem.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2000-2010 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.packaging.impl.compiler;
-
-import com.intellij.openapi.compiler.generic.VirtualFileCompileItem;
-import com.intellij.compiler.impl.packagingCompiler.DestinationInfo;
-import com.intellij.openapi.util.Pair;
-import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.util.SmartList;
-import com.intellij.util.io.DataExternalizer;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.List;
-
-/**
- * @author nik
- */
-public class ArtifactCompilerCompileItem extends VirtualFileCompileItem<ArtifactPackagingItemOutputState> {
- public static final DataExternalizer<ArtifactPackagingItemOutputState> OUTPUT_EXTERNALIZER = new ArtifactPackagingItemExternalizer();
- private final List<DestinationInfo> myDestinations = new SmartList<DestinationInfo>();
-
- public ArtifactCompilerCompileItem(VirtualFile file) {
- super(file);
- }
-
- public void addDestination(DestinationInfo info) {
- myDestinations.add(info);
- }
-
- public List<DestinationInfo> getDestinations() {
- return myDestinations;
- }
-
- @NotNull
- @Override
- public ArtifactPackagingItemOutputState computeOutputState() {
- final SmartList<Pair<String, Long>> pairs = new SmartList<Pair<String, Long>>();
- for (DestinationInfo destination : myDestinations) {
- destination.update();
- final VirtualFile outputFile = destination.getOutputFile();
- long timestamp = outputFile != null ? outputFile.getTimeStamp() : -1;
- pairs.add(Pair.create(destination.getOutputPath(), timestamp));
- }
- return new ArtifactPackagingItemOutputState(pairs);
- }
-
- @Override
- public boolean isOutputUpToDate(@NotNull ArtifactPackagingItemOutputState state) {
- final SmartList<Pair<String, Long>> cachedDestinations = state.myDestinations;
- if (cachedDestinations.size() != myDestinations.size()) {
- return false;
- }
-
- for (DestinationInfo info : myDestinations) {
- final VirtualFile outputFile = info.getOutputFile();
- long timestamp = outputFile != null ? outputFile.getTimeStamp() : -1;
- final String path = info.getOutputPath();
- boolean found = false;
- //todo[nik] use map if list contains many items
- for (Pair<String, Long> cachedDestination : cachedDestinations) {
- if (cachedDestination.first.equals(path)) {
- if (cachedDestination.second != timestamp) return false;
- found = true;
- break;
- }
- }
- if (!found) return false;
- }
-
- return true;
- }
-
-}
diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactCompilerUtil.java b/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactCompilerUtil.java
index 0c2a151..d4070de 100644
--- a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactCompilerUtil.java
+++ b/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactCompilerUtil.java
@@ -15,129 +15,26 @@
*/
package com.intellij.packaging.impl.compiler;
-import com.intellij.facet.Facet;
-import com.intellij.facet.FacetManager;
-import com.intellij.facet.FacetRootsProvider;
import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.application.Result;
-import com.intellij.openapi.compiler.CompileContext;
-import com.intellij.openapi.compiler.CompilerMessageCategory;
-import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.module.Module;
-import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.openapi.vfs.JarFileSystem;
-import com.intellij.openapi.vfs.VfsUtilCore;
-import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.packaging.artifacts.Artifact;
import com.intellij.packaging.artifacts.ArtifactManager;
-import com.intellij.packaging.elements.PackagingElement;
-import com.intellij.packaging.elements.PackagingElementResolvingContext;
-import com.intellij.packaging.impl.artifacts.ArtifactUtil;
-import com.intellij.packaging.impl.elements.FileOrDirectoryCopyPackagingElement;
-import com.intellij.util.Processor;
-import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.MultiMap;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope;
import org.jetbrains.jps.incremental.artifacts.ArtifactBuildTargetType;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
/**
* @author nik
*/
public class ArtifactCompilerUtil {
- private static final Logger LOG = Logger.getInstance("#com.intellij.packaging.impl.compiler.ArtifactCompilerUtil");
-
private ArtifactCompilerUtil() {
}
- @Nullable
- public static BufferedInputStream getJarEntryInputStream(VirtualFile sourceFile, final CompileContext context) throws IOException {
- final String fullPath = sourceFile.getPath();
- final int jarEnd = fullPath.indexOf(JarFileSystem.JAR_SEPARATOR);
- LOG.assertTrue(jarEnd != -1, fullPath);
- String pathInJar = fullPath.substring(jarEnd + JarFileSystem.JAR_SEPARATOR.length());
- String jarPath = fullPath.substring(0, jarEnd);
- final ZipFile jarFile = new ZipFile(new File(FileUtil.toSystemDependentName(jarPath)));
- final ZipEntry entry = jarFile.getEntry(pathInJar);
- if (entry == null) {
- context.addMessage(CompilerMessageCategory.ERROR, "Cannot extract '" + pathInJar + "' from '" + jarFile.getName() + "': entry not found", null, -1, -1);
- return null;
- }
-
- return new BufferedInputStream(jarFile.getInputStream(entry)) {
- @Override
- public void close() throws IOException {
- super.close();
- jarFile.close();
- }
- };
- }
-
- public static File getJarFile(VirtualFile jarEntry) {
- String fullPath = jarEntry.getPath();
- return new File(FileUtil.toSystemDependentName(fullPath.substring(fullPath.indexOf(JarFileSystem.JAR_SEPARATOR))));
- }
-
-
- @NotNull
- public static Set<VirtualFile> getArtifactOutputsContainingSourceFiles(final @NotNull Project project) {
- final List<VirtualFile> allOutputs = new ArrayList<VirtualFile>();
- for (Artifact artifact : ArtifactManager.getInstance(project).getArtifacts()) {
- ContainerUtil.addIfNotNull(artifact.getOutputFile(), allOutputs);
- }
-
- final Set<VirtualFile> roots = new HashSet<VirtualFile>();
- final PackagingElementResolvingContext context = ArtifactManager.getInstance(project).getResolvingContext();
- for (Artifact artifact : ArtifactManager.getInstance(project).getArtifacts()) {
- Processor<PackagingElement<?>> processor = new Processor<PackagingElement<?>>() {
- @Override
- public boolean process(@NotNull PackagingElement<?> element) {
- if (element instanceof FileOrDirectoryCopyPackagingElement<?>) {
- final VirtualFile file = ((FileOrDirectoryCopyPackagingElement)element).findFile();
- if (file != null) {
- roots.add(file);
- }
- }
- return true;
- }
- };
- ArtifactUtil.processRecursivelySkippingIncludedArtifacts(artifact, processor, context);
- }
-
- final Module[] modules = ModuleManager.getInstance(project).getModules();
- for (Module module : modules) {
- final Facet[] facets = FacetManager.getInstance(module).getAllFacets();
- for (Facet facet : facets) {
- if (facet instanceof FacetRootsProvider) {
- roots.addAll(((FacetRootsProvider)facet).getFacetRoots());
- }
- }
- }
-
- final Set<VirtualFile> affectedOutputPaths = new HashSet<VirtualFile>();
- for (VirtualFile output : allOutputs) {
- for (VirtualFile root : roots) {
- if (VfsUtilCore.isAncestor(output, root, false)) {
- affectedOutputPaths.add(output);
- }
- }
- }
- return affectedOutputPaths;
- }
public static boolean containsArtifacts(List<TargetTypeBuildScope> scopes) {
for (TargetTypeBuildScope scope : scopes) {
diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactPackagingItemExternalizer.java b/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactPackagingItemExternalizer.java
deleted file mode 100644
index 175cdca..0000000
--- a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactPackagingItemExternalizer.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2000-2014 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.packaging.impl.compiler;
-
-import com.intellij.openapi.util.Pair;
-import com.intellij.util.SmartList;
-import com.intellij.util.io.DataExternalizer;
-import com.intellij.util.io.IOUtil;
-import org.jetbrains.annotations.NotNull;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-/**
-* @author nik
-*/
-public class ArtifactPackagingItemExternalizer implements DataExternalizer<ArtifactPackagingItemOutputState> {
- @Override
- public void save(@NotNull DataOutput out, ArtifactPackagingItemOutputState value) throws IOException {
- out.writeInt(value.myDestinations.size());
- for (Pair<String, Long> pair : value.myDestinations) {
- IOUtil.writeUTF(out, pair.getFirst());
- out.writeLong(pair.getSecond());
- }
- }
-
- @Override
- public ArtifactPackagingItemOutputState read(@NotNull DataInput in) throws IOException {
- int size = in.readInt();
- SmartList<Pair<String, Long>> destinations = new SmartList<Pair<String, Long>>();
- while (size-- > 0) {
- String path = IOUtil.readUTF(in);
- long outputTimestamp = in.readLong();
- destinations.add(Pair.create(path, outputTimestamp));
- }
- return new ArtifactPackagingItemOutputState(destinations);
- }
-}
diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactPackagingItemOutputState.java b/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactPackagingItemOutputState.java
deleted file mode 100644
index 29ac0ae..0000000
--- a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactPackagingItemOutputState.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2000-2010 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.packaging.impl.compiler;
-
-import com.intellij.openapi.util.Pair;
-import com.intellij.util.SmartList;
-
-/**
-* @author nik
-*/
-public class ArtifactPackagingItemOutputState {
- public final SmartList<Pair<String, Long>> myDestinations;
-
- public ArtifactPackagingItemOutputState(SmartList<Pair<String, Long>> destinations) {
- myDestinations = destinations;
- }
-}
diff --git a/java/compiler/instrumentation-util/src/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenter.java b/java/compiler/instrumentation-util/src/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenter.java
index 3bc0dc0..686791e 100644
--- a/java/compiler/instrumentation-util/src/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenter.java
+++ b/java/compiler/instrumentation-util/src/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenter.java
@@ -15,11 +15,11 @@
*/
package com.intellij.compiler.notNullVerification;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
import org.jetbrains.org.objectweb.asm.*;
-import java.util.ArrayList;
import java.util.LinkedHashMap;
-import java.util.List;
import java.util.Map;
/**
@@ -100,6 +100,15 @@
myClassName = name;
}
+ private static class NotNullState {
+ @Nullable String message;
+ @NotNull String exceptionType;
+
+ NotNullState(String exceptionType) {
+ this.exceptionType = exceptionType;
+ }
+ }
+
@Override
public MethodVisitor visitMethod(final int access, final String name, String desc, String signature, String[] exceptions) {
final Type[] args = Type.getArgumentTypes(desc);
@@ -107,29 +116,32 @@
final MethodVisitor v = cv.visitMethod(access, name, desc, signature, exceptions);
final Map<Integer, String> paramNames = myMethodParamNames.get(myClassName + '.' + name + desc);
return new MethodVisitor(Opcodes.ASM5, v) {
-
- private final List<Integer> myNotNullParams = new ArrayList<Integer>();
+ private final Map<Integer, NotNullState> myNotNullParams = new LinkedHashMap<Integer, NotNullState>();
private int mySyntheticCount = 0;
- private boolean myIsNotNull = false;
- private String myMessage = null;
+ private NotNullState myMethodNotNull;
private Label myStartGeneratedCodeLabel;
+ private AnnotationVisitor collectNotNullArgs(AnnotationVisitor base, final NotNullState state) {
+ return new AnnotationVisitor(Opcodes.ASM5, base) {
+ @Override
+ public void visit(String methodName, Object o) {
+ if (ANNOTATION_DEFAULT_METHOD.equals(methodName) && !((String) o).isEmpty()) {
+ state.message = (String) o;
+ }
+ else if ("exception".equals(methodName) && o instanceof Type && !((Type)o).getClassName().equals(Exception.class.getName())) {
+ state.exceptionType = ((Type)o).getInternalName();
+ }
+ super.visit(methodName, o);
+ }
+ };
+ }
+
public AnnotationVisitor visitParameterAnnotation(final int parameter, final String anno, final boolean visible) {
AnnotationVisitor av = mv.visitParameterAnnotation(parameter, anno, visible);
if (isReferenceType(args[parameter]) && anno.equals(NOT_NULL_TYPE)) {
- myNotNullParams.add(new Integer(parameter));
- av = new AnnotationVisitor(Opcodes.ASM5, av) {
- @Override
- public void visit(String methodName, Object o) {
- if(ANNOTATION_DEFAULT_METHOD.equals(methodName)) {
- String message = (String) o;
- if(!message.isEmpty()) {
- myMessage = message;
- }
- }
- super.visit(methodName, o);
- }
- };
+ NotNullState state = new NotNullState(IAE_CLASS_NAME);
+ myNotNullParams.put(new Integer(parameter), state);
+ av = collectNotNullArgs(av, state);
}
else if (anno.equals(SYNTHETIC_TYPE)) {
// see http://forge.ow2.org/tracker/?aid=307392&group_id=23&atid=100023&func=detail
@@ -143,19 +155,8 @@
public AnnotationVisitor visitAnnotation(String anno, boolean isRuntime) {
AnnotationVisitor av = mv.visitAnnotation(anno, isRuntime);
if (isReferenceType(returnType) && anno.equals(NOT_NULL_TYPE)) {
- myIsNotNull = true;
- av = new AnnotationVisitor(Opcodes.ASM5, av) {
- @Override
- public void visit(String methodName, Object o) {
- if(ANNOTATION_DEFAULT_METHOD.equals(methodName)) {
- String message = (String) o;
- if(!message.isEmpty()) {
- myMessage = message;
- }
- }
- super.visit(methodName, o);
- }
- };
+ myMethodNotNull = new NotNullState(ISE_CLASS_NAME);
+ av = collectNotNullArgs(av, myMethodNotNull);
}
return av;
@@ -167,7 +168,8 @@
myStartGeneratedCodeLabel = new Label();
mv.visitLabel(myStartGeneratedCodeLabel);
}
- for (Integer param : myNotNullParams) {
+ for (Map.Entry<Integer, NotNullState> entry : myNotNullParams.entrySet()) {
+ Integer param = entry.getKey();
int var = ((access & ACC_STATIC) == 0) ? 1 : 0;
for (int i = 0; i < param; ++i) {
var += args[i].getSize();
@@ -177,14 +179,15 @@
Label end = new Label();
mv.visitJumpInsn(IFNONNULL, end);
+ NotNullState state = entry.getValue();
String paramName = paramNames == null ? null : paramNames.get(param);
- String descrPattern = myMessage != null
- ? myMessage
+ String descrPattern = state.message != null
+ ? state.message
: paramName != null ? NULL_ARG_MESSAGE_NAMED : NULL_ARG_MESSAGE_INDEXED;
- String[] args = myMessage != null
+ String[] args = state.message != null
? EMPTY_STRING_ARRAY
: new String[]{paramName != null ? paramName : String.valueOf(param - mySyntheticCount), myClassName, name};
- generateThrow(IAE_CLASS_NAME, end, descrPattern, args);
+ generateThrow(state.exceptionType, end, descrPattern, args);
}
}
@@ -199,13 +202,13 @@
@Override
public void visitInsn(int opcode) {
if (opcode == ARETURN) {
- if (myIsNotNull) {
+ if (myMethodNotNull != null) {
mv.visitInsn(DUP);
final Label skipLabel = new Label();
mv.visitJumpInsn(IFNONNULL, skipLabel);
- String descrPattern = myMessage != null ? myMessage : NULL_RESULT_MESSAGE;
- String[] args = myMessage != null ? EMPTY_STRING_ARRAY : new String[]{myClassName, name};
- generateThrow(ISE_CLASS_NAME, skipLabel, descrPattern, args);
+ String descrPattern = myMethodNotNull.message != null ? myMethodNotNull.message : NULL_RESULT_MESSAGE;
+ String[] args = myMethodNotNull.message != null ? EMPTY_STRING_ARRAY : new String[]{myClassName, name};
+ generateThrow(myMethodNotNull.exceptionType, skipLabel, descrPattern, args);
}
}
diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildInstruction.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildInstruction.java
deleted file mode 100644
index eed2e77..0000000
--- a/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildInstruction.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.openapi.compiler.make;
-
-/**
- * @deprecated this class is part of the obsolete build system which runs as part of the IDE process. Since IDEA 12 plugins need to
- * integrate into 'external build system' instead (http://confluence.jetbrains.com/display/IDEADEV/External+Builder+API+and+Plugins).
- * Since IDEA 13 users cannot switch to the old build system via UI and it will be completely removed in IDEA 14.
- */
-public interface BuildInstruction {
- String getOutputRelativePath();
-
- boolean accept(BuildInstructionVisitor visitor) throws Exception;
-}
diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildInstructionVisitor.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildInstructionVisitor.java
deleted file mode 100644
index 0bd62be..0000000
--- a/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildInstructionVisitor.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.openapi.compiler.make;
-
-/**
- * @deprecated this class is part of the obsolete build system which runs as part of the IDE process. Since IDEA 12 plugins need to
- * integrate into 'external build system' instead (http://confluence.jetbrains.com/display/IDEADEV/External+Builder+API+and+Plugins).
- * Since IDEA 13 users cannot switch to the old build system via UI and it will be completely removed in IDEA 14.
- */
-public abstract class BuildInstructionVisitor {
- public boolean visitInstruction(BuildInstruction instruction) throws Exception {
- return true;
- }
- public boolean visitFileCopyInstruction(FileCopyInstruction instruction) throws Exception {
- return visitInstruction(instruction);
- }
-}
\ No newline at end of file
diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildParticipant.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildParticipant.java
deleted file mode 100644
index 9777724..0000000
--- a/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildParticipant.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.openapi.compiler.make;
-
-import com.intellij.openapi.compiler.CompileContext;
-import com.intellij.packaging.artifacts.Artifact;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * @deprecated this class is part of the obsolete build system which runs as part of the IDE process. Since IDEA 12 plugins need to
- * integrate into 'external build system' instead (http://confluence.jetbrains.com/display/IDEADEV/External+Builder+API+and+Plugins).
- * Since IDEA 13 users cannot switch to the old build system via UI and it will be completely removed in IDEA 14.
- */
-public abstract class BuildParticipant {
- public static final BuildParticipant[] EMPTY_ARRAY = new BuildParticipant[0];
-
- @Nullable
- public abstract Artifact createArtifact(CompileContext context);
-
-}
diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildParticipantProvider.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildParticipantProvider.java
deleted file mode 100644
index 374e161..0000000
--- a/java/compiler/openapi/src/com/intellij/openapi/compiler/make/BuildParticipantProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.openapi.compiler.make;
-
-import com.intellij.openapi.extensions.ExtensionPointName;
-import com.intellij.openapi.module.Module;
-
-import java.util.Collection;
-
-/**
- * @author nik
- *
- * @deprecated this class is part of the obsolete build system which runs as part of the IDE process. Since IDEA 12 plugins need to
- * integrate into 'external build system' instead (http://confluence.jetbrains.com/display/IDEADEV/External+Builder+API+and+Plugins).
- * Since IDEA 13 users cannot switch to the old build system via UI and it will be completely removed in IDEA 14.
- */
-public abstract class BuildParticipantProvider {
- public static final ExtensionPointName<BuildParticipantProvider> EXTENSION_POINT_NAME = ExtensionPointName.create("com.intellij.compiler.buildParticipantProvider");
-
-
- public abstract Collection<? extends BuildParticipant> getParticipants(Module module);
-
-}
diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/make/FileCopyInstruction.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/make/FileCopyInstruction.java
deleted file mode 100644
index c563639..0000000
--- a/java/compiler/openapi/src/com/intellij/openapi/compiler/make/FileCopyInstruction.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.openapi.compiler.make;
-
-import java.io.File;
-
-/**
- * @deprecated this class is part of the obsolete build system which runs as part of the IDE process. Since IDEA 12 plugins need to
- * integrate into 'external build system' instead (http://confluence.jetbrains.com/display/IDEADEV/External+Builder+API+and+Plugins).
- * Since IDEA 13 users cannot switch to the old build system via UI and it will be completely removed in IDEA 14.
- */
-public interface FileCopyInstruction extends BuildInstruction {
- File getFile();
-
- boolean isDirectory();
-
-}
\ No newline at end of file
diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/QuickEvaluateActionHandler.java b/java/debugger/impl/src/com/intellij/debugger/actions/QuickEvaluateActionHandler.java
index 6eedff4..2696f22 100644
--- a/java/debugger/impl/src/com/intellij/debugger/actions/QuickEvaluateActionHandler.java
+++ b/java/debugger/impl/src/com/intellij/debugger/actions/QuickEvaluateActionHandler.java
@@ -22,13 +22,13 @@
import com.intellij.debugger.DebuggerManagerEx;
import com.intellij.debugger.impl.DebuggerSession;
-import com.intellij.debugger.settings.DebuggerSettings;
import com.intellij.debugger.ui.ValueHint;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.xdebugger.impl.evaluate.quick.common.AbstractValueHint;
import com.intellij.xdebugger.impl.evaluate.quick.common.QuickEvaluateHandler;
import com.intellij.xdebugger.impl.evaluate.quick.common.ValueHintType;
+import com.intellij.xdebugger.settings.XDebuggerSettingsManager;
import org.jetbrains.annotations.NotNull;
import java.awt.*;
@@ -53,6 +53,6 @@
@Override
public int getValueLookupDelay(final Project project) {
- return DebuggerSettings.getInstance().VALUE_LOOKUP_DELAY;
+ return XDebuggerSettingsManager.getInstance().getDataViewSettings().getValueLookupDelay();
}
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/JavaStackFrame.java b/java/debugger/impl/src/com/intellij/debugger/engine/JavaStackFrame.java
index ed4d829..bcd8257 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/JavaStackFrame.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/JavaStackFrame.java
@@ -27,7 +27,6 @@
import com.intellij.debugger.jdi.*;
import com.intellij.debugger.settings.DebuggerSettings;
import com.intellij.debugger.settings.NodeRendererSettings;
-import com.intellij.debugger.settings.ViewsGeneralSettings;
import com.intellij.debugger.ui.breakpoints.Breakpoint;
import com.intellij.debugger.ui.impl.FrameVariablesTree;
import com.intellij.debugger.ui.impl.watch.*;
@@ -47,6 +46,7 @@
import com.intellij.xdebugger.frame.XStackFrame;
import com.intellij.xdebugger.frame.XValueChildrenList;
import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants;
+import com.intellij.xdebugger.settings.XDebuggerSettingsManager;
import com.sun.jdi.*;
import com.sun.jdi.event.Event;
import com.sun.jdi.event.ExceptionEvent;
@@ -66,7 +66,6 @@
private final DebugProcessImpl myDebugProcess;
private final XSourcePosition myXSourcePosition;
- private final SourcePosition mySourcePosition;
private final NodeManagerImpl myNodeManager;
private final StackFrameDescriptorImpl myDescriptor;
private static final JavaFramesListRenderer FRAME_RENDERER = new JavaFramesListRenderer();
@@ -74,43 +73,22 @@
public JavaStackFrame(@NotNull StackFrameProxyImpl stackFrameProxy, @NotNull DebugProcessImpl debugProcess, MethodsTracker tracker) {
myDebugProcess = debugProcess;
- Pair<SourcePosition, XSourcePosition> positions = calcSourcePosition(stackFrameProxy);
- mySourcePosition = positions.getFirst();
- myXSourcePosition = positions.getSecond();
myNodeManager = debugProcess.getXdebugProcess().getNodeManager();
myDescriptor = new StackFrameDescriptorImpl(stackFrameProxy, tracker);
myDescriptor.setContext(null);
myDescriptor.updateRepresentation(null, DescriptorLabelListener.DUMMY_LISTENER);
+ myXSourcePosition = ApplicationManager.getApplication().runReadAction(new Computable<XSourcePosition>() {
+ @Override
+ public XSourcePosition compute() {
+ return myDescriptor.getSourcePosition() != null ? DebuggerUtilsEx.toXSourcePosition(myDescriptor.getSourcePosition()) : null;
+ }
+ });
}
public StackFrameDescriptorImpl getDescriptor() {
return myDescriptor;
}
- private Pair<SourcePosition, XSourcePosition> calcSourcePosition(StackFrameProxyImpl stackFrameProxy) {
- final CompoundPositionManager positionManager = myDebugProcess.getPositionManager();
- if (positionManager == null) {
- // process already closed
- return null;
- }
- Location location = null;
- try {
- location = stackFrameProxy.location();
- }
- catch (Throwable e) {
- LOG.info(e);
- }
- final Location loc = location;
- return ApplicationManager.getApplication().runReadAction(new Computable<Pair<SourcePosition, XSourcePosition>>() {
- @Override
- public Pair<SourcePosition, XSourcePosition> compute() {
- SourcePosition position = positionManager.getSourcePosition(loc);
- XSourcePosition xSourcePosition = position != null ? DebuggerUtilsEx.toXSourcePosition(position) : null;
- return new Pair<SourcePosition, XSourcePosition>(position, xSourcePosition);
- }
- });
- }
-
@Nullable
@Override
public XDebuggerEvaluator getEvaluator() {
@@ -174,7 +152,7 @@
threadSuspendContext,
getStackFrameProxy().threadProxy(),
getStackFrameProxy());
- context.setPositionCache(mySourcePosition);
+ context.setPositionCache(myDescriptor.getSourcePosition());
context.initCaches();
}
return context;
@@ -293,7 +271,7 @@
}
try {
- if (!ViewsGeneralSettings.getInstance().ENABLE_AUTO_EXPRESSIONS && !myAutoWatchMode) {
+ if (!XDebuggerSettingsManager.getInstance().getDataViewSettings().isAutoExpressions() && !myAutoWatchMode) {
// optimization
superBuildVariables(evaluationContext, children);
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java b/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java
index 6af021c..0a691d3 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java
@@ -58,7 +58,10 @@
private final EvaluationContextImpl myEvaluationContext;
private final NodeManagerImpl myNodeManager;
- private JavaValue(JavaValue parent, @NotNull ValueDescriptorImpl valueDescriptor, EvaluationContextImpl evaluationContext, NodeManagerImpl nodeManager) {
+ private JavaValue(JavaValue parent,
+ @NotNull ValueDescriptorImpl valueDescriptor,
+ @NotNull EvaluationContextImpl evaluationContext,
+ NodeManagerImpl nodeManager) {
super(valueDescriptor.getName());
myParent = parent;
myValueDescriptor = valueDescriptor;
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/MethodEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/MethodEvaluator.java
index d299af1..69cbb14 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/MethodEvaluator.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/MethodEvaluator.java
@@ -83,8 +83,8 @@
ReferenceType referenceType = null;
if(object instanceof ObjectReference) {
- final ReferenceType qualifierType = ((ObjectReference)object).referenceType();
- referenceType = debugProcess.findClass(context, qualifierType.name(), qualifierType.classLoader());
+ // it seems that if we have an object of the class, the class must be ready, so no need to use findClass here
+ referenceType = ((ObjectReference)object).referenceType();
}
else if(object instanceof ClassType) {
final ClassType qualifierType = (ClassType)object;
diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java
index e937aac..026b711 100644
--- a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java
+++ b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java
@@ -45,6 +45,7 @@
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
import com.intellij.ui.classFilter.ClassFilter;
import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
import com.intellij.xdebugger.XSourcePosition;
import com.intellij.xdebugger.impl.XSourcePositionImpl;
import com.sun.jdi.*;
@@ -199,7 +200,7 @@
public static ClassFilter create(Element element) throws InvalidDataException {
ClassFilter filter = new ClassFilter();
- filter.readExternal(element);
+ DefaultJDOMExternalizer.readExternal(filter, element);
return filter;
}
@@ -245,24 +246,23 @@
return res;
}
- public static ClassFilter[] readFilters(List children) throws InvalidDataException {
- if (children == null || children.size() == 0) {
+ public static ClassFilter[] readFilters(List<Element> children) throws InvalidDataException {
+ if (ContainerUtil.isEmpty(children)) {
return ClassFilter.EMPTY_ARRAY;
}
- List<ClassFilter> classFiltersList = new ArrayList<ClassFilter>(children.size());
- for (Object aChildren : children) {
- final ClassFilter classFilter = new ClassFilter();
- classFilter.readExternal((Element)aChildren);
- classFiltersList.add(classFilter);
+
+ ClassFilter[] filters = new ClassFilter[children.size()];
+ for (int i = 0, size = children.size(); i < size; i++) {
+ filters[i] = create(children.get(i));
}
- return classFiltersList.toArray(new ClassFilter[classFiltersList.size()]);
+ return filters;
}
public static void writeFilters(Element parentNode, @NonNls String tagName, ClassFilter[] filters) throws WriteExternalException {
for (ClassFilter filter : filters) {
Element element = new Element(tagName);
parentNode.addContent(element);
- filter.writeExternal(element);
+ DefaultJDOMExternalizer.writeExternal(filter, element);
}
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/JavaEditorTextProviderImpl.java b/java/debugger/impl/src/com/intellij/debugger/impl/JavaEditorTextProviderImpl.java
index 11b0773..7b76b973 100644
--- a/java/debugger/impl/src/com/intellij/debugger/impl/JavaEditorTextProviderImpl.java
+++ b/java/debugger/impl/src/com/intellij/debugger/impl/JavaEditorTextProviderImpl.java
@@ -107,7 +107,10 @@
else if (parent instanceof PsiThisExpression) {
expression = parent;
}
- else if (parent instanceof PsiInstanceOfExpression || parent instanceof PsiBinaryExpression || parent instanceof PsiPolyadicExpression) {
+ else if (parent instanceof PsiInstanceOfExpression
+ || parent instanceof PsiBinaryExpression
+ || parent instanceof PsiPolyadicExpression
+ || parent instanceof PsiPrefixExpression) {
if (allowMethodCalls || !DebuggerUtils.hasSideEffects(parent)) {
expression = parent;
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java b/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java
index 86fb655..d6aa237 100644
--- a/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java
+++ b/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java
@@ -232,15 +232,16 @@
static {
int i;
byte[] b = new byte[220];
- String s = "AAAAAAAAAAAAAAAABCLMMDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADD"
- + "DDDEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
- + "AAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAJJJJJJJJJJJJJJJJDOPAA"
- + "AAAAGGGGGGGHIFBFAAFFAARQJJKKJJJJJJJJJJJJJJJJJJ";
- for (i = 0; i < b.length; ++i) {
- b[i] = (byte) (s.charAt(i) - 'A');
- }
- TYPE = b;
+ String s =
+ "AAAAAAAAAAAAAAAABCLMMDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADDDDDEE" +
+ "EEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +
+ "AAAAAAAAAANAAAAAAAAAAAAAAAAAAAAJJJJJJJJJJJJJJJJDOPAAAAAAGGGGG" +
+ "GGHIFBFAAFFAARQJJKKJLMMGGGGGGGGGGGGHGAFFQFFGGG";
+ for (i = 0; i < b.length; ++i) {
+ b[i] = (byte) (s.charAt(i) - 'A');
}
+ TYPE = b;
+ }
static final int NOP = 0; // visitInsn
@@ -446,4 +447,139 @@
static final int GOTO_W = 200; // -
static final int JSR_W = 201; // -
+ // JVM runtime-specific and reserved opcodes:
+ // From JVM specification:
+ // In addition to the opcodes of the instructions specified later in this chapter, which are used in class files (§4), three opcodes are reserved for internal use by a Java Virtual Machine implementation. If the instruction set of the Java Virtual Machine is extended in the future, these reserved opcodes are guaranteed not to be used.
+ // Two of the reserved opcodes, numbers 254 (0xfe) and 255 (0xff), have the mnemonics impdep1 and impdep2, respectively. These instructions are intended to provide "back doors" or traps to implementation-specific functionality implemented in software and hardware, respectively. The third reserved opcode, number 202 (0xca), has the mnemonic breakpoint and is intended to be used by debuggers to implement breakpoints.
+ // Although these opcodes have been reserved, they may be used only inside a Java Virtual Machine implementation. They cannot appear in valid class files. Tools such as debuggers or JIT code generators (§2.13) that might directly interact with Java Virtual Machine code that has been already loaded and executed may encounter these opcodes. Such tools should attempt to behave gracefully if they encounter any of these reserved instructions.
+
+ static final int BREAKPOINT = 202;
+ static final int LDC_QUICK = 203;
+ static final int LDC_W_QUICK = 204;
+ static final int LDC2_W_QUICK = 205;
+ static final int GETFIELD_QUICK = 206;
+ static final int PUTFIELD_QUICK = 207;
+ static final int GETFIELD2_QUICK = 208;
+ static final int PUTFIELD2_QUICK = 209;
+ static final int GETSTATIC_QUICK = 210;
+ static final int PUTSTATIC_QUICK = 211;
+ static final int GETSTATIC2_QUICK = 212;
+ static final int PUTSTATIC2_QUICK = 213;
+ static final int INVOKEVIRTUAL_QUICK = 214;
+ static final int INVOKENONVIRTUAL_QUICK = 215;
+ static final int INVOKESUPER_QUICK = 216;
+ static final int INVOKESTATIC_QUICK = 217;
+ static final int INVOKEINTERFACE_QUICK = 218;
+ static final int INVOKEVIRTUALOBJECT_QUICK = 219;
+ static final int NEW_QUICK = 221;
+ static final int ANEWARRAY_QUICK = 222;
+ static final int MULTIANEWARRAY_QUICK = 223;
+ static final int CHECKCAST_QUICK = 224;
+ static final int INSTANCEOF_QUICK = 225;
+ static final int INVOKEVIRTUAL_QUICK_W = 226;
+ static final int GETFIELD_QUICK_W = 227;
+ static final int PUTFIELD_QUICK_W = 228;
+ static final int IMPDEP1 = 254;
+ static final int IMPDEP2 = 255;
+
+ public static void main(String[] args) {
+ int[] b = new int[229];
+ //code to generate the above string
+
+ // SBYTE_INSN instructions
+ b[NEWARRAY] = SBYTE_INSN;
+ b[BIPUSH] = SBYTE_INSN;
+
+ // SHORT_INSN instructions
+ b[SIPUSH] = SHORT_INSN;
+
+ // (IMPL)VAR_INSN instructions
+ b[RET] = VAR_INSN;
+ for (int i = ILOAD; i <= ALOAD; ++i) {
+ b[i] = VAR_INSN;
+ }
+ for (int i = ISTORE; i <= ASTORE; ++i) {
+ b[i] = VAR_INSN;
+ }
+ for (int i = 26; i <= 45; ++i) { // ILOAD_0 to ALOAD_3
+ b[i] = IMPLVAR_INSN;
+ }
+ for (int i = 59; i <= 78; ++i) { // ISTORE_0 to ASTORE_3
+ b[i] = IMPLVAR_INSN;
+ }
+
+ // TYPE_INSN instructions
+ b[NEW] = TYPE_INSN;
+ b[ANEWARRAY] = TYPE_INSN;
+ b[CHECKCAST] = TYPE_INSN;
+ b[INSTANCEOF] = TYPE_INSN;
+
+ // (Set)FIELDORMETH_INSN instructions
+ for (int i = GETSTATIC; i <= INVOKESTATIC; ++i) {
+ b[i] = FIELDORMETH_INSN;
+ }
+ b[INVOKEINTERFACE] = ITFMETH_INSN;
+ b[INVOKEDYNAMIC] = INDYMETH_INSN;
+
+ // LABEL(W)_INSN instructions
+ for (int i = IFEQ; i <= JSR; ++i) {
+ b[i] = LABEL_INSN;
+ }
+ b[IFNULL] = LABEL_INSN;
+ b[IFNONNULL] = LABEL_INSN;
+ b[GOTO_W] = LABELW_INSN; // GOTO_W
+ b[JSR_W] = LABELW_INSN; // JSR_W
+
+ b[BREAKPOINT] = LABEL_INSN; // todo: is this correct?
+
+ // LDC(_W) instructions
+ b[LDC] = LDC_INSN;
+ b[LDC_W] = LDCW_INSN; // LDC_W
+ b[LDC2_W] = LDCW_INSN; // LDC2_W
+
+ // special instructions
+ b[IINC] = IINC_INSN;
+ b[TABLESWITCH] = TABL_INSN;
+ b[LOOKUPSWITCH] = LOOK_INSN;
+ b[MULTIANEWARRAY] = MANA_INSN;
+ b[WIDE] = WIDE_INSN; // WIDE
+
+ // runtime-specific
+
+ b[LDC_QUICK] = LDC_INSN; // = 203;
+ b[LDC_W_QUICK] = LDCW_INSN; // = 204;
+ b[LDC2_W_QUICK] = LDCW_INSN; // = 205;
+ b[GETFIELD_QUICK] = FIELDORMETH_INSN; // = 206;
+ b[PUTFIELD_QUICK] = FIELDORMETH_INSN; // = 207;
+
+ b[GETFIELD2_QUICK] = FIELDORMETH_INSN; // = 208;
+ b[PUTFIELD2_QUICK] = FIELDORMETH_INSN; // = 209;
+ b[GETSTATIC_QUICK] = FIELDORMETH_INSN; // = 210;
+ b[PUTSTATIC_QUICK] = FIELDORMETH_INSN; // = 211;
+ b[GETSTATIC2_QUICK] = FIELDORMETH_INSN; // = 212;
+ b[PUTSTATIC2_QUICK] = FIELDORMETH_INSN; // = 213;
+ b[INVOKEVIRTUAL_QUICK] = FIELDORMETH_INSN; // = 214;
+ b[INVOKENONVIRTUAL_QUICK] = FIELDORMETH_INSN; // = 215;
+ b[INVOKESUPER_QUICK] = FIELDORMETH_INSN; // = 216;
+ b[INVOKESTATIC_QUICK] = FIELDORMETH_INSN; // = 217;
+ b[INVOKEINTERFACE_QUICK] = ITFMETH_INSN; // = 218;
+ b[INVOKEVIRTUALOBJECT_QUICK] = FIELDORMETH_INSN; // = 219;
+ b[220] = Bytecodes.NOARG_INSN; // the ID is not used for any opcode
+ b[NEW_QUICK] = TYPE_INSN; // = 221;
+ b[ANEWARRAY_QUICK] = TYPE_INSN; // = 222;
+ b[MULTIANEWARRAY_QUICK] = MANA_INSN; // = 223;
+ b[CHECKCAST_QUICK] = TYPE_INSN; // = 224;
+ b[INSTANCEOF_QUICK] = TYPE_INSN; // = 225;
+ b[INVOKEVIRTUAL_QUICK_W] = FIELDORMETH_INSN; // = 226;
+ b[GETFIELD_QUICK_W] = FIELDORMETH_INSN; // = 227;
+ b[PUTFIELD_QUICK_W] = FIELDORMETH_INSN; // = 228;
+
+
+ for (int i = 0; i < b.length; ++i) {
+ System.err.print((char)('A' + b[i]));
+ }
+ System.err.println();
+
+ }
+
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/jdi/InstructionParser.java b/java/debugger/impl/src/com/intellij/debugger/jdi/InstructionParser.java
index b8053a8..78bf10f 100644
--- a/java/debugger/impl/src/com/intellij/debugger/jdi/InstructionParser.java
+++ b/java/debugger/impl/src/com/intellij/debugger/jdi/InstructionParser.java
@@ -38,7 +38,8 @@
break;
}
int opcode = myCode[v] & 0xFF;
- switch (Bytecodes.TYPE[opcode]) {
+ final byte opcodeType = opcode == Bytecodes.IMPDEP1 || opcode == Bytecodes.IMPDEP2? Bytecodes.NOARG_INSN : Bytecodes.TYPE[opcode];
+ switch (opcodeType) {
case Bytecodes.NOARG_INSN:
v += 1;
break;
diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerDataViewsConfigurable.java b/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerDataViewsConfigurable.java
index db01e13..452a924 100644
--- a/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerDataViewsConfigurable.java
+++ b/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerDataViewsConfigurable.java
@@ -20,6 +20,7 @@
import com.intellij.debugger.ui.JavaDebuggerSupport;
import com.intellij.debugger.ui.tree.render.ClassRenderer;
import com.intellij.debugger.ui.tree.render.ToStringRenderer;
+import com.intellij.openapi.options.OptionsBundle;
import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.registry.Registry;
@@ -45,7 +46,6 @@
private JCheckBox myCbAutoscroll;
private JCheckBox myCbShowSyntheticFields;
private StateRestoringCheckBox myCbShowValFieldsAsLocalVariables;
- private JCheckBox myCbSort;
private JCheckBox myCbHideNullArrayElements;
private JCheckBox myCbShowStatic;
private JCheckBox myCbShowDeclaredType;
@@ -54,15 +54,13 @@
private StateRestoringCheckBox myCbShowStaticFinalFields;
private final ArrayRendererConfigurable myArrayRendererConfigurable;
- private JCheckBox myCbEnableAutoExpressions;
private JCheckBox myCbEnableAlternateViews;
private JCheckBox myCbEnableToString;
private JRadioButton myRbAllThatOverride;
private JRadioButton myRbFromList;
private ClassFilterEditor myToStringFilterEditor;
- private JTextField myValueTooltipDelayField;
-
+
private Project myProject;
private RegistryCheckBox myAutoTooltip;
@@ -71,16 +69,19 @@
myArrayRendererConfigurable = new ArrayRendererConfigurable(NodeRendererSettings.getInstance().getArrayRenderer());
}
+ @Override
public void disposeUIResources() {
myArrayRendererConfigurable.disposeUIResources();
myToStringFilterEditor = null;
myProject = null;
}
+ @Override
public String getDisplayName() {
- return DebuggerBundle.message("base.renderer.configurable.display.name");
+ return OptionsBundle.message("options.java.display.name");
}
+ @Override
public JComponent createComponent() {
if (myProject == null) {
myProject = JavaDebuggerSupport.getContextProjectForEditorFieldsInDebuggerConfigurables();
@@ -90,13 +91,12 @@
myCbAutoscroll = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.autoscroll"));
myCbShowSyntheticFields = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.synthetic.fields"));
myCbShowValFieldsAsLocalVariables = new StateRestoringCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.val.fields.as.locals"));
- myCbSort = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.sort.alphabetically"));
myCbHideNullArrayElements = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.hide.null.array.elements"));
myCbShowStatic = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.static.fields"));
myCbShowStaticFinalFields = new StateRestoringCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.static.final.fields"));
myCbEnableAlternateViews = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.alternate.view"));
- myCbEnableAutoExpressions = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.auto.expressions"));
myCbShowStatic.addChangeListener(new ChangeListener(){
+ @Override
public void stateChanged(ChangeEvent e) {
if(myCbShowStatic.isSelected()) {
myCbShowStaticFinalFields.makeSelectable();
@@ -121,14 +121,15 @@
myCbShowFQNames = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.fq.names"));
myCbShowObjectId = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.object.id"));
- myCbEnableToString = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.enable.tostring"));
- myRbAllThatOverride = new JRadioButton(DebuggerBundle.message("label.base.renderer.configurable.all.overridding"));
+ myCbEnableToString = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.enable.toString"));
+ myRbAllThatOverride = new JRadioButton(DebuggerBundle.message("label.base.renderer.configurable.all.overriding"));
myRbFromList = new JRadioButton(DebuggerBundle.message("label.base.renderer.configurable.classes.from.list"));
ButtonGroup group = new ButtonGroup();
group.add(myRbAllThatOverride);
group.add(myRbFromList);
myToStringFilterEditor = new ClassFilterEditor(myProject, null, "reference.viewBreakpoints.classFilters.newPattern");
myCbEnableToString.addItemListener(new ItemListener() {
+ @Override
public void itemStateChanged(ItemEvent e) {
final boolean enabled = myCbEnableToString.isSelected();
myRbAllThatOverride.setEnabled(enabled);
@@ -137,12 +138,12 @@
}
});
myRbFromList.addItemListener(new ItemListener() {
+ @Override
public void itemStateChanged(ItemEvent e) {
myToStringFilterEditor.setEnabled(myCbEnableToString.isSelected() && myRbFromList.isSelected());
}
});
- panel.add(myCbSort, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
panel.add(myCbAutoscroll, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 0, 0, 0), 0, 0));
@@ -151,14 +152,6 @@
DebuggerBundle.message("label.base.renderer.configurable.autoTooltip.description",
Registry.stringValue("ide.forcedShowTooltip")));
panel.add(myAutoTooltip, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 0, 0, 0), 0, 0));
-
- final JLabel tooltipLabel = new JLabel(DebuggerBundle.message("label.debugger.general.configurable.tooltips.delay"));
- panel.add(tooltipLabel, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 0, 0, 0), 0, 0));
- myValueTooltipDelayField = new JTextField(10);
- myValueTooltipDelayField.setMinimumSize(new Dimension(50, myValueTooltipDelayField.getPreferredSize().height));
- panel.add(myValueTooltipDelayField, new GridBagConstraints(2, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 0, 0, 0), 0, 0));
- tooltipLabel.setLabelFor(myValueTooltipDelayField);
-
final JPanel showPanel = new JPanel(new GridBagLayout());
showPanel.setBorder(IdeBorderFactory.createTitledBorder("Show", true));
@@ -174,12 +167,12 @@
final JPanel arraysPanel = new JPanel(new BorderLayout(0, UIUtil.DEFAULT_VGAP));
final JComponent arraysComponent = myArrayRendererConfigurable.createComponent();
+ assert arraysComponent != null;
arraysPanel.add(arraysComponent, BorderLayout.CENTER);
arraysPanel.add(myCbHideNullArrayElements, BorderLayout.SOUTH);
arraysPanel.setBorder(IdeBorderFactory.createTitledBorder("Arrays", true));
panel.add(arraysPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 3, 1, 1.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- panel.add(myCbEnableAutoExpressions, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 10), 0, 0));
panel.add(myCbEnableAlternateViews, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 0, 0, 10), 0, 0));
// starting 4-th row
panel.add(myCbEnableToString, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 0, 0, 0), 0, 0));
@@ -191,22 +184,16 @@
return panel;
}
+ @Override
public void apply() {
final ViewsGeneralSettings generalSettings = ViewsGeneralSettings.getInstance();
final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance();
- try {
- DebuggerSettings.getInstance().VALUE_LOOKUP_DELAY = Integer.parseInt(myValueTooltipDelayField.getText().trim());
- }
- catch (NumberFormatException ignored) {
- }
generalSettings.AUTOSCROLL_TO_NEW_LOCALS = myCbAutoscroll.isSelected();
rendererSettings.setAlternateCollectionViewsEnabled(myCbEnableAlternateViews.isSelected());
generalSettings.HIDE_NULL_ARRAY_ELEMENTS = myCbHideNullArrayElements.isSelected();
- generalSettings.ENABLE_AUTO_EXPRESSIONS = myCbEnableAutoExpressions.isSelected();
final ClassRenderer classRenderer = rendererSettings.getClassRenderer();
- classRenderer.SORT_ASCENDING = myCbSort.isSelected();
classRenderer.SHOW_STATIC = myCbShowStatic.isSelected();
classRenderer.SHOW_STATIC_FINAL = myCbShowStaticFinalFields.isSelectedWhenSelectable();
classRenderer.SHOW_SYNTHETICS = myCbShowSyntheticFields.isSelected();
@@ -227,15 +214,14 @@
rendererSettings.fireRenderersChanged();
}
+ @Override
public void reset() {
final ViewsGeneralSettings generalSettings = ViewsGeneralSettings.getInstance();
final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance();
- myValueTooltipDelayField.setText(Integer.toString(DebuggerSettings.getInstance().VALUE_LOOKUP_DELAY));
myCbAutoscroll.setSelected(generalSettings.AUTOSCROLL_TO_NEW_LOCALS);
myCbHideNullArrayElements.setSelected(generalSettings.HIDE_NULL_ARRAY_ELEMENTS);
myCbEnableAlternateViews.setSelected(rendererSettings.areAlternateCollectionViewsEnabled());
- myCbEnableAutoExpressions.setSelected(generalSettings.ENABLE_AUTO_EXPRESSIONS);
ClassRenderer classRenderer = rendererSettings.getClassRenderer();
@@ -244,7 +230,6 @@
if (!classRenderer.SHOW_SYNTHETICS) {
myCbShowValFieldsAsLocalVariables.makeUnselectable(false);
}
- myCbSort.setSelected(classRenderer.SORT_ASCENDING);
myCbShowStatic.setSelected(classRenderer.SHOW_STATIC);
myCbShowStaticFinalFields.setSelected(classRenderer.SHOW_STATIC_FINAL);
if(!classRenderer.SHOW_STATIC) {
@@ -268,36 +253,27 @@
myArrayRendererConfigurable.reset();
}
+ @Override
public boolean isModified() {
- return areGeneralSettingsModified() || areDefaultRenderersModified() || areDebuggerSettingsModified();
- }
-
- private boolean areDebuggerSettingsModified() {
- try {
- return DebuggerSettings.getInstance().VALUE_LOOKUP_DELAY != Integer.parseInt(myValueTooltipDelayField.getText().trim());
- }
- catch (NumberFormatException ignored) {
- }
- return false;
+ return areGeneralSettingsModified() || areDefaultRenderersModified();
}
private boolean areGeneralSettingsModified() {
ViewsGeneralSettings generalSettings = ViewsGeneralSettings.getInstance();
- return
- (generalSettings.AUTOSCROLL_TO_NEW_LOCALS != myCbAutoscroll.isSelected()) ||
- (generalSettings.ENABLE_AUTO_EXPRESSIONS != myCbEnableAutoExpressions.isSelected()) ||
- (generalSettings.HIDE_NULL_ARRAY_ELEMENTS != myCbHideNullArrayElements.isSelected()) || myAutoTooltip.isChanged();
+ return generalSettings.AUTOSCROLL_TO_NEW_LOCALS != myCbAutoscroll.isSelected() ||
+ generalSettings.HIDE_NULL_ARRAY_ELEMENTS != myCbHideNullArrayElements.isSelected() ||
+ myAutoTooltip.isChanged();
}
private boolean areDefaultRenderersModified() {
if (myArrayRendererConfigurable.isModified()) {
return true;
}
+
final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance();
final ClassRenderer classRenderer = rendererSettings.getClassRenderer();
final boolean isClassRendererModified=
- (classRenderer.SORT_ASCENDING != myCbSort.isSelected()) ||
(classRenderer.SHOW_STATIC != myCbShowStatic.isSelected()) ||
(classRenderer.SHOW_STATIC_FINAL != myCbShowStaticFinalFields.isSelectedWhenSelectable()) ||
(classRenderer.SHOW_SYNTHETICS != myCbShowSyntheticFields.isSelected()) ||
@@ -325,16 +301,20 @@
return false;
}
+ @SuppressWarnings("SpellCheckingInspection")
+ @Override
@NotNull
public String getHelpTopic() {
return "reference.idesettings.debugger.dataviews";
}
+ @Override
@NotNull
public String getId() {
return getHelpTopic();
}
+ @Override
public Runnable enableSearch(String option) {
return null;
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerLaunchingConfigurable.java b/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerLaunchingConfigurable.java
index f731c89..490f99b 100644
--- a/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerLaunchingConfigurable.java
+++ b/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerLaunchingConfigurable.java
@@ -17,23 +17,21 @@
import com.intellij.debugger.DebuggerBundle;
import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.options.OptionsBundle;
import com.intellij.openapi.util.SystemInfo;
-import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.StateRestoringCheckBox;
import com.intellij.ui.components.panels.VerticalBox;
import javax.swing.*;
-import javax.swing.border.Border;
import java.awt.*;
-public class DebuggerLaunchingConfigurable implements Configurable{
+public class DebuggerLaunchingConfigurable implements Configurable {
private JRadioButton myRbSocket;
private JRadioButton myRbShmem;
- private JCheckBox myHideDebuggerCheckBox;
private StateRestoringCheckBox myCbForceClassicVM;
private JCheckBox myCbDisableJIT;
- private JCheckBox myFocusAppCheckBox;
+ @Override
public void reset() {
final DebuggerSettings settings = DebuggerSettings.getInstance();
if (!SystemInfo.isWindows) {
@@ -49,12 +47,11 @@
}
myRbShmem.setEnabled(true);
}
- myHideDebuggerCheckBox.setSelected(settings.HIDE_DEBUGGER_ON_PROCESS_TERMINATION);
myCbForceClassicVM.setSelected(settings.FORCE_CLASSIC_VM);
myCbDisableJIT.setSelected(settings.DISABLE_JIT);
- myFocusAppCheckBox.setSelected(Registry.is("debugger.mayBringFrameToFrontOnBreakpoint"));
}
+ @Override
public void apply() {
getSettingsTo(DebuggerSettings.getInstance());
}
@@ -66,43 +63,34 @@
else {
settings.DEBUGGER_TRANSPORT = DebuggerSettings.SOCKET_TRANSPORT;
}
- settings.HIDE_DEBUGGER_ON_PROCESS_TERMINATION = myHideDebuggerCheckBox.isSelected();
settings.FORCE_CLASSIC_VM = myCbForceClassicVM.isSelectedWhenSelectable();
settings.DISABLE_JIT = myCbDisableJIT.isSelected();
- Registry.get("debugger.mayBringFrameToFrontOnBreakpoint").setValue(myFocusAppCheckBox.isSelected());
}
+ @Override
public boolean isModified() {
final DebuggerSettings currentSettings = DebuggerSettings.getInstance();
final DebuggerSettings debuggerSettings = currentSettings.clone();
getSettingsTo(debuggerSettings);
- return !debuggerSettings.equals(currentSettings) || Registry.is("debugger.mayBringFrameToFrontOnBreakpoint") != myFocusAppCheckBox.isSelected();
+ return !debuggerSettings.equals(currentSettings);
}
+ @Override
public String getDisplayName() {
- return DebuggerBundle.message("debugger.launching.configurable.display.name");
+ return OptionsBundle.message("options.java.display.name");
}
+ @Override
public String getHelpTopic() {
return "reference.idesettings.debugger.launching";
}
+ @Override
public JComponent createComponent() {
myCbForceClassicVM = new StateRestoringCheckBox(DebuggerBundle.message("label.debugger.launching.configurable.force.classic.vm"));
myCbDisableJIT = new JCheckBox(DebuggerBundle.message("label.debugger.launching.configurable.disable.jit"));
- myHideDebuggerCheckBox = new JCheckBox(DebuggerBundle.message("label.debugger.launching.configurable.hide.window"));
myRbSocket = new JRadioButton(DebuggerBundle.message("label.debugger.launching.configurable.socket"));
myRbShmem = new JRadioButton(DebuggerBundle.message("label.debugger.launching.configurable.shmem"));
- myFocusAppCheckBox = new JCheckBox(DebuggerBundle.message("label.debugger.focusAppOnBreakpoint"));
-
- int cbLeftOffset = 0;
- final Border border = myCbForceClassicVM.getBorder();
- if (border != null) {
- final Insets insets = border.getBorderInsets(myCbForceClassicVM);
- if (insets != null) {
- cbLeftOffset = insets.left;
- }
- }
final ButtonGroup gr = new ButtonGroup();
gr.add(myRbSocket);
@@ -119,8 +107,6 @@
panel.add(transportPanel);
panel.add(myCbForceClassicVM);
panel.add(myCbDisableJIT);
- panel.add(myHideDebuggerCheckBox);
- panel.add(myFocusAppCheckBox);
JPanel result = new JPanel(new BorderLayout());
result.add(panel, BorderLayout.NORTH);
@@ -129,7 +115,7 @@
}
+ @Override
public void disposeUIResources() {
}
-
-}
+}
\ No newline at end of file
diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerSettings.java b/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerSettings.java
index e25c895..bb3fafe 100644
--- a/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerSettings.java
+++ b/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerSettings.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,25 +16,31 @@
package com.intellij.debugger.settings;
import com.intellij.debugger.impl.DebuggerUtilsEx;
-import com.intellij.openapi.components.NamedComponent;
-import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.components.*;
import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.util.DefaultJDOMExternalizer;
import com.intellij.openapi.util.InvalidDataException;
-import com.intellij.openapi.util.JDOMExternalizable;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.ui.classFilter.ClassFilter;
+import com.intellij.util.containers.hash.LinkedHashMap;
+import com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters;
+import com.intellij.util.xmlb.XmlSerializer;
+import com.intellij.util.xmlb.annotations.Transient;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
-import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
-public class DebuggerSettings implements JDOMExternalizable, NamedComponent, Cloneable {
- private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.settings.DebuggerSettings");
+@State(
+ name = "DebuggerSettings",
+ storages = {
+ @Storage(
+ file = StoragePathMacros.APP_CONFIG + "/other.xml"
+ )}
+)
+public class DebuggerSettings implements Cloneable, PersistentStateComponent<Element> {
+ private static final Logger LOG = Logger.getInstance(DebuggerSettings.class);
public static final int SOCKET_TRANSPORT = 0;
public static final int SHMEM_TRANSPORT = 1;
@@ -50,11 +56,9 @@
@NonNls public static final String RUN_HOTSWAP_ASK = "RunHotswapAsk";
public boolean TRACING_FILTERS_ENABLED;
- public int VALUE_LOOKUP_DELAY; // ms
public int DEBUGGER_TRANSPORT;
public boolean FORCE_CLASSIC_VM;
public boolean DISABLE_JIT;
- public boolean HIDE_DEBUGGER_ON_PROCESS_TERMINATION;
public boolean HOTSWAP_IN_BACKGROUND = true;
public boolean SKIP_SYNTHETIC_METHODS;
public boolean SKIP_CONSTRUCTORS;
@@ -72,8 +76,10 @@
private ClassFilter[] mySteppingFilters = ClassFilter.EMPTY_ARRAY;
- private Map<String, ContentState> myContentStates = new HashMap<String, ContentState>();
+ private Map<String, ContentState> myContentStates = new LinkedHashMap<String, ContentState>();
+ // transient - custom serialization
+ @Transient
public ClassFilter[] getSteppingFilters() {
final ClassFilter[] rv = new ClassFilter[mySteppingFilters.length];
for (int idx = 0; idx < rv.length; idx++) {
@@ -82,50 +88,51 @@
return rv;
}
+ public static DebuggerSettings getInstance() {
+ return ServiceManager.getService(DebuggerSettings.class);
+ }
+
public void setSteppingFilters(ClassFilter[] steppingFilters) {
mySteppingFilters = steppingFilters != null ? steppingFilters : ClassFilter.EMPTY_ARRAY;
}
- @SuppressWarnings({"HardCodedStringLiteral"})
- public void readExternal(Element parentNode) throws InvalidDataException {
- DefaultJDOMExternalizer.readExternal(this, parentNode);
- List<ClassFilter> filtersList = new ArrayList<ClassFilter>();
-
- for (final Object o : parentNode.getChildren("filter")) {
- Element filter = (Element)o;
- filtersList.add(DebuggerUtilsEx.create(filter));
+ @Nullable
+ @Override
+ public Element getState() {
+ Element state = XmlSerializer.serialize(this, new SkipDefaultValuesSerializationFilters());
+ try {
+ DebuggerUtilsEx.writeFilters(state, "filter", mySteppingFilters);
}
- setSteppingFilters(filtersList.toArray(new ClassFilter[filtersList.size()]));
-
- filtersList.clear();
-
- final List contents = parentNode.getChildren("content");
- myContentStates.clear();
- for (Object content : contents) {
- final ContentState state = new ContentState((Element)content);
- myContentStates.put(state.getType(), state);
- }
- }
-
- @SuppressWarnings({"HardCodedStringLiteral"})
- public void writeExternal(Element parentNode) throws WriteExternalException {
- DefaultJDOMExternalizer.writeExternal(this, parentNode);
- for (ClassFilter mySteppingFilter : mySteppingFilters) {
- Element element = new Element("filter");
- parentNode.addContent(element);
- mySteppingFilter.writeExternal(element);
+ catch (WriteExternalException e) {
+ LOG.error(e);
+ return null;
}
for (ContentState eachState : myContentStates.values()) {
final Element content = new Element("content");
if (eachState.write(content)) {
- parentNode.addContent(content);
+ state.addContent(content);
}
}
+ return state;
}
- public static DebuggerSettings getInstance() {
- return ServiceManager.getService(DebuggerSettings.class);
+ @Override
+ public void loadState(Element state) {
+ XmlSerializer.deserializeInto(this, state);
+
+ try {
+ setSteppingFilters(DebuggerUtilsEx.readFilters(state.getChildren("filter")));
+ }
+ catch (InvalidDataException e) {
+ LOG.error(e);
+ }
+
+ myContentStates.clear();
+ for (Element content : state.getChildren("content")) {
+ ContentState contentState = new ContentState(content);
+ myContentStates.put(contentState.getType(), contentState);
+ }
}
public boolean equals(Object obj) {
@@ -134,11 +141,9 @@
return
TRACING_FILTERS_ENABLED == secondSettings.TRACING_FILTERS_ENABLED &&
- VALUE_LOOKUP_DELAY == secondSettings.VALUE_LOOKUP_DELAY &&
DEBUGGER_TRANSPORT == secondSettings.DEBUGGER_TRANSPORT &&
FORCE_CLASSIC_VM == secondSettings.FORCE_CLASSIC_VM &&
DISABLE_JIT == secondSettings.DISABLE_JIT &&
- HIDE_DEBUGGER_ON_PROCESS_TERMINATION == secondSettings.HIDE_DEBUGGER_ON_PROCESS_TERMINATION &&
HOTSWAP_IN_BACKGROUND == secondSettings.HOTSWAP_IN_BACKGROUND &&
SKIP_SYNTHETIC_METHODS == secondSettings.SKIP_SYNTHETIC_METHODS &&
SKIP_CLASSLOADERS == secondSettings.SKIP_CLASSLOADERS &&
@@ -150,6 +155,7 @@
DebuggerUtilsEx.filterEquals(mySteppingFilters, secondSettings.mySteppingFilters);
}
+ @Override
public DebuggerSettings clone() {
try {
final DebuggerSettings cloned = (DebuggerSettings)super.clone();
@@ -169,13 +175,7 @@
return null;
}
- @NotNull
- public String getComponentName() {
- return "DebuggerSettings";
- }
-
public static class ContentState implements Cloneable {
-
private final String myType;
private boolean myMinimized;
private String mySelectedTab;
@@ -208,7 +208,7 @@
if (mySelectedTab != null) {
element.setAttribute("selected", mySelectedTab);
}
- element.setAttribute("split", new Double(mySplitProportion).toString());
+ element.setAttribute("split", Double.toString(mySplitProportion));
element.setAttribute("detached", Boolean.valueOf(myDetached).toString());
element.setAttribute("horizontal", Boolean.valueOf(myHorizontalToolbar).toString());
return true;
@@ -266,6 +266,7 @@
myHorizontalToolbar = horizontalToolbar;
}
+ @Override
public ContentState clone() throws CloneNotSupportedException {
return (ContentState)super.clone();
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerSteppingConfigurable.java b/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerSteppingConfigurable.java
index 75d9a81..cec458c 100644
--- a/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerSteppingConfigurable.java
+++ b/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerSteppingConfigurable.java
@@ -18,6 +18,7 @@
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.ui.JavaDebuggerSupport;
import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.options.OptionsBundle;
import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.project.Project;
import com.intellij.ui.classFilter.ClassFilterEditor;
@@ -37,6 +38,7 @@
private JCheckBox myCbSkipSimpleGetters;
private Project myProject;
+ @Override
public void reset() {
final DebuggerSettings settings = DebuggerSettings.getInstance();
myCbSkipSimpleGetters.setSelected(settings.SKIP_GETTERS);
@@ -52,6 +54,7 @@
}
+ @Override
public void apply() {
getSettingsTo(DebuggerSettings.getInstance());
}
@@ -67,6 +70,7 @@
settings.setSteppingFilters(mySteppingFilterEditor.getFilters());
}
+ @Override
public boolean isModified() {
final DebuggerSettings currentSettings = DebuggerSettings.getInstance();
final DebuggerSettings debuggerSettings = currentSettings.clone();
@@ -74,30 +78,35 @@
return !debuggerSettings.equals(currentSettings);
}
+ @Override
public String getDisplayName() {
- return DebuggerBundle.message("debugger.stepping.configurable.display.name");
+ return OptionsBundle.message("options.java.display.name");
}
+ @Override
@NotNull
public String getHelpTopic() {
return "reference.idesettings.debugger.stepping";
}
+ @Override
@NotNull
public String getId() {
return getHelpTopic();
}
+ @Override
public Runnable enableSearch(String option) {
return null;
}
+ @Override
public JComponent createComponent() {
final JPanel panel = new JPanel(new GridBagLayout());
myProject = JavaDebuggerSupport.getContextProjectForEditorFieldsInDebuggerConfigurables();
myCbSkipSyntheticMethods = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.synthetic.methods"));
myCbSkipConstructors = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.constructors"));
- myCbSkipClassLoaders = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.classloaders"));
+ myCbSkipClassLoaders = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.classLoaders"));
myCbSkipSimpleGetters = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.simple.getters"));
myCbStepInfoFiltersEnabled = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.step.filters.list.header"));
panel.add(myCbSkipSyntheticMethods, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0),0, 0));
@@ -110,6 +119,7 @@
panel.add(mySteppingFilterEditor, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 0, 0),0, 0));
myCbStepInfoFiltersEnabled.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
mySteppingFilterEditor.setEnabled(myCbStepInfoFiltersEnabled.isSelected());
}
@@ -117,6 +127,7 @@
return panel;
}
+ @Override
public void disposeUIResources() {
mySteppingFilterEditor = null;
myProject = null;
diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/JavaDebuggerSettings.java b/java/debugger/impl/src/com/intellij/debugger/settings/JavaDebuggerSettings.java
new file mode 100644
index 0000000..7151cb9
--- /dev/null
+++ b/java/debugger/impl/src/com/intellij/debugger/settings/JavaDebuggerSettings.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2014 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.debugger.settings;
+
+import com.intellij.openapi.options.Configurable;
+import com.intellij.xdebugger.settings.XDebuggerSettings;
+import org.jdom.Element;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * We cannot now transform DebuggerSettings to XDebuggerSettings: getState/loadState is not called for EP,
+ * but we cannot use standard implementation to save our state, due to backward compatibility we must use own state spec.
+ *
+ * But we must implement createConfigurable as part of XDebuggerSettings otherwise java general settings will be before xdebugger general setting,
+ * because JavaDebuggerSettingsPanelProvider has higher priority than XDebuggerSettingsPanelProviderImpl.
+ */
+class JavaDebuggerSettings extends XDebuggerSettings<Element> {
+ protected JavaDebuggerSettings() {
+ super("java");
+ }
+
+ @Nullable
+ @Override
+ public Configurable createConfigurable(@NotNull Category category) {
+ switch (category) {
+ case ROOT:
+ return new DebuggerLaunchingConfigurable();
+ case DATA_VIEWS:
+ return new DebuggerDataViewsConfigurable(null);
+ case STEPPING:
+ return new DebuggerSteppingConfigurable();
+ }
+ return null;
+ }
+
+ @Override
+ public void generalApplied(@NotNull XDebuggerSettings.Category category) {
+ if (category == XDebuggerSettings.Category.DATA_VIEWS) {
+ NodeRendererSettings.getInstance().fireRenderersChanged();
+ }
+ }
+
+ @Nullable
+ @Override
+ public Element getState() {
+ return null;
+ }
+
+ @Override
+ public void loadState(Element state) {
+ }
+}
\ No newline at end of file
diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/ViewsGeneralSettings.java b/java/debugger/impl/src/com/intellij/debugger/settings/ViewsGeneralSettings.java
index 8518e82..9555ce6 100644
--- a/java/debugger/impl/src/com/intellij/debugger/settings/ViewsGeneralSettings.java
+++ b/java/debugger/impl/src/com/intellij/debugger/settings/ViewsGeneralSettings.java
@@ -32,7 +32,6 @@
public boolean SHOW_OBJECTID = true;
public boolean HIDE_NULL_ARRAY_ELEMENTS = true;
public boolean AUTOSCROLL_TO_NEW_LOCALS = true;
- public boolean ENABLE_AUTO_EXPRESSIONS = true;
public ViewsGeneralSettings() {
}
@@ -41,22 +40,22 @@
return ServiceManager.getService(ViewsGeneralSettings.class);
}
+ @Override
public void loadState(Element element) {
try {
DefaultJDOMExternalizer.readExternal(this, element);
}
- catch (InvalidDataException e) {
- // ignore
+ catch (InvalidDataException ignored) {
}
}
+ @Override
public Element getState() {
Element element = new Element("ViewsGeneralSettings");
try {
DefaultJDOMExternalizer.writeExternal(this, element);
}
- catch (WriteExternalException e) {
- // ignore
+ catch (WriteExternalException ignored) {
}
return element;
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerSessionTab.java b/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerSessionTab.java
index 7b4b22e..600efd8 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerSessionTab.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerSessionTab.java
@@ -61,6 +61,7 @@
import com.intellij.unscramble.ThreadState;
import com.intellij.xdebugger.XDebuggerBundle;
import com.intellij.xdebugger.impl.actions.XDebuggerActions;
+import com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager;
import com.intellij.xdebugger.impl.ui.DebuggerSessionTabBase;
import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants;
import org.jetbrains.annotations.NotNull;
@@ -105,7 +106,7 @@
case DebuggerSession.EVENT_DETACHED:
myUi.updateActionsNow();
- if (debuggerSettings.HIDE_DEBUGGER_ON_PROCESS_TERMINATION) {
+ if (XDebuggerSettingsManager.getInstanceImpl().getGeneralSettings().isHideDebuggerOnProcessTermination()) {
try {
ExecutionManager.getInstance(getProject()).getContentManager().hideRunContent(DefaultDebugExecutor.getDebugExecutorInstance(), myRunContentDescriptor);
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/JavaDebuggerSupport.java b/java/debugger/impl/src/com/intellij/debugger/ui/JavaDebuggerSupport.java
index 630fa30..27f63e0 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/JavaDebuggerSupport.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/JavaDebuggerSupport.java
@@ -18,7 +18,9 @@
import com.intellij.debugger.DebuggerManagerEx;
import com.intellij.debugger.actions.*;
import com.intellij.debugger.impl.DebuggerContextImpl;
-import com.intellij.debugger.settings.*;
+import com.intellij.debugger.settings.DebuggerHotswapConfigurable;
+import com.intellij.debugger.settings.NodeRendererSettings;
+import com.intellij.debugger.settings.UserRenderersConfigurable;
import com.intellij.debugger.ui.breakpoints.Breakpoint;
import com.intellij.ide.DataManager;
import com.intellij.openapi.Disposable;
@@ -333,22 +335,16 @@
//}
}
- public static class JavaDebuggerSettingsPanelProvider extends DebuggerSettingsPanelProvider {
+ final static class JavaDebuggerSettingsPanelProvider extends DebuggerSettingsPanelProvider {
@Override
public int getPriority() {
return 1;
}
- @Override
- public Configurable getRootConfigurable() {
- return new DebuggerLaunchingConfigurable();
- }
-
+ @NotNull
@Override
public Collection<? extends Configurable> getConfigurables() {
final ArrayList<Configurable> configurables = new ArrayList<Configurable>();
- configurables.add(new DebuggerDataViewsConfigurable(null));
- configurables.add(new DebuggerSteppingConfigurable());
configurables.add(new UserRenderersConfigurable(null));
configurables.add(new DebuggerHotswapConfigurable());
return configurables;
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointWithHighlighter.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointWithHighlighter.java
index 1087338..d6cbf14 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointWithHighlighter.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointWithHighlighter.java
@@ -177,7 +177,12 @@
protected BreakpointWithHighlighter(@NotNull Project project, XBreakpoint xBreakpoint) {
//for persistency
super(project, xBreakpoint);
- reload();
+ ApplicationManager.getApplication().runReadAction(new Runnable() {
+ @Override
+ public void run() {
+ reload();
+ }
+ });
}
@Override
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaExceptionBreakpointType.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaExceptionBreakpointType.java
index 3bbea65..638e6a0 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaExceptionBreakpointType.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaExceptionBreakpointType.java
@@ -59,6 +59,18 @@
return AllIcons.Debugger.Db_disabled_exception_breakpoint;
}
+ @NotNull
+ @Override
+ public Icon getMutedEnabledIcon() {
+ return AllIcons.Debugger.Db_muted_exception_breakpoint;
+ }
+
+ @NotNull
+ @Override
+ public Icon getMutedDisabledIcon() {
+ return AllIcons.Debugger.Db_muted_disabled_exception_breakpoint;
+ }
+
//@Override
protected String getHelpID() {
return HelpID.EXCEPTION_BREAKPOINTS;
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaFieldBreakpointType.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaFieldBreakpointType.java
index 0b1ba90..f34898b 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaFieldBreakpointType.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaFieldBreakpointType.java
@@ -63,6 +63,18 @@
return AllIcons.Debugger.Db_disabled_field_breakpoint;
}
+ @NotNull
+ @Override
+ public Icon getMutedEnabledIcon() {
+ return AllIcons.Debugger.Db_muted_field_breakpoint;
+ }
+
+ @NotNull
+ @Override
+ public Icon getMutedDisabledIcon() {
+ return AllIcons.Debugger.Db_muted_disabled_field_breakpoint;
+ }
+
//@Override
protected String getHelpID() {
return HelpID.FIELD_WATCHPOINTS;
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaLineBreakpointType.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaLineBreakpointType.java
index 70d0f00..a3c442f 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaLineBreakpointType.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaLineBreakpointType.java
@@ -41,18 +41,6 @@
super("java-line", DebuggerBundle.message("line.breakpoints.tab.title"));
}
- @NotNull
- @Override
- public Icon getEnabledIcon() {
- return AllIcons.Debugger.Db_set_breakpoint;
- }
-
- @NotNull
- @Override
- public Icon getDisabledIcon() {
- return AllIcons.Debugger.Db_disabled_breakpoint;
- }
-
//@Override
protected String getHelpID() {
return HelpID.LINE_BREAKPOINTS;
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaMethodBreakpointType.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaMethodBreakpointType.java
index 2ec2749..4d7d512 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaMethodBreakpointType.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaMethodBreakpointType.java
@@ -51,6 +51,18 @@
return AllIcons.Debugger.Db_disabled_method_breakpoint;
}
+ @NotNull
+ @Override
+ public Icon getMutedEnabledIcon() {
+ return AllIcons.Debugger.Db_muted_method_breakpoint;
+ }
+
+ @NotNull
+ @Override
+ public Icon getMutedDisabledIcon() {
+ return AllIcons.Debugger.Db_muted_disabled_method_breakpoint;
+ }
+
//@Override
protected String getHelpID() {
return HelpID.METHOD_BREAKPOINTS;
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaWildcardMethodBreakpointType.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaWildcardMethodBreakpointType.java
index 8fea87b..83da4a9 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaWildcardMethodBreakpointType.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaWildcardMethodBreakpointType.java
@@ -50,6 +50,18 @@
return AllIcons.Debugger.Db_disabled_method_breakpoint;
}
+ @NotNull
+ @Override
+ public Icon getMutedEnabledIcon() {
+ return AllIcons.Debugger.Db_muted_method_breakpoint;
+ }
+
+ @NotNull
+ @Override
+ public Icon getMutedDisabledIcon() {
+ return AllIcons.Debugger.Db_muted_disabled_method_breakpoint;
+ }
+
//@Override
protected String getHelpID() {
return HelpID.METHOD_BREAKPOINTS;
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/FrameVariablesTree.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/FrameVariablesTree.java
index 8cb6828..5d32e71 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/FrameVariablesTree.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/FrameVariablesTree.java
@@ -53,6 +53,7 @@
import com.intellij.util.ui.tree.TreeModelAdapter;
import com.intellij.xdebugger.XDebuggerBundle;
import com.intellij.xdebugger.frame.XStackFrame;
+import com.intellij.xdebugger.settings.XDebuggerSettingsManager;
import com.sun.jdi.*;
import gnu.trove.TIntObjectHashMap;
import gnu.trove.TObjectProcedure;
@@ -157,7 +158,7 @@
}
try {
- if (!ViewsGeneralSettings.getInstance().ENABLE_AUTO_EXPRESSIONS && !myAutoWatchMode) {
+ if (!XDebuggerSettingsManager.getInstance().getDataViewSettings().isAutoExpressions() && !myAutoWatchMode) {
// optimization
super.buildVariables(stackDescriptor, evaluationContext);
}
@@ -273,7 +274,7 @@
}
catch (UnsupportedOperationException ignored) {
}
- catch (InternalException e) {
+ catch (Exception e) {
LOG.info(e);
}
return Collections.emptyList();
@@ -569,7 +570,7 @@
myVars = vars;
myPosition = position;
myEvalContext = evalContext;
- myCollectExpressions = ViewsGeneralSettings.getInstance().ENABLE_AUTO_EXPRESSIONS;
+ myCollectExpressions = XDebuggerSettingsManager.getInstance().getDataViewSettings().isAutoExpressions();
}
@Override
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/TipManager.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/TipManager.java
index fce05d1..df91efe 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/TipManager.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/TipManager.java
@@ -15,7 +15,6 @@
*/
package com.intellij.debugger.ui.impl;
-import com.intellij.debugger.settings.DebuggerSettings;
import com.intellij.ide.FrameStateListener;
import com.intellij.ide.FrameStateManager;
import com.intellij.openapi.Disposable;
@@ -32,6 +31,7 @@
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.update.Activatable;
import com.intellij.util.ui.update.UiNotifyConnector;
+import com.intellij.xdebugger.settings.XDebuggerSettingsManager;
import javax.swing.*;
import javax.swing.event.PopupMenuEvent;
@@ -117,14 +117,17 @@
return menu;
}
+ @Override
public void popupMenuWillBecomeVisible(final PopupMenuEvent e) {
myPopupShown = true;
}
+ @Override
public void popupMenuWillBecomeInvisible(final PopupMenuEvent e) {
onPopupClosed(e);
}
+ @Override
public void popupMenuCanceled(final PopupMenuEvent e) {
onPopupClosed(e);
}
@@ -174,12 +177,13 @@
myShowAlarm.cancelAllRequests();
myHideAlarm.cancelAllRequests();
myShowAlarm.addRequest(new Runnable() {
+ @Override
public void run() {
if (!myIsDisposed && !myPopupShown) {
showTooltip(e, auto);
}
}
- }, auto ? DebuggerSettings.getInstance().VALUE_LOOKUP_DELAY : 10);
+ }, auto ? XDebuggerSettingsManager.getInstance().getDataViewSettings().getValueLookupDelay() : 10);
}
private void showTooltip(InputEvent e, boolean auto) {
@@ -245,6 +249,7 @@
myCurrentTooltip = null;
} else {
myHideAlarm.addRequest(new Runnable() {
+ @Override
public void run() {
if (myInsideComponent) {
hideTooltip(true);
@@ -273,10 +278,12 @@
myComponent = component;
new UiNotifyConnector.Once(component, new Activatable() {
+ @Override
public void showNotify() {
installListeners();
}
+ @Override
public void hideNotify() {
}
});
@@ -284,6 +291,7 @@
final HideTooltipAction hide = new HideTooltipAction();
hide.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)), myComponent);
Disposer.register(this, new Disposable() {
+ @Override
public void dispose() {
hide.unregisterCustomShortcutSet(myComponent);
}
@@ -292,6 +300,7 @@
private class HideTooltipAction extends AnAction {
+ @Override
public void actionPerformed(AnActionEvent e) {
hideTooltip(true);
}
@@ -316,6 +325,7 @@
FrameStateManager.getInstance().addListener(myFrameStateListener);
}
+ @Override
public void dispose() {
Disposer.dispose(this);
@@ -333,6 +343,7 @@
private class MyAwtPreprocessor implements AWTEventListener {
+ @Override
public void eventDispatched(AWTEvent event) {
if (event.getID() == MouseEvent.MOUSE_MOVED) {
preventFromHideIfInsideTooltip(event);
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/DebuggerTree.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/DebuggerTree.java
index 52d5575..d333eaa 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/DebuggerTree.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/DebuggerTree.java
@@ -55,6 +55,7 @@
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.SpeedSearchComparator;
import com.intellij.ui.TreeSpeedSearch;
+import com.intellij.xdebugger.settings.XDebuggerSettingsManager;
import com.sun.jdi.*;
import com.sun.jdi.event.Event;
import com.sun.jdi.event.ExceptionEvent;
@@ -485,7 +486,7 @@
try {
buildVariables(stackDescriptor, evaluationContext);
- if (classRenderer.SORT_ASCENDING) {
+ if (XDebuggerSettingsManager.getInstance().getDataViewSettings().isSortValues()) {
Collections.sort(myChildren, NodeManagerImpl.getNodeComparator());
}
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/BatchEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/BatchEvaluator.java
index abf937e..59749a2 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/BatchEvaluator.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/BatchEvaluator.java
@@ -27,6 +27,7 @@
import com.intellij.debugger.engine.managerThread.SuspendContextCommand;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.rt.debugger.BatchEvaluatorServer;
import com.intellij.util.containers.HashMap;
import com.sun.jdi.*;
@@ -120,7 +121,7 @@
final EvaluationContext evaluationContext = command.getEvaluationContext();
final SuspendContext suspendContext = evaluationContext.getSuspendContext();
- if(!hasBatchEvaluator(evaluationContext)) {
+ if(!Registry.is("debugger.batch.evaluation") || !hasBatchEvaluator(evaluationContext)) {
myDebugProcess.getManagerThread().invokeCommand(command);
}
else {
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ClassRenderer.java b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ClassRenderer.java
index bd14ef5..7fe89bb 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ClassRenderer.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ClassRenderer.java
@@ -38,6 +38,7 @@
import com.intellij.psi.PsiExpression;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.StringBuilderSpinAllocator;
+import com.intellij.xdebugger.settings.XDebuggerSettingsManager;
import com.sun.jdi.*;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
@@ -58,7 +59,6 @@
public static final @NonNls String UNIQUE_ID = "ClassRenderer";
- public boolean SORT_ASCENDING = false;
public boolean SHOW_SYNTHETICS = true;
public boolean SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES = true;
public boolean SHOW_STATIC = false;
@@ -83,22 +83,27 @@
return typeName;
}
+ @Override
public String getUniqueId() {
return UNIQUE_ID;
}
+ @Override
public boolean isEnabled() {
return myProperties.isEnabled();
}
+ @Override
public void setEnabled(boolean enabled) {
myProperties.setEnabled(enabled);
}
+ @Override
public ClassRenderer clone() {
return (ClassRenderer) super.clone();
}
+ @Override
public String calcLabel(ValueDescriptor descriptor, EvaluationContext evaluationContext, DescriptorLabelListener labelListener) throws EvaluateException {
return calcLabel(descriptor);
}
@@ -151,6 +156,7 @@
}
}
+ @Override
public void buildChildren(final Value value, final ChildrenBuilder builder, final EvaluationContext evaluationContext) {
DebuggerManagerThreadImpl.assertIsManagerThread();
final ValueDescriptorImpl parentDescriptor = (ValueDescriptorImpl)builder.getParentDescriptor();
@@ -171,7 +177,7 @@
children.add(nodeManager.createNode(nodeDescriptorFactory.getFieldDescriptor(parentDescriptor, objRef, field), evaluationContext));
}
- if(SORT_ASCENDING) {
+ if (XDebuggerSettingsManager.getInstance().getDataViewSettings().isSortValues()) {
Collections.sort(children, NodeManagerImpl.getNodeComparator());
}
}
@@ -211,16 +217,19 @@
return true;
}
+ @Override
public void readExternal(Element element) throws InvalidDataException {
super.readExternal(element);
DefaultJDOMExternalizer.readExternal(this, element);
}
+ @Override
public void writeExternal(Element element) throws WriteExternalException {
super.writeExternal(element);
DefaultJDOMExternalizer.writeExternal(this, element);
}
+ @Override
public PsiExpression getChildValueExpression(DebuggerTreeNode node, DebuggerContext context) throws EvaluateException {
FieldDescriptor fieldDescriptor = (FieldDescriptor)node.getDescriptor();
@@ -251,19 +260,23 @@
return false;
}
+ @Override
public boolean isExpandable(Value value, EvaluationContext evaluationContext, NodeDescriptor parentDescriptor) {
DebuggerManagerThreadImpl.assertIsManagerThread();
return valueExpandable(value);
}
+ @Override
public boolean isApplicable(Type type) {
return type instanceof ReferenceType && !(type instanceof ArrayType);
}
+ @Override
public @NonNls String getName() {
return "Object";
}
+ @Override
public void setName(String text) {
LOG.assertTrue(false);
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ToStringRenderer.java b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ToStringRenderer.java
index fd77aa90..4016289 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ToStringRenderer.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ToStringRenderer.java
@@ -36,7 +36,7 @@
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
-import java.util.Iterator;
+import java.util.List;
import static com.intellij.psi.CommonClassNames.JAVA_LANG_STRING;
@@ -126,14 +126,10 @@
@SuppressWarnings({"HardCodedStringLiteral"})
private static boolean overridesToString(Type type) {
if(type instanceof ClassType) {
- final ClassType classType = (ClassType)type;
- final java.util.List methods = classType.methodsByName("toString", "()Ljava/lang/String;");
- if (methods.size() > 0) {
- for (Iterator iterator = methods.iterator(); iterator.hasNext();) {
- final Method method = (Method)iterator.next();
- if(!(method.declaringType().name()).equals(CommonClassNames.JAVA_LANG_OBJECT)){
- return true;
- }
+ final List<Method> methods = ((ClassType)type).methodsByName("toString", "()Ljava/lang/String;");
+ for (Method method : methods) {
+ if (!(method.declaringType().name()).equals(CommonClassNames.JAVA_LANG_OBJECT)) {
+ return true;
}
}
}
@@ -182,7 +178,7 @@
private boolean isFiltered(Type t) {
if (t instanceof ReferenceType) {
for (ClassFilter classFilter : myClassFilters) {
- if (classFilter.isEnabled() && DebuggerUtilsEx.getSuperType(t, classFilter.getPattern()) != null) {
+ if (classFilter.isEnabled() && DebuggerUtils.getSuperType(t, classFilter.getPattern()) != null) {
return true;
}
}
diff --git a/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/properties/JavaBreakpointProperties.java b/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/properties/JavaBreakpointProperties.java
index 599aed3..be8833a 100644
--- a/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/properties/JavaBreakpointProperties.java
+++ b/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/properties/JavaBreakpointProperties.java
@@ -45,7 +45,7 @@
}
public boolean setInstanceFilters(InstanceFilter[] instanceFilters) {
- boolean changed = !Comparing.equal(myInstanceFilters, instanceFilters);
+ boolean changed = !filtersEqual(myInstanceFilters, instanceFilters);
myInstanceFilters = instanceFilters;
return changed;
}
@@ -64,11 +64,18 @@
}
public final boolean setClassFilters(ClassFilter[] classFilters) {
- boolean changed = !Comparing.equal(myClassFilters, classFilters);
+ boolean changed = !filtersEqual(myClassFilters, classFilters);
myClassFilters = classFilters;
return changed;
}
+ private static boolean filtersEqual(Object[] a, Object[] b) {
+ if ((a == null || a.length == 0) && (b == null || b.length == 0)) {
+ return true;
+ }
+ return Comparing.equal(a, b);
+ }
+
@Tag("class-exclusion-filters")
@AbstractCollection(surroundWithTag = false)
public ClassFilter[] getClassExclusionFilters() {
@@ -76,7 +83,7 @@
}
public boolean setClassExclusionFilters(ClassFilter[] classExclusionFilters) {
- boolean changed = !Comparing.equal(myClassExclusionFilters, classExclusionFilters);
+ boolean changed = !filtersEqual(myClassExclusionFilters, classExclusionFilters);
myClassExclusionFilters = classExclusionFilters;
return changed;
}
diff --git a/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurable.java b/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurable.java
index b72a888..04af179 100644
--- a/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurable.java
+++ b/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurable.java
@@ -16,6 +16,7 @@
package com.intellij.execution.application;
import com.intellij.execution.ExecutionBundle;
+import com.intellij.execution.JavaExecutionUtil;
import com.intellij.execution.configurations.ConfigurationUtil;
import com.intellij.execution.ui.AlternativeJREPanel;
import com.intellij.execution.ui.ClassBrowser;
@@ -71,7 +72,9 @@
public void applyEditorTo(final ApplicationConfiguration configuration) throws ConfigurationException {
myCommonProgramParameters.applyTo(configuration);
myModuleSelector.applyTo(configuration);
- configuration.MAIN_CLASS_NAME = getMainClassField().getText();
+ final String className = getMainClassField().getText();
+ final PsiClass aClass = myModuleSelector.findClass(className);
+ configuration.MAIN_CLASS_NAME = aClass != null ? JavaExecutionUtil.getRuntimeQualifiedName(aClass) : className;
configuration.ALTERNATIVE_JRE_PATH = myAlternativeJREPanel.getPath();
configuration.ALTERNATIVE_JRE_PATH_ENABLED = myAlternativeJREPanel.isPathEnabled();
configuration.ENABLE_SWING_INSPECTOR = (myVersionDetector.isJre50Configured(configuration) || myVersionDetector.isModuleJre50Configured(configuration)) && myShowSwingInspectorCheckbox.isSelected();
@@ -82,7 +85,7 @@
public void resetEditorFrom(final ApplicationConfiguration configuration) {
myCommonProgramParameters.reset(configuration);
myModuleSelector.reset(configuration);
- getMainClassField().setText(configuration.MAIN_CLASS_NAME);
+ getMainClassField().setText(configuration.MAIN_CLASS_NAME.replaceAll("\\$", "\\."));
myAlternativeJREPanel.init(configuration.ALTERNATIVE_JRE_PATH, configuration.ALTERNATIVE_JRE_PATH_ENABLED);
updateShowSwingInspector(configuration);
@@ -121,7 +124,7 @@
public Visibility isDeclarationVisible(PsiElement declaration, PsiElement place) {
if (declaration instanceof PsiClass) {
final PsiClass aClass = (PsiClass)declaration;
- if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null) {
+ if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null || place.getParent() != null && myModuleSelector.findClass(((PsiClass)declaration).getQualifiedName()) != null) {
return Visibility.VISIBLE;
}
}
diff --git a/java/execution/impl/src/com/intellij/execution/remote/RemoteConfiguration.java b/java/execution/impl/src/com/intellij/execution/remote/RemoteConfiguration.java
index 4f503f3..57c84c9 100644
--- a/java/execution/impl/src/com/intellij/execution/remote/RemoteConfiguration.java
+++ b/java/execution/impl/src/com/intellij/execution/remote/RemoteConfiguration.java
@@ -77,10 +77,13 @@
@Override
public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException {
- GenericDebuggerRunnerSettings debuggerSettings = (GenericDebuggerRunnerSettings)env.getRunnerSettings();
- debuggerSettings.LOCAL = false;
- debuggerSettings.setDebugPort(USE_SOCKET_TRANSPORT ? PORT : SHMEM_ADDRESS);
- debuggerSettings.setTransport(USE_SOCKET_TRANSPORT ? DebuggerSettings.SOCKET_TRANSPORT : DebuggerSettings.SHMEM_TRANSPORT);
+ final GenericDebuggerRunnerSettings debuggerSettings = (GenericDebuggerRunnerSettings)env.getRunnerSettings();
+ if (debuggerSettings != null) {
+ // sync self state with execution environment's state if available
+ debuggerSettings.LOCAL = false;
+ debuggerSettings.setDebugPort(USE_SOCKET_TRANSPORT ? PORT : SHMEM_ADDRESS);
+ debuggerSettings.setTransport(USE_SOCKET_TRANSPORT ? DebuggerSettings.SOCKET_TRANSPORT : DebuggerSettings.SHMEM_TRANSPORT);
+ }
return new RemoteStateState(getProject(), createRemoteConnection());
}
diff --git a/java/idea-ui/src/com/intellij/ide/actions/ShowStructureSettingsAction.java b/java/idea-ui/src/com/intellij/ide/actions/ShowStructureSettingsAction.java
index e3570c2..ded07d4 100644
--- a/java/idea-ui/src/com/intellij/ide/actions/ShowStructureSettingsAction.java
+++ b/java/idea-ui/src/com/intellij/ide/actions/ShowStructureSettingsAction.java
@@ -27,6 +27,7 @@
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.Gray;
+import com.intellij.ui.JBColor;
import com.intellij.ui.border.CustomLineBorder;
import org.jetbrains.annotations.Nullable;
@@ -55,7 +56,7 @@
protected JComponent createSouthPanel() {
JComponent panel = super.createSouthPanel();
assert panel != null;
- CustomLineBorder line = new CustomLineBorder(Gray._153, 1, 0, 0, 0);
+ CustomLineBorder line = new CustomLineBorder(new JBColor(Gray._153, Gray._80), 1, 0, 0, 0);
panel.setBorder(new CompoundBorder(line, new EmptyBorder(10, 5, 5, 5)));
return panel;
}
diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ErrorPaneConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ErrorPaneConfigurable.java
new file mode 100644
index 0000000..77ccbe6
--- /dev/null
+++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ErrorPaneConfigurable.java
@@ -0,0 +1,217 @@
+/*
+ * Copyright 2000-2014 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.roots.ui.configuration;
+
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.ui.*;
+import com.intellij.ui.awt.RelativePoint;
+import com.intellij.util.Alarm;
+import com.intellij.util.ui.UIUtil;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.text.Element;
+import java.awt.*;
+import java.awt.event.MouseEvent;
+import java.net.URL;
+import java.util.ArrayList;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class ErrorPaneConfigurable extends JPanel implements Configurable, Disposable, ConfigurationErrors {
+ private final Alarm myAlarm;
+ private final ArrayList<ConfigurationError> myErrors = new ArrayList<ConfigurationError>();
+ private final JTextPane myContent = new JTextPane();
+ private Runnable myOnErrorsChanged;
+
+ public ErrorPaneConfigurable(final Project project, StructureConfigurableContext context, Runnable onErrorsChanged) {
+ super(new BorderLayout());
+ myOnErrorsChanged = onErrorsChanged;
+ myContent.setEditorKit(UIUtil.getHTMLEditorKit());
+ myContent.setEditable(false);
+ myContent.setBackground(UIUtil.getListBackground());
+ final JScrollPane pane = ScrollPaneFactory.createScrollPane(myContent, true);
+ pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ add(pane);
+ myAlarm = new Alarm(this);
+ project.getMessageBus().connect(this).subscribe(ConfigurationErrors.TOPIC, this);
+ myContent.addHyperlinkListener(new HyperlinkAdapter() {
+ @Override
+ public void hyperlinkActivated(HyperlinkEvent e) {
+ final URL url = e.getURL();
+ final AWTEvent awtEvent = EventQueue.getCurrentEvent();
+ if (!(awtEvent instanceof MouseEvent)) {
+ return;
+ }
+ final MouseEvent me = (MouseEvent)awtEvent;
+
+ if (url != null) {
+ ConfigurationError error = null;
+ Element element = e.getSourceElement();
+ while (element != null) {
+ if ("li".equals(element.getName())) {
+ final Element ol = element.getParentElement();
+ for (int i = 0; i < ol.getElementCount(); i++) {
+ if (ol.getElement(i) == element) {
+ error = myErrors.get(i);
+ }
+ }
+ break;
+ }
+ element = element.getParentElement();
+ }
+ if (error == null) return;
+ final String host = url.getHost();
+ String path = url.getPath();
+ if (path != null && path.startsWith("/")) {
+ path = StringUtil.unescapeXml(path.substring(1));
+ }
+ if (path != null) {
+ if ("fix".equals(host)) {
+ final MouseEvent mouseEvent = new MouseEvent(me.getComponent(), me.getID(), me.getWhen(), me.getModifiers(),
+ me.getX() - 15, me.getY() + 10, me.getClickCount(), me.isPopupTrigger());
+ error.fix(myContent, new RelativePoint(mouseEvent));
+ } else {
+ error.navigate();
+ }
+ }
+ }
+ }
+ });
+
+ refresh();
+ }
+
+ public void refresh() {
+ myAlarm.cancelAllRequests();
+ myAlarm.addRequest(new Runnable() {
+ @Override
+ public void run() {
+ String html = "<html>" +
+ "<header><style type='text/css'>" +
+ "body {" +
+ " color: #" + ColorUtil.toHex(new JBColor(Gray.x33, UIUtil.getLabelForeground())) + ";" +
+ " font-family: '" + UIUtil.getLabelFont().getName() + ",serif';" +
+ " font-size: " + UIUtil.getLabelFont().getSize() + ";" +
+ "}" +
+ "li {" +
+ " margin-bottom: 5;" +
+ "}" +
+ "ol {" +
+ "}" +
+ "a {" +
+ " text-decoration: none;" +
+ "}" +
+ "</style>" +
+ "</header>" +
+ "<body>";
+ int i = 0;
+ html += "<ol>";
+ for (ConfigurationError error : myErrors) {
+ i++;
+ String description = error.getDescription();
+ if (description.startsWith("<html>") && description.endsWith("</html>")) {
+ description = description.substring(6, description.length() - 7);
+ }
+ if (description.startsWith("Module '")) {
+ final int start = 8;
+ final int end = description.indexOf("'", 9);
+ final String moduleName = description.substring(start, end);
+ description = "Module <a href='http://module/" + StringUtil.escapeXml(moduleName) + "'>" + StringUtil.escapeXml(moduleName) + "</a> " + description.substring(
+ end + 1);
+ }
+ if (error.canBeFixed()) {
+ description += " <a href='http://fix/" + i + "'>[Fix]</a>";
+ }
+ html+= "<li>" + description + "</li>";
+ }
+ html += "</ol></body></html>";
+ myContent.setText(html);
+ if (myOnErrorsChanged != null) {
+ myOnErrorsChanged.run();
+ }
+ }
+ }, 100);
+ }
+
+ @Nls
+ @Override
+ public String getDisplayName() {
+ return "Problems";
+ }
+
+ @Nullable
+ @Override
+ public String getHelpTopic() {
+ return null;
+ }
+
+ @Nullable
+ @Override
+ public JComponent createComponent() {
+ return this;
+ }
+
+ @Override
+ public boolean isModified() {
+ return false;
+ }
+
+ @Override
+ public void apply() throws ConfigurationException {
+
+ }
+
+ @Override
+ public void reset() {
+
+ }
+
+ @Override
+ public void disposeUIResources() {
+ Disposer.dispose(this);
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void addError(@NotNull ConfigurationError error) {
+ myErrors.add(error);
+ refresh();
+ }
+
+ @Override
+ public void removeError(@NotNull ConfigurationError error) {
+ myErrors.remove(error);
+ refresh();
+ }
+
+ public int getErrorsCount() {
+ return myErrors.size();
+ }
+}
diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java
index d007c36..bf083f9 100644
--- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java
+++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java
@@ -43,7 +43,6 @@
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy;
import com.intellij.packaging.artifacts.Artifact;
-import com.intellij.ui.Gray;
import com.intellij.ui.JBSplitter;
import com.intellij.ui.components.panels.Wrapper;
import com.intellij.ui.navigation.BackAction;
@@ -179,11 +178,7 @@
mySplitter.setSplitterProportionKey("ProjectStructure.TopLevelElements");
mySplitter.setHonorComponentsMinimumSize(true);
if (Registry.is("ide.new.project.settings")) {
- mySplitter.setDividerWidth(1);
- mySplitter.setShowDividerIcon(false);
- mySplitter.getDivider().setBackground(Gray._153.withAlpha(128));
- mySplitter.setShowDividerControls(false);
- mySplitter.setOrientation(mySplitter.getOrientation());
+ mySplitter.setOnePixelMode();
}
initSidePanel();
@@ -203,7 +198,7 @@
toolbar.setTargetComponent(myComponent);
myToolbarComponent = toolbar.getComponent();
if (Registry.is("ide.new.project.settings")) {
- left.setBackground(new Color(0xD2D6DD));
+ left.setBackground(UIUtil.getSidePanelColor());
} else {
left.add(myToolbarComponent, BorderLayout.NORTH);
}
@@ -214,7 +209,9 @@
myComponent.add(mySplitter, BorderLayout.CENTER);
myErrorsComponent = new ConfigurationErrorsComponent(myProject);
- myComponent.add(myErrorsComponent, BorderLayout.SOUTH);
+ if (!Registry.is("ide.new.project.settings")) {
+ myComponent.add(myErrorsComponent, BorderLayout.SOUTH);
+ }
myUiInitialized = true;
@@ -253,6 +250,11 @@
addConfigurable(configurable, true);
}
}
+
+ if (Registry.is("ide.new.project.settings")) {
+ mySidePanel.addSeparator("--");
+ addErrorPane();
+ }
}
private void addArtifactsConfig() {
@@ -299,6 +301,15 @@
addConfigurable(myProjectLibrariesConfig, ConfigurableId.PROJECT_LIBRARIES);
}
+ private void addErrorPane() {
+ addConfigurable(new ErrorPaneConfigurable(myProject, myContext, new Runnable() {
+ @Override
+ public void run() {
+ mySidePanel.getList().repaint();
+ }
+ }), true);
+ }
+
private void addGlobalLibrariesConfig() {
addConfigurable(myGlobalLibrariesConfig, ConfigurableId.GLOBAL_LIBRARIES);
}
diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/SidePanel.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/SidePanel.java
index a2d1e4e..290f35e 100644
--- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/SidePanel.java
+++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/SidePanel.java
@@ -16,17 +16,23 @@
package com.intellij.openapi.roots.ui.configuration;
import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.ui.GraphicsConfig;
import com.intellij.openapi.ui.popup.ListItemDescriptor;
import com.intellij.openapi.util.registry.Registry;
-import com.intellij.ui.ScrollPaneFactory;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.ui.*;
import com.intellij.ui.components.JBList;
+import com.intellij.ui.components.panels.NonOpaquePanel;
import com.intellij.ui.navigation.History;
import com.intellij.ui.navigation.Place;
import com.intellij.ui.popup.list.GroupedItemsListRenderer;
import com.intellij.util.ui.EmptyIcon;
+import com.intellij.util.ui.GraphicsUtil;
+import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
+import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
@@ -36,6 +42,9 @@
import java.util.HashMap;
import java.util.Map;
+import static javax.swing.SwingConstants.CENTER;
+import static javax.swing.SwingConstants.LEFT;
+
public class SidePanel extends JPanel {
private final JList myList;
@@ -56,7 +65,7 @@
myModel = new DefaultListModel();
myList = new JBList(myModel);
if (Registry.is("ide.new.project.settings")) {
- myList.setBackground(new Color(0xD2D6DD));
+ myList.setBackground(UIUtil.getSidePanelColor());
myList.setBorder(new EmptyBorder(5, 0, 0, 0));
}
final ListItemDescriptor descriptor = new ListItemDescriptor() {
@@ -84,18 +93,100 @@
@Override
public String getCaptionAboveOf(final Object value) {
- String text = myIndex2Separator.get(myPlaces.indexOf(value));
- return text != null && Registry.is("ide.new.project.settings") ? text.toUpperCase() : text;
+ return myIndex2Separator.get(myPlaces.indexOf(value));
}
};
myList.setCellRenderer(new GroupedItemsListRenderer(descriptor) {
+ JPanel myExtraPanel;
+ CountLabel myCountLabel;
{
mySeparatorComponent.setCaptionCentered(false);
}
+
+ @Override
+ protected Color getForeground() {
+ return Registry.is("ide.new.project.settings") ? new JBColor(Gray._60, Gray._140) : super.getForeground();
+ }
+
+ @Override
+ protected SeparatorWithText createSeparator() {
+ return new SeparatorWithText() {
+ @Override
+ protected void paintComponent(Graphics g) {
+ if (Registry.is("ide.new.project.settings")) {
+ g.setColor(new JBColor(POPUP_SEPARATOR_FOREGROUND, Gray._80));
+ if ("--".equals(getCaption())) {
+ g.drawLine(0, getHeight()/ 2, getWidth(), getHeight() /2);
+ return;
+ }
+ Rectangle viewR = new Rectangle(0, getVgap(), getWidth() - 1, getHeight() - getVgap() - 1);
+ Rectangle iconR = new Rectangle();
+ Rectangle textR = new Rectangle();
+ String s = SwingUtilities
+ .layoutCompoundLabel(g.getFontMetrics(), getCaption(), null, CENTER,
+ LEFT,
+ CENTER,
+ LEFT,
+ viewR, iconR, textR, 0);
+ GraphicsUtil.setupAAPainting(g);
+ g.setColor(new JBColor(Gray._255.withAlpha(80), Gray._0.withAlpha(80)));
+ g.drawString(s, textR.x + 10, textR.y + 1 + g.getFontMetrics().getAscent());
+ g.setColor(new JBColor(new Color(0x5F6D7B), Gray._120));
+ g.drawString(s, textR.x + 10, textR.y + g.getFontMetrics().getAscent());
+ }
+ else {
+ super.paintComponent(g);
+ }
+ }
+ };
+ }
+
+ @Override
+ protected void layout() {
+ if (Registry.is("ide.new.project.settings")) {
+ myRendererComponent.add(mySeparatorComponent, BorderLayout.NORTH);
+ myExtraPanel.add(myComponent, BorderLayout.CENTER);
+ myExtraPanel.add(myCountLabel, BorderLayout.EAST);
+ myRendererComponent.add(myExtraPanel, BorderLayout.CENTER);
+ } else {
+ super.layout();
+ }
+ }
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+ myCountLabel.setText("");
+ final Component component = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+ if ("Problems".equals(descriptor.getTextFor(value))) {
+ final ErrorPaneConfigurable errorPane = (ErrorPaneConfigurable)((Place)value).getPath("category");
+ if (errorPane != null && errorPane.getErrorsCount() > 0) {
+ myCountLabel.setSelected(isSelected);
+ myCountLabel.setText(String.valueOf(errorPane.getErrorsCount()));
+ }
+ }
+ return component;
+ }
+
+ @Override
+ protected JComponent createItemComponent() {
+ myExtraPanel = new NonOpaquePanel(new BorderLayout());
+ myCountLabel = new CountLabel();
+
+
+ if (Registry.is("ide.new.project.settings")) {
+ myTextLabel = new EngravedLabel();
+ myTextLabel.setFont(myTextLabel.getFont().deriveFont(Font.BOLD));
+ myTextLabel.setForeground(Gray._240);
+ myTextLabel.setOpaque(true);
+ return layoutComponent(myTextLabel);
+ }
+ return super.createItemComponent();
+ }
+
@Override
protected Color getBackground() {
- return Registry.is("ide.new.project.settings") ? new Color(0xD2D6DD) : super.getBackground();
+ return Registry.is("ide.new.project.settings") ? UIUtil.getSidePanelColor() : super.getBackground();
}
});
@@ -114,6 +205,10 @@
});
}
+ public JList getList() {
+ return myList;
+ }
+
public void addPlace(Place place, @NotNull Presentation presentation) {
myModel.addElement(place);
myPlaces.add(place);
@@ -133,4 +228,51 @@
public void select(final Place place) {
myList.setSelectedValue(place, true);
}
+
+ private static class CountLabel extends JLabel {
+ private boolean mySelected;
+
+ public CountLabel() {
+ super();
+ setBorder(new Border() {
+ @Override
+ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
+ }
+
+ @Override
+ public Insets getBorderInsets(Component c) {
+ return StringUtil.isEmpty(getText()) ? new Insets(0,0,0,0) : new Insets(2, 6, 2, 6 + 6);
+ }
+
+ @Override
+ public boolean isBorderOpaque() {
+ return false;
+ }
+ });
+ setFont(UIUtil.getListFont().deriveFont(Font.BOLD));
+ }
+
+ public boolean isSelected() {
+ return mySelected;
+ }
+
+ public void setSelected(boolean selected) {
+ mySelected = selected;
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ g.setColor(isSelected() ? UIUtil.getListSelectionBackground() : UIUtil.getSidePanelColor());
+ g.fillRect(0, 0, getWidth(), getHeight());
+ if (StringUtil.isEmpty(getText())) return;
+ final JBColor deepBlue = new JBColor(new Color(0x97A4B2), new Color(92, 98, 113));
+ g.setColor(isSelected() ? Gray._255.withAlpha(UIUtil.isUnderDarcula() ? 100 : 220) : deepBlue);
+ final GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
+ g.fillRoundRect(0, 3, getWidth() - 6 -1, getHeight()-6 , (getHeight() - 6), (getHeight() - 6));
+ config.restore();
+ setForeground(isSelected() ? deepBlue.darker() : UIUtil.getListForeground(true));
+
+ super.paintComponent(g);
+ }
+ }
}
diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/LibraryProjectStructureElement.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/LibraryProjectStructureElement.java
index 1fc3dbd..7af12e9 100644
--- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/LibraryProjectStructureElement.java
+++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/LibraryProjectStructureElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -34,6 +34,7 @@
import com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext;
import com.intellij.openapi.ui.NamedConfigurable;
import com.intellij.openapi.util.ActionCallback;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.PathUtil;
import com.intellij.xml.util.XmlStringUtil;
@@ -95,7 +96,14 @@
private static String createInvalidRootsDescription(List<String> invalidClasses, String rootName, String libraryName) {
StringBuilder buffer = new StringBuilder();
- buffer.append("Library '").append(StringUtil.escapeXml(libraryName)).append("' has broken " + rootName + " " + StringUtil.pluralize("path", invalidClasses.size()) + ":");
+ final String name = StringUtil.escapeXml(libraryName);
+ buffer.append("Library ");
+ if (Registry.is("ide.new.project.settings")) {
+ buffer.append("<a href='http://library/").append(name).append("'>").append(name).append("</a>");
+ } else {
+ buffer.append("'").append(name).append("'");
+ }
+ buffer.append(" has broken " + rootName + " " + StringUtil.pluralize("path", invalidClasses.size()) + ":");
for (String url : invalidClasses) {
buffer.append("<br> ");
buffer.append(PathUtil.toPresentableUrl(url));
@@ -150,7 +158,10 @@
@Override
public ProjectStructureProblemDescription createUnusedElementWarning() {
final List<ConfigurationErrorQuickFix> fixes = Arrays.asList(new AddLibraryToDependenciesFix(), new RemoveLibraryFix(), new RemoveAllUnusedLibrariesFix());
- return new ProjectStructureProblemDescription("Library '" + StringUtil.escapeXml(myLibrary.getName()) + "'" + " is not used", null, createPlace(),
+ final String name = StringUtil.escapeXml(myLibrary.getName());
+ String libraryName = Registry.is("ide.new.project.settings") ? "<a href='http://library/" + name + "'>" + name + "</a>"
+ : "'" + name + "'";
+ return new ProjectStructureProblemDescription("Library " + libraryName + " is not used", null, createPlace(),
ProjectStructureProblemType.unused("unused-library"), ProjectStructureProblemDescription.ProblemLevel.PROJECT,
fixes, false);
}
diff --git a/java/idea-ui/src/com/intellij/platform/templates/SaveProjectAsTemplateAction.java b/java/idea-ui/src/com/intellij/platform/templates/SaveProjectAsTemplateAction.java
index c2fafe0..328eda5 100644
--- a/java/idea-ui/src/com/intellij/platform/templates/SaveProjectAsTemplateAction.java
+++ b/java/idea-ui/src/com/intellij/platform/templates/SaveProjectAsTemplateAction.java
@@ -40,7 +40,6 @@
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.JDOMUtil;
-import com.intellij.openapi.util.ThrowableComputable;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.io.StreamUtil;
import com.intellij.openapi.vfs.VfsUtil;
@@ -177,12 +176,7 @@
@Override
public InputStream getContent(final File file) throws IOException {
if (virtualFile.getFileType().isBinary() || PROJECT_TEMPLATE_XML.equals(virtualFile.getName())) return STANDARD.getContent(file);
- String result = ApplicationManager.getApplication().runReadAction(new ThrowableComputable<String, IOException>() {
- @Override
- public String compute() throws IOException {
- return getEncodedContent(virtualFile, project, parameters);
- }
- });
+ String result = getEncodedContent(virtualFile, project, parameters);
return new ByteArrayInputStream(result.getBytes(TemplateModuleBuilder.UTF_8));
}
});
@@ -253,10 +247,10 @@
public static String getEncodedContent(VirtualFile virtualFile,
Project project,
Map<String, String> parameters) throws IOException {
+ String text = VfsUtilCore.loadText(virtualFile);
final FileTemplate template = FileTemplateManager.getInstance().getDefaultTemplate(FileTemplateManager.FILE_HEADER_TEMPLATE_NAME);
final String templateText = template.getText();
final Pattern pattern = FileHeaderChecker.getTemplatePattern(template, project, new TIntObjectHashMap<String>());
- String text = VfsUtilCore.loadText(virtualFile);
String result = convertTemplates(text, pattern, templateText);
result = ProjectTemplateFileProcessor.encodeFile(result, virtualFile, project);
for (Map.Entry<String, String> entry : parameters.entrySet()) {
diff --git a/java/java-analysis-impl/java-analysis-impl.iml b/java/java-analysis-impl/java-analysis-impl.iml
index c3f33d6..95c129b 100644
--- a/java/java-analysis-impl/java-analysis-impl.iml
+++ b/java/java-analysis-impl/java-analysis-impl.iml
@@ -17,6 +17,7 @@
<orderEntry type="module" module-name="java-analysis-api" exported="" />
<orderEntry type="module" module-name="resources-en" />
<orderEntry type="module" module-name="xml-psi-impl" />
+ <orderEntry type="library" exported="" name="asm5" level="project" />
</component>
</module>
diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/InferredAnnotationsManagerImpl.java b/java/java-analysis-impl/src/com/intellij/codeInsight/InferredAnnotationsManagerImpl.java
new file mode 100644
index 0000000..813ff25
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInsight/InferredAnnotationsManagerImpl.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2000-2014 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.codeInsight;
+
+import com.intellij.codeInspection.bytecodeAnalysis.ProjectBytecodeAnalysis;
+import com.intellij.codeInspection.dataFlow.ContractInference;
+import com.intellij.codeInspection.dataFlow.MethodContract;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.PsiAnnotation;
+import com.intellij.psi.PsiMethod;
+import com.intellij.psi.PsiModifierListOwner;
+import com.intellij.psi.util.PsiUtil;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+import static com.intellij.codeInspection.dataFlow.ControlFlowAnalyzer.ORG_JETBRAINS_ANNOTATIONS_CONTRACT;
+
+public class InferredAnnotationsManagerImpl extends InferredAnnotationsManager {
+ @Nullable
+ @Override
+ public PsiAnnotation findInferredAnnotation(@NotNull PsiModifierListOwner listOwner, @NotNull String annotationFQN) {
+ PsiAnnotation fromBytecode = ProjectBytecodeAnalysis.getInstance(listOwner.getProject()).findInferredAnnotation(listOwner, annotationFQN);
+ if (fromBytecode != null) {
+ return fromBytecode;
+ }
+
+ if (ORG_JETBRAINS_ANNOTATIONS_CONTRACT.equals(annotationFQN) && canHaveContract(listOwner)) {
+ List<MethodContract> contracts = ContractInference.inferContracts((PsiMethod)listOwner);
+ if (!contracts.isEmpty()) {
+ return ProjectBytecodeAnalysis.getInstance(listOwner.getProject()).createContractAnnotation("\"" + StringUtil.join(contracts, "; ") + "\"");
+ }
+ }
+
+ return null;
+ }
+
+ private static boolean canHaveContract(PsiModifierListOwner listOwner) {
+ return listOwner instanceof PsiMethod && !PsiUtil.canBeOverriden((PsiMethod)listOwner);
+ }
+
+ @NotNull
+ @Override
+ public PsiAnnotation[] findInferredAnnotations(@NotNull PsiModifierListOwner listOwner) {
+ List<PsiAnnotation> result = ContainerUtil.newArrayList();
+ PsiAnnotation[] fromBytecode = ProjectBytecodeAnalysis.getInstance(listOwner.getProject()).findInferredAnnotations(listOwner);
+ for (PsiAnnotation annotation : fromBytecode) {
+ if (!ORG_JETBRAINS_ANNOTATIONS_CONTRACT.equals(annotation.getQualifiedName()) || canHaveContract(listOwner)) {
+ result.add(annotation);
+ }
+ }
+
+ if (canHaveContract(listOwner)) {
+ List<MethodContract> contracts = ContractInference.inferContracts((PsiMethod)listOwner);
+ if (!contracts.isEmpty()) {
+ result.add(ProjectBytecodeAnalysis.getInstance(listOwner.getProject())
+ .createContractAnnotation("\"" + StringUtil.join(contracts, "; ") + "\""));
+ }
+ }
+
+ return result.isEmpty() ? PsiAnnotation.EMPTY_ARRAY : result.toArray(new PsiAnnotation[result.size()]);
+ }
+
+ @Override
+ public boolean isInferredAnnotation(@NotNull PsiAnnotation annotation) {
+ return annotation.getUserData(ProjectBytecodeAnalysis.INFERRED_ANNOTATION) != null;
+ }
+}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddTypeCastFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddTypeCastFix.java
index 0ccad5c..9fc35a6 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddTypeCastFix.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddTypeCastFix.java
@@ -31,6 +31,7 @@
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.codeStyle.CodeStyleManager;
+import com.intellij.psi.codeStyle.JavaCodeStyleManager;
import com.intellij.psi.util.PsiUtil;
import com.intellij.psi.util.TypeConversionUtil;
import org.jetbrains.annotations.NotNull;
@@ -91,6 +92,7 @@
String text = "(" + type.getCanonicalText(false) + ")value";
PsiElementFactory factory = JavaPsiFacade.getInstance(original.getProject()).getElementFactory();
PsiTypeCastExpression typeCast = (PsiTypeCastExpression)factory.createExpressionFromText(text, original);
+ typeCast = (PsiTypeCastExpression)JavaCodeStyleManager.getInstance(project).shortenClassReferences(typeCast);
typeCast = (PsiTypeCastExpression)CodeStyleManager.getInstance(project).reformat(typeCast);
if (expression instanceof PsiConditionalExpression) {
diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/intention/AddAnnotationPsiFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/intention/AddAnnotationPsiFix.java
index 84f704f..e5e4bb6 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInsight/intention/AddAnnotationPsiFix.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInsight/intention/AddAnnotationPsiFix.java
@@ -75,13 +75,16 @@
PsiElement element = file.findElementAt(offset);
- PsiModifierListOwner listOwner = PsiTreeUtil.getParentOfType(element, PsiParameter.class, false);
- if (listOwner != null) return listOwner;
+ PsiModifierListOwner listOwner = PsiTreeUtil.getParentOfType(element, PsiModifierListOwner.class, false);
+ if (listOwner instanceof PsiParameter) return listOwner;
- final PsiIdentifier psiIdentifier = PsiTreeUtil.getParentOfType(element, PsiIdentifier.class, false);
- if (psiIdentifier != null && psiIdentifier.getParent() instanceof PsiModifierListOwner) {
- return (PsiModifierListOwner)psiIdentifier.getParent();
+ if (listOwner instanceof PsiNameIdentifierOwner) {
+ PsiElement id = ((PsiNameIdentifierOwner)listOwner).getNameIdentifier();
+ if (id != null && id.getTextRange().containsOffset(offset)) { // Groovy methods will pass this check as well
+ return listOwner;
+ }
}
+
return null;
}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeLambdaInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeLambdaInspection.java
index 96066c3..c1f127d 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeLambdaInspection.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeLambdaInspection.java
@@ -32,10 +32,7 @@
import com.intellij.psi.controlFlow.ControlFlowUtil;
import com.intellij.psi.impl.source.resolve.DefaultParameterTypeInferencePolicy;
import com.intellij.psi.infos.MethodCandidateInfo;
-import com.intellij.psi.util.InheritanceUtil;
-import com.intellij.psi.util.PsiTreeUtil;
-import com.intellij.psi.util.PsiTypesUtil;
-import com.intellij.psi.util.PsiUtil;
+import com.intellij.psi.util.*;
import com.intellij.util.ArrayUtilRt;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtilRt;
@@ -91,16 +88,12 @@
final PsiMethod[] methods = aClass.getMethods();
if (methods.length == 1 && aClass.getFields().length == 0) {
final PsiCodeBlock body = methods[0].getBody();
- if (body != null) {
- final ForbiddenRefsChecker checker = new ForbiddenRefsChecker(methods[0], aClass);
- body.accept(checker);
- if (!checker.hasForbiddenRefs()) {
- final PsiElement lBrace = aClass.getLBrace();
- LOG.assertTrue(lBrace != null);
- final TextRange rangeInElement = new TextRange(0, aClass.getStartOffsetInParent() + lBrace.getStartOffsetInParent());
- holder.registerProblem(aClass.getParent(), "Anonymous #ref #loc can be replaced with lambda",
- ProblemHighlightType.LIKE_UNUSED_SYMBOL, rangeInElement, new ReplaceWithLambdaFix());
- }
+ if (body != null && !hasForbiddenRefsInsideBody(methods[0], aClass)) {
+ final PsiElement lBrace = aClass.getLBrace();
+ LOG.assertTrue(lBrace != null);
+ final TextRange rangeInElement = new TextRange(0, aClass.getStartOffsetInParent() + lBrace.getStartOffsetInParent());
+ holder.registerProblem(aClass.getParent(), "Anonymous #ref #loc can be replaced with lambda",
+ ProblemHighlightType.LIKE_UNUSED_SYMBOL, rangeInElement, new ReplaceWithLambdaFix());
}
}
}
@@ -110,6 +103,14 @@
};
}
+ public static boolean hasForbiddenRefsInsideBody(PsiMethod method, PsiAnonymousClass aClass) {
+ final ForbiddenRefsChecker checker = new ForbiddenRefsChecker(method, aClass);
+ final PsiCodeBlock body = method.getBody();
+ LOG.assertTrue(body != null);
+ body.accept(checker);
+ return checker.hasForbiddenRefs();
+ }
+
private static PsiType getInferredType(PsiAnonymousClass aClass) {
final PsiExpression expression = (PsiExpression)aClass.getParent();
final PsiType psiType = PsiTypesUtil.getExpectedTypeByParent(expression);
@@ -369,14 +370,14 @@
private final PsiMethod myMethod;
private final PsiAnonymousClass myAnonymClass;
- private final boolean myRawType;
+ private final boolean myEqualInference;
public ForbiddenRefsChecker(PsiMethod method,
PsiAnonymousClass aClass) {
myMethod = method;
myAnonymClass = aClass;
final PsiType inferredType = getInferredType(aClass);
- myRawType = inferredType instanceof PsiClassType && ((PsiClassType)inferredType).isRaw();
+ myEqualInference = !aClass.getBaseClassType().equals(inferredType);
}
@Override
@@ -467,7 +468,7 @@
}
}
- if (myRawType) {
+ if (myEqualInference) {
final PsiElement resolved = expression.resolve();
if (resolved instanceof PsiParameter && ((PsiParameter)resolved).getDeclarationScope() == myMethod) {
final int parameterIndex = myMethod.getParameterList().getParameterIndex((PsiParameter)resolved);
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java
index d6a884c..c3363ec 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java
@@ -69,7 +69,7 @@
final PsiClassType baseClassType = aClass.getBaseClassType();
if (LambdaUtil.isFunctionalType(baseClassType)) {
final PsiMethod[] methods = aClass.getMethods();
- if (methods.length == 1 && aClass.getFields().length == 0) {
+ if (methods.length == 1 && aClass.getFields().length == 0 && !AnonymousCanBeLambdaInspection.hasForbiddenRefsInsideBody(methods[0], aClass)) {
final PsiCodeBlock body = methods[0].getBody();
final PsiCallExpression callExpression =
LambdaCanBeMethodReferenceInspection
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/LambdaCanBeMethodReferenceInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/LambdaCanBeMethodReferenceInspection.java
index 1e887030..416226e 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/LambdaCanBeMethodReferenceInspection.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/LambdaCanBeMethodReferenceInspection.java
@@ -245,11 +245,14 @@
PsiParameter[] candidateParams = method.getParameterList().getParameters();
if (candidateParams.length == 1) {
if (TypeConversionUtil.areTypesConvertible(candidateParams[0].getType(), parameters[0].getType())) {
- for (PsiMethod superMethod : psiMethod.findDeepestSuperMethods()) {
- PsiMethod validSuperMethod = ensureNonAmbiguousMethod(parameters, superMethod);
- if (validSuperMethod != null) return validSuperMethod;
+ final PsiMethod[] deepestSuperMethods = psiMethod.findDeepestSuperMethods();
+ if (deepestSuperMethods.length > 0) {
+ for (PsiMethod superMethod : deepestSuperMethods) {
+ PsiMethod validSuperMethod = ensureNonAmbiguousMethod(parameters, superMethod);
+ if (validSuperMethod != null) return validSuperMethod;
+ }
+ return null;
}
- return null;
}
}
}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Analysis.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Analysis.java
new file mode 100644
index 0000000..44e493c
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Analysis.java
@@ -0,0 +1,398 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import gnu.trove.TIntObjectHashMap;
+import org.jetbrains.org.objectweb.asm.Opcodes;
+import org.jetbrains.org.objectweb.asm.Type;
+import org.jetbrains.org.objectweb.asm.tree.MethodNode;
+import org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException;
+import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue;
+import org.jetbrains.org.objectweb.asm.tree.analysis.Frame;
+
+import java.util.*;
+
+class AbstractValues {
+ static final class ParamValue extends BasicValue {
+ ParamValue(Type tp) {
+ super(tp);
+ }
+ }
+ static final BasicValue InstanceOfCheckValue = new BasicValue(Type.INT_TYPE) {
+ @Override
+ public boolean equals(Object value) {
+ return this == value;
+ }
+ };
+
+ static final BasicValue TrueValue = new BasicValue(Type.INT_TYPE) {
+ @Override
+ public boolean equals(Object value) {
+ return this == value;
+ }
+ };
+
+ static final BasicValue FalseValue = new BasicValue(Type.INT_TYPE) {
+ @Override
+ public boolean equals(Object value) {
+ return this == value;
+ }
+ };
+
+ static final BasicValue NullValue = new BasicValue(Type.getObjectType("null")) {
+ @Override
+ public boolean equals(Object value) {
+ return this == value;
+ }
+ };
+ static final class NotNullValue extends BasicValue {
+ NotNullValue(Type tp) {
+ super(tp);
+ }
+ }
+ static final class CallResultValue extends BasicValue {
+ final Set<Key> inters;
+ CallResultValue(Type tp, Set<Key> inters) {
+ super(tp);
+ this.inters = inters;
+ }
+ }
+
+ static boolean isInstance(Conf curr, Conf prev) {
+ if (curr.insnIndex != prev.insnIndex) {
+ return false;
+ }
+ Frame<BasicValue> currFr = curr.frame;
+ Frame<BasicValue> prevFr = prev.frame;
+ for (int i = 0; i < currFr.getLocals(); i++) {
+ if (!isInstance(currFr.getLocal(i), prevFr.getLocal(i))) {
+ return false;
+ }
+ }
+ for (int i = 0; i < currFr.getStackSize(); i++) {
+ if (!isInstance(currFr.getStack(i), prevFr.getStack(i))) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ static boolean isInstance(BasicValue curr, BasicValue prev) {
+ if (prev instanceof ParamValue) {
+ return curr instanceof ParamValue;
+ }
+ if (InstanceOfCheckValue == prev) {
+ return InstanceOfCheckValue == curr;
+ }
+ if (TrueValue == prev) {
+ return TrueValue == curr;
+ }
+ if (FalseValue == prev) {
+ return FalseValue == curr;
+ }
+ if (NullValue == prev) {
+ return NullValue == curr;
+ }
+ if (prev instanceof NotNullValue) {
+ return curr instanceof NotNullValue;
+ }
+ if (prev instanceof CallResultValue) {
+ if (curr instanceof CallResultValue) {
+ CallResultValue prevCall = (CallResultValue) prev;
+ CallResultValue currCall = (CallResultValue) curr;
+ return prevCall.inters.equals(currCall.inters);
+ }
+ else {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ static boolean equiv(Conf curr, Conf prev) {
+ Frame<BasicValue> currFr = curr.frame;
+ Frame<BasicValue> prevFr = prev.frame;
+ for (int i = currFr.getStackSize() - 1; i >= 0; i--) {
+ if (!equiv(currFr.getStack(i), prevFr.getStack(i))) {
+ return false;
+ }
+ }
+ for (int i = currFr.getLocals() - 1; i >= 0; i--) {
+ if (!equiv(currFr.getLocal(i), prevFr.getLocal(i))) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ static boolean equiv(BasicValue curr, BasicValue prev) {
+ if (curr.getClass() == prev.getClass()) {
+ if (curr instanceof CallResultValue && prev instanceof CallResultValue) {
+ Set<Key> keys1 = ((CallResultValue)prev).inters;
+ Set<Key> keys2 = ((CallResultValue)curr).inters;
+ return keys1.equals(keys2);
+ }
+ else return true;
+ }
+ else return false;
+ }
+}
+
+final class Conf {
+ final int insnIndex;
+ final Frame<BasicValue> frame;
+ final int fastHashCode;
+
+ Conf(int insnIndex, Frame<BasicValue> frame) {
+ this.insnIndex = insnIndex;
+ this.frame = frame;
+
+ int hash = 0;
+ for (int i = 0; i < frame.getLocals(); i++) {
+ hash = hash * 31 + frame.getLocal(i).getClass().hashCode();
+ }
+ for (int i = 0; i < frame.getStackSize(); i++) {
+ hash = hash * 31 + frame.getStack(i).getClass().hashCode();
+ }
+ fastHashCode = hash;
+ }
+}
+
+final class State {
+ final int index;
+ final Conf conf;
+ final List<Conf> history;
+ final boolean taken;
+ final boolean hasCompanions;
+
+ State(int index, Conf conf, List<Conf> history, boolean taken, boolean hasCompanions) {
+ this.index = index;
+ this.conf = conf;
+ this.history = history;
+ this.taken = taken;
+ this.hasCompanions = hasCompanions;
+ }
+}
+
+interface PendingAction<Res> {}
+class ProceedState<Res> implements PendingAction<Res> {
+ final State state;
+
+ ProceedState(State state) {
+ this.state = state;
+ }
+}
+class MakeResult<Res> implements PendingAction<Res> {
+ final State state;
+ final Res subResult;
+ final int[] indices;
+
+ MakeResult(State state, Res subResult, int[] indices) {
+ this.state = state;
+ this.subResult = subResult;
+ this.indices = indices;
+ }
+}
+
+abstract class Analysis<Res> {
+ private static final int STEPS_LIMIT = 30000;
+ final RichControlFlow richControlFlow;
+ final Direction direction;
+ final ControlFlowGraph controlFlow;
+ final MethodNode methodNode;
+ final Method method;
+ final DFSTree dfsTree;
+ final Res myIdentity;
+
+ final Deque<PendingAction<Res>> pending = new LinkedList<PendingAction<Res>>();
+ final TIntObjectHashMap<List<State>> computed = new TIntObjectHashMap<List<State>>();
+ final TIntObjectHashMap<Res> results = new TIntObjectHashMap<Res>();
+ final Key aKey;
+
+ Res earlyResult = null;
+
+ abstract Res identity();
+ abstract Res combineResults(Res delta, List<Res> subResults);
+ abstract boolean isEarlyResult(Res res);
+ abstract Equation<Key, Value> mkEquation(Res result);
+ abstract void processState(State state) throws AnalyzerException;
+
+ protected Analysis(RichControlFlow richControlFlow, Direction direction, boolean stable) {
+ this.richControlFlow = richControlFlow;
+ this.direction = direction;
+ controlFlow = richControlFlow.controlFlow;
+ methodNode = controlFlow.methodNode;
+ method = new Method(controlFlow.className, methodNode.name, methodNode.desc);
+ dfsTree = richControlFlow.dfsTree;
+ aKey = new Key(method, direction, stable);
+ myIdentity = identity();
+ }
+
+ final State createStartState() {
+ return new State(0, new Conf(0, createStartFrame()), new ArrayList<Conf>(), false, false);
+ }
+
+ static boolean stateEquiv(State curr, State prev) {
+ if (curr.taken != prev.taken) {
+ return false;
+ }
+ if (curr.conf.fastHashCode != prev.conf.fastHashCode) {
+ return false;
+ }
+ if (!AbstractValues.equiv(curr.conf, prev.conf)) {
+ return false;
+ }
+ if (curr.history.size() != prev.history.size()) {
+ return false;
+ }
+ for (int i = 0; i < curr.history.size(); i++) {
+ Conf curr1 = curr.history.get(i);
+ Conf prev1 = prev.history.get(i);
+ if (curr1.fastHashCode != prev1.fastHashCode || !AbstractValues.equiv(curr1, prev1)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ final Equation<Key, Value> analyze() throws AnalyzerException {
+ pending.push(new ProceedState<Res>(createStartState()));
+ int steps = 0;
+ while (!pending.isEmpty() && earlyResult == null) {
+ steps ++;
+ if (steps >= STEPS_LIMIT) {
+ throw new AnalyzerException(null, "limit is reached, steps: " + steps + " in method " + method);
+ }
+ PendingAction<Res> action = pending.pop();
+ if (action instanceof MakeResult) {
+ MakeResult<Res> makeResult = (MakeResult<Res>) action;
+ ArrayList<Res> subResults = new ArrayList<Res>();
+ for (int index : makeResult.indices) {
+ subResults.add(results.get(index));
+ }
+ Res result = combineResults(makeResult.subResult, subResults);
+ if (isEarlyResult(result)) {
+ earlyResult = result;
+ } else {
+ State state = makeResult.state;
+ int insnIndex = state.conf.insnIndex;
+ results.put(state.index, result);
+ List<State> thisComputed = computed.get(insnIndex);
+ if (thisComputed == null) {
+ thisComputed = new ArrayList<State>();
+ computed.put(insnIndex, thisComputed);
+ }
+ thisComputed.add(state);
+ }
+ }
+ else if (action instanceof ProceedState) {
+ ProceedState<Res> proceedState = (ProceedState<Res>) action;
+ State state = proceedState.state;
+ int insnIndex = state.conf.insnIndex;
+ Conf conf = state.conf;
+ List<Conf> history = state.history;
+
+ boolean fold = false;
+ if (dfsTree.loopEnters.contains(insnIndex)) {
+ for (Conf prev : history) {
+ if (AbstractValues.isInstance(conf, prev)) {
+ fold = true;
+ }
+ }
+ }
+ if (fold) {
+ results.put(state.index, myIdentity);
+ List<State> thisComputed = computed.get(insnIndex);
+ if (thisComputed == null) {
+ thisComputed = new ArrayList<State>();
+ computed.put(insnIndex, thisComputed);
+ }
+ thisComputed.add(state);
+ }
+ else {
+ State baseState = null;
+ List<State> thisComputed = computed.get(insnIndex);
+ if (thisComputed != null) {
+ for (State prevState : thisComputed) {
+ if (stateEquiv(state, prevState)) {
+ baseState = prevState;
+ break;
+ }
+ }
+ }
+ if (baseState != null) {
+ results.put(state.index, results.get(baseState.index));
+ } else {
+ // the main call
+ processState(state);
+ }
+
+ }
+ }
+ }
+ if (earlyResult != null) {
+ return mkEquation(earlyResult);
+ } else {
+ return mkEquation(results.get(0));
+ }
+ }
+
+ final Frame<BasicValue> createStartFrame() {
+ Frame<BasicValue> frame = new Frame<BasicValue>(methodNode.maxLocals, methodNode.maxStack);
+ Type returnType = Type.getReturnType(methodNode.desc);
+ BasicValue returnValue = Type.VOID_TYPE.equals(returnType) ? null : new BasicValue(returnType);
+ frame.setReturn(returnValue);
+
+ Type[] args = Type.getArgumentTypes(methodNode.desc);
+ int local = 0;
+ if ((methodNode.access & Opcodes.ACC_STATIC) == 0) {
+ frame.setLocal(local++, new AbstractValues.NotNullValue(Type.getObjectType(controlFlow.className)));
+ }
+ for (int i = 0; i < args.length; i++) {
+ BasicValue value;
+ if (direction instanceof InOut && ((InOut)direction).paramIndex == i) {
+ value = new AbstractValues.ParamValue(args[i]);
+ }
+ else if (direction instanceof In && ((In)direction).paramIndex == i) {
+ value = new AbstractValues.ParamValue(args[i]);
+ }
+ else {
+ value = new BasicValue(args[i]);
+ }
+ frame.setLocal(local++, value);
+ if (args[i].getSize() == 2) {
+ frame.setLocal(local++, BasicValue.UNINITIALIZED_VALUE);
+ }
+ }
+ while (local < methodNode.maxLocals) {
+ frame.setLocal(local++, BasicValue.UNINITIALIZED_VALUE);
+ }
+ return frame;
+ }
+
+ static BasicValue popValue(Frame<BasicValue> frame) {
+ return frame.getStack(frame.getStackSize() - 1);
+ }
+
+ static <A> List<A> append(List<A> xs, A x) {
+ ArrayList<A> result = new ArrayList<A>();
+ if (xs != null) {
+ result.addAll(xs);
+ }
+ result.add(x);
+ return result;
+ }
+}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisConverter.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisConverter.java
new file mode 100644
index 0000000..f29dd7f
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisConverter.java
@@ -0,0 +1,485 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import com.intellij.ide.util.PropertiesComponent;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.PathManager;
+import com.intellij.openapi.components.ApplicationComponent;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.util.ThrowableComputable;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.*;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.util.TypeConversionUtil;
+import com.intellij.util.io.*;
+import gnu.trove.TIntHashSet;
+import gnu.trove.TIntObjectHashMap;
+import gnu.trove.TIntObjectIterator;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.org.objectweb.asm.Type;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+
+import static com.intellij.codeInspection.bytecodeAnalysis.ProjectBytecodeAnalysis.LOG;
+
+/**
+ * @author lambdamix
+ */
+public class BytecodeAnalysisConverter implements ApplicationComponent {
+
+ private static final String VERSION = "BytecodeAnalysisConverter.Enumerators";
+
+ public static BytecodeAnalysisConverter getInstance() {
+ return ApplicationManager.getApplication().getComponent(BytecodeAnalysisConverter.class);
+ }
+
+ private PersistentStringEnumerator myNamesEnumerator;
+ private PersistentEnumeratorDelegate<int[]> myCompoundKeyEnumerator;
+ private int version;
+
+ @Override
+ public void initComponent() {
+ version = PropertiesComponent.getInstance().getOrInitInt(VERSION, 0);
+ final File keysDir = new File(PathManager.getIndexRoot(), "bytecodekeys");
+ final File namesFile = new File(keysDir, "names");
+ final File compoundKeysFile = new File(keysDir, "compound");
+
+ try {
+ IOUtil.openCleanOrResetBroken(new ThrowableComputable<Void, IOException>() {
+ @Override
+ public Void compute() throws IOException {
+ myNamesEnumerator = new PersistentStringEnumerator(namesFile, true);
+ myCompoundKeyEnumerator = new IntArrayPersistentEnumerator(compoundKeysFile, new IntArrayKeyDescriptor());
+ return null;
+ }
+ }, new Runnable() {
+ @Override
+ public void run() {
+ LOG.info("Error during initialization of enumerators in bytecode analysis. Re-initializing.");
+ IOUtil.deleteAllFilesStartingWith(keysDir);
+ version ++;
+ }
+ });
+ }
+ catch (IOException e) {
+ LOG.error("Re-initialization of enumerators in bytecode analysis failed.", e);
+ }
+ // TODO: is it enough for rebuilding indices?
+ PropertiesComponent.getInstance().setValue(VERSION, String.valueOf(version));
+ }
+
+ @Override
+ public void disposeComponent() {
+ try {
+ myNamesEnumerator.close();
+ myCompoundKeyEnumerator.close();
+ }
+ catch (IOException e) {
+ LOG.debug(e);
+ }
+ }
+
+ @NotNull
+ @Override
+ public String getComponentName() {
+ return "BytecodeAnalysisConverter";
+ }
+
+ IntIdEquation convert(Equation<Key, Value> equation) throws IOException {
+ ProgressManager.checkCanceled();
+
+ Result<Key, Value> rhs = equation.rhs;
+ IntIdResult result;
+ if (rhs instanceof Final) {
+ result = new IntIdFinal(((Final<Key, Value>)rhs).value);
+ } else {
+ Pending<Key, Value> pending = (Pending<Key, Value>)rhs;
+ Set<Product<Key, Value>> sumOrigin = pending.sum;
+ IntIdComponent[] components = new IntIdComponent[sumOrigin.size()];
+ int componentI = 0;
+ for (Product<Key, Value> prod : sumOrigin) {
+ int[] intProd = new int[prod.ids.size()];
+ int idI = 0;
+ for (Key id : prod.ids) {
+ int rawId = mkAsmKey(id);
+ if (rawId <= 0) {
+ LOG.error("raw key should be positive. rawId = " + rawId);
+ }
+ intProd[idI] = id.stable ? rawId : -rawId;
+ idI++;
+ }
+ IntIdComponent intIdComponent = new IntIdComponent(prod.value, intProd);
+ components[componentI] = intIdComponent;
+ componentI++;
+ }
+ result = new IntIdPending(components);
+ }
+
+ int rawKey = mkAsmKey(equation.id);
+ if (rawKey <= 0) {
+ LOG.error("raw key should be positive. rawKey = " + rawKey);
+ }
+
+ int key = equation.id.stable ? rawKey : -rawKey;
+ return new IntIdEquation(key, result);
+ }
+
+ public int mkAsmKey(@NotNull Key key) throws IOException {
+ return myCompoundKeyEnumerator.enumerate(new int[]{mkDirectionKey(key.direction), mkAsmSignatureKey(key.method)});
+ }
+
+ private int mkDirectionKey(Direction dir) throws IOException {
+ return myCompoundKeyEnumerator.enumerate(new int[]{dir.directionId(), dir.paramId(), dir.valueId()});
+ }
+
+ // class + short signature
+ private int mkAsmSignatureKey(@NotNull Method method) throws IOException {
+ int[] sigKey = new int[2];
+ sigKey[0] = mkAsmTypeKey(Type.getObjectType(method.internalClassName));
+ sigKey[1] = mkAsmShortSignatureKey(method);
+ return myCompoundKeyEnumerator.enumerate(sigKey);
+ }
+
+ private int mkAsmShortSignatureKey(@NotNull Method method) throws IOException {
+ Type[] argTypes = Type.getArgumentTypes(method.methodDesc);
+ int arity = argTypes.length;
+ int[] sigKey = new int[3 + arity];
+ sigKey[0] = mkAsmTypeKey(Type.getReturnType(method.methodDesc));
+ sigKey[1] = myNamesEnumerator.enumerate(method.methodName);
+ sigKey[2] = argTypes.length;
+ for (int i = 0; i < argTypes.length; i++) {
+ sigKey[3 + i] = mkAsmTypeKey(argTypes[i]);
+ }
+ return myCompoundKeyEnumerator.enumerate(sigKey);
+ }
+
+ @Nullable
+ private static Direction extractDirection(int[] directionKey) {
+ switch (directionKey[0]) {
+ case Direction.OUT_DIRECTION:
+ return new Out();
+ case Direction.IN_DIRECTION:
+ return new In(directionKey[1]);
+ case Direction.INOUT_DIRECTION:
+ return new InOut(directionKey[1], Value.values()[directionKey[2]]);
+ }
+ return null;
+ }
+
+ private int mkAsmTypeKey(Type type) throws IOException {
+ String className = type.getClassName();
+ int dotIndex = className.lastIndexOf('.');
+ String packageName;
+ String simpleName;
+ if (dotIndex > 0) {
+ packageName = className.substring(0, dotIndex);
+ simpleName = className.substring(dotIndex + 1);
+ } else {
+ packageName = "";
+ simpleName = className;
+ }
+ int[] classKey = new int[]{myNamesEnumerator.enumerate(packageName), myNamesEnumerator.enumerate(simpleName)};
+ return myCompoundKeyEnumerator.enumerate(classKey);
+ }
+
+ public int mkPsiKey(@NotNull PsiMethod psiMethod, Direction direction) throws IOException {
+ final PsiClass psiClass = PsiTreeUtil.getParentOfType(psiMethod, PsiClass.class, false);
+ if (psiClass == null) {
+ LOG.debug("PsiClass was null for " + psiMethod.getName());
+ return -1;
+ }
+ int sigKey = mkPsiSignatureKey(psiMethod);
+ if (sigKey == -1) {
+ return -1;
+ }
+ return myCompoundKeyEnumerator.enumerate(new int[]{mkDirectionKey(direction), sigKey});
+
+ }
+
+ private int mkPsiSignatureKey(@NotNull PsiMethod psiMethod) throws IOException {
+ final PsiClass psiClass = PsiTreeUtil.getParentOfType(psiMethod, PsiClass.class, false);
+ if (psiClass == null) {
+ LOG.debug("PsiClass was null for " + psiMethod.getName());
+ return -1;
+ }
+ PsiClass outerClass = psiClass.getContainingClass();
+ boolean isInnerClassConstructor = psiMethod.isConstructor() && (outerClass != null) && !psiClass.hasModifierProperty(PsiModifier.STATIC);
+ PsiParameter[] parameters = psiMethod.getParameterList().getParameters();
+ PsiType returnType = psiMethod.getReturnType();
+
+ final int shift = isInnerClassConstructor ? 1 : 0;
+ final int arity = parameters.length + shift;
+ int[] shortSigKey = new int[3 + arity];
+ if (returnType == null) {
+ shortSigKey[0] = mkPsiTypeKey(PsiType.VOID);
+ shortSigKey[1] = myNamesEnumerator.enumerate("<init>");
+ } else {
+ shortSigKey[0] = mkPsiTypeKey(returnType);
+ shortSigKey[1] = myNamesEnumerator.enumerate(psiMethod.getName());
+ }
+ shortSigKey[2] = arity;
+ if (isInnerClassConstructor) {
+ shortSigKey[3] = mkPsiClassKey(outerClass, 0);
+ }
+ for (int i = 0; i < parameters.length; i++) {
+ PsiParameter parameter = parameters[i];
+ shortSigKey[3 + i + shift] = mkPsiTypeKey(parameter.getType());
+ }
+ for (int aShortSigKey : shortSigKey) {
+ if (aShortSigKey == -1) {
+ return -1;
+ }
+ }
+
+ int[] sigKey = new int[2];
+ int classKey = mkPsiClassKey(psiClass, 0);
+ if (classKey == -1) {
+ return -1;
+ }
+ sigKey[0] = classKey;
+ sigKey[1] = myCompoundKeyEnumerator.enumerate(shortSigKey);
+
+ return myCompoundKeyEnumerator.enumerate(sigKey);
+ }
+
+
+ private int mkPsiClassKey(PsiClass psiClass, int dimensions) throws IOException {
+ PsiFile containingFile = psiClass.getContainingFile();
+ if (!(containingFile instanceof PsiClassOwner)) {
+ LOG.debug("containingFile was not resolved for " + psiClass.getQualifiedName());
+ return -1;
+ }
+ PsiClassOwner psiFile = (PsiClassOwner)containingFile;
+ String packageName = psiFile.getPackageName();
+ String qname = psiClass.getQualifiedName();
+ if (qname == null) {
+ return -1;
+ }
+ String className = qname;
+ if (packageName.length() > 0) {
+ className = qname.substring(packageName.length() + 1).replace('.', '$');
+ }
+ int[] classKey = new int[2];
+ classKey[0] = myNamesEnumerator.enumerate(packageName);
+ if (dimensions == 0) {
+ classKey[1] = myNamesEnumerator.enumerate(className);
+ } else {
+ StringBuilder sb = new StringBuilder(className);
+ for (int j = 0; j < dimensions; j++) {
+ sb.append("[]");
+ }
+ classKey[1] = myNamesEnumerator.enumerate(sb.toString());
+ }
+ return myCompoundKeyEnumerator.enumerate(classKey);
+ }
+
+ private int mkPsiTypeKey(PsiType psiType) throws IOException {
+ int dimensions = 0;
+ psiType = TypeConversionUtil.erasure(psiType);
+ if (psiType instanceof PsiArrayType) {
+ PsiArrayType arrayType = (PsiArrayType)psiType;
+ psiType = arrayType.getDeepComponentType();
+ dimensions = arrayType.getArrayDimensions();
+ }
+
+ if (psiType instanceof PsiClassType) {
+ // no resolve() -> no package/class split
+ PsiClass psiClass = ((PsiClassType)psiType).resolve();
+ if (psiClass != null) {
+ return mkPsiClassKey(psiClass, dimensions);
+ }
+ else {
+ LOG.debug("resolve was null for " + ((PsiClassType)psiType).getClassName());
+ return -1;
+ }
+ }
+ else if (psiType instanceof PsiPrimitiveType) {
+ String packageName = "";
+ String className = psiType.getPresentableText();
+ int[] classKey = new int[2];
+ classKey[0] = myNamesEnumerator.enumerate(packageName);
+ if (dimensions == 0) {
+ classKey[1] = myNamesEnumerator.enumerate(className);
+ } else {
+ StringBuilder sb = new StringBuilder(className);
+ for (int j = 0; j < dimensions; j++) {
+ sb.append("[]");
+ }
+ classKey[1] = myNamesEnumerator.enumerate(sb.toString());
+ }
+ return myCompoundKeyEnumerator.enumerate(classKey);
+ }
+ return -1;
+ }
+
+ public void addAnnotations(TIntObjectHashMap<Value> internalIdSolutions, Annotations annotations) {
+
+ TIntObjectHashMap<List<String>> contractClauses = new TIntObjectHashMap<List<String>>();
+ TIntObjectIterator<Value> solutionsIterator = internalIdSolutions.iterator();
+
+ TIntHashSet notNulls = annotations.notNulls;
+ TIntObjectHashMap<String> contracts = annotations.contracts;
+
+ for (int i = internalIdSolutions.size(); i-- > 0;) {
+ solutionsIterator.advance();
+ int key = Math.abs(solutionsIterator.key());
+ Value value = solutionsIterator.value();
+ if (value == Value.Top || value == Value.Bot) {
+ continue;
+ }
+ try {
+ int[] compoundKey = myCompoundKeyEnumerator.valueOf(key);
+ Direction direction = extractDirection(myCompoundKeyEnumerator.valueOf(compoundKey[0]));
+ if (value == Value.NotNull && (direction instanceof In || direction instanceof Out)) {
+ notNulls.add(key);
+ }
+ else if (direction instanceof InOut) {
+ compoundKey = new int[]{mkDirectionKey(new Out()), compoundKey[1]};
+ try {
+ int baseKey = myCompoundKeyEnumerator.enumerate(compoundKey);
+ List<String> clauses = contractClauses.get(baseKey);
+ if (clauses == null) {
+ clauses = new ArrayList<String>();
+ contractClauses.put(baseKey, clauses);
+ }
+ int[] sig = myCompoundKeyEnumerator.valueOf(compoundKey[1]);
+ int[] shortSig = myCompoundKeyEnumerator.valueOf(sig[1]);
+ int arity = shortSig[2];
+ clauses.add(contractElement(arity, (InOut)direction, value));
+ }
+ catch (IOException e) {
+ LOG.debug(e);
+ }
+ }
+ }
+ catch (IOException e) {
+ LOG.debug(e);
+ }
+ }
+
+ TIntObjectIterator<List<String>> buildersIterator = contractClauses.iterator();
+ for (int i = contractClauses.size(); i-- > 0;) {
+ buildersIterator.advance();
+ int key = buildersIterator.key();
+ if (!notNulls.contains(key)) {
+ List<String> clauses = buildersIterator.value();
+ Collections.sort(clauses);
+ StringBuilder sb = new StringBuilder("\"");
+ StringUtil.join(clauses, ";", sb);
+ sb.append('"');
+ contracts.put(key, sb.toString().intern());
+ }
+ }
+ }
+
+ static String contractValueString(Value v) {
+ switch (v) {
+ case False: return "false";
+ case True: return "true";
+ case NotNull: return "!null";
+ case Null: return "null";
+ default: return "_";
+ }
+ }
+
+ static String contractElement(int arity, InOut inOut, Value value) {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < arity; i++) {
+ Value currentValue = Value.Top;
+ if (i == inOut.paramIndex) {
+ currentValue = inOut.inValue;
+ }
+ if (i > 0) {
+ sb.append(',');
+ }
+ sb.append(contractValueString(currentValue));
+ }
+ sb.append("->");
+ sb.append(contractValueString(value));
+ return sb.toString();
+ }
+
+ public int getVersion() {
+ return version;
+ }
+
+ private static class IntArrayKeyDescriptor implements KeyDescriptor<int[]> {
+
+ @Override
+ public void save(@NotNull DataOutput out, int[] value) throws IOException {
+ DataInputOutputUtil.writeINT(out, value.length);
+ for (int i : value) {
+ DataInputOutputUtil.writeINT(out, i);
+ }
+ }
+
+ @Override
+ public int[] read(@NotNull DataInput in) throws IOException {
+ int[] value = new int[DataInputOutputUtil.readINT(in)];
+ for (int i = 0; i < value.length; i++) {
+ value[i] = DataInputOutputUtil.readINT(in);
+ }
+ return value;
+ }
+
+ @Override
+ public int getHashCode(int[] value) {
+ return Arrays.hashCode(value);
+ }
+
+ @Override
+ public boolean isEqual(int[] val1, int[] val2) {
+ return Arrays.equals(val1, val2);
+ }
+ }
+
+ private static class IntArrayPersistentEnumerator extends PersistentEnumeratorDelegate<int[]> {
+ private final CachingEnumerator<int[]> myCache;
+
+ public IntArrayPersistentEnumerator(File compoundKeysFile, IntArrayKeyDescriptor descriptor) throws IOException {
+ super(compoundKeysFile, descriptor, 1024 * 4);
+ myCache = new CachingEnumerator<int[]>(new DataEnumerator<int[]>() {
+ @Override
+ public int enumerate(@Nullable int[] value) throws IOException {
+ return IntArrayPersistentEnumerator.super.enumerate(value);
+ }
+
+ @Nullable
+ @Override
+ public int[] valueOf(int idx) throws IOException {
+ return IntArrayPersistentEnumerator.super.valueOf(idx);
+ }
+ }, descriptor);
+ }
+
+ @Override
+ public int enumerate(@Nullable int[] value) throws IOException {
+ return myCache.enumerate(value);
+ }
+
+ @Nullable
+ @Override
+ public int[] valueOf(int idx) throws IOException {
+ return myCache.valueOf(idx);
+ }
+ }
+}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisIndex.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisIndex.java
new file mode 100644
index 0000000..6a4b327
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisIndex.java
@@ -0,0 +1,167 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import com.intellij.ide.highlighter.JavaClassFileType;
+import com.intellij.openapi.application.Application;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.VirtualFileWithId;
+import com.intellij.util.SystemProperties;
+import com.intellij.util.indexing.*;
+import com.intellij.util.io.DataExternalizer;
+import com.intellij.util.io.DataInputOutputUtil;
+import com.intellij.util.io.EnumeratorIntegerDescriptor;
+import com.intellij.util.io.KeyDescriptor;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * @author lambdamix
+ */
+public class BytecodeAnalysisIndex extends FileBasedIndexExtension<Integer, Collection<IntIdEquation>> {
+ public static final ID<Integer, Collection<IntIdEquation>> NAME = ID.create("bytecodeAnalysis");
+ private final EquationExternalizer myExternalizer = new EquationExternalizer();
+ private static final DataIndexer<Integer, Collection<IntIdEquation>, FileContent> INDEXER =
+ new ClassDataIndexer(BytecodeAnalysisConverter.getInstance());
+
+ private static final int ourInternalVersion = 2;
+ private static boolean ourEnabled = SystemProperties.getBooleanProperty("idea.enable.bytecode.contract.inference", isEnabledByDefault());
+
+ private static boolean isEnabledByDefault() {
+ Application application = ApplicationManager.getApplication();
+ return application.isInternal() || application.isUnitTestMode();
+ }
+
+ public static int indexKey(VirtualFile file, boolean parameters) {
+ return (file instanceof VirtualFileWithId ? ((VirtualFileWithId)file).getId() * 2 : -2) + (parameters ? 1 : 0);
+ }
+
+ @NotNull
+ @Override
+ public ID<Integer, Collection<IntIdEquation>> getName() {
+ return NAME;
+ }
+
+ @NotNull
+ @Override
+ public DataIndexer<Integer, Collection<IntIdEquation>, FileContent> getIndexer() {
+ return INDEXER;
+ }
+
+ @NotNull
+ @Override
+ public KeyDescriptor<Integer> getKeyDescriptor() {
+ return EnumeratorIntegerDescriptor.INSTANCE;
+ }
+
+ @NotNull
+ @Override
+ public DataExternalizer<Collection<IntIdEquation>> getValueExternalizer() {
+ return myExternalizer;
+ }
+
+ @NotNull
+ @Override
+ public FileBasedIndex.InputFilter getInputFilter() {
+ return new DefaultFileTypeSpecificInputFilter(JavaClassFileType.INSTANCE) {
+ @Override
+ public boolean acceptInput(@NotNull VirtualFile file) {
+ return ourEnabled && super.acceptInput(file);
+ }
+ };
+ }
+
+ @Override
+ public boolean dependsOnFileContent() {
+ return true;
+ }
+
+ @Override
+ public int getVersion() {
+ return ourInternalVersion + BytecodeAnalysisConverter.getInstance().getVersion() + (ourEnabled ? 0xFF : 0);
+ }
+
+ public static class EquationExternalizer implements DataExternalizer<Collection<IntIdEquation>> {
+ @Override
+ public void save(@NotNull DataOutput out, Collection<IntIdEquation> equations) throws IOException {
+ DataInputOutputUtil.writeINT(out, equations.size());
+
+ for (IntIdEquation equation : equations) {
+ out.writeInt(equation.id);
+ IntIdResult rhs = equation.rhs;
+ if (rhs instanceof IntIdFinal) {
+ IntIdFinal finalResult = (IntIdFinal)rhs;
+ out.writeBoolean(true); // final flag
+ DataInputOutputUtil.writeINT(out, finalResult.value.ordinal());
+ } else {
+ IntIdPending pendResult = (IntIdPending)rhs;
+ out.writeBoolean(false); // pending flag
+ DataInputOutputUtil.writeINT(out, pendResult.delta.length);
+
+ for (IntIdComponent component : pendResult.delta) {
+ DataInputOutputUtil.writeINT(out, component.value.ordinal());
+ int[] ids = component.ids;
+ DataInputOutputUtil.writeINT(out, ids.length);
+ for (int id : ids) {
+ out.writeInt(id);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public Collection<IntIdEquation> read(@NotNull DataInput in) throws IOException {
+
+ int size = DataInputOutputUtil.readINT(in);
+ ArrayList<IntIdEquation> result = new ArrayList<IntIdEquation>(size);
+
+ for (int x = 0; x < size; x++) {
+ int equationId = in.readInt();
+ boolean isFinal = in.readBoolean(); // flag
+ if (isFinal) {
+ int ordinal = DataInputOutputUtil.readINT(in);
+ Value value = Value.values()[ordinal];
+ result.add(new IntIdEquation(equationId, new IntIdFinal(value)));
+ } else {
+
+ int sumLength = DataInputOutputUtil.readINT(in);
+ IntIdComponent[] components = new IntIdComponent[sumLength];
+
+ for (int i = 0; i < sumLength; i++) {
+ int ordinal = DataInputOutputUtil.readINT(in);
+ Value value = Value.values()[ordinal];
+ int componentSize = DataInputOutputUtil.readINT(in);
+ int[] ids = new int[componentSize];
+ for (int j = 0; j < componentSize; j++) {
+ ids[j] = in.readInt();
+ }
+ components[i] = new IntIdComponent(value, ids);
+ }
+ result.add(new IntIdEquation(equationId, new IntIdPending(components)));
+ }
+ }
+
+ return result;
+ }
+ }
+}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/ClassDataIndexer.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/ClassDataIndexer.java
new file mode 100644
index 0000000..5e74a8b5
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/ClassDataIndexer.java
@@ -0,0 +1,264 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import com.intellij.openapi.progress.ProcessCanceledException;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.util.NotNullLazyValue;
+import com.intellij.util.indexing.DataIndexer;
+import com.intellij.util.indexing.FileContent;
+import gnu.trove.TIntHashSet;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.org.objectweb.asm.*;
+import org.jetbrains.org.objectweb.asm.tree.MethodNode;
+import org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException;
+
+import java.util.*;
+
+import static com.intellij.codeInspection.bytecodeAnalysis.ProjectBytecodeAnalysis.LOG;
+
+/**
+ * @author lambdamix
+ */
+public class ClassDataIndexer implements DataIndexer<Integer, Collection<IntIdEquation>, FileContent> {
+ final BytecodeAnalysisConverter myConverter;
+
+ public ClassDataIndexer(BytecodeAnalysisConverter converter) {
+ myConverter = converter;
+ }
+
+ @NotNull
+ @Override
+ public Map<Integer, Collection<IntIdEquation>> map(@NotNull FileContent inputData) {
+ HashMap<Integer, Collection<IntIdEquation>> map = new HashMap<Integer, Collection<IntIdEquation>>(2);
+ try {
+ ClassEquations rawEquations = processClass(new ClassReader(inputData.getContent()));
+ List<Equation<Key, Value>> rawParameterEquations = rawEquations.parameterEquations;
+ List<Equation<Key, Value>> rawContractEquations = rawEquations.contractEquations;
+
+ Collection<IntIdEquation> idParameterEquations = new ArrayList<IntIdEquation>(rawParameterEquations.size());
+ Collection<IntIdEquation> idContractEquations = new ArrayList<IntIdEquation>(rawContractEquations.size());
+
+ map.put(BytecodeAnalysisIndex.indexKey(inputData.getFile(), true), idParameterEquations);
+ map.put(BytecodeAnalysisIndex.indexKey(inputData.getFile(), false), idContractEquations);
+
+
+ for (Equation<Key, Value> rawParameterEquation: rawParameterEquations) {
+ idParameterEquations.add(myConverter.convert(rawParameterEquation));
+ }
+ for (Equation<Key, Value> rawContractEquation: rawContractEquations) {
+ idContractEquations.add(myConverter.convert(rawContractEquation));
+ }
+ }
+ catch (ProcessCanceledException e) {
+ throw e;
+ }
+ catch (Throwable e) {
+ // incorrect bytecode may result in Runtime exceptions during analysis
+ // so here we suppose that exception is due to incorrect bytecode
+ LOG.debug("Unexpected Error during indexing of bytecode", e);
+ }
+ return map;
+ }
+
+ private static class ClassEquations {
+ final List<Equation<Key, Value>> parameterEquations;
+ final List<Equation<Key, Value>> contractEquations;
+
+ private ClassEquations(List<Equation<Key, Value>> parameterEquations, List<Equation<Key, Value>> contractEquations) {
+ this.parameterEquations = parameterEquations;
+ this.contractEquations = contractEquations;
+ }
+ }
+
+ public static ClassEquations processClass(final ClassReader classReader) {
+ final List<Equation<Key, Value>> parameterEquations = new ArrayList<Equation<Key, Value>>();
+ final List<Equation<Key, Value>> contractEquations = new ArrayList<Equation<Key, Value>>();
+
+ classReader.accept(new ClassVisitor(Opcodes.ASM5) {
+ private boolean stableClass;
+
+ @Override
+ public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
+ stableClass = (access & Opcodes.ACC_FINAL) != 0;
+ super.visit(version, access, name, signature, superName, interfaces);
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ final MethodNode node = new MethodNode(Opcodes.ASM5, access, name, desc, signature, exceptions);
+ return new MethodVisitor(Opcodes.ASM5, node) {
+ @Override
+ public void visitEnd() {
+ super.visitEnd();
+ processMethod(classReader.getClassName(), node, stableClass);
+ }
+ };
+ }
+
+ void processMethod(final String className, final MethodNode methodNode, boolean stableClass) {
+ ProgressManager.checkCanceled();
+ Type[] argumentTypes = Type.getArgumentTypes(methodNode.desc);
+ Type resultType = Type.getReturnType(methodNode.desc);
+ int resultSort = resultType.getSort();
+ boolean isReferenceResult = resultSort == Type.OBJECT || resultSort == Type.ARRAY;
+ boolean isBooleanResult = Type.BOOLEAN_TYPE == resultType;
+ boolean isInterestingResult = isReferenceResult || isBooleanResult;
+
+ if (argumentTypes.length == 0 && !isInterestingResult) {
+ return;
+ }
+
+ Method method = new Method(className, methodNode.name, methodNode.desc);
+ int access = methodNode.access;
+ boolean stable =
+ stableClass ||
+ (access & Opcodes.ACC_FINAL) != 0 ||
+ (access & Opcodes.ACC_PRIVATE) != 0 ||
+ (access & Opcodes.ACC_STATIC) != 0 ||
+ "<init>".equals(methodNode.name);
+ try {
+ boolean added = false;
+ ControlFlowGraph graph = cfg.buildControlFlowGraph(className, methodNode);
+
+ boolean maybeLeakingParameter = false;
+ for (Type argType : argumentTypes) {
+ int argSort = argType.getSort();
+ if (argSort == Type.OBJECT || argSort == Type.ARRAY || (isInterestingResult && Type.BOOLEAN_TYPE.equals(argType))) {
+ maybeLeakingParameter = true;
+ break;
+ }
+ }
+
+ if (graph.transitions.length > 0) {
+ DFSTree dfs = cfg.buildDFSTree(graph.transitions);
+ boolean reducible = dfs.back.isEmpty() || cfg.reducible(graph, dfs);
+ if (reducible) {
+ NotNullLazyValue<TIntHashSet> resultOrigins = new NotNullLazyValue<TIntHashSet>() {
+ @NotNull
+ @Override
+ protected TIntHashSet compute() {
+ try {
+ return cfg.resultOrigins(className, methodNode);
+ }
+ catch (AnalyzerException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ boolean[] leakingParameters = maybeLeakingParameter ? cfg.leakingParameters(className, methodNode) : null;
+ boolean shouldComputeResult = isReferenceResult;
+
+ if (!shouldComputeResult && isInterestingResult && maybeLeakingParameter) {
+ loop: for (int i = 0; i < argumentTypes.length; i++) {
+ Type argType = argumentTypes[i];
+ int argSort = argType.getSort();
+ boolean isReferenceArg = argSort == Type.OBJECT || argSort == Type.ARRAY;
+ boolean isBooleanArg = Type.BOOLEAN_TYPE.equals(argType);
+ if ((isReferenceArg || isBooleanArg) && !leakingParameters[i]) {
+ shouldComputeResult = true;
+ break loop;
+ }
+ }
+ }
+
+ Equation<Key, Value> resultEquation =
+ shouldComputeResult ? new InOutAnalysis(new RichControlFlow(graph, dfs), new Out(), resultOrigins.getValue(), stable).analyze() : null;
+
+ for (int i = 0; i < argumentTypes.length; i++) {
+ Type argType = argumentTypes[i];
+ int argSort = argType.getSort();
+ boolean isReferenceArg = argSort == Type.OBJECT || argSort == Type.ARRAY;
+ boolean isBooleanArg = Type.BOOLEAN_TYPE.equals(argType);
+ if (isReferenceArg) {
+ if (leakingParameters[i]) {
+ parameterEquations.add(new NonNullInAnalysis(new RichControlFlow(graph, dfs), new In(i), stable).analyze());
+ } else {
+ parameterEquations.add(new Equation<Key, Value>(new Key(method, new In(i), stable), new Final<Key, Value>(Value.Top)));
+ }
+ }
+ if (isReferenceArg && isInterestingResult) {
+ if (leakingParameters[i]) {
+ contractEquations.add(new InOutAnalysis(new RichControlFlow(graph, dfs), new InOut(i, Value.Null), resultOrigins.getValue(), stable).analyze());
+ contractEquations.add(new InOutAnalysis(new RichControlFlow(graph, dfs), new InOut(i, Value.NotNull), resultOrigins.getValue(), stable).analyze());
+ } else {
+ contractEquations.add(new Equation<Key, Value>(new Key(method, new InOut(i, Value.Null), stable), resultEquation.rhs));
+ contractEquations.add(new Equation<Key, Value>(new Key(method, new InOut(i, Value.NotNull), stable), resultEquation.rhs));
+ }
+ }
+ if (isBooleanArg && isInterestingResult) {
+ if (leakingParameters[i]) {
+ contractEquations.add(new InOutAnalysis(new RichControlFlow(graph, dfs), new InOut(i, Value.False), resultOrigins.getValue(), stable).analyze());
+ contractEquations.add(new InOutAnalysis(new RichControlFlow(graph, dfs), new InOut(i, Value.True), resultOrigins.getValue(), stable).analyze());
+ } else {
+ contractEquations.add(new Equation<Key, Value>(new Key(method, new InOut(i, Value.False), stable), resultEquation.rhs));
+ contractEquations.add(new Equation<Key, Value>(new Key(method, new InOut(i, Value.True), stable), resultEquation.rhs));
+ }
+ }
+ }
+ if (isReferenceResult) {
+ if (resultEquation != null) {
+ contractEquations.add(resultEquation);
+ } else {
+ contractEquations.add(new InOutAnalysis(new RichControlFlow(graph, dfs), new Out(), resultOrigins.getValue(), stable).analyze());
+ }
+ }
+ added = true;
+ }
+ else {
+ LOG.debug("CFG for " + method + " is not reducible");
+ }
+ }
+
+ if (!added) {
+ method = new Method(className, methodNode.name, methodNode.desc);
+ for (int i = 0; i < argumentTypes.length; i++) {
+ Type argType = argumentTypes[i];
+ int argSort = argType.getSort();
+ boolean isReferenceArg = argSort == Type.OBJECT || argSort == Type.ARRAY;
+ boolean isBooleanArg = Type.BOOLEAN_TYPE.equals(argType);
+
+ if (isReferenceArg) {
+ parameterEquations.add(new Equation<Key, Value>(new Key(method, new In(i), stable), new Final<Key, Value>(Value.Top)));
+ }
+ if (isReferenceArg && isInterestingResult) {
+ contractEquations.add(new Equation<Key, Value>(new Key(method, new InOut(i, Value.Null), stable), new Final<Key, Value>(Value.Top)));
+ contractEquations.add(new Equation<Key, Value>(new Key(method, new InOut(i, Value.NotNull), stable), new Final<Key, Value>(Value.Top)));
+ }
+ if (isBooleanArg && isInterestingResult) {
+ contractEquations.add(new Equation<Key, Value>(new Key(method, new InOut(i, Value.False), stable), new Final<Key, Value>(Value.Top)));
+ contractEquations.add(new Equation<Key, Value>(new Key(method, new InOut(i, Value.True), stable), new Final<Key, Value>(Value.Top)));
+ }
+ }
+ if (isReferenceResult) {
+ contractEquations.add(new Equation<Key, Value>(new Key(method, new Out(), stable), new Final<Key, Value>(Value.Top)));
+ }
+ }
+ }
+ catch (ProcessCanceledException e) {
+ throw e;
+ }
+ catch (Throwable e) {
+ // incorrect bytecode may result in Runtime exceptions during analysis
+ // so here we suppose that exception is due to incorrect bytecode
+ LOG.debug("Unexpected Error during processing of " + method, e);
+ }
+ }
+ }, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
+
+ return new ClassEquations(parameterEquations, contractEquations);
+ }
+}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Contracts.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Contracts.java
new file mode 100644
index 0000000..c837b12
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Contracts.java
@@ -0,0 +1,439 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import gnu.trove.TIntHashSet;
+import org.jetbrains.org.objectweb.asm.Handle;
+import org.jetbrains.org.objectweb.asm.Type;
+import org.jetbrains.org.objectweb.asm.tree.*;
+import org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException;
+import org.jetbrains.org.objectweb.asm.tree.analysis.BasicInterpreter;
+import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue;
+import org.jetbrains.org.objectweb.asm.tree.analysis.Frame;
+
+import java.util.*;
+
+import static com.intellij.codeInspection.bytecodeAnalysis.AbstractValues.*;
+import static org.jetbrains.org.objectweb.asm.Opcodes.*;
+
+class InOutAnalysis extends Analysis<Result<Key, Value>> {
+
+ final ResultUtil<Key, Value> resultUtil =
+ new ResultUtil<Key, Value>(new ELattice<Value>(Value.Bot, Value.Top));
+
+ private final InOutInterpreter interpreter;
+ private final Value inValue;
+
+ protected InOutAnalysis(RichControlFlow richControlFlow, Direction direction, TIntHashSet resultOrigins, boolean stable) {
+ super(richControlFlow, direction, stable);
+ interpreter = new InOutInterpreter(direction, richControlFlow.controlFlow.methodNode.instructions, resultOrigins);
+ inValue = direction instanceof InOut ? ((InOut)direction).inValue : null;
+ }
+
+ @Override
+ Result<Key, Value> identity() {
+ return new Final<Key, Value>(Value.Bot);
+ }
+
+ @Override
+ Result<Key, Value> combineResults(Result<Key, Value> delta, List<Result<Key, Value>> subResults) {
+ Result<Key, Value> result = null;
+ for (Result<Key, Value> subResult : subResults) {
+ if (result == null) {
+ result = subResult;
+ } else {
+ result = resultUtil.join(result, subResult);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ boolean isEarlyResult(Result<Key, Value> res) {
+ if (res instanceof Final) {
+ return ((Final<?, Value>)res).value == Value.Top;
+ }
+ return false;
+ }
+
+ @Override
+ Equation<Key, Value> mkEquation(Result<Key, Value> res) {
+ return new Equation<Key, Value>(aKey, res);
+ }
+
+ private int id = 0;
+
+ @Override
+ void processState(State state) throws AnalyzerException {
+ int stateIndex = state.index;
+ Conf preConf = state.conf;
+ int insnIndex = preConf.insnIndex;
+ boolean loopEnter = dfsTree.loopEnters.contains(insnIndex);
+ Conf conf = loopEnter ? generalize(preConf) : preConf;
+ List<Conf> history = state.history;
+ boolean taken = state.taken;
+ Frame<BasicValue> frame = conf.frame;
+ AbstractInsnNode insnNode = methodNode.instructions.get(insnIndex);
+ List<Conf> nextHistory = dfsTree.loopEnters.contains(insnIndex) ? append(history, conf) : history;
+ Frame<BasicValue> nextFrame = execute(frame, insnNode);
+
+ if (interpreter.deReferenced) {
+ results.put(stateIndex, new Final<Key, Value>(Value.Bot));
+ computed.put(insnIndex, append(computed.get(insnIndex), state));
+ return;
+ }
+
+ int opcode = insnNode.getOpcode();
+ switch (opcode) {
+ case ARETURN:
+ case IRETURN:
+ case LRETURN:
+ case FRETURN:
+ case DRETURN:
+ case RETURN:
+ BasicValue stackTop = popValue(frame);
+ if (FalseValue == stackTop) {
+ results.put(stateIndex, new Final<Key, Value>(Value.False));
+ computed.put(insnIndex, append(computed.get(insnIndex), state));
+ }
+ else if (TrueValue == stackTop) {
+ results.put(stateIndex, new Final<Key, Value>(Value.True));
+ computed.put(insnIndex, append(computed.get(insnIndex), state));
+ }
+ else if (NullValue == stackTop) {
+ results.put(stateIndex, new Final<Key, Value>(Value.Null));
+ computed.put(insnIndex, append(computed.get(insnIndex), state));
+ }
+ else if (stackTop instanceof NotNullValue) {
+ results.put(stateIndex, new Final<Key, Value>(Value.NotNull));
+ computed.put(insnIndex, append(computed.get(insnIndex), state));
+ }
+ else if (stackTop instanceof ParamValue) {
+ results.put(stateIndex, new Final<Key, Value>(inValue));
+ computed.put(insnIndex, append(computed.get(insnIndex), state));
+ }
+ else if (stackTop instanceof CallResultValue) {
+ Set<Key> keys = ((CallResultValue) stackTop).inters;
+ results.put(stateIndex, new Pending<Key, Value>(Collections.singleton(new Product<Key, Value>(Value.Top, keys))));
+ computed.put(insnIndex, append(computed.get(insnIndex), state));
+ }
+ else {
+ earlyResult = new Final<Key, Value>(Value.Top);
+ }
+ return;
+ case ATHROW:
+ results.put(stateIndex, new Final<Key, Value>(Value.Bot));
+ computed.put(insnIndex, append(computed.get(insnIndex), state));
+ return;
+ default:
+ }
+
+ if (opcode == IFNONNULL && popValue(frame) instanceof ParamValue) {
+ int nextInsnIndex = inValue == Value.Null ? insnIndex + 1 : methodNode.instructions.indexOf(((JumpInsnNode)insnNode).label);
+ State nextState = new State(++id, new Conf(nextInsnIndex, nextFrame), nextHistory, true, false);
+ pending.push(new MakeResult<Result<Key, Value>>(state, myIdentity, new int[]{nextState.index}));
+ pending.push(new ProceedState<Result<Key, Value>>(nextState));
+ return;
+ }
+
+ if (opcode == IFNULL && popValue(frame) instanceof ParamValue) {
+ int nextInsnIndex = inValue == Value.NotNull ? insnIndex + 1 : methodNode.instructions.indexOf(((JumpInsnNode)insnNode).label);
+ State nextState = new State(++id, new Conf(nextInsnIndex, nextFrame), nextHistory, true, false);
+ pending.push(new MakeResult<Result<Key, Value>>(state, myIdentity, new int[]{nextState.index}));
+ pending.push(new ProceedState<Result<Key, Value>>(nextState));
+ return;
+ }
+
+ if (opcode == IFEQ && popValue(frame) == InstanceOfCheckValue && inValue == Value.Null) {
+ int nextInsnIndex = methodNode.instructions.indexOf(((JumpInsnNode)insnNode).label);
+ State nextState = new State(++id, new Conf(nextInsnIndex, nextFrame), nextHistory, true, false);
+ pending.push(new MakeResult<Result<Key, Value>>(state, myIdentity, new int[]{nextState.index}));
+ pending.push(new ProceedState<Result<Key, Value>>(nextState));
+ return;
+ }
+
+ if (opcode == IFNE && popValue(frame) == InstanceOfCheckValue && inValue == Value.Null) {
+ int nextInsnIndex = insnIndex + 1;
+ State nextState = new State(++id, new Conf(nextInsnIndex, nextFrame), nextHistory, true, false);
+ pending.push(new MakeResult<Result<Key, Value>>(state, myIdentity, new int[]{nextState.index}));
+ pending.push(new ProceedState<Result<Key, Value>>(nextState));
+ return;
+ }
+
+ if (opcode == IFEQ && popValue(frame) instanceof ParamValue) {
+ int nextInsnIndex = inValue == Value.True ? insnIndex + 1 : methodNode.instructions.indexOf(((JumpInsnNode)insnNode).label);
+ State nextState = new State(++id, new Conf(nextInsnIndex, nextFrame), nextHistory, true, false);
+ pending.push(new MakeResult<Result<Key, Value>>(state, myIdentity, new int[]{nextState.index}));
+ pending.push(new ProceedState<Result<Key, Value>>(nextState));
+ return;
+ }
+
+ if (opcode == IFNE && popValue(frame) instanceof ParamValue) {
+ int nextInsnIndex = inValue == Value.False ? insnIndex + 1 : methodNode.instructions.indexOf(((JumpInsnNode)insnNode).label);
+ State nextState = new State(++id, new Conf(nextInsnIndex, nextFrame), nextHistory, true, false);
+ pending.push(new MakeResult<Result<Key, Value>>(state, myIdentity, new int[]{nextState.index}));
+ pending.push(new ProceedState<Result<Key, Value>>(nextState));
+ return;
+ }
+
+ // general case
+ int[] nextInsnIndices = controlFlow.transitions[insnIndex];
+ List<State> nextStates = new ArrayList<State>(nextInsnIndices.length);
+ int[] subIndices = new int[nextInsnIndices.length];
+
+ for (int i = 0; i < nextInsnIndices.length; i++) {
+ int nextInsnIndex = nextInsnIndices[i];
+ Frame<BasicValue> nextFrame1 = nextFrame;
+ if (controlFlow.errorTransitions.contains(new Edge(insnIndex, nextInsnIndex))) {
+ nextFrame1 = new Frame<BasicValue>(frame);
+ nextFrame1.clearStack();
+ nextFrame1.push(new BasicValue(Type.getType("java/lang/Throwable")));
+ }
+ nextStates.add(new State(++id, new Conf(nextInsnIndex, nextFrame1), nextHistory, taken, false));
+ subIndices[i] = id;
+ }
+
+ pending.push(new MakeResult<Result<Key, Value>>(state, myIdentity, subIndices));
+ for (State nextState : nextStates) {
+ pending.push(new ProceedState<Result<Key, Value>>(nextState));
+ }
+ }
+
+ private Frame<BasicValue> execute(Frame<BasicValue> frame, AbstractInsnNode insnNode) throws AnalyzerException {
+ interpreter.deReferenced = false;
+ switch (insnNode.getType()) {
+ case AbstractInsnNode.LABEL:
+ case AbstractInsnNode.LINE:
+ case AbstractInsnNode.FRAME:
+ return frame;
+ default:
+ Frame<BasicValue> nextFrame = new Frame<BasicValue>(frame);
+ nextFrame.execute(insnNode, interpreter);
+ return nextFrame;
+ }
+ }
+
+ private static Conf generalize(Conf conf) {
+ Frame<BasicValue> frame = new Frame<BasicValue>(conf.frame);
+ for (int i = 0; i < frame.getLocals(); i++) {
+ BasicValue value = frame.getLocal(i);
+ Class<?> valueClass = value.getClass();
+ if (valueClass != BasicValue.class && valueClass != ParamValue.class) {
+ frame.setLocal(i, new BasicValue(value.getType()));
+ }
+ }
+
+ BasicValue[] stack = new BasicValue[frame.getStackSize()];
+ for (int i = 0; i < frame.getStackSize(); i++) {
+ stack[i] = frame.getStack(i);
+ }
+ frame.clearStack();
+
+ for (BasicValue value : stack) {
+ Class<?> valueClass = value.getClass();
+ if (valueClass != BasicValue.class && valueClass != ParamValue.class) {
+ frame.push(new BasicValue(value.getType()));
+ } else {
+ frame.push(value);
+ }
+ }
+
+ return new Conf(conf.insnIndex, frame);
+ }
+}
+
+class InOutInterpreter extends BasicInterpreter {
+ final Direction direction;
+ final InsnList insns;
+ final TIntHashSet resultOrigins;
+ final boolean nullAnalysis;
+
+ boolean deReferenced = false;
+
+ InOutInterpreter(Direction direction, InsnList insns, TIntHashSet resultOrigins) {
+ this.direction = direction;
+ this.insns = insns;
+ this.resultOrigins = resultOrigins;
+ nullAnalysis = (direction instanceof InOut) && (((InOut)direction).inValue) == Value.Null;
+ }
+
+ @Override
+ public BasicValue newOperation(AbstractInsnNode insn) throws AnalyzerException {
+ boolean propagate = resultOrigins.contains(insns.indexOf(insn));
+ if (propagate) {
+ switch (insn.getOpcode()) {
+ case ICONST_0:
+ return FalseValue;
+ case ICONST_1:
+ return TrueValue;
+ case ACONST_NULL:
+ return NullValue;
+ case LDC:
+ Object cst = ((LdcInsnNode)insn).cst;
+ if (cst instanceof Type) {
+ Type type = (Type)cst;
+ if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
+ return new NotNullValue(Type.getObjectType("java/lang/Class"));
+ }
+ if (type.getSort() == Type.METHOD) {
+ return new NotNullValue(Type.getObjectType("java/lang/invoke/MethodType"));
+ }
+ }
+ else if (cst instanceof String) {
+ return new NotNullValue(Type.getObjectType("java/lang/String"));
+ }
+ else if (cst instanceof Handle) {
+ return new NotNullValue(Type.getObjectType("java/lang/invoke/MethodHandle"));
+ }
+ break;
+ case NEW:
+ return new NotNullValue(Type.getObjectType(((TypeInsnNode)insn).desc));
+ default:
+ }
+ }
+ return super.newOperation(insn);
+ }
+
+ @Override
+ public BasicValue unaryOperation(AbstractInsnNode insn, BasicValue value) throws AnalyzerException {
+ boolean propagate = resultOrigins.contains(insns.indexOf(insn));
+ switch (insn.getOpcode()) {
+ case GETFIELD:
+ case ARRAYLENGTH:
+ case MONITORENTER:
+ if (nullAnalysis && value instanceof ParamValue) {
+ deReferenced = true;
+ }
+ return super.unaryOperation(insn, value);
+ case CHECKCAST:
+ if (value instanceof ParamValue) {
+ return new ParamValue(Type.getObjectType(((TypeInsnNode)insn).desc));
+ }
+ break;
+ case INSTANCEOF:
+ if (value instanceof ParamValue) {
+ return InstanceOfCheckValue;
+ }
+ break;
+ case NEWARRAY:
+ case ANEWARRAY:
+ if (propagate) {
+ return new NotNullValue(super.unaryOperation(insn, value).getType());
+ }
+ break;
+ default:
+ }
+ return super.unaryOperation(insn, value);
+ }
+
+ @Override
+ public BasicValue binaryOperation(AbstractInsnNode insn, BasicValue value1, BasicValue value2) throws AnalyzerException {
+ switch (insn.getOpcode()) {
+ case IALOAD:
+ case LALOAD:
+ case FALOAD:
+ case DALOAD:
+ case AALOAD:
+ case BALOAD:
+ case CALOAD:
+ case SALOAD:
+ case PUTFIELD:
+ if (nullAnalysis && value1 instanceof ParamValue) {
+ deReferenced = true;
+ }
+ break;
+ default:
+ }
+ return super.binaryOperation(insn, value1, value2);
+ }
+
+ @Override
+ public BasicValue ternaryOperation(AbstractInsnNode insn, BasicValue value1, BasicValue value2, BasicValue value3) throws AnalyzerException {
+ switch (insn.getOpcode()) {
+ case IASTORE:
+ case LASTORE:
+ case FASTORE:
+ case DASTORE:
+ case AASTORE:
+ case BASTORE:
+ case CASTORE:
+ case SASTORE:
+ if (nullAnalysis && value1 instanceof ParamValue) {
+ deReferenced = true;
+ }
+ default:
+ }
+ return super.ternaryOperation(insn, value1, value2, value3);
+ }
+
+ @Override
+ public BasicValue naryOperation(AbstractInsnNode insn, List<? extends BasicValue> values) throws AnalyzerException {
+ boolean propagate = resultOrigins.contains(insns.indexOf(insn));
+ int opCode = insn.getOpcode();
+ int shift = opCode == INVOKESTATIC ? 0 : 1;
+
+ switch (opCode) {
+ case INVOKESPECIAL:
+ case INVOKEINTERFACE:
+ case INVOKEVIRTUAL:
+ if (nullAnalysis && values.get(0) instanceof ParamValue) {
+ deReferenced = true;
+ return super.naryOperation(insn, values);
+ }
+ }
+
+ if (propagate) {
+ switch (opCode) {
+ case INVOKESTATIC:
+ case INVOKESPECIAL:
+ case INVOKEVIRTUAL:
+ case INVOKEINTERFACE:
+ boolean stable = opCode == INVOKESTATIC || opCode == INVOKESPECIAL;
+ MethodInsnNode mNode = (MethodInsnNode)insn;
+ Method method = new Method(mNode.owner, mNode.name, mNode.desc);
+ Type retType = Type.getReturnType(mNode.desc);
+ boolean isRefRetType = retType.getSort() == Type.OBJECT || retType.getSort() == Type.ARRAY;
+ if (!Type.VOID_TYPE.equals(retType)) {
+ if (direction instanceof InOut) {
+ InOut inOut = (InOut)direction;
+ HashSet<Key> keys = new HashSet<Key>();
+ for (int i = shift; i < values.size(); i++) {
+ if (values.get(i) instanceof ParamValue) {
+ keys.add(new Key(method, new InOut(i - shift, inOut.inValue), stable));
+ }
+ }
+ if (isRefRetType) {
+ keys.add(new Key(method, new Out(), stable));
+ }
+ if (!keys.isEmpty()) {
+ return new CallResultValue(retType, keys);
+ }
+ }
+ else if (isRefRetType) {
+ HashSet<Key> keys = new HashSet<Key>();
+ keys.add(new Key(method, new Out(), stable));
+ return new CallResultValue(retType, keys);
+ }
+ }
+ break;
+ case MULTIANEWARRAY:
+ return new NotNullValue(super.naryOperation(insn, values).getType());
+ default:
+ }
+ }
+ return super.naryOperation(insn, values);
+ }
+}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/ControlFlow.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/ControlFlow.java
new file mode 100644
index 0000000..910d75b
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/ControlFlow.java
@@ -0,0 +1,1030 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import gnu.trove.TIntArrayList;
+import gnu.trove.TIntHashSet;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.org.objectweb.asm.Opcodes;
+import org.jetbrains.org.objectweb.asm.Type;
+import org.jetbrains.org.objectweb.asm.tree.*;
+import org.jetbrains.org.objectweb.asm.tree.analysis.*;
+import org.jetbrains.org.objectweb.asm.tree.analysis.Value;
+
+import java.util.*;
+
+import static org.jetbrains.org.objectweb.asm.Opcodes.*;
+
+final class cfg {
+ static ControlFlowGraph buildControlFlowGraph(String className, MethodNode methodNode) throws AnalyzerException {
+ return new ControlFlowBuilder(className, methodNode).buildCFG();
+ }
+
+ static TIntHashSet resultOrigins(String className, MethodNode methodNode) throws AnalyzerException {
+ Frame<SourceValue>[] frames = new Analyzer<SourceValue>(MININAL_ORIGIN_INTERPRETER).analyze(className, methodNode);
+ InsnList insns = methodNode.instructions;
+ TIntHashSet result = new TIntHashSet();
+ for (int i = 0; i < frames.length; i++) {
+ AbstractInsnNode insnNode = insns.get(i);
+ Frame<SourceValue> frame = frames[i];
+ if (frame != null) {
+ switch (insnNode.getOpcode()) {
+ case ARETURN:
+ case IRETURN:
+ case LRETURN:
+ case FRETURN:
+ case DRETURN:
+ for (AbstractInsnNode sourceInsn : frame.pop().insns) {
+ result.add(insns.indexOf(sourceInsn));
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ static boolean[] leakingParameters(String className, MethodNode methodNode) throws AnalyzerException {
+ Frame<ParamsValue>[] frames = new Analyzer<ParamsValue>(new ParametersUsage(methodNode)).analyze(className, methodNode);
+ InsnList insns = methodNode.instructions;
+ LeakingParametersCollector collector = new LeakingParametersCollector(methodNode);
+ for (int i = 0; i < frames.length; i++) {
+ AbstractInsnNode insnNode = insns.get(i);
+ Frame<ParamsValue> frame = frames[i];
+ if (frame != null) {
+ switch (insnNode.getType()) {
+ case AbstractInsnNode.LABEL:
+ case AbstractInsnNode.LINE:
+ case AbstractInsnNode.FRAME:
+ break;
+ default:
+ frame.execute(insnNode, collector);
+ }
+ }
+ }
+ return collector.leaking;
+ }
+
+ static final Interpreter<SourceValue> MININAL_ORIGIN_INTERPRETER = new SourceInterpreter() {
+ final SourceValue[] sourceVals = {new SourceValue(1), new SourceValue(2)};
+
+ @Override
+ public SourceValue newOperation(AbstractInsnNode insn) {
+ SourceValue result = super.newOperation(insn);
+ switch (insn.getOpcode()) {
+ case ICONST_0:
+ case ICONST_1:
+ case ACONST_NULL:
+ case LDC:
+ case NEW:
+ return result;
+ default:
+ return sourceVals[result.getSize() - 1];
+ }
+ }
+
+ @Override
+ public SourceValue unaryOperation(AbstractInsnNode insn, SourceValue value) {
+ SourceValue result = super.unaryOperation(insn, value);
+ switch (insn.getOpcode()) {
+ case CHECKCAST:
+ case NEWARRAY:
+ case ANEWARRAY:
+ return result;
+ default:
+ return sourceVals[result.getSize() - 1];
+ }
+ }
+
+ @Override
+ public SourceValue binaryOperation(AbstractInsnNode insn, SourceValue value1, SourceValue value2) {
+ switch (insn.getOpcode()) {
+ case LALOAD:
+ case DALOAD:
+ case LADD:
+ case DADD:
+ case LSUB:
+ case DSUB:
+ case LMUL:
+ case DMUL:
+ case LDIV:
+ case DDIV:
+ case LREM:
+ case LSHL:
+ case LSHR:
+ case LUSHR:
+ case LAND:
+ case LOR:
+ case LXOR:
+ return sourceVals[1];
+ default:
+ return sourceVals[0];
+ }
+ }
+
+ @Override
+ public SourceValue ternaryOperation(AbstractInsnNode insn, SourceValue value1, SourceValue value2, SourceValue value3) {
+ return sourceVals[0];
+ }
+
+ @Override
+ public SourceValue copyOperation(AbstractInsnNode insn, SourceValue value) {
+ return value;
+ }
+
+ };
+
+ private interface Action {}
+ private static class MarkScanned implements Action {
+ final int node;
+ private MarkScanned(int node) {
+ this.node = node;
+ }
+ }
+ private static class ExamineEdge implements Action {
+ final int from;
+ final int to;
+
+ private ExamineEdge(int from, int to) {
+ this.from = from;
+ this.to = to;
+ }
+ }
+
+ // Graphs: Theory and Algorithms. by K. Thulasiraman , M. N. S. Swamy (1992)
+ // 11.7.2 DFS of a directed graph
+ static DFSTree buildDFSTree(int[][] transitions) {
+ Set<Edge> tree = new HashSet<Edge>();
+ Set<Edge> forward = new HashSet<Edge>();
+ Set<Edge> back = new HashSet<Edge>();
+ Set<Edge> cross = new HashSet<Edge>();
+
+ boolean[] marked = new boolean[transitions.length];
+ boolean[] scanned = new boolean[transitions.length];
+ int[] preOrder = new int[transitions.length];
+ int[] postOrder = new int[transitions.length];
+
+ int entered = 0;
+ int completed = 0;
+
+ Deque<Action> stack = new LinkedList<Action>();
+ Set<Integer> loopEnters = new HashSet<Integer>();
+
+ // enter 0
+ entered ++;
+ preOrder[0] = entered;
+ marked[0] = true;
+ stack.push(new MarkScanned(0));
+ for (int to : transitions[0]) {
+ stack.push(new ExamineEdge(0, to));
+ }
+
+ while (!stack.isEmpty()) {
+ Action action = stack.pop();
+ if (action instanceof MarkScanned) {
+ MarkScanned markScannedAction = (MarkScanned) action;
+ completed ++;
+ postOrder[markScannedAction.node] = completed;
+ scanned[markScannedAction.node] = true;
+ }
+ else {
+ ExamineEdge examineEdgeAction = (ExamineEdge) action;
+ int from = examineEdgeAction.from;
+ int to = examineEdgeAction.to;
+ if (!marked[to]) {
+ tree.add(new Edge(from, to));
+ // enter to
+ entered ++;
+ preOrder[to] = entered;
+ marked[to] = true;
+ stack.push(new MarkScanned(to));
+ for (int to1 : transitions[to]) {
+ stack.push(new ExamineEdge(to, to1));
+ }
+ }
+ else if (preOrder[to] > preOrder[from]) {
+ forward.add(new Edge(from, to));
+ }
+ else if (preOrder[to] < preOrder[from] && !scanned[to]) {
+ back.add(new Edge(from, to));
+ loopEnters.add(to);
+ } else {
+ cross.add(new Edge(from, to));
+ }
+ }
+ }
+
+ return new DFSTree(preOrder, postOrder, tree, forward, back, cross, loopEnters);
+ }
+
+ // Tarjan. Testing flow graph reducibility.
+ // Journal of Computer and System Sciences 9.3 (1974): 355-365.
+ static boolean reducible(ControlFlowGraph cfg, DFSTree dfs) {
+ int size = cfg.transitions.length;
+ HashSet<Integer>[] cycles = new HashSet[size];
+ HashSet<Integer>[] nonCycles = new HashSet[size];
+ int[] collapsedTo = new int[size];
+ for (int i = 0; i < size; i++) {
+ cycles[i] = new HashSet<Integer>();
+ nonCycles[i] = new HashSet<Integer>();
+ collapsedTo[i] = i;
+ }
+
+ for (Edge edge : dfs.back) {
+ cycles[edge.to].add(edge.from);
+ }
+ for (Edge edge : dfs.tree) {
+ nonCycles[edge.to].add(edge.from);
+ }
+ for (Edge edge : dfs.forward) {
+ nonCycles[edge.to].add(edge.from);
+ }
+ for (Edge edge : dfs.cross) {
+ nonCycles[edge.to].add(edge.from);
+ }
+
+ for (int w = size - 1; w >= 0 ; w--) {
+ HashSet<Integer> p = new HashSet<Integer>(cycles[w]);
+ Queue<Integer> queue = new LinkedList<Integer>(cycles[w]);
+
+ while (!queue.isEmpty()) {
+ int x = queue.remove();
+ for (int y : nonCycles[x]) {
+ int y1 = collapsedTo[y];
+ if (!dfs.isDescendant(y1, w)) {
+ return false;
+ }
+ if (y1 != w && p.add(y1)) {
+ queue.add(y1);
+ }
+ }
+ }
+
+ for (int x : p) {
+ collapsedTo[x] = w;
+ }
+ }
+
+ return true;
+ }
+
+}
+
+final class Edge {
+ final int from, to;
+
+ Edge(int from, int to) {
+ this.from = from;
+ this.to = to;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof Edge)) {
+ return false;
+ }
+ Edge edge = (Edge) o;
+ return from == edge.from && to == edge.to;
+ }
+
+ @Override
+ public int hashCode() {
+ return 31 * from + to;
+ }
+
+ @Override
+ public String toString() {
+ return "(" + from + "," + to + ")";
+ }
+}
+
+final class ControlFlowGraph {
+ final String className;
+ final MethodNode methodNode;
+ final int[][] transitions;
+ final Set<Edge> errorTransitions;
+
+ ControlFlowGraph(String className, MethodNode methodNode, int[][] transitions, Set<Edge> errorTransitions) {
+ this.className = className;
+ this.methodNode = methodNode;
+ this.transitions = transitions;
+ this.errorTransitions = errorTransitions;
+ }
+
+ @Override
+ public String toString() {
+ return "CFG(" +
+ Arrays.toString(transitions) + "," +
+ errorTransitions +
+ ')';
+ }
+}
+
+final class RichControlFlow {
+ final ControlFlowGraph controlFlow;
+ final DFSTree dfsTree;
+
+ RichControlFlow(ControlFlowGraph controlFlow, DFSTree dfsTree) {
+ this.controlFlow = controlFlow;
+ this.dfsTree = dfsTree;
+ }
+}
+
+final class ControlFlowBuilder extends CfgAnalyzer {
+ final String className;
+ final MethodNode methodNode;
+ final TIntArrayList[] transitions;
+ final Set<Edge> errorTransitions;
+
+ ControlFlowBuilder(String className, MethodNode methodNode) {
+ this.className = className;
+ this.methodNode = methodNode;
+ transitions = new TIntArrayList[methodNode.instructions.size()];
+ for (int i = 0; i < transitions.length; i++) {
+ transitions[i] = new TIntArrayList();
+ }
+ errorTransitions = new HashSet<Edge>();
+ }
+
+ final ControlFlowGraph buildCFG() throws AnalyzerException {
+ if ((methodNode.access & (ACC_ABSTRACT | ACC_NATIVE)) == 0) {
+ analyze(methodNode);
+ }
+ int[][] resultTransitions = new int[transitions.length][];
+ for (int i = 0; i < resultTransitions.length; i++) {
+ resultTransitions[i] = transitions[i].toNativeArray();
+ }
+ return new ControlFlowGraph(className, methodNode, resultTransitions, errorTransitions);
+ }
+
+ @Override
+ protected final void newControlFlowEdge(int insn, int successor) {
+ if (!transitions[insn].contains(successor)) {
+ transitions[insn].add(successor);
+ }
+ }
+
+ @Override
+ protected final boolean newControlFlowExceptionEdge(int insn, int successor) {
+ if (!transitions[insn].contains(successor)) {
+ transitions[insn].add(successor);
+ errorTransitions.add(new Edge(insn, successor));
+ }
+ return true;
+ }
+}
+
+final class DFSTree {
+ final int[] preOrder, postOrder;
+ final Set<Edge> tree, forward, back, cross;
+ final Set<Integer> loopEnters;
+
+ DFSTree(int[] preOrder,
+ int[] postOrder,
+ Set<Edge> tree,
+ Set<Edge> forward,
+ Set<Edge> back,
+ Set<Edge> cross,
+ Set<Integer> loopEnters) {
+ this.preOrder = preOrder;
+ this.postOrder = postOrder;
+ this.tree = tree;
+ this.forward = forward;
+ this.back = back;
+ this.cross = cross;
+ this.loopEnters = loopEnters;
+ }
+
+ final boolean isDescendant(int child, int parent) {
+ return preOrder[parent] <= preOrder[child] && postOrder[child] <= postOrder[parent];
+ }
+}
+
+final class ParamsValue implements Value {
+ @NotNull final boolean[] params;
+ final int size;
+
+ ParamsValue(@NotNull boolean[] params, int size) {
+ this.params = params;
+ this.size = size;
+ }
+
+ @Override
+ public int getSize() {
+ return size;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null) return false;
+ ParamsValue that = (ParamsValue)o;
+ return (this.size == that.size && Arrays.equals(this.params, that.params));
+ }
+
+ @Override
+ public int hashCode() {
+ return 31 * Arrays.hashCode(params) + size;
+ }
+}
+
+class ParametersUsage extends Interpreter<ParamsValue> {
+ final ParamsValue val1;
+ final ParamsValue val2;
+ int called = -1;
+ final int rangeStart;
+ final int rangeEnd;
+ final int arity;
+ final int shift;
+
+ ParametersUsage(MethodNode methodNode) {
+ super(ASM5);
+ arity = Type.getArgumentTypes(methodNode.desc).length;
+ boolean[] emptyParams = new boolean[arity];
+ val1 = new ParamsValue(emptyParams, 1);
+ val2 = new ParamsValue(emptyParams, 2);
+
+ shift = (methodNode.access & ACC_STATIC) == 0 ? 2 : 1;
+ rangeStart = shift;
+ rangeEnd = arity + shift;
+ }
+
+ @Override
+ public ParamsValue newValue(Type type) {
+ if (type == null) return val1;
+ called++;
+ if (type == Type.VOID_TYPE) return null;
+ if (called < rangeEnd && rangeStart <= called) {
+ boolean[] params = new boolean[arity];
+ params[called - shift] = true;
+ return type.getSize() == 1 ? new ParamsValue(params, 1) : new ParamsValue(params, 2);
+ }
+ else {
+ return type.getSize() == 1 ? val1 : val2;
+ }
+ }
+
+ @Override
+ public ParamsValue newOperation(final AbstractInsnNode insn) {
+ int size;
+ switch (insn.getOpcode()) {
+ case LCONST_0:
+ case LCONST_1:
+ case DCONST_0:
+ case DCONST_1:
+ size = 2;
+ break;
+ case LDC:
+ Object cst = ((LdcInsnNode) insn).cst;
+ size = cst instanceof Long || cst instanceof Double ? 2 : 1;
+ break;
+ case GETSTATIC:
+ size = Type.getType(((FieldInsnNode) insn).desc).getSize();
+ break;
+ default:
+ size = 1;
+ }
+ return size == 1 ? val1 : val2;
+ }
+
+ @Override
+ public ParamsValue copyOperation(AbstractInsnNode insn, ParamsValue value) {
+ return value;
+ }
+
+ @Override
+ public ParamsValue unaryOperation(AbstractInsnNode insn, ParamsValue value) {
+ int size;
+ switch (insn.getOpcode()) {
+ case CHECKCAST:
+ return new ParamsValue(value.params, Type.getObjectType(((TypeInsnNode)insn).desc).getSize());
+ case LNEG:
+ case DNEG:
+ case I2L:
+ case I2D:
+ case L2D:
+ case F2L:
+ case F2D:
+ case D2L:
+ size = 2;
+ break;
+ case GETFIELD:
+ size = Type.getType(((FieldInsnNode) insn).desc).getSize();
+ break;
+ default:
+ size = 1;
+ }
+ return size == 1 ? val1 : val2;
+ }
+
+ @Override
+ public ParamsValue binaryOperation(AbstractInsnNode insn, ParamsValue value1, ParamsValue value2) {
+ int size;
+ switch (insn.getOpcode()) {
+ case LALOAD:
+ case DALOAD:
+ case LADD:
+ case DADD:
+ case LSUB:
+ case DSUB:
+ case LMUL:
+ case DMUL:
+ case LDIV:
+ case DDIV:
+ case LREM:
+ case DREM:
+ case LSHL:
+ case LSHR:
+ case LUSHR:
+ case LAND:
+ case LOR:
+ case LXOR:
+ size = 2;
+ break;
+ default:
+ size = 1;
+ }
+ return size == 1 ? val1 : val2;
+ }
+
+ @Override
+ public ParamsValue ternaryOperation(AbstractInsnNode insn, ParamsValue value1, ParamsValue value2, ParamsValue value3) {
+ return val1;
+ }
+
+ @Override
+ public ParamsValue naryOperation(AbstractInsnNode insn, List<? extends ParamsValue> values) {
+ int size;
+ int opcode = insn.getOpcode();
+ if (opcode == MULTIANEWARRAY) {
+ size = 1;
+ } else {
+ String desc = (opcode == INVOKEDYNAMIC) ? ((InvokeDynamicInsnNode) insn).desc : ((MethodInsnNode) insn).desc;
+ size = Type.getReturnType(desc).getSize();
+ }
+ return size == 1 ? val1 : val2;
+ }
+
+ @Override
+ public void returnOperation(AbstractInsnNode insn, ParamsValue value, ParamsValue expected) {}
+
+ @Override
+ public ParamsValue merge(ParamsValue v1, ParamsValue v2) {
+ if (v1.equals(v2)) return v1;
+ boolean[] params = new boolean[arity];
+ boolean[] params1 = v1.params;
+ boolean[] params2 = v2.params;
+ for (int i = 0; i < arity; i++) {
+ params[i] = params1[i] || params2[i];
+ }
+ return new ParamsValue(params, Math.min(v1.size, v2.size));
+ }
+}
+
+class LeakingParametersCollector extends ParametersUsage {
+ final boolean[] leaking;
+ LeakingParametersCollector(MethodNode methodNode) {
+ super(methodNode);
+ leaking = new boolean[arity];
+ }
+
+ @Override
+ public ParamsValue unaryOperation(AbstractInsnNode insn, ParamsValue value) {
+ switch (insn.getOpcode()) {
+ case GETFIELD:
+ case ARRAYLENGTH:
+ case MONITORENTER:
+ case INSTANCEOF:
+ case IRETURN:
+ case ARETURN:
+ case IFNONNULL:
+ case IFNULL:
+ case IFEQ:
+ case IFNE:
+ boolean[] params = value.params;
+ for (int i = 0; i < arity; i++) {
+ leaking[i] |= params[i];
+ }
+ break;
+ default:
+ }
+ return super.unaryOperation(insn, value);
+ }
+
+ @Override
+ public ParamsValue binaryOperation(AbstractInsnNode insn, ParamsValue value1, ParamsValue value2) {
+ switch (insn.getOpcode()) {
+ case IALOAD:
+ case LALOAD:
+ case FALOAD:
+ case DALOAD:
+ case AALOAD:
+ case BALOAD:
+ case CALOAD:
+ case SALOAD:
+ case PUTFIELD:
+ boolean[] params = value1.params;
+ for (int i = 0; i < arity; i++) {
+ leaking[i] |= params[i];
+ }
+ break;
+ default:
+ }
+ return super.binaryOperation(insn, value1, value2);
+ }
+
+ @Override
+ public ParamsValue ternaryOperation(AbstractInsnNode insn, ParamsValue value1, ParamsValue value2, ParamsValue value3) {
+ switch (insn.getOpcode()) {
+ case IASTORE:
+ case LASTORE:
+ case FASTORE:
+ case DASTORE:
+ case AASTORE:
+ case BASTORE:
+ case CASTORE:
+ case SASTORE:
+ boolean[] params = value1.params;
+ for (int i = 0; i < arity; i++) {
+ leaking[i] |= params[i];
+ }
+ break;
+ default:
+ }
+ return super.ternaryOperation(insn, value1, value2, value3);
+ }
+
+ @Override
+ public ParamsValue naryOperation(AbstractInsnNode insn, List<? extends ParamsValue> values) {
+ switch (insn.getOpcode()) {
+ case INVOKESTATIC:
+ case INVOKESPECIAL:
+ case INVOKEVIRTUAL:
+ case INVOKEINTERFACE:
+ for (ParamsValue value : values) {
+ boolean[] params = value.params;
+ for (int i = 0; i < arity; i++) {
+ leaking[i] |= params[i];
+ }
+ }
+ break;
+ default:
+ }
+ return super.naryOperation(insn, values);
+ }
+}
+
+/**
+ * Specialized lite version of {@link org.jetbrains.org.objectweb.asm.tree.analysis.Analyzer}.
+ * Calculation of fix-point of frames is removed, since frames are not needed to build control flow graph.
+ * So, the main point here is handling of subroutines (jsr) and try-catch-finally blocks.
+ */
+class CfgAnalyzer implements Opcodes {
+ static class Subroutine {
+
+ LabelNode start;
+
+ boolean[] access;
+
+ List<JumpInsnNode> callers;
+
+ private Subroutine() {
+ }
+
+ Subroutine(final LabelNode start, final int maxLocals,
+ final JumpInsnNode caller) {
+ this.start = start;
+ this.access = new boolean[maxLocals];
+ this.callers = new ArrayList<JumpInsnNode>();
+ callers.add(caller);
+ }
+
+ public Subroutine copy() {
+ Subroutine result = new Subroutine();
+ result.start = start;
+ result.access = new boolean[access.length];
+ System.arraycopy(access, 0, result.access, 0, access.length);
+ result.callers = new ArrayList<JumpInsnNode>(callers);
+ return result;
+ }
+
+ public boolean merge(final Subroutine subroutine) throws AnalyzerException {
+ boolean changes = false;
+ for (int i = 0; i < access.length; ++i) {
+ if (subroutine.access[i] && !access[i]) {
+ access[i] = true;
+ changes = true;
+ }
+ }
+ if (subroutine.start == start) {
+ for (int i = 0; i < subroutine.callers.size(); ++i) {
+ JumpInsnNode caller = subroutine.callers.get(i);
+ if (!callers.contains(caller)) {
+ callers.add(caller);
+ changes = true;
+ }
+ }
+ }
+ return changes;
+ }
+ }
+ private int n;
+ private InsnList insns;
+ private List<TryCatchBlockNode>[] handlers;
+ private Subroutine[] subroutines;
+ private boolean[] wasQueued;
+ private boolean[] queued;
+ private int[] queue;
+ private int top;
+
+ public void analyze(final MethodNode m) throws AnalyzerException {
+ n = m.instructions.size();
+ insns = m.instructions;
+ handlers = (List<TryCatchBlockNode>[]) new List<?>[n];
+ subroutines = new Subroutine[n];
+ queued = new boolean[n];
+ wasQueued = new boolean[n];
+ queue = new int[n];
+ top = 0;
+
+ // computes exception handlers for each instruction
+ for (int i = 0; i < m.tryCatchBlocks.size(); ++i) {
+ TryCatchBlockNode tcb = m.tryCatchBlocks.get(i);
+ int begin = insns.indexOf(tcb.start);
+ int end = insns.indexOf(tcb.end);
+ for (int j = begin; j < end; ++j) {
+ List<TryCatchBlockNode> insnHandlers = handlers[j];
+ if (insnHandlers == null) {
+ insnHandlers = new ArrayList<TryCatchBlockNode>();
+ handlers[j] = insnHandlers;
+ }
+ insnHandlers.add(tcb);
+ }
+ }
+
+ // computes the subroutine for each instruction:
+ Subroutine main = new Subroutine(null, m.maxLocals, null);
+ List<AbstractInsnNode> subroutineCalls = new ArrayList<AbstractInsnNode>();
+ Map<LabelNode, Subroutine> subroutineHeads = new HashMap<LabelNode, Subroutine>();
+
+ findSubroutine(0, main, subroutineCalls);
+ while (!subroutineCalls.isEmpty()) {
+ JumpInsnNode jsr = (JumpInsnNode) subroutineCalls.remove(0);
+ Subroutine sub = subroutineHeads.get(jsr.label);
+ if (sub == null) {
+ sub = new Subroutine(jsr.label, m.maxLocals, jsr);
+ subroutineHeads.put(jsr.label, sub);
+ findSubroutine(insns.indexOf(jsr.label), sub, subroutineCalls);
+ } else {
+ sub.callers.add(jsr);
+ }
+ }
+ for (int i = 0; i < n; ++i) {
+ if (subroutines[i] != null && subroutines[i].start == null) {
+ subroutines[i] = null;
+ }
+ }
+
+ merge(0, null);
+ // control flow analysis
+ while (top > 0) {
+ int insn = queue[--top];
+ Subroutine subroutine = subroutines[insn];
+ queued[insn] = false;
+
+ AbstractInsnNode insnNode = null;
+ try {
+ insnNode = m.instructions.get(insn);
+ int insnOpcode = insnNode.getOpcode();
+ int insnType = insnNode.getType();
+
+ if (insnType == AbstractInsnNode.LABEL || insnType == AbstractInsnNode.LINE || insnType == AbstractInsnNode.FRAME) {
+ merge(insn + 1, subroutine);
+ newControlFlowEdge(insn, insn + 1);
+ } else {
+ subroutine = subroutine == null ? null : subroutine.copy();
+
+ if (insnNode instanceof JumpInsnNode) {
+ JumpInsnNode j = (JumpInsnNode) insnNode;
+ if (insnOpcode != GOTO && insnOpcode != JSR) {
+ merge(insn + 1, subroutine);
+ newControlFlowEdge(insn, insn + 1);
+ }
+ int jump = insns.indexOf(j.label);
+ if (insnOpcode == JSR) {
+ merge(jump, new Subroutine(j.label, m.maxLocals, j));
+ } else {
+ merge(jump, subroutine);
+ }
+ newControlFlowEdge(insn, jump);
+ } else if (insnNode instanceof LookupSwitchInsnNode) {
+ LookupSwitchInsnNode lsi = (LookupSwitchInsnNode) insnNode;
+ int jump = insns.indexOf(lsi.dflt);
+ merge(jump, subroutine);
+ newControlFlowEdge(insn, jump);
+ for (int j = 0; j < lsi.labels.size(); ++j) {
+ LabelNode label = lsi.labels.get(j);
+ jump = insns.indexOf(label);
+ merge(jump, subroutine);
+ newControlFlowEdge(insn, jump);
+ }
+ } else if (insnNode instanceof TableSwitchInsnNode) {
+ TableSwitchInsnNode tsi = (TableSwitchInsnNode) insnNode;
+ int jump = insns.indexOf(tsi.dflt);
+ merge(jump, subroutine);
+ newControlFlowEdge(insn, jump);
+ for (int j = 0; j < tsi.labels.size(); ++j) {
+ LabelNode label = tsi.labels.get(j);
+ jump = insns.indexOf(label);
+ merge(jump, subroutine);
+ newControlFlowEdge(insn, jump);
+ }
+ } else if (insnOpcode == RET) {
+ if (subroutine == null) {
+ throw new AnalyzerException(insnNode, "RET instruction outside of a sub routine");
+ }
+ for (int i = 0; i < subroutine.callers.size(); ++i) {
+ JumpInsnNode caller = subroutine.callers.get(i);
+ int call = insns.indexOf(caller);
+ if (wasQueued[call]) {
+ merge(call + 1, subroutines[call], subroutine.access);
+ newControlFlowEdge(insn, call + 1);
+ }
+ }
+ } else if (insnOpcode != ATHROW && (insnOpcode < IRETURN || insnOpcode > RETURN)) {
+ if (subroutine != null) {
+ if (insnNode instanceof VarInsnNode) {
+ int var = ((VarInsnNode) insnNode).var;
+ subroutine.access[var] = true;
+ if (insnOpcode == LLOAD || insnOpcode == DLOAD
+ || insnOpcode == LSTORE
+ || insnOpcode == DSTORE) {
+ subroutine.access[var + 1] = true;
+ }
+ } else if (insnNode instanceof IincInsnNode) {
+ int var = ((IincInsnNode) insnNode).var;
+ subroutine.access[var] = true;
+ }
+ }
+ merge(insn + 1, subroutine);
+ newControlFlowEdge(insn, insn + 1);
+ }
+ }
+
+ List<TryCatchBlockNode> insnHandlers = handlers[insn];
+ if (insnHandlers != null) {
+ for (TryCatchBlockNode tcb : insnHandlers) {
+ newControlFlowExceptionEdge(insn, tcb);
+ merge(insns.indexOf(tcb.handler), subroutine);
+ }
+ }
+ } catch (AnalyzerException e) {
+ throw new AnalyzerException(e.node, "Error at instruction "
+ + insn + ": " + e.getMessage(), e);
+ } catch (Exception e) {
+ throw new AnalyzerException(insnNode, "Error at instruction "
+ + insn + ": " + e.getMessage(), e);
+ }
+ }
+ }
+
+ private void findSubroutine(int insn, final Subroutine sub,
+ final List<AbstractInsnNode> calls) throws AnalyzerException {
+ while (true) {
+ if (insn < 0 || insn >= n) {
+ throw new AnalyzerException(null, "Execution can fall off end of the code");
+ }
+ if (subroutines[insn] != null) {
+ return;
+ }
+ subroutines[insn] = sub.copy();
+ AbstractInsnNode node = insns.get(insn);
+
+ // calls findSubroutine recursively on normal successors
+ if (node instanceof JumpInsnNode) {
+ if (node.getOpcode() == JSR) {
+ // do not follow a JSR, it leads to another subroutine!
+ calls.add(node);
+ } else {
+ JumpInsnNode jnode = (JumpInsnNode) node;
+ findSubroutine(insns.indexOf(jnode.label), sub, calls);
+ }
+ } else if (node instanceof TableSwitchInsnNode) {
+ TableSwitchInsnNode tsnode = (TableSwitchInsnNode) node;
+ findSubroutine(insns.indexOf(tsnode.dflt), sub, calls);
+ for (int i = tsnode.labels.size() - 1; i >= 0; --i) {
+ LabelNode l = tsnode.labels.get(i);
+ findSubroutine(insns.indexOf(l), sub, calls);
+ }
+ } else if (node instanceof LookupSwitchInsnNode) {
+ LookupSwitchInsnNode lsnode = (LookupSwitchInsnNode) node;
+ findSubroutine(insns.indexOf(lsnode.dflt), sub, calls);
+ for (int i = lsnode.labels.size() - 1; i >= 0; --i) {
+ LabelNode l = lsnode.labels.get(i);
+ findSubroutine(insns.indexOf(l), sub, calls);
+ }
+ }
+
+ // calls findSubroutine recursively on exception handler successors
+ List<TryCatchBlockNode> insnHandlers = handlers[insn];
+ if (insnHandlers != null) {
+ for (int i = 0; i < insnHandlers.size(); ++i) {
+ TryCatchBlockNode tcb = insnHandlers.get(i);
+ findSubroutine(insns.indexOf(tcb.handler), sub, calls);
+ }
+ }
+
+ // if insn does not falls through to the next instruction, return.
+ switch (node.getOpcode()) {
+ case GOTO:
+ case RET:
+ case TABLESWITCH:
+ case LOOKUPSWITCH:
+ case IRETURN:
+ case LRETURN:
+ case FRETURN:
+ case DRETURN:
+ case ARETURN:
+ case RETURN:
+ case ATHROW:
+ return;
+ }
+ insn++;
+ }
+ }
+
+ protected void newControlFlowEdge(final int insn, final int successor) {}
+
+ protected boolean newControlFlowExceptionEdge(final int insn,
+ final int successor) {
+ return true;
+ }
+
+ protected boolean newControlFlowExceptionEdge(final int insn,
+ final TryCatchBlockNode tcb) {
+ return newControlFlowExceptionEdge(insn, insns.indexOf(tcb.handler));
+ }
+
+ // -------------------------------------------------------------------------
+
+ private void merge(final int insn, final Subroutine subroutine) throws AnalyzerException {
+ Subroutine oldSubroutine = subroutines[insn];
+ boolean changes = false;
+
+ if (!wasQueued[insn]) {
+ wasQueued[insn] = true;
+ changes = true;
+ }
+
+ if (oldSubroutine == null) {
+ if (subroutine != null) {
+ subroutines[insn] = subroutine.copy();
+ changes = true;
+ }
+ } else {
+ if (subroutine != null) {
+ changes |= oldSubroutine.merge(subroutine);
+ }
+ }
+ if (changes && !queued[insn]) {
+ queued[insn] = true;
+ queue[top++] = insn;
+ }
+ }
+
+ private void merge(final int insn, final Subroutine subroutineBeforeJSR, final boolean[] access) throws AnalyzerException {
+ Subroutine oldSubroutine = subroutines[insn];
+ boolean changes = false;
+
+ if (!wasQueued[insn]) {
+ wasQueued[insn] = true;
+ changes = true;
+ }
+
+ if (oldSubroutine != null && subroutineBeforeJSR != null) {
+ changes |= oldSubroutine.merge(subroutineBeforeJSR);
+ }
+ if (changes && !queued[insn]) {
+ queued[insn] = true;
+ queue[top++] = insn;
+ }
+ }
+}
+
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Data.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Data.java
new file mode 100644
index 0000000..132c564
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Data.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+final class Method {
+ final String internalClassName;
+ final String methodName;
+ final String methodDesc;
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ Method method = (Method) o;
+ return internalClassName.equals(method.internalClassName) && methodDesc.equals(method.methodDesc) && methodName.equals(method.methodName);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = internalClassName.hashCode();
+ result = 31 * result + methodName.hashCode();
+ result = 31 * result + methodDesc.hashCode();
+ return result;
+ }
+
+ Method(String internalClassName, String methodName, String methodDesc) {
+ this.internalClassName = internalClassName;
+ this.methodName = methodName;
+ this.methodDesc = methodDesc;
+ }
+
+ @Override
+ public String toString() {
+ return internalClassName + ' ' + methodName + ' ' + methodDesc;
+ }
+}
+
+enum Value {
+ Bot, NotNull, Null, True, False, Top
+}
+
+interface Direction {
+ static final int OUT_DIRECTION = 0;
+ static final int IN_DIRECTION = 1;
+ static final int INOUT_DIRECTION = 2;
+ int directionId();
+ int paramId();
+ int valueId();
+}
+
+final class In implements Direction {
+ final int paramIndex;
+
+ In(int paramIndex) {
+ this.paramIndex = paramIndex;
+ }
+
+ @Override
+ public String toString() {
+ return "In " + paramIndex;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ In in = (In) o;
+ if (paramIndex != in.paramIndex) return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return paramIndex;
+ }
+
+ @Override
+ public int directionId() {
+ return IN_DIRECTION;
+ }
+
+ @Override
+ public int paramId() {
+ return paramIndex;
+ }
+
+ @Override
+ public int valueId() {
+ return 0;
+ }
+}
+
+final class InOut implements Direction {
+ final int paramIndex;
+ final Value inValue;
+
+ InOut(int paramIndex, Value inValue) {
+ this.paramIndex = paramIndex;
+ this.inValue = inValue;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ InOut inOut = (InOut) o;
+
+ if (paramIndex != inOut.paramIndex) return false;
+ if (inValue != inOut.inValue) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = paramIndex;
+ result = 31 * result + inValue.ordinal();
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "InOut " + paramIndex + " " + inValue.toString();
+ }
+
+ @Override
+ public int directionId() {
+ return INOUT_DIRECTION;
+ }
+
+ @Override
+ public int paramId() {
+ return paramIndex;
+ }
+
+ @Override
+ public int valueId() {
+ return inValue.ordinal();
+ }
+}
+
+final class Out implements Direction {
+ @Override
+ public String toString() {
+ return "Out";
+ }
+
+ @Override
+ public int hashCode() {
+ return 1;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return obj instanceof Out;
+ }
+
+ @Override
+ public int directionId() {
+ return OUT_DIRECTION;
+ }
+
+ @Override
+ public int paramId() {
+ return 0;
+ }
+
+ @Override
+ public int valueId() {
+ return 0;
+ }
+}
+
+final class Key {
+ final Method method;
+ final Direction direction;
+ final boolean stable;
+
+ Key(Method method, Direction direction, boolean stable) {
+ this.method = method;
+ this.direction = direction;
+ this.stable = stable;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Key key = (Key) o;
+
+ if (!direction.equals(key.direction)) return false;
+ if (!method.equals(key.method)) return false;
+ if (stable != key.stable) return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = method.hashCode();
+ result = 31 * result + direction.hashCode();
+ result = 31 * result + (stable ? 1 : 0);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "" + method + ' ' + direction + ' ' + stable;
+ }
+}
+
+
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Parameters.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Parameters.java
new file mode 100644
index 0000000..08c52c4
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Parameters.java
@@ -0,0 +1,390 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import org.jetbrains.org.objectweb.asm.Type;
+import org.jetbrains.org.objectweb.asm.tree.AbstractInsnNode;
+import org.jetbrains.org.objectweb.asm.tree.JumpInsnNode;
+import org.jetbrains.org.objectweb.asm.tree.MethodInsnNode;
+import org.jetbrains.org.objectweb.asm.tree.TypeInsnNode;
+import org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException;
+import org.jetbrains.org.objectweb.asm.tree.analysis.BasicInterpreter;
+import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue;
+import org.jetbrains.org.objectweb.asm.tree.analysis.Frame;
+
+import java.util.*;
+
+import static com.intellij.codeInspection.bytecodeAnalysis.AbstractValues.InstanceOfCheckValue;
+import static com.intellij.codeInspection.bytecodeAnalysis.AbstractValues.ParamValue;
+import static com.intellij.codeInspection.bytecodeAnalysis.PResults.*;
+import static org.jetbrains.org.objectweb.asm.Opcodes.*;
+
+abstract class PResults {
+ // SoP = sum of products
+ static Set<Set<Key>> join(Set<Set<Key>> sop1, Set<Set<Key>> sop2) {
+ Set<Set<Key>> sop = new HashSet<Set<Key>>();
+ sop.addAll(sop1);
+ sop.addAll(sop2);
+ return sop;
+ }
+
+ static Set<Set<Key>> meet(Set<Set<Key>> sop1, Set<Set<Key>> sop2) {
+ Set<Set<Key>> sop = new HashSet<Set<Key>>();
+ for (Set<Key> prod1 : sop1) {
+ for (Set<Key> prod2 : sop2) {
+ Set<Key> prod = new HashSet<Key>();
+ prod.addAll(prod1);
+ prod.addAll(prod2);
+ sop.add(prod);
+ }
+ }
+ return sop;
+ }
+
+ // Results
+ interface PResult {}
+ static final PResult Identity = new PResult() {
+ @Override
+ public String toString() {
+ return "Identity";
+ }
+ };
+ // similar to top, maximal element
+ static final PResult Return = new PResult() {
+ @Override
+ public String toString() {
+ return "Return";
+ }
+ };
+ // minimal element
+ static final PResult NPE = new PResult() {
+ @Override
+ public String toString() {
+ return "NPE";
+ }
+ };
+ static final class ConditionalNPE implements PResult {
+ final Set<Set<Key>> sop;
+ public ConditionalNPE(Set<Set<Key>> sop) {
+ this.sop = sop;
+ }
+
+ public ConditionalNPE(Key key) {
+ sop = new HashSet<Set<Key>>();
+ Set<Key> prod = new HashSet<Key>();
+ prod.add(key);
+ sop.add(prod);
+ }
+ }
+
+ static PResult join(PResult r1, PResult r2) {
+ if (Identity == r1) return r2;
+ if (Identity == r2) return r1;
+ if (Return == r1) return Return;
+ if (Return == r2) return Return;
+ if (NPE == r1) return r2;
+ if (NPE == r2) return r1;
+ ConditionalNPE cnpe1 = (ConditionalNPE) r1;
+ ConditionalNPE cnpe2 = (ConditionalNPE) r2;
+ return new ConditionalNPE(join(cnpe1.sop, cnpe2.sop));
+ }
+
+ static PResult meet(PResult r1, PResult r2) {
+ if (Identity == r1) return r2;
+ if (Return == r1) return r2;
+ if (Return == r2) return r1;
+ if (NPE == r1) return NPE;
+ if (NPE == r2) return NPE;
+ if (Identity == r2) return Identity;
+ ConditionalNPE cnpe1 = (ConditionalNPE) r1;
+ ConditionalNPE cnpe2 = (ConditionalNPE) r2;
+ return new ConditionalNPE(meet(cnpe1.sop, cnpe2.sop));
+ }
+
+}
+
+class NonNullInAnalysis extends Analysis<PResult> {
+
+ private final NonNullInInterpreter interpreter = new NonNullInInterpreter();
+
+ protected NonNullInAnalysis(RichControlFlow richControlFlow, Direction direction, boolean stable) {
+ super(richControlFlow, direction, stable);
+ }
+
+ @Override
+ PResult identity() {
+ return Identity;
+ }
+
+ @Override
+ PResult combineResults(PResult delta, List<PResult> subResults) {
+ PResult subResult = Identity;
+ for (PResult sr : subResults) {
+ subResult = join(subResult, sr);
+ }
+ return meet(delta, subResult);
+ }
+
+ @Override
+ boolean isEarlyResult(PResult result) {
+ return false;
+ }
+
+ @Override
+ Equation<Key, Value> mkEquation(PResult result) {
+ if (Identity == result || Return == result) {
+ return new Equation<Key, Value>(aKey, new Final<Key, Value>(Value.Top));
+ }
+ else if (NPE == result) {
+ return new Equation<Key, Value>(aKey, new Final<Key, Value>(Value.NotNull));
+ }
+ else {
+ ConditionalNPE condNpe = (ConditionalNPE) result;
+ Set<Product<Key, Value>> components = new HashSet<Product<Key, Value>>();
+ for (Set<Key> prod : condNpe.sop) {
+ components.add(new Product<Key, Value>(Value.Top, prod));
+ }
+ return new Equation<Key, Value>(aKey, new Pending<Key, Value>(components));
+ }
+ }
+
+ private int id = 0;
+ private Frame<BasicValue> nextFrame = null;
+ private PResult subResult = null;
+
+ @Override
+ void processState(State state) throws AnalyzerException {
+ int stateIndex = state.index;
+ Conf conf = state.conf;
+ int insnIndex = conf.insnIndex;
+ List<Conf> history = state.history;
+ boolean taken = state.taken;
+ Frame<BasicValue> frame = conf.frame;
+ AbstractInsnNode insnNode = methodNode.instructions.get(insnIndex);
+ List<Conf> nextHistory = dfsTree.loopEnters.contains(insnIndex) ? append(history, conf) : history;
+ boolean hasCompanions = state.hasCompanions;
+ execute(frame, insnNode);
+
+ boolean notEmptySubResult = subResult != Identity;
+
+ if (subResult == NPE) {
+ results.put(stateIndex, NPE);
+ computed.put(insnIndex, append(computed.get(insnIndex), state));
+ return;
+ }
+
+ int opcode = insnNode.getOpcode();
+ switch (opcode) {
+ case ARETURN:
+ case IRETURN:
+ case LRETURN:
+ case FRETURN:
+ case DRETURN:
+ case RETURN:
+ if (!hasCompanions) {
+ earlyResult = Return;
+ } else {
+ results.put(stateIndex, Return);
+ computed.put(insnIndex, append(computed.get(insnIndex), state));
+ }
+ return;
+ default:
+ }
+
+ if (opcode == ATHROW) {
+ if (taken) {
+ results.put(stateIndex, NPE);
+ } else {
+ results.put(stateIndex, Identity);
+ }
+ computed.put(insnIndex, append(computed.get(insnIndex), state));
+ return;
+ }
+
+ if (opcode == IFNONNULL && popValue(frame) instanceof ParamValue) {
+ int nextInsnIndex = insnIndex + 1;
+ State nextState = new State(++id, new Conf(nextInsnIndex, nextFrame), nextHistory, true, hasCompanions || notEmptySubResult);
+ pending.push(new MakeResult<PResult>(state, subResult, new int[]{nextState.index}));
+ pending.push(new ProceedState<PResult>(nextState));
+ return;
+ }
+
+ if (opcode == IFNULL && popValue(frame) instanceof ParamValue) {
+ int nextInsnIndex = methodNode.instructions.indexOf(((JumpInsnNode)insnNode).label);
+ State nextState = new State(++id, new Conf(nextInsnIndex, nextFrame), nextHistory, true, hasCompanions || notEmptySubResult);
+ pending.push(new MakeResult<PResult>(state, subResult, new int[]{nextState.index}));
+ pending.push(new ProceedState<PResult>(nextState));
+ return;
+ }
+
+ if (opcode == IFEQ && popValue(frame) == InstanceOfCheckValue) {
+ int nextInsnIndex = methodNode.instructions.indexOf(((JumpInsnNode)insnNode).label);
+ State nextState = new State(++id, new Conf(nextInsnIndex, nextFrame), nextHistory, true, hasCompanions || notEmptySubResult);
+ pending.push(new MakeResult<PResult>(state, subResult, new int[]{nextState.index}));
+ pending.push(new ProceedState<PResult>(nextState));
+ return;
+ }
+
+ if (opcode == IFNE && popValue(frame) == InstanceOfCheckValue) {
+ int nextInsnIndex = insnIndex + 1;
+ State nextState = new State(++id, new Conf(nextInsnIndex, nextFrame), nextHistory, true, hasCompanions || notEmptySubResult);
+ pending.push(new MakeResult<PResult>(state, subResult, new int[]{nextState.index}));
+ pending.push(new ProceedState<PResult>(nextState));
+ return;
+ }
+
+ // general case
+ int[] nextInsnIndices = controlFlow.transitions[insnIndex];
+ List<State> nextStates = new ArrayList<State>(nextInsnIndices.length);
+ int[] subIndices = new int[nextInsnIndices.length];
+
+ for (int i = 0; i < nextInsnIndices.length; i++) {
+ int nextInsnIndex = nextInsnIndices[i];
+ Frame<BasicValue> nextFrame1 = nextFrame;
+ if (controlFlow.errorTransitions.contains(new Edge(insnIndex, nextInsnIndex))) {
+ nextFrame1 = new Frame<BasicValue>(frame);
+ nextFrame1.clearStack();
+ nextFrame1.push(new BasicValue(Type.getType("java/lang/Throwable")));
+ }
+ nextStates.add(new State(++id, new Conf(nextInsnIndex, nextFrame1), nextHistory, taken, hasCompanions || notEmptySubResult));
+ subIndices[i] = (id);
+ }
+
+ pending.push(new MakeResult<PResult>(state, subResult, subIndices));
+ for (State nextState : nextStates) {
+ pending.push(new ProceedState<PResult>(nextState));
+ }
+
+ }
+
+ private void execute(Frame<BasicValue> frame, AbstractInsnNode insnNode) throws AnalyzerException {
+ switch (insnNode.getType()) {
+ case AbstractInsnNode.LABEL:
+ case AbstractInsnNode.LINE:
+ case AbstractInsnNode.FRAME:
+ nextFrame = frame;
+ subResult = Identity;
+ break;
+ default:
+ nextFrame = new Frame<BasicValue>(frame);
+ interpreter.reset();
+ nextFrame.execute(insnNode, interpreter);
+ subResult = interpreter.getSubResult();
+ }
+ }
+}
+
+class NonNullInInterpreter extends BasicInterpreter {
+ private PResult subResult = Identity;
+ public PResult getSubResult() {
+ return subResult;
+ }
+ void reset() {
+ subResult = Identity;
+ }
+
+ @Override
+ public BasicValue unaryOperation(AbstractInsnNode insn, BasicValue value) throws AnalyzerException {
+ switch (insn.getOpcode()) {
+ case GETFIELD:
+ case ARRAYLENGTH:
+ case MONITORENTER:
+ if (value instanceof ParamValue) {
+ subResult = NPE;
+ }
+ break;
+ case CHECKCAST:
+ if (value instanceof ParamValue) {
+ return new ParamValue(Type.getObjectType(((TypeInsnNode)insn).desc));
+ }
+ break;
+ case INSTANCEOF:
+ if (value instanceof ParamValue) {
+ return InstanceOfCheckValue;
+ }
+ break;
+ default:
+
+ }
+ return super.unaryOperation(insn, value);
+ }
+
+ @Override
+ public BasicValue binaryOperation(AbstractInsnNode insn, BasicValue value1, BasicValue value2) throws AnalyzerException {
+ switch (insn.getOpcode()) {
+ case IALOAD:
+ case LALOAD:
+ case FALOAD:
+ case DALOAD:
+ case AALOAD:
+ case BALOAD:
+ case CALOAD:
+ case SALOAD:
+ case PUTFIELD:
+ if (value1 instanceof ParamValue) {
+ subResult = NPE;
+ }
+ break;
+ default:
+ }
+ return super.binaryOperation(insn, value1, value2);
+ }
+
+ @Override
+ public BasicValue ternaryOperation(AbstractInsnNode insn, BasicValue value1, BasicValue value2, BasicValue value3) throws AnalyzerException {
+ switch (insn.getOpcode()) {
+ case IASTORE:
+ case LASTORE:
+ case FASTORE:
+ case DASTORE:
+ case AASTORE:
+ case BASTORE:
+ case CASTORE:
+ case SASTORE:
+ if (value1 instanceof ParamValue) {
+ subResult = NPE;
+ }
+ default:
+ }
+ return super.ternaryOperation(insn, value1, value2, value3);
+ }
+
+ @Override
+ public BasicValue naryOperation(AbstractInsnNode insn, List<? extends BasicValue> values) throws AnalyzerException {
+ int opcode = insn.getOpcode();
+ boolean isStaticInvoke = opcode == INVOKESTATIC;
+ int shift = isStaticInvoke ? 0 : 1;
+ if ((opcode == INVOKESPECIAL || opcode ==INVOKEINTERFACE || opcode == INVOKEVIRTUAL) && values.get(0) instanceof ParamValue) {
+ subResult = NPE;
+ }
+ switch (opcode) {
+ case INVOKESTATIC:
+ case INVOKESPECIAL:
+ case INVOKEVIRTUAL:
+ case INVOKEINTERFACE:
+ boolean stable = opcode == INVOKESTATIC || opcode == INVOKESPECIAL;
+ MethodInsnNode methodNode = (MethodInsnNode) insn;
+ for (int i = shift; i < values.size(); i++) {
+ if (values.get(i) instanceof ParamValue) {
+ Method method = new Method(methodNode.owner, methodNode.name, methodNode.desc);
+ subResult = meet(subResult, new ConditionalNPE(new Key(method, new In(i - shift), stable)));
+ }
+ }
+ default:
+ }
+ return super.naryOperation(insn, values);
+ }
+}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/ProjectBytecodeAnalysis.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/ProjectBytecodeAnalysis.java
new file mode 100644
index 0000000..86b9dd1
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/ProjectBytecodeAnalysis.java
@@ -0,0 +1,291 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import com.intellij.ProjectTopics;
+import com.intellij.codeInsight.AnnotationUtil;
+import com.intellij.codeInspection.dataFlow.ControlFlowAnalyzer;
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ContentIterator;
+import com.intellij.openapi.roots.ModuleRootAdapter;
+import com.intellij.openapi.roots.ModuleRootEvent;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.ModificationTracker;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.search.ProjectScope;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.indexing.FileBasedIndex;
+import com.intellij.util.messages.MessageBusConnection;
+import gnu.trove.TIntHashSet;
+import gnu.trove.TIntObjectHashMap;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.IOException;
+import java.util.Collection;
+
+/**
+ * @author lambdamix
+ */
+public class ProjectBytecodeAnalysis {
+ public static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.bytecodeAnalysis");
+ public static final Key<Boolean> INFERRED_ANNOTATION = Key.create("INFERRED_ANNOTATION");
+ private final Project myProject;
+
+ private volatile Annotations myAnnotations = null;
+
+ public static ProjectBytecodeAnalysis getInstance(@NotNull Project project) {
+ return ServiceManager.getService(project, ProjectBytecodeAnalysis.class);
+ }
+
+ public ProjectBytecodeAnalysis(Project project) {
+ myProject = project;
+ final MessageBusConnection connection = myProject.getMessageBus().connect();
+ connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
+ @Override
+ public void rootsChanged(ModuleRootEvent event) {
+ unloadAnnotations();
+ }
+ });
+ }
+
+ private void loadAnnotations() {
+ Annotations annotations = new Annotations();
+ loadParameterAnnotations(annotations);
+ loadContractAnnotations(annotations);
+ myAnnotations = annotations;
+ LOG.debug("NotNull annotations: " + myAnnotations.notNulls.size());
+ LOG.debug("Contract annotations: " + myAnnotations.contracts.size());
+ }
+
+ private void unloadAnnotations() {
+ myAnnotations = null;
+ LOG.debug("unloaded");
+ }
+
+ private void loadParameterAnnotations(Annotations annotations) {
+ LOG.debug("initializing parameter annotations");
+ final IntIdSolver solver = new IntIdSolver(new ELattice<Value>(Value.NotNull, Value.Top));
+
+ processValues(true, new FileBasedIndex.ValueProcessor<Collection<IntIdEquation>>() {
+ @Override
+ public boolean process(VirtualFile file, Collection<IntIdEquation> value) {
+ for (IntIdEquation intIdEquation : value) {
+ solver.addEquation(intIdEquation);
+ }
+ return true;
+ }
+ });
+
+ LOG.debug("parameter equations are constructed");
+ LOG.debug("equations: " + solver.getSize());
+ TIntObjectHashMap<Value> solutions = solver.solve();
+ LOG.debug("parameter equations are solved");
+ BytecodeAnalysisConverter.getInstance().addAnnotations(solutions, annotations);
+ }
+
+ private void processValues(final boolean parameters, final FileBasedIndex.ValueProcessor<Collection<IntIdEquation>> processor) {
+ final GlobalSearchScope libScope = ProjectScope.getLibrariesScope(myProject);
+ final FileBasedIndex index = FileBasedIndex.getInstance();
+ index.iterateIndexableFiles(new ContentIterator() {
+ @Override
+ public boolean processFile(VirtualFile fileOrDir) {
+ ProgressManager.checkCanceled();
+ if (!fileOrDir.isDirectory() && libScope.contains(fileOrDir)) {
+ index.processValues(BytecodeAnalysisIndex.NAME, BytecodeAnalysisIndex.indexKey(fileOrDir, parameters),
+ fileOrDir, processor, GlobalSearchScope.fileScope(myProject, fileOrDir));
+ }
+ return false;
+ }
+ }, myProject, null);
+ }
+
+ private void loadContractAnnotations(Annotations annotations) {
+ LOG.debug("initializing contract annotations");
+ final IntIdSolver solver = new IntIdSolver(new ELattice<Value>(Value.Bot, Value.Top));
+ processValues(false, new FileBasedIndex.ValueProcessor<Collection<IntIdEquation>>() {
+ @Override
+ public boolean process(VirtualFile file, Collection<IntIdEquation> value) {
+ for (IntIdEquation intIdEquation : value) {
+ solver.addEquation(intIdEquation);
+ }
+ return true;
+ }
+ });
+ LOG.debug("contract equations are constructed");
+ LOG.debug("equations: " + solver.getSize());
+ TIntObjectHashMap<Value> solutions = solver.solve();
+ LOG.debug("contract equations are solved");
+ BytecodeAnalysisConverter.getInstance().addAnnotations(solutions, annotations);
+ }
+
+ @Nullable
+ public PsiAnnotation findInferredAnnotation(@NotNull PsiModifierListOwner listOwner, @NotNull String annotationFQN) {
+ if (!(listOwner instanceof PsiCompiledElement)) {
+ return null;
+ }
+ if (annotationFQN.equals("org.jetbrains.annotations.NotNull")) {
+ return findNotNullAnnotation(listOwner);
+ }
+ else if (annotationFQN.equals("org.jetbrains.annotations.Contract")) {
+ return findContractAnnotation(listOwner);
+ }
+ else {
+ return null;
+ }
+ }
+
+ @NotNull
+ public PsiAnnotation[] findInferredAnnotations(@NotNull PsiModifierListOwner listOwner) {
+ if (!(listOwner instanceof PsiCompiledElement)) {
+ return PsiAnnotation.EMPTY_ARRAY;
+ }
+ return collectInferredAnnotations(listOwner);
+ }
+
+ // TODO the best way to synchronize?
+ @NotNull
+ private synchronized PsiAnnotation[] collectInferredAnnotations(PsiModifierListOwner listOwner) {
+ if (myAnnotations == null) {
+ loadAnnotations();
+ }
+ try {
+ int key = getKey(listOwner);
+ if (key == -1) {
+ return PsiAnnotation.EMPTY_ARRAY;
+ }
+ boolean notNull = myAnnotations.notNulls.contains(key);
+ String contractValue = myAnnotations.contracts.get(key);
+
+ if (notNull && contractValue != null) {
+ return new PsiAnnotation[]{
+ getNotNullAnnotation(),
+ createAnnotationFromText("@" + ControlFlowAnalyzer.ORG_JETBRAINS_ANNOTATIONS_CONTRACT + "(" + contractValue + ")")
+ };
+ }
+ else if (notNull) {
+ return new PsiAnnotation[]{
+ getNotNullAnnotation()
+ };
+ }
+ else if (contractValue != null) {
+ return new PsiAnnotation[]{
+ createAnnotationFromText("@" + ControlFlowAnalyzer.ORG_JETBRAINS_ANNOTATIONS_CONTRACT + "(" + contractValue + ")")
+ };
+ }
+ else {
+ return PsiAnnotation.EMPTY_ARRAY;
+ }
+ }
+ catch (IOException e) {
+ LOG.debug(e);
+ return PsiAnnotation.EMPTY_ARRAY;
+ }
+ }
+
+ private PsiAnnotation getNotNullAnnotation() {
+ return CachedValuesManager.getManager(myProject).getCachedValue(myProject, new CachedValueProvider<PsiAnnotation>() {
+ @Nullable
+ @Override
+ public Result<PsiAnnotation> compute() {
+ return Result.create(createAnnotationFromText("@" + AnnotationUtil.NOT_NULL), ModificationTracker.NEVER_CHANGED);
+ }
+ });
+ }
+
+ @Nullable
+ private synchronized PsiAnnotation findNotNullAnnotation(PsiModifierListOwner listOwner) {
+ if (myAnnotations == null) {
+ loadAnnotations();
+ }
+ try {
+ int key = getKey(listOwner);
+ if (key == -1) {
+ return null;
+ }
+ return myAnnotations.notNulls.contains(key) ? getNotNullAnnotation() : null;
+ }
+ catch (IOException e) {
+ LOG.debug(e);
+ return null;
+ }
+ }
+
+ @Nullable
+ private synchronized PsiAnnotation findContractAnnotation(PsiModifierListOwner listOwner) {
+ if (myAnnotations == null) {
+ loadAnnotations();
+ }
+ try {
+ int key = getKey(listOwner);
+ if (key == -1) {
+ return null;
+ }
+ String contractValue = myAnnotations.contracts.get(key);
+ return contractValue != null ? createContractAnnotation(contractValue) : null;
+ }
+ catch (IOException e) {
+ LOG.debug(e);
+ return null;
+ }
+ }
+
+ public PsiAnnotation createContractAnnotation(String contractValue) {
+ return createAnnotationFromText("@org.jetbrains.annotations.Contract(" + contractValue + ")");
+ }
+
+ public static int getKey(@NotNull PsiModifierListOwner owner) throws IOException {
+ LOG.assertTrue(owner instanceof PsiCompiledElement, owner);
+
+ if (owner instanceof PsiMethod) {
+ return BytecodeAnalysisConverter.getInstance().mkPsiKey((PsiMethod)owner, new Out());
+ }
+
+ if (owner instanceof PsiParameter) {
+ PsiElement parent = owner.getParent();
+ if (parent instanceof PsiParameterList) {
+ PsiElement gParent = parent.getParent();
+ if (gParent instanceof PsiMethod) {
+ final int index = ((PsiParameterList)parent).getParameterIndex((PsiParameter)owner);
+ return BytecodeAnalysisConverter.getInstance().mkPsiKey((PsiMethod)gParent, new In(index));
+ }
+ }
+ }
+
+ return -1;
+ }
+
+ @NotNull
+ private PsiAnnotation createAnnotationFromText(@NotNull final String text) throws IncorrectOperationException {
+ PsiAnnotation annotation = JavaPsiFacade.getElementFactory(myProject).createAnnotationFromText(text, null);
+ annotation.putUserData(INFERRED_ANNOTATION, Boolean.TRUE);
+ return annotation;
+ }
+}
+
+class Annotations {
+ // @NotNull keys
+ final TIntHashSet notNulls = new TIntHashSet();
+ // @Contracts
+ final TIntObjectHashMap<String> contracts = new TIntObjectHashMap<String>();
+}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Solver.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Solver.java
new file mode 100644
index 0000000..47c9779
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Solver.java
@@ -0,0 +1,440 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import com.intellij.util.containers.IntStack;
+import com.intellij.util.containers.IntToIntSetMap;
+import gnu.trove.TIntObjectHashMap;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.*;
+
+final class ELattice<T extends Enum<T>> {
+ final T bot;
+ final T top;
+
+ ELattice(T bot, T top) {
+ this.bot = bot;
+ this.top = top;
+ }
+
+ final T join(T x, T y) {
+ if (x == bot) return y;
+ if (y == bot) return x;
+ if (x == y) return x;
+ return top;
+ }
+
+ final T meet(T x, T y) {
+ if (x == top) return y;
+ if (y == top) return x;
+ if (x == y) return x;
+ return bot;
+ }
+}
+
+// component specialized for ints
+final class IntIdComponent {
+ Value value;
+ final int[] ids;
+
+ IntIdComponent(Value value, int[] ids) {
+ this.value = value;
+ this.ids = ids;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ IntIdComponent that = (IntIdComponent)o;
+
+ if (!Arrays.equals(ids, that.ids)) return false;
+ if (value != that.value) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.ordinal() + Arrays.hashCode(ids);
+ }
+
+ public boolean remove(int id) {
+ return IdUtils.remove(ids, id);
+ }
+
+ public boolean isEmpty() {
+ return IdUtils.isEmpty(ids);
+ }
+
+ IntIdComponent copy() {
+ return new IntIdComponent(value, ids.clone());
+ }
+}
+
+class IdUtils {
+ // removed value
+ static final int nullId = 0;
+
+ static boolean contains(int[] ids, int id) {
+ for (int id1 : ids) {
+ if (id1 == id) return true;
+ }
+
+ return false;
+ }
+
+ static boolean isEmpty(int[] ids) {
+ for (int id : ids) {
+ if (id != nullId) return false;
+ }
+ return true;
+ }
+
+ static IntIdComponent[] toArray(Collection<IntIdComponent> set) {
+ IntIdComponent[] result = new IntIdComponent[set.size()];
+ int i = 0;
+ for (IntIdComponent intIdComponent : set) {
+ result[i] = intIdComponent;
+ i++;
+ }
+
+ return result;
+ }
+
+ static boolean remove(int[] ids, int id) {
+ boolean removed = false;
+ for (int i = 0; i < ids.length; i++) {
+ if (ids[i] == id) {
+ ids[i] = nullId;
+ removed = true;
+ }
+ }
+ return removed;
+ }
+}
+
+class ResultUtil<Id, T extends Enum<T>> {
+ private final ELattice<T> lattice;
+ final T top;
+ ResultUtil(ELattice<T> lattice) {
+ this.lattice = lattice;
+ top = lattice.top;
+ }
+
+ Result<Id, T> join(Result<Id, T> r1, Result<Id, T> r2) {
+ if (r1 instanceof Final && ((Final) r1).value == top) {
+ return r1;
+ }
+ if (r2 instanceof Final && ((Final) r2).value == top) {
+ return r2;
+ }
+ if (r1 instanceof Final && r2 instanceof Final) {
+ return new Final<Id, T>(lattice.join(((Final<?, T>) r1).value, ((Final<?, T>) r2).value));
+ }
+ if (r1 instanceof Final && r2 instanceof Pending) {
+ Final<?, T> f1 = (Final<?, T>)r1;
+ Pending<Id, T> pending = (Pending<Id, T>) r2;
+ Set<Product<Id, T>> sum1 = new HashSet<Product<Id, T>>(pending.sum);
+ sum1.add(new Product<Id, T>(f1.value, Collections.<Id>emptySet()));
+ return new Pending<Id, T>(sum1);
+ }
+ if (r1 instanceof Pending && r2 instanceof Final) {
+ Final<?, T> f2 = (Final<?, T>)r2;
+ Pending<Id, T> pending = (Pending<Id, T>) r1;
+ Set<Product<Id, T>> sum1 = new HashSet<Product<Id, T>>(pending.sum);
+ sum1.add(new Product<Id, T>(f2.value, Collections.<Id>emptySet()));
+ return new Pending<Id, T>(sum1);
+ }
+ Pending<Id, T> pending1 = (Pending<Id, T>) r1;
+ Pending<Id, T> pending2 = (Pending<Id, T>) r2;
+ Set<Product<Id, T>> sum = new HashSet<Product<Id, T>>();
+ sum.addAll(pending1.sum);
+ sum.addAll(pending2.sum);
+ return new Pending<Id, T>(sum);
+ }
+}
+
+final class Product<K, V> {
+ @NotNull final V value;
+ @NotNull final Set<K> ids;
+
+ Product(@NotNull V value, @NotNull Set<K> ids) {
+ this.value = value;
+ this.ids = ids;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Product product = (Product)o;
+
+ if (!ids.equals(product.ids)) return false;
+ if (!value.equals(product.value)) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = value.hashCode();
+ result = 31 * result + ids.hashCode();
+ return result;
+ }
+}
+
+interface Result<Id, T> {}
+final class Final<Id, T> implements Result<Id, T> {
+ final T value;
+ Final(T value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return "Final{" + "value=" + value + '}';
+ }
+}
+
+final class Pending<Id, T> implements Result<Id, T> {
+ final Set<Product<Id, T>> sum;
+
+ Pending(Set<Product<Id, T>> sum) {
+ this.sum = sum;
+ }
+
+}
+
+interface IntIdResult {}
+// this just wrapper, no need for this really
+final class IntIdFinal implements IntIdResult {
+ final Value value;
+ public IntIdFinal(Value value) {
+ this.value = value;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ IntIdFinal that = (IntIdFinal)o;
+
+ if (value != that.value) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.ordinal();
+ }
+
+ @Override
+ public String toString() {
+ return super.toString();
+ }
+}
+
+final class IntIdPending implements IntIdResult {
+ final IntIdComponent[] delta;
+
+ IntIdPending(IntIdComponent[] delta) {
+ this.delta = delta;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof IntIdPending)) return false;
+ IntIdPending pending = (IntIdPending)o;
+ return !Arrays.equals(delta, pending.delta);
+ }
+
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(delta);
+ }
+
+ IntIdPending copy() {
+ IntIdComponent[] delta1 = new IntIdComponent[delta.length];
+ for (int i = 0; i < delta.length; i++) {
+ delta1[i] = delta[i].copy();
+ }
+ return new IntIdPending(delta1);
+ }
+}
+
+final class IntIdEquation {
+ final int id;
+ final IntIdResult rhs;
+
+ IntIdEquation(int id, IntIdResult rhs) {
+ this.id = id;
+ this.rhs = rhs;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof IntIdEquation)) return false;
+
+ IntIdEquation equation = (IntIdEquation)o;
+
+ if (id != equation.id) return false;
+ if (!rhs.equals(equation.rhs)) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = id;
+ result = 31 * result + rhs.hashCode();
+ return result;
+ }
+}
+
+final class Solution<Id, Val> {
+ final Id id;
+ final Val value;
+
+ Solution(Id id, Val value) {
+ this.id = id;
+ this.value = value;
+ }
+}
+
+final class Equation<Id, T> {
+ final Id id;
+ final Result<Id, T> rhs;
+
+ Equation(Id id, Result<Id, T> rhs) {
+ this.id = id;
+ this.rhs = rhs;
+ }
+
+ @Override
+ public String toString() {
+ return "Equation{" + "id=" + id + ", rhs=" + rhs + '}';
+ }
+}
+
+final class IntIdSolver {
+
+ private int size = 0;
+ private final ELattice<Value> lattice;
+ private final IntToIntSetMap dependencies = new IntToIntSetMap(10000, 0.5f);
+ private final TIntObjectHashMap<IntIdPending> pending = new TIntObjectHashMap<IntIdPending>();
+ private final TIntObjectHashMap<Value> solved = new TIntObjectHashMap<Value>();
+ private final IntStack moving = new IntStack();
+
+ int getSize() {
+ return size;
+ }
+
+ IntIdSolver(ELattice<Value> lattice) {
+ this.lattice = lattice;
+ }
+
+ void addEquation(IntIdEquation equation) {
+ size ++;
+ IntIdResult rhs = equation.rhs;
+ if (rhs instanceof IntIdFinal) {
+ solved.put(equation.id, ((IntIdFinal) rhs).value);
+ moving.push(equation.id);
+ } else if (rhs instanceof IntIdPending) {
+ IntIdPending pendResult = ((IntIdPending)rhs).copy();
+ IntIdResult norm = normalize(pendResult.delta);
+ if (norm instanceof IntIdFinal) {
+ solved.put(equation.id, ((IntIdFinal) norm).value);
+ moving.push(equation.id);
+ }
+ else {
+ IntIdPending pendResult1 = ((IntIdPending)rhs).copy();
+ for (IntIdComponent component : pendResult1.delta) {
+ for (int trigger : component.ids) {
+ dependencies.addOccurence(trigger, equation.id);
+ }
+ pending.put(equation.id, pendResult1);
+ }
+ }
+ }
+ }
+
+ TIntObjectHashMap<Value> solve() {
+ while (!moving.empty()) {
+ int id = moving.pop();
+ Value value = solved.get(id);
+
+ boolean stable = id > 0;
+ int[] pIds = stable ? new int[]{id, -id} : new int[]{-id, id};
+ Value[] pVals = stable ? new Value[]{value, value} : new Value[]{value, lattice.top};
+
+ for (int i = 0; i < pIds.length; i++) {
+ int pId = pIds[i];
+ Value pVal = pVals[i];
+ // todo - remove
+ int[] dIds = dependencies.get(pId);
+ for (int dId : dIds) {
+ IntIdPending pend = pending.remove(dId);
+ if (pend != null) {
+ IntIdResult pend1 = substitute(pend, pId, pVal);
+ if (pend1 instanceof IntIdFinal) {
+ IntIdFinal fi = (IntIdFinal)pend1;
+ solved.put(dId, fi.value);
+ moving.push(dId);
+ }
+ else {
+ pending.put(dId, (IntIdPending)pend1);
+ }
+ }
+ }
+ }
+ }
+ pending.clear();
+ return solved;
+ }
+
+ // substitute id -> value into pending
+ IntIdResult substitute(IntIdPending pending, int id, Value value) {
+ IntIdComponent[] sum = pending.delta;
+ for (IntIdComponent intIdComponent : sum) {
+ if (intIdComponent.remove(id)) {
+ intIdComponent.value = lattice.meet(intIdComponent.value, value);
+ }
+ }
+ return normalize(sum);
+ }
+
+ IntIdResult normalize(IntIdComponent[] sum) {
+ Value acc = lattice.bot;
+ boolean computableNow = true;
+ for (IntIdComponent prod : sum) {
+ if (prod.isEmpty() || prod.value == lattice.bot) {
+ acc = lattice.join(acc, prod.value);
+ } else {
+ computableNow = false;
+ }
+ }
+ return (acc == lattice.top || computableNow) ? new IntIdFinal(acc) : new IntIdPending(sum);
+ }
+
+}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ContractInference.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ContractInference.java
index 534d65b..a1c9088 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ContractInference.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ContractInference.java
@@ -15,6 +15,7 @@
*/
package com.intellij.codeInspection.dataFlow;
+import com.intellij.codeInsight.NullableNotNullManager;
import com.intellij.codeInspection.dataFlow.MethodContract.ValueConstraint;
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.util.Condition;
@@ -41,6 +42,10 @@
@NotNull
public static List<MethodContract> inferContracts(@NotNull final PsiMethod method) {
+ if (method instanceof PsiCompiledElement) {
+ return Collections.emptyList();
+ }
+
return CachedValuesManager.getCachedValue(method, new CachedValueProvider<List<MethodContract>>() {
@Nullable
@Override
@@ -70,7 +75,12 @@
}
else if (statements[0] instanceof PsiExpressionStatement && ((PsiExpressionStatement)statements[0]).getExpression() instanceof PsiMethodCallExpression) {
List<MethodContract> result = handleDelegation(((PsiExpressionStatement)statements[0]).getExpression(), false);
- if (result != null) return result;
+ if (result != null) return ContainerUtil.findAll(result, new Condition<MethodContract>() {
+ @Override
+ public boolean value(MethodContract contract) {
+ return contract.returnValue == THROW_EXCEPTION || !textMatches(myMethod.getReturnTypeElement(), PsiKeyword.VOID);
+ }
+ });
}
}
@@ -103,7 +113,7 @@
return RecursionManager.doPreventingRecursion(myMethod, true, new Computable<List<MethodContract>>() {
@Override
public List<MethodContract> compute() {
- List<MethodContract> delegateContracts = ContractInference.inferContracts(targetMethod); //todo use explicit contracts, too
+ List<MethodContract> delegateContracts = ControlFlowAnalyzer.getMethodContracts(targetMethod);
return ContainerUtil.mapNotNull(delegateContracts, new NullableFunction<MethodContract, MethodContract>() {
@Nullable
@Override
@@ -125,7 +135,7 @@
}
}
}
- return new MethodContract(answer, negated ? negateConstraint(delegateContract.returnValue) : delegateContract.returnValue);
+ return answer == null ? null : new MethodContract(answer, negated ? negateConstraint(delegateContract.returnValue) : delegateContract.returnValue);
}
});
}
@@ -173,10 +183,12 @@
if (expr instanceof PsiInstanceOfExpression) {
final int parameter = resolveParameter(((PsiInstanceOfExpression)expr).getOperand());
if (parameter >= 0) {
- return ContainerUtil.map(states, new Function<ValueConstraint[], MethodContract>() {
+ return ContainerUtil.mapNotNull(states, new Function<ValueConstraint[], MethodContract>() {
@Override
public MethodContract fun(ValueConstraint[] state) {
- return new MethodContract(withConstraint(state, parameter, NULL_VALUE), FALSE_VALUE);
+ ValueConstraint paramConstraint = NULL_VALUE;
+ ValueConstraint returnValue = FALSE_VALUE;
+ return contractWithConstraint(state, parameter, paramConstraint, returnValue);
}
});
}
@@ -187,17 +199,17 @@
return toContracts(states, constraint);
}
- int parameter = resolveParameter(expr);
- if (parameter >= 0) {
+ int paramIndex = resolveParameter(expr);
+ if (paramIndex >= 0) {
List<MethodContract> result = ContainerUtil.newArrayList();
for (ValueConstraint[] state : states) {
- if (state[parameter] != ANY_VALUE) {
+ if (state[paramIndex] != ANY_VALUE) {
// the second 'o' reference in cases like: if (o != null) return o;
- result.add(new MethodContract(state, state[parameter]));
- } else {
+ result.add(new MethodContract(state, state[paramIndex]));
+ } else if (textMatches(myMethod.getParameterList().getParameters()[paramIndex].getTypeElement(), PsiKeyword.BOOLEAN)) {
// if (boolValue) ...
- result.add(new MethodContract(withConstraint(state, parameter, TRUE_VALUE), TRUE_VALUE));
- result.add(new MethodContract(withConstraint(state, parameter, FALSE_VALUE), FALSE_VALUE));
+ ContainerUtil.addIfNotNull(result, contractWithConstraint(state, paramIndex, TRUE_VALUE, TRUE_VALUE));
+ ContainerUtil.addIfNotNull(result, contractWithConstraint(state, paramIndex, FALSE_VALUE, FALSE_VALUE));
}
}
return result;
@@ -206,6 +218,18 @@
return Collections.emptyList();
}
+ @Nullable
+ private MethodContract contractWithConstraint(ValueConstraint[] state,
+ int parameter, ValueConstraint paramConstraint,
+ ValueConstraint returnValue) {
+ ValueConstraint[] newState = withConstraint(state, parameter, paramConstraint);
+ return newState == null ? null : new MethodContract(newState, returnValue);
+ }
+
+ private static boolean textMatches(@Nullable PsiTypeElement typeElement, @NotNull String text) {
+ return typeElement != null && typeElement.textMatches(text);
+ }
+
private List<MethodContract> visitEqualityComparison(List<ValueConstraint[]> states,
PsiExpression op1,
PsiExpression op2,
@@ -219,8 +243,9 @@
if (parameter >= 0 && constraint != null) {
List<MethodContract> result = ContainerUtil.newArrayList();
for (ValueConstraint[] state : states) {
- result.add(new MethodContract(withConstraint(state, parameter, constraint), equality ? TRUE_VALUE : FALSE_VALUE));
- result.add(new MethodContract(withConstraint(state, parameter, negateConstraint(constraint)), equality ? FALSE_VALUE : TRUE_VALUE));
+ ContainerUtil.addIfNotNull(result, contractWithConstraint(state, parameter, constraint, equality ? TRUE_VALUE : FALSE_VALUE));
+ ContainerUtil.addIfNotNull(result, contractWithConstraint(state, parameter, negateConstraint(constraint),
+ equality ? FALSE_VALUE : TRUE_VALUE));
}
return result;
}
@@ -295,7 +320,15 @@
result.addAll(toContracts(states, THROW_EXCEPTION));
}
else if (statement instanceof PsiReturnStatement) {
- result.addAll(visitExpression(states, ((PsiReturnStatement)statement).getReturnValue()));
+ List<MethodContract> contracts = visitExpression(states, ((PsiReturnStatement)statement).getReturnValue());
+ for (MethodContract contract : contracts) {
+ if ((contract.returnValue == TRUE_VALUE || contract.returnValue == FALSE_VALUE) &&
+ !textMatches(myMethod.getReturnTypeElement(), PsiKeyword.BOOLEAN)) {
+ continue;
+ }
+
+ result.add(contract);
+ }
}
else if (statement instanceof PsiAssertStatement) {
List<MethodContract> conditionResults = visitExpression(states, ((PsiAssertStatement)statement).getAssertCondition());
@@ -357,7 +390,19 @@
return -1;
}
- private static ValueConstraint[] withConstraint(ValueConstraint[] constraints, int index, ValueConstraint constraint) {
+ @Nullable
+ private ValueConstraint[] withConstraint(ValueConstraint[] constraints, int index, ValueConstraint constraint) {
+ if (constraints[index] == constraint) return constraints;
+
+ ValueConstraint negated = negateConstraint(constraint);
+ if (negated != constraint && constraints[index] == negated) {
+ return null;
+ }
+
+ if (constraint == NULL_VALUE && NullableNotNullManager.isNotNull(myMethod.getParameterList().getParameters()[index])) {
+ return null;
+ }
+
ValueConstraint[] copy = constraints.clone();
copy[index] = constraint;
return copy;
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java
index 65e7fd7..7ef19f2 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java
@@ -20,7 +20,6 @@
import com.intellij.codeInspection.dataFlow.value.*;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Condition;
-import com.intellij.openapi.util.registry.Registry;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.tree.IElementType;
@@ -30,37 +29,15 @@
import com.intellij.util.containers.Stack;
import com.siyeh.ig.numeric.UnnecessaryExplicitNumericCastInspection;
import org.jetbrains.annotations.Contract;
-import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
-import java.util.regex.Pattern;
-import static com.intellij.codeInspection.dataFlow.MethodContract.ValueConstraint;
import static com.intellij.psi.CommonClassNames.*;
public class ControlFlowAnalyzer extends JavaElementVisitor {
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.dataFlow.ControlFlowAnalyzer");
- private static final Condition<String> FALSE_GETTERS = parseFalseGetters();
-
- private static Condition<String> parseFalseGetters() {
- try {
- final Pattern pattern = Pattern.compile(Registry.stringValue("ide.dfa.getters.with.side.effects"));
- return new Condition<String>() {
- @Override
- public boolean value(String s) {
- return pattern.matcher(s).matches();
- }
- };
- }
- catch (Exception e) {
- LOG.error(e);
- //noinspection unchecked
- return Condition.FALSE;
- }
- }
-
public static final String ORG_JETBRAINS_ANNOTATIONS_CONTRACT = Contract.class.getName();
private boolean myIgnoreAssertions;
@@ -209,9 +186,23 @@
}
addInstruction(new AssignInstruction(rExpr));
+
+ flushArrayElementsOnUnknownIndexAssignment(lExpr);
+
finishElement(expression);
}
+ private void flushArrayElementsOnUnknownIndexAssignment(PsiExpression lExpr) {
+ if (lExpr instanceof PsiArrayAccessExpression &&
+ myFactory.createValue(lExpr) == null // check for unknown index, otherwise AssignInstruction will flush only that element
+ ) {
+ DfaValue arrayVar = myFactory.createValue(((PsiArrayAccessExpression)lExpr).getArrayExpression());
+ if (arrayVar instanceof DfaVariableValue) {
+ addInstruction(new FlushVariableInstruction((DfaVariableValue)arrayVar));
+ }
+ }
+ }
+
private void generateDefaultAssignmentBinOp(PsiExpression lExpr, PsiExpression rExpr, final PsiType exprType) {
lExpr.accept(this);
addInstruction(new DupInstruction());
@@ -635,7 +626,7 @@
((PsiReferenceExpression)caseExpression).getQualifierExpression() == null &&
JavaPsiFacade.getInstance(body.getProject()).getConstantEvaluationHelper().computeConstantExpression(caseValue) != null) {
- addInstruction(new PushInstruction(getExpressionDfaValue((PsiReferenceExpression)caseExpression), caseExpression));
+ addInstruction(new PushInstruction(myFactory.createValue(caseExpression), caseExpression));
caseValue.accept(this);
addInstruction(new BinopInstruction(JavaTokenType.EQEQ, null, caseExpression.getProject()));
}
@@ -1030,7 +1021,8 @@
addInstruction(new PopInstruction());
}
- pushTypeOrUnknown(arrayExpression);
+ DfaValue toPush = myFactory.createValue(expression);
+ addInstruction(new PushInstruction(toPush != null ? toPush : myFactory.createTypeValue(expression.getType(), Nullness.UNKNOWN), null));
finishElement(expression);
}
@@ -1396,8 +1388,8 @@
}
addConditionalRuntimeThrow();
- List<MethodContract> contracts = method instanceof PsiMethod ? getMethodContracts((PsiMethod)method) : Collections.<MethodContract>emptyList();
- addInstruction(new MethodCallInstruction(expression, createChainedVariableValue(expression), contracts));
+ List<MethodContract> contracts = method instanceof PsiMethod ? getMethodCallContracts((PsiMethod)method, expression) : Collections.<MethodContract>emptyList();
+ addInstruction(new MethodCallInstruction(expression, myFactory.createValue(expression), contracts));
if (!contracts.isEmpty()) {
// if a contract resulted in 'fail', handle it
addInstruction(new DupInstruction());
@@ -1431,6 +1423,11 @@
finishElement(expression);
}
+ private static List<MethodContract> getMethodCallContracts(@NotNull final PsiMethod method, @NotNull PsiMethodCallExpression call) {
+ List<MethodContract> contracts = HardcodedContracts.getHardcodedContracts(method, call);
+ return !contracts.isEmpty() ? contracts : getMethodContracts(method);
+ }
+
static List<MethodContract> getMethodContracts(@NotNull final PsiMethod method) {
final PsiAnnotation contractAnno = findContractAnnotation(method);
final int paramCount = method.getParameterList().getParametersCount();
@@ -1458,45 +1455,6 @@
});
}
- @NonNls String methodName = method.getName();
-
- PsiClass owner = method.getContainingClass();
- if (owner != null) {
- final String className = owner.getQualifiedName();
- if ("java.lang.System".equals(className)) {
- if ("exit".equals(methodName)) {
- return Collections.singletonList(new MethodContract(MethodContract.createConstraintArray(paramCount), ValueConstraint.THROW_EXCEPTION));
- }
- }
- else if ("junit.framework.Assert".equals(className) || "org.junit.Assert".equals(className) ||
- "junit.framework.TestCase".equals(className) || "org.testng.Assert".equals(className) || "org.testng.AssertJUnit".equals(className)) {
- boolean testng = className.startsWith("org.testng.");
- if ("fail".equals(methodName)) {
- return Collections.singletonList(new MethodContract(MethodContract.createConstraintArray(paramCount), ValueConstraint.THROW_EXCEPTION));
- }
-
- int checkedParam = testng ? 0 : paramCount - 1;
- ValueConstraint[] constraints = MethodContract.createConstraintArray(paramCount);
- if ("assertTrue".equals(methodName)) {
- constraints[checkedParam] = ValueConstraint.FALSE_VALUE;
- return Collections.singletonList(new MethodContract(constraints, ValueConstraint.THROW_EXCEPTION));
- }
- if ("assertFalse".equals(methodName)) {
- constraints[checkedParam] = ValueConstraint.TRUE_VALUE;
- return Collections.singletonList(new MethodContract(constraints, ValueConstraint.THROW_EXCEPTION));
- }
- if ("assertNull".equals(methodName)) {
- constraints[checkedParam] = ValueConstraint.NOT_NULL_VALUE;
- return Collections.singletonList(new MethodContract(constraints, ValueConstraint.THROW_EXCEPTION));
- }
- if ("assertNotNull".equals(methodName)) {
- constraints[checkedParam] = ValueConstraint.NULL_VALUE;
- return Collections.singletonList(new MethodContract(constraints, ValueConstraint.THROW_EXCEPTION));
- }
- return Collections.emptyList();
- }
- }
-
return Collections.emptyList();
}
@@ -1505,20 +1463,6 @@
return AnnotationUtil.findAnnotation(method, ORG_JETBRAINS_ANNOTATIONS_CONTRACT);
}
- private void pushTypeOrUnknown(PsiExpression expr) {
- PsiType type = expr.getType();
-
- final DfaValue dfaValue;
- if (type instanceof PsiClassType) {
- dfaValue = myFactory.createTypeValue(type, Nullness.UNKNOWN);
- }
- else {
- dfaValue = null;
- }
-
- addInstruction(new PushInstruction(dfaValue, null));
- }
-
@Override public void visitNewExpression(PsiNewExpression expression) {
startElement(expression);
@@ -1657,88 +1601,11 @@
}
boolean referenceRead = PsiUtil.isAccessedForReading(expression) && !PsiUtil.isAccessedForWriting(expression);
- addInstruction(new PushInstruction(getExpressionDfaValue(expression), expression, referenceRead));
+ addInstruction(new PushInstruction(myFactory.createValue(expression), expression, referenceRead));
finishElement(expression);
}
- @Nullable
- private DfaValue getExpressionDfaValue(PsiReferenceExpression expression) {
- DfaValue dfaValue = myFactory.createReferenceValue(expression);
- if (dfaValue == null) {
- PsiElement resolved = expression.resolve();
- if (resolved instanceof PsiField) {
- dfaValue = createDfaValueForAnotherInstanceMemberAccess(expression, (PsiField)resolved);
- }
- }
- return dfaValue;
- }
-
- @NotNull
- private DfaValue createDfaValueForAnotherInstanceMemberAccess(PsiReferenceExpression expression, PsiField field) {
- DfaValue dfaValue = null;
- if (expression.getQualifierExpression() != null) {
- dfaValue = createChainedVariableValue(expression);
- }
- if (dfaValue == null) {
- PsiType type = expression.getType();
- return myFactory.createTypeValue(type, DfaPsiUtil.getElementNullability(type, field));
- }
- return dfaValue;
- }
-
- @Nullable
- private DfaVariableValue createChainedVariableValue(@Nullable PsiExpression expression) {
- if (expression instanceof PsiParenthesizedExpression) {
- return createChainedVariableValue(((PsiParenthesizedExpression)expression).getExpression());
- }
-
- PsiReferenceExpression refExpr;
- if (expression instanceof PsiMethodCallExpression) {
- refExpr = ((PsiMethodCallExpression)expression).getMethodExpression();
- }
- else if (expression instanceof PsiReferenceExpression) {
- refExpr = (PsiReferenceExpression)expression;
- }
- else {
- return null;
- }
-
- PsiElement target = refExpr.resolve();
- PsiModifierListOwner var = getAccessedVariable(target);
- if (var == null) {
- return null;
- }
-
- if (DfaValueFactory.isEffectivelyUnqualified(refExpr)) {
- return myFactory.getVarFactory().createVariableValue(var, refExpr.getType(), false, null);
- }
-
- if (!(var instanceof PsiField) || !var.hasModifierProperty(PsiModifier.TRANSIENT) && !var.hasModifierProperty(PsiModifier.VOLATILE)) {
- DfaVariableValue qualifierValue = createChainedVariableValue(refExpr.getQualifierExpression());
- if (qualifierValue != null) {
- return myFactory.getVarFactory().createVariableValue(var, refExpr.getType(), false, qualifierValue);
- }
- }
- return null;
- }
-
- @Nullable
- private static PsiModifierListOwner getAccessedVariable(final PsiElement target) {
- if (target instanceof PsiVariable) {
- return (PsiVariable)target;
- }
- if (target instanceof PsiMethod) {
- if (PropertyUtil.isSimplePropertyGetter((PsiMethod)target)) {
- String qName = PsiUtil.getMemberQualifiedName((PsiMethod)target);
- if (qName == null || !FALSE_GETTERS.value(qName)) {
- return (PsiMethod)target;
- }
- }
- }
- return null;
- }
-
@Override public void visitSuperExpression(PsiSuperExpression expression) {
startElement(expression);
addInstruction(new PushInstruction(myFactory.createTypeValue(expression.getType(), Nullness.NOT_NULL), null));
@@ -1769,7 +1636,7 @@
generateBoxingUnboxingInstructionFor(operand, castExpression.getType());
}
else {
- pushTypeOrUnknown(castExpression);
+ addInstruction(new PushInstruction(myFactory.createTypeValue(castExpression.getType(), Nullness.UNKNOWN), null));
}
final PsiTypeElement typeElement = castExpression.getCastType();
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java
index 3e017e0..d66d63b 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java
@@ -32,7 +32,8 @@
import com.intellij.codeInsight.intention.impl.AddNullableAnnotationFix;
import com.intellij.codeInspection.*;
import com.intellij.codeInspection.dataFlow.instructions.*;
-import com.intellij.codeInspection.dataFlow.value.*;
+import com.intellij.codeInspection.dataFlow.value.DfaConstValue;
+import com.intellij.codeInspection.dataFlow.value.DfaValue;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Condition;
@@ -41,9 +42,9 @@
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.*;
-import com.intellij.psi.codeStyle.JavaCodeStyleManager;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
+import com.intellij.refactoring.extractMethod.ExtractMethodUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ArrayUtilRt;
import com.intellij.util.IncorrectOperationException;
@@ -106,7 +107,6 @@
public void visitIfStatement(PsiIfStatement statement) {
PsiExpression condition = statement.getCondition();
if (BranchingInstruction.isBoolConst(condition)) {
- assert condition != null;
LocalQuickFix fix = createSimplifyBooleanExpressionFix(condition, condition.textMatches(PsiKeyword.TRUE));
holder.registerProblem(condition, "Condition is always " + condition.getText(), fix);
}
@@ -253,7 +253,7 @@
final Object value = pair.second.getValue();
PsiVariable constant = pair.second.getConstant();
final String presentableName = constant != null ? constant.getName() : String.valueOf(value);
- final String exprText = getConstantValueText(value, constant);
+ final String exprText = String.valueOf(value);
if (presentableName == null || exprText == null) {
continue;
}
@@ -280,31 +280,23 @@
PsiElement problemElement = descriptor.getPsiElement();
if (problemElement == null) return;
+ PsiMethodCallExpression call = problemElement.getParent() instanceof PsiExpressionList &&
+ problemElement.getParent().getParent() instanceof PsiMethodCallExpression ?
+ (PsiMethodCallExpression)problemElement.getParent().getParent() :
+ null;
+ PsiMethod targetMethod = call == null ? null : call.resolveMethod();
+
JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
- PsiElement newElement = problemElement.replace(facade.getElementFactory().createExpressionFromText(exprText, null));
- newElement = JavaCodeStyleManager.getInstance(project).shortenClassReferences(newElement);
- if (newElement instanceof PsiJavaCodeReferenceElement) {
- PsiJavaCodeReferenceElement ref = (PsiJavaCodeReferenceElement)newElement;
- PsiElement target = ref.resolve();
- String shortName = ref.getReferenceName();
- if (target != null && shortName != null && ref.isQualified() &&
- facade.getResolveHelper().resolveReferencedVariable(shortName, newElement) == target) {
- newElement.replace(facade.getElementFactory().createExpressionFromText(shortName, null));
- }
+ problemElement.replace(facade.getElementFactory().createExpressionFromText(exprText, null));
+
+ if (targetMethod != null) {
+ ExtractMethodUtil.addCastsToEnsureResolveTarget(targetMethod, call);
}
}
});
}
}
- private static String getConstantValueText(Object value, @Nullable PsiVariable constant) {
- if (constant != null) {
- return constant instanceof PsiMember ? PsiUtil.getMemberQualifiedName((PsiMember)constant) : constant.getName();
- }
-
- return value instanceof String ? "\"" + StringUtil.escapeStringCharacters((String)value) + "\"" : String.valueOf(value);
- }
-
private void reportNullableArgumentsPassedToNonAnnotated(DataFlowInstructionVisitor visitor, ProblemsHolder holder, Set<PsiElement> reportedAnchors) {
for (PsiElement expr : visitor.getProblems(NullabilityProblem.passingNullableArgumentToNonAnnotatedParameter)) {
if (reportedAnchors.contains(expr)) continue;
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaPsiUtil.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaPsiUtil.java
index e6c278e..4dd2ac2 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaPsiUtil.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaPsiUtil.java
@@ -17,16 +17,15 @@
import com.intellij.codeInsight.NullableNotNullManager;
import com.intellij.codeInspection.dataFlow.instructions.Instruction;
+import com.intellij.codeInspection.dataFlow.instructions.MethodCallInstruction;
import com.intellij.codeInspection.dataFlow.instructions.ReturnInstruction;
+import com.intellij.codeInspection.dataFlow.value.DfaValueFactory;
import com.intellij.openapi.util.Ref;
import com.intellij.psi.*;
import com.intellij.psi.search.LocalSearchScope;
import com.intellij.psi.search.searches.ReferencesSearch;
import com.intellij.psi.tree.IElementType;
-import com.intellij.psi.util.CachedValueProvider;
-import com.intellij.psi.util.CachedValuesManager;
-import com.intellij.psi.util.PsiModificationTracker;
-import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.util.*;
import com.intellij.util.NullableFunction;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.MultiMap;
@@ -126,11 +125,36 @@
shouldCheck = psiBlock == body;
}
+ private boolean isCallExposingNonInitializedFields(Instruction instruction) {
+ if (!(instruction instanceof MethodCallInstruction) ||
+ ((MethodCallInstruction)instruction).getMethodType() != MethodCallInstruction.MethodType.REGULAR_METHOD_CALL) {
+ return false;
+ }
+
+ PsiCallExpression call = ((MethodCallInstruction)instruction).getCallExpression();
+ if (call == null) return false;
+
+ if (call instanceof PsiMethodCallExpression &&
+ DfaValueFactory.isEffectivelyUnqualified(((PsiMethodCallExpression)call).getMethodExpression())) {
+ return true;
+ }
+
+ PsiExpressionList argumentList = call.getArgumentList();
+ if (argumentList != null) {
+ for (PsiExpression expression : argumentList.getExpressions()) {
+ if (expression instanceof PsiThisExpression) return true;
+ }
+ }
+
+ return false;
+ }
+
@Override
protected DfaInstructionState[] acceptInstruction(InstructionVisitor visitor, DfaInstructionState instructionState) {
if (shouldCheck) {
Instruction instruction = instructionState.getInstruction();
- if (instruction instanceof ReturnInstruction && !((ReturnInstruction)instruction).isViaException()) {
+ if (isCallExposingNonInitializedFields(instruction) ||
+ instruction instanceof ReturnInstruction && !((ReturnInstruction)instruction).isViaException()) {
for (PsiField field : containingClass.getFields()) {
if (!instructionState.getMemoryState().isNotNull(getFactory().getVarFactory().createVariableValue(field, false))) {
map.put(field, false);
@@ -138,6 +162,7 @@
map.put(field, true);
}
}
+ return DfaInstructionState.EMPTY_ARRAY;
}
}
return super.acceptInstruction(visitor, instructionState);
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/HardcodedContracts.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/HardcodedContracts.java
new file mode 100644
index 0000000..7e77dc2
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/HardcodedContracts.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.dataFlow;
+
+import com.intellij.psi.*;
+import com.siyeh.ig.psiutils.ExpressionUtils;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Collections;
+import java.util.List;
+
+import static com.intellij.codeInspection.dataFlow.MethodContract.ValueConstraint.*;
+import static com.intellij.codeInspection.dataFlow.MethodContract.createConstraintArray;
+
+/**
+ * @author peter
+ */
+class HardcodedContracts {
+ static List<MethodContract> getHardcodedContracts(@NotNull PsiMethod method, @NotNull PsiMethodCallExpression call) {
+ PsiClass owner = method.getContainingClass();
+ if (owner == null) return Collections.emptyList();
+
+ final int paramCount = method.getParameterList().getParametersCount();
+ String className = owner.getQualifiedName();
+ String methodName = method.getName();
+
+ if ("java.lang.System".equals(className)) {
+ if ("exit".equals(methodName)) {
+ return Collections.singletonList(new MethodContract(createConstraintArray(paramCount), THROW_EXCEPTION));
+ }
+ }
+ else if ("com.google.common.base.Preconditions".equals(className)) {
+ if ("checkNotNull".equals(methodName) && paramCount > 0) {
+ MethodContract.ValueConstraint[] constraints = createConstraintArray(paramCount);
+ constraints[0] = NULL_VALUE;
+ return Collections.singletonList(new MethodContract(constraints, THROW_EXCEPTION));
+ }
+ }
+ else if ("junit.framework.Assert".equals(className) ||
+ "org.junit.Assert".equals(className) ||
+ "junit.framework.TestCase".equals(className) ||
+ "org.testng.Assert".equals(className) ||
+ "org.testng.AssertJUnit".equals(className)) {
+ return handleTestFrameworks(paramCount, className, methodName, call);
+ }
+
+ return Collections.emptyList();
+ }
+
+ private static boolean isNotNullMatcher(PsiExpression expr) {
+ if (expr instanceof PsiMethodCallExpression) {
+ String calledName = ((PsiMethodCallExpression)expr).getMethodExpression().getReferenceName();
+ if ("notNullValue".equals(calledName)) {
+ return true;
+ }
+ if ("not".equals(calledName)) {
+ PsiExpression[] notArgs = ((PsiMethodCallExpression)expr).getArgumentList().getExpressions();
+ if (notArgs.length == 1 &&
+ notArgs[0] instanceof PsiMethodCallExpression &&
+ "equalTo".equals(((PsiMethodCallExpression)notArgs[0]).getMethodExpression().getReferenceName())) {
+ PsiExpression[] equalArgs = ((PsiMethodCallExpression)notArgs[0]).getArgumentList().getExpressions();
+ if (equalArgs.length == 1 && ExpressionUtils.isNullLiteral(equalArgs[0])) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private static List<MethodContract> handleTestFrameworks(int paramCount, String className, String methodName,
+ @NotNull PsiMethodCallExpression call) {
+ if ("assertThat".equals(methodName)) {
+ PsiExpression[] args = call.getArgumentList().getExpressions();
+ if (args.length == paramCount) {
+ for (int i = 1; i < args.length; i++) {
+ if (isNotNullMatcher(args[i])) {
+ MethodContract.ValueConstraint[] constraints = createConstraintArray(args.length);
+ constraints[i - 1] = NULL_VALUE;
+ return Collections.singletonList(new MethodContract(constraints, THROW_EXCEPTION));
+ }
+ }
+ }
+ return Collections.emptyList();
+ }
+
+ if (!"junit.framework.Assert".equals(className) &&
+ !"junit.framework.TestCase".equals(className) &&
+ !"org.junit.Assert".equals(className) &&
+ !"org.testng.Assert".equals(className) &&
+ !"org.testng.AssertJUnit".equals(className)) {
+ return Collections.emptyList();
+ }
+
+ boolean testng = className.startsWith("org.testng.");
+ if ("fail".equals(methodName)) {
+ return Collections.singletonList(new MethodContract(createConstraintArray(paramCount), THROW_EXCEPTION));
+ }
+
+ int checkedParam = testng ? 0 : paramCount - 1;
+ MethodContract.ValueConstraint[] constraints = createConstraintArray(paramCount);
+ if ("assertTrue".equals(methodName)) {
+ constraints[checkedParam] = FALSE_VALUE;
+ return Collections.singletonList(new MethodContract(constraints, THROW_EXCEPTION));
+ }
+ if ("assertFalse".equals(methodName)) {
+ constraints[checkedParam] = TRUE_VALUE;
+ return Collections.singletonList(new MethodContract(constraints, THROW_EXCEPTION));
+ }
+ if ("assertNull".equals(methodName)) {
+ constraints[checkedParam] = NOT_NULL_VALUE;
+ return Collections.singletonList(new MethodContract(constraints, THROW_EXCEPTION));
+ }
+ if ("assertNotNull".equals(methodName)) {
+ constraints[checkedParam] = NULL_VALUE;
+ return Collections.singletonList(new MethodContract(constraints, THROW_EXCEPTION));
+ }
+ return Collections.emptyList();
+ }
+}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/MethodContract.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/MethodContract.java
index 160f69b..691c2f00 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/MethodContract.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/MethodContract.java
@@ -20,6 +20,7 @@
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
@@ -31,7 +32,7 @@
public final ValueConstraint[] arguments;
public final ValueConstraint returnValue;
- public MethodContract(ValueConstraint[] arguments, ValueConstraint returnValue) {
+ public MethodContract(@NotNull ValueConstraint[] arguments, @NotNull ValueConstraint returnValue) {
this.arguments = arguments;
this.returnValue = returnValue;
}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/StandardInstructionVisitor.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/StandardInstructionVisitor.java
index 522bd34..013e24c 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/StandardInstructionVisitor.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/StandardInstructionVisitor.java
@@ -455,10 +455,10 @@
DfaValue dfaRight,
DfaValue dfaLeft, IElementType opSign) {
if (dfaRight instanceof DfaConstValue && dfaLeft instanceof DfaVariableValue) {
- PsiType varType = ((DfaVariableValue)dfaLeft).getVariableType();
Object value = ((DfaConstValue)dfaRight).getValue();
- if (varType instanceof PsiPrimitiveType && value instanceof Number) {
- DfaInstructionState[] result = checkTypeRanges(instruction, runner, memState, opSign, varType, ((Number)value).longValue());
+ if (value instanceof Number) {
+ DfaInstructionState[] result = checkComparingWithConstant(instruction, runner, memState, (DfaVariableValue)dfaLeft, opSign,
+ ((Number)value).doubleValue());
if (result != null) {
return result;
}
@@ -485,33 +485,60 @@
return null;
}
- private static DfaInstructionState[] checkTypeRanges(BinopInstruction instruction,
- DataFlowRunner runner,
- DfaMemoryState memState,
- IElementType opSign, PsiType varType, long constantValue) {
- long minValue = varType == PsiType.BYTE ? Byte.MIN_VALUE :
- varType == PsiType.SHORT ? Short.MIN_VALUE :
- varType == PsiType.INT ? Integer.MIN_VALUE :
- varType == PsiType.CHAR ? Character.MIN_VALUE :
- Long.MIN_VALUE;
- long maxValue = varType == PsiType.BYTE ? Byte.MAX_VALUE :
- varType == PsiType.SHORT ? Short.MAX_VALUE :
- varType == PsiType.INT ? Integer.MAX_VALUE :
- varType == PsiType.CHAR ? Character.MAX_VALUE :
- Long.MAX_VALUE;
+ @Nullable
+ private static DfaInstructionState[] checkComparingWithConstant(BinopInstruction instruction,
+ DataFlowRunner runner,
+ DfaMemoryState memState,
+ DfaVariableValue var,
+ IElementType opSign, double comparedWith) {
+ DfaConstValue knownConstantValue = memState.getConstantValue(var);
+ Object knownValue = knownConstantValue == null ? null : knownConstantValue.getValue();
+ if (knownValue instanceof Number) {
+ double knownDouble = ((Number)knownValue).doubleValue();
+ return checkComparisonWithKnownRange(instruction, runner, memState, opSign, comparedWith, knownDouble, knownDouble);
+ }
- if (constantValue < minValue || constantValue > maxValue) {
+ PsiType varType = var.getVariableType();
+ if (!(varType instanceof PsiPrimitiveType)) return null;
+
+ double minValue = varType == PsiType.BYTE ? Byte.MIN_VALUE :
+ varType == PsiType.SHORT ? Short.MIN_VALUE :
+ varType == PsiType.INT ? Integer.MIN_VALUE :
+ varType == PsiType.CHAR ? Character.MIN_VALUE :
+ varType == PsiType.LONG ? Long.MIN_VALUE :
+ varType == PsiType.FLOAT ? Float.MIN_VALUE :
+ Double.MIN_VALUE;
+ double maxValue = varType == PsiType.BYTE ? Byte.MAX_VALUE :
+ varType == PsiType.SHORT ? Short.MAX_VALUE :
+ varType == PsiType.INT ? Integer.MAX_VALUE :
+ varType == PsiType.CHAR ? Character.MAX_VALUE :
+ varType == PsiType.LONG ? Long.MAX_VALUE :
+ varType == PsiType.FLOAT ? Float.MAX_VALUE :
+ Double.MAX_VALUE;
+
+ return checkComparisonWithKnownRange(instruction, runner, memState, opSign, comparedWith, minValue, maxValue);
+ }
+
+ @Nullable
+ private static DfaInstructionState[] checkComparisonWithKnownRange(BinopInstruction instruction,
+ DataFlowRunner runner,
+ DfaMemoryState memState,
+ IElementType opSign,
+ double comparedWith,
+ double rangeMin,
+ double rangeMax) {
+ if (comparedWith < rangeMin || comparedWith > rangeMax) {
if (opSign == EQEQ) return alwaysFalse(instruction, runner, memState);
if (opSign == NE) return alwaysTrue(instruction, runner, memState);
}
- if (opSign == LT && constantValue <= minValue) return alwaysFalse(instruction, runner, memState);
- if (opSign == LT && constantValue > maxValue) return alwaysTrue(instruction, runner, memState);
- if (opSign == LE && constantValue >= maxValue) return alwaysTrue(instruction, runner, memState);
+ if (opSign == LT && comparedWith <= rangeMin) return alwaysFalse(instruction, runner, memState);
+ if (opSign == LT && comparedWith > rangeMax) return alwaysTrue(instruction, runner, memState);
+ if (opSign == LE && comparedWith >= rangeMax) return alwaysTrue(instruction, runner, memState);
- if (opSign == GT && constantValue >= maxValue) return alwaysFalse(instruction, runner, memState);
- if (opSign == GT && constantValue < minValue) return alwaysTrue(instruction, runner, memState);
- if (opSign == GE && constantValue <= minValue) return alwaysTrue(instruction, runner, memState);
+ if (opSign == GT && comparedWith >= rangeMax) return alwaysFalse(instruction, runner, memState);
+ if (opSign == GT && comparedWith < rangeMin) return alwaysTrue(instruction, runner, memState);
+ if (opSign == GE && comparedWith <= rangeMin) return alwaysTrue(instruction, runner, memState);
return null;
}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaExpressionFactory.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaExpressionFactory.java
new file mode 100644
index 0000000..ec9e02f
--- /dev/null
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaExpressionFactory.java
@@ -0,0 +1,170 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.dataFlow.value;
+
+import com.intellij.codeInspection.dataFlow.DfaPsiUtil;
+import com.intellij.codeInspection.dataFlow.Nullness;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.registry.Registry;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.JavaConstantExpressionEvaluator;
+import com.intellij.psi.util.PropertyUtil;
+import com.intellij.psi.util.PsiUtil;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+import java.util.regex.Pattern;
+
+/**
+ * @author peter
+ */
+public class DfaExpressionFactory {
+ private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.dataFlow.value.DfaExpressionFactory");
+ private static final Condition<String> FALSE_GETTERS = parseFalseGetters();
+
+ private static Condition<String> parseFalseGetters() {
+ try {
+ final Pattern pattern = Pattern.compile(Registry.stringValue("ide.dfa.getters.with.side.effects"));
+ return new Condition<String>() {
+ @Override
+ public boolean value(String s) {
+ return pattern.matcher(s).matches();
+ }
+ };
+ }
+ catch (Exception e) {
+ LOG.error(e);
+ //noinspection unchecked
+ return Condition.FALSE;
+ }
+ }
+
+ private final DfaValueFactory myFactory;
+ private Map<Integer, PsiVariable> myMockIndices = ContainerUtil.newHashMap();
+
+ public DfaExpressionFactory(DfaValueFactory factory) {
+ myFactory = factory;
+ }
+
+ @Nullable
+ public DfaValue getExpressionDfaValue(@Nullable PsiExpression expression) {
+ if (expression == null) return null;
+
+ if (expression instanceof PsiParenthesizedExpression) {
+ return getExpressionDfaValue(((PsiParenthesizedExpression)expression).getExpression());
+ }
+
+ if (expression instanceof PsiArrayAccessExpression) {
+ PsiExpression arrayExpression = ((PsiArrayAccessExpression)expression).getArrayExpression();
+ DfaValue qualifier = getExpressionDfaValue(arrayExpression);
+ if (qualifier instanceof DfaVariableValue) {
+ PsiVariable indexVar = getArrayIndexVariable(((PsiArrayAccessExpression)expression).getIndexExpression());
+ if (indexVar != null) {
+ return myFactory.getVarFactory().createVariableValue(indexVar, expression.getType(), false, (DfaVariableValue)qualifier);
+ }
+ }
+ return null;
+ }
+
+ if (expression instanceof PsiMethodCallExpression) {
+ return createReferenceValue(((PsiMethodCallExpression)expression).getMethodExpression());
+ }
+
+ if (expression instanceof PsiReferenceExpression) {
+ return createReferenceValue((PsiReferenceExpression)expression);
+ }
+
+ if (expression instanceof PsiLiteralExpression) {
+ return myFactory.createLiteralValue((PsiLiteralExpression)expression);
+ }
+
+ if (expression instanceof PsiNewExpression) {
+ return myFactory.createTypeValue(expression.getType(), Nullness.NOT_NULL);
+ }
+
+ final Object value = JavaConstantExpressionEvaluator.computeConstantExpression(expression, false);
+ PsiType type = expression.getType();
+ if (value != null && type != null) {
+ if (value instanceof String) {
+ return myFactory.createTypeValue(type, Nullness.NOT_NULL); // Non-null string literal.
+ }
+ return myFactory.getConstFactory().createFromValue(value, type, null);
+ }
+
+ return null;
+ }
+
+ private DfaValue createReferenceValue(@NotNull PsiReferenceExpression refExpr) {
+ PsiModifierListOwner var = getAccessedVariableOrGetter(refExpr.resolve());
+ if (var == null) {
+ return null;
+ }
+
+ if (!var.hasModifierProperty(PsiModifier.VOLATILE) && !var.hasModifierProperty(PsiModifier.TRANSIENT)) {
+ if (var instanceof PsiVariable && var.hasModifierProperty(PsiModifier.FINAL)) {
+ DfaValue constValue = myFactory.getConstFactory().create((PsiVariable)var);
+ if (constValue != null) return constValue;
+ }
+
+ if (DfaValueFactory.isEffectivelyUnqualified(refExpr)) {
+ return myFactory.getVarFactory().createVariableValue(var, refExpr.getType(), false, null);
+ }
+
+ DfaValue qualifierValue = getExpressionDfaValue(refExpr.getQualifierExpression());
+ if (qualifierValue instanceof DfaVariableValue) {
+ return myFactory.getVarFactory().createVariableValue(var, refExpr.getType(), false, (DfaVariableValue)qualifierValue);
+ }
+ }
+
+ PsiType type = refExpr.getType();
+ return myFactory.createTypeValue(type, DfaPsiUtil.getElementNullability(type, var));
+ }
+
+ @Nullable
+ private static PsiModifierListOwner getAccessedVariableOrGetter(final PsiElement target) {
+ if (target instanceof PsiVariable) {
+ return (PsiVariable)target;
+ }
+ if (target instanceof PsiMethod) {
+ if (PropertyUtil.isSimplePropertyGetter((PsiMethod)target)) {
+ String qName = PsiUtil.getMemberQualifiedName((PsiMethod)target);
+ if (qName == null || !FALSE_GETTERS.value(qName)) {
+ return (PsiMethod)target;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Nullable
+ private PsiVariable getArrayIndexVariable(@Nullable PsiExpression indexExpression) {
+ Object constant = JavaConstantExpressionEvaluator.computeConstantExpression(indexExpression, false);
+ if (constant instanceof Integer) {
+ PsiVariable mockVar = myMockIndices.get(constant);
+ if (mockVar == null) {
+ mockVar = JavaPsiFacade.getElementFactory(indexExpression.getProject()).createField("$array$index$" + constant, PsiType.INT);
+ myMockIndices.put((Integer)constant, mockVar);
+ }
+ return mockVar;
+ }
+ return null;
+ }
+
+
+}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaValueFactory.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaValueFactory.java
index ba7772b..da1d2d9 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaValueFactory.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaValueFactory.java
@@ -27,7 +27,6 @@
import com.intellij.codeInspection.dataFlow.Nullness;
import com.intellij.openapi.util.Pair;
import com.intellij.psi.*;
-import com.intellij.psi.impl.JavaConstantExpressionEvaluator;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.TypeConversionUtil;
import com.intellij.util.containers.ContainerUtil;
@@ -52,6 +51,7 @@
myBoxedFactory = new DfaBoxedValue.Factory(this);
myTypeFactory = new DfaTypeValue.Factory(this);
myRelationFactory = new DfaRelationValue.Factory(this);
+ myExpressionFactory = new DfaExpressionFactory(this);
}
public boolean isHonorFieldInitializers() {
@@ -83,28 +83,7 @@
@Nullable
public DfaValue createValue(PsiExpression psiExpression) {
- if (psiExpression instanceof PsiReferenceExpression) {
- return createReferenceValue((PsiReferenceExpression)psiExpression);
- }
-
- if (psiExpression instanceof PsiLiteralExpression) {
- return createLiteralValue((PsiLiteralExpression)psiExpression);
- }
-
- if (psiExpression instanceof PsiNewExpression) {
- return createTypeValue(psiExpression.getType(), Nullness.NOT_NULL);
- }
-
- final Object value = JavaConstantExpressionEvaluator.computeConstantExpression(psiExpression, false);
- PsiType type = psiExpression.getType();
- if (value != null && type != null) {
- if (value instanceof String) {
- return createTypeValue(type, Nullness.NOT_NULL); // Non-null string literal.
- }
- return getConstFactory().createFromValue(value, type, null);
- }
-
- return null;
+ return myExpressionFactory.getExpressionDfaValue(psiExpression);
}
@Nullable
@@ -116,26 +95,6 @@
}
@Nullable
- public DfaValue createReferenceValue(PsiReferenceExpression referenceExpression) {
- PsiElement psiSource = referenceExpression.resolve();
- if (!(psiSource instanceof PsiVariable)) {
- return null;
- }
-
- final PsiVariable variable = (PsiVariable)psiSource;
- if (variable.hasModifierProperty(PsiModifier.FINAL) && !variable.hasModifierProperty(PsiModifier.TRANSIENT)) {
- DfaValue constValue = getConstFactory().create(variable);
- if (constValue != null) return constValue;
- }
-
- if (!variable.hasModifierProperty(PsiModifier.VOLATILE) && isEffectivelyUnqualified(referenceExpression)) {
- return getVarFactory().createVariableValue(variable, referenceExpression.getType(), false, null);
- }
-
- return null;
- }
-
- @Nullable
public static PsiVariable resolveUnqualifiedVariable(PsiReferenceExpression refExpression) {
if (isEffectivelyUnqualified(refExpression)) {
PsiElement resolved = refExpression.resolve();
@@ -168,6 +127,7 @@
private final DfaBoxedValue.Factory myBoxedFactory;
private final DfaTypeValue.Factory myTypeFactory;
private final DfaRelationValue.Factory myRelationFactory;
+ private final DfaExpressionFactory myExpressionFactory;
@NotNull
public DfaVariableValue.Factory getVarFactory() {
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaVariableValue.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaVariableValue.java
index 31492bb..3030bef 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaVariableValue.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaVariableValue.java
@@ -105,7 +105,7 @@
return myTypeValue;
}
- @Nullable
+ @NotNull
public PsiModifierListOwner getPsiVariable() {
return myVariable;
}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/search/InheritorsStatisticalDataSearch.java b/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/search/InheritorsStatisticalDataSearch.java
index 8691d6b..4266b66 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/search/InheritorsStatisticalDataSearch.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/search/InheritorsStatisticalDataSearch.java
@@ -1,6 +1,21 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.inheritance.search;
-import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.Couple;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiClass;
import com.intellij.psi.search.GlobalSearchScope;
@@ -32,7 +47,7 @@
disabledNames.add(aClassName);
disabledNames.add(superClassName);
final Set<InheritorsCountData> collector = new TreeSet<InheritorsCountData>();
- final Pair<Integer, Integer> collectingResult = collectInheritorsInfo(superClass, collector, disabledNames);
+ final Couple<Integer> collectingResult = collectInheritorsInfo(superClass, collector, disabledNames);
final int allAnonymousInheritors = collectingResult.getSecond();
final int allInheritors = collectingResult.getFirst() + allAnonymousInheritors - 1;
@@ -64,19 +79,19 @@
return result;
}
- private static Pair<Integer, Integer> collectInheritorsInfo(final PsiClass superClass,
+ private static Couple<Integer> collectInheritorsInfo(final PsiClass superClass,
final Set<InheritorsCountData> collector,
final Set<String> disabledNames) {
return collectInheritorsInfo(superClass, collector, disabledNames, new HashSet<String>(), new HashSet<String>());
}
- private static Pair<Integer, Integer> collectInheritorsInfo(final PsiClass aClass,
+ private static Couple<Integer> collectInheritorsInfo(final PsiClass aClass,
final Set<InheritorsCountData> collector,
final Set<String> disabledNames,
final Set<String> processedElements,
final Set<String> allNotAnonymousInheritors) {
final String className = aClass.getName();
- if (!processedElements.add(className)) return Pair.create(0, 0);
+ if (!processedElements.add(className)) return Couple.of(0, 0);
final MyInheritorsInfoProcessor processor = new MyInheritorsInfoProcessor(collector, disabledNames, processedElements);
DirectClassInheritorsSearch.search(aClass).forEach(processor);
@@ -87,7 +102,7 @@
if (!aClass.isInterface() && allInheritorsCount != 0 && !disabledNames.contains(className)) {
collector.add(new InheritorsCountData(aClass, allInheritorsCount));
}
- return Pair.create(allNotAnonymousInheritors.size(), processor.getAnonymousInheritorsCount());
+ return Couple.of(allNotAnonymousInheritors.size(), processor.getAnonymousInheritorsCount());
}
private static class MyInheritorsInfoProcessor implements Processor<PsiClass> {
@@ -120,8 +135,11 @@
myAnonymousInheritorsCount++;
}
else {
- final Pair<Integer, Integer> res =
- collectInheritorsInfo(psiClass, myCollector, myDisabledNames, myProcessedElements, myAllNotAnonymousInheritors);
+ final Couple<Integer> res = collectInheritorsInfo(psiClass,
+ myCollector,
+ myDisabledNames,
+ myProcessedElements,
+ myAllNotAnonymousInheritors);
myAnonymousInheritorsCount += res.getSecond();
if (!psiClass.isInterface()) {
myAllNotAnonymousInheritors.add(inheritorName);
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java
index 38f8d46..47d32a0 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java
@@ -114,8 +114,8 @@
ProblemHighlightType.GENERIC_ERROR_OR_WARNING, getterAnnoFix);
}
}
- if (annotated.isDeclaredNotNull && manager.isNullable(getter, false) ||
- annotated.isDeclaredNullable && manager.isNotNull(getter, false)) {
+ if (annotated.isDeclaredNotNull && isNullableNotInferred(getter, false) ||
+ annotated.isDeclaredNullable && isNotNullNotInferred(getter, false)) {
holder.registerProblem(nameIdentifier, InspectionsBundle.message(
"inspection.nullable.problems.annotated.field.getter.conflict", getPresentableAnnoName(field), getPresentableAnnoName(getter)),
ProblemHighlightType.GENERIC_ERROR_OR_WARNING, getterAnnoFix);
@@ -141,8 +141,8 @@
addAnnoFix);
}
if (PropertyUtil.isSimpleSetter(setter)) {
- if (annotated.isDeclaredNotNull && manager.isNullable(parameter, false) ||
- annotated.isDeclaredNullable && manager.isNotNull(parameter, false)) {
+ if (annotated.isDeclaredNotNull && isNullableNotInferred(parameter, false) ||
+ annotated.isDeclaredNullable && isNotNullNotInferred(parameter, false)) {
final PsiIdentifier nameIdentifier1 = parameter.getNameIdentifier();
assertValidElement(setter, parameter, nameIdentifier1);
holder.registerProblem(nameIdentifier1, InspectionsBundle.message(
@@ -154,7 +154,17 @@
}
}
- for (PsiExpression rhs : DfaPsiUtil.findAllConstructorInitializers(field)) {
+ List<PsiExpression> initializers = DfaPsiUtil.findAllConstructorInitializers(field);
+ if (annotated.isDeclaredNotNull && initializers.isEmpty()) {
+ final PsiAnnotation annotation = AnnotationUtil.findAnnotation(field, manager.getNotNulls());
+ if (annotation != null) {
+ holder.registerProblem(annotation.isPhysical() ? annotation : field.getNameIdentifier(),
+ "Not-null fields must be initialized",
+ ProblemHighlightType.GENERIC_ERROR_OR_WARNING);
+ }
+ }
+
+ for (PsiExpression rhs : initializers) {
if (rhs instanceof PsiReferenceExpression) {
PsiElement target = ((PsiReferenceExpression)rhs).resolve();
if (target instanceof PsiParameter) {
@@ -169,7 +179,7 @@
ProblemHighlightType.GENERIC_ERROR_OR_WARNING, fix);
continue;
}
- if (annotated.isDeclaredNullable && manager.isNotNull(parameter, false)) {
+ if (annotated.isDeclaredNullable && isNotNullNotInferred(parameter, false)) {
boolean usedAsQualifier = !ReferencesSearch.search(parameter).forEach(new Processor<PsiReference>() {
@Override
public boolean process(PsiReference reference) {
@@ -203,6 +213,33 @@
if (!PsiUtil.isLanguageLevel5OrHigher(parameter)) return;
check(parameter, holder, parameter.getType());
}
+
+ @Override
+ public void visitAnnotation(PsiAnnotation annotation) {
+ if (!AnnotationUtil.NOT_NULL.equals(annotation.getQualifiedName())) return;
+
+ PsiAnnotationMemberValue value = annotation.findDeclaredAttributeValue("exception");
+ if (value instanceof PsiClassObjectAccessExpression) {
+ PsiClass psiClass = PsiUtil.resolveClassInClassTypeOnly(((PsiClassObjectAccessExpression)value).getOperand().getType());
+ if (psiClass != null && !hasStringConstructor(psiClass)) {
+ holder.registerProblem(value,
+ "Custom exception class should have a constructor with a single message parameter of String type",
+ ProblemHighlightType.GENERIC_ERROR_OR_WARNING);
+
+ }
+ }
+ }
+
+ private boolean hasStringConstructor(PsiClass aClass) {
+ for (PsiMethod method : aClass.getConstructors()) {
+ PsiParameterList list = method.getParameterList();
+ if (list.getParametersCount() == 1 &&
+ list.getParameters()[0].getType().equalsToText(CommonClassNames.JAVA_LANG_STRING)) {
+ return true;
+ }
+ }
+ return false;
+ }
};
}
@@ -231,7 +268,7 @@
PsiAnnotation isDeclaredNotNull = AnnotationUtil.findAnnotation(parameter, manager.getNotNulls());
PsiAnnotation isDeclaredNullable = AnnotationUtil.findAnnotation(parameter, manager.getNullables());
if (isDeclaredNullable != null && isDeclaredNotNull != null) {
- reportNullableNotNullConflict(holder, parameter, isDeclaredNullable, isDeclaredNotNull);
+ reportNullableNotNullConflict(holder, parameter, isDeclaredNullable, isDeclaredNotNull);
}
if ((isDeclaredNotNull != null || isDeclaredNullable != null) && type != null && TypeConversionUtil.isPrimitive(type.getCanonicalText())) {
PsiAnnotation annotation = isDeclaredNotNull == null ? isDeclaredNullable : isDeclaredNotNull;
@@ -282,7 +319,7 @@
if (!reported_nullable_method_overrides_notnull
&& REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE
&& annotated.isDeclaredNullable
- && NullableNotNullManager.isNotNull(superMethod)) {
+ && isNotNullNotInferred(superMethod, true)) {
reported_nullable_method_overrides_notnull = true;
final PsiAnnotation annotation = AnnotationUtil.findAnnotation(method, nullableManager.getNullables(), true);
holder.registerProblem(annotation != null ? annotation : method.getNameIdentifier(),
@@ -293,7 +330,7 @@
&& REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL
&& !annotated.isDeclaredNullable
&& !annotated.isDeclaredNotNull
- && NullableNotNullManager.isNotNull(superMethod)) {
+ && isNotNullNotInferred(superMethod, true)) {
reported_not_annotated_method_overrides_notnull = true;
final String defaultNotNull = nullableManager.getDefaultNotNull();
final String[] annotationsToRemove = ArrayUtil.toStringArray(nullableManager.getNullables());
@@ -314,8 +351,8 @@
PsiParameter parameter = parameters[i];
PsiParameter superParameter = superParameters[i];
if (!reported_notnull_parameter_overrides_nullable[i] && REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE &&
- nullableManager.isNotNull(parameter, false) &&
- nullableManager.isNullable(superParameter, false)) {
+ isNotNullNotInferred(parameter, false) &&
+ isNullableNotInferred(superParameter, false)) {
reported_notnull_parameter_overrides_nullable[i] = true;
final PsiAnnotation annotation = AnnotationUtil.findAnnotation(parameter, nullableManager.getNotNulls(), true);
holder.registerProblem(annotation != null ? annotation : parameter.getNameIdentifier(),
@@ -325,7 +362,7 @@
ProblemHighlightType.GENERIC_ERROR_OR_WARNING);
}
if (!reported_not_annotated_parameter_overrides_notnull[i] && REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL) {
- if (!nullableManager.hasNullability(parameter) && nullableManager.isNotNull(superParameter, false)) {
+ if (!nullableManager.hasNullability(parameter) && isNotNullNotInferred(superParameter, false)) {
reported_not_annotated_parameter_overrides_notnull[i] = true;
final LocalQuickFix fix = AnnotationUtil.isAnnotatingApplicable(parameter, nullableManager.getDefaultNotNull())
? new AddNotNullAnnotationFix(parameter)
@@ -346,7 +383,7 @@
boolean hasAnnotatedParameter = false;
for (int i = 0; i < parameters.length; i++) {
PsiParameter parameter = parameters[i];
- parameterAnnotated[i] = nullableManager.isNotNull(parameter, false);
+ parameterAnnotated[i] = isNotNullNotInferred(parameter, false);
hasAnnotatedParameter |= parameterAnnotated[i];
}
if (hasAnnotatedParameter || annotated.isDeclaredNotNull) {
@@ -362,8 +399,8 @@
final boolean applicable = AnnotationUtil.isAnnotatingApplicable(overriding, defaultNotNull);
if (!methodQuickFixSuggested
&& annotated.isDeclaredNotNull
- && !nullableManager.isNotNull(overriding, false)
- && (nullableManager.isNullable(overriding, false) || !nullableManager.isNullable(overriding, true))) {
+ && !isNotNullNotInferred(overriding, false)
+ && (isNullableNotInferred(overriding, false) || !isNullableNotInferred(overriding, true))) {
method.getNameIdentifier(); //load tree
PsiAnnotation annotation = AnnotationUtil.findAnnotation(method, nullableManager.getNotNulls());
final String[] annotationsToRemove = ArrayUtil.toStringArray(nullableManager.getNullables());
@@ -391,7 +428,7 @@
for (int i = 0; i < psiParameters.length; i++) {
if (parameterQuickFixSuggested[i]) continue;
PsiParameter parameter = psiParameters[i];
- if (parameterAnnotated[i] && !nullableManager.isNotNull(parameter, false) && !nullableManager.isNullable(parameter, false)) {
+ if (parameterAnnotated[i] && !isNotNullNotInferred(parameter, false) && !isNullableNotInferred(parameter, false)) {
parameters[i].getNameIdentifier(); //be sure that corresponding tree element available
PsiAnnotation annotation = AnnotationUtil.findAnnotation(parameters[i], nullableManager.getNotNulls());
PsiElement psiElement = annotation;
@@ -415,6 +452,24 @@
}
}
+ private static boolean isNotNullNotInferred(@NotNull PsiModifierListOwner owner, boolean checkBases) {
+ Project project = owner.getProject();
+ NullableNotNullManager manager = NullableNotNullManager.getInstance(project);
+ if (!manager.isNotNull(owner, checkBases)) return false;
+
+ PsiAnnotation anno = manager.getNotNullAnnotation(owner, checkBases);
+ return !(anno != null && AnnotationUtil.isInferredAnnotation(anno));
+ }
+
+ private static boolean isNullableNotInferred(@NotNull PsiModifierListOwner owner, boolean checkBases) {
+ Project project = owner.getProject();
+ NullableNotNullManager manager = NullableNotNullManager.getInstance(project);
+ if (!manager.isNullable(owner, checkBases)) return false;
+
+ PsiAnnotation anno = manager.getNullableAnnotation(owner, checkBases);
+ return !(anno != null && AnnotationUtil.isInferredAnnotation(anno));
+ }
+
@NotNull
private static LocalQuickFix[] wrapFix(LocalQuickFix fix) {
if (fix == null) return LocalQuickFix.EMPTY_ARRAY;
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/unusedLibraries/UnusedLibrariesInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/unusedLibraries/UnusedLibrariesInspection.java
index 5a419df..4db11dc 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/unusedLibraries/UnusedLibrariesInspection.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/unusedLibraries/UnusedLibrariesInspection.java
@@ -23,14 +23,15 @@
import com.intellij.analysis.AnalysisScope;
import com.intellij.codeInsight.daemon.GroupNames;
import com.intellij.codeInspection.*;
-import com.intellij.codeInspection.reference.*;
+import com.intellij.codeInspection.reference.RefEntity;
+import com.intellij.codeInspection.reference.RefGraphAnnotator;
+import com.intellij.codeInspection.reference.RefManager;
+import com.intellij.codeInspection.reference.RefModule;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.*;
-import com.intellij.openapi.roots.impl.DirectoryIndex;
-import com.intellij.openapi.roots.impl.DirectoryInfo;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Key;
@@ -185,12 +186,12 @@
private static class UnusedLibraryGraphAnnotator extends RefGraphAnnotator {
public static final Key<Set<VirtualFile>> USED_LIBRARY_ROOTS = Key.create("inspection.dependencies");
- private final DirectoryIndex myDirectoryIndex;
+ private final ProjectFileIndex myFileIndex;
private RefManager myManager;
public UnusedLibraryGraphAnnotator(RefManager manager) {
myManager = manager;
- myDirectoryIndex = DirectoryIndex.getInstance(manager.getProject());
+ myFileIndex = ProjectRootManager.getInstance(manager.getProject()).getFileIndex();
}
@Override
@@ -199,8 +200,7 @@
final VirtualFile virtualFile = PsiUtilCore.getVirtualFile(what);
final VirtualFile containingDir = virtualFile != null ? virtualFile.getParent() : null;
if (containingDir != null) {
- final DirectoryInfo infoForDirectory = myDirectoryIndex.getInfoForDirectory(containingDir);
- final VirtualFile libraryClassRoot = infoForDirectory != null ? infoForDirectory.getLibraryClassRoot() : null;
+ final VirtualFile libraryClassRoot = myFileIndex.getClassRootForFile(containingDir);
if (libraryClassRoot != null) {
final Module fromModule = ModuleUtilCore.findModuleForPsiElement(from);
if (fromModule != null){
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/varScopeCanBeNarrowed/FieldCanBeLocalInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/varScopeCanBeNarrowed/FieldCanBeLocalInspectionBase.java
index f84abbb..e13f3e6 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/varScopeCanBeNarrowed/FieldCanBeLocalInspectionBase.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/varScopeCanBeNarrowed/FieldCanBeLocalInspectionBase.java
@@ -132,6 +132,7 @@
final Set<PsiField> candidates,
final Set<PsiField> usedFields,
final boolean ignoreFieldsUsedInMultipleMethods) {
+ final Set<PsiField> ignored = new HashSet<PsiField>();
aClass.accept(new JavaRecursiveElementWalkingVisitor() {
@Override
public void visitElement(PsiElement element) {
@@ -144,7 +145,7 @@
final PsiCodeBlock body = method.getBody();
if (body != null) {
- checkCodeBlock(body, candidates, usedFields, ignoreFieldsUsedInMultipleMethods);
+ checkCodeBlock(body, candidates, usedFields, ignoreFieldsUsedInMultipleMethods, ignored);
}
}
@@ -153,14 +154,14 @@
super.visitLambdaExpression(expression);
final PsiElement body = expression.getBody();
if (body != null) {
- checkCodeBlock(body, candidates, usedFields, ignoreFieldsUsedInMultipleMethods);
+ checkCodeBlock(body, candidates, usedFields, ignoreFieldsUsedInMultipleMethods, ignored);
}
}
@Override
public void visitClassInitializer(PsiClassInitializer initializer) {
super.visitClassInitializer(initializer);
- checkCodeBlock(initializer.getBody(), candidates, usedFields, ignoreFieldsUsedInMultipleMethods);
+ checkCodeBlock(initializer.getBody(), candidates, usedFields, ignoreFieldsUsedInMultipleMethods, ignored);
}
});
}
@@ -168,20 +169,28 @@
private static void checkCodeBlock(final PsiElement body,
final Set<PsiField> candidates,
Set<PsiField> usedFields,
- boolean ignoreFieldsUsedInMultipleMethods) {
+ boolean ignoreFieldsUsedInMultipleMethods,
+ Set<PsiField> ignored) {
try {
+ final Ref<Collection<PsiVariable>> writtenVariables = new Ref<Collection<PsiVariable>>();
final ControlFlow
controlFlow = ControlFlowFactory.getInstance(body.getProject()).getControlFlow(body, AllVariablesControlFlowPolicy.getInstance());
final List<PsiVariable> usedVars = ControlFlowUtil.getUsedVariables(controlFlow, 0, controlFlow.getSize());
for (PsiVariable usedVariable : usedVars) {
if (usedVariable instanceof PsiField) {
final PsiField usedField = (PsiField)usedVariable;
- if (!usedFields.add(usedField) && ignoreFieldsUsedInMultipleMethods) {
+ if (!getWrittenVariables(controlFlow, writtenVariables).contains(usedField)) {
+ ignored.add(usedField);
+ }
+
+ if (!usedFields.add(usedField) && (ignoreFieldsUsedInMultipleMethods || ignored.contains(usedField))) {
candidates.remove(usedField); //used in more than one code block
}
}
}
- final Ref<Collection<PsiVariable>> writtenVariables = new Ref<Collection<PsiVariable>>();
+
+ if (candidates.isEmpty()) return;
+
final List<PsiReferenceExpression> readBeforeWrites = ControlFlowUtil.getReadBeforeWrite(controlFlow);
for (final PsiReferenceExpression readBeforeWrite : readBeforeWrites) {
final PsiElement resolved = readBeforeWrite.resolve();
diff --git a/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodUtil.java b/java/java-analysis-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodUtil.java
similarity index 94%
rename from java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodUtil.java
rename to java/java-analysis-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodUtil.java
index f20ff1c..82ed68a 100644
--- a/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodUtil.java
+++ b/java/java-analysis-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodUtil.java
@@ -26,6 +26,7 @@
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.Processor;
import com.intellij.util.containers.HashMap;
+import org.jetbrains.annotations.NotNull;
import java.util.Map;
@@ -89,7 +90,7 @@
if (target != null) {
expression.putCopyableUserData(RESOLVE_TARGET_KEY, null);
try {
- assertSameResolveTarget(target, expression, extracted);
+ addCastsToEnsureResolveTarget(target, expression);
}
catch (IncorrectOperationException e) {
LOG.error(e);
@@ -102,7 +103,7 @@
for (final Map.Entry<PsiMethodCallExpression, PsiMethod> entry : oldResolves.entrySet()) {
try {
- assertSameResolveTarget(entry.getValue(), entry.getKey(), extracted);
+ addCastsToEnsureResolveTarget(entry.getValue(), entry.getKey());
}
catch (IncorrectOperationException e) {
LOG.error(e);
@@ -110,10 +111,10 @@
}
}
- private static void assertSameResolveTarget(final PsiMethod oldTarget, final PsiMethodCallExpression call, final PsiMethod extracted)
+ public static void addCastsToEnsureResolveTarget(@NotNull final PsiMethod oldTarget, @NotNull final PsiMethodCallExpression call)
throws IncorrectOperationException {
final PsiMethod newTarget = call.resolveMethod();
- final PsiManager manager = extracted.getManager();
+ final PsiManager manager = oldTarget.getManager();
final PsiElementFactory factory = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory();
if (!manager.areElementsEquivalent(oldTarget, newTarget)) {
final PsiParameter[] oldParameters = oldTarget.getParameterList().getParameters();
diff --git a/java/java-impl/src/com/intellij/codeInsight/ExternalAnnotationsLineMarkerProvider.java b/java/java-impl/src/com/intellij/codeInsight/ExternalAnnotationsLineMarkerProvider.java
index d5d927c..182f79c 100644
--- a/java/java-impl/src/com/intellij/codeInsight/ExternalAnnotationsLineMarkerProvider.java
+++ b/java/java-impl/src/com/intellij/codeInsight/ExternalAnnotationsLineMarkerProvider.java
@@ -48,43 +48,55 @@
@Nullable
@Override
public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) {
- if (element instanceof PsiParameter) return null;
+ if (!(element instanceof PsiModifierListOwner)) return null;
+ if (element instanceof PsiParameter || element instanceof PsiLocalVariable) return null;
- PsiModifierListOwner owner = null;
- if (element instanceof PsiModifierListOwner) {
- final PsiModifierListOwner modifierListOwner = (PsiModifierListOwner)element;
- final ExternalAnnotationsManager annotationsManager = ExternalAnnotationsManager.getInstance(modifierListOwner.getProject());
- PsiAnnotation[] externalAnnotations = annotationsManager.findExternalAnnotations(modifierListOwner);
- if (externalAnnotations != null && externalAnnotations.length > 0) {
- owner = (PsiModifierListOwner)element;
- } else if (element instanceof PsiMethod) {
- final PsiParameter[] parameters = ((PsiMethod)element).getParameterList().getParameters();
- for (PsiParameter parameter : parameters) {
- externalAnnotations = annotationsManager.findExternalAnnotations(parameter);
- if (externalAnnotations != null && externalAnnotations.length > 0) {
- owner = (PsiMethod)element;
- break;
- }
- }
- }
- }
-
- if (owner == null) {
+ if (!shouldShowSignature(preferCompiledElement((PsiModifierListOwner)element))) {
return null;
}
final Function<PsiModifierListOwner, String> annotationsCollector = new Function<PsiModifierListOwner, String>() {
@Override
public String fun(PsiModifierListOwner owner) {
- return XmlStringUtil.wrapInHtml(JavaDocInfoGenerator.generateSignature(owner));
+ return XmlStringUtil.wrapInHtml(JavaDocInfoGenerator.generateSignature(preferCompiledElement(owner)));
}
};
- return new LineMarkerInfo<PsiModifierListOwner>(owner, owner.getTextOffset(), AllIcons.Gutter.ExtAnnotation,
+ return new LineMarkerInfo<PsiModifierListOwner>((PsiModifierListOwner)element, element.getTextOffset(), AllIcons.Gutter.ExtAnnotation,
Pass.UPDATE_ALL,
annotationsCollector, new MyIconGutterHandler(),
GutterIconRenderer.Alignment.LEFT);
}
+ private static PsiModifierListOwner preferCompiledElement(PsiModifierListOwner element) {
+ PsiElement original = element.getOriginalElement();
+ return original instanceof PsiModifierListOwner ? (PsiModifierListOwner)original : element;
+ }
+
+ private static boolean shouldShowSignature(PsiModifierListOwner owner) {
+ if (hasNonCodeAnnotations(owner)) {
+ return true;
+ }
+
+ if (owner instanceof PsiMethod) {
+ for (PsiParameter parameter : ((PsiMethod)owner).getParameterList().getParameters()) {
+ if (hasNonCodeAnnotations(parameter)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private static boolean hasNonCodeAnnotations(@NotNull PsiModifierListOwner element) {
+ Project project = element.getProject();
+ PsiAnnotation[] externalAnnotations = ExternalAnnotationsManager.getInstance(project).findExternalAnnotations(element);
+ if (externalAnnotations != null && externalAnnotations.length > 0) {
+ return true;
+ }
+ return InferredAnnotationsManager.getInstance(project).findInferredAnnotations(element).length > 0;
+ }
+
@Override
public void collectSlowLineMarkers(@NotNull List<PsiElement> elements, @NotNull Collection<LineMarkerInfo> result) {}
diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaChainLookupElement.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaChainLookupElement.java
index 4ff8ca2..cbc9653 100644
--- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaChainLookupElement.java
+++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaChainLookupElement.java
@@ -21,6 +21,7 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.util.ClassConditionKey;
+import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.codeStyle.CodeStyleManager;
@@ -38,6 +39,7 @@
* @author peter
*/
public class JavaChainLookupElement extends LookupElementDecorator<LookupElement> implements TypedLookupItem {
+ public static final Key<Boolean> CHAIN_QUALIFIER = Key.create("CHAIN_QUALIFIER");
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.completion.JavaChainLookupElement");
public static final ClassConditionKey<JavaChainLookupElement> CLASS_CONDITION_KEY = ClassConditionKey.create(JavaChainLookupElement.class);
private final LookupElement myQualifier;
@@ -109,9 +111,12 @@
public void handleInsert(InsertionContext context) {
final Document document = context.getEditor().getDocument();
document.replaceString(context.getStartOffset(), context.getTailOffset(), ";");
+ myQualifier.putUserData(CHAIN_QUALIFIER, true);
final InsertionContext qualifierContext = CompletionUtil.emulateInsertion(context, context.getStartOffset(), myQualifier);
OffsetKey oldStart = context.trackOffset(context.getStartOffset(), false);
+ PsiDocumentManager.getInstance(context.getProject()).doPostponedOperationsAndUnblockDocument(document);
+
int start = CharArrayUtil.shiftForward(context.getDocument().getCharsSequence(), context.getStartOffset(), " \t\n");
if (shouldParenthesizeQualifier(context.getFile(), start, qualifierContext.getTailOffset())) {
final String space = CodeStyleSettingsManager.getSettings(qualifierContext.getProject()).SPACE_WITHIN_PARENTHESES ? " " : "";
@@ -165,6 +170,7 @@
if (expr instanceof PsiJavaCodeReferenceElement ||
expr instanceof PsiMethodCallExpression ||
+ expr instanceof PsiNewExpression ||
expr instanceof PsiArrayAccessExpression) {
return false;
}
diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameInsertHandler.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameInsertHandler.java
index be6d814..f5a8253 100644
--- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameInsertHandler.java
+++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameInsertHandler.java
@@ -98,7 +98,8 @@
context.setTailOffset(context.getOffset(refEnd));
context.commitDocument();
- if (shouldInsertParentheses(file.findElementAt(context.getTailOffset() - 1))) {
+ if (item.getUserData(JavaChainLookupElement.CHAIN_QUALIFIER) == null &&
+ shouldInsertParentheses(file.findElementAt(context.getTailOffset() - 1))) {
if (ConstructorInsertHandler.insertParentheses(context, item, psiClass, false)) {
fillTypeArgs |= psiClass.hasTypeParameters() && PsiUtil.getLanguageLevel(file).isAtLeast(LanguageLevel.JDK_1_5);
}
diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java
index 7310227..fba10a6 100644
--- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java
+++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java
@@ -426,7 +426,7 @@
if (JavaCompletionData.isAfterPrimitiveOrArrayType(position)) {
return false;
}
-
+
return true;
}
@@ -466,11 +466,11 @@
methods: for (PsiMethod method : annoClass.getMethods()) {
if (!(method instanceof PsiAnnotationMethod)) continue;
-
+
final String attrName = method.getName();
for (PsiNameValuePair existingAttr : existingPairs) {
if (PsiTreeUtil.isAncestor(existingAttr, insertedElement, false)) break;
- if (Comparing.equal(existingAttr.getName(), attrName) ||
+ if (Comparing.equal(existingAttr.getName(), attrName) ||
PsiAnnotation.DEFAULT_REFERENCED_METHOD_NAME.equals(attrName) && existingAttr.getName() == null) continue methods;
}
LookupElementBuilder element = LookupElementBuilder.createWithIcon(method).withInsertHandler(new InsertHandler<LookupElement>() {
@@ -479,7 +479,7 @@
final Editor editor = context.getEditor();
TailType.EQ.processTail(editor, editor.getCaretModel().getOffset());
context.setAddCompletionChar(false);
-
+
context.commitDocument();
PsiAnnotationParameterList paramList =
PsiTreeUtil.findElementOfClassAtOffset(context.getFile(), context.getStartOffset(), PsiAnnotationParameterList.class, false);
@@ -644,7 +644,20 @@
if (file instanceof PsiJavaFile) {
if (context.getInvocationCount() > 0) {
autoImport(file, context.getStartOffset() - 1, context.getEditor());
- PsiDocumentManager.getInstance(context.getProject()).commitDocument(context.getEditor().getDocument());
+
+ PsiElement leaf = file.findElementAt(context.getStartOffset() - 1);
+ if (leaf != null) leaf = PsiTreeUtil.prevVisibleLeaf(leaf);
+
+ PsiVariable variable = PsiTreeUtil.getParentOfType(leaf, PsiVariable.class);
+ if (variable != null) {
+ PsiTypeElement typeElement = variable.getTypeElement();
+ if (typeElement != null) {
+ PsiType type = typeElement.getType();
+ if (type instanceof PsiClassType && ((PsiClassType)type).resolve() == null) {
+ autoImportReference(file, context.getEditor(), typeElement.getInnermostComponentReferenceElement());
+ }
+ }
+ }
}
JavaCompletionUtil.initOffsets(file, context.getOffsetMap());
@@ -702,7 +715,13 @@
iterator.advance();
}
- if (!iterator.atEnd() && (iterator.getTokenType() == JavaTokenType.LPARENTH || iterator.getTokenType() == JavaTokenType.COLON)) {
+ if (!iterator.atEnd() && (iterator.getTokenType() == JavaTokenType.LPARENTH)) {
+ return true;
+ }
+
+ if (!iterator.atEnd()
+ && (iterator.getTokenType() == JavaTokenType.COLON)
+ && null == PsiTreeUtil.findElementOfClassAtOffset(file, startOffset, PsiConditionalExpression.class, false)) {
return true;
}
@@ -721,7 +740,7 @@
return iterator.getTokenType() == JavaTokenType.EQ || iterator.getTokenType() == JavaTokenType.LPARENTH;
}
- private static void autoImport(final PsiFile file, int offset, final Editor editor) {
+ private static void autoImport(@NotNull final PsiFile file, int offset, @NotNull final Editor editor) {
final CharSequence text = editor.getDocument().getCharsSequence();
while (offset > 0 && Character.isJavaIdentifierPart(text.charAt(offset))) offset--;
if (offset <= 0) return;
@@ -734,7 +753,10 @@
while (offset > 0 && Character.isWhitespace(text.charAt(offset))) offset--;
if (offset <= 0) return;
- PsiJavaCodeReferenceElement element = extractReference(PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiExpression.class, false));
+ autoImportReference(file, editor, extractReference(PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiExpression.class, false)));
+ }
+
+ private static void autoImportReference(@NotNull PsiFile file, @NotNull Editor editor, @Nullable PsiJavaCodeReferenceElement element) {
if (element == null) return;
while (true) {
@@ -745,6 +767,7 @@
}
if (!(element.getParent() instanceof PsiMethodCallExpression) && element.multiResolve(true).length == 0) {
new ImportClassFix(element).doFix(editor, false, false);
+ PsiDocumentManager.getInstance(file.getProject()).commitDocument(editor.getDocument());
}
}
diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodMergingContributor.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodMergingContributor.java
index b409014..661d0ab 100644
--- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodMergingContributor.java
+++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodMergingContributor.java
@@ -18,11 +18,14 @@
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.LookupItem;
import com.intellij.psi.PsiMethod;
-import com.intellij.psi.ResolveResult;
+import com.intellij.psi.PsiType;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
+import static com.intellij.util.ObjectUtils.assertNotNull;
+
/**
* @author peter
*/
@@ -38,13 +41,9 @@
final LookupElement[] items = context.getItems();
if (items.length > 1) {
String commonName = null;
- LookupElement best = null;
final ArrayList<PsiMethod> allMethods = new ArrayList<PsiMethod>();
for (LookupElement item : items) {
- Object o = item.getObject();
- if (o instanceof ResolveResult) {
- o = ((ResolveResult)o).getElement();
- }
+ Object o = item.getPsiElement();
if (item.getUserData(LookupItem.FORCE_SHOW_SIGNATURE_ATTR) != null || !(o instanceof PsiMethod)) {
return AutoCompletionDecision.SHOW_LOOKUP;
}
@@ -56,19 +55,37 @@
return AutoCompletionDecision.SHOW_LOOKUP;
}
- if (best == null && method.getParameterList().getParametersCount() > 0) {
- best = item;
- }
commonName = name;
allMethods.add(method);
item.putUserData(JavaCompletionUtil.ALL_METHODS_ATTRIBUTE, allMethods);
}
- if (best == null) {
- best = items[0];
- }
- return AutoCompletionDecision.insertItem(best);
+
+ return AutoCompletionDecision.insertItem(findBestOverload(items));
}
return super.handleAutoCompletionPossibility(context);
}
+
+ public static LookupElement findBestOverload(LookupElement[] items) {
+ LookupElement best = items[0];
+ for (int i = 1; i < items.length; i++) {
+ LookupElement item = items[i];
+ if (getPriority(best) < getPriority(item)) {
+ best = item;
+ }
+ }
+ return best;
+ }
+
+ private static int getPriority(LookupElement element) {
+ PsiMethod method = assertNotNull(getItemMethod(element));
+ return (method.getReturnType() == PsiType.VOID ? 0 : 1) +
+ (method.getParameterList().getParametersCount() > 0 ? 2 : 0);
+ }
+
+ @Nullable
+ private static PsiMethod getItemMethod(LookupElement item) {
+ Object o = item.getPsiElement();
+ return o instanceof PsiMethod ? (PsiMethod)o : null;
+ }
}
diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaNoVariantsDelegator.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaNoVariantsDelegator.java
index f36f567..ceebdec 100644
--- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaNoVariantsDelegator.java
+++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaNoVariantsDelegator.java
@@ -20,6 +20,7 @@
import com.intellij.codeInsight.completion.impl.CamelHumpMatcher;
import com.intellij.codeInsight.lookup.AutoCompletionPolicy;
import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
@@ -41,7 +42,6 @@
* @author peter
*/
public class JavaNoVariantsDelegator extends CompletionContributor {
-
@Override
public void fillCompletionVariants(@NotNull final CompletionParameters parameters, @NotNull CompletionResultSet result) {
LinkedHashSet<CompletionResult> plainResults = result.runRemainingContributors(parameters, true);
diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateAbstractMethodFromUsageFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateAbstractMethodFromUsageFix.java
index abcff223..5edd197 100644
--- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateAbstractMethodFromUsageFix.java
+++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateAbstractMethodFromUsageFix.java
@@ -51,7 +51,7 @@
}
@Override
- protected boolean shouldBeAbstract(PsiClass targetClass) {
+ protected boolean shouldBeAbstract(PsiReferenceExpression expression, PsiClass targetClass) {
return true;
}
}
diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFieldFromUsageFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFieldFromUsageFix.java
index 939b8b6..1e9d1a8 100644
--- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFieldFromUsageFix.java
+++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFieldFromUsageFix.java
@@ -28,6 +28,9 @@
import com.intellij.psi.util.PsiUtil;
import org.jetbrains.annotations.NotNull;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* @author Mike
*/
@@ -45,6 +48,19 @@
return false;
}
+ @NotNull
+ @Override
+ protected List<PsiClass> getTargetClasses(PsiElement element) {
+ final List<PsiClass> targetClasses = new ArrayList<PsiClass>();
+ for (PsiClass psiClass : super.getTargetClasses(element)) {
+ if (psiClass.getManager().isInProject(psiClass) &&
+ (!psiClass.isInterface() && !psiClass.isAnnotationType() || shouldCreateStaticMember(myReferenceExpression, psiClass))) {
+ targetClasses.add(psiClass);
+ }
+ }
+ return targetClasses;
+ }
+
@Override
protected boolean canBeTargetClass(PsiClass psiClass) {
return psiClass.getManager().isInProject(psiClass) && !psiClass.isInterface() && !psiClass.isAnnotationType();
diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFromUsageBaseFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFromUsageBaseFix.java
index c12fbe8..09b83e2 100644
--- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFromUsageBaseFix.java
+++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFromUsageBaseFix.java
@@ -168,6 +168,9 @@
list.deleteChildRange(list.getFirstChild(), list.getLastChild());
return;
}
+ if (targetClass.isInterface()) {
+ return;
+ }
final String visibility = getVisibility(parentClass, targetClass);
if (VisibilityUtil.ESCALATE_VISIBILITY.equals(visibility)) {
list.setModifierProperty(PsiModifier.PRIVATE, true);
diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java
index b7cd8af..8e93a6a 100644
--- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java
+++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java
@@ -120,7 +120,7 @@
PsiMethodCallExpression call = getMethodCall();
if (call == null) return Collections.emptyList();
for (PsiClass target : targets) {
- if (target.isInterface() && shouldCreateStaticMember(call.getMethodExpression(), target)) continue;
+ if (target.isInterface() && shouldCreateStaticMember(call.getMethodExpression(), target) && !PsiUtil.isLanguageLevel8OrHigher(target)) continue;
if (!isMethodSignatureExists(call, target)) {
result.add(target);
}
@@ -155,7 +155,8 @@
PsiCodeBlock body = method.getBody();
assert body != null;
- if (shouldBeAbstract(targetClass)) {
+ final boolean shouldBeAbstract = shouldBeAbstract(expression.getMethodExpression(), targetClass);
+ if (shouldBeAbstract) {
body.delete();
if (!targetClass.isInterface()) {
method.getModifierList().setModifierProperty(PsiModifier.ABSTRACT, true);
@@ -167,14 +168,14 @@
expression = getMethodCall();
LOG.assertTrue(expression.isValid());
- if (!targetClass.isInterface() && shouldCreateStaticMember(expression.getMethodExpression(), targetClass) && !shouldBeAbstract(targetClass)) {
+ if ((!targetClass.isInterface() || PsiUtil.isLanguageLevel8OrHigher(targetClass)) && shouldCreateStaticMember(expression.getMethodExpression(), targetClass) && !shouldBeAbstract) {
PsiUtil.setModifierProperty(method, PsiModifier.STATIC, true);
}
final PsiElement context = PsiTreeUtil.getParentOfType(expression, PsiClass.class, PsiMethod.class);
PsiExpression[] arguments = expression.getArgumentList().getExpressions();
- doCreate(targetClass, method, shouldBeAbstract(targetClass),
+ doCreate(targetClass, method, shouldBeAbstract,
ContainerUtil.map2List(arguments, Pair.<PsiExpression, PsiType>createFunction(null)),
getTargetSubstitutor(expression),
CreateFromUsageUtils.guessExpectedTypes(expression, true),
@@ -213,7 +214,7 @@
public static void doCreate(PsiClass targetClass, PsiMethod method, List<Pair<PsiExpression, PsiType>> arguments, PsiSubstitutor substitutor,
ExpectedTypeInfo[] expectedTypes, @Nullable PsiElement context) {
- doCreate(targetClass, method, shouldBeAbstractImpl(targetClass), arguments, substitutor, expectedTypes, context);
+ doCreate(targetClass, method, shouldBeAbstractImpl(null, targetClass), arguments, substitutor, expectedTypes, context);
}
public static void doCreate(PsiClass targetClass,
@@ -340,12 +341,12 @@
return false;
}
- protected boolean shouldBeAbstract(PsiClass targetClass) {
- return shouldBeAbstractImpl(targetClass);
+ protected boolean shouldBeAbstract(PsiReferenceExpression expression, PsiClass targetClass) {
+ return shouldBeAbstractImpl(expression, targetClass);
}
- private static boolean shouldBeAbstractImpl(PsiClass targetClass) {
- return targetClass.isInterface();
+ private static boolean shouldBeAbstractImpl(PsiReferenceExpression expression, PsiClass targetClass) {
+ return targetClass.isInterface() && (expression == null || !shouldCreateStaticMember(expression, targetClass));
}
@Override
diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFix.java
index b5de7b7..fec3efd 100644
--- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFix.java
+++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFix.java
@@ -30,6 +30,7 @@
import com.intellij.psi.util.ClassUtil;
import org.jetbrains.annotations.NotNull;
+import java.util.Collections;
import java.util.List;
public class ImportClassFix extends ImportClassFixBase<PsiJavaCodeReferenceElement, PsiJavaCodeReferenceElement> {
@@ -107,9 +108,22 @@
return super.getRequiredMemberName(reference);
}
+ @Override
+ protected boolean canReferenceClass(PsiJavaCodeReferenceElement ref) {
+ if (ref instanceof PsiReferenceExpression) {
+ PsiElement parent = ref.getParent();
+ return parent instanceof PsiReferenceExpression || parent instanceof PsiExpressionStatement;
+ }
+ return true;
+ }
+
@NotNull
@Override
protected List<PsiClass> filterByContext(@NotNull List<PsiClass> candidates, @NotNull PsiJavaCodeReferenceElement ref) {
+ if (ref instanceof PsiReferenceExpression) {
+ return Collections.emptyList();
+ }
+
PsiElement typeElement = ref.getParent();
if (typeElement instanceof PsiTypeElement) {
PsiElement var = typeElement.getParent();
diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFixBase.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFixBase.java
index 8047486d..2fbe85b 100644
--- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFixBase.java
+++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFixBase.java
@@ -102,14 +102,19 @@
// can happen when e.g. class name happened to be in a method position
if (element instanceof PsiClass && result.isValidResult()) return Collections.emptyList();
}
- PsiShortNamesCache cache = PsiShortNamesCache.getInstance(myElement.getProject());
+
String name = getReferenceName(myRef);
GlobalSearchScope scope = myElement.getResolveScope();
if (name == null) {
return Collections.emptyList();
}
+
+ if (!canReferenceClass(myRef)) {
+ return Collections.emptyList();
+ }
+
boolean referenceHasTypeParameters = hasTypeParameters(myRef);
- PsiClass[] classes = cache.getClassesByName(name, scope);
+ PsiClass[] classes = PsiShortNamesCache.getInstance(myElement.getProject()).getClassesByName(name, scope);
if (classes.length == 0) return Collections.emptyList();
List<PsiClass> classList = new ArrayList<PsiClass>(classes.length);
boolean isAnnotationReference = myElement.getParent() instanceof PsiAnnotation;
@@ -140,6 +145,10 @@
return classList;
}
+ protected boolean canReferenceClass(R ref) {
+ return true;
+ }
+
private List<PsiClass> filterByRequiredMemberName(List<PsiClass> classList) {
final String memberName = getRequiredMemberName(myElement);
if (memberName != null) {
diff --git a/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/JavaSmartEnterProcessor.java b/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/JavaSmartEnterProcessor.java
index cea0711..90c26bc 100644
--- a/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/JavaSmartEnterProcessor.java
+++ b/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/JavaSmartEnterProcessor.java
@@ -47,7 +47,21 @@
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.editorActions.smartEnter.JavaSmartEnterProcessor");
private static final Fixer[] ourFixers;
- private static final EnterProcessor[] ourEnterProcessors;
+ private static final EnterProcessor[] ourEnterProcessors = {
+ new CommentBreakerEnterProcessor(),
+ new AfterSemicolonEnterProcessor(),
+ new LeaveCodeBlockEnterProcessor(),
+ new PlainEnterProcessor()
+ };
+ private static final EnterProcessor[] ourAfterCompletionEnterProcessors = {
+ new AfterSemicolonEnterProcessor(),
+ new EnterProcessor() {
+ @Override
+ public boolean doEnter(Editor editor, PsiElement psiElement, boolean isModified) {
+ return PlainEnterProcessor.expandCodeBlock(editor, psiElement);
+ }
+ }
+ };
static {
final List<Fixer> fixers = new ArrayList<Fixer>();
@@ -78,15 +92,7 @@
fixers.add(new MissingArrayInitializerBraceFixer());
fixers.add(new MissingArrayConstructorBracketFixer());
fixers.add(new EnumFieldFixer());
- //ourFixers.add(new CompletionFixer());
ourFixers = fixers.toArray(new Fixer[fixers.size()]);
-
- List<EnterProcessor> processors = new ArrayList<EnterProcessor>();
- processors.add(new CommentBreakerEnterProcessor());
- processors.add(new AfterSemicolonEnterProcessor());
- processors.add(new LeaveCodeBlockEnterProcessor());
- processors.add(new PlainEnterProcessor());
- ourEnterProcessors = processors.toArray(new EnterProcessor[processors.size()]);
}
private int myFirstErrorOffset = Integer.MAX_VALUE;
@@ -102,13 +108,22 @@
public boolean process(@NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile psiFile) {
FeatureUsageTracker.getInstance().triggerFeatureUsed("codeassists.complete.statement");
+ return invokeProcessor(editor, psiFile, false);
+ }
+
+ @Override
+ public boolean processAfterCompletion(@NotNull Editor editor, @NotNull PsiFile psiFile) {
+ return invokeProcessor(editor, psiFile, true);
+ }
+
+ private boolean invokeProcessor(Editor editor, PsiFile psiFile, boolean afterCompletion) {
final Document document = editor.getDocument();
- final String textForRollback = document.getText();
+ final CharSequence textForRollback = document.getImmutableCharSequence();
try {
editor.putUserData(SMART_ENTER_TIMESTAMP, editor.getDocument().getModificationStamp());
myFirstErrorOffset = Integer.MAX_VALUE;
mySkipEnter = false;
- process(project, editor, psiFile, 0);
+ process(editor, psiFile, 0, afterCompletion);
}
catch (TooManyAttemptsException e) {
document.replaceString(0, document.getTextLength(), textForRollback);
@@ -118,8 +133,7 @@
return true;
}
-
- private void process(@NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile file, final int attempt) throws TooManyAttemptsException {
+ private void process(@NotNull final Editor editor, @NotNull final PsiFile file, final int attempt, boolean afterCompletion) throws TooManyAttemptsException {
if (attempt > MAX_ATTEMPTS) throw new TooManyAttemptsException();
try {
@@ -148,18 +162,18 @@
for (PsiElement psiElement : queue) {
for (Fixer fixer : ourFixers) {
fixer.apply(editor, this, psiElement);
- if (LookupManager.getInstance(project).getActiveLookup() != null) {
+ if (LookupManager.getInstance(file.getProject()).getActiveLookup() != null) {
return;
}
- if (isUncommited(project) || !psiElement.isValid()) {
+ if (isUncommited(file.getProject()) || !psiElement.isValid()) {
moveCaretInsideBracesIfAny(editor, file);
- process(project, editor, file, attempt + 1);
+ process(editor, file, attempt + 1, afterCompletion);
return;
}
}
}
- doEnter(atCaret, editor);
+ doEnter(atCaret, editor, afterCompletion);
}
catch (IncorrectOperationException e) {
LOG.error(e);
@@ -187,7 +201,7 @@
}
- private void doEnter(PsiElement atCaret, Editor editor) throws IncorrectOperationException {
+ private void doEnter(PsiElement atCaret, Editor editor, boolean afterCompletion) throws IncorrectOperationException {
final PsiFile psiFile = atCaret.getContainingFile();
final RangeMarker rangeMarker = createRangeMarker(atCaret);
@@ -205,7 +219,7 @@
}
atCaret = CodeInsightUtil.findElementInRange(psiFile, rangeMarker.getStartOffset(), rangeMarker.getEndOffset(), atCaret.getClass());
- for (EnterProcessor processor : ourEnterProcessors) {
+ for (EnterProcessor processor : afterCompletion ? ourAfterCompletionEnterProcessors : ourEnterProcessors) {
if(atCaret == null){
// Can't restore element at caret after enter processor execution!
break;
@@ -214,7 +228,7 @@
if (processor.doEnter(editor, atCaret, isModified(editor))) return;
}
- if (!isModified(editor)) {
+ if (!isModified(editor) && !afterCompletion) {
plainEnter(editor);
} else {
if (myFirstErrorOffset == Integer.MAX_VALUE) {
diff --git a/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/PlainEnterProcessor.java b/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/PlainEnterProcessor.java
index 0fe5892..6bafcc0 100644
--- a/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/PlainEnterProcessor.java
+++ b/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/PlainEnterProcessor.java
@@ -42,29 +42,37 @@
public class PlainEnterProcessor implements EnterProcessor {
@Override
public boolean doEnter(Editor editor, PsiElement psiElement, boolean isModified) {
+ if (expandCodeBlock(editor, psiElement)) return true;
+
+ getEnterHandler(IdeActions.ACTION_EDITOR_START_NEW_LINE).execute(editor, ((EditorEx)editor).getDataContext());
+ return true;
+ }
+
+ static boolean expandCodeBlock(Editor editor, PsiElement psiElement) {
PsiCodeBlock block = getControlStatementBlock(editor.getCaretModel().getOffset(), psiElement);
if (processExistingBlankLine(editor, block, psiElement)) {
return true;
}
- EditorActionHandler enterHandler = getEnterHandler(IdeActions.ACTION_EDITOR_START_NEW_LINE);
- if (block != null) {
- PsiElement firstElement = block.getFirstBodyElement();
- if (firstElement == null) {
- firstElement = block.getRBrace();
- // Plain enter processor inserts enter after the end of line, hence, we don't want to use it here because the line ends with
- // the empty braces block. So, we get the following in case of default handler usage:
- // Before:
- // if (condition[caret]) {}
- // After:
- // if (condition) {}
- // [caret]
- enterHandler = getEnterHandler(IdeActions.ACTION_EDITOR_ENTER);
- }
- editor.getCaretModel().moveToOffset(firstElement != null ?
- firstElement.getTextRange().getStartOffset() :
- block.getTextRange().getEndOffset());
+ if (block == null) {
+ return false;
}
+ EditorActionHandler enterHandler = getEnterHandler(IdeActions.ACTION_EDITOR_START_NEW_LINE);
+ PsiElement firstElement = block.getFirstBodyElement();
+ if (firstElement == null) {
+ firstElement = block.getRBrace();
+ // Plain enter processor inserts enter after the end of line, hence, we don't want to use it here because the line ends with
+ // the empty braces block. So, we get the following in case of default handler usage:
+ // Before:
+ // if (condition[caret]) {}
+ // After:
+ // if (condition) {}
+ // [caret]
+ enterHandler = getEnterHandler(IdeActions.ACTION_EDITOR_ENTER);
+ }
+ editor.getCaretModel().moveToOffset(firstElement != null ?
+ firstElement.getTextRange().getStartOffset() :
+ block.getTextRange().getEndOffset());
enterHandler.execute(editor, ((EditorEx)editor).getDataContext());
return true;
}
diff --git a/java/java-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilder.java b/java/java-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilder.java
index 8646805..5d948f3 100644
--- a/java/java-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilder.java
+++ b/java/java-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilder.java
@@ -17,6 +17,7 @@
import com.intellij.codeInsight.ExpectedTypeInfo;
import com.intellij.codeInsight.ExpectedTypesProvider;
+import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.codeStyle.CodeStyleSettings;
@@ -27,7 +28,7 @@
@Override
protected boolean isBelowRightMargin(Project project, int lineLength) {
final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project);
- return lineLength <= settings.RIGHT_MARGIN;
+ return lineLength <= settings.getRightMargin(JavaLanguage.INSTANCE);
}
@Override
diff --git a/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java b/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java
index 4236da3..fe4208d 100644
--- a/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java
+++ b/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java
@@ -251,11 +251,22 @@
final Set<MethodSignature> existingSignatures = new HashSet<MethodSignature>(aClass.getVisibleSignatures());
final Set<PsiMethodMember> selection = new HashSet<PsiMethodMember>();
Map<PsiClass, PsiSubstitutor> superSubstitutors = new HashMap<PsiClass, PsiSubstitutor>();
+
+ final PsiClass containingClass = targetMember.getContainingClass();
JavaPsiFacade facade = JavaPsiFacade.getInstance(target.getProject());
for (PsiMethod method : allMethods) {
final PsiClass superClass = method.getContainingClass();
if (CommonClassNames.JAVA_LANG_OBJECT.equals(superClass.getQualifiedName())) continue;
if (method.isConstructor()) continue;
+
+ //do not suggest to override final method
+ if (method.hasModifierProperty(PsiModifier.FINAL)) {
+ PsiMethod overridden = containingClass.findMethodBySignature(method, true);
+ if (overridden != null && overridden.getContainingClass() != containingClass) {
+ continue;
+ }
+ }
+
PsiSubstitutor superSubstitutor = superSubstitutors.get(superClass);
if (superSubstitutor == null) {
superSubstitutor = TypeConversionUtil.getSuperClassSubstitutor(superClass, targetClass, substitutor);
diff --git a/java/java-impl/src/com/intellij/codeInsight/generation/OverrideImplementUtil.java b/java/java-impl/src/com/intellij/codeInsight/generation/OverrideImplementUtil.java
index d8df673..49e2e43 100644
--- a/java/java-impl/src/com/intellij/codeInsight/generation/OverrideImplementUtil.java
+++ b/java/java-impl/src/com/intellij/codeInsight/generation/OverrideImplementUtil.java
@@ -15,10 +15,7 @@
*/
package com.intellij.codeInsight.generation;
-import com.intellij.codeInsight.AnnotationUtil;
-import com.intellij.codeInsight.CodeInsightActionHandler;
-import com.intellij.codeInsight.CodeInsightBundle;
-import com.intellij.codeInsight.MethodImplementor;
+import com.intellij.codeInsight.*;
import com.intellij.codeInsight.intention.AddAnnotationFix;
import com.intellij.codeInsight.intention.AddAnnotationPsiFix;
import com.intellij.featureStatistics.FeatureUsageTracker;
@@ -259,6 +256,11 @@
for (String annotation : each.getAnnotations(project)) {
if (moduleScope != null && facade.findClass(annotation, moduleScope) == null) continue;
if (AnnotationUtil.isAnnotated(overridden, annotation, false, false) && !AnnotationUtil.isAnnotated(method, annotation, false, false)) {
+ PsiAnnotation psiAnnotation = AnnotationUtil.findAnnotation(overridden, annotation);
+ if (psiAnnotation != null && AnnotationUtil.isInferredAnnotation(psiAnnotation)) {
+ continue;
+ }
+
AddAnnotationPsiFix.removePhysicalAnnotations(method, each.annotationsToRemove(project, annotation));
AddAnnotationPsiFix.addPhysicalAnnotation(annotation, PsiNameValuePair.EMPTY_ARRAY, method.getModifierList());
}
diff --git a/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java b/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java
index b332873..fd85d11 100644
--- a/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java
+++ b/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java
@@ -23,6 +23,7 @@
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.lang.parameterInfo.*;
import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.project.DumbService;
import com.intellij.psi.*;
import com.intellij.psi.impl.source.resolve.CompletionParameterTypeInferencePolicy;
import com.intellij.psi.infos.CandidateInfo;
@@ -31,6 +32,7 @@
import com.intellij.psi.util.MethodSignatureUtil;
import com.intellij.psi.util.PsiUtilBase;
import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.HashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -443,13 +445,18 @@
private static void appendModifierList(@NotNull StringBuilder buffer, @NotNull PsiModifierListOwner owner) {
int lastSize = buffer.length();
- for (PsiAnnotation annotation : AnnotationUtil.getAllAnnotations(owner, false, null)) {
+ Set<String> shownAnnotations = ContainerUtil.newHashSet();
+ for (PsiAnnotation annotation : AnnotationUtil.getAllAnnotations(owner, false, null, !DumbService.isDumb(owner.getProject()))) {
final PsiJavaCodeReferenceElement element = annotation.getNameReferenceElement();
if (element != null) {
final PsiElement resolved = element.resolve();
if (resolved instanceof PsiClass && !AnnotationUtil.isAnnotated((PsiClass)resolved, "java.lang.annotation.Documented", false)) continue;
+
+ String referenceName = element.getReferenceName();
+ if (!shownAnnotations.add(referenceName)) continue;
+
if (lastSize != buffer.length()) buffer.append(" ");
- buffer.append("@").append(element.getReferenceName());
+ buffer.append("@").append(referenceName);
}
}
if (lastSize != buffer.length()) buffer.append(" ");
diff --git a/java/java-impl/src/com/intellij/codeInsight/template/impl/ShortenToStaticImportProcessor.java b/java/java-impl/src/com/intellij/codeInsight/template/impl/ShortenToStaticImportProcessor.java
index 41424cf..fbb6786 100644
--- a/java/java-impl/src/com/intellij/codeInsight/template/impl/ShortenToStaticImportProcessor.java
+++ b/java/java-impl/src/com/intellij/codeInsight/template/impl/ShortenToStaticImportProcessor.java
@@ -27,11 +27,11 @@
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtilBase;
import com.intellij.psi.util.PsiUtilCore;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collections;
@@ -63,7 +63,7 @@
for (
PsiElement element = PsiUtilCore.getElementAtOffset(file, templateRange.getStartOffset());
element != null && element.getTextRange().getStartOffset() < templateRange.getEndOffset();
- element = getNext(element))
+ element = PsiTreeUtil.nextLeaf(element))
{
for (StaticImporter importer : IMPORTERS) {
if (importer.canPerform(element)) {
@@ -81,15 +81,6 @@
}
}
- @Nullable
- private static PsiElement getNext(@NotNull PsiElement element) {
- PsiElement result = element.getNextSibling();
- for (PsiElement current = element; current != null && result == null; current = current.getParent()) {
- result = current.getNextSibling();
- }
- return result;
- }
-
@Nls
@Override
public String getOptionName() {
diff --git a/java/java-impl/src/com/intellij/codeInsight/unwrap/JavaMethodParameterUnwrapper.java b/java/java-impl/src/com/intellij/codeInsight/unwrap/JavaMethodParameterUnwrapper.java
index ec771e4..1c1957b 100644
--- a/java/java-impl/src/com/intellij/codeInsight/unwrap/JavaMethodParameterUnwrapper.java
+++ b/java/java-impl/src/com/intellij/codeInsight/unwrap/JavaMethodParameterUnwrapper.java
@@ -29,15 +29,23 @@
super("");
}
+ private static PsiElement adjustElementToTheLeft(PsiElement element) {
+ if (element instanceof PsiJavaToken && ((PsiJavaToken)element).getTokenType() == JavaTokenType.RPARENTH) {
+ return element.getPrevSibling();
+ }
+ return element;
+ }
+
@Override
public String getDescription(PsiElement e) {
- String text = e.getText();
+ String text = adjustElementToTheLeft(e).getText();
if (text.length() > 20) text = text.substring(0, 17) + "...";
return CodeInsightBundle.message("unwrap.with.placeholder", text);
}
@Override
public boolean isApplicableTo(PsiElement e) {
+ e = adjustElementToTheLeft(e);
final PsiElement parent = e.getParent();
if (e instanceof PsiExpression){
if (parent instanceof PsiExpressionList) {
@@ -62,6 +70,7 @@
@Override
public PsiElement collectAffectedElements(PsiElement e, List<PsiElement> toExtract) {
+ e = adjustElementToTheLeft(e);
super.collectAffectedElements(e, toExtract);
return isTopLevelCall(e) ? e.getParent() : e.getParent().getParent();
}
@@ -73,6 +82,7 @@
@Override
protected void doUnwrap(PsiElement element, Context context) throws IncorrectOperationException {
+ element = adjustElementToTheLeft(element);
PsiElement methodCall = isTopLevelCall(element) ? element.getParent() : element.getParent().getParent();
final PsiElement extractedElement = isTopLevelCall(element) ? getArg(element) : element;
context.extractElement(extractedElement, methodCall);
diff --git a/java/java-impl/src/com/intellij/ide/projectView/impl/nodes/PackageUtil.java b/java/java-impl/src/com/intellij/ide/projectView/impl/nodes/PackageUtil.java
index e9e999b..bcb4b3d 100644
--- a/java/java-impl/src/com/intellij/ide/projectView/impl/nodes/PackageUtil.java
+++ b/java/java-impl/src/com/intellij/ide/projectView/impl/nodes/PackageUtil.java
@@ -21,8 +21,6 @@
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.*;
-import com.intellij.openapi.roots.impl.DirectoryIndex;
-import com.intellij.openapi.roots.impl.DirectoryInfo;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.JavaDirectoryService;
@@ -230,20 +228,16 @@
}
private static class ProjectLibrariesSearchScope extends GlobalSearchScope {
- private final DirectoryIndex myDirectoryIndex;
+ private final ProjectFileIndex myFileIndex;
public ProjectLibrariesSearchScope(@NotNull Project project) {
super(project);
- myDirectoryIndex = DirectoryIndex.getInstance(project);
+ myFileIndex = ProjectRootManager.getInstance(project).getFileIndex();
}
@Override
public boolean contains(@NotNull VirtualFile file) {
- VirtualFile dir = file.isDirectory() ? file : file.getParent();
- if (dir == null) return false;
-
- DirectoryInfo info = myDirectoryIndex.getInfoForDirectory(dir);
- return info != null && info.hasLibraryClassRoot();
+ return myFileIndex.isInLibraryClasses(file);
}
@Override
diff --git a/java/java-impl/src/com/intellij/ide/util/PackageUtil.java b/java/java-impl/src/com/intellij/ide/util/PackageUtil.java
index be9405e..0530f34 100644
--- a/java/java-impl/src/com/intellij/ide/util/PackageUtil.java
+++ b/java/java-impl/src/com/intellij/ide/util/PackageUtil.java
@@ -24,14 +24,12 @@
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectBundle;
import com.intellij.openapi.projectRoots.impl.ProjectRootUtil;
-import com.intellij.openapi.roots.ModulePackageIndex;
-import com.intellij.openapi.roots.ModuleRootManager;
-import com.intellij.openapi.roots.ProjectFileIndex;
-import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.roots.*;
import com.intellij.openapi.roots.ui.configuration.CommonContentEntriesEditor;
import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.Computable;
+import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
@@ -52,13 +50,29 @@
@Nullable
public static PsiDirectory findPossiblePackageDirectoryInModule(Module module, String packageName) {
+ return findPossiblePackageDirectoryInModule(module, packageName, true);
+ }
+ @Nullable
+ public static PsiDirectory findPossiblePackageDirectoryInModule(Module module, String packageName, boolean preferNonGeneratedRoots) {
+ final Project project = module.getProject();
PsiDirectory psiDirectory = null;
- if (!"".equals(packageName)) {
- PsiPackage rootPackage = findLongestExistingPackage(module.getProject(), packageName);
+ if (!StringUtil.isEmptyOrSpaces(packageName)) {
+ PsiPackage rootPackage = findLongestExistingPackage(project, packageName);
if (rootPackage != null) {
final PsiDirectory[] psiDirectories = getPackageDirectoriesInModule(rootPackage, module);
if (psiDirectories.length > 0) {
psiDirectory = psiDirectories[0];
+
+ // If we prefer to find a non-generated PsiDirectory for the given package name, search through all
+ // the directories for the first dir not marked as generated and use that one instead
+ if (preferNonGeneratedRoots && psiDirectories.length > 1) {
+ for (PsiDirectory dir : psiDirectories) {
+ if (!GeneratedSourcesFilter.isGeneratedSourceByAnyFilter(dir.getVirtualFile(), project)) {
+ psiDirectory = dir;
+ break;
+ }
+ }
+ }
}
}
}
@@ -66,7 +80,7 @@
if (checkSourceRootsConfigured(module)) {
final List<VirtualFile> sourceRoots = ModuleRootManager.getInstance(module).getSourceRoots(JavaModuleSourceRootTypes.SOURCES);
for (VirtualFile sourceRoot : sourceRoots) {
- final PsiDirectory directory = PsiManager.getInstance(module.getProject()).findDirectory(sourceRoot);
+ final PsiDirectory directory = PsiManager.getInstance(project).findDirectory(sourceRoot);
if (directory != null) {
psiDirectory = directory;
break;
diff --git a/java/java-impl/src/com/intellij/openapi/roots/impl/JavaLanguageLevelPusher.java b/java/java-impl/src/com/intellij/openapi/roots/impl/JavaLanguageLevelPusher.java
index d933576..a4e7b64 100644
--- a/java/java-impl/src/com/intellij/openapi/roots/impl/JavaLanguageLevelPusher.java
+++ b/java/java-impl/src/com/intellij/openapi/roots/impl/JavaLanguageLevelPusher.java
@@ -86,7 +86,7 @@
private static final FileAttribute PERSISTENCE = new FileAttribute("language_level_persistence", 3, true);
@Override
- public void persistAttribute(@NotNull VirtualFile fileOrDir, @NotNull LanguageLevel level) throws IOException {
+ public void persistAttribute(@NotNull Project project, @NotNull VirtualFile fileOrDir, @NotNull LanguageLevel level) throws IOException {
final DataInputStream iStream = PERSISTENCE.readAttribute(fileOrDir);
if (iStream != null) {
try {
@@ -104,7 +104,7 @@
for (VirtualFile child : fileOrDir.getChildren()) {
if (!child.isDirectory() && StdFileTypes.JAVA.equals(child.getFileType())) {
- PushedFilePropertiesUpdater.filePropertiesChanged(child);
+ PushedFilePropertiesUpdater.getInstance(project).filePropertiesChanged(child);
}
}
}
diff --git a/java/java-impl/src/com/intellij/psi/formatter/java/JavaSpacePropertyProcessor.java b/java/java-impl/src/com/intellij/psi/formatter/java/JavaSpacePropertyProcessor.java
index b76aeaa..2874802 100644
--- a/java/java-impl/src/com/intellij/psi/formatter/java/JavaSpacePropertyProcessor.java
+++ b/java/java-impl/src/com/intellij/psi/formatter/java/JavaSpacePropertyProcessor.java
@@ -44,6 +44,7 @@
import com.intellij.psi.tree.java.IJavaElementType;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.containers.ConcurrentHashMap;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
@@ -229,7 +230,7 @@
new TextRange(dependanceStart, myChild1.getTextRange().getEndOffset()),
keepOneLine, true);
}
- else if (myRole1 == ChildRole.LBRACE) {
+ else if (myRole1 == ChildRole.LBRACE || isEndOfLineCommentAfterLBrace(myChild1)) {
if (aClass.isEnum()) {
createParenthSpace(true, false);
}
@@ -275,6 +276,19 @@
}
}
+ private boolean isEndOfLineCommentAfterLBrace(@NotNull ASTNode node) {
+ if (node.getPsi() instanceof PsiComment) {
+ PsiElement ws = node.getPsi().getPrevSibling();
+ if (ws instanceof PsiWhiteSpace && !ws.textContains('\n')) {
+ PsiElement beforeWs = ws.getPrevSibling();
+ if (beforeWs instanceof PsiJavaToken && ((PsiJavaToken)beforeWs).getTokenType() == JavaTokenType.LBRACE) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
private static boolean isTheOnlyClassMember(final ASTNode node) {
ASTNode next = node.getTreeNext();
if (next == null || !(next.getElementType() == JavaTokenType.RBRACE)) return false;
diff --git a/java/java-impl/src/com/intellij/psi/impl/JavaCodeBlockModificationListener.java b/java/java-impl/src/com/intellij/psi/impl/JavaCodeBlockModificationListener.java
index 18be9cd..314f55c 100644
--- a/java/java-impl/src/com/intellij/psi/impl/JavaCodeBlockModificationListener.java
+++ b/java/java-impl/src/com/intellij/psi/impl/JavaCodeBlockModificationListener.java
@@ -16,6 +16,7 @@
package com.intellij.psi.impl;
import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.psi.*;
import com.intellij.psi.impl.source.jsp.jspXml.JspDirective;
import com.intellij.psi.util.PsiModificationTracker;
@@ -90,7 +91,8 @@
}
private static boolean isSourceDir(PsiElement element) {
- return element instanceof PsiDirectory && JavaDirectoryService.getInstance().getPackage((PsiDirectory)element) != null;
+ return element instanceof PsiDirectory &&
+ ProjectFileIndex.SERVICE.getInstance(element.getProject()).isInSource(((PsiDirectory)element).getVirtualFile());
}
private static boolean isClassOwner(final PsiElement element) {
diff --git a/java/java-impl/src/com/intellij/psi/impl/JavaDirectoryIconProvider.java b/java/java-impl/src/com/intellij/psi/impl/JavaDirectoryIconProvider.java
index 795e66e..e87e95f7 100644
--- a/java/java-impl/src/com/intellij/psi/impl/JavaDirectoryIconProvider.java
+++ b/java/java-impl/src/com/intellij/psi/impl/JavaDirectoryIconProvider.java
@@ -15,6 +15,7 @@
*/
package com.intellij.psi.impl;
+import com.intellij.icons.AllIcons;
import com.intellij.ide.IconProvider;
import com.intellij.ide.projectView.impl.ProjectRootsUtil;
import com.intellij.openapi.module.Module;
@@ -24,6 +25,7 @@
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.roots.SourceFolder;
import com.intellij.openapi.roots.ui.configuration.SourceRootPresentation;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.JarFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.JavaDirectoryService;
@@ -68,6 +70,9 @@
else if (JavaDirectoryService.getInstance().getPackage(psiDirectory) != null) {
symbolIcon = PlatformIcons.PACKAGE_ICON;
}
+ else if (!Registry.is("ide.hide.excluded.files") && ProjectRootManager.getInstance(project).getFileIndex().isExcluded(vFile)) {
+ symbolIcon = AllIcons.Modules.ExcludeRoot;
+ }
else {
symbolIcon = PlatformIcons.DIRECTORY_CLOSED_ICON;
}
diff --git a/java/java-impl/src/com/intellij/psi/impl/JavaPsiImplementationHelperImpl.java b/java/java-impl/src/com/intellij/psi/impl/JavaPsiImplementationHelperImpl.java
index 8ea592f..dce55fd 100644
--- a/java/java-impl/src/com/intellij/psi/impl/JavaPsiImplementationHelperImpl.java
+++ b/java/java-impl/src/com/intellij/psi/impl/JavaPsiImplementationHelperImpl.java
@@ -178,7 +178,7 @@
}
List<OrderEntry> orderEntries = index.getOrderEntriesForFile(virtualFile);
if (orderEntries.isEmpty()) {
- LOG.error("Inconsistent: " + DirectoryIndex.getInstance(myProject).getInfoForDirectory(folder).toString());
+ LOG.error("Inconsistent: " + DirectoryIndex.getInstance(myProject).getInfoForFile(folder).toString());
}
final VirtualFile[] files = orderEntries.get(0).getFiles(OrderRootType.CLASSES);
for (VirtualFile rootFile : files) {
diff --git a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDParser.java b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDParser.java
index b424af9..f6dc9b9 100644
--- a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDParser.java
+++ b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDParser.java
@@ -15,6 +15,7 @@
*/
package com.intellij.psi.impl.source.codeStyle.javadoc;
+import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.pom.java.LanguageLevel;
@@ -469,20 +470,21 @@
boolean firstLineShorter,
int firstLinePrefixLength)
{
+ int rightMargin = mySettings.getRightMargin(JavaLanguage.INSTANCE);
StringBuilder sb = new StringBuilder();
List<String> list;
//If wrap comments selected, comments should be wrapped by the right margin
if (mySettings.WRAP_COMMENTS) {
- list = toArrayWrapping(str, mySettings.RIGHT_MARGIN - prefix.length());
+ list = toArrayWrapping(str, rightMargin - prefix.length());
if (firstLineShorter
&& list != null && !list.isEmpty()
- && list.get(0).length() > mySettings.RIGHT_MARGIN - firstLinePrefixLength)
+ && list.get(0).length() > rightMargin - firstLinePrefixLength)
{
list = new ArrayList<String>();
//want the first line to be shorter, according to it's prefix
- String firstLine = toArrayWrapping(str, mySettings.RIGHT_MARGIN - firstLinePrefixLength).get(0);
+ String firstLine = toArrayWrapping(str, rightMargin - firstLinePrefixLength).get(0);
//so now first line is exactly same width we need
list.add(firstLine);
str = str.substring(firstLine.length());
@@ -493,7 +495,7 @@
}
//getting all another lines according to their prefix
- List<String> subList = toArrayWrapping(str, mySettings.RIGHT_MARGIN - prefix.length());
+ List<String> subList = toArrayWrapping(str, rightMargin - prefix.length());
//removing pre tag
if (unclosedPreTag && subList != null && !subList.isEmpty()) {
diff --git a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/JavaCharsetReferenceContributor.java b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/JavaCharsetReferenceContributor.java
deleted file mode 100644
index db1a385..0000000
--- a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/JavaCharsetReferenceContributor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2000-2014 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.source.resolve.reference.impl;
-
-import com.intellij.codeInsight.daemon.impl.analysis.encoding.EncodingReference;
-import com.intellij.psi.*;
-import com.intellij.psi.impl.source.resolve.reference.impl.manipulators.StringLiteralManipulator;
-import com.intellij.util.ProcessingContext;
-import org.jetbrains.annotations.NotNull;
-
-import java.nio.charset.Charset;
-
-import static com.intellij.patterns.PsiJavaPatterns.literalExpression;
-import static com.intellij.patterns.PsiJavaPatterns.psiMethod;
-import static com.intellij.patterns.StandardPatterns.string;
-
-/**
- * @author peter
- */
-public class JavaCharsetReferenceContributor extends PsiReferenceContributor {
- @Override
- public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
- registrar.registerReferenceProvider(
- literalExpression().methodCallParameter(
- 0, psiMethod().withName(string().oneOf("forName", "isSupported")).inClass(Charset.class.getName())),
- new PsiReferenceProvider() {
- @NotNull
- @Override
- public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
- PsiLiteralExpression literal = (PsiLiteralExpression)element;
- Object value = literal.getValue();
- if (value instanceof String) {
- return new PsiReference[]{new EncodingReference(element, (String)value, StringLiteralManipulator.getValueRange(literal))};
- }
- return PsiReference.EMPTY_ARRAY;
- }
- });
- }
-}
diff --git a/java/java-impl/src/com/intellij/psi/util/proximity/KnownElementWeigher.java b/java/java-impl/src/com/intellij/psi/util/proximity/KnownElementWeigher.java
index ffb122b..511d41f5 100644
--- a/java/java-impl/src/com/intellij/psi/util/proximity/KnownElementWeigher.java
+++ b/java/java-impl/src/com/intellij/psi/util/proximity/KnownElementWeigher.java
@@ -20,14 +20,26 @@
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.util.ProximityLocation;
+import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.util.Set;
+
+import static com.intellij.psi.CommonClassNames.*;
+
/**
* @author peter
*/
public class KnownElementWeigher extends ProximityWeigher {
+ private static final Set<String> POPULAR_JDK_CLASSES = ContainerUtil.newHashSet(
+ JAVA_LANG_STRING,
+ JAVA_LANG_CLASS,
+ System.class.getName(), JAVA_LANG_RUNNABLE,
+ JAVA_LANG_EXCEPTION, JAVA_LANG_THROWABLE, JAVA_LANG_RUNTIME_EXCEPTION,
+ JAVA_UTIL_ARRAY_LIST, JAVA_UTIL_HASH_MAP, JAVA_UTIL_HASH_SET
+ );
@Override
public Comparable weigh(@NotNull final PsiElement element, @NotNull final ProximityLocation location) {
@@ -50,7 +62,7 @@
if (containingClass != null) {
String methodName = method.getName();
if ("finalize".equals(methodName) || "registerNatives".equals(methodName) || methodName.startsWith("wait") || methodName.startsWith("notify")) {
- if (CommonClassNames.JAVA_LANG_OBJECT.equals(containingClass.getQualifiedName())) {
+ if (JAVA_LANG_OBJECT.equals(containingClass.getQualifiedName())) {
return -1;
}
}
@@ -58,11 +70,11 @@
return -1;
}
if ("subSequence".equals(methodName)) {
- if (CommonClassNames.JAVA_LANG_STRING.equals(containingClass.getQualifiedName())) {
+ if (JAVA_LANG_STRING.equals(containingClass.getQualifiedName())) {
return -1;
}
}
- if (CommonClassNames.JAVA_LANG_OBJECT.equals(containingClass.getQualifiedName())) {
+ if (JAVA_LANG_OBJECT.equals(containingClass.getQualifiedName())) {
return 0;
}
return getJdkClassProximity(method.getContainingClass());
@@ -86,8 +98,8 @@
@NonNls final String qname = element.getQualifiedName();
if (qname != null) {
String pkg = StringUtil.getPackageName(qname);
- if (qname.equals(CommonClassNames.JAVA_LANG_OBJECT)) return 5;
- if (isPopularJdkClass(qname)) return 8;
+ if (qname.equals(JAVA_LANG_OBJECT)) return 5;
+ if (POPULAR_JDK_CLASSES.contains(qname)) return 8;
if (pkg.equals("java.lang")) return 6;
if (pkg.equals("java.util")) return 7;
@@ -103,13 +115,4 @@
return 0;
}
- private static boolean isPopularJdkClass(String qname) {
- return qname.equals(CommonClassNames.JAVA_LANG_STRING) ||
- qname.equals(System.class.getName()) ||
- qname.equals(CommonClassNames.JAVA_LANG_EXCEPTION) ||
- qname.equals(CommonClassNames.JAVA_LANG_THROWABLE) ||
- qname.equals(CommonClassNames.JAVA_LANG_RUNTIME_EXCEPTION) ||
- qname.equals(CommonClassNames.JAVA_LANG_RUNNABLE) ||
- qname.equals(CommonClassNames.JAVA_LANG_CLASS);
- }
}
\ No newline at end of file
diff --git a/java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureUsageProcessor.java b/java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureUsageProcessor.java
index 8a9eca3..6a44f25 100644
--- a/java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureUsageProcessor.java
+++ b/java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureUsageProcessor.java
@@ -15,7 +15,9 @@
*/
package com.intellij.refactoring.changeSignature;
+import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.codeInsight.ExceptionUtil;
+import com.intellij.codeInsight.InferredAnnotationsManager;
import com.intellij.codeInsight.daemon.impl.analysis.JavaHighlightUtil;
import com.intellij.codeInspection.dataFlow.ControlFlowAnalyzer;
import com.intellij.lang.StdLanguages;
@@ -943,7 +945,8 @@
}
private static void checkContract(MultiMap<PsiElement, String> conflictDescriptions, PsiMethod method) {
- if (ControlFlowAnalyzer.findContractAnnotation(method) != null) {
+ PsiAnnotation contract = ControlFlowAnalyzer.findContractAnnotation(method);
+ if (contract != null && !AnnotationUtil.isInferredAnnotation(contract)) {
conflictDescriptions.putValue(method, "@Contract annotation will have to be changed manually");
}
}
diff --git a/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java b/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java
index 7b68e33..b29d02f 100644
--- a/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java
+++ b/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java
@@ -791,7 +791,7 @@
String[] names = myJavaCodeStyle.suggestVariableName(VariableKind.LOCAL_VARIABLE, null, null, thisType)
.names;
String thisVarName = names[0];
- thisVarName = myJavaCodeStyle.suggestUniqueVariableName(thisVarName, block.getFirstChild(), true);
+ thisVarName = myJavaCodeStyle.suggestUniqueVariableName(thisVarName, myMethod.getFirstChild(), true);
PsiExpression initializer = myFactory.createExpressionFromText("null", null);
PsiDeclarationStatement declaration = myFactory.createVariableDeclarationStatement(thisVarName, thisType, initializer);
declaration = (PsiDeclarationStatement)block.addAfter(declaration, null);
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceField/BaseExpressionToFieldHandler.java b/java/java-impl/src/com/intellij/refactoring/introduceField/BaseExpressionToFieldHandler.java
index 731daff..a751ace 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceField/BaseExpressionToFieldHandler.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceField/BaseExpressionToFieldHandler.java
@@ -405,7 +405,8 @@
PsiElementFactory factory = JavaPsiFacade.getInstance(psiManager.getProject()).getElementFactory();
try {
PsiField field = factory.createFieldFromText(pattern.toString(), null);
- field.getTypeElement().replace(factory.createTypeElement(type));
+ final PsiTypeElement typeElement = factory.createTypeElement(type);
+ field.getTypeElement().replace(typeElement);
field = (PsiField)CodeStyleManager.getInstance(psiManager.getProject()).reformat(field);
if (includeInitializer) {
field.getInitializer().replace(initializerExpr);
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceField/InplaceIntroduceConstantPopup.java b/java/java-impl/src/com/intellij/refactoring/introduceField/InplaceIntroduceConstantPopup.java
index 4238c21..ceae8ae 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceField/InplaceIntroduceConstantPopup.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceField/InplaceIntroduceConstantPopup.java
@@ -224,6 +224,11 @@
}
@Override
+ protected String getRefactoringId() {
+ return "refactoring.extractConstant";
+ }
+
+ @Override
protected boolean startsOnTheSameElement(RefactoringActionHandler handler, PsiElement element) {
return super.startsOnTheSameElement(handler, element) && handler instanceof IntroduceConstantHandler;
}
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceField/InplaceIntroduceFieldPopup.java b/java/java-impl/src/com/intellij/refactoring/introduceField/InplaceIntroduceFieldPopup.java
index 4c1de5e..3998a93d 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceField/InplaceIntroduceFieldPopup.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceField/InplaceIntroduceFieldPopup.java
@@ -148,6 +148,11 @@
}
}
+ @Override
+ protected String getRefactoringId() {
+ return "refactoring.extractField";
+ }
+
public void setVisibility(String visibility) {
myIntroduceFieldPanel.setVisibility(visibility);
}
@@ -203,6 +208,8 @@
protected void performIntroduce() {
ourLastInitializerPlace = myIntroduceFieldPanel.getInitializerPlace();
+ final PsiType forcedType = getType();
+ LOG.assertTrue(forcedType == null || forcedType.isValid(), forcedType);
final BaseExpressionToFieldHandler.Settings settings =
new BaseExpressionToFieldHandler.Settings(getInputName(),
getExpr(),
@@ -211,7 +218,7 @@
myIntroduceFieldPanel.isDeclareFinal(),
myIntroduceFieldPanel.getInitializerPlace(),
myIntroduceFieldPanel.getFieldVisibility(), (PsiLocalVariable)getLocalVariable(),
- getType(),
+ forcedType,
myIntroduceFieldPanel.isDeleteVariable(),
myParentClass, false, false);
new WriteCommandAction(myProject, getCommandName(), getCommandName()){
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java
index dc1f166..1521725 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java
@@ -348,6 +348,15 @@
return data;
}
+ @Nullable
+ @Override
+ protected RefactoringEventData getAfterData(UsageInfo[] usages) {
+ final PsiParameter parameter = JavaIntroduceParameterMethodUsagesProcessor.getAnchorParameter(myMethodToReplaceIn);
+ final RefactoringEventData afterData = new RefactoringEventData();
+ afterData.addElement(parameter);
+ return afterData;
+ }
+
protected void performRefactoring(UsageInfo[] usages) {
try {
PsiElementFactory factory = JavaPsiFacade.getInstance(myManager.getProject()).getElementFactory();
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java b/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java
index 0e513d4..16fc097 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java
@@ -61,6 +61,8 @@
import com.intellij.refactoring.introduce.inplace.AbstractInplaceIntroducer;
import com.intellij.refactoring.introduce.inplace.OccurrencesChooser;
import com.intellij.refactoring.introduceField.ElementToWorkOn;
+import com.intellij.refactoring.listeners.RefactoringEventData;
+import com.intellij.refactoring.listeners.RefactoringEventListener;
import com.intellij.refactoring.ui.TypeSelectorManagerImpl;
import com.intellij.refactoring.util.CommonRefactoringUtil;
import com.intellij.refactoring.util.FieldConflictsResolver;
@@ -85,7 +87,8 @@
public abstract class IntroduceVariableBase extends IntroduceHandlerBase {
private static final Logger LOG = Logger.getInstance("#com.intellij.refactoring.introduceVariable.IntroduceVariableBase");
@NonNls private static final String PREFER_STATEMENTS_OPTION = "introduce.variable.prefer.statements";
-
+ @NonNls private static final String REFACTORING_ID = "refactoring.extractVariable";
+
protected static final String REFACTORING_NAME = RefactoringBundle.message("introduce.variable.title");
public static final Key<Boolean> NEED_PARENTHESIS = Key.create("NEED_PARENTHESIS");
@@ -677,13 +680,27 @@
occurrenceMarkers.add(topLevelEditor.getDocument().createRangeMarker(occurrence.getTextRange()));
}
}
+ final RefactoringEventData beforeData = new RefactoringEventData();
+ beforeData.addElement(expr);
+ project.getMessageBus()
+ .syncPublisher(RefactoringEventListener.REFACTORING_EVENT_TOPIC).refactoringStarted(REFACTORING_ID, beforeData);
final String expressionText = expr.getText();
final Runnable runnable = introduce(project, expr, topLevelEditor, chosenAnchor, occurrences, settings, variable);
CommandProcessor.getInstance().executeCommand(
project,
new Runnable() {
public void run() {
- ApplicationManager.getApplication().runWriteAction(runnable);
+ try {
+ ApplicationManager.getApplication().runWriteAction(runnable);
+ }
+ finally {
+ final RefactoringEventData afterData = new RefactoringEventData();
+ final SmartPsiElementPointer<PsiVariable> pointer = variable.get();
+ afterData.addElement(pointer != null ? pointer.getElement() : null);
+ project.getMessageBus()
+ .syncPublisher(RefactoringEventListener.REFACTORING_EVENT_TOPIC).refactoringDone(REFACTORING_ID, afterData);
+ }
+
if (isInplaceAvailableOnDataContext) {
final PsiVariable elementToRename = variable.get().getElement();
if (elementToRename != null) {
diff --git a/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java b/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java
index 39913cd..ab86ee8 100644
--- a/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java
+++ b/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java
@@ -219,7 +219,10 @@
}
}
PsiMethod methodCopy = (PsiMethod)method.copy();
- if (method.findSuperMethods(myTargetSuperClass).length == 0) {
+ Language language = myTargetSuperClass.getLanguage();
+ final PsiMethod superClassMethod = myTargetSuperClass.findMethodBySignature(methodCopy, false);
+ if (superClassMethod != null && superClassMethod.findDeepestSuperMethods().length == 0 ||
+ method.findSuperMethods(myTargetSuperClass).length == 0) {
deleteOverrideAnnotationIfFound(methodCopy);
}
boolean isOriginalMethodAbstract = method.hasModifierProperty(PsiModifier.ABSTRACT) || method.hasModifierProperty(PsiModifier.DEFAULT);
@@ -238,7 +241,14 @@
myJavaDocPolicy.processCopiedJavaDoc(methodCopy.getDocComment(), method.getDocComment(), isOriginalMethodAbstract);
- final PsiMember movedElement = anchor != null ? (PsiMember)myTargetSuperClass.addBefore(methodCopy, anchor) : (PsiMember)myTargetSuperClass.add(methodCopy);
+ final PsiMember movedElement;
+ if (superClassMethod != null && superClassMethod.hasModifierProperty(PsiModifier.ABSTRACT)) {
+ movedElement = (PsiMember)superClassMethod.replace(convertMethodToLanguage(methodCopy, language));
+ }
+ else {
+ movedElement =
+ anchor != null ? (PsiMember)myTargetSuperClass.addBefore(methodCopy, anchor) : (PsiMember)myTargetSuperClass.add(methodCopy);
+ }
CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(method.getProject());
if (styleSettings.INSERT_OVERRIDE_ANNOTATION) {
if (PsiUtil.isLanguageLevel5OrHigher(mySourceClass) && !myIsTargetInterface || PsiUtil.isLanguageLevel6OrHigher(mySourceClass)) {
@@ -265,8 +275,6 @@
RefactoringUtil.replaceMovedMemberTypeParameters(methodCopy, PsiUtil.typeParametersIterable(mySourceClass), substitutor, elementFactory);
fixReferencesToStatic(methodCopy);
- Language language = myTargetSuperClass.getLanguage();
- final PsiMethod superClassMethod = myTargetSuperClass.findMethodBySignature(methodCopy, false);
if (superClassMethod != null && superClassMethod.hasModifierProperty(PsiModifier.ABSTRACT)) {
superClassMethod.replace(convertMethodToLanguage(methodCopy, language));
}
diff --git a/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpDialog.java b/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpDialog.java
index b92c5f5..3fd4e33 100644
--- a/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpDialog.java
+++ b/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpDialog.java
@@ -196,7 +196,7 @@
final PsiSubstitutor superSubstitutor = TypeConversionUtil.getSuperClassSubstitutor(currentSuperClass, myClass, PsiSubstitutor.EMPTY);
final MethodSignature signature = ((PsiMethod) element).getSignature(superSubstitutor);
final PsiMethod superClassMethod = MethodSignatureUtil.findMethodBySignature(currentSuperClass, signature, false);
- if (superClassMethod != null) return false;
+ if (superClassMethod != null && !PsiUtil.isLanguageLevel8OrHigher(currentSuperClass)) return false;
return !((PsiModifierListOwner) element).hasModifierProperty(PsiModifier.STATIC) || PsiUtil.isLanguageLevel8OrHigher(currentSuperClass);
}
return true;
diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/AutocreatingSingleSourceRootMoveDestination.java b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/AutocreatingSingleSourceRootMoveDestination.java
index c1bc3bf..ce19d6b 100644
--- a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/AutocreatingSingleSourceRootMoveDestination.java
+++ b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/AutocreatingSingleSourceRootMoveDestination.java
@@ -102,6 +102,6 @@
if (myTargetDirectory == null) {
myTargetDirectory = RefactoringUtil.createPackageDirectoryInSourceRoot(myPackage, mySourceRoot);
}
- return RefactoringUtil.createPackageDirectoryInSourceRoot(myPackage, mySourceRoot);
+ return myTargetDirectory;
}
}
diff --git a/java/java-impl/src/com/intellij/refactoring/util/duplicates/DuplicatesImpl.java b/java/java-impl/src/com/intellij/refactoring/util/duplicates/DuplicatesImpl.java
index 895334d..5e5b620 100644
--- a/java/java-impl/src/com/intellij/refactoring/util/duplicates/DuplicatesImpl.java
+++ b/java/java-impl/src/com/intellij/refactoring/util/duplicates/DuplicatesImpl.java
@@ -131,7 +131,7 @@
}
HighlightManager.getInstance(project).removeSegmentHighlighter(editor, highlighters.get(0));
- new WriteCommandAction(project, MethodDuplicatesHandler.REFACTORING_NAME) {
+ new WriteCommandAction(project, MethodDuplicatesHandler.REFACTORING_NAME, MethodDuplicatesHandler.REFACTORING_NAME) {
@Override
protected void run(Result result) throws Throwable {
try {
diff --git a/java/java-impl/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java b/java/java-impl/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java
index 2eade69..5d10f07 100644
--- a/java/java-impl/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java
+++ b/java/java-impl/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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,7 +17,6 @@
import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.psi.JavaTokenType;
-import com.intellij.psi.PsiLanguageInjectionHost;
import com.intellij.psi.PsiLiteralExpression;
import com.intellij.psi.PsiModifierListOwner;
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
@@ -37,12 +36,10 @@
public class LiteralExpressionTokenizer extends Tokenizer<PsiLiteralExpression> {
@Override
public void tokenize(@NotNull PsiLiteralExpression element, TokenConsumer consumer) {
- PsiLiteralExpressionImpl literalExpression = (PsiLiteralExpressionImpl) element;
- if (literalExpression.getLiteralElementType() != JavaTokenType.STRING_LITERAL) {
- return; // not a string literal
- }
+ PsiLiteralExpressionImpl literalExpression = (PsiLiteralExpressionImpl)element;
+ if (literalExpression.getLiteralElementType() != JavaTokenType.STRING_LITERAL) return; // not a string literal
- if (InjectedLanguageUtil.hasInjections((PsiLanguageInjectionHost)element)) return;
+ if (InjectedLanguageUtil.hasInjections(literalExpression)) return;
final PsiModifierListOwner listOwner = PsiTreeUtil.getParentOfType(element, PsiModifierListOwner.class);
if (listOwner != null && AnnotationUtil.isAnnotated(listOwner, Collections.singleton(AnnotationUtil.NON_NLS), false, false)) {
diff --git a/java/java-impl/src/com/intellij/testIntegration/BaseGenerateTestSupportMethodAction.java b/java/java-impl/src/com/intellij/testIntegration/BaseGenerateTestSupportMethodAction.java
index 40a97cf..6d82acd 100644
--- a/java/java-impl/src/com/intellij/testIntegration/BaseGenerateTestSupportMethodAction.java
+++ b/java/java-impl/src/com/intellij/testIntegration/BaseGenerateTestSupportMethodAction.java
@@ -24,9 +24,10 @@
import com.intellij.codeInsight.hint.HintManager;
import com.intellij.ide.fileTemplates.FileTemplateDescriptor;
import com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable;
-import com.intellij.ide.util.EditSourceUtil;
-import com.intellij.openapi.actionSystem.*;
-import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
@@ -40,7 +41,6 @@
import com.intellij.util.Consumer;
import com.intellij.util.Function;
import com.intellij.util.IncorrectOperationException;
-import com.intellij.util.Processor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -100,7 +100,7 @@
private static PsiClass findTargetClass(@NotNull Editor editor, @NotNull PsiFile file) {
int offset = editor.getCaretModel().getOffset();
PsiElement element = file.findElementAt(offset);
- return element == null ? null : TestIntegrationUtils.findOuterClass(element);
+ return PsiTreeUtil.getParentOfType(element, PsiClass.class, false) == null ? null : TestIntegrationUtils.findOuterClass(element);
}
@Override
diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaAnnotationIndex.java b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaAnnotationIndex.java
index 90edae7..67f8bde3 100644
--- a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaAnnotationIndex.java
+++ b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaAnnotationIndex.java
@@ -44,7 +44,7 @@
}
@Override
- public Collection<PsiAnnotation> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
+ public Collection<PsiAnnotation> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiAnnotation.class);
}
}
\ No newline at end of file
diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaAnonymousClassBaseRefOccurenceIndex.java b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaAnonymousClassBaseRefOccurenceIndex.java
index 3c92cd4..0439ea5 100644
--- a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaAnonymousClassBaseRefOccurenceIndex.java
+++ b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaAnonymousClassBaseRefOccurenceIndex.java
@@ -45,7 +45,7 @@
}
@Override
- public Collection<PsiAnonymousClass> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
+ public Collection<PsiAnonymousClass> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiAnonymousClass.class);
}
}
\ No newline at end of file
diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaFieldNameIndex.java b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaFieldNameIndex.java
index 873ea3e..d2d4cc8 100644
--- a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaFieldNameIndex.java
+++ b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaFieldNameIndex.java
@@ -44,7 +44,7 @@
}
@Override
- public Collection<PsiField> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
+ public Collection<PsiField> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiField.class);
}
}
\ No newline at end of file
diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaFullClassNameIndex.java b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaFullClassNameIndex.java
index 045fdc0..ecabef2 100644
--- a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaFullClassNameIndex.java
+++ b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaFullClassNameIndex.java
@@ -44,7 +44,7 @@
}
@Override
- public Collection<PsiClass> get(final Integer integer, final Project project, @NotNull final GlobalSearchScope scope) {
+ public Collection<PsiClass> get(@NotNull final Integer integer, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
return StubIndex.getElements(getKey(), integer, project, new JavaSourceFilterScope(scope), PsiClass.class);
}
}
\ No newline at end of file
diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaMethodNameIndex.java b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaMethodNameIndex.java
index daf3f52..42e95d3 100644
--- a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaMethodNameIndex.java
+++ b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaMethodNameIndex.java
@@ -44,7 +44,7 @@
}
@Override
- public Collection<PsiMethod> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
+ public Collection<PsiMethod> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiMethod.class);
}
}
\ No newline at end of file
diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaMethodParameterTypesIndex.java b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaMethodParameterTypesIndex.java
index 689961e..23f4ffa 100644
--- a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaMethodParameterTypesIndex.java
+++ b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaMethodParameterTypesIndex.java
@@ -44,7 +44,7 @@
}
@Override
- public Collection<PsiMethod> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
+ public Collection<PsiMethod> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiMethod.class);
}
}
\ No newline at end of file
diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaShortClassNameIndex.java b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaShortClassNameIndex.java
index 35e1d1e..5f0d929 100644
--- a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaShortClassNameIndex.java
+++ b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaShortClassNameIndex.java
@@ -51,7 +51,7 @@
}
@Override
- public Collection<PsiClass> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
+ public Collection<PsiClass> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiClass.class);
}
diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaSuperClassNameOccurenceIndex.java b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaSuperClassNameOccurenceIndex.java
index dcd7ae9..542ed38 100644
--- a/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaSuperClassNameOccurenceIndex.java
+++ b/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaSuperClassNameOccurenceIndex.java
@@ -45,7 +45,7 @@
}
@Override
- public Collection<PsiReferenceList> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
+ public Collection<PsiReferenceList> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiReferenceList.class);
}
diff --git a/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java b/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java
index c0cd96c..c2c79a9 100644
--- a/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java
+++ b/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java
@@ -113,13 +113,21 @@
}
}
if (!skipExternal) {
- final ExternalAnnotationsManager annotationsManager = ExternalAnnotationsManager.getInstance(listOwner.getProject());
+ final Project project = listOwner.getProject();
+ final ExternalAnnotationsManager annotationsManager = ExternalAnnotationsManager.getInstance(project);
for (String annotationName : annotationNames) {
final PsiAnnotation annotation = annotationsManager.findExternalAnnotation(listOwner, annotationName);
if (annotation != null) {
return annotation;
}
}
+ final InferredAnnotationsManager inferredAnnotationsManager = InferredAnnotationsManager.getInstance(project);
+ for (String annotationName : annotationNames) {
+ final PsiAnnotation annotation = inferredAnnotationsManager.findInferredAnnotation(listOwner, annotationName);
+ if (annotation != null) {
+ return annotation;
+ }
+ }
}
return null;
}
@@ -269,8 +277,12 @@
if (modifierList == null) return false;
PsiAnnotation annotation = modifierList.findAnnotation(annotationFQN);
if (annotation != null) return true;
- if (!skipExternal && ExternalAnnotationsManager.getInstance(listOwner.getProject()).findExternalAnnotation(listOwner, annotationFQN) != null) {
- return true;
+ if (!skipExternal) {
+ final Project project = listOwner.getProject();
+ if (ExternalAnnotationsManager.getInstance(project).findExternalAnnotation(listOwner, annotationFQN) != null ||
+ InferredAnnotationsManager.getInstance(project).findInferredAnnotation(listOwner, annotationFQN) != null) {
+ return true;
+ }
}
if (checkHierarchy) {
if (listOwner instanceof PsiMethod) {
@@ -365,17 +377,31 @@
}
@NotNull
- public static PsiAnnotation[] getAllAnnotations(@NotNull PsiModifierListOwner owner, boolean inHierarchy, Set<PsiModifierListOwner> visited) {
+ public static PsiAnnotation[] getAllAnnotations(@NotNull PsiModifierListOwner owner,
+ boolean inHierarchy,
+ Set<PsiModifierListOwner> visited) {
+ return getAllAnnotations(owner, inHierarchy, visited, true);
+ }
+
+ @NotNull
+ public static PsiAnnotation[] getAllAnnotations(@NotNull PsiModifierListOwner owner,
+ boolean inHierarchy,
+ Set<PsiModifierListOwner> visited, boolean withInferred) {
final PsiModifierList list = owner.getModifierList();
PsiAnnotation[] annotations = PsiAnnotation.EMPTY_ARRAY;
if (list != null) {
annotations = list.getAnnotations();
}
- final PsiAnnotation[] externalAnnotations = ExternalAnnotationsManager.getInstance(owner.getProject()).findExternalAnnotations(owner);
+ final Project project = owner.getProject();
+ final PsiAnnotation[] externalAnnotations = ExternalAnnotationsManager.getInstance(project).findExternalAnnotations(owner);
if (externalAnnotations != null) {
annotations = ArrayUtil.mergeArrays(annotations, externalAnnotations, PsiAnnotation.ARRAY_FACTORY);
}
+ if (withInferred) {
+ final PsiAnnotation[] inferredAnnotations = InferredAnnotationsManager.getInstance(project).findInferredAnnotations(owner);
+ annotations = ArrayUtil.mergeArrays(annotations, inferredAnnotations, PsiAnnotation.ARRAY_FACTORY);
+ }
if (inHierarchy) {
if (owner instanceof PsiClass) {
@@ -435,6 +461,10 @@
return PsiTreeUtil.getParentOfType(element, PsiNameValuePair.class, PsiArrayInitializerMemberValue.class) != null;
}
+ public static boolean isInferredAnnotation(@NotNull PsiAnnotation annotation) {
+ return InferredAnnotationsManager.getInstance(annotation.getProject()).isInferredAnnotation(annotation);
+ }
+
@Nullable
public static String getStringAttributeValue(@NotNull PsiAnnotation anno, @Nullable final String attributeName) {
PsiAnnotationMemberValue attrValue = anno.findAttributeValue(attributeName);
diff --git a/java/java-psi-api/src/com/intellij/codeInsight/InferredAnnotationsManager.java b/java/java-psi-api/src/com/intellij/codeInsight/InferredAnnotationsManager.java
new file mode 100644
index 0000000..b3fbfe7
--- /dev/null
+++ b/java/java-psi-api/src/com/intellij/codeInsight/InferredAnnotationsManager.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2014 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.codeInsight;
+
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.NotNullLazyKey;
+import com.intellij.psi.PsiAnnotation;
+import com.intellij.psi.PsiModifierListOwner;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public abstract class InferredAnnotationsManager {
+ private static final NotNullLazyKey<InferredAnnotationsManager, Project> INSTANCE_KEY = ServiceManager.createLazyKey(InferredAnnotationsManager.class);
+
+ public static InferredAnnotationsManager getInstance(@NotNull Project project) {
+ return INSTANCE_KEY.getValue(project);
+ }
+
+ @Nullable
+ public abstract PsiAnnotation findInferredAnnotation(@NotNull PsiModifierListOwner listOwner, @NotNull String annotationFQN);
+
+ @NotNull
+ public abstract PsiAnnotation[] findInferredAnnotations(@NotNull PsiModifierListOwner listOwner);
+
+ public abstract boolean isInferredAnnotation(@NotNull PsiAnnotation annotation);
+}
diff --git a/java/java-psi-api/src/com/intellij/codeInsight/NullableNotNullManager.java b/java/java-psi-api/src/com/intellij/codeInsight/NullableNotNullManager.java
index 192d19c..21e014e 100644
--- a/java/java-psi-api/src/com/intellij/codeInsight/NullableNotNullManager.java
+++ b/java/java-psi-api/src/com/intellij/codeInsight/NullableNotNullManager.java
@@ -94,10 +94,15 @@
@Nullable
public String getNullable(PsiModifierListOwner owner) {
- PsiAnnotation annotation = findNullabilityAnnotation(owner, false, true);
+ PsiAnnotation annotation = getNullableAnnotation(owner, false);
return annotation == null ? null : annotation.getQualifiedName();
}
+ @Nullable
+ public PsiAnnotation getNullableAnnotation(PsiModifierListOwner owner, boolean checkBases) {
+ return findNullabilityAnnotation(owner, checkBases, true);
+ }
+
public void setDefaultNullable(@NotNull String defaultNullable) {
LOG.assertTrue(getNullables().contains(defaultNullable));
myDefaultNullable = defaultNullable;
@@ -108,8 +113,13 @@
}
@Nullable
+ public PsiAnnotation getNotNullAnnotation(PsiModifierListOwner owner, boolean checkBases) {
+ return findNullabilityAnnotation(owner, checkBases, false);
+ }
+
+ @Nullable
public String getNotNull(PsiModifierListOwner owner) {
- PsiAnnotation annotation = findNullabilityAnnotation(owner, false, false);
+ PsiAnnotation annotation = getNotNullAnnotation(owner, false);
return annotation == null ? null : annotation.getQualifiedName();
}
diff --git a/java/java-psi-api/src/com/intellij/psi/PsiMethodReferenceUtil.java b/java/java-psi-api/src/com/intellij/psi/PsiMethodReferenceUtil.java
index fe45c66..87afd3d 100644
--- a/java/java-psi-api/src/com/intellij/psi/PsiMethodReferenceUtil.java
+++ b/java/java-psi-api/src/com/intellij/psi/PsiMethodReferenceUtil.java
@@ -44,7 +44,15 @@
public static String checkReturnType(PsiMethodReferenceExpression expression, JavaResolveResult result, PsiType functionalInterfaceType) {
final PsiElement resolve = result.getElement();
if (resolve instanceof PsiMethod) {
+ final PsiClass containingClass = ((PsiMethod)resolve).getContainingClass();
+ LOG.assertTrue(containingClass != null);
PsiSubstitutor subst = result.getSubstitutor();
+ PsiClass qContainingClass = getQualifierResolveResult(expression).getContainingClass();
+ if (qContainingClass != null && InheritanceUtil.isInheritorOrSelf(qContainingClass, containingClass, true)) {
+ subst = TypeConversionUtil.getClassSubstitutor(containingClass, qContainingClass, subst);
+ LOG.assertTrue(subst != null);
+ }
+
final PsiType interfaceReturnType = LambdaUtil.getFunctionalInterfaceReturnType(functionalInterfaceType);
@@ -57,7 +65,7 @@
PsiType methodReturnType = subst.substitute(returnType);
if (interfaceReturnType != null && interfaceReturnType != PsiType.VOID) {
if (methodReturnType == null) {
- methodReturnType = JavaPsiFacade.getElementFactory(expression.getProject()).createType(((PsiMethod)resolve).getContainingClass(), subst);
+ methodReturnType = JavaPsiFacade.getElementFactory(expression.getProject()).createType(containingClass, subst);
}
if (!TypeConversionUtil.isAssignable(interfaceReturnType, methodReturnType, false)) {
return "Bad return type in method reference: cannot convert " + methodReturnType.getCanonicalText() + " to " + interfaceReturnType.getCanonicalText();
diff --git a/java/java-psi-api/src/com/intellij/psi/util/MethodSignatureUtil.java b/java/java-psi-api/src/com/intellij/psi/util/MethodSignatureUtil.java
index 388da3b..622714c 100644
--- a/java/java-psi-api/src/com/intellij/psi/util/MethodSignatureUtil.java
+++ b/java/java-psi-api/src/com/intellij/psi/util/MethodSignatureUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
diff --git a/java/java-psi-api/src/com/intellij/psi/util/PsiFormatUtil.java b/java/java-psi-api/src/com/intellij/psi/util/PsiFormatUtil.java
index 472e7cd..885f1bd 100644
--- a/java/java-psi-api/src/com/intellij/psi/util/PsiFormatUtil.java
+++ b/java/java-psi-api/src/com/intellij/psi/util/PsiFormatUtil.java
@@ -450,6 +450,40 @@
return builder.toString();
}
+ @Nullable
+ public static String getRawExternalName(PsiModifierListOwner owner) {
+ final StringBuilder builder = new StringBuilder();
+ final PsiClass psiClass = PsiTreeUtil.getParentOfType(owner, PsiClass.class, false);
+ if (psiClass == null) return null;
+ ClassUtil.formatClassName(psiClass, builder);
+ if (owner instanceof PsiMethod) {
+ builder.append(" ");
+ formatMethod((PsiMethod)owner, PsiSubstitutor.EMPTY,
+ SHOW_NAME | SHOW_FQ_NAME | SHOW_TYPE | SHOW_RAW_TYPE | SHOW_PARAMETERS | SHOW_FQ_CLASS_NAMES,
+ SHOW_TYPE | SHOW_RAW_TYPE | SHOW_FQ_CLASS_NAMES,
+ Integer.MAX_VALUE, builder);
+ }
+ else if (owner instanceof PsiParameter) {
+ final PsiElement declarationScope = ((PsiParameter)owner).getDeclarationScope();
+ if (!(declarationScope instanceof PsiMethod)) {
+ return null;
+ }
+ final PsiMethod psiMethod = (PsiMethod)declarationScope;
+
+ builder.append(" ");
+ formatMethod(psiMethod, PsiSubstitutor.EMPTY,
+ SHOW_NAME | SHOW_FQ_NAME | SHOW_TYPE | SHOW_RAW_TYPE | SHOW_PARAMETERS | SHOW_FQ_CLASS_NAMES,
+ SHOW_TYPE | SHOW_RAW_TYPE | SHOW_FQ_CLASS_NAMES,
+ Integer.MAX_VALUE, builder);
+ builder.append(" ");
+ builder.append(psiMethod.getParameterList().getParameterIndex((PsiParameter)owner));
+ }
+ else {
+ return null;
+ }
+ return builder.toString();
+ }
+
public static String getPackageDisplayName(@NotNull final PsiClass psiClass) {
if (psiClass instanceof PsiTypeParameter) {
PsiTypeParameterListOwner owner = ((PsiTypeParameter)psiClass).getOwner();
diff --git a/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java b/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java
index 1a7e71c..b721d80 100644
--- a/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java
+++ b/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java
@@ -181,6 +181,7 @@
@Nullable
public static PsiType createJavaLangClassType(@NotNull PsiElement context, @Nullable PsiType qualifierType, boolean captureTopLevelWildcards) {
if (qualifierType != null) {
+ PsiUtil.ensureValidType(qualifierType);
JavaPsiFacade facade = JavaPsiFacade.getInstance(context.getProject());
PsiClass javaLangClass = facade.findClass(CommonClassNames.JAVA_LANG_CLASS, context.getResolveScope());
if (javaLangClass != null && javaLangClass.getTypeParameters().length == 1) {
diff --git a/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java b/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java
index b71214f..e549371 100644
--- a/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java
+++ b/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java
@@ -775,7 +775,7 @@
@NotNull
public static Iterable<PsiTypeParameter> typeParametersIterable(@NotNull final PsiTypeParameterListOwner owner) {
- ArrayList<PsiTypeParameter> result = null;
+ List<PsiTypeParameter> result = null;
PsiTypeParameterListOwner currentOwner = owner;
while (currentOwner != null) {
diff --git a/java/java-psi-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilderBase.java b/java/java-psi-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilderBase.java
index 9f5ecb1..5e008af 100644
--- a/java/java-psi-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilderBase.java
+++ b/java/java-psi-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilderBase.java
@@ -45,7 +45,6 @@
import com.intellij.util.Function;
import com.intellij.util.ObjectUtils;
import com.intellij.util.text.CharArrayUtil;
-import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -701,7 +700,7 @@
else if (element instanceof PsiComment) {
return settings.isCollapseEndOfLineComments();
}
- else if (isLiteralExpression(element)
+ else if (ParameterNameFoldingManager.isLiteralExpression(element)
&& element.getParent() instanceof PsiExpressionList
&& (element.getParent().getParent() instanceof PsiCallExpression
|| element.getParent().getParent() instanceof PsiAnonymousClass)) {
@@ -760,55 +759,8 @@
if (quick || !JavaCodeFoldingSettings.getInstance().isInlineParameterNamesForLiteralCallArguments()) {
return;
}
- PsiExpressionList callArgumentsList = expression.getArgumentList();
- if (callArgumentsList == null) {
- return;
- }
-
- PsiExpression[] callArguments = callArgumentsList.getExpressions();
- if (callArguments.length > 1) {
- PsiParameter[] parameters = null;
- boolean isResolved = false;
-
- for (int i = 0; i < callArguments.length; i++) {
- PsiExpression callArgument = callArguments[i];
-
- if (callArgument.getType() != null && isLiteralExpression(callArgument)) {
- if (!isResolved) {
- PsiMethod method = expression.resolveMethod();
- isResolved = true;
- if (method == null) {
- return;
- }
- parameters = method.getParameterList().getParameters();
- if (parameters.length != callArguments.length) {
- return;
- }
- }
-
- PsiParameter methodParam = parameters[i];
- if (TypeConversionUtil.isAssignable(methodParam.getType(), callArgument.getType())) {
- TextRange range = callArgument.getTextRange();
- String placeholderText = methodParam.getName() + ": " + callArgument.getText();
- foldElements.add(new NamedFoldingDescriptor(callArgument, range.getStartOffset(), range.getEndOffset(), null, placeholderText));
- }
- }
- }
- }
- }
-
- @Contract("null -> false")
- private static boolean isLiteralExpression(@Nullable PsiElement callArgument) {
- if (callArgument instanceof PsiLiteralExpression)
- return true;
-
- if (callArgument instanceof PsiPrefixExpression) {
- PsiPrefixExpression expr = (PsiPrefixExpression)callArgument;
- IElementType tokenType = expr.getOperationTokenType();
- return JavaTokenType.MINUS.equals(tokenType) && expr.getOperand() instanceof PsiLiteralExpression;
- }
-
- return false;
+ ParameterNameFoldingManager manager = new ParameterNameFoldingManager(expression);
+ foldElements.addAll(manager.buildDescriptors());
}
private boolean addClosureFolding(final PsiClass aClass, final Document document, final List<FoldingDescriptor> foldElements,
diff --git a/java/java-psi-impl/src/com/intellij/codeInsight/folding/impl/ParameterNameFoldingManager.java b/java/java-psi-impl/src/com/intellij/codeInsight/folding/impl/ParameterNameFoldingManager.java
new file mode 100644
index 0000000..aca4357
--- /dev/null
+++ b/java/java-psi-impl/src/com/intellij/codeInsight/folding/impl/ParameterNameFoldingManager.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2000-2014 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.codeInsight.folding.impl;
+
+import com.intellij.lang.folding.FoldingDescriptor;
+import com.intellij.lang.folding.NamedFoldingDescriptor;
+import com.intellij.openapi.util.Couple;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.*;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.TypeConversionUtil;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+public class ParameterNameFoldingManager {
+ private static final int MIN_NAME_LENGTH_THRESHOLD = 3;
+ private static final int MIN_ARGS_TO_FOLD = 2;
+
+ private static final List<Couple<String>> COMMONLY_USED_PARAMETER_PAIR = ContainerUtil.newArrayList(
+ Couple.of("begin", "end"),
+ Couple.of("start", "end"),
+ Couple.of("first", "last"),
+ Couple.of("first", "second"),
+ Couple.of("from", "to"),
+ Couple.of("key", "value")
+ );
+
+ private final PsiCallExpression myCallExpression;
+
+ private PsiExpression[] myCallArguments;
+ private PsiParameter[] myParameters;
+
+ public ParameterNameFoldingManager(@NotNull PsiCallExpression callExpression) {
+ myCallExpression = callExpression;
+ }
+
+ public static boolean isLiteralExpression(@Nullable PsiElement callArgument) {
+ if (callArgument instanceof PsiLiteralExpression)
+ return true;
+
+ if (callArgument instanceof PsiPrefixExpression) {
+ PsiPrefixExpression expr = (PsiPrefixExpression)callArgument;
+ IElementType tokenType = expr.getOperationTokenType();
+ return JavaTokenType.MINUS.equals(tokenType) && expr.getOperand() instanceof PsiLiteralExpression;
+ }
+
+ return false;
+ }
+
+ @Nullable
+ public PsiExpression[] getArguments(@NotNull PsiCallExpression call) {
+ PsiExpressionList callArgumentsList = call.getArgumentList();
+ return callArgumentsList != null ? callArgumentsList.getExpressions() : null;
+ }
+
+ @NotNull
+ public List<FoldingDescriptor> buildDescriptors() {
+ myCallArguments = getArguments(myCallExpression);
+
+ if (myCallArguments != null && myCallArguments.length >= MIN_ARGS_TO_FOLD && hasLiteralExpression(myCallArguments)) {
+ PsiMethod method = myCallExpression.resolveMethod();
+
+ if (method != null) {
+ myParameters = method.getParameterList().getParameters();
+ if (myParameters.length == myCallArguments.length) {
+ return buildDescriptorsForLiteralArguments();
+ }
+ }
+ }
+
+ return ContainerUtil.emptyList();
+ }
+
+ @NotNull
+ private List<FoldingDescriptor> buildDescriptorsForLiteralArguments() {
+ List<FoldingDescriptor> descriptors = ContainerUtil.newArrayList();
+
+ int i = 0;
+ while (i < myCallArguments.length) {
+ if (i + 1 < myCallArguments.length && isCommonlyNamedParameterPair(i, i + 1)) {
+ i += 2;
+ continue;
+ }
+
+ if (shouldInlineParameterName(i)) {
+ descriptors.add(createFoldingDescriptor(myCallArguments[i], myParameters[i]));
+ }
+ i++;
+ }
+
+ return descriptors;
+ }
+
+ @NotNull
+ private static NamedFoldingDescriptor createFoldingDescriptor(@NotNull PsiExpression callArgument, @NotNull PsiParameter methodParam) {
+ TextRange range = callArgument.getTextRange();
+ String placeholderText = methodParam.getName() + ": " + callArgument.getText();
+ return new NamedFoldingDescriptor(callArgument, range.getStartOffset(), range.getEndOffset(), null, placeholderText);
+ }
+
+ private boolean isCommonlyNamedParameterPair(int first, int second) {
+ assert first < myParameters.length && second < myParameters.length;
+
+ String firstParamName = myParameters[first].getName();
+ String secondParamName = myParameters[second].getName();
+ if (firstParamName == null || secondParamName == null) return false;
+
+ for (Couple<String> knownPair : COMMONLY_USED_PARAMETER_PAIR) {
+ if (StringUtil.containsIgnoreCase(firstParamName, knownPair.first)
+ && StringUtil.containsIgnoreCase(secondParamName, knownPair.second)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private boolean shouldInlineParameterName(int paramIndex) {
+ PsiExpression argument = myCallArguments[paramIndex];
+ if (isLiteralExpression(argument) && argument.getType() != null) {
+ PsiParameter parameter = myParameters[paramIndex];
+ String paramName = parameter.getName();
+ if (paramName != null && paramName.length() >= MIN_NAME_LENGTH_THRESHOLD) {
+ return TypeConversionUtil.isAssignable(parameter.getType(), argument.getType());
+ }
+ }
+ return false;
+ }
+
+ private static boolean hasLiteralExpression(@NotNull PsiExpression[] arguments) {
+ for (PsiExpression argument : arguments) {
+ if (isLiteralExpression(argument)) return true;
+ }
+ return false;
+ }
+}
diff --git a/java/java-psi-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java b/java/java-psi-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java
index 0052dd5..f2b9583 100644
--- a/java/java-psi-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java
+++ b/java/java-psi-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java
@@ -18,6 +18,7 @@
import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.ExternalAnnotationsManager;
+import com.intellij.codeInsight.InferredAnnotationsManager;
import com.intellij.codeInsight.documentation.DocumentationManagerUtil;
import com.intellij.lang.ASTNode;
import com.intellij.lang.LangBundle;
@@ -217,6 +218,7 @@
LOG.debug(text);
}
+ text = StringUtil.replaceIgnoreCase(text, "<p/>", "<p></p>");
return StringUtil.replace(text, "/>", ">");
}
@@ -321,7 +323,7 @@
}
private static boolean generateClassSignature(StringBuilder buffer, PsiClass aClass, boolean generateLink) {
- generateAnnotations(buffer, aClass, generateLink);
+ generateAnnotations(buffer, aClass, generateLink, true);
String modifiers = PsiFormatUtil.formatModifiers(aClass, PsiFormatUtilBase.JAVADOC_MODIFIERS_ONLY);
if (!modifiers.isEmpty()) {
buffer.append(modifiers);
@@ -487,7 +489,7 @@
}
private static void generateFieldSignature(StringBuilder buffer, PsiField field, boolean generateLink) {
- generateAnnotations(buffer, field, generateLink);
+ generateAnnotations(buffer, field, generateLink, true);
String modifiers = PsiFormatUtil.formatModifiers(field, PsiFormatUtilBase.JAVADOC_MODIFIERS_ONLY);
if (!modifiers.isEmpty()) {
buffer.append(modifiers);
@@ -695,30 +697,38 @@
}
}
- private static void generateAnnotations(@NonNls @NotNull StringBuilder buffer, @NotNull PsiModifierListOwner owner, boolean generateLink) {
+ private static void generateAnnotations(@NonNls @NotNull StringBuilder buffer,
+ @NotNull PsiModifierListOwner owner,
+ boolean generateLink,
+ boolean splitAnnotations) {
final PsiModifierList ownerModifierList = owner.getModifierList();
if (ownerModifierList == null) return;
- generateAnnotations(buffer, owner, ownerModifierList.getAnnotations(), false, generateLink);
- final PsiAnnotation[] externalAnnotations = ExternalAnnotationsManager.getInstance(owner.getProject()).findExternalAnnotations(owner);
- if (externalAnnotations != null) {
- generateAnnotations(buffer, owner, externalAnnotations, true, generateLink);
+ generateAnnotations(buffer, owner, ownerModifierList.getAnnotations(), false, generateLink, splitAnnotations);
+ PsiAnnotation[] externalAnnotations = ExternalAnnotationsManager.getInstance(owner.getProject()).findExternalAnnotations(owner);
+ if (externalAnnotations == null) {
+ externalAnnotations = new PsiAnnotation[]{};
}
+ PsiAnnotation[] inferredAnnotations = InferredAnnotationsManager.getInstance(owner.getProject()).findInferredAnnotations(owner);
+ externalAnnotations = ArrayUtil.mergeArrays(externalAnnotations, inferredAnnotations, PsiAnnotation.ARRAY_FACTORY);
+ generateAnnotations(buffer, owner, externalAnnotations, true, generateLink, splitAnnotations);
}
private static void generateAnnotations(StringBuilder buffer,
PsiModifierListOwner owner,
PsiAnnotation[] annotations,
boolean external,
- boolean generateLink) {
+ boolean generateLink, boolean splitAnnotations) {
PsiManager manager = owner.getManager();
for (PsiAnnotation annotation : annotations) {
final PsiJavaCodeReferenceElement nameReferenceElement = annotation.getNameReferenceElement();
if (nameReferenceElement == null) continue;
final PsiElement resolved = nameReferenceElement.resolve();
+ boolean inferred = AnnotationUtil.isInferredAnnotation(annotation);
if (resolved instanceof PsiClass) {
final PsiClass annotationType = (PsiClass)resolved;
if (AnnotationUtil.isAnnotated(annotationType, "java.lang.annotation.Documented", false)) {
+ if (inferred) buffer.append("<i>");
final PsiClassType type = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory().createType(annotationType, PsiSubstitutor.EMPTY);
buffer.append("@");
generateType(buffer, type, owner, generateLink);
@@ -736,24 +746,27 @@
}
final PsiAnnotationMemberValue value = pair.getValue();
if (value != null) {
- buffer.append(value.getText());
+ buffer.append(XmlStringUtil.escapeString(value.getText()));
}
}
buffer.append(")");
}
+ if (inferred) buffer.append("</i>");
buffer.append(" ");
}
} else if (external) {
- buffer.append(annotation.getText());
+ if (inferred) buffer.append("<i>");
+ buffer.append(XmlStringUtil.escapeString(annotation.getText()));
buffer.append(" ");
+ if (inferred) buffer.append("</i>");
}
else {
buffer.append("<font color=red>");
- buffer.append(annotation.getText());
+ buffer.append(XmlStringUtil.escapeString(annotation.getText()));
buffer.append("</font>");
buffer.append(" ");
}
- buffer.append("\n");
+ if (splitAnnotations) buffer.append("\n");
}
}
@@ -767,7 +780,7 @@
buffer.append(modifiers);
buffer.append(" ");
}
- generateAnnotations(buffer, parameter, true);
+ generateAnnotations(buffer, parameter, true, true);
generateType(buffer, parameter.getType(), parameter);
buffer.append(" ");
buffer.append("<b>");
@@ -843,7 +856,7 @@
}
private static void generateMethodSignature(StringBuilder buffer, PsiMethod method, boolean generateLink) {
- generateAnnotations(buffer, method, generateLink);
+ generateAnnotations(buffer, method, generateLink, true);
String modifiers = PsiFormatUtil.formatModifiers(method, PsiFormatUtilBase.JAVADOC_MODIFIERS_ONLY);
int indent = 0;
if (!modifiers.isEmpty()) {
@@ -876,7 +889,7 @@
PsiParameter[] parms = method.getParameterList().getParameters();
for (int i = 0; i < parms.length; i++) {
PsiParameter parm = parms[i];
- generateAnnotations(buffer, parm, generateLink);
+ generateAnnotations(buffer, parm, generateLink, false);
generateType(buffer, parm.getType(), method, generateLink);
buffer.append(" ");
if (parm.getName() != null) {
diff --git a/java/java-psi-impl/src/com/intellij/lang/java/parser/DeclarationParser.java b/java/java-psi-impl/src/com/intellij/lang/java/parser/DeclarationParser.java
index 0377048d..36d0247 100644
--- a/java/java-psi-impl/src/com/intellij/lang/java/parser/DeclarationParser.java
+++ b/java/java-psi-impl/src/com/intellij/lang/java/parser/DeclarationParser.java
@@ -46,6 +46,8 @@
JavaTokenType.IDENTIFIER, JavaTokenType.COMMA, JavaTokenType.THROWS_KEYWORD);
private static final TokenSet PARAM_LIST_STOPPERS = TokenSet.create(
JavaTokenType.RPARENTH, JavaTokenType.LBRACE, JavaTokenType.ARROW);
+ private static final TokenSet TYPE_START = TokenSet.orSet(
+ ElementType.PRIMITIVE_TYPE_BIT_SET, TokenSet.create(JavaTokenType.IDENTIFIER, JavaTokenType.AT));
private static final String WHITESPACES = "\n\r \t";
private static final String LINE_ENDS = "\n\r";
@@ -278,56 +280,64 @@
return modList;
}
- PsiBuilder.Marker type;
- if (ElementType.PRIMITIVE_TYPE_BIT_SET.contains(builder.getTokenType())) {
- type = parseTypeNotNull(builder);
- }
- else if (builder.getTokenType() == JavaTokenType.IDENTIFIER) {
- final PsiBuilder.Marker idPos = builder.mark();
- type = parseTypeNotNull(builder);
- if (builder.getTokenType() == JavaTokenType.LPARENTH) { // constructor
- if (context == Context.CODE_BLOCK) {
- declaration.rollbackTo();
- return null;
- }
- idPos.rollbackTo();
- if (typeParams == null) {
- emptyElement(builder, JavaElementType.TYPE_PARAMETER_LIST);
- }
- builder.advanceLexer();
- if (builder.getTokenType() != JavaTokenType.LPARENTH) {
- declaration.rollbackTo();
- return null;
- }
- return parseMethodFromLeftParenth(builder, declaration, false, true);
- }
- idPos.drop();
- }
- else if (builder.getTokenType() == JavaTokenType.LBRACE) {
+ if (builder.getTokenType() == JavaTokenType.LBRACE) {
if (context == Context.CODE_BLOCK) {
error(builder, JavaErrorMessages.message("expected.identifier.or.type"), typeParams);
declaration.drop();
return modList;
}
- final PsiBuilder.Marker codeBlock = myParser.getStatementParser().parseCodeBlock(builder);
+ PsiBuilder.Marker codeBlock = myParser.getStatementParser().parseCodeBlock(builder);
assert codeBlock != null : builder.getOriginalText();
if (typeParams != null) {
- final PsiBuilder.Marker error = typeParams.precede();
+ PsiBuilder.Marker error = typeParams.precede();
error.errorBefore(JavaErrorMessages.message("unexpected.token"), codeBlock);
}
+
done(declaration, JavaElementType.CLASS_INITIALIZER);
return declaration;
}
- else {
- final PsiBuilder.Marker error;
- if (typeParams != null) {
- error = typeParams.precede();
+
+ PsiBuilder.Marker type = null;
+
+ if (TYPE_START.contains(builder.getTokenType())) {
+ PsiBuilder.Marker pos = builder.mark();
+
+ type = myParser.getReferenceParser().parseType(builder, ReferenceParser.EAT_LAST_DOT | ReferenceParser.WILDCARD);
+
+ if (type == null) {
+ pos.rollbackTo();
+ }
+ else if (builder.getTokenType() == JavaTokenType.LPARENTH) { // constructor
+ if (context == Context.CODE_BLOCK) {
+ declaration.rollbackTo();
+ return null;
+ }
+
+ pos.rollbackTo();
+
+ if (typeParams == null) {
+ emptyElement(builder, JavaElementType.TYPE_PARAMETER_LIST);
+ }
+ parseAnnotations(builder);
+ builder.advanceLexer();
+
+ if (builder.getTokenType() == JavaTokenType.LPARENTH) {
+ return parseMethodFromLeftParenth(builder, declaration, false, true);
+ }
+ else {
+ declaration.rollbackTo();
+ return null;
+ }
}
else {
- error = builder.mark();
+ pos.drop();
}
+ }
+
+ if (type == null) {
+ PsiBuilder.Marker error = typeParams != null ? typeParams.precede() : builder.mark();
error.error(JavaErrorMessages.message("expected.identifier.or.type"));
declaration.drop();
return modList;
@@ -364,13 +374,6 @@
}
@NotNull
- private PsiBuilder.Marker parseTypeNotNull(final PsiBuilder builder) {
- final PsiBuilder.Marker type = myParser.getReferenceParser().parseType(builder, ReferenceParser.EAT_LAST_DOT | ReferenceParser.WILDCARD);
- assert type != null : builder.getOriginalText();
- return type;
- }
-
- @NotNull
public Pair<PsiBuilder.Marker, Boolean> parseModifierList(final PsiBuilder builder) {
return parseModifierList(builder, ElementType.MODIFIER_BIT_SET);
}
diff --git a/java/java-psi-impl/src/com/intellij/lang/java/parser/ReferenceParser.java b/java/java-psi-impl/src/com/intellij/lang/java/parser/ReferenceParser.java
index 42a41d5..e18b1b5 100644
--- a/java/java-psi-impl/src/com/intellij/lang/java/parser/ReferenceParser.java
+++ b/java/java-psi-impl/src/com/intellij/lang/java/parser/ReferenceParser.java
@@ -277,8 +277,8 @@
error(builder, JavaErrorMessages.message("expected.identifier"));
}
else {
- final IElementType tokenType = builder.getTokenType();
- if (WILDCARD_KEYWORD_SET.contains(tokenType) && tokenType != null) {
+ IElementType tokenType = builder.getTokenType();
+ if (WILDCARD_KEYWORD_SET.contains(tokenType)) {
parseReferenceList(builder, tokenType, null, JavaTokenType.AND);
}
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/InheritanceImplUtil.java b/java/java-psi-impl/src/com/intellij/psi/impl/InheritanceImplUtil.java
index 543c8a6..f958555 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/InheritanceImplUtil.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/InheritanceImplUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -24,7 +24,7 @@
import com.intellij.psi.util.CachedValuesManager;
import com.intellij.psi.util.InheritanceUtil;
import com.intellij.psi.util.PsiModificationTracker;
-import com.intellij.util.containers.ConcurrentHashMap;
+import com.intellij.util.containers.ConcurrentWeakHashMap;
import com.intellij.util.containers.HashSet;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NonNls;
@@ -41,14 +41,14 @@
if (baseClass instanceof PsiAnonymousClass) return false;
if (!checkDeep) return isInheritor(candidateClass, baseClass, false, null);
- if (CommonClassNames.JAVA_LANG_OBJECT.equals(candidateClass.getQualifiedName())) return false;
- if (CommonClassNames.JAVA_LANG_OBJECT.equals(baseClass.getQualifiedName())) return true;
+ if (CommonClassNames.JAVA_LANG_OBJECT_SHORT.equals(candidateClass.getName()) && CommonClassNames.JAVA_LANG_OBJECT.equals(candidateClass.getQualifiedName())) return false;
+ if (CommonClassNames.JAVA_LANG_OBJECT_SHORT.equals(baseClass.getName()) && CommonClassNames.JAVA_LANG_OBJECT.equals(baseClass.getQualifiedName())) return true;
Map<PsiClass, Boolean> map = CachedValuesManager.
getCachedValue(candidateClass, new CachedValueProvider<Map<PsiClass, Boolean>>() {
@Nullable
@Override
public Result<Map<PsiClass, Boolean>> compute() {
- final Map<PsiClass, Boolean> map = new ConcurrentHashMap<PsiClass, Boolean>();
+ final Map<PsiClass, Boolean> map = new ConcurrentWeakHashMap<PsiClass, Boolean>();
return Result.create(map, candidateClass, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
}
});
@@ -82,7 +82,7 @@
}
@NonNls final String baseName = baseClass.getName();
- if ("Object".equals(baseName)) {
+ if (CommonClassNames.JAVA_LANG_OBJECT_SHORT.equals(baseName)) {
PsiClass objectClass = JavaPsiFacade.getInstance(manager.getProject()).findClass(CommonClassNames.JAVA_LANG_OBJECT, candidateClass.getResolveScope());
if (manager.areElementsEquivalent(baseClass, objectClass)) {
if (manager.areElementsEquivalent(candidateClass, objectClass)) return false;
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/JavaConstantExpressionEvaluator.java b/java/java-psi-impl/src/com/intellij/psi/impl/JavaConstantExpressionEvaluator.java
index 674ccbe..19da149 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/JavaConstantExpressionEvaluator.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/JavaConstantExpressionEvaluator.java
@@ -105,11 +105,11 @@
return myMapFactory.create();
}
- public static Object computeConstantExpression(PsiExpression expression, @Nullable Set<PsiVariable> visitedVars, boolean throwExceptionOnOverflow) {
+ public static Object computeConstantExpression(@Nullable PsiExpression expression, @Nullable Set<PsiVariable> visitedVars, boolean throwExceptionOnOverflow) {
return computeConstantExpression(expression, visitedVars, throwExceptionOnOverflow, null);
}
- public static Object computeConstantExpression(PsiExpression expression, @Nullable Set<PsiVariable> visitedVars, boolean throwExceptionOnOverflow,
+ public static Object computeConstantExpression(@Nullable PsiExpression expression, @Nullable Set<PsiVariable> visitedVars, boolean throwExceptionOnOverflow,
final PsiConstantEvaluationHelper.AuxEvaluator auxEvaluator) {
if (expression == null) return null;
@@ -131,7 +131,7 @@
return cached == NO_VALUE ? null : cached;
}
- public static Object computeConstantExpression(PsiExpression expression, boolean throwExceptionOnOverflow) {
+ public static Object computeConstantExpression(@Nullable PsiExpression expression, boolean throwExceptionOnOverflow) {
return computeConstantExpression(expression, null, throwExceptionOnOverflow);
}
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/compiled/SignatureParsing.java b/java/java-psi-impl/src/com/intellij/psi/impl/compiled/SignatureParsing.java
index 46cceff..bd5f75e 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/compiled/SignatureParsing.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/compiled/SignatureParsing.java
@@ -32,6 +32,7 @@
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.text.CharacterIterator;
@@ -259,7 +260,8 @@
return variance;
}
- public static String parseTypeString(CharacterIterator signature) throws ClsFormatException {
+ @NotNull
+ public static String parseTypeString(@NotNull CharacterIterator signature) throws ClsFormatException {
int arrayDimensions = 0;
while (signature.current() == '[') {
arrayDimensions++;
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaImportStatementElementType.java b/java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaImportStatementElementType.java
index 7c9af30..93e359e 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaImportStatementElementType.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaImportStatementElementType.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -24,7 +24,7 @@
import com.intellij.psi.impl.source.PsiImportStatementImpl;
import com.intellij.psi.impl.source.PsiImportStaticStatementImpl;
import com.intellij.psi.impl.source.tree.JavaElementType;
-import com.intellij.psi.impl.source.tree.SourceUtil;
+import com.intellij.psi.impl.source.tree.JavaSourceUtil;
import com.intellij.psi.impl.source.tree.java.ImportStaticStatementElement;
import com.intellij.psi.stubs.IndexSink;
import com.intellij.psi.stubs.StubElement;
@@ -68,7 +68,7 @@
for (LighterASTNode child : tree.getChildren(node)) {
IElementType type = child.getTokenType();
if (type == JavaElementType.JAVA_CODE_REFERENCE || type == JavaElementType.IMPORT_STATIC_REFERENCE) {
- refText = SourceUtil.getReferenceText(tree, child);
+ refText = JavaSourceUtil.getReferenceText(tree, child);
}
else if (type == JavaTokenType.ASTERISK) {
isOnDemand = true;
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/JavaLightStubBuilder.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/JavaLightStubBuilder.java
index ff8c80d..3413fda 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/JavaLightStubBuilder.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/JavaLightStubBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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 @@
if (pkg != null) {
LighterASTNode ref = LightTreeUtil.firstChildOfType(tree, pkg, JavaElementType.JAVA_CODE_REFERENCE);
if (ref != null) {
- refText = SourceUtil.getReferenceText(tree, ref);
+ refText = JavaSourceUtil.getReferenceText(tree, ref);
}
}
return new PsiJavaFileStubImpl((PsiJavaFile)file, StringRef.fromString(refText), false);
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceElementImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceElementImpl.java
index 55b7600..807b42d 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceElementImpl.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceElementImpl.java
@@ -587,7 +587,15 @@
if (parameterList != null) {
text += parameterList.getText();
}
- PsiJavaCodeReferenceElement ref = facade.getParserFacade().createReferenceFromText(text, getParent());
+
+ PsiJavaCodeReferenceElement ref;
+ try {
+ ref = facade.getParserFacade().createReferenceFromText(text, getParent());
+ }
+ catch (IncorrectOperationException e) {
+ throw new IncorrectOperationException(e.getMessage() + " [qname=" + qName + " class=" + aClass + ";" + aClass.getClass().getName() + "]");
+ }
+
((PsiJavaCodeReferenceElementImpl)ref).setAnnotations(annotations);
getTreeParent().replaceChildInternal(this, (TreeElement)ref.getNode());
@@ -743,7 +751,7 @@
private String getNormalizedText() {
String whiteSpaceAndComments = myCachedNormalizedText;
if (whiteSpaceAndComments == null) {
- myCachedNormalizedText = whiteSpaceAndComments = SourceUtil.getReferenceText(this);
+ myCachedNormalizedText = whiteSpaceAndComments = JavaSourceUtil.getReferenceText(this);
}
return whiteSpaceAndComments;
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/ClassResolverProcessor.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/ClassResolverProcessor.java
index a2e5593..3e081a7 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/ClassResolverProcessor.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/ClassResolverProcessor.java
@@ -38,6 +38,7 @@
@NotNull
private final PsiFile myContainingFile;
private final PsiElement myPlace;
+ private final PsiResolveHelper myResolveHelper;
private PsiClass myAccessClass = null;
private List<ClassCandidateInfo> myCandidates = null;
private boolean myHasAccessibleCandidate;
@@ -67,6 +68,7 @@
}
}
}
+ myResolveHelper = JavaPsiFacade.getInstance(containingFile.getProject()).getResolveHelper();
}
@NotNull
@@ -252,8 +254,7 @@
}
private boolean checkAccessibility(final PsiClass aClass) {
- JavaPsiFacade facade = JavaPsiFacade.getInstance(aClass.getProject());
- return facade.getResolveHelper().isAccessible(aClass, myPlace, myAccessClass);
+ return myResolveHelper.isAccessible(aClass, myPlace, myAccessClass);
}
@Override
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java
index f16231a..6098199 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java
@@ -379,7 +379,7 @@
PsiType returnType = method.getReturnType();
if (!PsiType.VOID.equals(returnType) && returnType != null) {
PsiType targetType = getTargetType(context);
- if (targetType != null) {
+ if (targetType != null && !PsiType.VOID.equals(targetType)) {
registerReturnTypeConstraints(PsiUtil.isRawSubstitutor(method, mySiteSubstitutor) ? returnType : mySiteSubstitutor.substitute(returnType), targetType);
}
}
@@ -970,7 +970,8 @@
addConstraint(new TypeCompatibilityConstraint(getParameterType(parameters, i, PsiSubstitutor.EMPTY, varargs), pType));
}
}
- else if (parameters.length + 1 == functionalMethodParameters.length && !varargs || !isStatic && varargs && functionalMethodParameters.length > 0) { //instance methods
+ else if (parameters.length + 1 == functionalMethodParameters.length && !varargs ||
+ !isStatic && varargs && functionalMethodParameters.length > 0 && PsiMethodReferenceUtil.hasReceiver(reference, method)) { //instance methods
initBounds(containingClass.getTypeParameters());
final PsiType pType = signature.getParameterTypes()[0];
@@ -1020,13 +1021,13 @@
*/
public static boolean isMoreSpecific(PsiMethod m1,
PsiMethod m2,
- PsiSubstitutor siteSubstitutor2,
PsiExpression[] args,
PsiElement context,
boolean varargs) {
- final PsiTypeParameter[] typeParameters = m2.getTypeParameters();
-
- final InferenceSession session = new InferenceSession(typeParameters, siteSubstitutor2, m2.getManager(), context);
+ final InferenceSession session = new InferenceSession(PsiTypeParameter.EMPTY_ARRAY, PsiSubstitutor.EMPTY, m2.getManager(), context);
+ for (PsiTypeParameter param : PsiUtil.typeParametersIterable(m2)) {
+ session.initBounds(param);
+ }
final PsiParameter[] parameters1 = m1.getParameterList().getParameters();
final PsiParameter[] parameters2 = m2.getParameterList().getParameters();
@@ -1036,8 +1037,8 @@
final int paramsLength = !varargs ? parameters1.length : parameters1.length - 1;
for (int i = 0; i < paramsLength; i++) {
- PsiType sType = getParameterType(parameters1, i, siteSubstitutor2, false);
- PsiType tType = getParameterType(parameters2, i, siteSubstitutor2, varargs);
+ PsiType sType = getParameterType(parameters1, i, PsiSubstitutor.EMPTY, false);
+ PsiType tType = getParameterType(parameters2, i, PsiSubstitutor.EMPTY, varargs);
if (session.isProperType(sType) && session.isProperType(tType)) {
if (!TypeConversionUtil.isAssignable(tType, sType)) {
return false;
@@ -1054,8 +1055,8 @@
}
if (varargs) {
- PsiType sType = getParameterType(parameters1, paramsLength, siteSubstitutor2, true);
- PsiType tType = getParameterType(parameters2, paramsLength, siteSubstitutor2, true);
+ PsiType sType = getParameterType(parameters1, paramsLength, PsiSubstitutor.EMPTY, true);
+ PsiType tType = getParameterType(parameters2, paramsLength, PsiSubstitutor.EMPTY, true);
session.addConstraint(new StrictSubtypingConstraint(tType, sType));
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/PsiMethodReferenceCompatibilityConstraint.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/PsiMethodReferenceCompatibilityConstraint.java
index 175f083..18d0c49e 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/PsiMethodReferenceCompatibilityConstraint.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/PsiMethodReferenceCompatibilityConstraint.java
@@ -21,6 +21,7 @@
import com.intellij.psi.impl.source.resolve.graphInference.InferenceSession;
import com.intellij.psi.impl.source.resolve.graphInference.PsiPolyExpressionUtil;
import com.intellij.psi.infos.MethodCandidateInfo;
+import com.intellij.psi.util.InheritanceUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
import com.intellij.psi.util.TypeConversionUtil;
@@ -60,6 +61,10 @@
final PsiType interfaceMethodReturnType = interfaceMethod.getReturnType();
final PsiType returnType = substitutor.substitute(interfaceMethodReturnType);
final PsiType[] typeParameters = myExpression.getTypeParameters();
+
+ final PsiMethodReferenceUtil.QualifierResolveResult qualifierResolveResult = PsiMethodReferenceUtil.getQualifierResolveResult(myExpression);
+ PsiSubstitutor psiSubstitutor = qualifierResolveResult.getSubstitutor();
+
if (!myExpression.isExact()) {
for (PsiParameter parameter : targetParameters) {
if (!session.isProperType(substitutor.substitute(parameter.getType()))) {
@@ -70,11 +75,9 @@
final PsiMember applicableMember = myExpression.getPotentiallyApplicableMember();
LOG.assertTrue(applicableMember != null);
- final PsiMethodReferenceUtil.QualifierResolveResult qualifierResolveResult = PsiMethodReferenceUtil.getQualifierResolveResult(myExpression);
final PsiClass applicableMemberContainingClass = applicableMember.getContainingClass();
final PsiClass containingClass = qualifierResolveResult.getContainingClass();
- PsiSubstitutor psiSubstitutor = qualifierResolveResult.getSubstitutor();
psiSubstitutor = applicableMemberContainingClass == null || containingClass == null || myExpression.isConstructor()
? psiSubstitutor
: TypeConversionUtil.getSuperClassSubstitutor(applicableMemberContainingClass, containingClass, psiSubstitutor);
@@ -143,6 +146,13 @@
final PsiType referencedMethodReturnType;
final PsiClass containingClass = method.getContainingClass();
LOG.assertTrue(containingClass != null, method);
+
+ PsiClass qContainingClass = qualifierResolveResult.getContainingClass();
+ if (qContainingClass != null && InheritanceUtil.isInheritorOrSelf(qContainingClass, containingClass, true)) {
+ psiSubstitutor = TypeConversionUtil.getClassSubstitutor(containingClass, qContainingClass, PsiSubstitutor.EMPTY);
+ LOG.assertTrue(psiSubstitutor != null);
+ }
+
if (method.isConstructor()) {
referencedMethodReturnType = JavaPsiFacade.getElementFactory(method.getProject()).createType(containingClass, PsiSubstitutor.EMPTY);
}
@@ -179,7 +189,6 @@
}
int idx = 0;
- PsiSubstitutor psiSubstitutor = PsiSubstitutor.EMPTY;
for (PsiTypeParameter param : method.getTypeParameters()) {
if (idx < typeParameters.length) {
psiSubstitutor = psiSubstitutor.put(param, typeParameters[idx++]);
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaElementType.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaElementType.java
index 4fbbad2..8d42dbe 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaElementType.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaElementType.java
@@ -84,8 +84,8 @@
IElementType PARAMETER_LIST = JavaStubElementTypes.PARAMETER_LIST;
IElementType EXTENDS_BOUND_LIST = JavaStubElementTypes.EXTENDS_BOUND_LIST;
IElementType THROWS_LIST = JavaStubElementTypes.THROWS_LIST;
- IElementType LITERAL_EXPRESSION = new JavaCompositeElementType("LITERAL_EXPRESSION", PsiLiteralExpressionImpl.class);
+ IElementType LITERAL_EXPRESSION = new JavaCompositeElementType("LITERAL_EXPRESSION", PsiLiteralExpressionImpl.class);
IElementType IMPORT_STATIC_REFERENCE = new JavaCompositeElementType("IMPORT_STATIC_REFERENCE", PsiImportStaticReferenceElementImpl.class);
IElementType TYPE = new JavaCompositeElementType("TYPE", PsiTypeElementImpl.class);
IElementType DIAMOND_TYPE = new JavaCompositeElementType("DIAMOND_TYPE", PsiDiamondTypeElementImpl.class);
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaSourceUtil.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaSourceUtil.java
index 8cf5b5b..e2af7b0 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaSourceUtil.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaSourceUtil.java
@@ -15,13 +15,28 @@
*/
package com.intellij.psi.impl.source.tree;
+import com.intellij.lang.ASTFactory;
import com.intellij.lang.ASTNode;
+import com.intellij.lang.LighterAST;
+import com.intellij.lang.LighterASTNode;
+import com.intellij.openapi.diagnostic.Logger;
import com.intellij.psi.*;
+import com.intellij.psi.codeStyle.CodeStyleManager;
+import com.intellij.psi.impl.source.DummyHolder;
import com.intellij.psi.impl.source.SourceJavaCodeReference;
+import com.intellij.psi.impl.source.SourceTreeToPsiMap;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
import com.intellij.util.CharTable;
+import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
public class JavaSourceUtil {
+ private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.JavaSourceUtil");
+
+ private static final TokenSet REF_FILTER = TokenSet.orSet(
+ ElementType.JAVA_COMMENT_OR_WHITESPACE_BIT_SET, TokenSet.create(JavaElementType.ANNOTATION));
+
private JavaSourceUtil() { }
public static void fullyQualifyReference(@NotNull CompositeElement reference, @NotNull PsiClass targetClass) {
@@ -61,4 +76,70 @@
}
}
}
+
+ @NotNull
+ public static String getReferenceText(@NotNull PsiJavaCodeReferenceElement ref) {
+ final StringBuilder buffer = new StringBuilder();
+
+ ((TreeElement)ref.getNode()).acceptTree(new RecursiveTreeElementWalkingVisitor() {
+ @Override
+ public void visitLeaf(LeafElement leaf) {
+ if (!REF_FILTER.contains(leaf.getElementType())) {
+ String leafText = leaf.getText();
+ if (buffer.length() > 0 && !leafText.isEmpty() && Character.isJavaIdentifierPart(leafText.charAt(0))) {
+ char lastInBuffer = buffer.charAt(buffer.length() - 1);
+ if (lastInBuffer == '?' || Character.isJavaIdentifierPart(lastInBuffer)) {
+ buffer.append(" ");
+ }
+ }
+
+ buffer.append(leafText);
+ }
+ }
+
+ @Override
+ public void visitComposite(CompositeElement composite) {
+ if (!REF_FILTER.contains(composite.getElementType())) {
+ super.visitComposite(composite);
+ }
+ }
+ });
+
+ return buffer.toString();
+ }
+
+ @NotNull
+ public static String getReferenceText(@NotNull LighterAST tree, @NotNull LighterASTNode node) {
+ return LightTreeUtil.toFilteredString(tree, node, REF_FILTER);
+ }
+
+ public static TreeElement addParenthToReplacedChild(@NotNull IElementType parenthType,
+ @NotNull TreeElement newChild,
+ @NotNull PsiManager manager) {
+ CompositeElement parenthExpr = ASTFactory.composite(parenthType);
+
+ TreeElement dummyExpr = (TreeElement)newChild.clone();
+ final CharTable charTableByTree = SharedImplUtil.findCharTableByTree(newChild);
+ new DummyHolder(manager, parenthExpr, null, charTableByTree);
+ parenthExpr.putUserData(CharTable.CHAR_TABLE_KEY, charTableByTree);
+ parenthExpr.rawAddChildren(ASTFactory.leaf(JavaTokenType.LPARENTH, "("));
+ parenthExpr.rawAddChildren(dummyExpr);
+ parenthExpr.rawAddChildren(ASTFactory.leaf(JavaTokenType.RPARENTH, ")"));
+
+ try {
+ CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(manager.getProject());
+ PsiElement formatted = codeStyleManager.reformat(SourceTreeToPsiMap.treeToPsiNotNull(parenthExpr));
+ parenthExpr = (CompositeElement)SourceTreeToPsiMap.psiToTreeNotNull(formatted);
+ }
+ catch (IncorrectOperationException e) {
+ LOG.error(e); // should not happen
+ }
+
+ newChild.putUserData(CharTable.CHAR_TABLE_KEY, SharedImplUtil.findCharTableByTree(newChild));
+ dummyExpr.getTreeParent().replaceChild(dummyExpr, newChild);
+
+ // TODO remove explicit caches drop since this should be ok if we will use ChangeUtil for the modification
+ TreeUtil.clearCaches(TreeUtil.getFileElement(parenthExpr));
+ return parenthExpr;
+ }
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/SourceUtil.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/SourceUtil.java
index 93e9f60..5545808 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/SourceUtil.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/SourceUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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,94 +15,29 @@
*/
package com.intellij.psi.impl.source.tree;
-import com.intellij.lang.ASTFactory;
import com.intellij.lang.LighterAST;
import com.intellij.lang.LighterASTNode;
-import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.psi.JavaTokenType;
-import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiJavaCodeReferenceElement;
import com.intellij.psi.PsiManager;
-import com.intellij.psi.codeStyle.CodeStyleManager;
-import com.intellij.psi.impl.source.DummyHolder;
-import com.intellij.psi.impl.source.SourceTreeToPsiMap;
import com.intellij.psi.tree.IElementType;
-import com.intellij.psi.tree.TokenSet;
-import com.intellij.util.CharTable;
-import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
+/** @deprecated use {@link JavaSourceUtil} (to be removed in IDEA 15) */
+@SuppressWarnings("UnusedDeclaration")
public class SourceUtil {
- private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.SourceUtil");
-
- private static final TokenSet REF_FILTER = TokenSet.orSet(
- ElementType.JAVA_COMMENT_OR_WHITESPACE_BIT_SET, TokenSet.create(JavaElementType.ANNOTATION));
-
private SourceUtil() { }
@NotNull
public static String getReferenceText(@NotNull PsiJavaCodeReferenceElement ref) {
- final StringBuilder buffer = new StringBuilder();
-
- ((TreeElement)ref.getNode()).acceptTree(new RecursiveTreeElementWalkingVisitor() {
- @Override
- public void visitLeaf(LeafElement leaf) {
- if (!REF_FILTER.contains(leaf.getElementType())) {
- String leafText = leaf.getText();
- if (buffer.length() > 0 && !leafText.isEmpty() && Character.isJavaIdentifierPart(leafText.charAt(0))) {
- char lastInBuffer = buffer.charAt(buffer.length() - 1);
- if (lastInBuffer == '?' || Character.isJavaIdentifierPart(lastInBuffer)) {
- buffer.append(" ");
- }
- }
-
- buffer.append(leafText);
- }
- }
-
- @Override
- public void visitComposite(CompositeElement composite) {
- if (!REF_FILTER.contains(composite.getElementType())) {
- super.visitComposite(composite);
- }
- }
- });
-
- return buffer.toString();
+ return JavaSourceUtil.getReferenceText(ref);
}
@NotNull
public static String getReferenceText(@NotNull LighterAST tree, @NotNull LighterASTNode node) {
- return LightTreeUtil.toFilteredString(tree, node, REF_FILTER);
+ return JavaSourceUtil.getReferenceText(tree, node);
}
- public static TreeElement addParenthToReplacedChild(@NotNull IElementType parenthType,
- @NotNull TreeElement newChild,
- @NotNull PsiManager manager) {
- CompositeElement parenthExpr = ASTFactory.composite(parenthType);
-
- TreeElement dummyExpr = (TreeElement)newChild.clone();
- final CharTable charTableByTree = SharedImplUtil.findCharTableByTree(newChild);
- new DummyHolder(manager, parenthExpr, null, charTableByTree);
- parenthExpr.putUserData(CharTable.CHAR_TABLE_KEY, charTableByTree);
- parenthExpr.rawAddChildren(ASTFactory.leaf(JavaTokenType.LPARENTH, "("));
- parenthExpr.rawAddChildren(dummyExpr);
- parenthExpr.rawAddChildren(ASTFactory.leaf(JavaTokenType.RPARENTH, ")"));
-
- try {
- CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(manager.getProject());
- PsiElement formatted = codeStyleManager.reformat(SourceTreeToPsiMap.treeToPsiNotNull(parenthExpr));
- parenthExpr = (CompositeElement)SourceTreeToPsiMap.psiToTreeNotNull(formatted);
- }
- catch (IncorrectOperationException e) {
- LOG.error(e); // should not happen
- }
-
- newChild.putUserData(CharTable.CHAR_TABLE_KEY, SharedImplUtil.findCharTableByTree(newChild));
- dummyExpr.getTreeParent().replaceChild(dummyExpr, newChild);
-
- // TODO remove explicit caches drop since this should be ok if we will use ChangeUtil for the modification
- TreeUtil.clearCaches(TreeUtil.getFileElement(parenthExpr));
- return parenthExpr;
+ public static TreeElement addParenthToReplacedChild(@NotNull IElementType parenthType, @NotNull TreeElement newChild, @NotNull PsiManager manager) {
+ return JavaSourceUtil.addParenthToReplacedChild(parenthType, newChild, manager);
}
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/ExpressionPsiElement.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/ExpressionPsiElement.java
index 1d8693e..e0b122e 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/ExpressionPsiElement.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/ExpressionPsiElement.java
@@ -13,10 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-/*
- * @author max
- */
package com.intellij.psi.impl.source.tree.java;
import com.intellij.lang.ASTNode;
@@ -24,13 +20,11 @@
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;
+/**
+ * @author max
+ */
public class ExpressionPsiElement extends CompositePsiElement {
- private final int myHC = CompositePsiElement.ourHC++;
-
- @Override
- public final int hashCode() {
- return myHC;
- }
+ @SuppressWarnings("AssignmentToStaticFieldFromInstanceMethod") private final int myHC = CompositePsiElement.ourHC++;
public ExpressionPsiElement(final IElementType type) {
super(type);
@@ -42,9 +36,14 @@
ElementType.EXPRESSION_BIT_SET.contains(newElement.getElementType())) {
boolean needParenth = ReplaceExpressionUtil.isNeedParenthesis(child, newElement);
if (needParenth) {
- newElement = SourceUtil.addParenthToReplacedChild(JavaElementType.PARENTH_EXPRESSION, newElement, getManager());
+ newElement = JavaSourceUtil.addParenthToReplacedChild(JavaElementType.PARENTH_EXPRESSION, newElement, getManager());
}
}
super.replaceChildInternal(child, newElement);
}
+
+ @Override
+ public final int hashCode() {
+ return myHC;
+ }
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/MethodElement.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/MethodElement.java
index 31fb4bc..1edd7cb 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/MethodElement.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/MethodElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -41,14 +41,15 @@
@Override
public int getTextOffset() {
- return findChildByRole(ChildRole.NAME).getStartOffset();
+ ASTNode name = findChildByType(IDENTIFIER);
+ return name != null ? name.getStartOffset() : this.getStartOffset();
}
@Override
public TreeElement addInternal(TreeElement first, ASTNode last, ASTNode anchor, Boolean before) {
- if (first == last && first.getElementType() == JavaElementType.CODE_BLOCK){
- ASTNode semicolon = findChildByRole(ChildRole.CLOSING_SEMICOLON);
- if (semicolon != null){
+ if (first == last && first.getElementType() == JavaElementType.CODE_BLOCK) {
+ ASTNode semicolon = TreeUtil.findChildBackward(this, SEMICOLON);
+ if (semicolon != null) {
deleteChildInternal(semicolon);
}
}
@@ -64,7 +65,7 @@
@Override
public void deleteChildInternal(@NotNull ASTNode child) {
- if (child.getElementType() == CODE_BLOCK){
+ if (child.getElementType() == CODE_BLOCK) {
final ASTNode prevWS = TreeUtil.prevLeaf(child);
if (prevWS != null && prevWS.getElementType() == TokenType.WHITE_SPACE) {
removeChild(prevWS);
@@ -80,9 +81,9 @@
}
@Override
- public ASTNode findChildByRole(int role){
+ public ASTNode findChildByRole(int role) {
LOG.assertTrue(ChildRole.isUnique(role));
- switch(role){
+ switch (role) {
default:
return null;
@@ -161,5 +162,4 @@
protected boolean isVisibilitySupported() {
return true;
}
-
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiMethodReferenceExpressionImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiMethodReferenceExpressionImpl.java
index 2209efe..95171ba3 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiMethodReferenceExpressionImpl.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiMethodReferenceExpressionImpl.java
@@ -434,7 +434,7 @@
return true;
}
- final PsiSubstitutor subst = result.getSubstitutor();
+ PsiSubstitutor subst = result.getSubstitutor();
PsiType methodReturnType = null;
PsiClass containingClass = null;
@@ -451,6 +451,12 @@
return false;
}
+ PsiClass qContainingClass = PsiMethodReferenceUtil.getQualifierResolveResult(this).getContainingClass();
+ if (qContainingClass != null && containingClass != null && InheritanceUtil.isInheritorOrSelf(qContainingClass, containingClass, true)) {
+ subst = TypeConversionUtil.getClassSubstitutor(containingClass, qContainingClass, subst);
+ LOG.assertTrue(subst != null);
+ }
+
methodReturnType = subst.substitute(returnType);
}
else if (resolve instanceof PsiClass) {
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiPackageStatementImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiPackageStatementImpl.java
index 5a42715..29d0729 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiPackageStatementImpl.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiPackageStatementImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -38,7 +38,7 @@
@Override
public String getPackageName() {
PsiJavaCodeReferenceElement ref = getPackageReference();
- return ref == null ? null : SourceUtil.getReferenceText(ref);
+ return ref == null ? null : JavaSourceUtil.getReferenceText(ref);
}
@Override
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiReferenceExpressionImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiReferenceExpressionImpl.java
index 02ffaa6..8dd4393 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiReferenceExpressionImpl.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiReferenceExpressionImpl.java
@@ -761,7 +761,7 @@
private String getCachedNormalizedText() {
String whiteSpaceAndComments = myCachedNormalizedText;
if (whiteSpaceAndComments == null) {
- myCachedNormalizedText = whiteSpaceAndComments = SourceUtil.getReferenceText(this);
+ myCachedNormalizedText = whiteSpaceAndComments = JavaSourceUtil.getReferenceText(this);
}
return whiteSpaceAndComments;
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java b/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java
index f136c84..59083c6 100644
--- a/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java
+++ b/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java
@@ -550,10 +550,10 @@
final PsiSubstitutor methodSubstitutor1 = calculateMethodSubstitutor(typeParameters1, method1, siteSubstitutor1, types1, types2AtSite,
languageLevel);
- boolean applicable12 = isApplicableTo(types2AtSite, method1, languageLevel, varargsPosition, methodSubstitutor1, method2, siteSubstitutor1);
+ boolean applicable12 = isApplicableTo(types2AtSite, method1, languageLevel, varargsPosition, methodSubstitutor1, method2);
final PsiSubstitutor methodSubstitutor2 = calculateMethodSubstitutor(typeParameters2, method2, siteSubstitutor2, types2, types1AtSite, languageLevel);
- boolean applicable21 = isApplicableTo(types1AtSite, method2, languageLevel, varargsPosition, methodSubstitutor2, method1, siteSubstitutor2);
+ boolean applicable21 = isApplicableTo(types1AtSite, method2, languageLevel, varargsPosition, methodSubstitutor2, method1);
if (!myLanguageLevel.isAtLeast(LanguageLevel.JDK_1_8)) {
final boolean typeArgsApplicable12 = GenericsUtil.isTypeArgumentsApplicable(typeParameters1, methodSubstitutor1, myArgumentsList, !applicable21);
@@ -604,9 +604,9 @@
if (toCompareFunctional) {
final boolean applicable12ignoreFunctionalType = isApplicableTo(types2AtSite, method1, languageLevel, varargsPosition,
- calculateMethodSubstitutor(typeParameters1, method1, siteSubstitutor1, types1, types2AtSite, languageLevel), null, null);
+ calculateMethodSubstitutor(typeParameters1, method1, siteSubstitutor1, types1, types2AtSite, languageLevel), null);
final boolean applicable21ignoreFunctionalType = isApplicableTo(types1AtSite, method2, languageLevel, varargsPosition,
- calculateMethodSubstitutor(typeParameters2, method2, siteSubstitutor2, types2, types1AtSite, languageLevel), null, null);
+ calculateMethodSubstitutor(typeParameters2, method2, siteSubstitutor2, types2, types1AtSite, languageLevel), null);
if (applicable12ignoreFunctionalType || applicable21ignoreFunctionalType) {
Specifics specifics = null;
@@ -694,12 +694,11 @@
@NotNull LanguageLevel languageLevel,
boolean varargsPosition,
@NotNull PsiSubstitutor methodSubstitutor1,
- PsiMethod method2,
- PsiSubstitutor siteSubstitutor1) {
+ PsiMethod method2) {
if (languageLevel.isAtLeast(LanguageLevel.JDK_1_8) && method2 != null && method1.getTypeParameters().length > 0 && myArgumentsList instanceof PsiExpressionList) {
final PsiElement parent = myArgumentsList.getParent();
if (parent instanceof PsiCallExpression && ((PsiCallExpression)parent).getTypeArguments().length == 0) {
- return InferenceSession.isMoreSpecific(method2, method1, siteSubstitutor1, ((PsiExpressionList)myArgumentsList).getExpressions(), myArgumentsList, varargsPosition);
+ return InferenceSession.isMoreSpecific(method2, method1, ((PsiExpressionList)myArgumentsList).getExpressions(), myArgumentsList, varargsPosition);
}
}
final int applicabilityLevel = PsiUtil.getApplicabilityLevel(method1, methodSubstitutor1, types2AtSite, languageLevel, false, varargsPosition);
diff --git a/java/java-tests/testData/codeInsight/completion/normal/MethodMergingMinimalTail.java b/java/java-tests/testData/codeInsight/completion/normal/MethodMergingMinimalTail.java
new file mode 100644
index 0000000..aa594589
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/normal/MethodMergingMinimalTail.java
@@ -0,0 +1,7 @@
+class Foo {
+ {
+ foo("someTestAttachment", "".getByt<caret>)
+ }
+
+ void foo(String s, byte[] z) {}
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/completion/normal/MethodMergingMinimalTail_after.java b/java/java-tests/testData/codeInsight/completion/normal/MethodMergingMinimalTail_after.java
new file mode 100644
index 0000000..a89e601
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/normal/MethodMergingMinimalTail_after.java
@@ -0,0 +1,7 @@
+class Foo {
+ {
+ foo("someTestAttachment", "".getBytes(<caret>))
+ }
+
+ void foo(String s, byte[] z) {}
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/completion/normal/SmartEnterNoNewLine.java b/java/java-tests/testData/codeInsight/completion/normal/SmartEnterNoNewLine.java
new file mode 100644
index 0000000..49f9b65
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/normal/SmartEnterNoNewLine.java
@@ -0,0 +1,9 @@
+
+class Tester {
+ private void build(EntityBuilder builder) {
+ }
+
+ public void test1(int abc, int abd) {
+ System.out.println(a<caret>);
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/completion/normal/SmartEnterNoNewLine_after.java b/java/java-tests/testData/codeInsight/completion/normal/SmartEnterNoNewLine_after.java
new file mode 100644
index 0000000..ce2b895
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/normal/SmartEnterNoNewLine_after.java
@@ -0,0 +1,9 @@
+
+class Tester {
+ private void build(EntityBuilder builder) {
+ }
+
+ public void test1(int abc, int abd) {
+ System.out.println(abc);<caret>
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/completion/normal/SmartEnterWithNewLine.java b/java/java-tests/testData/codeInsight/completion/normal/SmartEnterWithNewLine.java
new file mode 100644
index 0000000..d21cac7
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/normal/SmartEnterWithNewLine.java
@@ -0,0 +1,9 @@
+
+class Tester {
+ private void build(EntityBuilder builder) {
+ }
+
+ public void test1(int abc, int abd) {
+ if(a<caret>)
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/completion/normal/SmartEnterWithNewLine_after.java b/java/java-tests/testData/codeInsight/completion/normal/SmartEnterWithNewLine_after.java
new file mode 100644
index 0000000..1b70dd9
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/normal/SmartEnterWithNewLine_after.java
@@ -0,0 +1,11 @@
+
+class Tester {
+ private void build(EntityBuilder builder) {
+ }
+
+ public void test1(int abc, int abd) {
+ if (abc) {
+ <caret>
+ }
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/completion/normal/UnimportedStaticInnerClass.java b/java/java-tests/testData/codeInsight/completion/normal/UnimportedStaticInnerClass.java
new file mode 100644
index 0000000..4dcd4a5
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/normal/UnimportedStaticInnerClass.java
@@ -0,0 +1,6 @@
+class Zoo {
+ void foo() {
+ new Super.I<caret>
+ }
+
+}
diff --git a/java/java-tests/testData/codeInsight/completion/normal/UnimportedStaticInnerClass_after.java b/java/java-tests/testData/codeInsight/completion/normal/UnimportedStaticInnerClass_after.java
new file mode 100644
index 0000000..6db6912
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/normal/UnimportedStaticInnerClass_after.java
@@ -0,0 +1,8 @@
+import foo.Super;
+
+class Zoo {
+ void foo() {
+ new Super.Inner()<caret>
+ }
+
+}
diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AutoImportExpectedType.java b/java/java-tests/testData/codeInsight/completion/smartType/AutoImportExpectedType.java
new file mode 100644
index 0000000..e120ecb
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/smartType/AutoImportExpectedType.java
@@ -0,0 +1,5 @@
+class Main<T extends Foo> {
+ {
+ List<Foo> list = new <caret>
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/annotations/typeAnnotations.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/annotations/typeAnnotations.java
index 28035c8..01f7486 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/annotations/typeAnnotations.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/annotations/typeAnnotations.java
@@ -114,6 +114,7 @@
void <error descr="Annotations are not allowed here">@TA</error> misplaced() { }
@TA Outer() { }
+ <T> <error descr="Annotations are not allowed here">@TA</error> Outer(T t) { }
class MyClass<@TA @TPA T> { }
interface MyInterface<@TA @TPA E> { }
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/mostSpecific/IDEA127584.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/mostSpecific/IDEA127584.java
new file mode 100644
index 0000000..f122250
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/mostSpecific/IDEA127584.java
@@ -0,0 +1,22 @@
+class Test {
+ public static <Tfoo, Vfoo> Future<Vfoo> foo(Future<Tfoo> future, Function<Tfoo, Vfoo> function) {
+ return future.map(function);
+ }
+
+ // These interfaces inspired by FoundationDB Java client class files
+ interface PartialFunction <TP, VP> {
+ VP apply(TP t) throws java.lang.Exception;
+ }
+
+ interface Function <TF, VF> extends PartialFunction<TF, VF> {
+ VF apply(TF t);
+ }
+
+ interface PartialFuture <TPP> {
+ <VPP> PartialFuture<VPP> map(PartialFunction<TPP, VPP> partialFunction);
+ }
+
+ interface Future <TFF> extends PartialFuture<TFF> {
+ <VFF> Future<VFF> map(Function<TFF, VFF> function);
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/IDEA127596.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/IDEA127596.java
new file mode 100644
index 0000000..2063667
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/IDEA127596.java
@@ -0,0 +1,9 @@
+class Executor<E> {
+ <K> void bar(Executor<K> e) {
+ Runnable r = () -> foo(e);
+ }
+
+ private <T> T foo(final Executor<T> e) {
+ return null;
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/IDEA126969.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/IDEA126969.java
new file mode 100644
index 0000000..e981d28
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/IDEA126969.java
@@ -0,0 +1,15 @@
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Stream;
+
+class IDEA126969 {
+ void foo(final Stream<List<Integer>> stream) {
+
+ stream.flatMap(List::stream)
+ .forEach(i -> System.out.println(i.floatValue()));
+
+ stream.flatMap(Collection::stream)
+ .forEach(i -> System.out.println(i.floatValue()));
+
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/IDEA127506.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/IDEA127506.java
new file mode 100644
index 0000000..7abf6ba
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/IDEA127506.java
@@ -0,0 +1,24 @@
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Stream;
+
+class Validator {
+ static boolean thereAreConstraintViolationsIn1(final Stream<Object> objectStream, Validator validator) {
+ Stream<Set<List<Object>>> rStream = objectStream
+ .map(validator::validate);
+ return rStream
+ .flatMap(set -> set.stream())
+ .findAny()
+ .isPresent();
+ }
+
+ static void thereAreConstraintViolationsIn(final Stream<Object> objectStream, Validator validator) {
+ Stream<Set<List<Object>>> rStream = objectStream.map(validator ::validate);
+
+ Stream<Set<List<Object>>> lStream = objectStream.map((a) -> validator.validate(a));
+ }
+
+ <T> Set<List<T>> validate(T var1, Class<?> ... var2) {
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeCast/afterShortenFQNs.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeCast/afterShortenFQNs.java
new file mode 100644
index 0000000..9fea89f
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeCast/afterShortenFQNs.java
@@ -0,0 +1,10 @@
+import java.util.List;
+
+// "Cast parameter to 'java.util.List'" "true"
+class Test {
+ void m(Object o) {
+ foo((List) o);
+ }
+
+ private void foo(final java.util.List o) {}
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeCast/beforeShortenFQNs.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeCast/beforeShortenFQNs.java
new file mode 100644
index 0000000..e53d8b1
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeCast/beforeShortenFQNs.java
@@ -0,0 +1,8 @@
+// "Cast parameter to 'java.util.List'" "true"
+class Test {
+ void m(Object o) {
+ foo(<caret>o);
+ }
+
+ private void foo(final java.util.List o) {}
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/anonymous2lambda/beforeObjectInferredButIntExpected.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/anonymous2lambda/beforeObjectInferredButIntExpected.java
new file mode 100644
index 0000000..3a82478
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/anonymous2lambda/beforeObjectInferredButIntExpected.java
@@ -0,0 +1,16 @@
+// "Replace with lambda" "false"
+import java.util.function.Function;
+
+class Test {
+ void ab() {
+ comparing(new Func<caret>tion<Integer, String>() {
+ public String apply(Integer pObj) {
+ return Integer.toString(pObj);
+ }
+ });
+
+ }
+
+ static <T> void comparing(Function<T, String> keyExtractor){}
+
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convert2Local/afterMultipleMethodsMultipleFields.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convert2Local/afterMultipleMethodsMultipleFields.java
new file mode 100644
index 0000000..9d1502b
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convert2Local/afterMultipleMethodsMultipleFields.java
@@ -0,0 +1,17 @@
+// "Convert to local" "true"
+class MyClassTest {
+
+ private boolean editable = false;
+
+ boolean isEditable() {
+ return editable;
+ }
+
+ void setEditable(boolean editable) {
+ this.editable = editable;
+ }
+
+ public void setEditable1(final boolean editable1) {
+ boolean editable11 = editable1;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convert2Local/beforeMultipleMethodsMultipleFields.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convert2Local/beforeMultipleMethodsMultipleFields.java
new file mode 100644
index 0000000..4c6ead7
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convert2Local/beforeMultipleMethodsMultipleFields.java
@@ -0,0 +1,18 @@
+// "Convert to local" "true"
+class MyClassTest {
+
+ private boolean editable = false;
+ private boolean edit<caret>able1 = false;
+
+ boolean isEditable() {
+ return editable;
+ }
+
+ void setEditable(boolean editable) {
+ this.editable = editable;
+ }
+
+ public void setEditable1(final boolean editable1) {
+ this.editable1 = editable1;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convert2Local/beforeMultipleMethodsOnReadOnly.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convert2Local/beforeMultipleMethodsOnReadOnly.java
new file mode 100644
index 0000000..db61483
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convert2Local/beforeMultipleMethodsOnReadOnly.java
@@ -0,0 +1,18 @@
+// "Convert to local" "false"
+class MyClassTest {
+
+ private boolean edit<caret>able = false;
+ private boolean editable1 = false;
+
+ boolean isEditable() {
+ return editable;
+ }
+
+ void setEditable(boolean editable) {
+ this.editable = editable;
+ }
+
+ public void setEditable1(final boolean editable1) {
+ this.editable1 = editable1;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createFieldFromUsage/beforeInsideInterface.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createFieldFromUsage/beforeInsideInterface.java
new file mode 100644
index 0000000..74627f9
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createFieldFromUsage/beforeInsideInterface.java
@@ -0,0 +1,7 @@
+// "Create Field 'myFoo'" "false"
+
+interface Test {
+ default String get() {
+ return my<caret>Foo;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/afterStaticInInterface.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/afterStaticInInterface.java
new file mode 100644
index 0000000..66a2b59
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/afterStaticInInterface.java
@@ -0,0 +1,10 @@
+// "Create Method 'f'" "true"
+interface X {
+ public static void m() {
+ f();
+ }
+
+ static void f() {
+
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/beforeStaticInInterface.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/beforeStaticInInterface.java
new file mode 100644
index 0000000..81afbe3
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/beforeStaticInInterface.java
@@ -0,0 +1,6 @@
+// "Create Method 'f'" "true"
+interface X {
+ public static void m() {
+ f<caret>();
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterAmbiguityWithoutSuperMethods.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterAmbiguityWithoutSuperMethods.java
new file mode 100644
index 0000000..54310c8
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterAmbiguityWithoutSuperMethods.java
@@ -0,0 +1,11 @@
+// "Replace lambda with method reference" "true"
+import java.io.PrintStream;
+import java.util.function.BiConsumer;
+
+class Test {
+ {
+ BiConsumer<PrintStream, String> printer = PrintStream::println;
+ }
+
+
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/beforeAmbiguityWithoutSuperMethods.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/beforeAmbiguityWithoutSuperMethods.java
new file mode 100644
index 0000000..7c68e5e
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/beforeAmbiguityWithoutSuperMethods.java
@@ -0,0 +1,11 @@
+// "Replace lambda with method reference" "true"
+import java.io.PrintStream;
+import java.util.function.BiConsumer;
+
+class Test {
+ {
+ BiConsumer<PrintStream, String> printer = (printStream, x) -> printSt<caret>ream.println(x);
+ }
+
+
+}
diff --git a/java/java-tests/testData/codeInsight/javadocIG/annotationsInParams.html b/java/java-tests/testData/codeInsight/javadocIG/annotationsInParams.html
new file mode 100644
index 0000000..c9b08d6
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/javadocIG/annotationsInParams.html
@@ -0,0 +1,2 @@
+<html><head> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><small><b><a href="psi_element://Test"><code>Test</code></a></b></small><PRE>public void <b>foo</b>(@<a href="psi_element://java.lang.Deprecated"><code>Deprecated</code></a> <a href="psi_element://java.lang.String"><code>String</code></a> s,
+ @<a href="psi_element://java.lang.Deprecated"><code>Deprecated</code></a> <a href="psi_element://java.lang.String"><code>String</code></a> p)</PRE></body></html>
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/javadocIG/annotationsInParams.java b/java/java-tests/testData/codeInsight/javadocIG/annotationsInParams.java
new file mode 100644
index 0000000..676ff2d
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/javadocIG/annotationsInParams.java
@@ -0,0 +1,4 @@
+class Test {
+ public void foo(@Deprecated String s,
+ @Deprecated String p){}
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/javadocIG/pInsidePre.html b/java/java-tests/testData/codeInsight/javadocIG/pInsidePre.html
new file mode 100644
index 0000000..fbfd298
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/javadocIG/pInsidePre.html
@@ -0,0 +1,6 @@
+<html><head> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><small><b><a href="psi_element://Test"><code>Test</code></a></b></small><PRE>public <a href="psi_element://java.lang.String"><code>String</code></a> <b>field = null</b></PRE>
+ <pre>
+ foo
+ <p></p>
+ bar
+ </pre></body></html>
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/javadocIG/pInsidePre.java b/java/java-tests/testData/codeInsight/javadocIG/pInsidePre.java
new file mode 100644
index 0000000..0627e4b9
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/javadocIG/pInsidePre.java
@@ -0,0 +1,10 @@
+class Test {
+ /**
+ * <pre>
+ * foo
+ * <p/>
+ * bar
+ * </pre>
+ */
+ public String field = null;
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/nullityinferrer/afterMethodReturnValue.java b/java/java-tests/testData/codeInsight/nullityinferrer/afterMethodReturnValue.java
index 6ae0b5b..6503f43 100644
--- a/java/java-tests/testData/codeInsight/nullityinferrer/afterMethodReturnValue.java
+++ b/java/java-tests/testData/codeInsight/nullityinferrer/afterMethodReturnValue.java
@@ -15,6 +15,7 @@
return s;
}
+ @NotNull
String foo4(@NotNull String s) {
return s.substring(0);
}
diff --git a/java/java-tests/testData/codeInsight/template/postfix/templates/cast/ternary.java b/java/java-tests/testData/codeInsight/template/postfix/templates/cast/ternary.java
new file mode 100644
index 0000000..0e0ff37
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/template/postfix/templates/cast/ternary.java
@@ -0,0 +1,5 @@
+public class Foo {
+ void m(String s) {
+ Object o = s.isEmpty() ? s.concat("a").cast<caret> : s.concat("b");
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/template/postfix/templates/cast/ternary_after.java b/java/java-tests/testData/codeInsight/template/postfix/templates/cast/ternary_after.java
new file mode 100644
index 0000000..486e88b
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/template/postfix/templates/cast/ternary_after.java
@@ -0,0 +1,5 @@
+public class Foo {
+ void m(String s) {
+ Object o = s.isEmpty() ? (() s.concat("a")) : s.concat("b");
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/typing/columnMode_after.java b/java/java-tests/testData/codeInsight/typing/columnMode_after.java
new file mode 100644
index 0000000..78c1436
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/typing/columnMode_after.java
@@ -0,0 +1,5 @@
+class Foo {
+ void m() {
+ System.exit(<caret>)
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/typing/columnMode_before.java b/java/java-tests/testData/codeInsight/typing/columnMode_before.java
new file mode 100644
index 0000000..ba4c1bf
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/typing/columnMode_before.java
@@ -0,0 +1,5 @@
+class Foo {
+ void m() {
+ System.exit<caret>
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/awt/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/awt/annotations.xml
new file mode 100644
index 0000000..0314b02
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/awt/annotations.xml
@@ -0,0 +1,345 @@
+<root>
+ <item name="java.awt.Component boolean action(java.awt.Event, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->false;_,!null->false;_,null->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean contains(java.awt.Point) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component boolean dispatchMouseWheelToAncestor(java.awt.event.MouseWheelEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component boolean dispatchMouseWheelToAncestor(java.awt.event.MouseWheelEvent)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->true""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean eventEnabled(java.awt.AWTEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component boolean gotFocus(java.awt.Event, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->false;_,!null->false;_,null->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean handleEvent(java.awt.Event) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component boolean keyDown(java.awt.Event, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean keyUp(java.awt.Event, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean lostFocus(java.awt.Event, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->false;_,!null->false;_,null->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean mouseDown(java.awt.Event, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->false;null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean mouseDrag(java.awt.Event, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->false;null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean mouseEnter(java.awt.Event, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->false;null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean mouseExit(java.awt.Event, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->false;null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean mouseMove(java.awt.Event, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->false;null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean mouseUp(java.awt.Event, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->false;null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component boolean postEvent(java.awt.Event) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.awt.AWTEvent coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.awt.AWTEvent coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component java.awt.Component findUnderMouseInWindow(java.awt.PointerInfo)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component java.awt.Component getComponentAt(java.awt.Point) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.awt.Dimension getMaximumSize()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.awt.Dimension getSize(java.awt.Dimension)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component java.awt.Dimension minimumSize()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.awt.Dimension preferredSize()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.awt.Dimension size()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.awt.Point getLocation(java.awt.Point)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component java.awt.Point location()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.awt.Point pointRelativeToComponent(java.awt.Point) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.awt.Point pointRelativeToComponent(java.awt.Point)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.awt.Rectangle bounds()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.awt.Rectangle getBounds(java.awt.Rectangle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component java.awt.Window getContainingWindow(java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Component java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component javax.accessibility.AccessibleStateSet getAccessibleStateSet()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component void add(java.awt.PopupMenu) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component void applyComponentOrientation(java.awt.ComponentOrientation) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component void createBufferStrategy(int, java.awt.BufferCapabilities) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component void dispatchEventImpl(java.awt.AWTEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component void list(java.io.PrintStream, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component void list(java.io.PrintWriter, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component void resize(java.awt.Dimension) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component void setBounds(java.awt.Rectangle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component void setLocation(java.awt.Point) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component.FlipBufferStrategy FlipBufferStrategy(java.awt.Component, int, java.awt.BufferCapabilities) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Component.FlipBufferStrategy void createBuffers(int, java.awt.BufferCapabilities) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container boolean eventEnabled(java.awt.AWTEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container boolean isAncestorOf(java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Container boolean isRemoveNotifyNeeded(java.awt.Component, java.awt.Container, java.awt.Container)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,null->false;_,null,_->false;null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Container java.awt.Component add(java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Container java.awt.Component add(java.awt.Component, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Container java.awt.Component add(java.lang.String, java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Container java.awt.Component findComponentAt(java.awt.Point) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container java.awt.Component getComponentAt(java.awt.Point) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container java.awt.Component[] getComponents()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container java.awt.Component[] getComponents_NoClientCode()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void addDelicately(java.awt.Component, java.awt.Container, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void addImpl(java.awt.Component, java.lang.Object, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void applyComponentOrientation(java.awt.ComponentOrientation) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void checkAdding(java.awt.Component, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void deliverEvent(java.awt.Event) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void dispatchEventImpl(java.awt.AWTEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void dispatchEventToSelf(java.awt.AWTEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void list(java.io.PrintStream, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void list(java.io.PrintWriter, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void remove(java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void removeDelicately(java.awt.Component, java.awt.Container, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void reparentTraverse(java.awt.peer.ContainerPeer, java.awt.Container) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void setComponentZOrder(java.awt.Component, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Container void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Dimension Dimension(java.awt.Dimension) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Dimension boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Dimension java.awt.Dimension getSize()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Dimension java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Dimension void setSize(java.awt.Dimension) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Frame java.lang.String constructComponentName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Frame void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Frame void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window Window(java.awt.Frame) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window Window(java.awt.Window) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window Window(java.awt.Window, java.awt.GraphicsConfiguration) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window boolean dispatchMouseWheelToAncestor(java.awt.event.MouseWheelEvent)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->false;null->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Window boolean eventEnabled(java.awt.AWTEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window boolean postEvent(java.awt.Event)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.awt.Window java.lang.Object access$000(java.awt.Window) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window java.lang.String constructComponentName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window void connectOwnedWindow(java.awt.Window) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window void dispatchEventImpl(java.awt.AWTEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window void ownedInit(java.awt.Window) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window void preProcessKeyEvent(java.awt.event.KeyEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.awt.Window void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/awt/event/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/awt/event/annotations.xml
new file mode 100644
index 0000000..7b9c87e
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/awt/event/annotations.xml
@@ -0,0 +1,5 @@
+<root>
+ <item name="java.awt.event.ActionEvent java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/beans/beancontext/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/beans/beancontext/annotations.xml
new file mode 100644
index 0000000..60214de
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/beans/beancontext/annotations.xml
@@ -0,0 +1,79 @@
+<root>
+ <item name="java.beans.beancontext.BeanContextServicesSupport boolean addService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport boolean addService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport boolean hasService(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport java.beans.beancontext.BeanContextServicesListener getChildBeanContextServicesListener(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport java.beans.beancontext.BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport java.beans.beancontext.BeanContextSupport.BCSChild createBCSChild(java.lang.Object, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport java.lang.Object getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport java.lang.Object getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport java.lang.Object getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport java.lang.Object getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport java.util.Iterator getCurrentServiceClasses()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void addBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void bcsPreDeserializationHook(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void bcsPreSerializationHook(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void childJustRemovedHook(java.lang.Object, java.beans.beancontext.BeanContextSupport.BCSChild) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void releaseService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void releaseService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Object) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void releaseService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Object) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void removeBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void revokeService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void revokeService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void serviceAvailable(java.beans.beancontext.BeanContextServiceAvailableEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void serviceRevoked(java.beans.beancontext.BeanContextServiceRevokedEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.beans.beancontext.BeanContextServicesSupport void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/io/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/io/annotations.xml
new file mode 100644
index 0000000..868b0f3
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/io/annotations.xml
@@ -0,0 +1,395 @@
+<root>
+ <item name="java.io.BufferedInputStream int read(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.BufferedReader BufferedReader(java.io.Reader) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.BufferedReader BufferedReader(java.io.Reader, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.BufferedReader int read(char[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.BufferedWriter BufferedWriter(java.io.Writer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.BufferedWriter BufferedWriter(java.io.Writer, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.BufferedWriter void write(char[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ByteArrayInputStream ByteArrayInputStream(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ByteArrayInputStream ByteArrayInputStream(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ByteArrayInputStream int read(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ByteArrayOutputStream java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ByteArrayOutputStream java.lang.String toString(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ByteArrayOutputStream java.lang.String toString(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ByteArrayOutputStream java.lang.String toString(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ByteArrayOutputStream void write(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ByteArrayOutputStream void writeTo(java.io.OutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.DataInputStream int read(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.DataInputStream java.lang.String readUTF()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.DataInputStream java.lang.String readUTF(java.io.DataInput) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.DataInputStream java.lang.String readUTF(java.io.DataInput)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.DataInputStream void readFully(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File File(java.io.File, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File File(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File File(java.lang.String, java.io.File) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File File(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File File(java.net.URI) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.io.File java.io.File createTempFile(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File java.io.File createTempFile(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File java.io.File createTempFile(java.lang.String, java.lang.String, java.io.File) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File java.io.File createTempFile(java.lang.String, java.lang.String, java.io.File)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File java.io.File generateFile(java.lang.String, java.lang.String, java.io.File)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File java.io.File getAbsoluteFile()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File java.io.File getCanonicalFile()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File java.lang.String getName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File java.lang.String slashify(java.lang.String, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File java.net.URI toURI()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File java.net.URL toURL()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.File void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.FileInputStream FileInputStream(java.io.FileDescriptor) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.FileInputStream int read(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.FileOutputStream FileOutputStream(java.io.FileDescriptor) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.FileOutputStream void write(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.FileReader FileReader(java.io.FileDescriptor) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.FileWriter FileWriter(java.io.FileDescriptor) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.FilterOutputStream void write(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.FilterOutputStream void write(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.InputStream int read(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.InputStream int read(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.InputStreamReader InputStreamReader(java.io.InputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.InputStreamReader InputStreamReader(java.io.InputStream, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.InputStreamReader InputStreamReader(java.io.InputStream, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.InputStreamReader InputStreamReader(java.io.InputStream, java.nio.charset.Charset) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.InputStreamReader InputStreamReader(java.io.InputStream, java.nio.charset.Charset) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.InputStreamReader InputStreamReader(java.io.InputStream, java.nio.charset.CharsetDecoder) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.InputStreamReader InputStreamReader(java.io.InputStream, java.nio.charset.CharsetDecoder) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream boolean access$400(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream int access$000(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream int access$002(java.io.ObjectInputStream, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream int read(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream java.io.ObjectInputStream.BlockDataInputStream access$200(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream java.io.ObjectInputStream.HandleTable access$100(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream java.io.ObjectStreamClass readClassDescriptor()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream java.io.ObjectStreamClass readNonProxyDesc(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream java.lang.Class resolveClass(java.io.ObjectStreamClass) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream java.lang.Class resolveProxyClass(java.lang.String[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream java.lang.Object access$300(java.io.ObjectInputStream, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream java.lang.Object resolveObject(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.io.ObjectInputStream void access$500(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream void defaultReadFields(java.lang.Object, java.io.ObjectStreamClass) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream void readExternalData(java.io.Externalizable, java.io.ObjectStreamClass) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream void readFully(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream void readFully(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectInputStream void readSerialData(java.lang.Object, java.io.ObjectStreamClass) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream java.io.ObjectOutputStream.BlockDataOutputStream access$000(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream java.lang.Object replaceObject(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.io.ObjectOutputStream void access$100(java.io.ObjectOutputStream, java.lang.Object, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void defaultWriteFields(java.lang.Object, java.io.ObjectStreamClass) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void write(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void write(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void writeArray(java.lang.Object, java.io.ObjectStreamClass, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void writeArray(java.lang.Object, java.io.ObjectStreamClass, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void writeClassDescriptor(java.io.ObjectStreamClass) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void writeEnum(java.lang.Enum, java.io.ObjectStreamClass, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void writeEnum(java.lang.Enum, java.io.ObjectStreamClass, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void writeExternalData(java.io.Externalizable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void writeNonProxyDesc(java.io.ObjectStreamClass, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void writeOrdinaryObject(java.lang.Object, java.io.ObjectStreamClass, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void writeProxyDesc(java.io.ObjectStreamClass, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.ObjectOutputStream void writeSerialData(java.lang.Object, java.io.ObjectStreamClass) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.OutputStream void write(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.OutputStream void write(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.OutputStreamWriter OutputStreamWriter(java.io.OutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.OutputStreamWriter OutputStreamWriter(java.io.OutputStream, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.OutputStreamWriter OutputStreamWriter(java.io.OutputStream, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.OutputStreamWriter OutputStreamWriter(java.io.OutputStream, java.nio.charset.Charset) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.OutputStreamWriter OutputStreamWriter(java.io.OutputStream, java.nio.charset.Charset) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.OutputStreamWriter OutputStreamWriter(java.io.OutputStream, java.nio.charset.CharsetEncoder) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.OutputStreamWriter OutputStreamWriter(java.io.OutputStream, java.nio.charset.CharsetEncoder) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.PrintStream PrintStream(boolean, java.io.OutputStream) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.PrintStream PrintStream(java.io.File, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.PrintStream PrintStream(java.io.OutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.PrintStream PrintStream(java.io.OutputStream, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.PrintStream PrintStream(java.io.OutputStream, boolean, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.PrintStream PrintStream(java.io.OutputStream, boolean, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.PrintStream PrintStream(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.PrintStream java.io.PrintStream append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.PrintStream java.io.PrintStream append(java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.PrintStream java.io.PrintStream append(java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.PrintStream void init(java.io.OutputStreamWriter) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.RandomAccessFile RandomAccessFile(java.io.File, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.RandomAccessFile RandomAccessFile(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.RandomAccessFile int read(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.RandomAccessFile java.lang.String readUTF()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.RandomAccessFile void readFully(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.RandomAccessFile void write(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.RandomAccessFile void writeBytes(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.RandomAccessFile void writeChars(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.Reader Reader(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.Reader int read(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.Reader int read(java.nio.CharBuffer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.Writer Writer(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.Writer java.io.Writer append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.Writer java.io.Writer append(java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.Writer java.io.Writer append(java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.Writer void write(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.Writer void write(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.io.Writer void write(java.lang.String, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/lang/annotation/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/lang/annotation/annotations.xml
new file mode 100644
index 0000000..21d29c1
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/lang/annotation/annotations.xml
@@ -0,0 +1,5 @@
+<root>
+ <item name="java.lang.annotation.IncompleteAnnotationException IncompleteAnnotationException(java.lang.Class<? extends java.lang.annotation.Annotation>, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/lang/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/lang/annotations.xml
new file mode 100644
index 0000000..8d15748
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/lang/annotations.xml
@@ -0,0 +1,1347 @@
+<root>
+ <item name="java.lang.AbstractStringBuilder int indexOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder int lastIndexOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder append(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder append(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder append(char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder append(char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder append(double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder append(float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder append(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder append(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder append(java.lang.StringBuffer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder append(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder appendCodePoint(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder delete(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder deleteCharAt(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder insert(int, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder insert(int, char[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder insert(int, char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder insert(int, char[], int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder insert(int, char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder insert(int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder replace(int, int, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder replace(int, int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.AbstractStringBuilder java.lang.String substring(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Boolean boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Boolean boolean parseBoolean(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Boolean boolean toBoolean(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Boolean int compareTo(java.lang.Boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Boolean int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Boolean java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Boolean java.lang.String toString(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte Byte(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Byte byte parseByte(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte byte parseByte(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte int compareTo(java.lang.Byte) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte java.lang.Byte decode(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte java.lang.Byte decode(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte java.lang.Byte valueOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte java.lang.Byte valueOf(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte java.lang.Byte valueOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte java.lang.Byte valueOf(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Byte java.lang.String toString(byte)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Character char[] toChars(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character int codePointAt(char[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character int codePointAt(java.lang.CharSequence, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character int codePointBefore(char[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character int codePointBefore(java.lang.CharSequence, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character int compareTo(java.lang.Character) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character int toChars(int, char[], int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character java.lang.Character valueOf(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character java.lang.String toString(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Character void toSurrogates(int, char[], int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class A getAnnotation(java.lang.Class<A>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class T cast(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Class boolean access$202(boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""false->false;true->true""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Class boolean access$302(boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""false->false;true->true""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Class boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.Class toClass(java.lang.reflect.Type)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Class java.lang.Class<? extends U> asSubclass(java.lang.Class<U>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.Class<? extends U> asSubclass(java.lang.Class<U>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.String argumentTypesToString(java.lang.Class[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.String getSimpleName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.String resolveName(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Class java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Constructor[] copyConstructors(java.lang.reflect.Constructor[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Field getDeclaredField(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Field getField(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Field getField0(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Field searchFields(java.lang.reflect.Field[], java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Field searchFields(java.lang.reflect.Field[], java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Field[] copyFields(java.lang.reflect.Field[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Method getDeclaredMethod(java.lang.String, java.lang.Class...) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Method getMethod(java.lang.String, java.lang.Class...) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Method getMethod0(java.lang.String, java.lang.Class[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Method searchMethods(java.lang.reflect.Method[], java.lang.String, java.lang.Class[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Method searchMethods(java.lang.reflect.Method[], java.lang.String, java.lang.Class[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class java.lang.reflect.Method[] copyMethods(java.lang.reflect.Method[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Class void addAll(java.util.Collection, java.lang.reflect.Field[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ClassLoader boolean compareCerts(java.security.cert.Certificate[], java.security.cert.Certificate[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ClassLoader boolean loadLibrary0(java.lang.Class, java.io.File)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.ClassLoader java.lang.Package definePackage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.net.URL)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ClassLoader java.lang.String findLibrary(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.ClassLoader java.lang.String[] initializePath(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ClassLoader java.net.URL findResource(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.ClassLoader java.util.Enumeration findResources(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ClassLoader java.util.Enumeration getBootstrapResources(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ClassLoader java.util.Enumeration getResources(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ClassLoader java.util.Enumeration getSystemResources(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ClassLoader void checkCerts(java.lang.String, java.security.CodeSource) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ClassLoader void setSigners(java.lang.Class, java.lang.Object[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Double boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Double int compareTo(java.lang.Double) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Double int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Double java.lang.Double valueOf(double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Double java.lang.Double valueOf(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Enum T valueOf(java.lang.Class<T>, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Enum int compareTo(E) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Enum int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Float boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Float int compareTo(java.lang.Float) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Float int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Float java.lang.Float valueOf(float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Float java.lang.Float valueOf(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer Integer(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Integer int compareTo(java.lang.Integer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer int parseInt(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer int parseInt(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.Integer decode(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.Integer decode(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.Integer getInteger(java.lang.String, java.lang.Integer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Integer java.lang.Integer valueOf(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.Integer valueOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.Integer valueOf(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.Integer valueOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.Integer valueOf(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.String toBinaryString(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.String toHexString(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.String toOctalString(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.String toString(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.String toString(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer java.lang.String toUnsignedString(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Integer void getChars(int, int, char[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long Long(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Long int compareTo(java.lang.Long) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.Long decode(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.Long decode(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.Long getLong(java.lang.String, java.lang.Long)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Long java.lang.Long valueOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.Long valueOf(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.Long valueOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.Long valueOf(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.String toBinaryString(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.String toHexString(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.String toOctalString(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.String toString(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.String toString(long, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long java.lang.String toUnsignedString(long, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long long parseLong(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long long parseLong(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Long void getChars(long, int, char[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.NumberFormatException java.lang.NumberFormatException forInputString(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Object java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short Short(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.Short int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short int compareTo(java.lang.Short) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short java.lang.Short decode(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short java.lang.Short decode(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short java.lang.Short valueOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short java.lang.Short valueOf(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short java.lang.Short valueOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short java.lang.Short valueOf(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short java.lang.Short valueOf(short)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short java.lang.String toString(short)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short short parseShort(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Short short parseShort(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(byte[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(byte[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(byte[], int, int, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(byte[], int, int, java.lang.String) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(byte[], java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(byte[], java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(char[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(int[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(java.lang.StringBuffer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String String(java.lang.StringBuilder) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String boolean contains(java.lang.CharSequence) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String boolean contentEquals(java.lang.CharSequence) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String boolean contentEquals(java.lang.StringBuffer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String boolean endsWith(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String boolean regionMatches(boolean, int, java.lang.String, int, int) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String boolean regionMatches(int, java.lang.String, int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String boolean startsWith(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String boolean startsWith(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String byte[] getBytes(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String char[] toCharArray()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String int compareTo(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String int indexOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String int indexOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String int lastIndexOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String int lastIndexOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.CharSequence subSequence(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String concat(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String concat(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String copyValueOf(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String copyValueOf(char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String copyValueOf(char[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String copyValueOf(char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String replace(java.lang.CharSequence, java.lang.CharSequence) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String replace(java.lang.CharSequence, java.lang.CharSequence) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String substring(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String substring(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String toLowerCase(java.util.Locale) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String toUpperCase(java.util.Locale) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String valueOf(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String valueOf(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String valueOf(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String valueOf(char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String valueOf(char[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String valueOf(char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String valueOf(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String java.lang.String valueOf(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.String java.lang.String valueOf(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String void checkBounds(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String.CaseInsensitiveComparator int compare(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.String.CaseInsensitiveComparator int compare(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer StringBuffer(java.lang.CharSequence) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer StringBuffer(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer int indexOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer int indexOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer int lastIndexOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer int lastIndexOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(java.lang.StringBuffer)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder append(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder appendCodePoint(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder delete(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder deleteCharAt(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, char[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, char[], int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder insert(int, long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder replace(int, int, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder replace(int, int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.AbstractStringBuilder reverse()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.Appendable append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.Appendable append(java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.Appendable append(java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.CharSequence subSequence(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.String substring(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.String substring(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(java.lang.StringBuffer)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer append(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer appendCodePoint(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer delete(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer deleteCharAt(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, char[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, char[], int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer insert(int, long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer replace(int, int, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer replace(int, int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer java.lang.StringBuffer reverse()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuffer void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder StringBuilder(java.lang.CharSequence) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder StringBuilder(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder int indexOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder int indexOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder int lastIndexOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder int lastIndexOf(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(java.lang.StringBuffer)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder append(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder appendCodePoint(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder delete(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder deleteCharAt(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, char[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, char[], int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder insert(int, long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder replace(int, int, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder replace(int, int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.AbstractStringBuilder reverse()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.Appendable append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.Appendable append(java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.Appendable append(java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(java.lang.StringBuffer)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(java.lang.StringBuilder)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder append(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder appendCodePoint(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder delete(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder deleteCharAt(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, char[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, char[], int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, char[], int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, java.lang.CharSequence)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, java.lang.CharSequence, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder insert(int, long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder replace(int, int, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder replace(int, int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder java.lang.StringBuilder reverse()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.StringBuilder void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.System java.lang.String clearProperty(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.System java.lang.String getProperty(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.System java.lang.String getProperty(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.System java.lang.String setProperty(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.System void checkKey(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.System.2 sun.reflect.ConstantPool getConstantPool(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.System.2 sun.reflect.annotation.AnnotationType getAnnotationType(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.System.2 void blockedOn(java.lang.Thread, sun.nio.ch.Interruptible) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.System.2 void setAnnotationType(java.lang.Class, sun.reflect.annotation.AnnotationType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Thread Thread(java.lang.Runnable, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Thread Thread(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Thread Thread(java.lang.ThreadGroup, java.lang.Runnable, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Thread Thread(java.lang.ThreadGroup, java.lang.Runnable, java.lang.String, long) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Thread Thread(java.lang.ThreadGroup, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Thread java.lang.String getName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Thread java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Thread void init(java.lang.ThreadGroup, java.lang.Runnable, java.lang.String, long) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Thread void setName(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal int access$400(java.lang.ThreadLocal) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal java.lang.ThreadLocal.ThreadLocalMap createInheritedMap(java.lang.ThreadLocal.ThreadLocalMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal java.lang.ThreadLocal.ThreadLocalMap createInheritedMap(java.lang.ThreadLocal.ThreadLocalMap)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal java.lang.ThreadLocal.ThreadLocalMap getMap(java.lang.Thread) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal void createMap(java.lang.Thread, T) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap ThreadLocalMap(java.lang.ThreadLocal, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap ThreadLocalMap(java.lang.ThreadLocal.ThreadLocalMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap ThreadLocalMap(java.lang.ThreadLocal.ThreadLocalMap, java.lang.ThreadLocal.1) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap java.lang.ThreadLocal.ThreadLocalMap.Entry access$000(java.lang.ThreadLocal.ThreadLocalMap, java.lang.ThreadLocal) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap java.lang.ThreadLocal.ThreadLocalMap.Entry access$000(java.lang.ThreadLocal.ThreadLocalMap, java.lang.ThreadLocal) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap java.lang.ThreadLocal.ThreadLocalMap.Entry getEntry(java.lang.ThreadLocal) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap java.lang.ThreadLocal.ThreadLocalMap.Entry getEntryAfterMiss(java.lang.ThreadLocal, int, java.lang.ThreadLocal.ThreadLocalMap.Entry)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap void access$100(java.lang.ThreadLocal.ThreadLocalMap, java.lang.ThreadLocal, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap void access$100(java.lang.ThreadLocal.ThreadLocalMap, java.lang.ThreadLocal, java.lang.Object) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap void access$200(java.lang.ThreadLocal.ThreadLocalMap, java.lang.ThreadLocal) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap void access$200(java.lang.ThreadLocal.ThreadLocalMap, java.lang.ThreadLocal) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap void remove(java.lang.ThreadLocal) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.ThreadLocal.ThreadLocalMap void set(java.lang.ThreadLocal, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Throwable java.lang.Throwable initCause(java.lang.Throwable)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Throwable void printEnclosedStackTrace(java.lang.Throwable.PrintStreamOrWriter, java.lang.StackTraceElement[], java.lang.String, java.lang.String, java.util.Set<java.lang.Throwable>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Throwable void printEnclosedStackTrace(java.lang.Throwable.PrintStreamOrWriter, java.lang.StackTraceElement[], java.lang.String, java.lang.String, java.util.Set<java.lang.Throwable>) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Throwable void printStackTrace(java.lang.Throwable.PrintStreamOrWriter) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Throwable void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Throwable void setStackTrace(java.lang.StackTraceElement[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.Throwable void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/lang/invoke/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/lang/invoke/annotations.xml
new file mode 100644
index 0000000..f800dab
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/lang/invoke/annotations.xml
@@ -0,0 +1,1872 @@
+<root>
+ <item name="java.lang.invoke.AdapterMethodHandle AdapterMethodHandle(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, long) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle AdapterMethodHandle(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, long, java.lang.Object) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle AdapterMethodHandle(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, long, java.lang.invoke.AdapterMethodHandle.1) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canBoxArgument(java.lang.Class<?>, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->false;_,!null->false;_,null->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canCheckCast(java.lang.Class<?>, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canCheckCast(java.lang.Class<?>, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canCheckCast(java.lang.invoke.MethodType, java.lang.invoke.MethodType, int, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_,_->false;null,_,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canConvertArgument(java.lang.Class<?>, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canDupArguments(java.lang.invoke.MethodType, java.lang.invoke.MethodType, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_,_->false;null,_,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canPairwiseConvert(java.lang.invoke.MethodType, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canPairwiseConvert(java.lang.invoke.MethodType, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canPrimCast(java.lang.Class<?>, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canPrimCast(java.lang.invoke.MethodType, java.lang.invoke.MethodType, int, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_,_->false;null,_,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canRotateArguments(java.lang.invoke.MethodType, java.lang.invoke.MethodType, int, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_,_,_->false;null,_,_,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canSpreadArguments(java.lang.invoke.MethodType, java.lang.invoke.MethodType, java.lang.Class<?>, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_,_,_->false;null,_,_,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canSwapArguments(java.lang.invoke.MethodType, java.lang.invoke.MethodType, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_,_->false;null,_,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canUnboxArgument(java.lang.Class<?>, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle boolean canUnboxArgument(java.lang.invoke.MethodType, java.lang.invoke.MethodType, int, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_,_->false;null,_,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle int diffReturnTypes(java.lang.invoke.MethodType, java.lang.invoke.MethodType, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle int diffReturnTypes(java.lang.invoke.MethodType, java.lang.invoke.MethodType, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle int diffTypes(java.lang.invoke.MethodType, java.lang.invoke.MethodType, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle int diffTypes(java.lang.invoke.MethodType, java.lang.invoke.MethodType, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeBoxArgument(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->null;_,!null,_,_->null;_,_,_,!null->null;_,_,_,null->null;_,null,_,_->null;null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeCheckCast(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int, java.lang.Class<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeDropArguments(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeDupArguments(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makePairwiseConvert(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makePermutation(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makePermutation(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makePrimCast(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int, java.lang.Class<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makePrimCast(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeRetype(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeRetypeOnly(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeRetypeRaw(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeRotateArguments(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int, int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeRotateArguments(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeSpreadArguments(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, java.lang.Class<?>, int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeSwapArguments(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeUnboxArgument(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeUnboxArgument(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, int, java.lang.Class<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeVarargsCollector(java.lang.invoke.MethodHandle, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle makeVarargsCollector(java.lang.invoke.MethodHandle, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle java.lang.invoke.MethodHandle nonAdapter(java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle.AsVarargsCollector AsVarargsCollector(java.lang.invoke.MethodHandle, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.AdapterMethodHandle.AsVarargsCollector java.lang.invoke.MethodHandle asType(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle BoundMethodHandle(java.lang.invoke.DirectMethodHandle, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle BoundMethodHandle(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle BoundMethodHandle(java.lang.invoke.MethodHandle, java.lang.Object, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle BoundMethodHandle(java.lang.invoke.MethodType, java.lang.Object, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle BoundMethodHandle(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, java.lang.Object, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle BoundMethodHandle(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, java.lang.Object, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle java.lang.Object bindPrimitiveArgument(java.lang.Object, java.lang.invoke.MethodHandle, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle java.lang.Object checkReferenceArgument(java.lang.Object, java.lang.invoke.MethodHandle, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle java.lang.Object checkReferenceArgument(java.lang.Object, java.lang.invoke.MethodHandle, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle java.lang.RuntimeException badBoundArgumentException(java.lang.Object, java.lang.invoke.MethodHandle, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle java.lang.RuntimeException badBoundArgumentException(java.lang.Object, java.lang.invoke.MethodHandle, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle java.lang.String noParens(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.BoundMethodHandle java.lang.String noParens(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.CallSite CallSite(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.CallSite CallSite(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.CallSite java.lang.Object maybeReBox(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.CallSite java.lang.invoke.CallSite makeSite(java.lang.invoke.MethodHandle, java.lang.String, java.lang.invoke.MethodType, java.lang.Object, java.lang.invoke.MemberName, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.CallSite java.lang.invoke.CallSite makeSite(java.lang.invoke.MethodHandle, java.lang.String, java.lang.invoke.MethodType, java.lang.Object, java.lang.invoke.MemberName, int) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.CallSite java.lang.invoke.WrongMethodTypeException wrongTargetType(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.CallSite void checkTargetChange(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.CallSite void checkTargetChange(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.CallSite void maybeReBoxElements(java.lang.Object[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ConstantCallSite ConstantCallSite(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.DirectMethodHandle DirectMethodHandle(java.lang.invoke.MethodType, java.lang.invoke.MemberName, boolean, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.DirectMethodHandle DirectMethodHandle(java.lang.invoke.MethodType, java.lang.invoke.MemberName, boolean, java.lang.Class<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric FilterGeneric(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.FilterGeneric of(java.lang.invoke.FilterGeneric.Kind, int, java.lang.invoke.MethodType, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.FilterGeneric.Adapter findAdapter(java.lang.invoke.MethodType, java.lang.invoke.FilterGeneric.Kind, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.FilterGeneric.Adapter findAdapter(java.lang.invoke.MethodType, java.lang.invoke.FilterGeneric.Kind, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.FilterGeneric.Adapter getAdapter(java.lang.invoke.FilterGeneric.Kind, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodHandle make(java.lang.invoke.FilterGeneric.Kind, int, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodHandle make(java.lang.invoke.FilterGeneric.Kind, int, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodHandle make(java.lang.invoke.FilterGeneric.Kind, int, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodHandle makeArgumentCollector(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodHandle makeArgumentCollector(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodHandle makeArgumentFilter(int, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodHandle makeArgumentFilter(int, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodHandle makeArgumentFolder(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodHandle makeArgumentFolder(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodHandle makeFlyby(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodHandle makeFlyby(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodType entryType(java.lang.invoke.FilterGeneric.Kind, int, java.lang.invoke.MethodType, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodType entryType(java.lang.invoke.FilterGeneric.Kind, int, java.lang.invoke.MethodType, java.lang.invoke.MethodType)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodType targetType(java.lang.invoke.MethodType, java.lang.invoke.FilterGeneric.Kind, int, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric java.lang.invoke.MethodType targetType(java.lang.invoke.MethodType, java.lang.invoke.FilterGeneric.Kind, int, java.lang.invoke.MethodType)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.Adapter Adapter(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.Adapter Adapter(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F0 F0(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F0 F0(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F0 java.lang.invoke.FilterGeneric.F0 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F0 java.lang.invoke.FilterGeneric.F0 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F1 F1(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F1 F1(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F1 java.lang.invoke.FilterGeneric.F1 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F1 java.lang.invoke.FilterGeneric.F1 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F10 F10(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F10 F10(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F10 java.lang.invoke.FilterGeneric.F10 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F10 java.lang.invoke.FilterGeneric.F10 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F11 F11(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F11 F11(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F11 java.lang.invoke.FilterGeneric.F11 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F11 java.lang.invoke.FilterGeneric.F11 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F12 F12(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F12 F12(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F12 java.lang.invoke.FilterGeneric.F12 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F12 java.lang.invoke.FilterGeneric.F12 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F13 F13(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F13 F13(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F13 java.lang.invoke.FilterGeneric.F13 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F13 java.lang.invoke.FilterGeneric.F13 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F14 F14(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F14 F14(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F14 java.lang.invoke.FilterGeneric.F14 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F14 java.lang.invoke.FilterGeneric.F14 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F15 F15(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F15 F15(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F15 java.lang.invoke.FilterGeneric.F15 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F15 java.lang.invoke.FilterGeneric.F15 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F16 F16(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F16 F16(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F16 java.lang.invoke.FilterGeneric.F16 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F16 java.lang.invoke.FilterGeneric.F16 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F17 F17(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F17 F17(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F17 java.lang.invoke.FilterGeneric.F17 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F17 java.lang.invoke.FilterGeneric.F17 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F18 F18(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F18 F18(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F18 java.lang.invoke.FilterGeneric.F18 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F18 java.lang.invoke.FilterGeneric.F18 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F19 F19(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F19 F19(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F19 java.lang.invoke.FilterGeneric.F19 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F19 java.lang.invoke.FilterGeneric.F19 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F2 F2(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F2 F2(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F2 java.lang.invoke.FilterGeneric.F2 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F2 java.lang.invoke.FilterGeneric.F2 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F20 F20(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F20 F20(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F20 java.lang.invoke.FilterGeneric.F20 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F20 java.lang.invoke.FilterGeneric.F20 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F3 F3(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F3 F3(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F3 java.lang.invoke.FilterGeneric.F3 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F3 java.lang.invoke.FilterGeneric.F3 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F4 F4(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F4 F4(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F4 java.lang.invoke.FilterGeneric.F4 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F4 java.lang.invoke.FilterGeneric.F4 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F5 F5(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F5 F5(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F5 java.lang.invoke.FilterGeneric.F5 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F5 java.lang.invoke.FilterGeneric.F5 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F6 F6(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F6 F6(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F6 java.lang.invoke.FilterGeneric.F6 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F6 java.lang.invoke.FilterGeneric.F6 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F7 F7(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F7 F7(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F7 java.lang.invoke.FilterGeneric.F7 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F7 java.lang.invoke.FilterGeneric.F7 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F8 F8(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F8 F8(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F8 java.lang.invoke.FilterGeneric.F8 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F8 java.lang.invoke.FilterGeneric.F8 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F9 F9(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F9 F9(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F9 java.lang.invoke.FilterGeneric.F9 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.F9 java.lang.invoke.FilterGeneric.F9 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterGeneric.Kind java.lang.String invokerName(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FilterOneArgument java.lang.invoke.MethodHandle make(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.FromGeneric FromGeneric(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric java.lang.invoke.FromGeneric of(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric java.lang.invoke.FromGeneric.Adapter findAdapter(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric java.lang.invoke.FromGeneric.Adapter makeInstance(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric java.lang.invoke.MethodHandle computeReturnConversion(java.lang.invoke.MethodType, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric java.lang.invoke.MethodHandle computeReturnConversion(java.lang.invoke.MethodType, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric java.lang.invoke.MethodHandle computeUnboxingInvoker(java.lang.invoke.MethodType, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric java.lang.invoke.MethodHandle computeUnboxingInvoker(java.lang.invoke.MethodType, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric java.lang.invoke.MethodHandle make(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A0 A0(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A0 A0(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A0 java.lang.invoke.FromGeneric.A0 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A0 java.lang.invoke.FromGeneric.A0 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A1 A1(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A1 A1(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A1 java.lang.invoke.FromGeneric.A1 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A1 java.lang.invoke.FromGeneric.A1 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A10 A10(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A10 A10(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A10 java.lang.invoke.FromGeneric.A10 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A10 java.lang.invoke.FromGeneric.A10 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A2 A2(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A2 A2(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A2 java.lang.invoke.FromGeneric.A2 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A2 java.lang.invoke.FromGeneric.A2 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A3 A3(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A3 A3(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A3 java.lang.invoke.FromGeneric.A3 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A3 java.lang.invoke.FromGeneric.A3 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A4 A4(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A4 A4(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A4 java.lang.invoke.FromGeneric.A4 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A4 java.lang.invoke.FromGeneric.A4 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A5 A5(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A5 A5(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A5 java.lang.invoke.FromGeneric.A5 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A5 java.lang.invoke.FromGeneric.A5 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A6 A6(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A6 A6(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A6 java.lang.invoke.FromGeneric.A6 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A6 java.lang.invoke.FromGeneric.A6 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A7 A7(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A7 A7(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A7 java.lang.invoke.FromGeneric.A7 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A7 java.lang.invoke.FromGeneric.A7 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A8 A8(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A8 A8(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A8 java.lang.invoke.FromGeneric.A8 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A8 java.lang.invoke.FromGeneric.A8 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A9 A9(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A9 A9(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A9 java.lang.invoke.FromGeneric.A9 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.A9 java.lang.invoke.FromGeneric.A9 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.Adapter Adapter(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.FromGeneric.Adapter Adapter(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.InvokeGeneric boolean returnConversionNeeded(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.InvokeGeneric boolean returnConversionNeeded(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->false""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.InvokeGeneric java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.InvokeGeneric java.lang.invoke.MethodHandle dispatch(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.InvokeGeneric java.lang.invoke.MethodHandle dispatch(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.InvokeGeneric java.lang.invoke.MethodHandle dispatchWithConversion(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.InvokeGeneric java.lang.invoke.MethodHandle dispatchWithConversion(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.InvokeGeneric java.lang.invoke.MethodHandle dispatcher(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.InvokeGeneric java.lang.invoke.MethodHandle dropDispatchArguments(java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.Invokers Invokers(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.Invokers java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.Invokers java.lang.invoke.MethodType invokerType(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName MemberName(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName MemberName(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName MemberName(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName MemberName(java.lang.reflect.Constructor) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName MemberName(java.lang.reflect.Field) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName MemberName(java.lang.reflect.Method) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName int access$200(java.lang.invoke.MemberName) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName java.lang.IllegalAccessException makeAccessException(java.lang.String, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName java.lang.Object access$100(java.lang.invoke.MemberName) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName java.lang.Object access$102(java.lang.invoke.MemberName, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName java.lang.Object access$102(java.lang.invoke.MemberName, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MemberName java.lang.ReflectiveOperationException makeAccessException(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName java.lang.String access$000(java.lang.invoke.MemberName) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName java.lang.String access$002(java.lang.invoke.MemberName, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName java.lang.String access$002(java.lang.invoke.MemberName, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MemberName java.lang.String getName(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MemberName.Factory boolean resolveInPlace(java.lang.invoke.MemberName, boolean, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MemberName.Factory java.lang.invoke.MemberName resolveOrNull(java.lang.invoke.MemberName, boolean, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandle MethodHandle(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandle java.lang.Object invokeWithArguments(java.util.List<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandle java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandle java.lang.invoke.MethodHandle asCollector(java.lang.Class<?>, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandle java.lang.invoke.MethodHandle asSpreader(java.lang.Class<?>, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandle java.lang.invoke.MethodHandle asVarargsCollector(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandle java.lang.invoke.MethodHandle asVarargsCollector(java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle accessArrayElement(java.lang.Class<?>, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle accessField(java.lang.invoke.MemberName, boolean, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle accessField(java.lang.invoke.MemberName, boolean, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle asVarargsCollector(java.lang.invoke.MethodHandle, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle asVarargsCollector(java.lang.invoke.MethodHandle, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle bindArgument(java.lang.invoke.MethodHandle, int, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle bindArgument(java.lang.invoke.MethodHandle, int, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle bindReceiver(java.lang.invoke.MethodHandle, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle collectArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, int, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle dropArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle dropArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle filterArgument(java.lang.invoke.MethodHandle, int, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle filterArgument(java.lang.invoke.MethodHandle, int, java.lang.invoke.MethodHandle) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle findMethod(java.lang.invoke.MemberName, boolean, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle foldArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle foldArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle makeAllocator(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle makeGuardWithCatch(java.lang.invoke.MethodHandle, java.lang.Class<? extends java.lang.Throwable>, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle makeGuardWithCatch(java.lang.invoke.MethodHandle, java.lang.Class<? extends java.lang.Throwable>, java.lang.invoke.MethodHandle) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle makeGuardWithTest(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle makeGuardWithTest(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl java.lang.invoke.MethodHandle spreadArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.AllocateObject AllocateObject(java.lang.invoke.MethodHandle, java.lang.Class<C>, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.AllocateObject java.lang.invoke.MethodHandle make(java.lang.Class<?>, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.AllocateObject java.lang.invoke.MethodType makeConType(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor FieldAccessor(java.lang.invoke.MemberName, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor V getElementL(java.lang.Class<V[]>, V[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor boolean doCache(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor boolean getElementZ(boolean[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor byte getElementB(byte[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor char getElementC(char[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor double getElementD(double[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor float getElementF(float[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor int getElementI(int[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor java.lang.Object getElementL(java.lang.Object[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor java.lang.Object staticBase(java.lang.invoke.MemberName) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor java.lang.String aname(java.lang.Class<?>, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor java.lang.String aname(java.lang.Class<?>, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor java.lang.String fname(java.lang.Class<?>, boolean, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor java.lang.invoke.MethodHandle ahandle(java.lang.Class<?>, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor java.lang.invoke.MethodHandle fhandle(java.lang.Class<?>, java.lang.Class<?>, boolean, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor java.lang.invoke.MethodHandle fhandle(java.lang.Class<?>, java.lang.Class<?>, boolean, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor java.lang.invoke.MethodType atype(java.lang.Class<?>, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor long getElementJ(long[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor short getElementS(short[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor void setElementB(byte[], int, byte) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor void setElementC(char[], int, char) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor void setElementD(double[], int, double) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor void setElementF(float[], int, float) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor void setElementI(int[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor void setElementJ(long[], int, long) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor void setElementL(java.lang.Class<V[]>, V[], int, V) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor void setElementL(java.lang.Object[], int, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor void setElementS(short[], int, short) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.FieldAccessor void setElementZ(boolean[], int, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.GuardWithCatch GuardWithCatch(java.lang.invoke.MethodHandle, java.lang.Class<? extends java.lang.Throwable>, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.GuardWithCatch GuardWithCatch(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.Class<? extends java.lang.Throwable>, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.GuardWithTest GuardWithTest(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.GuardWithTest java.lang.invoke.MethodHandle make(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleImpl.GuardWithTest java.lang.invoke.MethodHandle make(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleNatives java.lang.Object[] makeTarget(java.lang.Class<?>, java.lang.String, java.lang.String, int, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleNatives java.lang.invoke.CallSite makeDynamicCallSite(java.lang.invoke.MethodHandle, java.lang.String, java.lang.invoke.MethodType, java.lang.Object, java.lang.invoke.MemberName, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleNatives java.lang.invoke.CallSite makeDynamicCallSite(java.lang.invoke.MethodHandle, java.lang.String, java.lang.invoke.MethodType, java.lang.Object, java.lang.invoke.MemberName, int) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleNatives java.lang.invoke.MethodHandle linkMethodHandleConstant(java.lang.Class<?>, int, java.lang.Class<?>, java.lang.String, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleNatives java.lang.invoke.MethodHandle linkMethodHandleConstant(java.lang.Class<?>, int, java.lang.Class<?>, java.lang.String, java.lang.Object) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleNatives java.lang.invoke.MethodType findMethodHandleType(java.lang.Class<?>, java.lang.Class<?>[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleNatives void notifyGenericMethodType(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleNatives void raiseException(int, java.lang.Object, java.lang.Object) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleStatics java.lang.Error uncaughtException(java.lang.Exception)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleStatics java.lang.RuntimeException newIllegalArgumentException(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleStatics java.lang.RuntimeException newIllegalArgumentException(java.lang.String, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleStatics java.lang.RuntimeException newIllegalStateException(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleStatics java.lang.RuntimeException newIllegalStateException(java.lang.String, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleStatics java.lang.String addTypeString(java.lang.Object, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MethodHandleStatics java.lang.String getNameString(java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleStatics java.lang.String getNameString(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleStatics java.lang.String getNameString(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandleStatics java.lang.String message(java.lang.String, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MethodHandles T asInstance(java.lang.invoke.MethodHandle, java.lang.Class<T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles T asInstance(java.lang.invoke.MethodHandle, java.lang.Class<T>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles T1 checkValue(java.lang.Class<T0>, java.lang.Class<T1>, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles boolean access$100(java.lang.reflect.Method) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles boolean isObjectMethod(java.lang.reflect.Method) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.Class<?> wrapperInstanceType(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.Object access$200(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.Object callObjectMethod(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.RuntimeException misMatchedTypes(java.lang.String, java.lang.invoke.MethodType, java.lang.invoke.MethodType)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle arrayElementGetter(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle arrayElementSetter(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle asVarargsCollector(java.lang.invoke.MethodHandle, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle asVarargsCollector(java.lang.invoke.MethodHandle, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle catchException(java.lang.invoke.MethodHandle, java.lang.Class<? extends java.lang.Throwable>, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle catchException(java.lang.invoke.MethodHandle, java.lang.Class<? extends java.lang.Throwable>, java.lang.invoke.MethodHandle) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle collectArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle collectArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle constant(java.lang.Class<?>, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle convertArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle dropArguments(java.lang.invoke.MethodHandle, int, java.lang.Class<?>...) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle dropArguments(java.lang.invoke.MethodHandle, int, java.lang.Class<?>...)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle dropArguments(java.lang.invoke.MethodHandle, int, java.util.List<java.lang.Class<?>>) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle dropArguments(java.lang.invoke.MethodHandle, int, java.util.List<java.lang.Class<?>>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle exactInvoker(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle explicitCastArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle filterArguments(java.lang.invoke.MethodHandle, int, java.lang.invoke.MethodHandle...) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle filterArguments(java.lang.invoke.MethodHandle, int, java.lang.invoke.MethodHandle...) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle filterReturnValue(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle filterReturnValue(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle foldArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle foldArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle genericInvoker(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle guardWithTest(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle guardWithTest(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle guardWithTest(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle insertArguments(java.lang.invoke.MethodHandle, int, java.lang.Object...) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle insertArguments(java.lang.invoke.MethodHandle, int, java.lang.Object...) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle permuteArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, int...) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle permuteArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, int...) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle permuteArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, int...) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle spreadArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle spreadArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle spreadInvoker(java.lang.invoke.MethodType, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle throwException(java.lang.Class<?>, java.lang.Class<? extends java.lang.Throwable>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandle wrapperInstanceTarget(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.invoke.MethodHandles.Lookup lookup()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.reflect.Constructor getSingleConstructor(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles java.lang.reflect.Method getSingleMethod(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles sun.invoke.WrapperInstance asWrapperInstance(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles sun.invoke.WrapperInstance asWrapperInstance(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MethodHandles void checkReorder(int[], java.lang.invoke.MethodType, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles void checkReorder(int[], java.lang.invoke.MethodType, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles void checkReorder(int[], java.lang.invoke.MethodType, java.lang.invoke.MethodType) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.1 java.lang.Object invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.String accessFailedMessage(java.lang.Class<?>, java.lang.invoke.MemberName) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.String accessFailedMessage(java.lang.Class<?>, java.lang.invoke.MemberName)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MemberName resolveOrFail(java.lang.Class<?>, java.lang.String, java.lang.Class<?>, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MemberName resolveOrFail(java.lang.Class<?>, java.lang.String, java.lang.Class<?>, boolean) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MemberName resolveOrFail(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MemberName resolveOrFail(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType, boolean) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MemberName resolveOrFail(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType, boolean, boolean, java.lang.Class<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MemberName resolveOrFail(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType, boolean, boolean, java.lang.Class<?>) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle bind(java.lang.Object, java.lang.String, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle bind(java.lang.Object, java.lang.String, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle bind(java.lang.Object, java.lang.String, java.lang.invoke.MethodType) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findConstructor(java.lang.Class<?>, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findGetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findGetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findSetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findSetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findSpecial(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType, java.lang.Class<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findSpecial(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType, java.lang.Class<?>) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findStatic(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findStatic(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findStaticGetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findStaticGetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findStaticSetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findStaticSetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findVirtual(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle findVirtual(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle fixVarargs(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle fixVarargs(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle makeAccessor(java.lang.Class<?>, java.lang.String, java.lang.Class<?>, boolean, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle makeAccessor(java.lang.Class<?>, java.lang.String, java.lang.Class<?>, boolean, boolean) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle makeAccessor(java.lang.Class<?>, java.lang.invoke.MemberName, boolean, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle makeAccessor(java.lang.Class<?>, java.lang.invoke.MemberName, boolean, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,true,_->!null;_,null,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle restrictProtectedReceiver(java.lang.invoke.MemberName, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle restrictProtectedReceiver(java.lang.invoke.MemberName, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle restrictReceiver(java.lang.invoke.MemberName, java.lang.invoke.MethodHandle, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle restrictReceiver(java.lang.invoke.MemberName, java.lang.invoke.MethodHandle, java.lang.Class<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle unreflect(java.lang.reflect.Method) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle unreflectConstructor(java.lang.reflect.Constructor) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle unreflectGetter(java.lang.reflect.Field) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle unreflectSetter(java.lang.reflect.Field) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandle unreflectSpecial(java.lang.reflect.Method, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandles.Lookup in(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup java.lang.invoke.MethodHandles.Lookup in(java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup void checkMethod(java.lang.Class<?>, java.lang.invoke.MemberName, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodHandles.Lookup void checkUnprivilegedlookupClass(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType MethodType(java.lang.Class<?>, java.lang.Class<?>[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType MethodType(java.lang.Class<?>, java.lang.Class<?>[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType boolean equals(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType int checkPtype(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType int checkPtypes(java.lang.Class<?>[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.IndexOutOfBoundsException newIndexOutOfBoundsException(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.IndexOutOfBoundsException newIndexOutOfBoundsException(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType appendParameterTypes(java.lang.Class<?>...) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType appendParameterTypes(java.util.List<java.lang.Class<?>>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType insertParameterTypes(int, java.lang.Class<?>...) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType insertParameterTypes(int, java.util.List<java.lang.Class<?>>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType makeImpl(java.lang.Class<?>, java.lang.Class<?>[], boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType methodType(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.lang.Class<?>, java.lang.Class<?>...) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.lang.Class<?>, java.lang.Class<?>...) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.lang.Class<?>[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.util.List<java.lang.Class<?>>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.util.List<java.lang.Class<?>>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType unwrapWithNoPrims(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.lang.invoke.MethodType wrapWithPrims(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType java.util.List<java.lang.Class<?>> parameterList()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType void MethodType_init(java.lang.Class<?>, java.lang.Class<?>[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType void MethodType_init(java.lang.Class<?>, java.lang.Class<?>[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType void checkRtype(java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodType void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodTypeForm MethodTypeForm(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodTypeForm int[] primsAtEndOrder(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodTypeForm java.lang.Class<?> canonicalize(java.lang.Class<?>, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MethodTypeForm java.lang.Class<?>[] canonicalizes(java.lang.Class<?>[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodTypeForm java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodTypeForm java.lang.invoke.MethodType canonicalize(java.lang.invoke.MethodType, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MethodTypeForm java.lang.invoke.MethodType reorderParameters(java.lang.invoke.MethodType, int[], java.lang.Class<?>[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.MethodTypeForm java.lang.invoke.MethodTypeForm findForm(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MutableCallSite MutableCallSite(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MutableCallSite MutableCallSite(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.MutableCallSite void syncAll(java.lang.invoke.MutableCallSite[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric java.lang.Object check(java.lang.Object, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric java.lang.Object select(java.lang.Object, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric java.lang.invoke.MethodHandle access$000(java.lang.invoke.SpreadGeneric) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric java.lang.invoke.MethodHandle make(java.lang.invoke.MethodHandle, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric java.lang.invoke.MethodHandle makeInstance(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric java.lang.invoke.MethodType preSpreadType(java.lang.invoke.MethodType, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric java.lang.invoke.SpreadGeneric of(java.lang.invoke.MethodType, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric java.lang.invoke.SpreadGeneric.Adapter findAdapter(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric java.lang.invoke.SpreadGeneric.Adapter findAdapter(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.Adapter Adapter(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S0 S0(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S0 java.lang.invoke.SpreadGeneric.S0 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S0 java.lang.invoke.SpreadGeneric.S0 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S1 S1(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S1 java.lang.invoke.SpreadGeneric.S1 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S1 java.lang.invoke.SpreadGeneric.S1 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S10 S10(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S10 java.lang.invoke.SpreadGeneric.S10 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S10 java.lang.invoke.SpreadGeneric.S10 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S2 S2(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S2 java.lang.invoke.SpreadGeneric.S2 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S2 java.lang.invoke.SpreadGeneric.S2 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S3 S3(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S3 java.lang.invoke.SpreadGeneric.S3 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S3 java.lang.invoke.SpreadGeneric.S3 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S4 S4(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S4 java.lang.invoke.SpreadGeneric.S4 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S4 java.lang.invoke.SpreadGeneric.S4 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S5 S5(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S5 java.lang.invoke.SpreadGeneric.S5 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S5 java.lang.invoke.SpreadGeneric.S5 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S6 S6(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S6 java.lang.invoke.SpreadGeneric.S6 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S6 java.lang.invoke.SpreadGeneric.S6 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S7 S7(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S7 java.lang.invoke.SpreadGeneric.S7 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S7 java.lang.invoke.SpreadGeneric.S7 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S8 S8(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S8 java.lang.invoke.SpreadGeneric.S8 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S8 java.lang.invoke.SpreadGeneric.S8 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S9 S9(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S9 java.lang.invoke.SpreadGeneric.S9 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SpreadGeneric.S9 java.lang.invoke.SpreadGeneric.S9 makeInstance(java.lang.invoke.SpreadGeneric, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.SwitchPoint java.lang.invoke.MethodHandle guardWithTest(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.SwitchPoint void invalidateAll(java.lang.invoke.SwitchPoint[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric ToGeneric(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric java.lang.invoke.MethodHandle computeReturnConversion(java.lang.invoke.MethodType, java.lang.invoke.MethodType, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric java.lang.invoke.MethodHandle computeReturnConversion(java.lang.invoke.MethodType, java.lang.invoke.MethodType, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric java.lang.invoke.MethodHandle make(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric java.lang.invoke.MethodHandle make(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric java.lang.invoke.MethodHandle makeRawArgumentFilter(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, java.lang.invoke.MethodType) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric java.lang.invoke.MethodHandle makeRawArgumentFilter(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, java.lang.invoke.MethodType)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="java.lang.invoke.ToGeneric java.lang.invoke.ToGeneric of(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric java.lang.invoke.ToGeneric.Adapter findAdapter(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric java.lang.invoke.ToGeneric.Adapter makeInstance(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A0 A0(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A0 A0(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A0 java.lang.invoke.ToGeneric.A0 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A0 java.lang.invoke.ToGeneric.A0 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A1 A1(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A1 A1(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A1 java.lang.invoke.ToGeneric.A1 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A1 java.lang.invoke.ToGeneric.A1 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A10 A10(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A10 A10(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A10 java.lang.invoke.ToGeneric.A10 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A10 java.lang.invoke.ToGeneric.A10 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A2 A2(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A2 A2(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A2 java.lang.invoke.ToGeneric.A2 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A2 java.lang.invoke.ToGeneric.A2 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A3 A3(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A3 A3(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A3 java.lang.invoke.ToGeneric.A3 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A3 java.lang.invoke.ToGeneric.A3 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A4 A4(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A4 A4(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A4 java.lang.invoke.ToGeneric.A4 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A4 java.lang.invoke.ToGeneric.A4 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A5 A5(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A5 A5(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A5 java.lang.invoke.ToGeneric.A5 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A5 java.lang.invoke.ToGeneric.A5 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A6 A6(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A6 A6(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A6 java.lang.invoke.ToGeneric.A6 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A6 java.lang.invoke.ToGeneric.A6 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A7 A7(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A7 A7(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A7 java.lang.invoke.ToGeneric.A7 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A7 java.lang.invoke.ToGeneric.A7 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A8 A8(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A8 A8(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A8 java.lang.invoke.ToGeneric.A8 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A8 java.lang.invoke.ToGeneric.A8 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A9 A9(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A9 A9(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A9 java.lang.invoke.ToGeneric.A9 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.A9 java.lang.invoke.ToGeneric.A9 makeInstance(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.Adapter Adapter(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.ToGeneric.Adapter Adapter(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.VolatileCallSite VolatileCallSite(java.lang.invoke.MethodHandle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.lang.invoke.VolatileCallSite VolatileCallSite(java.lang.invoke.MethodType) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/net/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/net/annotations.xml
new file mode 100644
index 0000000..6c410bc
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/net/annotations.xml
@@ -0,0 +1,422 @@
+<root>
+ <item name="java.net.DatagramPacket DatagramPacket(byte[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramPacket DatagramPacket(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramPacket DatagramPacket(byte[], int, int, java.net.InetAddress, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramPacket DatagramPacket(byte[], int, int, java.net.SocketAddress) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramPacket DatagramPacket(byte[], int, int, java.net.SocketAddress) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramPacket DatagramPacket(byte[], int, java.net.InetAddress, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramPacket DatagramPacket(byte[], int, java.net.SocketAddress) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramPacket DatagramPacket(byte[], int, java.net.SocketAddress) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramPacket java.net.SocketAddress getSocketAddress()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramPacket void setData(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramPacket void setData(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramPacket void setSocketAddress(java.net.SocketAddress) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramSocket DatagramSocket(java.net.DatagramSocketImpl) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramSocket void connect(java.net.InetAddress, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramSocket void connect(java.net.SocketAddress) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramSocket void connectInternal(java.net.InetAddress, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramSocket void receive(java.net.DatagramPacket) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.DatagramSocket void send(java.net.DatagramPacket) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->false;null->false""/>
+ </annotation>
+ </item>
+ <item name="java.net.InetAddress int checkNumericZone(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress java.lang.Object checkLookupTable(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.InetAddress java.lang.Object getCachedAddress(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress java.lang.Object readResolve()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress java.lang.String getHostFromNameService(java.net.InetAddress, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress java.net.InetAddress getByAddress(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress java.net.InetAddress getByAddress(byte[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress java.net.InetAddress getByAddress(java.lang.String, byte[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress java.net.InetAddress getByAddress(java.lang.String, byte[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress java.net.InetAddress[] getAllByName(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.net.InetAddress java.net.InetAddress[] getAllByName0(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress java.net.InetAddress[] getAllByName0(java.lang.String, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.InetAddress sun.net.spi.nameservice.NameService access$002(sun.net.spi.nameservice.NameService)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.ServerSocket ServerSocket(java.net.Proxy) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.ServerSocket java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.ServerSocket java.net.Socket accept()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.ServerSocket java.net.SocketImpl access$000(java.net.ServerSocket) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.ServerSocket void implAccept(java.net.Socket) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.Socket Socket(java.net.SocketAddress, java.net.SocketAddress, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.Socket java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.Socket void connect(java.net.SocketAddress, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI int access$2502(java.net.URI, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI int compareTo(java.net.URI) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI int join(char[], int[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI int join(char[], int[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI int needsNormalization(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String access$002(java.net.URI, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String access$002(java.net.URI, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String access$1002(java.net.URI, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String access$1002(java.net.URI, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String access$1102(java.net.URI, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String access$1102(java.net.URI, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String access$1402(java.net.URI, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String access$1402(java.net.URI, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String access$1502(java.net.URI, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String access$1502(java.net.URI, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String access$2202(java.net.URI, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String access$2202(java.net.URI, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String access$2302(java.net.URI, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String access$2302(java.net.URI, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String access$2402(java.net.URI, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String access$2402(java.net.URI, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String access$702(java.net.URI, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String access$702(java.net.URI, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String decode(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String encode(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String encode(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String normalize(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String normalize(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String quote(java.lang.String, long, long) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String quote(java.lang.String, long, long)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.lang.String resolvePath(java.lang.String, java.lang.String, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String resolvePath(java.lang.String, java.lang.String, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.lang.String toString(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.net.URI create(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.net.URI normalize(java.net.URI) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.net.URI normalize(java.net.URI)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.net.URI parseServerAuthority()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.net.URI relativize(java.net.URI) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.net.URI relativize(java.net.URI)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.net.URI relativize(java.net.URI, java.net.URI) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.net.URI relativize(java.net.URI, java.net.URI)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URI java.net.URI resolve(java.net.URI) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.net.URI resolve(java.net.URI, java.net.URI) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI java.net.URL toURL()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI long highMask(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI long lowMask(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI void appendEscape(java.lang.StringBuffer, byte) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI void maybeAddLeadingDot(char[], int[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI void removeDots(char[], int[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI void removeDots(char[], int[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI void split(char[], int[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI void split(char[], int[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URI void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL URL(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL URL(java.lang.String, java.lang.String, int, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL URL(java.lang.String, java.lang.String, int, java.lang.String, java.net.URLStreamHandler) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL URL(java.lang.String, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL URL(java.net.URL, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL URL(java.net.URL, java.lang.String, java.net.URLStreamHandler) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.net.URL boolean isValidProtocol(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL java.net.URI toURI()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL java.net.URLConnection openConnection(java.net.Proxy) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL void checkSpecifyHandler(java.lang.SecurityManager) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL void set(java.lang.String, java.lang.String, int, java.lang.String, java.lang.String) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URL void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URLConnection boolean checkfpx(java.io.InputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URLConnection int readBytes(int[], int, java.io.InputStream) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URLConnection java.lang.String getContentHandlerPkgPrefixes()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URLConnection java.lang.String getDefaultRequestProperty(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URLConnection java.lang.String getHeaderField(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URLConnection java.lang.String guessContentTypeFromStream(java.io.InputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URLConnection java.lang.String stripOffParameters(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.net.URLConnection java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URLConnection java.lang.String typeToPackageName(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URLConnection java.lang.String typeToPackageName(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URLConnection java.net.ContentHandler lookupContentHandlerClassFor(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URLConnection java.net.FileNameMap getFileNameMap()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URLConnection void addRequestProperty(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.net.URLConnection void setRequestProperty(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/security/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/security/annotations.xml
new file mode 100644
index 0000000..756cbfc
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/security/annotations.xml
@@ -0,0 +1,132 @@
+<root>
+ <item name="java.security.Identity boolean identityEquals(java.security.Identity) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Identity boolean keyEquals(java.security.Key, java.security.Key) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Identity boolean keyEquals(java.security.Key, java.security.Key) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Identity java.lang.String printKeys()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Identity java.lang.String toString(boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""true->!null""/>
+ </annotation>
+ </item>
+ <item name="java.security.Identity java.security.Certificate[] certificates()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Identity void addCertificate(java.security.Certificate) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Policy java.security.PermissionCollection getPermissions(java.security.ProtectionDomain)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.security.Policy void initPolicy(java.security.Policy) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider java.lang.String[] getTypeAndAlgorithm(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider java.util.Collection values()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider java.util.Set keySet()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider void implPutAll(java.util.Map) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider void parseLegacyPut(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider void putAll(java.util.Map) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider void putPropertyStrings(java.security.Provider.Service) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider void putService(java.security.Provider.Service) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider void removeInvalidServices(java.util.Map<java.security.Provider.ServiceKey,java.security.Provider.Service>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider void removePropertyStrings(java.security.Provider.Service) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Provider void removeService(java.security.Provider.Service) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security boolean isConstraintSatisfied(java.lang.String, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security boolean isCriterionSatisfied(java.security.Provider, java.lang.String, java.lang.String, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security boolean isStandardAttr(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security int addProvider(java.security.Provider) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security int insertProviderAt(java.security.Provider, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security java.io.File securityPropFile(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security java.lang.String getProviderProperty(java.lang.String, java.security.Provider) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security java.lang.String[] getFilterComponents(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security java.lang.String[] getFilterComponents(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security java.lang.String[] getFilterComponents(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security java.security.Provider[] getProviders(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security java.security.Provider[] getProviders(java.util.Map) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security java.util.LinkedHashSet getAllQualifyingCandidates(java.lang.String, java.lang.String, java.security.Provider[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security java.util.LinkedHashSet getAllQualifyingCandidates(java.lang.String, java.lang.String, java.security.Provider[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security java.util.LinkedHashSet getAllQualifyingCandidates(java.lang.String, java.lang.String, java.security.Provider[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security java.util.LinkedHashSet getProvidersNotUsingCache(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.security.Provider[]) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security void invalidateSMCache(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Security void setProperty(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Signer java.lang.String printKeys()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Signer java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.security.Signer void setKeyPair(java.security.KeyPair) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/sql/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/sql/annotations.xml
new file mode 100644
index 0000000..2aaa71e
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/sql/annotations.xml
@@ -0,0 +1,78 @@
+<root>
+ <item name="java.sql.Date java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.Date java.sql.Date valueOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.DriverInfo boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.sql.DriverInfo java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.DriverManager boolean isDriverAllowed(java.sql.Driver, java.lang.Class<?>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.sql.DriverManager boolean isDriverAllowed(java.sql.Driver, java.lang.ClassLoader)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->false""/>
+ </annotation>
+ </item>
+ <item name="java.sql.DriverManager java.sql.Connection getConnection(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.DriverManager java.sql.Connection getConnection(java.lang.String, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.DriverManager java.sql.Connection getConnection(java.lang.String, java.util.Properties) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.DriverManager java.sql.Connection getConnection(java.lang.String, java.util.Properties, java.lang.Class<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.DriverManager void registerDriver(java.sql.Driver) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.SQLException java.util.Iterator<java.lang.Throwable> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.Time java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.Time java.sql.Time valueOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.Time java.sql.Time valueOf(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.Timestamp boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.sql.Timestamp boolean equals(java.sql.Timestamp)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.sql.Timestamp int compareTo(java.sql.Timestamp) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.Timestamp int compareTo(java.util.Date) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.Timestamp java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.Timestamp java.sql.Timestamp valueOf(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.sql.Timestamp java.sql.Timestamp valueOf(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/annotations.xml
new file mode 100644
index 0000000..363b81c
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/annotations.xml
@@ -0,0 +1,1533 @@
+<root>
+ <item name="java.util.AbstractCollection T[] toArray(T[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractCollection boolean addAll(java.util.Collection<? extends E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractCollection boolean containsAll(java.util.Collection<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractCollection java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractList boolean add(E)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->true;null->true""/>
+ </annotation>
+ </item>
+ <item name="java.util.AbstractList boolean addAll(int, java.util.Collection<? extends E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractList java.lang.String outOfBoundsMsg(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractList java.util.Iterator<E> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractList java.util.List<E> subList(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractList java.util.ListIterator<E> listIterator(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractMap java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractMap void putAll(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractMap.1 java.util.Iterator<K> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractMap.2 java.util.Iterator<V> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractMap.SimpleEntry SimpleEntry(java.util.Map.Entry<K,V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractMap.SimpleEntry boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.AbstractMap.SimpleEntry java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractQueue boolean add(E)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->true;null->true""/>
+ </annotation>
+ </item>
+ <item name="java.util.AbstractQueue boolean addAll(java.util.Collection<? extends E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractSequentialList boolean addAll(int, java.util.Collection<? extends E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.AbstractSet boolean removeAll(java.util.Collection<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.ArrayList ArrayList(java.util.Collection<? extends E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.ArrayList T[] toArray(T[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.ArrayList boolean add(E)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->true;null->true""/>
+ </annotation>
+ </item>
+ <item name="java.util.ArrayList boolean addAll(int, java.util.Collection<? extends E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.ArrayList boolean addAll(java.util.Collection<? extends E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.ArrayList java.lang.Object[] toArray()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.ArrayList void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.ArrayList void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays T[] cloneSubarray(T[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int binarySearch(T[], T, java.util.Comparator<? super T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int binarySearch(byte[], byte) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int binarySearch(char[], char) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int binarySearch(double[], double) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int binarySearch(float[], float) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int binarySearch(int[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int binarySearch(java.lang.Object[], java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int binarySearch(long[], long) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int binarySearch(short[], short) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int med3(byte[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int med3(char[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int med3(double[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int med3(float[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int med3(int[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int med3(long[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays int med3(short[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.lang.String deepToString(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.lang.String toString(boolean[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.lang.String toString(byte[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.lang.String toString(char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.lang.String toString(double[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.lang.String toString(float[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.lang.String toString(int[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.lang.String toString(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.lang.String toString(long[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.lang.String toString(short[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.util.List<T> asList(T...) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays java.util.List<T> asList(T...)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void deepToString(java.lang.Object[], java.lang.StringBuilder, java.util.Set<java.lang.Object[]>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(boolean[], boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(boolean[], int, int, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(byte[], byte) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(byte[], int, int, byte) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(char[], char) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(char[], int, int, char) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(double[], double) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(double[], int, int, double) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(float[], float) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(float[], int, int, float) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(int[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(int[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(java.lang.Object[], int, int, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(java.lang.Object[], java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(long[], int, int, long) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(long[], long) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(short[], int, int, short) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void fill(short[], short) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(T[], int, int, java.util.Comparator<? super T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(T[], java.util.Comparator<? super T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(char[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(double[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(double[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(float[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(float[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(int[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(int[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(java.lang.Object[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(java.lang.Object[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(long[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(long[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(short[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void sort(short[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void swap(byte[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void swap(char[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void swap(double[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void swap(float[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void swap(int[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void swap(java.lang.Object[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void swap(long[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays void swap(short[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Arrays.ArrayList ArrayList(E[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar boolean after(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Calendar boolean before(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Calendar java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar java.util.Calendar createCalendar(java.util.TimeZone, java.util.Locale) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar java.util.Calendar createCalendar(java.util.TimeZone, java.util.Locale)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar java.util.Calendar getInstance()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar java.util.Calendar getInstance(java.util.Locale) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar java.util.Calendar getInstance(java.util.Locale)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar java.util.Calendar getInstance(java.util.TimeZone)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar java.util.Calendar getInstance(java.util.TimeZone, java.util.Locale) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar java.util.Calendar getInstance(java.util.TimeZone, java.util.Locale)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar java.util.Date getTime()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar void setTime(java.util.Date) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Calendar void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections T get(java.util.ListIterator<? extends T>, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections T max(java.util.Collection<? extends T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections T max(java.util.Collection<? extends T>, java.util.Comparator<? super T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections T min(java.util.Collection<? extends T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections T min(java.util.Collection<? extends T>, java.util.Comparator<? super T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections boolean addAll(java.util.Collection<? super T>, T...) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections boolean disjoint(java.util.Collection<?>, java.util.Collection<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections boolean disjoint(java.util.Collection<?>, java.util.Collection<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections boolean replaceAll(java.util.List<T>, T, T) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections int binarySearch(java.util.List<? extends T>, T, java.util.Comparator<? super T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections int binarySearch(java.util.List<? extends java.lang.Comparable<? super T>>, T) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections int frequency(java.util.Collection<?>, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections int indexOfSubList(java.util.List<?>, java.util.List<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections int indexOfSubList(java.util.List<?>, java.util.List<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections int indexedBinarySearch(java.util.List<? extends T>, T, java.util.Comparator<? super T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections int indexedBinarySearch(java.util.List<? extends java.lang.Comparable<? super T>>, T) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections int iteratorBinarySearch(java.util.List<? extends T>, T, java.util.Comparator<? super T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections int iteratorBinarySearch(java.util.List<? extends java.lang.Comparable<? super T>>, T) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections int lastIndexOfSubList(java.util.List<?>, java.util.List<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections int lastIndexOfSubList(java.util.List<?>, java.util.List<?>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.ArrayList<T> list(java.util.Enumeration<T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Collection<E> checkedCollection(java.util.Collection<E>, java.lang.Class<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Collection<E> checkedCollection(java.util.Collection<E>, java.lang.Class<E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Collection<E> checkedCollection(java.util.Collection<E>, java.lang.Class<E>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Collection<T> synchronizedCollection(java.util.Collection<T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Collection<T> synchronizedCollection(java.util.Collection<T>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Collection<T> synchronizedCollection(java.util.Collection<T>, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Collection<T> unmodifiableCollection(java.util.Collection<? extends T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Collection<T> unmodifiableCollection(java.util.Collection<? extends T>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Enumeration<T> enumeration(java.util.Collection<T>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Iterator<E> singletonIterator(E)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.List<E> checkedList(java.util.List<E>, java.lang.Class<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.List<E> checkedList(java.util.List<E>, java.lang.Class<E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.List<E> checkedList(java.util.List<E>, java.lang.Class<E>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.List<T> nCopies(int, T)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.List<T> singletonList(T)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.List<T> synchronizedList(java.util.List<T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.List<T> synchronizedList(java.util.List<T>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.List<T> synchronizedList(java.util.List<T>, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.List<T> unmodifiableList(java.util.List<? extends T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.List<T> unmodifiableList(java.util.List<? extends T>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Map<K,V> checkedMap(java.util.Map<K,V>, java.lang.Class<K>, java.lang.Class<V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Map<K,V> checkedMap(java.util.Map<K,V>, java.lang.Class<K>, java.lang.Class<V>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Map<K,V> checkedMap(java.util.Map<K,V>, java.lang.Class<K>, java.lang.Class<V>) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Map<K,V> checkedMap(java.util.Map<K,V>, java.lang.Class<K>, java.lang.Class<V>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Map<K,V> singletonMap(K, V)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Map<K,V> synchronizedMap(java.util.Map<K,V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Map<K,V> synchronizedMap(java.util.Map<K,V>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Map<K,V> unmodifiableMap(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Map<K,V> unmodifiableMap(java.util.Map<? extends K,? extends V>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Queue<T> asLifoQueue(java.util.Deque<T>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Set<E> checkedSet(java.util.Set<E>, java.lang.Class<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Set<E> checkedSet(java.util.Set<E>, java.lang.Class<E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Set<E> checkedSet(java.util.Set<E>, java.lang.Class<E>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Set<E> newSetFromMap(java.util.Map<E,java.lang.Boolean>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Set<E> newSetFromMap(java.util.Map<E,java.lang.Boolean>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Set<T> singleton(T)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Set<T> synchronizedSet(java.util.Set<T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Set<T> synchronizedSet(java.util.Set<T>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Set<T> synchronizedSet(java.util.Set<T>, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Set<T> unmodifiableSet(java.util.Set<? extends T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.Set<T> unmodifiableSet(java.util.Set<? extends T>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedMap<K,V> checkedSortedMap(java.util.SortedMap<K,V>, java.lang.Class<K>, java.lang.Class<V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedMap<K,V> checkedSortedMap(java.util.SortedMap<K,V>, java.lang.Class<K>, java.lang.Class<V>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedMap<K,V> checkedSortedMap(java.util.SortedMap<K,V>, java.lang.Class<K>, java.lang.Class<V>) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedMap<K,V> checkedSortedMap(java.util.SortedMap<K,V>, java.lang.Class<K>, java.lang.Class<V>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedMap<K,V> synchronizedSortedMap(java.util.SortedMap<K,V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedMap<K,V> synchronizedSortedMap(java.util.SortedMap<K,V>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedMap<K,V> unmodifiableSortedMap(java.util.SortedMap<K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedMap<K,V> unmodifiableSortedMap(java.util.SortedMap<K,? extends V>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedSet<E> checkedSortedSet(java.util.SortedSet<E>, java.lang.Class<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedSet<E> checkedSortedSet(java.util.SortedSet<E>, java.lang.Class<E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedSet<E> checkedSortedSet(java.util.SortedSet<E>, java.lang.Class<E>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedSet<T> synchronizedSortedSet(java.util.SortedSet<T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedSet<T> synchronizedSortedSet(java.util.SortedSet<T>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedSet<T> unmodifiableSortedSet(java.util.SortedSet<T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections java.util.SortedSet<T> unmodifiableSortedSet(java.util.SortedSet<T>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void copy(java.util.List<? super T>, java.util.List<? extends T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void copy(java.util.List<? super T>, java.util.List<? extends T>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void fill(java.util.List<? super T>, T) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void reverse(java.util.List<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void rotate(java.util.List<?>, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void rotate1(java.util.List<T>, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void rotate2(java.util.List<?>, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void shuffle(java.util.List<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void shuffle(java.util.List<?>, java.util.Random) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void sort(java.util.List<T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void sort(java.util.List<T>, java.util.Comparator<? super T>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void swap(java.lang.Object[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections void swap(java.util.List<?>, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.AsLIFOQueue boolean add(E)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->true;null->true""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.CheckedCollection CheckedCollection(java.util.Collection<E>, java.lang.Class<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedCollection CheckedCollection(java.util.Collection<E>, java.lang.Class<E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedCollection java.lang.String badElementMsg(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedCollection java.lang.String badElementMsg(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedCollection java.util.Collection<E> checkedCopyOf(java.util.Collection<? extends E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedCollection java.util.Collection<E> checkedCopyOf(java.util.Collection<? extends E>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedCollection java.util.Iterator<E> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedList CheckedList(java.util.List<E>, java.lang.Class<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedList CheckedList(java.util.List<E>, java.lang.Class<E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedList java.util.List<E> subList(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedList java.util.ListIterator<E> listIterator(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap CheckedMap(java.util.Map<K,V>, java.lang.Class<K>, java.lang.Class<V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap CheckedMap(java.util.Map<K,V>, java.lang.Class<K>, java.lang.Class<V>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap CheckedMap(java.util.Map<K,V>, java.lang.Class<K>, java.lang.Class<V>) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap java.lang.String badKeyMsg(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap java.lang.String badKeyMsg(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap java.lang.String badValueMsg(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap java.lang.String badValueMsg(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap void putAll(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap.CheckedEntrySet T[] toArray(T[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap.CheckedEntrySet boolean contains(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.CheckedMap.CheckedEntrySet boolean containsAll(java.util.Collection<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap.CheckedEntrySet boolean remove(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.CheckedMap.CheckedEntrySet java.util.Collections.CheckedMap.CheckedEntrySet.CheckedEntry<K,V,T> checkedEntry(java.util.Map.Entry<K,V>, java.lang.Class<T>)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap.CheckedEntrySet java.util.Iterator<java.util.Map.Entry<K,V>> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap.CheckedEntrySet.1 java.util.Map.Entry<K,V> next()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap.CheckedEntrySet.CheckedEntry java.lang.String badValueMsg(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedMap.CheckedEntrySet.CheckedEntry java.lang.String badValueMsg(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedRandomAccessList CheckedRandomAccessList(java.util.List<E>, java.lang.Class<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedRandomAccessList CheckedRandomAccessList(java.util.List<E>, java.lang.Class<E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedRandomAccessList java.util.List<E> subList(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSet CheckedSet(java.util.Set<E>, java.lang.Class<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSet CheckedSet(java.util.Set<E>, java.lang.Class<E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSortedMap CheckedSortedMap(java.util.SortedMap<K,V>, java.lang.Class<K>, java.lang.Class<V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSortedMap CheckedSortedMap(java.util.SortedMap<K,V>, java.lang.Class<K>, java.lang.Class<V>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSortedMap CheckedSortedMap(java.util.SortedMap<K,V>, java.lang.Class<K>, java.lang.Class<V>) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSortedMap java.util.SortedMap<K,V> headMap(K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSortedMap java.util.SortedMap<K,V> subMap(K, K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSortedMap java.util.SortedMap<K,V> tailMap(K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSortedSet CheckedSortedSet(java.util.SortedSet<E>, java.lang.Class<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSortedSet CheckedSortedSet(java.util.SortedSet<E>, java.lang.Class<E>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSortedSet java.util.SortedSet<E> headSet(E)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSortedSet java.util.SortedSet<E> subSet(E, E)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CheckedSortedSet java.util.SortedSet<E> tailSet(E)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CopiesList T[] toArray(T[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CopiesList java.lang.Object[] toArray()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.CopiesList java.util.List<E> subList(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.EmptyList T[] toArray(T[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.EmptyList T[] toArray(T[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.EmptyList boolean contains(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->false;null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.EmptyList boolean containsAll(java.util.Collection<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.EmptyList boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.EmptyList java.lang.Object[] toArray()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.EmptyMap V get(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->null;null->null""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.EmptyMap boolean containsKey(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->false;null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.EmptyMap boolean containsValue(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->false;null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.EmptyMap boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.EmptySet T[] toArray(T[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.EmptySet T[] toArray(T[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.EmptySet boolean contains(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->false;null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.EmptySet boolean containsAll(java.util.Collection<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.EmptySet java.lang.Object[] toArray()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.ReverseComparator int compare(java.lang.Comparable<java.lang.Object>, java.lang.Comparable<java.lang.Object>) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SetFromMap SetFromMap(java.util.Map<E,java.lang.Boolean>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SetFromMap void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SingletonList java.util.Iterator<E> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SingletonSet java.util.Iterator<E> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedCollection SynchronizedCollection(java.util.Collection<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedCollection void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedList SynchronizedList(java.util.List<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedList java.lang.Object readResolve()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedList java.util.List<E> subList(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedMap SynchronizedMap(java.util.Map<K,V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedMap void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedRandomAccessList SynchronizedRandomAccessList(java.util.List<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedRandomAccessList java.lang.Object writeReplace()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedRandomAccessList java.util.List<E> subList(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedSet SynchronizedSet(java.util.Set<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedSortedMap SynchronizedSortedMap(java.util.SortedMap<K,V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedSortedMap java.util.SortedMap<K,V> headMap(K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedSortedMap java.util.SortedMap<K,V> subMap(K, K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedSortedMap java.util.SortedMap<K,V> tailMap(K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedSortedSet SynchronizedSortedSet(java.util.SortedSet<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedSortedSet java.util.SortedSet<E> headSet(E)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedSortedSet java.util.SortedSet<E> subSet(E, E)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.SynchronizedSortedSet java.util.SortedSet<E> tailSet(E)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableCollection UnmodifiableCollection(java.util.Collection<? extends E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableCollection java.util.Iterator<E> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableList UnmodifiableList(java.util.List<? extends E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableList java.lang.Object readResolve()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableList java.util.List<E> subList(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableList java.util.ListIterator<E> listIterator(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableMap UnmodifiableMap(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableMap.UnmodifiableEntrySet T[] toArray(T[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableMap.UnmodifiableEntrySet UnmodifiableEntrySet(java.util.Set<? extends java.util.Map.Entry<? extends K,? extends V>>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableMap.UnmodifiableEntrySet boolean contains(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Collections.UnmodifiableMap.UnmodifiableEntrySet boolean containsAll(java.util.Collection<?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableMap.UnmodifiableEntrySet java.util.Iterator<java.util.Map.Entry<K,V>> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableMap.UnmodifiableEntrySet.1 java.util.Map.Entry<K,V> next()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableRandomAccessList UnmodifiableRandomAccessList(java.util.List<? extends E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableRandomAccessList java.lang.Object writeReplace()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableRandomAccessList java.util.List<E> subList(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableSet UnmodifiableSet(java.util.Set<? extends E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableSortedMap UnmodifiableSortedMap(java.util.SortedMap<K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableSortedMap java.util.SortedMap<K,V> headMap(K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableSortedMap java.util.SortedMap<K,V> subMap(K, K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableSortedMap java.util.SortedMap<K,V> tailMap(K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableSortedSet UnmodifiableSortedSet(java.util.SortedSet<E>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableSortedSet java.util.SortedSet<E> headSet(E)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableSortedSet java.util.SortedSet<E> subSet(E, E)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Collections.UnmodifiableSortedSet java.util.SortedSet<E> tailSet(E)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Date Date(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Date boolean after(java.util.Date) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Date boolean before(java.util.Date) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Date boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Date int compareTo(java.util.Date) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Date long parse(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Date void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Date void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.GregorianCalendar boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.GregorianCalendar int floorDivide(int, int, int[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.GregorianCalendar int floorDivide(long, int, int[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.GregorianCalendar java.util.Date getGregorianChange()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.GregorianCalendar long computeJulianDay(boolean, int, int[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.GregorianCalendar void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.GregorianCalendar void setGregorianChange(java.util.Date) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.HashMap HashMap(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.HashMap T maskNull(T)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.util.HashMap T unmaskNull(T)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.util.HashMap boolean eq(java.lang.Object, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->true""/>
+ </annotation>
+ </item>
+ <item name="java.util.HashMap int hash(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.HashMap java.util.HashMap.Entry<K,V> removeMapping(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.util.HashMap java.util.Iterator<K> newKeyIterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.HashMap java.util.Iterator<V> newValueIterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.HashMap java.util.Iterator<java.util.Map.Entry<K,V>> newEntryIterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.HashMap void putAll(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.HashMap void putAllForCreate(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.HashMap void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.HashMap void transfer(java.util.HashMap.Entry[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.HashMap void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable Hashtable(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable V get(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable V put(K, V) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable V put(K, V) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable V remove(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable boolean contains(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable boolean containsKey(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable int access$200(java.util.Hashtable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable int access$210(java.util.Hashtable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable int access$500(java.util.Hashtable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable int access$508(java.util.Hashtable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable java.util.Hashtable.Entry[] access$400(java.util.Hashtable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable java.util.Iterator access$100(java.util.Hashtable, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable void putAll(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable void reconstitutionPut(java.util.Hashtable.Entry[], K, V) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable void reconstitutionPut(java.util.Hashtable.Entry[], K, V) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable void reconstitutionPut(java.util.Hashtable.Entry[], K, V) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable.Entry V setValue(V) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable.Entry boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Hashtable.Entry java.lang.Object clone()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable.Entry java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Hashtable.EntrySet boolean contains(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.Hashtable.EntrySet boolean remove(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.IdentityHashMap IdentityHashMap(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap boolean access$1500(java.util.IdentityHashMap, java.lang.Object, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap boolean access$1600(java.util.IdentityHashMap, java.lang.Object, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap int access$000(java.util.IdentityHashMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap int access$010(java.util.IdentityHashMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap int access$200(java.util.IdentityHashMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap int access$204(java.util.IdentityHashMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap java.lang.Object access$600(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.util.IdentityHashMap java.lang.Object maskNull(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.util.IdentityHashMap java.lang.Object unmaskNull(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.util.IdentityHashMap java.lang.Object[] access$100(java.util.IdentityHashMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap void putAll(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap.EntryIterator.Entry int access$800(java.util.IdentityHashMap.EntryIterator.Entry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap.EntryIterator.Entry int access$802(java.util.IdentityHashMap.EntryIterator.Entry, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap.EntryIterator.Entry java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap.EntrySet T[] toArray(T[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap.EntrySet boolean contains(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.IdentityHashMap.EntrySet boolean remove(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="java.util.IdentityHashMap.EntrySet java.util.Iterator<java.util.Map.Entry<K,V>> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap.KeySet java.util.Iterator<K> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.IdentityHashMap.Values java.util.Iterator<V> iterator()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale Locale(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale Locale(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale Locale(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale Locale(java.lang.String, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale Locale(java.lang.String, java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale Locale(java.lang.String, java.lang.String, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String convertOldISOCodes(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String formatList(java.lang.String[], java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String formatList(java.lang.String[], java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,null->!null;_,null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="java.util.Locale java.lang.String getDisplayCountry(java.util.Locale)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.util.Locale java.lang.String getDisplayLanguage(java.util.Locale)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.util.Locale java.lang.String getDisplayString(java.lang.String, java.util.Locale, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String getDisplayString(java.lang.String, java.util.Locale, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="java.util.Locale java.lang.String getISO3Code(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String getISO3Code(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null""/>
+ </annotation>
+ </item>
+ <item name="java.util.Locale java.lang.String toLowerCase(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String toLowerCase(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String toUpperCase(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String toUpperCase(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String[] composeList(java.text.MessageFormat, java.lang.String[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String[] getISO2Table(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String[] getISOCountries()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.lang.String[] getISOLanguages()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.util.Locale createSingleton(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.util.Locale getInstance(java.lang.String, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.util.Locale getInstance(java.lang.String, java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale java.util.Locale getInstance(java.lang.String, java.lang.String, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Locale void setDefault(java.util.Locale) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties java.lang.String getProperty(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties java.lang.String loadConvert(char[], int, int, char[]) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties java.lang.String loadConvert(char[], int, int, char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties java.lang.String saveConvert(java.lang.String, boolean, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties java.lang.String saveConvert(java.lang.String, boolean, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties void list(java.io.PrintStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties void list(java.io.PrintWriter) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties void load0(java.util.Properties.LineReader) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties void loadFromXML(java.io.InputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties void store(java.io.OutputStream, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties void store(java.io.Writer, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties void store0(java.io.BufferedWriter, java.lang.String, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties void storeToXML(java.io.OutputStream, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties void storeToXML(java.io.OutputStream, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties void writeComments(java.io.BufferedWriter, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Properties void writeComments(java.io.BufferedWriter, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Random void nextBytes(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Random void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.Random void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap K key(java.util.TreeMap.Entry<K,?>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap TreeMap(java.util.SortedMap<K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap boolean colorOf(java.util.TreeMap.Entry<K,V>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="java.util.TreeMap boolean valueSearchNonNull(java.util.TreeMap.Entry, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap boolean valueSearchNonNull(java.util.TreeMap.Entry, java.lang.Object) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap boolean valueSearchNull(java.util.TreeMap.Entry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap int access$100(java.util.TreeMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap int access$1600(java.util.TreeMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap int access$900(java.util.TreeMap, java.lang.Object, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.lang.Object access$1200(java.util.TreeMap.Entry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.util.Comparator access$1000(java.util.TreeMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.util.SortedMap<K,V> headMap(K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.util.SortedMap<K,V> subMap(K, K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.util.SortedMap<K,V> tailMap(K)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.util.TreeMap.Entry access$1100(java.util.TreeMap, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.util.TreeMap.Entry access$1300(java.util.TreeMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.util.TreeMap.Entry access$1400(java.util.TreeMap, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.util.TreeMap.Entry access$300(java.util.TreeMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.util.TreeMap.Entry access$400(java.util.TreeMap, java.util.TreeMap.Entry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.util.TreeMap.Entry access$400(java.util.TreeMap, java.util.TreeMap.Entry)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->null""/>
+ </annotation>
+ </item>
+ <item name="java.util.TreeMap java.util.TreeMap.Entry access$800(java.util.TreeMap, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap java.util.TreeMap.Entry<K,V> leftOf(java.util.TreeMap.Entry<K,V>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.util.TreeMap java.util.TreeMap.Entry<K,V> parentOf(java.util.TreeMap.Entry<K,V>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.util.TreeMap java.util.TreeMap.Entry<K,V> rightOf(java.util.TreeMap.Entry<K,V>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.util.TreeMap java.util.TreeMap.Entry<K,V> successor(java.util.TreeMap.Entry<K,V>)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="java.util.TreeMap void access$600(java.util.TreeMap, java.util.TreeMap.Entry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap void access$600(java.util.TreeMap, java.util.TreeMap.Entry) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap void deleteEntry(java.util.TreeMap.Entry<K,V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap void fixAfterInsertion(java.util.TreeMap.Entry<K,V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap void putAll(java.util.Map<? extends K,? extends V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap void rotateLeft(java.util.TreeMap.Entry<K,V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap void rotateRight(java.util.TreeMap.Entry<K,V>) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.TreeMap void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/concurrent/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/concurrent/annotations.xml
new file mode 100644
index 0000000..3c186b1
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/concurrent/annotations.xml
@@ -0,0 +1,5 @@
+<root>
+ <item name="java.util.concurrent.TimeUnit long convert(long, java.util.concurrent.TimeUnit) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/concurrent/atomic/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/concurrent/atomic/annotations.xml
new file mode 100644
index 0000000..def395c
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/concurrent/atomic/annotations.xml
@@ -0,0 +1,98 @@
+<root>
+ <item name="java.util.concurrent.atomic.AtomicBoolean java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicInteger java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicIntegerArray AtomicIntegerArray(int[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicIntegerArray java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicIntegerFieldUpdater java.util.concurrent.atomic.AtomicIntegerFieldUpdater<U> newUpdater(java.lang.Class<U>, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicIntegerFieldUpdater java.util.concurrent.atomic.AtomicIntegerFieldUpdater<U> newUpdater(java.lang.Class<U>, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicIntegerFieldUpdater java.util.concurrent.atomic.AtomicIntegerFieldUpdater<U> newUpdater(java.lang.Class<U>, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicIntegerFieldUpdater.AtomicIntegerFieldUpdaterImpl AtomicIntegerFieldUpdaterImpl(java.lang.Class<T>, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicIntegerFieldUpdater.AtomicIntegerFieldUpdaterImpl AtomicIntegerFieldUpdaterImpl(java.lang.Class<T>, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicLong java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicLongArray AtomicLongArray(long[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicLongArray java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicLongFieldUpdater java.util.concurrent.atomic.AtomicLongFieldUpdater<U> newUpdater(java.lang.Class<U>, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicLongFieldUpdater java.util.concurrent.atomic.AtomicLongFieldUpdater<U> newUpdater(java.lang.Class<U>, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicLongFieldUpdater java.util.concurrent.atomic.AtomicLongFieldUpdater<U> newUpdater(java.lang.Class<U>, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicLongFieldUpdater.CASUpdater CASUpdater(java.lang.Class<T>, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicLongFieldUpdater.CASUpdater CASUpdater(java.lang.Class<T>, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicLongFieldUpdater.LockedUpdater LockedUpdater(java.lang.Class<T>, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicLongFieldUpdater.LockedUpdater LockedUpdater(java.lang.Class<T>, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicMarkableReference V get(boolean[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicMarkableReference.ReferenceBooleanPair boolean access$100(java.util.concurrent.atomic.AtomicMarkableReference.ReferenceBooleanPair) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicMarkableReference.ReferenceBooleanPair java.lang.Object access$000(java.util.concurrent.atomic.AtomicMarkableReference.ReferenceBooleanPair) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicReferenceArray AtomicReferenceArray(E[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicReferenceArray java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicReferenceFieldUpdater java.util.concurrent.atomic.AtomicReferenceFieldUpdater<U,W> newUpdater(java.lang.Class<U>, java.lang.Class<W>, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicReferenceFieldUpdater java.util.concurrent.atomic.AtomicReferenceFieldUpdater<U,W> newUpdater(java.lang.Class<U>, java.lang.Class<W>, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicReferenceFieldUpdater java.util.concurrent.atomic.AtomicReferenceFieldUpdater<U,W> newUpdater(java.lang.Class<U>, java.lang.Class<W>, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicReferenceFieldUpdater.AtomicReferenceFieldUpdaterImpl AtomicReferenceFieldUpdaterImpl(java.lang.Class<T>, java.lang.Class<V>, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicReferenceFieldUpdater.AtomicReferenceFieldUpdaterImpl AtomicReferenceFieldUpdaterImpl(java.lang.Class<T>, java.lang.Class<V>, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicStampedReference V get(int[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicStampedReference.ReferenceIntegerPair int access$100(java.util.concurrent.atomic.AtomicStampedReference.ReferenceIntegerPair) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.atomic.AtomicStampedReference.ReferenceIntegerPair java.lang.Object access$000(java.util.concurrent.atomic.AtomicStampedReference.ReferenceIntegerPair) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/concurrent/locks/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/concurrent/locks/annotations.xml
new file mode 100644
index 0000000..a5aef3c
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/concurrent/locks/annotations.xml
@@ -0,0 +1,134 @@
+<root>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer boolean acquireQueued(java.util.concurrent.locks.AbstractQueuedSynchronizer.Node, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer boolean hasWaiters(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer boolean isOnSyncQueue(java.util.concurrent.locks.AbstractQueuedSynchronizer.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer boolean isQueued(java.lang.Thread) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer boolean owns(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer boolean shouldParkAfterFailedAcquire(java.util.concurrent.locks.AbstractQueuedSynchronizer.Node, java.util.concurrent.locks.AbstractQueuedSynchronizer.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer boolean transferAfterCancelledWait(java.util.concurrent.locks.AbstractQueuedSynchronizer.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer int getWaitQueueLength(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer java.util.concurrent.locks.AbstractQueuedSynchronizer.Node addWaiter(java.util.concurrent.locks.AbstractQueuedSynchronizer.Node)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer java.util.concurrent.locks.AbstractQueuedSynchronizer.Node enq(java.util.concurrent.locks.AbstractQueuedSynchronizer.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer void setHead(java.util.concurrent.locks.AbstractQueuedSynchronizer.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer void setHeadAndPropagate(java.util.concurrent.locks.AbstractQueuedSynchronizer.Node, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer void unparkSuccessor(java.util.concurrent.locks.AbstractQueuedSynchronizer.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject boolean await(long, java.util.concurrent.TimeUnit) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject boolean awaitUntil(java.util.Date) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject java.util.concurrent.locks.AbstractQueuedSynchronizer.Node addConditionWaiter()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject void doSignal(java.util.concurrent.locks.AbstractQueuedSynchronizer.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject void doSignalAll(java.util.concurrent.locks.AbstractQueuedSynchronizer.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantLock boolean hasWaiters(java.util.concurrent.locks.Condition) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantLock boolean tryLock(long, java.util.concurrent.TimeUnit) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantLock int getWaitQueueLength(java.util.concurrent.locks.Condition) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantLock java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantLock java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.Condition) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantLock java.util.concurrent.locks.Condition newCondition()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantLock.Sync java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject newCondition()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantLock.Sync void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock boolean hasWaiters(java.util.concurrent.locks.Condition) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock int getWaitQueueLength(java.util.concurrent.locks.Condition) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.Condition) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock ReadLock(java.util.concurrent.locks.ReentrantReadWriteLock) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock boolean tryLock(long, java.util.concurrent.TimeUnit) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.Sync java.lang.IllegalMonitorStateException unmatchedUnlockException()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.Sync java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject newCondition()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.Sync void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.Sync.ThreadLocalHoldCounter java.lang.Object initialValue()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.Sync.ThreadLocalHoldCounter java.util.concurrent.locks.ReentrantReadWriteLock.Sync.HoldCounter initialValue()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock WriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock boolean tryLock(long, java.util.concurrent.TimeUnit) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock java.util.concurrent.locks.Condition newCondition()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/javax/swing/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/javax/swing/annotations.xml
new file mode 100644
index 0000000..c0738eb
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/javax/swing/annotations.xml
@@ -0,0 +1,527 @@
+<root>
+ <item name="javax.swing.AbstractButton java.beans.PropertyChangeListener createActionPropertyChangeListener(javax.swing.Action)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.AbstractButton java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.AbstractButton javax.swing.AbstractButton.Handler access$000(javax.swing.AbstractButton) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.AbstractButton void access$100(javax.swing.AbstractButton) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JButton java.lang.String getUIClassID()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JButton java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JButton void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent boolean isLightweightComponent(java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent boolean processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JComponent boolean processKeyBindings(java.awt.event.KeyEvent, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent boolean processKeyBindings(java.awt.event.KeyEvent, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->false""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JComponent byte getWriteObjCounter(javax.swing.JComponent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent java.awt.Dimension getSize(java.awt.Dimension)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->!null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JComponent java.awt.Graphics getComponentGraphics(java.awt.Graphics)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->!null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JComponent java.awt.Point getLocation(java.awt.Point)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->!null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JComponent java.awt.Point getPopupLocation(java.awt.event.MouseEvent)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->null;null->null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JComponent java.awt.Point getToolTipLocation(java.awt.event.MouseEvent)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->null;null->null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JComponent java.awt.Rectangle getBounds(java.awt.Rectangle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->!null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JComponent java.awt.Rectangle getVisibleRect()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent java.lang.String getUIClassID()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent javax.swing.JToolTip createToolTip()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent void computeVisibleRect(java.awt.Component, java.awt.Rectangle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent void computeVisibleRect(java.awt.Component, java.awt.Rectangle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent void computeVisibleRect(java.awt.Rectangle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent void paintImmediately(java.awt.Rectangle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent void paintWithOffscreenBuffer(javax.swing.JComponent, java.awt.Graphics, int, int, int, int, java.awt.Image) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent void paintWithOffscreenBuffer(javax.swing.JComponent, java.awt.Graphics, int, int, int, int, java.awt.Image) 6">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent void processKeyEvent(java.awt.event.KeyEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent void repaint(java.awt.Rectangle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent void setWriteObjCounter(javax.swing.JComponent, byte) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent.AccessibleJComponent java.lang.String getBorderTitle(javax.swing.border.Border)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JComponent.AccessibleJComponent javax.accessibility.AccessibleExtendedComponent getAccessibleExtendedComponent()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JComponent.AccessibleJComponent javax.swing.JComponent access$100(javax.swing.JComponent.AccessibleJComponent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JDialog java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JDialog javax.swing.JRootPane createRootPane()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JDialog void processWindowEvent(java.awt.event.WindowEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JFrame java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JFrame javax.swing.JRootPane createRootPane()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JFrame void processWindowEvent(java.awt.event.WindowEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JLabel java.lang.String getUIClassID()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JLabel java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JLabel void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JPanel java.lang.String getUIClassID()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JPanel java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JPanel void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JScrollPane java.awt.Component getCorner(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JScrollPane java.awt.Rectangle getViewportBorderBounds()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JScrollPane java.lang.String getUIClassID()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JScrollPane java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JScrollPane javax.swing.JScrollBar createHorizontalScrollBar()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JScrollPane javax.swing.JScrollBar createVerticalScrollBar()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JScrollPane javax.swing.JViewport createViewport()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JScrollPane void setCorner(java.lang.String, java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JScrollPane void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable boolean print(int, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,_,false,_->true""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JTable int columnAtPoint(java.awt.Point) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable int getScrollableBlockIncrement(java.awt.Rectangle, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable int rowAtPoint(java.awt.Point) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable int[] getSelectedRows()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable java.awt.Component prepareEditor(javax.swing.table.TableCellEditor, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable java.awt.Component prepareRenderer(javax.swing.table.TableCellRenderer, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable java.awt.Dimension getIntercellSpacing()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable java.awt.print.Printable getPrintable(int, java.text.MessageFormat, java.text.MessageFormat)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable java.lang.String getToolTipText(java.awt.event.MouseEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable java.lang.String getUIClassID()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable java.lang.String paramString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable javax.swing.JScrollPane createScrollPaneForTable(javax.swing.JTable)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable javax.swing.ListSelectionModel createDefaultSelectionModel()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable javax.swing.table.JTableHeader createDefaultTableHeader()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable javax.swing.table.TableCellEditor getDefaultEditor(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JTable javax.swing.table.TableCellRenderer getDefaultRenderer(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.JTable javax.swing.table.TableColumnModel createDefaultColumnModel()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable javax.swing.table.TableModel createDefaultDataModel()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void addColumn(javax.swing.table.TableColumn) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void adjustSizes(long, javax.swing.JTable.Resizable2, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void adjustSizes(long, javax.swing.JTable.Resizable3, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void changeSelectionModel(javax.swing.ListSelectionModel, int, boolean, boolean, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void columnSelectionChanged(javax.swing.event.ListSelectionEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void setColumnModel(javax.swing.table.TableColumnModel) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void setGridColor(java.awt.Color) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void setIntercellSpacing(java.awt.Dimension) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void setLazyValue(java.util.Hashtable, java.lang.Class, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void setModel(javax.swing.table.TableModel) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void setSelectionBackground(java.awt.Color) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void setSelectionForeground(java.awt.Color) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void setSelectionModel(javax.swing.ListSelectionModel) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void tableRowsDeleted(javax.swing.event.TableModelEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void tableRowsInserted(javax.swing.event.TableModelEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void valueChanged(javax.swing.event.ListSelectionEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.JTable void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities boolean isDescendingFrom(java.awt.Component, java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->true""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities boolean isLeftMouseButton(java.awt.event.MouseEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities boolean isLeftToRight(java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities boolean isMiddleMouseButton(java.awt.event.MouseEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities boolean isRectangleContainingRectangle(java.awt.Rectangle, java.awt.Rectangle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities boolean isRectangleContainingRectangle(java.awt.Rectangle, java.awt.Rectangle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities boolean isRightMouseButton(java.awt.event.MouseEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities boolean isValidKeyEventForKeyBindings(java.awt.event.KeyEvent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities boolean notifyAction(javax.swing.Action, javax.swing.KeyStroke, java.awt.event.KeyEvent, java.lang.Object, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,null,_,_->false;null,_,_,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities boolean processKeyBindings(java.awt.event.KeyEvent)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities int computeStringWidth(java.awt.FontMetrics, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities int getAccessibleChildrenCount(java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities int getAccessibleIndexInParent(java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Component getDeepestComponentAt(java.awt.Component, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Container getAncestorNamed(java.lang.String, java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Container getAncestorOfClass(java.lang.Class, java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Point convertPoint(java.awt.Component, int, int, java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->!null;_,_,_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Point convertPoint(java.awt.Component, java.awt.Point, java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null;_,!null,_->!null;_,_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Point convertScreenLocationToParent(java.awt.Container, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Point convertScreenLocationToParent(java.awt.Container, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Rectangle calculateInnerArea(javax.swing.JComponent, java.awt.Rectangle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Rectangle computeIntersection(int, int, int, int, java.awt.Rectangle) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Rectangle computeIntersection(int, int, int, int, java.awt.Rectangle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,_,_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Rectangle computeUnion(int, int, int, int, java.awt.Rectangle) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Rectangle computeUnion(int, int, int, int, java.awt.Rectangle)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,_,_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Rectangle convertRectangle(java.awt.Component, java.awt.Rectangle, java.awt.Component) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Rectangle convertRectangle(java.awt.Component, java.awt.Rectangle, java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Rectangle getLocalBounds(java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Rectangle getLocalBounds(java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Rectangle[] computeDifference(java.awt.Rectangle, java.awt.Rectangle)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Window getWindowAncestor(java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.Window windowForComponent(java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.event.MouseEvent convertMouseEvent(java.awt.Component, java.awt.event.MouseEvent, java.awt.Component) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.awt.event.MouseEvent convertMouseEvent(java.awt.Component, java.awt.event.MouseEvent, java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabel(java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int) 7">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabel(java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int) 8">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabel(java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int) 9">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabel(java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null,_,_,_,_,_,_,_,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabel(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int) 10">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabel(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int) 8">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabel(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int) 9">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabel(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,!null,_,_,_,_,_,_,_,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabelImpl(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int) 10">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabelImpl(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int) 8">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabelImpl(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int) 9">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities java.lang.String layoutCompoundLabelImpl(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,!null,_,_,_,_,_,_,_,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities javax.accessibility.Accessible getAccessibleAt(java.awt.Component, java.awt.Point)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities javax.accessibility.Accessible getAccessibleChild(java.awt.Component, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities javax.accessibility.AccessibleStateSet getAccessibleStateSet(java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities javax.swing.ActionMap getUIActionMap(javax.swing.JComponent) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities javax.swing.CellRendererPane getCellRendererPane(java.awt.Component, java.awt.Container) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities javax.swing.InputMap getUIInputMap(javax.swing.JComponent, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities javax.swing.JRootPane getRootPane(java.awt.Component)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="javax.swing.SwingUtilities void convertPointFromScreen(java.awt.Point, java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities void convertPointFromScreen(java.awt.Point, java.awt.Component) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities void convertPointToScreen(java.awt.Point, java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities void convertPointToScreen(java.awt.Point, java.awt.Component) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities void paintComponent(java.awt.Graphics, java.awt.Component, java.awt.Container, int, int, int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities void paintComponent(java.awt.Graphics, java.awt.Component, java.awt.Container, java.awt.Rectangle) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities void paintComponent(java.awt.Graphics, java.awt.Component, java.awt.Container, java.awt.Rectangle) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities void replaceUIActionMap(javax.swing.JComponent, javax.swing.ActionMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities void replaceUIInputMap(javax.swing.JComponent, int, javax.swing.InputMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="javax.swing.SwingUtilities void updateComponentTreeUI(java.awt.Component) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/collections/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/collections/annotations.xml
new file mode 100644
index 0000000..08e265e
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/collections/annotations.xml
@@ -0,0 +1,40 @@
+<root>
+ <item name="org.apache.commons.collections.ExtendedProperties ExtendedProperties(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.ExtendedProperties ExtendedProperties(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.ExtendedProperties boolean access$000(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.ExtendedProperties boolean endsWithSlash(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.ExtendedProperties java.lang.String escape(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.ExtendedProperties java.lang.String escape(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.ExtendedProperties java.lang.String interpolateHelper(java.lang.String, java.util.List)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.collections.ExtendedProperties java.lang.String testBoolean(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.ExtendedProperties java.lang.String unescape(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.ExtendedProperties java.lang.String unescape(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.ExtendedProperties org.apache.commons.collections.ExtendedProperties convertProperties(java.util.Properties) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.ExtendedProperties void combine(org.apache.commons.collections.ExtendedProperties) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/collections/map/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/collections/map/annotations.xml
new file mode 100644
index 0000000..26b98c6
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/collections/map/annotations.xml
@@ -0,0 +1,161 @@
+<root>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap AbstractHashedMap(java.util.Map) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap boolean isEqualKey(java.lang.Object, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap boolean isEqualValue(java.lang.Object, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap int entryHashCode(org.apache.commons.collections.map.AbstractHashedMap.HashEntry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap int hash(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap java.lang.Object convertKey(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap java.lang.Object entryKey(org.apache.commons.collections.map.AbstractHashedMap.HashEntry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap java.lang.Object entryValue(org.apache.commons.collections.map.AbstractHashedMap.HashEntry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap org.apache.commons.collections.map.AbstractHashedMap.HashEntry createEntry(org.apache.commons.collections.map.AbstractHashedMap.HashEntry, int, java.lang.Object, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap org.apache.commons.collections.map.AbstractHashedMap.HashEntry entryNext(org.apache.commons.collections.map.AbstractHashedMap.HashEntry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap void destroyEntry(org.apache.commons.collections.map.AbstractHashedMap.HashEntry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap void doReadObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap void doWriteObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap void putAll(java.util.Map) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap void removeEntry(org.apache.commons.collections.map.AbstractHashedMap.HashEntry, int, org.apache.commons.collections.map.AbstractHashedMap.HashEntry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap void reuseEntry(org.apache.commons.collections.map.AbstractHashedMap.HashEntry, int, int, java.lang.Object, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap void updateEntry(org.apache.commons.collections.map.AbstractHashedMap.HashEntry, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap.EntrySet boolean contains(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap.EntrySet boolean remove(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap.EntrySetIterator EntrySetIterator(org.apache.commons.collections.map.AbstractHashedMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap.HashEntry java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap.HashIterator HashIterator(org.apache.commons.collections.map.AbstractHashedMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap.HashIterator java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap.HashMapIterator HashMapIterator(org.apache.commons.collections.map.AbstractHashedMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap.KeySetIterator KeySetIterator(org.apache.commons.collections.map.AbstractHashedMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractHashedMap.ValuesIterator ValuesIterator(org.apache.commons.collections.map.AbstractHashedMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap AbstractLinkedMap(java.util.Map) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap org.apache.commons.collections.map.AbstractHashedMap.HashEntry createEntry(org.apache.commons.collections.map.AbstractHashedMap.HashEntry, int, java.lang.Object, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry entryAfter(org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry entryBefore(org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap void addEntry(org.apache.commons.collections.map.AbstractHashedMap.HashEntry, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap void removeEntry(org.apache.commons.collections.map.AbstractHashedMap.HashEntry, int, org.apache.commons.collections.map.AbstractHashedMap.HashEntry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap.EntrySetIterator EntrySetIterator(org.apache.commons.collections.map.AbstractLinkedMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap.KeySetIterator KeySetIterator(org.apache.commons.collections.map.AbstractLinkedMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap.LinkIterator LinkIterator(org.apache.commons.collections.map.AbstractLinkedMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap.LinkIterator java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap.LinkMapIterator LinkMapIterator(org.apache.commons.collections.map.AbstractLinkedMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.AbstractLinkedMap.ValuesIterator ValuesIterator(org.apache.commons.collections.map.AbstractLinkedMap) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.LRUMap LRUMap(java.util.Map) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.LRUMap LRUMap(java.util.Map, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.LRUMap boolean removeLRU(org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->true;null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.collections.map.LRUMap void doReadObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.LRUMap void doWriteObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.LRUMap void moveToMRU(org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.LRUMap void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.LRUMap void reuseMapping(org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry, int, int, java.lang.Object, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.LRUMap void updateEntry(org.apache.commons.collections.map.AbstractHashedMap.HashEntry, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.collections.map.LRUMap void writeObject(java.io.ObjectOutputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/annotations.xml
new file mode 100644
index 0000000..e36a5e2
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/annotations.xml
@@ -0,0 +1,1581 @@
+<root>
+ <item name="org.apache.commons.lang.ArrayUtils boolean isEmpty(boolean[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean isEmpty(byte[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean isEmpty(char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean isEmpty(double[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean isEmpty(float[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean isEmpty(int[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean isEmpty(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean isEmpty(long[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean isEmpty(short[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean isSameType(java.lang.Object, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean isSameType(java.lang.Object, java.lang.Object) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean[] clone(boolean[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean[] remove(boolean[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean[] subarray(boolean[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean[] toPrimitive(java.lang.Boolean[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils boolean[] toPrimitive(java.lang.Boolean[], boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils byte[] clone(byte[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils byte[] remove(byte[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils byte[] subarray(byte[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils byte[] toPrimitive(java.lang.Byte[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils byte[] toPrimitive(java.lang.Byte[], byte)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils char[] clone(char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils char[] remove(char[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils char[] subarray(char[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils char[] toPrimitive(java.lang.Character[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils char[] toPrimitive(java.lang.Character[], char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils double[] clone(double[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils double[] remove(double[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils double[] subarray(double[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils double[] toPrimitive(java.lang.Double[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils double[] toPrimitive(java.lang.Double[], double)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils float[] clone(float[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils float[] remove(float[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils float[] subarray(float[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils float[] toPrimitive(java.lang.Float[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils float[] toPrimitive(java.lang.Float[], float)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils int[] clone(int[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils int[] remove(int[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils int[] subarray(int[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils int[] toPrimitive(java.lang.Integer[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils int[] toPrimitive(java.lang.Integer[], int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Boolean[] toObject(boolean[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Byte[] toObject(byte[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Character[] toObject(char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Double[] toObject(double[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Float[] toObject(float[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Integer[] toObject(int[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Long[] toObject(long[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Object remove(java.lang.Object, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Object[] clone(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Object[] remove(java.lang.Object[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Object[] subarray(java.lang.Object[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.lang.Short[] toObject(short[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils java.util.Map toMap(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils long[] clone(long[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils long[] remove(long[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils long[] subarray(long[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils long[] toPrimitive(java.lang.Long[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils long[] toPrimitive(java.lang.Long[], long)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils short[] clone(short[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils short[] remove(short[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils short[] subarray(short[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils short[] toPrimitive(java.lang.Short[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ArrayUtils short[] toPrimitive(java.lang.Short[], short)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.BooleanUtils boolean isFalse(java.lang.Boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.BooleanUtils boolean isTrue(java.lang.Boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.BooleanUtils boolean toBoolean(java.lang.Boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.BooleanUtils boolean xor(boolean[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.BooleanUtils java.lang.Boolean negate(java.lang.Boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.BooleanUtils java.lang.Boolean toBooleanObject(java.lang.Integer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.BooleanUtils java.lang.Boolean xor(java.lang.Boolean[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.BooleanUtils java.lang.Integer toIntegerObject(java.lang.Boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharEncoding boolean isSupported(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharRange boolean contains(org.apache.commons.lang.CharRange) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.CharSet CharSet(java.lang.String[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.CharSet org.apache.commons.lang.CharSet getInstance(java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharSetUtils java.lang.String delete(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharSetUtils java.lang.String delete(java.lang.String, java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharSetUtils java.lang.String keep(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharSetUtils java.lang.String keep(java.lang.String, java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharSetUtils java.lang.String modify(java.lang.String, java.lang.String[], boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.CharSetUtils java.lang.String modify(java.lang.String, java.lang.String[], boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.CharSetUtils java.lang.String squeeze(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharSetUtils java.lang.String squeeze(java.lang.String, java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharSetUtils java.lang.String translate(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharSetUtils org.apache.commons.lang.CharSet evaluateSet(java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharUtils char toChar(java.lang.Character) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.CharUtils char toChar(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.CharUtils int toIntValue(java.lang.Character) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.CharUtils java.lang.Character toCharacterObject(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharUtils java.lang.String toString(java.lang.Character)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.CharUtils java.lang.String unicodeEscaped(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.CharUtils java.lang.String unicodeEscaped(java.lang.Character)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils boolean isAssignable(java.lang.Class, java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils boolean isInnerClass(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.Class primitiveToWrapper(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.Class[] primitivesToWrappers(java.lang.Class[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.Class[] toClass(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.Class[] wrappersToPrimitives(java.lang.Class[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.String getPackageCanonicalName(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.String getPackageCanonicalName(java.lang.Object, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.String getPackageCanonicalName(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.String getPackageName(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.String getPackageName(java.lang.Object, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.String getPackageName(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.String getShortCanonicalName(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.String getShortClassName(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.String getShortClassName(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.String toCanonicalName(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.reflect.Method getPublicMethod(java.lang.Class, java.lang.String, java.lang.Class[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.lang.reflect.Method getPublicMethod(java.lang.Class, java.lang.String, java.lang.Class[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.util.List convertClassNamesToClasses(java.util.List)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.util.List convertClassesToClassNames(java.util.List)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.util.List getAllInterfaces(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ClassUtils java.util.List getAllSuperclasses(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.Entities java.io.StringWriter createStringWriter(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Entities java.io.StringWriter createStringWriter(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Entities java.lang.String escape(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Entities java.lang.String unescape(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Entities void addEntities(java.lang.String[][]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Entities void doUnescape(java.io.Writer, java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Entities void doUnescape(java.io.Writer, java.lang.String, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Entities void escape(java.io.Writer, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Entities void fillWithHtml40Entities(org.apache.commons.lang.Entities) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Entities void unescape(java.io.Writer, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Entities void unescape(java.io.Writer, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.IllegalClassException java.lang.String safeGetClassName(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.IncompleteArgumentException java.lang.String safeArrayToString(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.IntHashMap boolean contains(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.LocaleUtils java.util.List localeLookupList(java.util.Locale)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.LocaleUtils java.util.List localeLookupList(java.util.Locale, java.util.Locale)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.LocaleUtils java.util.Locale toLocale(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.NumberRange NumberRange(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.NumberRange NumberRange(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.NumberRange NumberRange(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.NumberRange boolean includesNumber(java.lang.Number)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.NumberRange boolean includesRange(org.apache.commons.lang.NumberRange)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.NumberRange boolean overlaps(org.apache.commons.lang.NumberRange)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.NumberRange java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils boolean isAllZeros(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils boolean isDigits(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils boolean isNumber(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils java.lang.Double createDouble(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils java.lang.Float createFloat(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils java.lang.Integer createInteger(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils java.lang.Integer createInteger(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils java.lang.Long createLong(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils java.lang.Long createLong(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils java.lang.Number createNumber(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils java.math.BigDecimal createBigDecimal(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.NumberUtils java.math.BigInteger createBigInteger(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ObjectUtils java.lang.Object defaultIfNull(java.lang.Object, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ObjectUtils java.lang.String identityToString(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ObjectUtils java.lang.String toString(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ObjectUtils java.lang.StringBuffer appendIdentityToString(java.lang.StringBuffer, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.ObjectUtils void identityToString(java.lang.StringBuffer, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.ObjectUtils void identityToString(java.lang.StringBuffer, java.lang.Object) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.RandomStringUtils java.lang.String random(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.RandomStringUtils java.lang.String random(int, boolean, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.RandomStringUtils java.lang.String random(int, char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.RandomStringUtils java.lang.String random(int, int, int, boolean, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.RandomStringUtils java.lang.String random(int, int, int, boolean, boolean, char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.RandomStringUtils java.lang.String random(int, int, int, boolean, boolean, char[], java.util.Random)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.RandomStringUtils java.lang.String random(int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.RandomStringUtils java.lang.String randomAlphabetic(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.RandomStringUtils java.lang.String randomAlphanumeric(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.RandomStringUtils java.lang.String randomAscii(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.RandomStringUtils java.lang.String randomNumeric(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.SerializationUtils java.lang.Object deserialize(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.SerializationUtils java.lang.Object deserialize(java.io.InputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.SerializationUtils void serialize(java.io.Serializable, java.io.OutputStream) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils java.lang.String escapeHtml(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils java.lang.String escapeJavaStyleString(java.lang.String, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils java.lang.String escapeSql(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils java.lang.String escapeXml(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils java.lang.String unescapeCsv(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils java.lang.String unescapeHtml(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils java.lang.String unescapeJava(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils java.lang.String unescapeXml(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils void escapeHtml(java.io.Writer, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils void escapeJava(java.io.Writer, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils void escapeJavaScript(java.io.Writer, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils void escapeJavaStyleString(java.io.Writer, java.lang.String, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils void escapeXml(java.io.Writer, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils void unescapeHtml(java.io.Writer, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils void unescapeJava(java.io.Writer, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils void unescapeJavaScript(java.io.Writer, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringEscapeUtils void unescapeXml(java.io.Writer, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean contains(java.lang.String, char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean contains(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean containsAny(java.lang.String, char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean containsAny(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean containsIgnoreCase(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean containsNone(java.lang.String, char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean containsNone(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean containsOnly(java.lang.String, char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean containsOnly(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->false;null,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean isAlpha(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean isAlphaSpace(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean isAlphanumeric(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean isAlphanumericSpace(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean isAsciiPrintable(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean isBlank(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean isEmpty(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean isNumeric(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean isNumericSpace(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils boolean isWhitespace(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils int getLevenshteinDistance(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils int getLevenshteinDistance(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String abbreviate(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String abbreviate(java.lang.String, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String capitalise(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String capitaliseAllWords(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String capitalize(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String center(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String center(java.lang.String, int, char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String center(java.lang.String, int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String chomp(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String chomp(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String chompLast(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String chompLast(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String chompLast(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String chompLast(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String chop(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String chopNewline(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String chopNewline(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String clean(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String concatenate(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String defaultString(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String defaultString(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String deleteSpaces(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String deleteWhitespace(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String difference(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String getChomp(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String getChomp(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String getChomp(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String getCommonPrefix(java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String getNestedString(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String getNestedString(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,null->null;_,null,_->null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String getPrechomp(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String getPrechomp(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String getPrechomp(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String join(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String join(java.lang.Object[], char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String join(java.lang.Object[], char, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->!null;null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String join(java.lang.Object[], java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String join(java.lang.Object[], java.lang.String, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->!null;null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String join(java.util.Collection, char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String join(java.util.Collection, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String join(java.util.Iterator, char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String join(java.util.Iterator, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String left(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String leftPad(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String leftPad(java.lang.String, int, char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String leftPad(java.lang.String, int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String lowerCase(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String mid(java.lang.String, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String overlay(java.lang.String, java.lang.String, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->!null;null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String overlayString(java.lang.String, java.lang.String, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String overlayString(java.lang.String, java.lang.String, int, int) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String overlayString(java.lang.String, java.lang.String, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String padding(int, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String prechomp(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String prechomp(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String prechomp(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String remove(java.lang.String, char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String remove(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String removeEnd(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String removeEndIgnoreCase(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String removeStart(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String removeStartIgnoreCase(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String repeat(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String replace(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String replace(java.lang.String, java.lang.String, java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->!null;null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String replaceChars(java.lang.String, char, char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String replaceChars(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String replaceEach(java.lang.String, java.lang.String[], java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String replaceEach(java.lang.String, java.lang.String[], java.lang.String[], boolean, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String replaceEachRepeatedly(java.lang.String, java.lang.String[], java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String replaceOnce(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String reverse(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String reverseDelimited(java.lang.String, char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String reverseDelimitedString(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String right(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String rightPad(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String rightPad(java.lang.String, int, char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String rightPad(java.lang.String, int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String stripEnd(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String stripStart(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String stripToEmpty(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String stripToNull(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String substring(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String substring(java.lang.String, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String substringAfter(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String substringAfterLast(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String substringBefore(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String substringBeforeLast(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String substringBetween(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String substringBetween(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,null->null;_,null,_->null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String swapCase(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String trim(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String trimToEmpty(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String trimToNull(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String uncapitalise(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String uncapitalize(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String upperCase(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] split(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] split(java.lang.String, char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] split(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] split(java.lang.String, java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitByCharacterType(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitByCharacterType(java.lang.String, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitByCharacterTypeCamelCase(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitByWholeSeparator(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitByWholeSeparator(java.lang.String, java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitByWholeSeparatorPreserveAllTokens(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitByWholeSeparatorPreserveAllTokens(java.lang.String, java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitByWholeSeparatorWorker(java.lang.String, java.lang.String, int, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitPreserveAllTokens(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitPreserveAllTokens(java.lang.String, char)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitPreserveAllTokens(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitPreserveAllTokens(java.lang.String, java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitWorker(java.lang.String, char, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] splitWorker(java.lang.String, java.lang.String, int, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] stripAll(java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] stripAll(java.lang.String[], java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.StringUtils java.lang.String[] substringsBetween(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.SystemUtils boolean getJavaVersionMatches(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.SystemUtils boolean getOSMatches(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.SystemUtils java.io.File getJavaHome()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.SystemUtils java.io.File getJavaIoTmpDir()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.SystemUtils java.io.File getUserDir()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.SystemUtils java.io.File getUserHome()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void allElementsOfType(java.util.Collection, java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void allElementsOfType(java.util.Collection, java.lang.Class) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void allElementsOfType(java.util.Collection, java.lang.Class, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void allElementsOfType(java.util.Collection, java.lang.Class, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void noNullElements(java.lang.Object[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void noNullElements(java.lang.Object[], java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void noNullElements(java.util.Collection) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void noNullElements(java.util.Collection, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void notEmpty(java.lang.Object[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void notEmpty(java.lang.Object[], java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void notEmpty(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void notEmpty(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void notEmpty(java.util.Collection) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void notEmpty(java.util.Collection, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void notEmpty(java.util.Map) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void notEmpty(java.util.Map, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void notNull(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.Validate void notNull(java.lang.Object, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String abbreviate(java.lang.String, int, int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->!null;null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String capitalize(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String capitalize(java.lang.String, char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String capitalizeFully(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String capitalizeFully(java.lang.String, char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String initials(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String initials(java.lang.String, char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String swapCase(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String uncapitalize(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String uncapitalize(java.lang.String, char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String wrap(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.WordUtils java.lang.String wrap(java.lang.String, int, java.lang.String, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->!null;null,_,_,_->null""/>
+ </annotation>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/builder/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/builder/annotations.xml
new file mode 100644
index 0000000..c46c851e
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/builder/annotations.xml
@@ -0,0 +1,574 @@
+<root>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(boolean, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(boolean[], boolean[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(byte, byte)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(byte[], byte[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(char, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(char[], char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(double, double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(double[], double[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(float, float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(float[], float[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(int[], int[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(java.lang.Object, java.lang.Object, java.util.Comparator)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(java.lang.Object[], java.lang.Object[], java.util.Comparator)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_->!null;null,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(long, long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(long[], long[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(short, short)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder append(short[], short[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder org.apache.commons.lang.builder.CompareToBuilder appendSuper(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.CompareToBuilder void reflectionAppend(java.lang.Object, java.lang.Object, java.lang.Class, org.apache.commons.lang.builder.CompareToBuilder, boolean, java.lang.String[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(boolean, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(boolean[], boolean[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(byte, byte)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(byte[], byte[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(char, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(char[], char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(double[], double[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(float[], float[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(int[], int[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(java.lang.Object, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(java.lang.Object[], java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(long, long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(long[], long[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(short, short)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder append(short[], short[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->!null;null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder org.apache.commons.lang.builder.EqualsBuilder appendSuper(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.EqualsBuilder void reflectionAppend(java.lang.Object, java.lang.Object, java.lang.Class, org.apache.commons.lang.builder.EqualsBuilder, boolean, java.lang.String[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder int reflectionHashCode(int, int, java.lang.Object) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder int reflectionHashCode(int, int, java.lang.Object, boolean) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder int reflectionHashCode(int, int, java.lang.Object, boolean, java.lang.Class) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder int reflectionHashCode(int, int, java.lang.Object, boolean, java.lang.Class, java.lang.String[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder int reflectionHashCode(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder int reflectionHashCode(java.lang.Object, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder int reflectionHashCode(java.lang.Object, java.lang.String[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder int reflectionHashCode(java.lang.Object, java.util.Collection) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder java.lang.Integer toIdentityHashCodeInteger(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(boolean[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(byte)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(byte[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(double[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(float[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(int[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(long[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(short)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder append(short[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder org.apache.commons.lang.builder.HashCodeBuilder appendSuper(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.HashCodeBuilder.1 java.lang.Object initialValue()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ReflectionToStringBuilder boolean accept(java.lang.reflect.Field) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ReflectionToStringBuilder java.lang.Object getValue(java.lang.reflect.Field) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ReflectionToStringBuilder java.lang.String[] toNoNullStringArray(java.lang.Object[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ReflectionToStringBuilder org.apache.commons.lang.builder.ReflectionToStringBuilder setExcludeFieldNames(java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ReflectionToStringBuilder org.apache.commons.lang.builder.ToStringBuilder reflectionAppendArray(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ReflectionToStringBuilder void appendFieldsIn(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(boolean[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(byte)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(byte[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(double[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(float[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(int[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, boolean[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, boolean[], boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, byte)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, byte[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, byte[], boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, char[], boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, double)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, double[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, double[], boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, float)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, float[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, float[], boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, int[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, int[], boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, java.lang.Object, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, java.lang.Object[], boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, long[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, long[], boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, short)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, short[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(java.lang.String, short[], boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(long[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(short)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder append(short[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder appendAsObjectToString(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder appendSuper(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder org.apache.commons.lang.builder.ToStringBuilder appendToString(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringBuilder void setDefaultStyle(org.apache.commons.lang.builder.ToStringStyle) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle java.lang.String getShortClassName(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendContentEnd(java.lang.StringBuffer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendContentStart(java.lang.StringBuffer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, boolean[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, boolean[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, byte) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, byte[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, char) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, char[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, double) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, double[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, double[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, float) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, float[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, float[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, int[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, int[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, java.lang.Object[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, java.lang.Object[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, java.util.Collection) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, java.util.Map) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, long) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, long[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, long[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, short) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, short[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendDetail(java.lang.StringBuffer, java.lang.String, short[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendFieldSeparator(java.lang.StringBuffer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendNullText(java.lang.StringBuffer, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummary(java.lang.StringBuffer, java.lang.String, boolean[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummary(java.lang.StringBuffer, java.lang.String, byte[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummary(java.lang.StringBuffer, java.lang.String, char[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummary(java.lang.StringBuffer, java.lang.String, double[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummary(java.lang.StringBuffer, java.lang.String, float[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummary(java.lang.StringBuffer, java.lang.String, int[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummary(java.lang.StringBuffer, java.lang.String, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummary(java.lang.StringBuffer, java.lang.String, java.lang.Object) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummary(java.lang.StringBuffer, java.lang.String, java.lang.Object[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummary(java.lang.StringBuffer, java.lang.String, long[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummary(java.lang.StringBuffer, java.lang.String, short[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void appendSummarySize(java.lang.StringBuffer, java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void reflectionAppendArrayDetail(java.lang.StringBuffer, java.lang.String, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle void removeLastFieldSeparator(java.lang.StringBuffer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.builder.ToStringStyle.1 java.lang.Object initialValue()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/enum/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/enum/annotations.xml
new file mode 100644
index 0000000..be5d5ca
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/enum/annotations.xml
@@ -0,0 +1,50 @@
+<root>
+ <item name="org.apache.commons.lang.enum.Enum Enum(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.Enum java.lang.String getNameInOtherClassLoader(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.Enum java.util.Iterator iterator(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.Enum java.util.List getEnumList(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.Enum java.util.Map getEnumMap(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.Enum org.apache.commons.lang.enum.Enum getEnum(java.lang.Class, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.Enum org.apache.commons.lang.enum.Enum.Entry createEntry(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.Enum org.apache.commons.lang.enum.Enum.Entry getEntry(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.EnumUtils java.util.Iterator iterator(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.EnumUtils java.util.List getEnumList(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.EnumUtils java.util.Map getEnumMap(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.EnumUtils org.apache.commons.lang.enum.Enum getEnum(java.lang.Class, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.EnumUtils org.apache.commons.lang.enum.ValuedEnum getEnum(java.lang.Class, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.ValuedEnum ValuedEnum(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.ValuedEnum int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enum.ValuedEnum org.apache.commons.lang.enum.Enum getEnum(java.lang.Class, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/enums/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/enums/annotations.xml
new file mode 100644
index 0000000..0e7d219
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/enums/annotations.xml
@@ -0,0 +1,50 @@
+<root>
+ <item name="org.apache.commons.lang.enums.Enum Enum(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.Enum java.lang.String getNameInOtherClassLoader(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.Enum java.util.Iterator iterator(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.Enum java.util.List getEnumList(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.Enum java.util.Map getEnumMap(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.Enum org.apache.commons.lang.enums.Enum getEnum(java.lang.Class, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.Enum org.apache.commons.lang.enums.Enum.Entry createEntry(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.Enum org.apache.commons.lang.enums.Enum.Entry getEntry(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.EnumUtils java.util.Iterator iterator(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.EnumUtils java.util.List getEnumList(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.EnumUtils java.util.Map getEnumMap(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.EnumUtils org.apache.commons.lang.enums.Enum getEnum(java.lang.Class, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.EnumUtils org.apache.commons.lang.enums.ValuedEnum getEnum(java.lang.Class, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.ValuedEnum ValuedEnum(java.lang.String, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.ValuedEnum int getValueInOtherClassLoader(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.enums.ValuedEnum org.apache.commons.lang.enums.Enum getEnum(java.lang.Class, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/exception/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/exception/annotations.xml
new file mode 100644
index 0000000..2924cb9
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/exception/annotations.xml
@@ -0,0 +1,72 @@
+<root>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils boolean isNestedThrowable(java.lang.Throwable)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils boolean setCause(java.lang.Throwable, java.lang.Throwable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils java.lang.String getFullStackTrace(java.lang.Throwable)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils java.lang.String getMessage(java.lang.Throwable)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils java.lang.String getRootCauseMessage(java.lang.Throwable)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils java.lang.String getStackTrace(java.lang.Throwable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils java.lang.String getStackTrace(java.lang.Throwable)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils java.lang.String[] toArray(java.util.List) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils java.lang.Throwable getCause(java.lang.Throwable)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils java.lang.Throwable getCause(java.lang.Throwable, java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils java.lang.Throwable getCauseUsingWellKnownTypes(java.lang.Throwable)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils java.util.ArrayList getCauseMethodNameList()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils java.util.List getStackFrameList(java.lang.Throwable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils void removeCommonFrames(java.util.List, java.util.List) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.ExceptionUtils void removeCommonFrames(java.util.List, java.util.List) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.NestableDelegate NestableDelegate(org.apache.commons.lang.exception.Nestable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.NestableDelegate java.lang.String getMessage(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.exception.NestableDelegate java.lang.String[] getStackFrames(java.lang.Throwable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.NestableDelegate void printStackTrace(java.io.PrintStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.exception.NestableDelegate void trimStackFrames(java.util.List) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/math/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/math/annotations.xml
new file mode 100644
index 0000000..c799fc9
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/math/annotations.xml
@@ -0,0 +1,309 @@
+<root>
+ <item name="org.apache.commons.lang.math.DoubleRange DoubleRange(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.DoubleRange DoubleRange(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.DoubleRange DoubleRange(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.DoubleRange boolean containsNumber(java.lang.Number)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.DoubleRange boolean containsRange(org.apache.commons.lang.math.Range)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.DoubleRange boolean overlapsRange(org.apache.commons.lang.math.Range)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.FloatRange FloatRange(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.FloatRange FloatRange(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.FloatRange FloatRange(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.FloatRange boolean containsNumber(java.lang.Number)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.FloatRange boolean containsRange(org.apache.commons.lang.math.Range)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.FloatRange boolean overlapsRange(org.apache.commons.lang.math.Range)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction abs()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction add(org.apache.commons.lang.math.Fraction) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction add(org.apache.commons.lang.math.Fraction)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction addSub(org.apache.commons.lang.math.Fraction, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction addSub(org.apache.commons.lang.math.Fraction, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;_,false->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction divideBy(org.apache.commons.lang.math.Fraction) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction getFraction(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction getFraction(int, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction getFraction(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction invert()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction multiplyBy(org.apache.commons.lang.math.Fraction) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction negate()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction subtract(org.apache.commons.lang.math.Fraction) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Fraction org.apache.commons.lang.math.Fraction subtract(org.apache.commons.lang.math.Fraction)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.IEEE754rUtils double max(double[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.IEEE754rUtils double min(double[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.IEEE754rUtils float max(float[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.IEEE754rUtils float min(float[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.IntRange IntRange(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.IntRange IntRange(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.IntRange IntRange(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.IntRange boolean containsNumber(java.lang.Number)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.IntRange boolean containsRange(org.apache.commons.lang.math.Range)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.IntRange boolean overlapsRange(org.apache.commons.lang.math.Range)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.LongRange LongRange(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.LongRange LongRange(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.LongRange LongRange(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.LongRange boolean containsNumber(java.lang.Number)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.LongRange boolean containsRange(org.apache.commons.lang.math.Range)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.LongRange boolean overlapsRange(org.apache.commons.lang.math.Range)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberRange NumberRange(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberRange NumberRange(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberRange NumberRange(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberRange boolean containsNumber(java.lang.Number)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils boolean isAllZeros(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils boolean isDigits(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils boolean isNumber(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils byte max(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils byte min(byte[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils double max(double[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils double min(double[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils float max(float[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils float min(float[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils int max(int[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils int min(int[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils java.lang.Double createDouble(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils java.lang.Float createFloat(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils java.lang.Integer createInteger(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils java.lang.Long createLong(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils java.lang.Number createNumber(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils java.math.BigDecimal createBigDecimal(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils java.math.BigInteger createBigInteger(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils long max(long[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils long min(long[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils short max(short[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.NumberUtils short min(short[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.RandomUtils boolean nextBoolean(java.util.Random) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.RandomUtils double nextDouble(java.util.Random) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.RandomUtils float nextFloat(java.util.Random) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.RandomUtils int nextInt(java.util.Random) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.RandomUtils int nextInt(java.util.Random, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.RandomUtils long nextLong(java.util.Random) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.math.Range boolean containsDouble(java.lang.Number)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.Range boolean containsFloat(java.lang.Number)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.Range boolean containsInteger(java.lang.Number)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.Range boolean containsLong(java.lang.Number)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.Range boolean containsRange(org.apache.commons.lang.math.Range)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.Range boolean overlapsRange(org.apache.commons.lang.math.Range)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.math.Range java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/mutable/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/mutable/annotations.xml
new file mode 100644
index 0000000..dd2d7d0
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/mutable/annotations.xml
@@ -0,0 +1,192 @@
+<root>
+ <item name="org.apache.commons.lang.mutable.MutableBoolean MutableBoolean(java.lang.Boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableBoolean boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableBoolean int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableBoolean java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableBoolean void setValue(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableByte MutableByte(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableByte boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableByte int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableByte java.lang.Byte toByte()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableByte java.lang.Object getValue()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableByte java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableByte void add(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableByte void setValue(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableByte void subtract(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableDouble MutableDouble(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableDouble boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableDouble int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableDouble java.lang.Double toDouble()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableDouble java.lang.Object getValue()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableDouble void add(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableDouble void setValue(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableDouble void subtract(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableFloat MutableFloat(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableFloat boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableFloat int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableFloat java.lang.Float toFloat()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableFloat java.lang.Object getValue()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableFloat void add(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableFloat void setValue(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableFloat void subtract(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableInt MutableInt(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableInt boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableInt int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableInt java.lang.Integer toInteger()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableInt java.lang.Object getValue()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableInt java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableInt void add(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableInt void setValue(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableInt void subtract(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableLong MutableLong(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableLong boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableLong int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableLong java.lang.Long toLong()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableLong java.lang.Object getValue()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableLong java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableLong void add(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableLong void setValue(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableLong void subtract(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableObject boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableShort MutableShort(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableShort boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableShort int compareTo(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableShort java.lang.Object getValue()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableShort java.lang.Short toShort()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableShort java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableShort void add(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableShort void setValue(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.mutable.MutableShort void subtract(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/text/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/text/annotations.xml
new file mode 100644
index 0000000..d6d4e6e
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/text/annotations.xml
@@ -0,0 +1,422 @@
+<root>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat boolean containsElements(java.util.Collection)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat int readArgumentIndex(java.lang.String, java.text.ParsePosition) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat int readArgumentIndex(java.lang.String, java.text.ParsePosition) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat java.lang.String insertFormats(java.lang.String, java.util.ArrayList)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat java.lang.String parseFormatDescription(java.lang.String, java.text.ParsePosition) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat java.lang.String parseFormatDescription(java.lang.String, java.text.ParsePosition) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat java.lang.String parseFormatDescription(java.lang.String, java.text.ParsePosition)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat java.lang.StringBuffer appendQuotedString(java.lang.String, java.text.ParsePosition, java.lang.StringBuffer, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat java.lang.StringBuffer appendQuotedString(java.lang.String, java.text.ParsePosition, java.lang.StringBuffer, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat java.lang.StringBuffer appendQuotedString(java.lang.String, java.text.ParsePosition, java.lang.StringBuffer, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,!null,_->!null;_,_,null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat java.text.Format getFormat(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat java.text.ParsePosition next(java.text.ParsePosition) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat java.text.ParsePosition next(java.text.ParsePosition)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat void getQuotedString(java.lang.String, java.text.ParsePosition, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat void getQuotedString(java.lang.String, java.text.ParsePosition, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat void seekNonWs(java.lang.String, java.text.ParsePosition) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.ExtendedMessageFormat void seekNonWs(java.lang.String, java.text.ParsePosition) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder boolean endsWith(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder boolean equals(org.apache.commons.lang.text.StrBuilder)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder boolean equalsIgnoreCase(org.apache.commons.lang.text.StrBuilder)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder boolean startsWith(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder char[] getChars(char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder java.io.Reader asReader()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder java.io.Writer asWriter()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder java.lang.String leftString(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder java.lang.String midString(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder java.lang.String rightString(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder java.lang.String substring(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder java.lang.StringBuffer toStringBuffer()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder append(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder append(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder append(char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder append(char[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder append(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder append(java.lang.String, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder append(java.lang.StringBuffer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder append(java.lang.StringBuffer, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder append(org.apache.commons.lang.text.StrBuilder)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder append(org.apache.commons.lang.text.StrBuilder, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder appendAll(java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder appendAll(java.util.Collection)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder appendAll(java.util.Iterator)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder appendSeparator(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder appendSeparator(char, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder appendSeparator(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder appendSeparator(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder appendWithSeparators(java.lang.Object[], java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder appendWithSeparators(java.util.Collection, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder appendWithSeparators(java.util.Iterator, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder clear()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder delete(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder deleteCharAt(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder deleteFirst(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder ensureCapacity(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder insert(int, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder insert(int, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder insert(int, char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder insert(int, char[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder insert(int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder minimizeCapacity()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder replace(int, int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder replace(org.apache.commons.lang.text.StrMatcher, java.lang.String, int, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder replaceFirst(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder replaceImpl(org.apache.commons.lang.text.StrMatcher, java.lang.String, int, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder setCharAt(int, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder setNewLineText(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrBuilder setNullText(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder org.apache.commons.lang.text.StrTokenizer asTokenizer()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrBuilder.StrBuilderReader int read(char[], int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrLookup org.apache.commons.lang.text.StrLookup mapLookup(java.util.Map)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrMatcher int isMatch(char[], int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrMatcher org.apache.commons.lang.text.StrMatcher charMatcher(char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrMatcher.CharMatcher int isMatch(char[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrMatcher.CharSetMatcher CharSetMatcher(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrMatcher.CharSetMatcher int isMatch(char[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrMatcher.StringMatcher StringMatcher(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrMatcher.TrimMatcher int isMatch(char[], int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor boolean replaceIn(java.lang.StringBuffer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor boolean replaceIn(java.lang.StringBuffer, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor boolean replaceIn(org.apache.commons.lang.text.StrBuilder)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor boolean replaceIn(org.apache.commons.lang.text.StrBuilder, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor boolean substitute(org.apache.commons.lang.text.StrBuilder, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor int substitute(org.apache.commons.lang.text.StrBuilder, int, int, java.util.List) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor java.lang.String replace(char[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor java.lang.String replace(char[], int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor java.lang.String replace(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor java.lang.String replace(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor java.lang.String replace(java.lang.String, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor java.lang.String replace(java.lang.StringBuffer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor java.lang.String replace(java.lang.StringBuffer, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor java.lang.String replace(org.apache.commons.lang.text.StrBuilder)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor java.lang.String replace(org.apache.commons.lang.text.StrBuilder, int, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor org.apache.commons.lang.text.StrSubstitutor setVariablePrefix(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor org.apache.commons.lang.text.StrSubstitutor setVariablePrefixMatcher(org.apache.commons.lang.text.StrMatcher) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor org.apache.commons.lang.text.StrSubstitutor setVariablePrefixMatcher(org.apache.commons.lang.text.StrMatcher)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor org.apache.commons.lang.text.StrSubstitutor setVariableSuffix(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor org.apache.commons.lang.text.StrSubstitutor setVariableSuffixMatcher(org.apache.commons.lang.text.StrMatcher) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor org.apache.commons.lang.text.StrSubstitutor setVariableSuffixMatcher(org.apache.commons.lang.text.StrMatcher)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrSubstitutor void checkCyclicSubstitution(java.lang.String, java.util.List) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrTokenizer int readWithQuotes(char[], int, int, org.apache.commons.lang.text.StrBuilder, java.util.List, int, int) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrTokenizer java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrTokenizer org.apache.commons.lang.text.StrTokenizer reset()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrTokenizer org.apache.commons.lang.text.StrTokenizer reset(char[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrTokenizer org.apache.commons.lang.text.StrTokenizer reset(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrTokenizer org.apache.commons.lang.text.StrTokenizer setDelimiterMatcher(org.apache.commons.lang.text.StrMatcher)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrTokenizer org.apache.commons.lang.text.StrTokenizer setEmptyTokenAsNull(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrTokenizer org.apache.commons.lang.text.StrTokenizer setIgnoreEmptyTokens(boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrTokenizer org.apache.commons.lang.text.StrTokenizer setIgnoredMatcher(org.apache.commons.lang.text.StrMatcher)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrTokenizer org.apache.commons.lang.text.StrTokenizer setQuoteMatcher(org.apache.commons.lang.text.StrMatcher)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.text.StrTokenizer org.apache.commons.lang.text.StrTokenizer setTrimmerMatcher(org.apache.commons.lang.text.StrMatcher)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/time/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/time/annotations.xml
new file mode 100644
index 0000000..b392cff
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/commons/lang/time/annotations.xml
@@ -0,0 +1,481 @@
+<root>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(java.util.Calendar, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(java.util.Calendar, java.lang.String, java.util.Locale) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(java.util.Calendar, java.lang.String, java.util.TimeZone) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(java.util.Calendar, java.lang.String, java.util.TimeZone, java.util.Locale) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(java.util.Date, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(java.util.Date, java.lang.String, java.util.Locale) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(java.util.Date, java.lang.String, java.util.TimeZone) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(java.util.Date, java.lang.String, java.util.TimeZone, java.util.Locale) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(long, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(long, java.lang.String, java.util.Locale) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(long, java.lang.String, java.util.TimeZone) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String format(long, java.lang.String, java.util.TimeZone, java.util.Locale) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String formatUTC(java.util.Date, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String formatUTC(java.util.Date, java.lang.String, java.util.Locale) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String formatUTC(long, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateFormatUtils java.lang.String formatUTC(long, java.lang.String, java.util.Locale) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils boolean isSameDay(java.util.Calendar, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils boolean isSameDay(java.util.Calendar, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils boolean isSameDay(java.util.Date, java.util.Date) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils boolean isSameDay(java.util.Date, java.util.Date) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils boolean isSameInstant(java.util.Calendar, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils boolean isSameInstant(java.util.Calendar, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils boolean isSameInstant(java.util.Date, java.util.Date) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils boolean isSameInstant(java.util.Date, java.util.Date) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils boolean isSameLocalTime(java.util.Calendar, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils boolean isSameLocalTime(java.util.Calendar, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Calendar round(java.util.Calendar, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Calendar truncate(java.util.Calendar, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date add(java.util.Date, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date add(java.util.Date, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addDays(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addDays(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addHours(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addHours(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addMilliseconds(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addMilliseconds(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addMinutes(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addMinutes(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addMonths(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addMonths(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addSeconds(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addSeconds(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addWeeks(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addWeeks(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addYears(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date addYears(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date parseDate(java.lang.String, java.lang.String[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date parseDate(java.lang.String, java.lang.String[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date round(java.lang.Object, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date round(java.lang.Object, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date round(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date round(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date set(java.util.Date, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date set(java.util.Date, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setDays(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setDays(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setHours(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setHours(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setMilliseconds(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setMilliseconds(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setMinutes(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setMinutes(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setMonths(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setMonths(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setSeconds(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setSeconds(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setYears(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date setYears(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date truncate(java.lang.Object, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date truncate(java.lang.Object, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date truncate(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Date truncate(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Iterator iterator(java.lang.Object, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Iterator iterator(java.lang.Object, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Iterator iterator(java.util.Calendar, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Iterator iterator(java.util.Calendar, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Iterator iterator(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils java.util.Iterator iterator(java.util.Date, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragment(java.util.Calendar, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragment(java.util.Date, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragmentInDays(java.util.Calendar, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragmentInDays(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragmentInHours(java.util.Calendar, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragmentInHours(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragmentInMilliseconds(java.util.Calendar, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragmentInMilliseconds(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragmentInMinutes(java.util.Calendar, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragmentInMinutes(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragmentInSeconds(java.util.Calendar, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils long getFragmentInSeconds(java.util.Date, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DateUtils void modify(java.util.Calendar, int, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String format(org.apache.commons.lang.time.DurationFormatUtils.Token[], int, int, int, int, int, int, int, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String format(org.apache.commons.lang.time.DurationFormatUtils.Token[], int, int, int, int, int, int, int, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String formatDuration(long, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String formatDuration(long, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String formatDuration(long, java.lang.String, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String formatDuration(long, java.lang.String, boolean)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String formatDurationHMS(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String formatDurationISO(long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String formatPeriod(long, long, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String formatPeriod(long, long, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String formatPeriod(long, long, java.lang.String, boolean, java.util.TimeZone) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String formatPeriod(long, long, java.lang.String, boolean, java.util.TimeZone)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils java.lang.String formatPeriodISO(long, long)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils org.apache.commons.lang.time.DurationFormatUtils.Token[] lexx(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils.Token boolean containsTokenWithValue(org.apache.commons.lang.time.DurationFormatUtils.Token[], java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.DurationFormatUtils.Token boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat FastDateFormat(java.lang.String, java.util.TimeZone, java.util.Locale) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.Object parseObject(java.lang.String, java.text.ParsePosition) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.Object parseObject(java.lang.String, java.text.ParsePosition)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->null;_,!null->null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.String format(java.util.Calendar)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.String format(java.util.Date) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.String format(java.util.Date)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.String parseToken(java.lang.String, int[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.String parseToken(java.lang.String, int[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.String parseToken(java.lang.String, int[])">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.StringBuffer applyRules(java.util.Calendar, java.lang.StringBuffer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat java.lang.StringBuffer format(java.util.Date, java.lang.StringBuffer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat org.apache.commons.lang.time.FastDateFormat getInstance(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat org.apache.commons.lang.time.FastDateFormat getInstance(java.lang.String, java.util.Locale) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat org.apache.commons.lang.time.FastDateFormat getInstance(java.lang.String, java.util.TimeZone) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat org.apache.commons.lang.time.FastDateFormat getInstance(java.lang.String, java.util.TimeZone, java.util.Locale) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat org.apache.commons.lang.time.FastDateFormat.NumberRule selectNumberRule(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat void readObject(java.io.ObjectInputStream) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.CharacterLiteral void appendTo(java.lang.StringBuffer, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.PaddedNumberField void appendTo(java.lang.StringBuffer, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.PaddedNumberField void appendTo(java.lang.StringBuffer, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.PaddedNumberField void appendTo(java.lang.StringBuffer, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.Pair java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.StringLiteral void appendTo(java.lang.StringBuffer, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TextField void appendTo(java.lang.StringBuffer, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TextField void appendTo(java.lang.StringBuffer, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TimeZoneNameRule void appendTo(java.lang.StringBuffer, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TimeZoneNumberRule void appendTo(java.lang.StringBuffer, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TimeZoneNumberRule void appendTo(java.lang.StringBuffer, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TwelveHourField void appendTo(java.lang.StringBuffer, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TwentyFourHourField void appendTo(java.lang.StringBuffer, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TwoDigitMonthField void appendTo(java.lang.StringBuffer, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TwoDigitMonthField void appendTo(java.lang.StringBuffer, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TwoDigitMonthField void appendTo(java.lang.StringBuffer, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TwoDigitNumberField void appendTo(java.lang.StringBuffer, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TwoDigitNumberField void appendTo(java.lang.StringBuffer, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TwoDigitNumberField void appendTo(java.lang.StringBuffer, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TwoDigitYearField void appendTo(java.lang.StringBuffer, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TwoDigitYearField void appendTo(java.lang.StringBuffer, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.TwoDigitYearField void appendTo(java.lang.StringBuffer, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.UnpaddedMonthField void appendTo(java.lang.StringBuffer, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.UnpaddedMonthField void appendTo(java.lang.StringBuffer, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.UnpaddedMonthField void appendTo(java.lang.StringBuffer, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.UnpaddedNumberField void appendTo(java.lang.StringBuffer, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.UnpaddedNumberField void appendTo(java.lang.StringBuffer, java.util.Calendar) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.FastDateFormat.UnpaddedNumberField void appendTo(java.lang.StringBuffer, java.util.Calendar) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.StopWatch java.lang.String toSplitString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.commons.lang.time.StopWatch java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/anakia/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/anakia/annotations.xml
new file mode 100644
index 0000000..a2e1c91
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/anakia/annotations.xml
@@ -0,0 +1,108 @@
+<root>
+ <item name="org.apache.velocity.anakia.AnakiaElement java.util.List getAttributes()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaElement java.util.List getChildren()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaElement java.util.List getChildren(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaElement java.util.List getChildren(java.lang.String, org.jdom.Namespace)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaElement java.util.List getContent()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaElement org.apache.velocity.anakia.NodeList selectNodes(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaJDOMFactory org.jdom.Element element(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaJDOMFactory org.jdom.Element element(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaJDOMFactory org.jdom.Element element(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaJDOMFactory org.jdom.Element element(java.lang.String, org.jdom.Namespace)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaTask java.lang.String getRelativePath(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaTask org.apache.velocity.anakia.AnakiaTask.Context createContext()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaTask void ensureDirectoryFor(java.io.File) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaTask void setLastModifiedCheck(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaTask void setTemplatePath(java.io.File) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.AnakiaTask.Context void setName(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.Escape java.lang.String getText(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.Escape java.lang.String getText(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.NodeList NodeList(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.NodeList NodeList(java.util.List) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.NodeList NodeList(java.util.List, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.NodeList NodeList(org.jdom.Document) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.NodeList NodeList(org.jdom.Element) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.NodeList boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.anakia.NodeList java.util.List subList(int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.NodeList org.apache.velocity.anakia.NodeList selectNodes(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.NodeList.AttributeXMLOutputter void output(org.jdom.Attribute, java.io.Writer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.NodeList.AttributeXMLOutputter void output(org.jdom.Attribute, java.io.Writer) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.TreeWalker org.apache.velocity.anakia.NodeList allElements(org.jdom.Element) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.TreeWalker org.apache.velocity.anakia.NodeList allElements(org.jdom.Element)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.TreeWalker void treeWalk(org.jdom.Element, java.util.Collection) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.XPathTool org.apache.velocity.anakia.NodeList applyTo(java.lang.String, java.util.List)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.XPathTool org.apache.velocity.anakia.NodeList applyTo(java.lang.String, org.jdom.Document)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.anakia.XPathTool org.apache.velocity.anakia.NodeList applyTo(java.lang.String, org.jdom.Element)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/annotations.xml
new file mode 100644
index 0000000..fac9186
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/annotations.xml
@@ -0,0 +1,29 @@
+<root>
+ <item name="org.apache.velocity.app.FieldMethodizer void addObject(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.FieldMethodizer void inspect(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.Velocity boolean evaluate(org.apache.velocity.context.Context, java.io.Writer, java.lang.String, java.io.InputStream) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.Velocity boolean mergeTemplate(java.lang.String, java.lang.String, org.apache.velocity.context.Context, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->true;_,!null,_,_->true;_,_,!null,_->true;_,_,_,!null->true;_,_,_,null->true;_,_,null,_->true;_,null,_,_->true;null,_,_,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.Velocity boolean mergeTemplate(java.lang.String, org.apache.velocity.context.Context, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->true;_,!null,_->true;_,_,!null->true;_,_,null->true;_,null,_->true;null,_,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.VelocityEngine boolean evaluate(org.apache.velocity.context.Context, java.io.Writer, java.lang.String, java.io.InputStream) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.VelocityEngine boolean mergeTemplate(java.lang.String, java.lang.String, org.apache.velocity.context.Context, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->true;_,!null,_,_->true;_,_,!null,_->true;_,_,_,!null->true;_,_,_,null->true;_,_,null,_->true;_,null,_,_->true;null,_,_,_->true""/>
+ </annotation>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/event/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/event/annotations.xml
new file mode 100644
index 0000000..ad9def7f
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/event/annotations.xml
@@ -0,0 +1,89 @@
+<root>
+ <item name="org.apache.velocity.app.event.EventCartridge boolean addEventHandler(org.apache.velocity.app.event.EventHandler)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.event.EventCartridge boolean attachToContext(org.apache.velocity.context.Context)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.event.EventCartridge boolean removeEventHandler(org.apache.velocity.app.event.EventHandler)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil boolean shouldLogOnNullSet(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil boolean shouldLogOnNullSet(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.Object invalidGetMethod(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.Object, java.lang.String, org.apache.velocity.util.introspection.Info) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.Object invalidGetMethod(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.Object, java.lang.String, org.apache.velocity.util.introspection.Info) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.Object invalidMethod(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.Object, java.lang.String, org.apache.velocity.util.introspection.Info) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.Object invalidMethod(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.Object, java.lang.String, org.apache.velocity.util.introspection.Info) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.Object invalidReferenceHandlerCall(org.apache.velocity.app.event.EventHandlerMethodExecutor, org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.Object invalidReferenceHandlerCall(org.apache.velocity.app.event.EventHandlerMethodExecutor, org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.Object invalidReferenceHandlerCall(org.apache.velocity.app.event.EventHandlerMethodExecutor, org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.Object methodException(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.Class, java.lang.String, java.lang.Exception) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.Object methodException(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.Class, java.lang.String, java.lang.Exception) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.Object referenceInsert(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.Object referenceInsert(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.Object) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.String includeEvent(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil java.lang.String includeEvent(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil void invalidSetMethod(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.String, org.apache.velocity.util.introspection.Info) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.EventHandlerUtil void invalidSetMethod(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.String, org.apache.velocity.util.introspection.Info) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.IncludeEventHandler.IncludeEventExecutor void execute(org.apache.velocity.app.event.EventHandler) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.InvalidReferenceEventHandler.InvalidGetMethodExecutor void execute(org.apache.velocity.app.event.EventHandler) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.InvalidReferenceEventHandler.InvalidMethodExecutor void execute(org.apache.velocity.app.event.EventHandler) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.InvalidReferenceEventHandler.InvalidSetMethodExecutor void execute(org.apache.velocity.app.event.EventHandler) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.MethodExceptionEventHandler.MethodExceptionExecutor void execute(org.apache.velocity.app.event.EventHandler) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.NullSetEventHandler.ShouldLogOnNullSetExecutor void execute(org.apache.velocity.app.event.EventHandler) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.ReferenceInsertionEventHandler.referenceInsertExecutor void execute(org.apache.velocity.app.event.EventHandler) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/event/implement/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/event/implement/annotations.xml
new file mode 100644
index 0000000..5591ed6
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/event/implement/annotations.xml
@@ -0,0 +1,90 @@
+<root>
+ <item name="org.apache.velocity.app.event.implement.EscapeHtmlReference java.lang.String escape(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.EscapeHtmlReference java.lang.String getMatchAttribute()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.EscapeJavaScriptReference java.lang.String escape(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.EscapeJavaScriptReference java.lang.String getMatchAttribute()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.EscapeReference java.lang.Object referenceInsert(java.lang.String, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.EscapeReference void setRuntimeServices(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.EscapeSqlReference java.lang.String escape(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.EscapeSqlReference java.lang.String getMatchAttribute()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.EscapeXmlReference java.lang.String escape(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.EscapeXmlReference java.lang.String getMatchAttribute()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.IncludeNotFound void setRuntimeServices(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.IncludeRelativePath java.lang.String includeEvent(java.lang.String, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.IncludeRelativePath java.lang.String includeEvent(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.InvalidReferenceInfo InvalidReferenceInfo(java.lang.String, org.apache.velocity.util.introspection.Info) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.InvalidReferenceInfo java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.PrintExceptions java.lang.Object methodException(java.lang.Class, java.lang.String, java.lang.Exception) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.PrintExceptions java.lang.Object methodException(java.lang.Class, java.lang.String, java.lang.Exception)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.PrintExceptions java.lang.String getStackTrace(java.lang.Throwable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.ReportInvalidReferences boolean invalidSetMethod(org.apache.velocity.context.Context, java.lang.String, java.lang.String, org.apache.velocity.util.introspection.Info) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.ReportInvalidReferences boolean invalidSetMethod(org.apache.velocity.context.Context, java.lang.String, java.lang.String, org.apache.velocity.util.introspection.Info)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->false;_,!null,_,_->false;_,_,!null,_->false;_,_,_,!null->false;_,_,_,null->false;_,_,null,_->false;_,null,_,_->false;null,_,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.ReportInvalidReferences java.lang.Object invalidGetMethod(org.apache.velocity.context.Context, java.lang.String, java.lang.Object, java.lang.String, org.apache.velocity.util.introspection.Info) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.ReportInvalidReferences java.lang.Object invalidGetMethod(org.apache.velocity.context.Context, java.lang.String, java.lang.Object, java.lang.String, org.apache.velocity.util.introspection.Info)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_,_->null;_,!null,_,_,_->null;_,_,!null,_,_->null;_,_,_,!null,_->null;_,_,_,_,!null->null;_,_,_,_,null->null;_,_,_,null,_->null;_,_,null,_,_->null;_,null,_,_,_->null;null,_,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.ReportInvalidReferences java.lang.Object invalidMethod(org.apache.velocity.context.Context, java.lang.String, java.lang.Object, java.lang.String, org.apache.velocity.util.introspection.Info) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.ReportInvalidReferences java.lang.Object invalidMethod(org.apache.velocity.context.Context, java.lang.String, java.lang.Object, java.lang.String, org.apache.velocity.util.introspection.Info)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_,_->null;_,!null,_,_,_->null;_,_,!null,_,_->null;_,_,_,!null,_->null;_,_,_,_,!null->null;_,_,_,_,null->null;_,_,_,null,_->null;_,_,null,_,_->null;_,null,_,_,_->null;null,_,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.ReportInvalidReferences void reportInvalidReference(java.lang.String, org.apache.velocity.util.introspection.Info) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.event.implement.ReportInvalidReferences void setRuntimeServices(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/tools/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/tools/annotations.xml
new file mode 100644
index 0000000..855a668
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/app/tools/annotations.xml
@@ -0,0 +1,39 @@
+<root>
+ <item name="org.apache.velocity.app.tools.VelocityFormatter java.lang.Object isNull(java.lang.Object, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.tools.VelocityFormatter java.lang.String formatArray(java.lang.Object, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.tools.VelocityFormatter java.lang.String formatVector(java.util.List, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.tools.VelocityFormatter java.lang.String formatVector(java.util.List, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.tools.VelocityFormatter java.lang.String limitLen(int, java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.tools.VelocityFormatter java.lang.String limitLen(int, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.app.tools.VelocityFormatter java.lang.String makeAlternator(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.tools.VelocityFormatter java.lang.String makeAlternator(java.lang.String, java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.tools.VelocityFormatter java.lang.String makeAlternator(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.tools.VelocityFormatter java.lang.String makeAutoAlternator(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.app.tools.VelocityFormatter.VelocityAlternator java.lang.String alternate()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/context/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/context/annotations.xml
new file mode 100644
index 0000000..2e739fb
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/context/annotations.xml
@@ -0,0 +1,37 @@
+<root>
+ <item name="org.apache.velocity.context.AbstractContext boolean containsKey(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.context.AbstractContext java.lang.Object get(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.context.AbstractContext java.lang.Object put(java.lang.String, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.context.AbstractContext java.lang.Object remove(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.context.EvaluateContext EvaluateContext(org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.RuntimeServices) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.context.EvaluateContext void initContext(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.context.InternalContextAdapterImpl org.apache.velocity.context.InternalContextAdapter getBaseContext()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.context.ProxyVMContext boolean isConstant(org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.context.ProxyVMContext void addVMProxyArg(org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.String, org.apache.velocity.runtime.parser.node.Node) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/convert/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/convert/annotations.xml
new file mode 100644
index 0000000..8303b86
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/convert/annotations.xml
@@ -0,0 +1,33 @@
+<root>
+ <item name="org.apache.velocity.convert.WebMacro boolean writeTemplate(java.lang.String, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.convert.WebMacro boolean writeTemplate(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.convert.WebMacro java.lang.String convertName(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.convert.WebMacro java.lang.String convertName(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.convert.WebMacro java.lang.String extractPath(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.convert.WebMacro java.lang.String extractPath(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.convert.WebMacro java.lang.String makeSubstRE(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.convert.WebMacro void convert(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.convert.WebMacro void main(java.lang.String[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/exception/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/exception/annotations.xml
new file mode 100644
index 0000000..d7d2ee1
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/exception/annotations.xml
@@ -0,0 +1,17 @@
+<root>
+ <item name="org.apache.velocity.exception.MethodInvocationException java.lang.String getMessage()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.exception.ParseErrorException ParseErrorException(java.lang.String, org.apache.velocity.util.introspection.Info) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.exception.ParseErrorException ParseErrorException(java.lang.String, org.apache.velocity.util.introspection.Info, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.exception.ParseErrorException ParseErrorException(org.apache.velocity.exception.VelocityException, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.exception.ParseErrorException ParseErrorException(org.apache.velocity.runtime.parser.ParseException, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/io/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/io/annotations.xml
new file mode 100644
index 0000000..75ca573
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/io/annotations.xml
@@ -0,0 +1,8 @@
+<root>
+ <item name="org.apache.velocity.io.UnicodeInputStream org.apache.velocity.io.UnicodeInputStream.UnicodeBOM match(org.apache.velocity.io.UnicodeInputStream.UnicodeBOM, org.apache.velocity.io.UnicodeInputStream.UnicodeBOM) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.io.VelocityWriter void write(char[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/annotations.xml
new file mode 100644
index 0000000..457ea7d
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/annotations.xml
@@ -0,0 +1,98 @@
+<root>
+ <item name="org.apache.velocity.runtime.ParserPoolImpl void initialize(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.ParserPoolImpl void put(org.apache.velocity.runtime.parser.Parser) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance boolean addVelocimacro(java.lang.String, java.lang.String, java.lang.String[], java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance boolean addVelocimacro(java.lang.String, org.apache.velocity.runtime.parser.node.Node, java.lang.String[], java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance boolean evaluate(org.apache.velocity.context.Context, java.io.Writer, java.lang.String, java.io.Reader) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance boolean invokeVelocimacro(java.lang.String, java.lang.String, java.lang.String[], org.apache.velocity.context.Context, java.io.Writer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance boolean invokeVelocimacro(java.lang.String, java.lang.String, java.lang.String[], org.apache.velocity.context.Context, java.io.Writer) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance boolean invokeVelocimacro(java.lang.String, java.lang.String, java.lang.String[], org.apache.velocity.context.Context, java.io.Writer) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance boolean isVelocimacro(java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance boolean render(org.apache.velocity.context.Context, java.io.Writer, java.lang.String, org.apache.velocity.runtime.parser.node.SimpleNode)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->true;_,!null,_,_->true;_,_,!null,_->true;_,_,_,!null->true;_,_,_,null->true;_,_,null,_->true;_,null,_,_->true;null,_,_,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance org.apache.velocity.app.event.EventHandler initializeSpecificEventHandler(java.lang.String, java.lang.String, java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,null->null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance org.apache.velocity.runtime.parser.Parser createNewParser()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance void addDirective(org.apache.velocity.runtime.directive.Directive) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance void init(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance void init(java.util.Properties) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance void setProperties(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.RuntimeInstance void setProperties(java.util.Properties) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroFactory VelocimacroFactory(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroFactory boolean addVelocimacro(java.lang.String, java.lang.String, java.lang.String[], java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroFactory boolean addVelocimacro(java.lang.String, java.lang.String, java.lang.String[], java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroFactory boolean addVelocimacro(java.lang.String, java.lang.String, java.lang.String[], java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroFactory boolean addVelocimacro(java.lang.String, java.lang.String, java.lang.String[], java.lang.String) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroFactory boolean addVelocimacro(java.lang.String, org.apache.velocity.runtime.parser.node.Node, java.lang.String[], java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroFactory boolean addVelocimacro(java.lang.String, org.apache.velocity.runtime.parser.node.Node, java.lang.String[], java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroFactory boolean addVelocimacro(java.lang.String, org.apache.velocity.runtime.parser.node.Node, java.lang.String[], java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroFactory boolean addVelocimacro(java.lang.String, org.apache.velocity.runtime.parser.node.Node, java.lang.String[], java.lang.String) 3">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroManager boolean addVM(java.lang.String, org.apache.velocity.runtime.parser.node.Node, java.lang.String[], java.lang.String, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroManager boolean addVM(java.lang.String, org.apache.velocity.runtime.parser.node.Node, java.lang.String[], java.lang.String, boolean)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_,_->true;_,!null,_,_,_->true;_,_,!null,_,_->true;_,_,_,!null,_->true;_,_,_,_,false->true;_,_,_,_,true->true;_,_,_,null,_->true;_,_,null,_,_->true;null,_,_,_,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroManager.MacroEntry MacroEntry(java.lang.String, org.apache.velocity.runtime.parser.node.Node, java.lang.String[], java.lang.String, org.apache.velocity.runtime.RuntimeServices) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.VelocimacroManager.MacroEntry MacroEntry(java.lang.String, org.apache.velocity.runtime.parser.node.Node, java.lang.String[], java.lang.String, org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.runtime.VelocimacroManager.1) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/directive/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/directive/annotations.xml
new file mode 100644
index 0000000..f6cd6763
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/directive/annotations.xml
@@ -0,0 +1,209 @@
+<root>
+ <item name="org.apache.velocity.runtime.directive.Block java.lang.String id(org.apache.velocity.context.InternalContextAdapter) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Block void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Block void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.BlockMacro void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.BlockMacro void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Break boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Break boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->false;_,!null,_->false;_,_,!null->false;_,null,_->false;null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Break java.lang.String getName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Break void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Define boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Define boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->true;_,!null,_->true;_,_,!null->true;_,_,null->true;_,null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Define java.lang.String getName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Define void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Define void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Directive org.apache.velocity.runtime.directive.Scope makeScope(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Evaluate boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Evaluate boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Evaluate java.lang.String getName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Evaluate void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Foreach boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Foreach boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Foreach java.lang.String getName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Foreach void clean(org.apache.velocity.context.InternalContextAdapter, java.lang.Object, java.lang.Object, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Foreach void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Foreach void put(org.apache.velocity.context.InternalContextAdapter, java.lang.String, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Include boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Include boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->true;_,!null,_->true;_,_,!null->true;_,null,_->true;null,_,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Include boolean renderOutput(org.apache.velocity.runtime.parser.node.Node, org.apache.velocity.context.InternalContextAdapter, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null,_->false;null,_,_->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Include java.lang.String getName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.InputBase java.lang.String getInputEncoding(org.apache.velocity.context.InternalContextAdapter) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Literal boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Literal boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->true;_,!null,_->true;_,_,!null->true;_,_,null->true;null,_,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Literal java.lang.String getName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Literal void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Macro boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->true;_,!null,_->true;_,_,!null->true;_,_,null->true;_,null,_->true;null,_,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Macro java.lang.String getName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Macro java.lang.StringBuffer macroToString(java.lang.StringBuffer, java.lang.String[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Macro java.lang.StringBuffer macroToString(java.lang.StringBuffer, java.lang.String[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Macro java.lang.String[] getArgArray(org.apache.velocity.runtime.parser.node.Node, org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Macro void checkArgs(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.runtime.parser.Token, org.apache.velocity.runtime.parser.node.Node, java.lang.String) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Macro void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Macro void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.MacroParseException java.lang.String getMessage()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.MacroParseException void appendTemplateInfo(java.lang.StringBuffer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Parse boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Parse boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Parse java.lang.String getName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Parse java.lang.String getScopeName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.RuntimeMacro RuntimeMacro(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.RuntimeMacro boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node, org.apache.velocity.runtime.Renderable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.RuntimeMacro java.lang.String getScopeName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.RuntimeMacro void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Scope.Info java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Stop boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Stop java.lang.String getName()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.Stop void init(org.apache.velocity.runtime.RuntimeServices, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.StopCommand java.lang.String getMessage()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.VelocimacroProxy boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node, org.apache.velocity.runtime.Renderable) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.VelocimacroProxy boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node, org.apache.velocity.runtime.Renderable)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->true;_,!null,_,_->true;_,_,!null,_->true;_,_,_,!null->true;_,_,_,null->true;_,null,_,_->true;null,_,_,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.VelocimacroProxy java.lang.String buildErrorMsg(org.apache.velocity.runtime.parser.node.Node, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.VelocimacroProxy void checkArgs(org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node, boolean) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.VelocimacroProxy void init(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.directive.VelocimacroProxy void setArgArray(java.lang.String[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/log/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/log/annotations.xml
new file mode 100644
index 0000000..b49c0f7
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/log/annotations.xml
@@ -0,0 +1,76 @@
+<root>
+ <item name="org.apache.velocity.runtime.log.AvalonLogChute void init(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.AvalonLogChute void initTarget(java.lang.String, org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.CommonsLogLogChute void init(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.JdkLogChute void init(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.Log java.lang.String formatFileString(java.lang.String, int, int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.Log java.lang.String formatFileString(org.apache.velocity.runtime.directive.Directive) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.Log java.lang.String formatFileString(org.apache.velocity.runtime.directive.Directive)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.Log java.lang.String formatFileString(org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.Log java.lang.String formatFileString(org.apache.velocity.runtime.parser.node.Node)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.Log java.lang.String formatFileString(org.apache.velocity.util.introspection.Info) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.Log java.lang.String formatFileString(org.apache.velocity.util.introspection.Info)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.Log void setLogChute(org.apache.velocity.runtime.log.LogChute) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.LogDisplayWrapper LogDisplayWrapper(org.apache.velocity.runtime.log.Log, java.lang.String, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.LogManager boolean isProbablyProvidedLogChute(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.log.LogManager org.apache.velocity.runtime.log.LogChute createLogChute(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.LogManager void updateLog(org.apache.velocity.runtime.log.Log, org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.LogManager void updateLog(org.apache.velocity.runtime.log.Log, org.apache.velocity.runtime.RuntimeServices) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.RuntimeLoggerLog RuntimeLoggerLog(org.apache.velocity.runtime.RuntimeLogger) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.ServletLogChute int toLevel(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.ServletLogChute void init(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.SystemLogChute int toLevel(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.SystemLogChute java.lang.String getPrefix(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.SystemLogChute void init(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.log.SystemLogChute void write(java.io.PrintStream, java.lang.String, java.lang.String, java.lang.Throwable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/parser/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/parser/annotations.xml
new file mode 100644
index 0000000..7d0bc8c
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/parser/annotations.xml
@@ -0,0 +1,73 @@
+<root>
+ <item name="org.apache.velocity.runtime.parser.JJTParserState void closeNodeScope(org.apache.velocity.runtime.parser.node.Node, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.JJTParserState void openNodeScope(org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.ParseException java.lang.String add_escapes(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.ParseException java.lang.String add_escapes(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.Parser Parser(org.apache.velocity.runtime.RuntimeServices) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.Parser java.lang.String escapedDirective(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.Parser java.lang.String escapedDirective(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.Parser org.apache.velocity.runtime.parser.ParseException generateParseException()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.ParserTokenManager org.apache.velocity.runtime.parser.Token jjFillToken()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.TemplateParseException java.lang.String getMessage()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.TemplateParseException void appendTemplateInfo(java.lang.StringBuffer) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.Token org.apache.velocity.runtime.parser.Token newToken(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.TokenMgrError TokenMgrError(boolean, int, int, int, java.lang.String, char, int) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.TokenMgrError java.lang.String LexicalError(boolean, int, int, int, java.lang.String, char) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.TokenMgrError java.lang.String LexicalError(boolean, int, int, int, java.lang.String, char)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.TokenMgrError java.lang.String addEscapes(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.TokenMgrError java.lang.String addEscapes(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.VelocityCharStream VelocityCharStream(java.io.InputStream, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.VelocityCharStream VelocityCharStream(java.io.InputStream, int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.VelocityCharStream char[] GetSuffix(int)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.VelocityCharStream java.lang.String GetImage()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.VelocityCharStream void ReInit(java.io.InputStream, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.VelocityCharStream void ReInit(java.io.InputStream, int, int, int) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/parser/node/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/parser/node/annotations.xml
new file mode 100644
index 0000000..5f78c94
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/parser/node/annotations.xml
@@ -0,0 +1,475 @@
+<root>
+ <item name="org.apache.velocity.runtime.parser.node.ASTAddNode java.lang.Number perform(java.lang.Number, java.lang.Number, org.apache.velocity.context.InternalContextAdapter) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTAddNode java.lang.Number perform(java.lang.Number, java.lang.Number, org.apache.velocity.context.InternalContextAdapter) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTAndNode java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTAssignment java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTBlock boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->true;_,!null->true;_,null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTBlock java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTComment boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTComment boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->true;_,!null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTComment java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTComment java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTDirective boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->true;_,!null->true;_,null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTDirective java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTDirective java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTDivNode java.lang.Number perform(java.lang.Number, java.lang.Number, org.apache.velocity.context.InternalContextAdapter) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTEQNode java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTElseIfStatement java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTElseStatement boolean evaluate(org.apache.velocity.context.InternalContextAdapter)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->true;null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTElseStatement java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTEscape boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTEscape boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->true;_,!null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTEscape java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTEscape java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTEscapedDirective boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTEscapedDirective boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->true;_,!null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTEscapedDirective java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTExpression java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTFalse boolean evaluate(org.apache.velocity.context.InternalContextAdapter)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->false;null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTFalse java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTFloatingPointLiteral java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTFloatingPointLiteral java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTGENode java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTGTNode java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIdentifier java.lang.Object execute(java.lang.Object, org.apache.velocity.context.InternalContextAdapter) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIdentifier java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIdentifier java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIfStatement boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->true;_,!null->true;_,null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIfStatement java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIncludeStatement java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIndex java.lang.Object adjMinusIndexArg(java.lang.Object, java.lang.Object, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.SimpleNode)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_,_->!null;null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIndex java.lang.Object execute(java.lang.Object, org.apache.velocity.context.InternalContextAdapter) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIndex java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIntegerLiteral java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIntegerLiteral java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTIntegerRange java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTLENode java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTLTNode java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMap java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMathNode java.lang.Object handleSpecial(java.lang.Object, java.lang.Object, org.apache.velocity.context.InternalContextAdapter)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->null;_,!null,_->null;_,_,!null->null;_,_,null->null;_,null,_->null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMathNode java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMathNode java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMethod java.lang.Object execute(java.lang.Object, org.apache.velocity.context.InternalContextAdapter) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMethod java.lang.Object handleInvocationException(java.lang.Object, org.apache.velocity.context.InternalContextAdapter, java.lang.Throwable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMethod java.lang.Object handleInvocationException(java.lang.Object, org.apache.velocity.context.InternalContextAdapter, java.lang.Throwable) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMethod java.lang.Object handleInvocationException(java.lang.Object, org.apache.velocity.context.InternalContextAdapter, java.lang.Throwable) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMethod java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMethod java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMethod.MethodCacheKey boolean equals(java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTModNode java.lang.Number perform(java.lang.Number, java.lang.Number, org.apache.velocity.context.InternalContextAdapter) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMulNode java.lang.Number perform(java.lang.Number, java.lang.Number, org.apache.velocity.context.InternalContextAdapter) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTMulNode java.lang.Number perform(java.lang.Number, java.lang.Number, org.apache.velocity.context.InternalContextAdapter) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTNENode java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTNotNode java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTObjectArray java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTOrNode java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTParameters java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTReference boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->true;_,!null->true;_,null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTReference java.lang.Object getVariableValue(org.apache.velocity.context.Context, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTReference java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTReference java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTReference java.lang.String getDollarBang()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTReference java.lang.String getNullString(org.apache.velocity.context.InternalContextAdapter) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTReference java.lang.String printClass(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTSetDirective java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTSetDirective java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTStringLiteral java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTStringLiteral java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTStringLiteral java.lang.String replaceQuotes(java.lang.String, char) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTStringLiteral java.lang.String unescape(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTStringLiteral void adjTokenLineNums(org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTSubtractNode java.lang.Number perform(java.lang.Number, java.lang.Number, org.apache.velocity.context.InternalContextAdapter) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTSubtractNode java.lang.Number perform(java.lang.Number, java.lang.Number, org.apache.velocity.context.InternalContextAdapter) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTText boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTText boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->true;_,!null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTText java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTText java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTTextblock boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTTextblock boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->true;_,!null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTTextblock java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTTextblock java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTTrue boolean evaluate(org.apache.velocity.context.InternalContextAdapter)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->true;null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTTrue java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTVariable java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTWord java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.ASTprocess java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.BooleanPropertyExecutor BooleanPropertyExecutor(org.apache.velocity.runtime.RuntimeLogger, org.apache.velocity.util.introspection.Introspector, java.lang.Class, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.GetExecutor GetExecutor(org.apache.velocity.runtime.RuntimeLogger, org.apache.velocity.util.introspection.Introspector, java.lang.Class, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MapGetExecutor java.lang.Object execute(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MapSetExecutor java.lang.Object execute(java.lang.Object, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils boolean isInteger(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils boolean isZero(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils int compare(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils int compare(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils int findCalculationBase(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils int findCalculationBase(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number add(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number add(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number divide(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number divide(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number modulo(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number modulo(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number multiply(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number multiply(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number subtract(java.lang.Number, java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number subtract(java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number wrapPrimitive(long, java.lang.Number, java.lang.Number) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.lang.Number wrapPrimitive(long, java.lang.Number, java.lang.Number) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.math.BigDecimal toBigDecimal(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.math.BigDecimal toBigDecimal(java.lang.Number)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.MathUtils java.math.BigInteger toBigInteger(java.lang.Number) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.NodeUtils java.lang.String interpolate(java.lang.String, org.apache.velocity.context.Context) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.NodeUtils java.lang.String specialText(org.apache.velocity.runtime.parser.Token) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.NodeUtils java.lang.String tokenLiteral(org.apache.velocity.runtime.parser.Token) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.NodeUtils org.apache.commons.lang.text.StrBuilder getSpecialText(org.apache.velocity.runtime.parser.Token) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.PropertyExecutor PropertyExecutor(org.apache.velocity.runtime.RuntimeLogger, org.apache.velocity.util.introspection.Introspector, java.lang.Class, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.SimpleNode boolean evaluate(org.apache.velocity.context.InternalContextAdapter)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->false;null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.SimpleNode boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->true;_,!null->true;_,null->true;null,_->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.SimpleNode java.lang.Object childrenAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.SimpleNode java.lang.Object execute(java.lang.Object, org.apache.velocity.context.InternalContextAdapter)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->null;_,!null->null;_,null->null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.SimpleNode java.lang.Object init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,!null->!null;_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.SimpleNode java.lang.Object jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.SimpleNode java.lang.Object value(org.apache.velocity.context.InternalContextAdapter)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->null;null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.SimpleNode java.lang.String getLocation(org.apache.velocity.context.InternalContextAdapter)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.parser.node.SimpleNode java.lang.String toString(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/resource/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/resource/annotations.xml
new file mode 100644
index 0000000..c85589b
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/resource/annotations.xml
@@ -0,0 +1,5 @@
+<root>
+ <item name="org.apache.velocity.runtime.resource.ResourceManagerImpl org.apache.velocity.runtime.resource.Resource refreshResource(org.apache.velocity.runtime.resource.Resource, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/resource/loader/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/resource/loader/annotations.xml
new file mode 100644
index 0000000..5fc5b3a
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/resource/loader/annotations.xml
@@ -0,0 +1,102 @@
+<root>
+ <item name="org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader boolean isSourceModified(org.apache.velocity.runtime.resource.Resource)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->false;null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader java.io.InputStream getResourceStream(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader boolean isSourceModified(org.apache.velocity.runtime.resource.Resource) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader java.io.InputStream getResourceStream(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader java.sql.PreparedStatement getStatement(java.sql.Connection, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader long getLastModified(org.apache.velocity.runtime.resource.Resource) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader long readLastModified(org.apache.velocity.runtime.resource.Resource, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader void init(org.apache.commons.collections.ExtendedProperties) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.FileResourceLoader boolean isSourceModified(org.apache.velocity.runtime.resource.Resource) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.FileResourceLoader boolean resourceExists(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.FileResourceLoader java.io.File getFile(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.FileResourceLoader java.io.File getFile(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.FileResourceLoader java.io.InputStream getResourceStream(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.FileResourceLoader long getLastModified(org.apache.velocity.runtime.resource.Resource) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.FileResourceLoader void init(org.apache.commons.collections.ExtendedProperties) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.JarHolder JarHolder(org.apache.velocity.runtime.RuntimeServices, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.JarResourceLoader boolean isSourceModified(org.apache.velocity.runtime.resource.Resource)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->true;null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.JarResourceLoader java.io.InputStream getResourceStream(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.JarResourceLoader void init(org.apache.commons.collections.ExtendedProperties) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.JarResourceLoader void loadJar(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.ResourceLoader void commonInit(org.apache.velocity.runtime.RuntimeServices, org.apache.commons.collections.ExtendedProperties) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.ResourceLoaderFactory org.apache.velocity.runtime.resource.loader.ResourceLoader getLoader(org.apache.velocity.runtime.RuntimeServices, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.StringResourceLoader boolean isSourceModified(org.apache.velocity.runtime.resource.Resource) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.StringResourceLoader boolean resourceExists(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->false""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.StringResourceLoader java.io.InputStream getResourceStream(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.StringResourceLoader long getLastModified(org.apache.velocity.runtime.resource.Resource) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.StringResourceLoader void init(org.apache.commons.collections.ExtendedProperties) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.URLResourceLoader boolean isSourceModified(org.apache.velocity.runtime.resource.Resource)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->true""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.URLResourceLoader long getLastModified(org.apache.velocity.runtime.resource.Resource) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.resource.loader.URLResourceLoader void init(org.apache.commons.collections.ExtendedProperties) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/visitor/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/visitor/annotations.xml
new file mode 100644
index 0000000..0ec8ac7
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/runtime/visitor/annotations.xml
@@ -0,0 +1,245 @@
+<root>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTAddNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTAndNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTAssignment, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTBlock, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTComment, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTDirective, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTDivNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTEQNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTElseIfStatement, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTElseStatement, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTEscape, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTEscapedDirective, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTExpression, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTFalse, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTFloatingPointLiteral, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTGENode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTGTNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTIdentifier, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTIfStatement, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTIntegerLiteral, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTIntegerRange, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTLENode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTLTNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTMap, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTMethod, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTModNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTMulNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTNENode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTNotNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTObjectArray, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTOrNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTReference, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTSetDirective, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTStringLiteral, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTSubtractNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTText, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTTrue, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTWord, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTprocess, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.BaseVisitor java.lang.Object visit(org.apache.velocity.runtime.parser.node.SimpleNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object showNode(org.apache.velocity.runtime.parser.node.Node, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTAddNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTAndNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTAssignment, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTBlock, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTDirective, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTDivNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTEQNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTElseIfStatement, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTElseStatement, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTEscape, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTEscapedDirective, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTExpression, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTFalse, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTFloatingPointLiteral, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTGENode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTGTNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTIdentifier, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTIfStatement, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTIntegerLiteral, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTIntegerRange, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTLENode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTLTNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTMap, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTMethod, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTModNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTMulNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTNENode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTNotNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTObjectArray, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTOrNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTReference, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTSetDirective, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTStringLiteral, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTSubtractNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTText, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTTrue, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTWord, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.ASTprocess, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.Object visit(org.apache.velocity.runtime.parser.node.SimpleNode, java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.runtime.visitor.NodeViewMode java.lang.String indentString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/servlet/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/servlet/annotations.xml
new file mode 100644
index 0000000..a1d5f80
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/servlet/annotations.xml
@@ -0,0 +1,23 @@
+<root>
+ <item name="org.apache.velocity.servlet.VelocityServlet java.util.Properties loadConfiguration(javax.servlet.ServletConfig) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.servlet.VelocityServlet java.util.Properties loadConfiguration(javax.servlet.ServletConfig)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.servlet.VelocityServlet org.apache.velocity.context.Context createContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.servlet.VelocityServlet void error(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Exception) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.servlet.VelocityServlet void error(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Exception) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.servlet.VelocityServlet void mergeTemplate(org.apache.velocity.Template, org.apache.velocity.context.Context, javax.servlet.http.HttpServletResponse) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.servlet.VelocityServlet void setContentType(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/texen/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/texen/annotations.xml
new file mode 100644
index 0000000..bea0f09
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/texen/annotations.xml
@@ -0,0 +1,14 @@
+<root>
+ <item name="org.apache.velocity.texen.Generator Generator(java.util.Properties) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.texen.Generator java.io.Writer getWriter(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.texen.Generator void fillContextDefaults(org.apache.velocity.context.Context) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.texen.Generator void fillContextHash(org.apache.velocity.context.Context, java.util.Hashtable) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/texen/ant/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/texen/ant/annotations.xml
new file mode 100644
index 0000000..5b553de
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/texen/ant/annotations.xml
@@ -0,0 +1,11 @@
+<root>
+ <item name="org.apache.velocity.texen.ant.TexenTask org.apache.velocity.context.Context initControlContext()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.texen.ant.TexenTask void populateInitialContext(org.apache.velocity.context.Context) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.texen.ant.TexenTask void setOutputDirectory(java.io.File) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/texen/util/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/texen/util/annotations.xml
new file mode 100644
index 0000000..353ade7
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/texen/util/annotations.xml
@@ -0,0 +1,23 @@
+<root>
+ <item name="org.apache.velocity.texen.util.FileUtil java.io.File file(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.texen.util.FileUtil java.io.File file(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.texen.util.FileUtil java.io.File file(java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.texen.util.FileUtil java.io.File file(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.texen.util.PropertiesUtil java.util.Properties loadFromClassPath(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.texen.util.PropertiesUtil java.util.Properties loadFromClassPath(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.texen.util.PropertiesUtil java.util.Properties loadFromTemplatePath(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/util/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/util/annotations.xml
new file mode 100644
index 0000000..e60004f
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/util/annotations.xml
@@ -0,0 +1,109 @@
+<root>
+ <item name="org.apache.velocity.util.ArrayIterator ArrayIterator(java.lang.Object) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.ClassUtils java.io.InputStream getResourceAsStream(java.lang.Class, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.ClassUtils org.apache.velocity.util.introspection.VelMethod getMethod(java.lang.String, java.lang.Object[], java.lang.Class[], java.lang.Object, org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.SimpleNode, boolean) 4">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.ExceptionUtils java.lang.Throwable createWithCause(java.lang.Class, java.lang.String, java.lang.Throwable)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils boolean allEmpty(java.util.List) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String capitalizeFirstLetter(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String capitalizeFirstLetter(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String chop(java.lang.String, int)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_->!null;null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String chop(java.lang.String, int, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String collapseNewlines(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String collapseNewlines(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String collapseSpaces(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String collapseSpaces(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String concat(java.util.List) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String concat(java.util.List)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String firstLetterCaps(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String firstLetterCaps(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String getPackageAsPath(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String getPackageAsPath(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String normalizePath(java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String nullTrim(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String removeAndHump(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String removeAndHump(java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String removeUnderScores(java.lang.String)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String stackTrace(java.lang.Throwable)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String sub(java.lang.String, java.lang.String, java.lang.String) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String sub(java.lang.String, java.lang.String, java.lang.String) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.String sub(java.lang.String, java.lang.String, java.lang.String)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null,_,_->!null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.StringBuffer stringSubstitution(java.lang.String, java.util.Hashtable) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.lang.StringBuffer stringSubstitution(java.lang.String, java.util.Map) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.StringUtils java.util.List trimStrings(java.util.List)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""!null->!null;null->null""/>
+ </annotation>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/util/introspection/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/util/introspection/annotations.xml
new file mode 100644
index 0000000..4518a46
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/apache/velocity/util/introspection/annotations.xml
@@ -0,0 +1,127 @@
+<root>
+ <item name="org.apache.velocity.util.introspection.ClassMap java.lang.reflect.Method findMethod(java.lang.String, java.lang.Object[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.ClassMap void populateMethodCacheWithInterface(org.apache.velocity.util.introspection.ClassMap.MethodCache, java.lang.Class) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.ClassMap.MethodCache java.lang.String makeMethodKey(java.lang.String, java.lang.Object[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.ClassMap.MethodCache java.lang.String makeMethodKey(java.lang.reflect.Method) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.ClassMap.MethodCache java.lang.reflect.Method get(java.lang.String, java.lang.Object[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.ClassMap.MethodCache void access$100(org.apache.velocity.util.introspection.ClassMap.MethodCache, java.lang.reflect.Method) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.ClassMap.MethodCache void access$100(org.apache.velocity.util.introspection.ClassMap.MethodCache, java.lang.reflect.Method) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.ClassMap.MethodCache void put(java.lang.reflect.Method) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.Info Info(org.apache.velocity.runtime.parser.node.Node) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.Info java.lang.String toString()">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.IntrospectionUtils boolean isMethodInvocationConvertible(java.lang.Class, java.lang.Class, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.IntrospectionUtils boolean isStrictMethodInvocationConvertible(java.lang.Class, java.lang.Class, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.Introspector Introspector(org.apache.velocity.runtime.RuntimeLogger) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.Introspector java.lang.reflect.Method getMethod(java.lang.Class, java.lang.String, java.lang.Object[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.Introspector java.lang.reflect.Method getMethod(java.lang.Class, java.lang.String, java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.introspection.IntrospectorBase java.lang.reflect.Method getMethod(java.lang.Class, java.lang.String, java.lang.Object[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.IntrospectorBase java.lang.reflect.Method getMethod(java.lang.Class, java.lang.String, java.lang.Object[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.IntrospectorCacheImpl org.apache.velocity.util.introspection.ClassMap get(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.IntrospectorCacheImpl org.apache.velocity.util.introspection.ClassMap put(java.lang.Class) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.IntrospectorCacheImpl org.apache.velocity.util.introspection.ClassMap put(java.lang.Class)">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.MethodMap boolean isApplicable(java.lang.reflect.Method, java.lang.Class[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.MethodMap boolean isApplicable(java.lang.reflect.Method, java.lang.Class[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.MethodMap boolean isConvertible(java.lang.Class, java.lang.Class, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.MethodMap boolean isStrictConvertible(java.lang.Class, java.lang.Class, boolean) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.MethodMap int compare(java.lang.Class[], java.lang.Class[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.MethodMap int compare(java.lang.Class[], java.lang.Class[]) 1">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.MethodMap java.lang.reflect.Method find(java.lang.String, java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,null->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.introspection.MethodMap java.lang.reflect.Method getBestMatch(java.util.List, java.lang.Class[]) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.MethodMap void add(java.lang.reflect.Method) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.SecureIntrospectorImpl java.lang.reflect.Method getMethod(java.lang.Class, java.lang.String, java.lang.Object[])">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""_,_,null->null;null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.introspection.SecureUberspector java.util.Iterator getIterator(java.lang.Object, org.apache.velocity.util.introspection.Info)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.introspection.UberspectImpl java.util.Iterator getIterator(java.lang.Object, org.apache.velocity.util.introspection.Info) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.UberspectImpl org.apache.velocity.util.introspection.VelMethod getMethod(java.lang.Object, java.lang.String, java.lang.Object[], org.apache.velocity.util.introspection.Info)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.introspection.UberspectImpl org.apache.velocity.util.introspection.VelPropertyGet getPropertyGet(java.lang.Object, java.lang.String, org.apache.velocity.util.introspection.Info)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.introspection.UberspectImpl org.apache.velocity.util.introspection.VelPropertySet getPropertySet(java.lang.Object, java.lang.String, java.lang.Object, org.apache.velocity.util.introspection.Info)">
+ <annotation name="org.jetbrains.annotations.Contract">
+ <val val=""null,_,_,_->null""/>
+ </annotation>
+ </item>
+ <item name="org.apache.velocity.util.introspection.UberspectImpl void setRuntimeLogger(org.apache.velocity.runtime.RuntimeLogger) 0">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+ <item name="org.apache.velocity.util.introspection.UberspectImpl.VelMethodImpl java.lang.Object[] handleVarArg(java.lang.Class, int, java.lang.Object[]) 2">
+ <annotation name="org.jetbrains.annotations.NotNull"/>
+ </item>
+</root>
diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/src/Example.java b/java/java-tests/testData/codeInspection/bytecodeAnalysis/src/Example.java
new file mode 100644
index 0000000..5738a37
--- /dev/null
+++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/src/Example.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2014 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.
+ */
+
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang.ClassUtils;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.io.FilterOutputStream;
+import java.io.IOException;
+
+public class Example {
+ void test() {
+
+ if (<warning descr="Condition 'ArrayUtils.toMap(null) == null' is always 'true'">ArrayUtils.toMap(null) == null</warning>) {
+ System.out.println("null");
+ }
+
+ if (<warning descr="Condition 'ClassUtils.getPackageName((String)null) == null' is always 'false'">ClassUtils.getPackageName((String)null) == null</warning>) {
+ System.out.println("null");
+ }
+
+ @NotNull Class x = <warning descr="Expression 'ClassUtils.primitiveToWrapper(null)' might evaluate to null but is assigned to a variable that is annotated with @NotNull">ClassUtils.primitiveToWrapper(null)</warning>;
+ }
+
+ void writeBytes(@Nullable byte[] bytes) throws IOException {
+ new FilterOutputStream(null).write(<warning descr="Argument 'bytes' might be null">bytes</warning>);
+ }
+}
diff --git a/java/java-tests/testData/compiler/notNullVerification/CustomExceptionType.java b/java/java-tests/testData/compiler/notNullVerification/CustomExceptionType.java
new file mode 100644
index 0000000..055b339
--- /dev/null
+++ b/java/java-tests/testData/compiler/notNullVerification/CustomExceptionType.java
@@ -0,0 +1,5 @@
+import org.jetbrains.annotations.NotNull;
+
+public class CustomExceptionType {
+ public void foo(Object obj, @NotNull(exception = NullPointerException.class) Object obj2) { }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/compiler/notNullVerification/annotations.jar b/java/java-tests/testData/compiler/notNullVerification/annotations.jar
index 45860d8..d96bb1d 100644
--- a/java/java-tests/testData/compiler/notNullVerification/annotations.jar
+++ b/java/java-tests/testData/compiler/notNullVerification/annotations.jar
Binary files differ
diff --git a/java/java-tests/testData/inspection/dataFlow/AlexBug/src/Test.java b/java/java-tests/testData/inspection/dataFlow/AlexBug/src/Test.java
index 1953a6a..e397de3 100644
--- a/java/java-tests/testData/inspection/dataFlow/AlexBug/src/Test.java
+++ b/java/java-tests/testData/inspection/dataFlow/AlexBug/src/Test.java
@@ -1,6 +1,8 @@
public class Test {
- public String foo(String path) {
- String smth = new String(path);
+ public Test(String s) { }
+
+ public Test foo(String path) {
+ Test smth = new Test(path);
if (path == null) return null;
return smth;
}
diff --git a/java/java-tests/testData/inspection/dataFlow/caseAndNpe/expected.xml b/java/java-tests/testData/inspection/dataFlow/caseAndNpe/expected.xml
index 184e6c5..e65851b 100644
--- a/java/java-tests/testData/inspection/dataFlow/caseAndNpe/expected.xml
+++ b/java/java-tests/testData/inspection/dataFlow/caseAndNpe/expected.xml
@@ -22,6 +22,11 @@
</problem>
<problem>
<file>CaseAndNpe.java</file>
+ <line>56</line>
+ <description>Condition <code>i < 5</code> is always <code>false</code></description>
+ </problem>
+ <problem>
+ <file>CaseAndNpe.java</file>
<line>80</line>
<description>Condition is always true</description>
</problem>
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/AccessingSameArrayElements.java b/java/java-tests/testData/inspection/dataFlow/fixture/AccessingSameArrayElements.java
new file mode 100644
index 0000000..a5a0001
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/AccessingSameArrayElements.java
@@ -0,0 +1,56 @@
+abstract class Test {
+ void testSameEquals(int[] arr1, int[] arr2) {
+ if (arr1[0] == arr2[0] && <warning descr="Condition 'arr1[0] == arr2[0]' is always 'true' when reached">arr1[0] == arr2[0]</warning>) {
+ }
+ }
+
+ void testMatrices(int[][][] arr1, int[][][] arr2) {
+ if (arr1[0][1][2] == arr1[0][1][3] &&
+ <warning descr="Condition 'arr1[0][1][2] == arr1[0][1][3]' is always 'true' when reached">arr1[0][1][2] == arr1[0][1][3]</warning>) {
+ }
+ }
+
+ void testNotEquals(int[] arr1, int[] arr2) {
+ if (arr1[0] != arr2[0]) return;
+
+ if (<warning descr="Condition 'arr1[0] == arr2[0]' is always 'true'">arr1[0] == arr2[0]</warning>) {}
+ }
+
+ void testInvalidatingCall(int[] arr1, int[] arr2) {
+ if (arr1[0] != arr2[0]) return;
+
+ changeArray(arr1);
+
+ if (arr1[0] == arr2[0]) {}
+ }
+ abstract void changeArray(int[] array);
+
+
+ void testIndirectlyInvalidatingCall(int[] arr1, int[] arr2, int[][] arr3) {
+ arr3[0] = arr1;
+
+ if (arr1[0] != arr2[0]) return;
+
+ changeSubArray(arr3);
+
+ if (arr1[0] == arr2[0]) {}
+ }
+ abstract void changeSubArray(int[][] array);
+
+
+ void testAssigning(int[] arr1, int j) {
+ arr1[0] = j;
+ if (<warning descr="Condition 'arr1[0] == j' is always 'true'">arr1[0] == j</warning>) { }
+ }
+
+ void testReassigning(int[] arr1) {
+ arr1[0] = 1;
+ arr1[1] = 3;
+ if (<warning descr="Condition 'arr1[0] == 1' is always 'true'">arr1[0] == 1</warning>) { }
+
+ for (int i = 0; i < arr1.length; i++) {
+ arr1[i] = 2;
+ }
+ if (arr1[0] == 1) { }
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/AssertThat.java b/java/java-tests/testData/inspection/dataFlow/fixture/AssertThat.java
new file mode 100644
index 0000000..b3d614c
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/AssertThat.java
@@ -0,0 +1,18 @@
+import org.hamcrest.CoreMatchers;
+import org.jetbrains.annotations.Nullable;
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+
+class Contracts {
+
+ private void checkNotNullValue(@Nullable Object o) {
+ assertThat(o, CoreMatchers.<Object>notNullValue());
+ System.out.println(o.hashCode());
+ }
+
+ private void checkNotEqualToNull(@Nullable String test) {
+ assertThat("String is null", test, not(equalTo(null)));
+ int length = test.length();
+ }
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/CatchRuntimeException.java b/java/java-tests/testData/inspection/dataFlow/fixture/CatchRuntimeException.java
index 8f65086..e635b8d 100644
--- a/java/java-tests/testData/inspection/dataFlow/fixture/CatchRuntimeException.java
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/CatchRuntimeException.java
@@ -36,7 +36,7 @@
}
public void bar(@NotNull Object foo) {
- assert <warning descr="Condition 'foo != null' is always 'true'">foo != null</warning>;
+ if (<warning descr="Condition 'foo != null' is always 'true'">foo != null</warning>);
}
public void bar2(@NotNull Object foo) {
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ContractInferenceBewareOverriding.java b/java/java-tests/testData/inspection/dataFlow/fixture/ContractInferenceBewareOverriding.java
new file mode 100644
index 0000000..a1d263f
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/ContractInferenceBewareOverriding.java
@@ -0,0 +1,21 @@
+import org.jetbrains.annotations.Nullable;
+
+class Doo {
+
+ boolean isMaybeNotNull(@Nullable Object o) {
+ return o != null;
+ }
+
+ void foo(@Nullable String s) {
+ if (isMaybeNotNull(s)) {
+ System.out.println(<warning descr="Method invocation 's.length()' may produce 'java.lang.NullPointerException'">s.length()</warning>);
+ }
+ }
+
+}
+
+class DooImpl extends Doo {
+ boolean isMaybeNotNull(@Nullable Object o) {
+ return hashCode() == 42;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/FinalFieldDuringSuperInitialization.java b/java/java-tests/testData/inspection/dataFlow/fixture/FinalFieldDuringSuperInitialization.java
new file mode 100644
index 0000000..59fc5fb
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/FinalFieldDuringSuperInitialization.java
@@ -0,0 +1,20 @@
+class Parent {
+ Parent() {
+ callProtectedMethod();
+ }
+ protected void callProtectedMethod() { }
+}
+
+class Child extends Parent {
+ private final Object myField;
+ Child() {
+ super();
+ myField = new Object();
+ }
+ @Override
+ protected void callProtectedMethod() {
+ if (myField != null) { // HERE myField CAN be null
+ System.out.println();
+ }
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/GuavaCheckNotNull.java b/java/java-tests/testData/inspection/dataFlow/fixture/GuavaCheckNotNull.java
new file mode 100644
index 0000000..4a11daa
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/GuavaCheckNotNull.java
@@ -0,0 +1,11 @@
+import org.jetbrains.annotations.Nullable;
+
+class Contracts {
+
+ private void check(@Nullable Object o) {
+ com.google.common.base.Preconditions.checkNotNull(o);
+ System.out.println(o.hashCode());
+ }
+
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/NumberComparisonsWhenValueIsKnown.java b/java/java-tests/testData/inspection/dataFlow/fixture/NumberComparisonsWhenValueIsKnown.java
new file mode 100644
index 0000000..71cca53
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/NumberComparisonsWhenValueIsKnown.java
@@ -0,0 +1,16 @@
+import java.util.Arrays;
+
+class Test {
+ int[] mIndex = null;
+ int mSize = 0;
+
+ void indexValues() {
+ float loadFactor = mIndex == null ? 1.f : ((float) mSize) / ((float) mIndex.length);
+
+ if (loadFactor < 0.25f || 0.75f <= loadFactor) {
+ mIndex = new int[mSize * 2];
+ }
+
+ mIndex[0] = -1;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences.java
index d81b467..dbb4f50 100644
--- a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences.java
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences.java
@@ -1,13 +1,15 @@
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
class Test {
- private void test2(@NotNull Object bar) {
+ private void test2(@NotNull Object bar) {}
- }
+ void println(@Nullable Object o) {}
+
private Object test(Object foo, Object bar) {
if (foo == null) {
- System.out.println(<warning descr="Value 'foo' is always 'null'"><caret>foo</warning>);
- System.out.println(<warning descr="Value 'foo' is always 'null'">foo</warning>);
+ println(<warning descr="Value 'foo' is always 'null'"><caret>foo</warning>);
+ println(<warning descr="Value 'foo' is always 'null'">foo</warning>);
return <warning descr="Expression 'foo' might evaluate to null but is returned by the method which is not declared as @Nullable">foo</warning>;
}
if (bar == null) {
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_NotInComplexAssignment.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_NotInComplexAssignment.java
deleted file mode 100644
index a13f0f1..0000000
--- a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_NotInComplexAssignment.java
+++ /dev/null
@@ -1,6 +0,0 @@
-class Test {
- void foo() {
- int x = 42;
- <caret>x += 100;
- }
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_OverloadedCall.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_OverloadedCall.java
new file mode 100644
index 0000000..82c1e91
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_OverloadedCall.java
@@ -0,0 +1,14 @@
+import org.jetbrains.annotations.Nullable;
+
+class Test {
+ void method(@Nullable String o) {}
+
+ void method(@Nullable Integer o) {}
+
+ private void test(String foo) {
+ if (foo == null) {
+ method(<warning descr="Value 'foo' is always 'null'"><caret>foo</warning>);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_OverloadedCall_after.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_OverloadedCall_after.java
new file mode 100644
index 0000000..2252462
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_OverloadedCall_after.java
@@ -0,0 +1,14 @@
+import org.jetbrains.annotations.Nullable;
+
+class Test {
+ void method(@Nullable String o) {}
+
+ void method(@Nullable Integer o) {}
+
+ private void test(String foo) {
+ if (foo == null) {
+ method(<caret>(String) null);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithEnum.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithEnum.java
deleted file mode 100644
index 2ed16ce..0000000
--- a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithEnum.java
+++ /dev/null
@@ -1,7 +0,0 @@
-class Test {
- private void test() {
- foo.MyEnum s = foo.MyEnum.FOO;
- System.out.println(<caret><warning descr="Value 's' is always 'FOO'">s</warning>);
- }
-
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithEnum_after.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithEnum_after.java
deleted file mode 100644
index 29552fa..0000000
--- a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithEnum_after.java
+++ /dev/null
@@ -1,9 +0,0 @@
-import foo.MyEnum;
-
-class Test {
- private void test() {
- foo.MyEnum s = foo.MyEnum.FOO;
- System.out.println(MyEnum.FOO);
- }
-
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithIntConstant.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithIntConstant.java
deleted file mode 100644
index 5388bcd..0000000
--- a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithIntConstant.java
+++ /dev/null
@@ -1,10 +0,0 @@
-class Test {
- public static final int CONST = 23942;
- private void test(int a) {
- if (a == CONST) {
- System.out.println(<caret><warning descr="Value 'a' is always 'CONST'">a</warning>);
- }
-
- }
-
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithIntConstant_after.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithIntConstant_after.java
deleted file mode 100644
index 11feed5..0000000
--- a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithIntConstant_after.java
+++ /dev/null
@@ -1,10 +0,0 @@
-class Test {
- public static final int CONST = 23942;
- private void test(int a) {
- if (a == CONST) {
- System.out.println(<caret>CONST);
- }
-
- }
-
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithString.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithString.java
deleted file mode 100644
index fcff484..0000000
--- a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithString.java
+++ /dev/null
@@ -1,8 +0,0 @@
-class Test {
- public static final String CONST = "foo bar";
- private void test() {
- String s = CONST;
- System.out.println(<caret><warning descr="Value 's' is always 'CONST'">s</warning>);
- }
-
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithString_after.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithString_after.java
deleted file mode 100644
index a462170..0000000
--- a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_ReplaceWithString_after.java
+++ /dev/null
@@ -1,8 +0,0 @@
-class Test {
- public static final String CONST = "foo bar";
- private void test() {
- String s = CONST;
- System.out.println(CONST);
- }
-
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_Switch.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_Switch.java
deleted file mode 100644
index e48dc19..0000000
--- a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_Switch.java
+++ /dev/null
@@ -1,22 +0,0 @@
-class Test {
- private void test() {
- int state = 1;
- switch (<warning descr="Value 'state' is always '1'">state</warning>) {
- case 1: break;
- }
- }
-
- private void test2(int state) {
- switch (state) {
- case ONE:
- case TWO:
- if (state == TWO) {
- System.out.println("hello");
- }
- }
- }
-
- public static final int ONE = 1;
- public static final int TWO = 2;
-
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_after.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_after.java
index 0d18739..395fd48 100644
--- a/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_after.java
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_after.java
@@ -1,13 +1,15 @@
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
class Test {
- private void test2(@NotNull Object bar) {
+ private void test2(@NotNull Object bar) {}
- }
+ void println(@Nullable Object o) {}
+
private Object test(Object foo, Object bar) {
if (foo == null) {
- System.out.println(<caret>null);
- System.out.println(foo);
+ println(<caret>null);
+ println(foo);
return foo;
}
if (bar == null) {
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/UseInferredContracts.java b/java/java-tests/testData/inspection/dataFlow/fixture/UseInferredContracts.java
new file mode 100644
index 0000000..34b9d70
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/UseInferredContracts.java
@@ -0,0 +1,15 @@
+import org.jetbrains.annotations.Nullable;
+
+class Doo {
+
+ static boolean isNotNull(@Nullable Object o) {
+ return o != null;
+ }
+
+ void foo(@Nullable String s) {
+ if (isNotNull(s)) {
+ System.out.println(s.length());
+ }
+ }
+
+}
diff --git a/java/java-tests/testData/inspection/nullableProblems/GetterSetterProblems.java b/java/java-tests/testData/inspection/nullableProblems/GetterSetterProblems.java
index d49cd9c..c8a5816 100644
--- a/java/java-tests/testData/inspection/nullableProblems/GetterSetterProblems.java
+++ b/java/java-tests/testData/inspection/nullableProblems/GetterSetterProblems.java
@@ -2,7 +2,7 @@
class B {
@NotNull
- B b;
+ B b = new B();
public B <warning descr="Getter for @NotNull field might be annotated @NotNull itself">getB</warning>() {
return b;
@@ -39,7 +39,7 @@
this.c = c;
}
- @NotNull C c1;
+ @NotNull C c1 = new C(null);
@org.jetbrains.annotations.Nullable
public C getC1() {
if (c1 != null) {
diff --git a/java/java-tests/testData/inspection/nullableProblems/NotNullCustomException.java b/java/java-tests/testData/inspection/nullableProblems/NotNullCustomException.java
new file mode 100644
index 0000000..42e2798
--- /dev/null
+++ b/java/java-tests/testData/inspection/nullableProblems/NotNullCustomException.java
@@ -0,0 +1,8 @@
+import org.jetbrains.annotations.*;
+
+class Test {
+ public void foo(@NotNull(exception = NullPointerException.class) String a) { }
+ public void foo2(@NotNull(exception = <warning descr="Custom exception class should have a constructor with a single message parameter of String type">CustomException.class</warning>) String a) { }
+}
+
+class CustomException extends Exception {}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/nullableProblems/NotNullFieldNotInitialized.java b/java/java-tests/testData/inspection/nullableProblems/NotNullFieldNotInitialized.java
new file mode 100644
index 0000000..918d5db
--- /dev/null
+++ b/java/java-tests/testData/inspection/nullableProblems/NotNullFieldNotInitialized.java
@@ -0,0 +1,9 @@
+import org.jetbrains.annotations.*;
+
+class Test {
+ <warning descr="Not-null fields must be initialized">@NotNull</warning> Object member;
+
+ private void accessMember() {
+ member = new Object();
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/Errors.java b/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/Errors.java
index 200c37e..4e90d08 100644
--- a/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/Errors.java
+++ b/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/Errors.java
@@ -1,2 +1,8 @@
@Ann(<error descr="Cannot find method 'value'">0</error>) class D {
+
+ <error>@EJB</error>
+ Runnable myMissingEjbRef;
+
+ public <T> @SafeVarargs
+ static void m();
}
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/Errors.txt b/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/Errors.txt
index 9f1efdb..678025f 100644
--- a/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/Errors.txt
+++ b/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/Errors.txt
@@ -69,5 +69,96 @@
<empty list>
PsiWhiteSpace(' ')
PsiJavaToken:LBRACE('{')
+ PsiWhiteSpace('\n\n ')
+ PsiModifierList:
+ <empty list>
+ PsiErrorElement:Identifier or type expected
+ PsiTypeParameterList
+ PsiJavaToken:LT('<')
+ PsiTypeParameter:error
+ PsiIdentifier:error('error')
+ PsiElement(EXTENDS_BOUND_LIST)
+ <empty list>
+ PsiJavaToken:GT('>')
+ PsiModifierList:@EJB
+ PsiAnnotation
+ PsiJavaToken:AT('@')
+ PsiJavaCodeReferenceElement:EJB
+ PsiIdentifier:EJB('EJB')
+ PsiReferenceParameterList
+ <empty list>
+ PsiAnnotationParameterList
+ <empty list>
+ PsiErrorElement:Identifier or type expected
+ PsiTypeParameterList
+ PsiJavaToken:LT('<')
+ PsiErrorElement:Type parameter expected
+ <empty list>
+ PsiErrorElement:'>' expected.
+ <empty list>
+ PsiErrorElement:Unexpected token
+ PsiJavaToken:DIV('/')
+ PsiModifierList:
+ <empty list>
+ PsiTypeElement:error
+ PsiJavaCodeReferenceElement:error
+ PsiIdentifier:error('error')
+ PsiReferenceParameterList
+ <empty list>
+ PsiErrorElement:Identifier expected
+ <empty list>
+ PsiErrorElement:Unexpected token
+ PsiJavaToken:GT('>')
+ PsiWhiteSpace('\n ')
+ PsiField:myMissingEjbRef
+ PsiModifierList:
+ <empty list>
+ PsiTypeElement:Runnable
+ PsiJavaCodeReferenceElement:Runnable
+ PsiIdentifier:Runnable('Runnable')
+ PsiReferenceParameterList
+ <empty list>
+ PsiWhiteSpace(' ')
+ PsiIdentifier:myMissingEjbRef('myMissingEjbRef')
+ PsiJavaToken:SEMICOLON(';')
+ PsiWhiteSpace('\n\n ')
+ PsiModifierList:public
+ PsiKeyword:public('public')
+ PsiWhiteSpace(' ')
+ PsiErrorElement:Identifier or type expected
+ PsiTypeParameterList
+ PsiJavaToken:LT('<')
+ PsiTypeParameter:T
+ PsiIdentifier:T('T')
+ PsiElement(EXTENDS_BOUND_LIST)
+ <empty list>
+ PsiJavaToken:GT('>')
+ PsiWhiteSpace(' ')
+ PsiMethod:m
+ PsiModifierList:@SafeVarargs
+ static
+ PsiAnnotation
+ PsiJavaToken:AT('@')
+ PsiJavaCodeReferenceElement:SafeVarargs
+ PsiIdentifier:SafeVarargs('SafeVarargs')
+ PsiReferenceParameterList
+ <empty list>
+ PsiAnnotationParameterList
+ <empty list>
+ PsiWhiteSpace('\n ')
+ PsiKeyword:static('static')
+ PsiTypeParameterList
+ <empty list>
+ PsiWhiteSpace(' ')
+ PsiTypeElement:void
+ PsiKeyword:void('void')
+ PsiWhiteSpace(' ')
+ PsiIdentifier:m('m')
+ PsiParameterList:()
+ PsiJavaToken:LPARENTH('(')
+ PsiJavaToken:RPARENTH(')')
+ PsiReferenceList
+ <empty list>
+ PsiJavaToken:SEMICOLON(';')
PsiWhiteSpace('\n')
PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/TypeAnnotations.java b/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/TypeAnnotations.java
index a74d4d6..de61404 100644
--- a/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/TypeAnnotations.java
+++ b/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/TypeAnnotations.java
@@ -47,6 +47,11 @@
try (@A Reader r = new @B FileReader("/dev/zero"); @A Writer w = new @B FileWriter("/dev/null")) { }
}
+ interface TestClass {
+ <T> @Nullable List<T> test();
+ <T> @Positive int test(T t);
+ }
+
//
// 2. An annotation on a wildcard type argument appears before the wildcard ...
//
@@ -72,6 +77,7 @@
//
@Immutable SpecSamples() { }
+ <T> @Immutable SpecSamples(T t) { }
//
// todo [r.sh] 5. It is permitted to explicitly declare the method receiver as the first formal parameter ...
diff --git a/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/TypeAnnotations.txt b/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/TypeAnnotations.txt
index 54cf4b8..0cc33a8 100644
--- a/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/TypeAnnotations.txt
+++ b/java/java-tests/testData/psi/parser-full/annotationParsing/annotation/TypeAnnotations.txt
@@ -1045,6 +1045,104 @@
PsiWhiteSpace('\n ')
PsiJavaToken:RBRACE('}')
PsiWhiteSpace('\n\n ')
+ PsiClass:TestClass
+ PsiModifierList:
+ <empty list>
+ PsiKeyword:interface('interface')
+ PsiWhiteSpace(' ')
+ PsiIdentifier:TestClass('TestClass')
+ PsiTypeParameterList
+ <empty list>
+ PsiReferenceList
+ <empty list>
+ PsiReferenceList
+ <empty list>
+ PsiWhiteSpace(' ')
+ PsiJavaToken:LBRACE('{')
+ PsiWhiteSpace('\n ')
+ PsiMethod:test
+ PsiModifierList:
+ <empty list>
+ PsiTypeParameterList
+ PsiJavaToken:LT('<')
+ PsiTypeParameter:T
+ PsiIdentifier:T('T')
+ PsiElement(EXTENDS_BOUND_LIST)
+ <empty list>
+ PsiJavaToken:GT('>')
+ PsiWhiteSpace(' ')
+ PsiTypeElement:@Nullable List<T>
+ PsiAnnotation
+ PsiJavaToken:AT('@')
+ PsiJavaCodeReferenceElement:Nullable
+ PsiIdentifier:Nullable('Nullable')
+ PsiReferenceParameterList
+ <empty list>
+ PsiAnnotationParameterList
+ <empty list>
+ PsiWhiteSpace(' ')
+ PsiJavaCodeReferenceElement:List<T>
+ PsiIdentifier:List('List')
+ PsiReferenceParameterList
+ PsiJavaToken:LT('<')
+ PsiTypeElement:T
+ PsiJavaCodeReferenceElement:T
+ PsiIdentifier:T('T')
+ PsiReferenceParameterList
+ <empty list>
+ PsiJavaToken:GT('>')
+ PsiWhiteSpace(' ')
+ PsiIdentifier:test('test')
+ PsiParameterList:()
+ PsiJavaToken:LPARENTH('(')
+ PsiJavaToken:RPARENTH(')')
+ PsiReferenceList
+ <empty list>
+ PsiJavaToken:SEMICOLON(';')
+ PsiWhiteSpace('\n ')
+ PsiMethod:test
+ PsiModifierList:
+ <empty list>
+ PsiTypeParameterList
+ PsiJavaToken:LT('<')
+ PsiTypeParameter:T
+ PsiIdentifier:T('T')
+ PsiElement(EXTENDS_BOUND_LIST)
+ <empty list>
+ PsiJavaToken:GT('>')
+ PsiWhiteSpace(' ')
+ PsiTypeElement:@Positive int
+ PsiAnnotation
+ PsiJavaToken:AT('@')
+ PsiJavaCodeReferenceElement:Positive
+ PsiIdentifier:Positive('Positive')
+ PsiReferenceParameterList
+ <empty list>
+ PsiAnnotationParameterList
+ <empty list>
+ PsiWhiteSpace(' ')
+ PsiKeyword:int('int')
+ PsiWhiteSpace(' ')
+ PsiIdentifier:test('test')
+ PsiParameterList:(T t)
+ PsiJavaToken:LPARENTH('(')
+ PsiParameter:t
+ PsiModifierList:
+ <empty list>
+ PsiTypeElement:T
+ PsiJavaCodeReferenceElement:T
+ PsiIdentifier:T('T')
+ PsiReferenceParameterList
+ <empty list>
+ PsiWhiteSpace(' ')
+ PsiIdentifier:t('t')
+ PsiJavaToken:RPARENTH(')')
+ PsiReferenceList
+ <empty list>
+ PsiJavaToken:SEMICOLON(';')
+ PsiWhiteSpace('\n ')
+ PsiJavaToken:RBRACE('}')
+ PsiWhiteSpace('\n\n ')
PsiComment(END_OF_LINE_COMMENT)('//')
PsiWhiteSpace('\n ')
PsiComment(END_OF_LINE_COMMENT)('// 2. An annotation on a wildcard type argument appears before the wildcard ...')
@@ -1485,6 +1583,48 @@
PsiJavaToken:LBRACE('{')
PsiWhiteSpace(' ')
PsiJavaToken:RBRACE('}')
+ PsiWhiteSpace('\n ')
+ PsiMethod:SpecSamples
+ PsiModifierList:
+ <empty list>
+ PsiTypeParameterList
+ PsiJavaToken:LT('<')
+ PsiTypeParameter:T
+ PsiIdentifier:T('T')
+ PsiElement(EXTENDS_BOUND_LIST)
+ <empty list>
+ PsiJavaToken:GT('>')
+ PsiWhiteSpace(' ')
+ PsiAnnotation
+ PsiJavaToken:AT('@')
+ PsiJavaCodeReferenceElement:Immutable
+ PsiIdentifier:Immutable('Immutable')
+ PsiReferenceParameterList
+ <empty list>
+ PsiAnnotationParameterList
+ <empty list>
+ PsiWhiteSpace(' ')
+ PsiIdentifier:SpecSamples('SpecSamples')
+ PsiParameterList:(T t)
+ PsiJavaToken:LPARENTH('(')
+ PsiParameter:t
+ PsiModifierList:
+ <empty list>
+ PsiTypeElement:T
+ PsiJavaCodeReferenceElement:T
+ PsiIdentifier:T('T')
+ PsiReferenceParameterList
+ <empty list>
+ PsiWhiteSpace(' ')
+ PsiIdentifier:t('t')
+ PsiJavaToken:RPARENTH(')')
+ PsiReferenceList
+ <empty list>
+ PsiWhiteSpace(' ')
+ PsiCodeBlock
+ PsiJavaToken:LBRACE('{')
+ PsiWhiteSpace(' ')
+ PsiJavaToken:RBRACE('}')
PsiWhiteSpace('\n\n ')
PsiComment(END_OF_LINE_COMMENT)('//')
PsiWhiteSpace('\n ')
diff --git a/java/java-tests/testData/refactoring/inlineMethod/ThisNameConflict.java b/java/java-tests/testData/refactoring/inlineMethod/ThisNameConflict.java
new file mode 100644
index 0000000..262eae4
--- /dev/null
+++ b/java/java-tests/testData/refactoring/inlineMethod/ThisNameConflict.java
@@ -0,0 +1,11 @@
+class Test {
+ private final String test = "";
+
+ {
+ foo();
+ }
+
+ void fo<caret>o() {
+ if (test.isEmpty());
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineMethod/ThisNameConflict.java.after b/java/java-tests/testData/refactoring/inlineMethod/ThisNameConflict.java.after
new file mode 100644
index 0000000..76ed281
--- /dev/null
+++ b/java/java-tests/testData/refactoring/inlineMethod/ThisNameConflict.java.after
@@ -0,0 +1,8 @@
+class Test {
+ private final String test = "";
+
+ {
+ if (test.isEmpty());
+ }
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/pullUp/AsDefaultMethodOverAbstract.java b/java/java-tests/testData/refactoring/pullUp/AsDefaultMethodOverAbstract.java
new file mode 100644
index 0000000..2a1b9f1a
--- /dev/null
+++ b/java/java-tests/testData/refactoring/pullUp/AsDefaultMethodOverAbstract.java
@@ -0,0 +1,12 @@
+class Test {
+ interface Printer {
+ void foo();
+
+ }
+
+ abstract class AbstractPrinter implements Printer {
+ @Override
+ public void f<caret>oo() {
+ }
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/pullUp/AsDefaultMethodOverAbstract_after.java b/java/java-tests/testData/refactoring/pullUp/AsDefaultMethodOverAbstract_after.java
new file mode 100644
index 0000000..2a1b9f1a
--- /dev/null
+++ b/java/java-tests/testData/refactoring/pullUp/AsDefaultMethodOverAbstract_after.java
@@ -0,0 +1,12 @@
+class Test {
+ interface Printer {
+ void foo();
+
+ }
+
+ abstract class AbstractPrinter implements Printer {
+ @Override
+ public void f<caret>oo() {
+ }
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testSrc/com/intellij/TestClassesFilterTest.java b/java/java-tests/testSrc/com/intellij/TestClassesFilterTest.java
index 2bbdb91..802189d 100644
--- a/java/java-tests/testSrc/com/intellij/TestClassesFilterTest.java
+++ b/java/java-tests/testSrc/com/intellij/TestClassesFilterTest.java
@@ -21,6 +21,8 @@
import java.io.ByteArrayInputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
+import java.util.Collections;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -41,7 +43,7 @@
"com.intellij.package6.ExcludedTest\n" +
"com.intellij.package7.*package8";
- TestClassesFilter classesFilter = GroupBasedTestClassFilter.createOn(getReader(filterText), "Group1");
+ TestClassesFilter classesFilter = GroupBasedTestClassFilter.createOn(getReader(filterText), Collections.singletonList("Group1"));
assertTrue(classesFilter.matches("com.intellij.package1.Test"));
assertTrue(classesFilter.matches("com.intellij.package1.Test2"));
assertFalse(classesFilter.matches("com.intellij.package2.Test"));
@@ -59,7 +61,7 @@
assertFalse(classesFilter.matches("com.intellij.package7.package5.package8"));
assertFalse(classesFilter.matches("com.intellij.package7"));
- classesFilter = GroupBasedTestClassFilter.createOn(getReader(filterText), "Group2");
+ classesFilter = GroupBasedTestClassFilter.createOn(getReader(filterText), Collections.singletonList("Group2"));
assertFalse(classesFilter.matches("com.intellij.package1.Test"));
assertFalse(classesFilter.matches("com.intellij.package1.Test2"));
assertFalse(classesFilter.matches("com.intellij.package2.Test"));
@@ -77,18 +79,29 @@
assertTrue(classesFilter.matches("com.intellij.package7.package5.package8"));
assertFalse(classesFilter.matches("com.intellij.package7"));
- classesFilter = GroupBasedTestClassFilter.createOn(getReader(filterText), null);
- checkForNullGroup(classesFilter);
+ classesFilter = GroupBasedTestClassFilter.createOn(getReader(filterText),
+ Collections.singletonList(GroupBasedTestClassFilter.ALL_EXCLUDE_DEFINED));
+ checkForAllExcludedDefinedGroup(classesFilter);
- classesFilter = GroupBasedTestClassFilter.createOn(getReader(filterText), GroupBasedTestClassFilter.ALL_EXCLUDE_DEFINED);
- checkForNullGroup(classesFilter);
+ classesFilter = GroupBasedTestClassFilter.createOn(getReader(filterText), Collections.<String>emptyList());
+ checkForAllExcludedDefinedGroup(classesFilter);
+
+ classesFilter = GroupBasedTestClassFilter.createOn(getReader(filterText), Arrays.asList("Group1", "Group2"));
+ assertTrue(classesFilter.matches("com.intellij.package1.Test"));
+ assertTrue(classesFilter.matches("com.intellij.package5.Test"));
+ assertFalse(classesFilter.matches("com.intellij.package4.Test"));
+
+ classesFilter = GroupBasedTestClassFilter.createOn(getReader(filterText), Arrays.asList("Group1", GroupBasedTestClassFilter.ALL_EXCLUDE_DEFINED));
+ assertTrue(classesFilter.matches("com.intellij.package1.Test"));
+ assertFalse(classesFilter.matches("com.intellij.package5.Test"));
+ assertTrue(classesFilter.matches("com.intellij.package4.Test"));
}
private static InputStreamReader getReader(String filterText) throws UnsupportedEncodingException {
return new InputStreamReader(new ByteArrayInputStream(filterText.getBytes("UTF-8")));
}
- private static void checkForNullGroup(TestClassesFilter classesFilter) {
+ private static void checkForAllExcludedDefinedGroup(TestClassesFilter classesFilter) {
assertFalse(classesFilter.matches("com.intellij.package1.Test"));
assertFalse(classesFilter.matches("com.intellij.package1.Test2"));
assertTrue(classesFilter.matches("com.intellij.package2.Test"));
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/JavaTypingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/JavaTypingTest.java
index 8c3837f..f59162a 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/JavaTypingTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/JavaTypingTest.java
@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight;
+import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
@@ -57,6 +58,13 @@
doTest('"');
}
+ public void testColumnMode() {
+ myFixture.configureByFile(getTestName(true) + "_before.java");
+ ((EditorEx)myFixture.getEditor()).setColumnMode(true);
+ myFixture.type('(');
+ myFixture.checkResultByFile(getTestName(true) + "_after.java");
+ }
+
private void doTest(char c) {
myFixture.configureByFile(getTestName(true) + "_before.java");
myFixture.type(c);
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy
index 8a54c95..7391f93 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy
@@ -42,6 +42,7 @@
import com.intellij.openapi.editor.EditorFactory
import com.intellij.openapi.editor.LogicalPosition
import com.intellij.openapi.editor.actionSystem.EditorActionManager
+import com.intellij.openapi.editor.ex.EditorEx
import com.intellij.openapi.extensions.Extensions
import com.intellij.openapi.extensions.LoadingOrder
import com.intellij.openapi.fileEditor.FileEditor
@@ -1642,4 +1643,14 @@
assert lookup
assert myFixture.lookupElementStrings == ['goo']
}
+
+ public void "test in column selection mode"() {
+ myFixture.configureByText "a.java", """
+class Foo {{
+ <caret>
+}}"""
+ edt { ((EditorEx)myFixture.editor).setColumnMode(true) }
+ type 'toStr'
+ assert lookup
+ }
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionTest.groovy
index 79a94aa..77b4c0c 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionTest.groovy
@@ -768,6 +768,8 @@
assertStringItems("fofoo", "fofoo");
}
+ public void testMethodMergingMinimalTail() { doTest() }
+
public void testAnnotationQualifiedName() throws Throwable {
doTest();
}
@@ -920,6 +922,9 @@
}
public void testSmartEnterWrapsConstructorCall() throws Throwable { doTest(Lookup.COMPLETE_STATEMENT_SELECT_CHAR as String) }
+ public void testSmartEnterNoNewLine() { doTest(Lookup.COMPLETE_STATEMENT_SELECT_CHAR as String) }
+ public void testSmartEnterWithNewLine() { doTest(Lookup.COMPLETE_STATEMENT_SELECT_CHAR as String) }
+
public void testTabReplacesMethodNameWithLocalVariableName() throws Throwable { doTest('\t'); }
public void testMethodParameterAnnotationClass() throws Throwable { doTest(); }
public void testPrimitiveCastOverwrite() throws Throwable { doTest '\t' }
@@ -1469,6 +1474,11 @@
doTest()
}
+ public void testUnimportedStaticInnerClass() {
+ myFixture.addClass("package foo; public class Super { public static class Inner {} }");
+ doTest()
+ }
+
public void testNoJavaLangPackagesInImport() { doAntiTest() }
public void testNoStaticDuplicatesFromExpectedMemberFactories() {
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionOrderingTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionOrderingTest.groovy
index b19da5a..1d258fe 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionOrderingTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionOrderingTest.groovy
@@ -52,12 +52,12 @@
public void testNewListAlwaysFirst() {
def lookup = invokeCompletion(getTestName(false) + ".java")
- assertPreferredItems 1, 'List', 'AbstractList', 'AbstractSequentialList', 'ArrayList'
+ assertPreferredItems 1, 'List', 'ArrayList', 'AbstractList', 'AbstractSequentialList'
for (int i = 0; i < StatisticsManager.OBLIVION_THRESHOLD + 10; i++) {
- imitateItemSelection(lookup, 3) //ArrayList
+ imitateItemSelection(lookup, 3) //AbstractSequentialList
}
refreshSorting(lookup)
- assertPreferredItems 1, 'List', 'ArrayList', 'AbstractList', 'AbstractSequentialList'
+ assertPreferredItems 1, 'List', 'AbstractSequentialList', 'ArrayList', 'AbstractList'
}
public void testNoStatsOnUnsuccessfulAttempt() {
@@ -170,11 +170,11 @@
public void testStatisticsAffectsNonPreferableExpectedItems() throws Throwable {
final LookupImpl lookup = invokeCompletion(getTestName(false) + ".java");
- assertPreferredItems(1, "List", "AbstractList", "AbstractSequentialList", "ArrayList");
+ assertPreferredItems(1, "List", "ArrayList", "AbstractList", "AbstractSequentialList");
incUseCount(lookup, 0);
- assertPreferredItems(1, "List", "AbstractList", "AbstractSequentialList", "ArrayList");
+ assertPreferredItems(1, "List", "ArrayList", "AbstractList", "AbstractSequentialList");
incUseCount(lookup, 0);
- assertPreferredItems(0, "List", "AbstractList", "AbstractSequentialList", "ArrayList");
+ assertPreferredItems(0, "List", "ArrayList", "AbstractList", "AbstractSequentialList");
}
public void testPreferNonRecursiveMethodParams() throws Throwable {
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java
index ed2b792..d2e8825 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java
@@ -1029,6 +1029,19 @@
assertStringItems("Bar", "Goo");
}
+ public void testAutoImportExpectedType() throws Throwable {
+ boolean old = CodeInsightSettings.getInstance().ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY;
+ CodeInsightSettings.getInstance().ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY = true;
+ try {
+ configureByTestName();
+ performAction();
+ myFixture.assertPreferredCompletionItems(1, "List", "ArrayList", "AbstractList");
+ }
+ finally {
+ CodeInsightSettings.getInstance().ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY = old;
+ }
+ }
+
public void testNoWrongSubstitutorFromStats() throws Throwable {
doTest();
FileDocumentManager.getInstance().saveDocument(myFixture.getEditor().getDocument());
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/LightAdvHighlightingJdk7Test.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/LightAdvHighlightingJdk7Test.java
index a3b6042..d6831d4 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/LightAdvHighlightingJdk7Test.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/LightAdvHighlightingJdk7Test.java
@@ -34,7 +34,6 @@
import com.intellij.psi.PsiElement;
import com.intellij.testFramework.IdeaTestUtil;
import org.jdom.Element;
-import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@@ -44,7 +43,7 @@
* For "heavyweight" tests use AdvHighlightingTest
*/
public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
- @NonNls static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/advHighlighting7";
+ private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/advHighlighting7";
private void doTest(boolean checkWarnings, boolean checkInfos, Class<?>... classes) {
setLanguageLevel(LanguageLevel.JDK_1_7);
@@ -102,12 +101,9 @@
public void testHighlightInaccessibleFromClassModifierList() { doTest(false, false); }
public void testInnerInTypeArguments() { doTest(false, false); }
public void testRawSubstitutor() { doTest(false, false); }
+ public void testIncompleteDiamonds() { doTest(false, false); }
- public void testIncompleteDiamonds() throws Exception {
- doTest(false, false);
- }
-
- public void testDynamicallyAddIgnoredAnnotations() throws Exception {
+ public void testDynamicallyAddIgnoredAnnotations() {
ExtensionPoint<EntryPoint> point = Extensions.getRootArea().getExtensionPoint(ToolExtensionPoints.DEAD_CODE_TOOL);
EntryPoint extension = new EntryPoint() {
@NotNull @Override public String getDisplayName() { return "duh"; }
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MostSpecificResolutionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MostSpecificResolutionTest.java
index 7a73bfe..9bb7d480 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MostSpecificResolutionTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MostSpecificResolutionTest.java
@@ -111,6 +111,10 @@
doTest();
}
+ public void testIDEA127584() throws Exception {
+ doTest();
+ }
+
private void doTest() {
doTest(true);
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java
index 6bd7654..ea9ada9 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -31,214 +31,64 @@
@Override
protected LocalInspectionTool[] configureLocalInspectionTools() {
return new LocalInspectionTool[]{
- new UnusedSymbolLocalInspection(),
+ new UnusedSymbolLocalInspection()
};
}
- public void testIDEA93586() throws Exception {
- doTest();
- }
+ public void testIDEA93586() { doTest(); }
+ public void testIDEA113573() { doTest(); }
+ public void testIDEA112922() { doTest(); }
+ public void testIDEA113504() { doTest(); }
+ public void testAfterAbstractPipeline2() { doTest(); }
+ public void testIDEA116252() { doTest(); }
+ public void testIDEA106670() { doTest(); }
+ public void testIDEA116548() { doTest(); }
+ public void testOverloadResolutionSAM() { doTest(); }
+ public void testIntersectionTypesDuringInference() { doTest(); }
+ public void testIncludeConstraintsWhenParentMethodIsDuringCalculation() { doTest(); }
+ public void testUseCalculatedSubstitutor() { doTest(); }
+ public void testArgumentOfAnonymousClass() { doTest(); }
+ public void testEllipsis() { doTest(); }
+ public void testOuterMethodPropagation() { doTest(); }
+ public void testRecursiveCalls() { doTest(); }
+ public void testGroundTargetTypeForImplicitLambdas() { doTest(); }
+ public void testAdditionalConstraintsReduceOrder() { doTest(); }
+ public void testAdditionalConstraintSubstitution() { doTest(); }
+ public void testFunctionalInterfacesCalculation() { doTest(); }
+ public void testMissedSiteSubstitutorDuringDeepAdditionalConstraintsGathering() { doTest(); }
+ public void testIDEA120992() { doTest(); }
+ public void testTargetTypeConflictResolverShouldNotTryToEvaluateCurrentArgumentType() { doTest(); }
+ public void testIDEA119535() { doTest(); }
+ public void testIDEA119003() { doTest(); }
+ public void testIDEA117124() { doTest(); }
+ public void testWildcardParameterization() { doTest(); }
+ public void testDiamondInLambdaReturn() { doTest(); }
+ public void testIDEA118965() { doTest(); }
+ public void testIDEA121315() { doTest(); }
+ public void testIDEA118965comment() { doTest(); }
+ public void testIDEA122074() { doTest(); }
+ public void testIDEA122084() { doTest(); }
+ public void testAdditionalConstraintDependsOnNonMentionedVars() { doTest(); }
+ public void testIDEA122616() { doTest(); }
+ public void testIDEA122700() { doTest(); }
+ public void testIDEA122406() { doTest(); }
+ public void testNestedCallsInsideLambdaReturnExpression() { doTest(); }
+ public void testIDEA123731() { doTest(); }
+ public void testIDEA123869() { doTest(); }
+ public void testIDEA123848() { doTest(); }
+ public void testOnlyLambdaAtTypeParameterPlace() { doTest(); }
+ public void testLiftedIntersectionType() { doTest(); }
+ public void testInferenceFromReturnStatements() { doTest(); }
+ public void testDownUpThroughLambdaReturnStatements() { doTest(); }
+ public void testIDEA124547() { doTest(); }
+ public void testIDEA118362() { doTest(); }
+ public void testIDEA126056() { doTest(); }
+ public void testIDEA125254() { doTest(); }
+ public void testIDEA124961() { doTest(); }
+ public void testIDEA126109() { doTest(); }
+ public void testIDEA126809() { doTest(); }
- public void testIDEA113573() throws Exception {
- doTest();
- }
-
- public void testIDEA112922() throws Exception {
- doTest();
- }
-
- public void testIDEA113504() throws Exception {
- doTest();
- }
-
- public void testAfterAbstractPipeline2() throws Exception {
- doTest();
- }
-
- public void testIDEA116252() throws Exception {
- doTest();
- }
-
- public void testIDEA106670() throws Exception {
- doTest();
- }
-
- public void testIDEA116548() throws Exception {
- doTest();
- }
-
- public void testOverloadResolutionSAM() throws Exception {
- doTest();
- }
-
- public void testIntersectionTypesDuringInference() throws Exception {
- doTest();
- }
-
- public void testIncludeConstraintsWhenParentMethodIsDuringCalculation() throws Exception {
- doTest();
- }
-
- public void testUseCalculatedSubstitutor() throws Exception {
- doTest();
- }
-
- public void testArgumentOfAnonymousClass() throws Exception {
- doTest();
- }
-
- public void testEllipsis() throws Exception {
- doTest();
- }
-
- public void testOuterMethodPropagation() throws Exception {
- doTest();
- }
-
- public void testRecursiveCalls() throws Exception {
- doTest();
- }
-
- public void testGroundTargetTypeForImplicitLambdas() throws Exception {
- doTest();
- }
-
- public void testAdditionalConstraintsReduceOrder() throws Exception {
- doTest();
- }
-
- public void testAdditionalConstraintSubstitution() throws Exception {
- doTest();
- }
- public void testFunctionalInterfacesCalculation() throws Exception {
- doTest();
- }
-
- public void testMissedSiteSubstitutorDuringDeepAdditionalConstraintsGathering() throws Exception {
- doTest();
- }
-
- public void testIDEA120992() throws Exception {
- doTest();
- }
-
- public void testTargetTypeConflictResolverShouldNotTryToEvaluateCurrentArgumentType() throws Exception {
- doTest();
- }
-
- public void testIDEA119535() throws Exception {
- doTest();
- }
-
- public void testIDEA119003() throws Exception {
- doTest();
- }
-
- public void testIDEA117124() throws Exception {
- doTest();
- }
-
- public void testWildcardParameterization() throws Exception {
- doTest();
- }
-
- public void testDiamondInLambdaReturn() throws Exception {
- doTest();
- }
-
- public void testIDEA118965() throws Exception {
- doTest();
- }
-
- public void testIDEA121315() throws Exception {
- doTest();
- }
-
- public void testIDEA118965comment() throws Exception {
- doTest();
- }
-
- public void testIDEA122074() throws Exception {
- doTest();
- }
-
- public void testIDEA122084() throws Exception {
- doTest();
- }
-
- public void testAdditionalConstraintDependsOnNonMentionedVars() throws Exception {
- doTest();
- }
-
- public void testIDEA122616() throws Exception {
- doTest();
- }
-
- public void testIDEA122700() throws Exception {
- doTest();
- }
-
- public void testIDEA122406() throws Exception {
- doTest();
- }
-
- public void testNestedCallsInsideLambdaReturnExpression() throws Exception {
- doTest();
- }
-
- public void testIDEA123731() throws Exception {
- doTest();
- }
-
- public void testIDEA123869() throws Exception {
- doTest();
- }
-
- public void testIDEA123848() throws Exception {
- doTest();
- }
-
- public void testOnlyLambdaAtTypeParameterPlace() throws Exception {
- doTest();
- }
-
- public void testLiftedIntersectionType() throws Exception {
- doTest();
- }
-
- public void testInferenceFromReturnStatements() throws Exception {
- doTest();
- }
-
- public void testDownUpThroughLambdaReturnStatements() throws Exception {
- doTest();
- }
-
- public void testIDEA124547() throws Exception {
- doTest();
- }
-
- public void testIDEA118362() throws Exception {
- doTest();
- }
-
- public void testIDEA126056() throws Exception {
- doTest();
- }
-
- public void testIDEA125254() throws Exception {
- doTest();
- }
-
- public void testIDEA124961() throws Exception {
- doTest();
- }
-
- public void testIDEA126109() throws Exception {
- doTest();
- }
-
- public void testIDEA126809() throws Exception {
+ public void testIDEA127596() throws Exception {
doTest();
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java
index 6860bc0..dd7ceb5 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java
@@ -273,6 +273,14 @@
doTest();
}
+ public void testIDEA126969() throws Exception {
+ doTest();
+ }
+
+ public void testIDEA127506() throws Exception {
+ doTest();
+ }
+
private void doTest() {
doTest(false);
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/CreateFieldFromUsageTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/CreateFieldFromUsageTest.java
index fba0c77..2c5c521 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/CreateFieldFromUsageTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/CreateFieldFromUsageTest.java
@@ -24,6 +24,7 @@
public void testInsideStaticInnerClass() throws Exception { doSingleTest(); }
public void testCreateFromEquals() throws Exception { doSingleTest(); }
public void testCreateFromEqualsToPrimitiveType() throws Exception { doSingleTest(); }
+ public void testInsideInterface() throws Exception { doSingleTest(); }
public void testWithAlignment() throws Exception {
final CommonCodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject()).getCommonSettings(JavaLanguage.INSTANCE);
boolean old = settings.ALIGN_GROUP_FIELD_DECLARATIONS;
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/RenameWrongReferenceTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/RenameWrongReferenceTest.java
index ae2c847..7b19bbd 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/RenameWrongReferenceTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/RenameWrongReferenceTest.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2000-2014 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.codeInsight.daemon.quickFix;
public class RenameWrongReferenceTest extends LightQuickFixAvailabilityTestCase {
@@ -9,4 +24,3 @@
return "/codeInsight/daemonCodeAnalyzer/quickFix/renameWrongReference";
}
}
-
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/folding/JavaFoldingTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/folding/JavaFoldingTest.groovy
index 2047f13..5d823e0 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/folding/JavaFoldingTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/folding/JavaFoldingTest.groovy
@@ -608,7 +608,7 @@
configure(testNow, shouldIgnoreRoots(), fourteen, pi, title, c, file);
}
- pubic void configure(boolean testNow, boolean shouldIgnoreRoots, int times, float pi, String title, char terminate, File file) {
+ pubic void configure(boolean testNow, boolean shouldIgnoreRoots, int times, float pii, String title, char terminate, File file) {
System.out.println();
System.out.println();
}
@@ -672,7 +672,7 @@
assert regions[1].placeholderText == "test: 13"
}
- public void "test inline if argument length is one (EA-57555)"() {
+ public void "test do not inline if parameter length is one or two"() {
def text = """
public class CharSymbol {
@@ -681,7 +681,7 @@
count(1, false);
}
- public void count(int test, boolean fast) {
+ public void count(int t, boolean fa) {
int temp = test;
boolean isFast = fast;
}
@@ -689,13 +689,78 @@
"""
configure text
def regions = myFixture.editor.foldingModel.allFoldRegions.sort { it.startOffset }
+ assert regions.size() == 2
+ }
+
+ public void "test do not inline known subsequent parameter names"() {
+ def text = """
+public class Test {
+ public void main() {
+ test1(1, 2);
+ test2(1, 2);
+ test3(1, 2);
+ doTest("first", "second");
+ }
+
+ public void test1(int first, int second) {
+ int start = first;
+ int end = second;
+ }
+
+ public void test2(int key, int value) {
+ int start = key;
+ int end = value;
+ }
+
+ public void test3(int key, int value) {
+ int start = key;
+ int end = value;
+ }
+}
+"""
+ configure text
+ def regions = myFixture.editor.foldingModel.allFoldRegions
assert regions.size() == 4
+ }
- checkRangeOffsetByPositionInText(regions[1], text, "1")
- assert regions[1].placeholderText == "test: 1"
+ public void "test do not inline paired ranged names"() {
+ def text = """
+public class CharSymbol {
- checkRangeOffsetByPositionInText(regions[2], text, "false")
- assert regions[2].placeholderText == "fast: false"
+ public void main() {
+ String s = "AAA";
+ int last = 3;
+
+ substring1(1, last);
+ substring2(1, last);
+ substring3(1, last);
+ substring4(1, last);
+ }
+
+ public void substring1(int beginIndex, int endIndex) {
+ int start = beginIndex;
+ int end = endIndex;
+ }
+
+ public void substring2(int startIndex, int endIndex) {
+ int start = startIndex;
+ int end = endIndex;
+ }
+
+ public void substring3(int from, int to) {
+ int start = from;
+ int end = to;
+ }
+
+ public void substring4(int first, int last) {
+ int start = first;
+ int end = last;
+ }
+}
+"""
+ configure text
+ def regions = myFixture.editor.foldingModel.allFoldRegions.sort { it.startOffset }
+ assert regions.size() == 5
}
public void "test inline names if literal expression can be assigned to method parameter"() {
@@ -764,7 +829,7 @@
}
abstract class Checker {
- Checker(boolean applyToFirst, boolean applyToSecond) {}
+ Checker(boolean isActive, boolean requestFocus) {}
abstract void test();
}
}
@@ -773,8 +838,8 @@
def regions = myFixture.editor.foldingModel.allFoldRegions.sort { it.startOffset }
assert regions.length == 6
- assert regions[1].placeholderText == "applyToFirst: true"
- assert regions[2].placeholderText == "applyToSecond: false"
+ assert regions[1].placeholderText == "isActive: true"
+ assert regions[2].placeholderText == "requestFocus: false"
checkRangeOffsetByPositionInText(regions[1], text, "true")
checkRangeOffsetByPositionInText(regions[2], text, "false")
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/intention/AddImportActionTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/intention/AddImportActionTest.groovy
index ead75a2..4b169fc 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/intention/AddImportActionTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/intention/AddImportActionTest.groovy
@@ -177,6 +177,66 @@
'''
}
+ public void "test import class in class reference expression"() {
+ myFixture.configureByText 'a.java', '''
+class Test {
+ {
+ equals(Co<caret>llection.class);
+ }
+}
+'''
+ importClass();
+ myFixture.checkResult '''import java.util.Collection;
+
+class Test {
+ {
+ equals(Co<caret>llection.class);
+ }
+}
+'''
+ }
+
+ public void "test import class in qualifier expression"() {
+ myFixture.configureByText 'a.java', '''
+class Test {
+ {
+ equals(Co<caret>llections.emptySet());
+ }
+}
+'''
+ importClass();
+ myFixture.checkResult '''import java.util.Collections;
+
+class Test {
+ {
+ equals(Co<caret>llections.emptySet());
+ }
+}
+'''
+ }
+
+ public void "test don't import class in method call argument"() {
+ myFixture.configureByText 'a.java', '''
+class Test {
+ {
+ equals(Co<caret>llection);
+ }
+}
+'''
+ assert !myFixture.filterAvailableIntentions("Import Class")
+ }
+
+ public void "test don't import class in assignment"() {
+ myFixture.configureByText 'a.java', '''
+class Test {
+ {
+ Co<caret>llection = 2;
+ }
+}
+'''
+ assert !myFixture.filterAvailableIntentions("Import Class")
+ }
+
private def importClass() {
myFixture.launchAction(myFixture.findSingleIntention("Import Class"))
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/javadoc/JavaDocInfoGeneratorTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/javadoc/JavaDocInfoGeneratorTest.java
index 454bb7f..8bac921 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/javadoc/JavaDocInfoGeneratorTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/javadoc/JavaDocInfoGeneratorTest.java
@@ -80,6 +80,10 @@
doTestField();
}
+ public void testAnnotationsInParams() throws Exception {
+ doTestMethod();
+ }
+
public void testLiteral() throws Exception {
doTestField();
}
@@ -88,6 +92,10 @@
doTestField();
}
+ public void testPInsidePre() throws Exception {
+ doTestField();
+ }
+
public void testEnumConstantOrdinal() throws Exception {
PsiClass psiClass = getTestClass();
PsiField field = psiClass.getFields() [0];
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy
index 3acb984..d866ddd 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy
@@ -797,4 +797,30 @@
}
"""
}
+
+ public void "test two static imports"() {
+ myFixture.configureByText "a.java", """
+
+class Foo {
+ {
+ <caret>
+ }
+}
+"""
+ final TemplateManager manager = TemplateManager.getInstance(getProject());
+ final Template template = manager.createTemplate("xxx", "user", 'java.lang.Math.abs(java.lang.Math.PI);');
+ template.setValue(USE_STATIC_IMPORT_IF_POSSIBLE, true);
+
+ startTemplate(template);
+ myFixture.checkResult """\
+import static java.lang.Math.PI;
+import static java.lang.Math.abs;
+
+class Foo {
+ {
+ abs(PI);<caret>
+ }
+}
+"""
+ }
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/template/postfix/templates/CastPostfixTemplateTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/template/postfix/templates/CastPostfixTemplateTest.java
index d5cae6ab3..9a50a6b 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/template/postfix/templates/CastPostfixTemplateTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/template/postfix/templates/CastPostfixTemplateTest.java
@@ -43,4 +43,7 @@
public void testChainCall() {
doTest();
}
+ public void testTernary() {
+ doTest();
+ }
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy b/java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy
index 32982f3..23eac58 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy
@@ -220,12 +220,74 @@
assert c == ['_ -> true']
}
+ public void "test boolean autoboxing"() {
+ def c = inferContracts("""
+ static Object test1(Object o1) {
+ return o1 == null;
+ }""")
+ assert c == []
+ }
+
+ public void "test non-returning delegation"() {
+ def c = inferContracts("""
+ static void test2(Object o) {
+ assertNotNull(o);
+ }
+
+ static boolean assertNotNull(Object o) {
+ if (o == null) {
+ throw new NullPointerException();
+ }
+ return true;
+ }
+ """)
+ assert c == ['null -> fail']
+ }
+
+ public void "test instanceof notnull"() {
+ def c = inferContracts("""
+ public boolean test2(Object o) {
+ if (o != null) {
+ return o instanceof String;
+ } else {
+ return test1(o);
+ }
+ }
+ static boolean test1(Object o1) {
+ return o1 == null;
+ }
+ """)
+ assert c == []
+ }
+
+ public void "test no duplicates in delegation"() {
+ def c = inferContracts("""
+ static boolean test2(Object o1, Object o2) {
+ return test1(o1, o1);
+ }
+ static boolean test1(Object o1, Object o2) {
+ return o1 != null && o2 != null;
+ }
+ """)
+ assert c == ['null, _ -> false', '!null, _ -> true']
+ }
+
+ public void "test take explicit parameter notnull into account"() {
+ def c = inferContracts("""
+ final Object foo(@org.jetbrains.annotations.NotNull Object bar) {
+ if (!(bar instanceof CharSequence)) return null;
+ return new String("abc");
+ }
+ """)
+ assert c == []
+ }
+
private String inferContract(String method) {
return assertOneElement(inferContracts(method))
}
private List<String> inferContracts(String method) {
- def clazz = myFixture.addClass("class Foo { $method }")
+ def clazz = myFixture.addClass("final class Foo { $method }")
return ContractInference.inferContracts(clazz.methods[0]).collect { it as String }
}
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java
index 833b519..4cba2ab 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java
@@ -139,6 +139,12 @@
myFixture.checkResultByFile(getTestName(false) + "_after.java");
}
+ public void testReportConstantReferences_OverloadedCall() {
+ doTestReportConstantReferences();
+ myFixture.launchAction(myFixture.findSingleIntention("Replace with 'null'"));
+ myFixture.checkResultByFile(getTestName(false) + "_after.java");
+ }
+
public void testReportConstantReferencesAfterFinalFieldAccess() { doTestReportConstantReferences(); }
private void doTestReportConstantReferences() {
@@ -148,28 +154,6 @@
myFixture.testHighlighting(true, false, true, getTestName(false) + ".java");
}
- public void _testReportConstantReferences_ReplaceWithString() {
- doTestReportConstantReferences();
- myFixture.launchAction(myFixture.findSingleIntention("Replace with 'CONST'"));
- myFixture.checkResultByFile(getTestName(false) + "_after.java");
- }
- public void _testReportConstantReferences_ReplaceWithIntConstant() {
- doTestReportConstantReferences();
- myFixture.launchAction(myFixture.findSingleIntention("Replace with 'CONST'"));
- myFixture.checkResultByFile(getTestName(false) + "_after.java");
- }
- public void _testReportConstantReferences_ReplaceWithEnum() {
- myFixture.addClass("package foo; public enum MyEnum { FOO }");
- doTestReportConstantReferences();
- myFixture.launchAction(myFixture.findSingleIntention("Replace with 'FOO'"));
- myFixture.checkResultByFile(getTestName(false) + "_after.java");
- }
- public void _testReportConstantReferences_NotInComplexAssignment() {
- doTestReportConstantReferences();
- assertEmpty(myFixture.filterAvailableIntentions("Replace with"));
- }
- public void _testReportConstantReferences_Switch() { doTestReportConstantReferences(); }
-
public void testCheckFieldInitializers() {
doTest();
}
@@ -190,6 +174,7 @@
public void testTransientFinalField() { doTest(); }
public void testFinalFieldDuringInitialization() { doTest(); }
+ public void testFinalFieldDuringSuperInitialization() { doTest(); }
public void _testSymmetricUncheckedCast() { doTest(); } // http://youtrack.jetbrains.com/issue/IDEABKL-6871
public void testNullCheckDoesntAffectUncheckedCast() { doTest(); }
public void testThrowNull() { doTest(); }
@@ -265,6 +250,13 @@
public void testSameComparisonTwice() { doTest(); }
public void testRootThrowableCause() { doTest(); }
+ public void testUseInferredContracts() { doTest(); }
+ public void testContractInferenceBewareOverriding() { doTest(); }
+
+ public void testNumberComparisonsWhenValueIsKnown() { doTest(); }
+
+ public void testAccessingSameArrayElements() { doTest(); }
+
public void testParametersAreNonnullByDefault() {
myFixture.addClass("package javax.annotation; public @interface ParametersAreNonnullByDefault {}");
myFixture.addClass("package javax.annotation; public @interface ParametersAreNullableByDefault {}");
@@ -280,6 +272,29 @@
myFixture.launchAction(myFixture.findSingleIntention("Remove redundant assignment"));
myFixture.checkResultByFile(getTestName(false) + "_after.java");
}
-
+
+ public void testAssertThat() {
+ myFixture.addClass("package org.hamcrest; public class CoreMatchers { " +
+ "public static <T> Matcher<T> notNullValue() {}\n" +
+ "public static <T> Matcher<T> not(Matcher<T> matcher) {}\n" +
+ "public static <T> Matcher<T> equalTo(T operand) {}\n" +
+ "}");
+ myFixture.addClass("package org.hamcrest; public interface Matcher<T> {}");
+ myFixture.addClass("package org.junit; public class Assert { " +
+ "public static <T> void assertThat(T actual, org.hamcrest.Matcher<? super T> matcher) {}\n" +
+ "public static <T> void assertThat(String msg, T actual, org.hamcrest.Matcher<? super T> matcher) {}\n" +
+ "}");
+ myFixture.enableInspections(new DataFlowInspection());
+ myFixture.testHighlighting(true, false, true, getTestName(false) + ".java");
+ }
+
+ public void testGuavaCheckNotNull() {
+ myFixture.addClass("package com.google.common.base; public class Preconditions { " +
+ "public static <T> T checkNotNull(T reference) {}\n" +
+ "}");
+ myFixture.enableInspections(new DataFlowInspection());
+ myFixture.testHighlighting(true, false, true, getTestName(false) + ".java");
+ }
+
public void _testNullCheckBeforeInstanceof() { doTest(); } // http://youtrack.jetbrains.com/issue/IDEA-113220
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/NullableStuffInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/NullableStuffInspectionTest.java
index 843dcbb..e925dd4 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/NullableStuffInspectionTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/NullableStuffInspectionTest.java
@@ -30,6 +30,8 @@
public void testProblems2() throws Exception{ doTest(); }
public void testNullableFieldNotnullParam() throws Exception{ doTest(); }
public void testNotNullFieldNullableParam() throws Exception{ doTest(); }
+ public void testNotNullCustomException() throws Exception{ doTest(); }
+ public void testNotNullFieldNotInitialized() throws Exception{ doTest(); }
public void testGetterSetterProblems() throws Exception{ doTest(); }
public void testOverriddenMethods() throws Exception{
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisIntegrationTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisIntegrationTest.java
new file mode 100644
index 0000000..516b140
--- /dev/null
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisIntegrationTest.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import com.intellij.codeInsight.AnnotationUtil;
+import com.intellij.codeInsight.ExternalAnnotationsManager;
+import com.intellij.codeInsight.InferredAnnotationsManager;
+import com.intellij.openapi.application.ex.PathManagerEx;
+import com.intellij.openapi.projectRoots.Sdk;
+import com.intellij.openapi.projectRoots.SdkModificator;
+import com.intellij.openapi.roots.AnnotationOrderRootType;
+import com.intellij.openapi.roots.ModifiableRootModel;
+import com.intellij.openapi.roots.ModuleRootModificationUtil;
+import com.intellij.openapi.roots.libraries.Library;
+import com.intellij.openapi.roots.libraries.LibraryTable;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VfsUtilCore;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.VirtualFileVisitor;
+import com.intellij.psi.*;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.util.PsiFormatUtil;
+import com.intellij.testFramework.PsiTestUtil;
+import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase;
+import com.intellij.util.AsynchConsumer;
+import org.jetbrains.annotations.Contract;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author lambdamix
+ */
+public class BytecodeAnalysisIntegrationTest extends JavaCodeInsightFixtureTestCase {
+ public static final String ORG_JETBRAINS_ANNOTATIONS_CONTRACT = Contract.class.getName();
+
+ private InferredAnnotationsManager myInferredAnnotationsManager;
+ private ExternalAnnotationsManager myExternalAnnotationsManager;
+
+ private List<String> diffs = new ArrayList<String>();
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ setUpLibraries();
+ setUpExternalUpAnnotations();
+
+ myInferredAnnotationsManager = InferredAnnotationsManager.getInstance(myModule.getProject());
+ myExternalAnnotationsManager = ExternalAnnotationsManager.getInstance(myModule.getProject());
+ }
+
+ private void setUpLibraries() {
+ VirtualFile lib = LocalFileSystem.getInstance().refreshAndFindFileByPath(PathManagerEx.getTestDataPath() + "/../../../lib");
+ assertNotNull(lib);
+ PsiTestUtil.addLibrary(myModule, "velocity", lib.getPath(), new String[]{"/velocity.jar!/"}, new String[]{});
+ }
+
+ private void setUpExternalUpAnnotations() {
+ String annotationsPath = PathManagerEx.getTestDataPath() + "/codeInspection/bytecodeAnalysis/annotations";
+ final VirtualFile annotationsDir = LocalFileSystem.getInstance().refreshAndFindFileByPath(annotationsPath);
+ assertNotNull(annotationsDir);
+
+ ModuleRootModificationUtil.updateModel(myModule, new AsynchConsumer<ModifiableRootModel>() {
+ @Override
+ public void finished() {
+ }
+
+ @Override
+ public void consume(ModifiableRootModel modifiableRootModel) {
+ final LibraryTable libraryTable = modifiableRootModel.getModuleLibraryTable();
+ Library[] libs = libraryTable.getLibraries();
+ for (Library library : libs) {
+ final Library.ModifiableModel libraryModel = library.getModifiableModel();
+ libraryModel.addRoot(annotationsDir, AnnotationOrderRootType.getInstance());
+ libraryModel.commit();
+ }
+ Sdk sdk = modifiableRootModel.getSdk();
+ if (sdk != null) {
+ SdkModificator sdkModificator = sdk.getSdkModificator();
+ sdkModificator.addRoot(annotationsDir, AnnotationOrderRootType.getInstance());
+ sdkModificator.commitChanges();
+ }
+ }
+ });
+
+ VfsUtilCore.visitChildrenRecursively(annotationsDir, new VirtualFileVisitor() { });
+ annotationsDir.refresh(false, true);
+ }
+
+ public void testSdkAndLibAnnotations() {
+
+ final PsiPackage rootPackage = JavaPsiFacade.getInstance(getProject()).findPackage("");
+ assert rootPackage != null;
+
+ final GlobalSearchScope scope = GlobalSearchScope.allScope(getProject());
+ JavaRecursiveElementVisitor visitor = new JavaRecursiveElementVisitor() {
+ @Override
+ public void visitPackage(PsiPackage aPackage) {
+ for (PsiPackage subPackage : aPackage.getSubPackages(scope)) {
+ visitPackage(subPackage);
+ }
+ for (PsiClass aClass : aPackage.getClasses(scope)) {
+ for (PsiMethod method : aClass.getMethods()) {
+ checkMethodAnnotations(method);
+ }
+ }
+ }
+ };
+
+ rootPackage.accept(visitor);
+ assertEmpty(diffs);
+ }
+
+ private void checkMethodAnnotations(PsiMethod method) {
+ try {
+ if (ProjectBytecodeAnalysis.getKey(method) == -1) {
+ return;
+ }
+ }
+ catch (IOException e) {
+ fail();
+ }
+
+ // not null-result
+ String externalOutAnnotation =
+ myExternalAnnotationsManager.findExternalAnnotation(method, AnnotationUtil.NOT_NULL) == null ? "null" : "@NotNull";
+ String inferredOutAnnotation =
+ myInferredAnnotationsManager.findInferredAnnotation(method, AnnotationUtil.NOT_NULL) == null ? "null" : "@NotNull";
+ String methodKey = PsiFormatUtil.getExternalName(method, false, Integer.MAX_VALUE);
+
+ if (!externalOutAnnotation.equals(inferredOutAnnotation)) {
+ diffs.add(methodKey + ": " + externalOutAnnotation + " != " + inferredOutAnnotation);
+ }
+
+ for (PsiParameter parameter : method.getParameterList().getParameters()) {
+ String parameterKey = PsiFormatUtil.getExternalName(parameter, false, Integer.MAX_VALUE);
+ String externalParameterAnnotation =
+ myExternalAnnotationsManager.findExternalAnnotation(parameter, AnnotationUtil.NOT_NULL) == null ? "null" : "@NotNull";
+ String inferredParameterAnnotation =
+ myInferredAnnotationsManager.findInferredAnnotation(parameter, AnnotationUtil.NOT_NULL) == null ? "null" : "@NotNull";
+ if (!externalParameterAnnotation.equals(inferredParameterAnnotation)) {
+ diffs.add(parameterKey + ": " + externalParameterAnnotation + " != " + inferredParameterAnnotation);
+ }
+ }
+
+ PsiAnnotation externalContractAnnotation =
+ myExternalAnnotationsManager.findExternalAnnotation(method, ORG_JETBRAINS_ANNOTATIONS_CONTRACT);
+ PsiAnnotation inferredContractAnnotation =
+ myInferredAnnotationsManager.findInferredAnnotation(method, ORG_JETBRAINS_ANNOTATIONS_CONTRACT);
+
+ String externalContractAnnotationString =
+ externalContractAnnotation == null ? "null" : "@Contract(" + AnnotationUtil.getStringAttributeValue(externalContractAnnotation, null) + ")";
+ String inferredContractAnnotationString =
+ inferredContractAnnotation == null ? "null" : "@Contract(" + AnnotationUtil.getStringAttributeValue(inferredContractAnnotation, null) + ")";
+
+ if (!externalContractAnnotationString.equals(inferredContractAnnotationString)) {
+ diffs.add(methodKey + ": " + externalContractAnnotationString + " != " + inferredContractAnnotationString);
+ }
+
+ }
+
+}
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisResultsHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisResultsHighlightingTest.java
new file mode 100644
index 0000000..dc67871
--- /dev/null
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisResultsHighlightingTest.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import com.intellij.JavaTestUtil;
+import com.intellij.codeInspection.dataFlow.DataFlowInspection;
+import com.intellij.openapi.application.ex.PathManagerEx;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.testFramework.LightProjectDescriptor;
+import com.intellij.testFramework.PsiTestUtil;
+import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author lambdamix
+ */
+public class BytecodeAnalysisResultsHighlightingTest extends LightCodeInsightFixtureTestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ setUpLibraries();
+ }
+
+ @NotNull
+ @Override
+ protected LightProjectDescriptor getProjectDescriptor() {
+ return JAVA_1_7;
+ }
+
+ @Override
+ protected String getTestDataPath() {
+ return JavaTestUtil.getJavaTestDataPath() + "/codeInspection/bytecodeAnalysis/src/";
+ }
+
+ private void doTest() {
+ final DataFlowInspection inspection = new DataFlowInspection();
+ inspection.SUGGEST_NULLABLE_ANNOTATIONS = true;
+ inspection.REPORT_CONSTANT_REFERENCE_VALUES = false;
+ myFixture.enableInspections(inspection);
+ myFixture.testHighlighting(true, false, true, getTestName(false) + ".java");
+ }
+
+ public void testExample() {
+ doTest();
+ }
+
+ private void setUpLibraries() {
+ VirtualFile lib = LocalFileSystem.getInstance().refreshAndFindFileByPath(PathManagerEx.getTestDataPath() + "/../../../lib");
+ assertNotNull(lib);
+ PsiTestUtil.addLibrary(myModule, "velocity", lib.getPath(), new String[]{"/velocity.jar!/"}, new String[]{});
+ }
+}
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisTest.java
new file mode 100644
index 0000000..09fa87f
--- /dev/null
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisTest.java
@@ -0,0 +1,209 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis;
+
+import com.intellij.codeInsight.AnnotationUtil;
+import com.intellij.codeInsight.InferredAnnotationsManager;
+import com.intellij.codeInspection.bytecodeAnalysis.data.*;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.testFramework.PsiTestUtil;
+import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase;
+import com.intellij.util.ArrayUtil;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.org.objectweb.asm.*;
+import org.jetbrains.org.objectweb.asm.tree.MethodNode;
+import org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException;
+import org.junit.Assert;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.util.HashMap;
+
+/**
+ * @author lambdamix
+ */
+public class BytecodeAnalysisTest extends JavaCodeInsightFixtureTestCase {
+ public static final String ORG_JETBRAINS_ANNOTATIONS_CONTRACT = Contract.class.getName();
+ private final String myClassesProjectRelativePath = "/classes/" + Test01.class.getPackage().getName().replace('.', '/');
+ private JavaPsiFacade myJavaPsiFacade;
+ private InferredAnnotationsManager myInferredAnnotationsManager;
+ private BytecodeAnalysisConverter myBytecodeAnalysisConverter;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ myJavaPsiFacade = JavaPsiFacade.getInstance(myModule.getProject());
+ myInferredAnnotationsManager = InferredAnnotationsManager.getInstance(myModule.getProject());
+ myBytecodeAnalysisConverter = BytecodeAnalysisConverter.getInstance();
+
+ setUpDataClasses();
+ }
+
+ public void testInference() throws IOException {
+ checkAnnotations(Test01.class);
+ checkAnnotations(Test02.class);
+ checkAnnotations(Test03.class);
+ }
+
+ public void testConverter() throws IOException {
+ checkCompoundIds(Test01.class);
+ checkCompoundIds(TestConverterData.class);
+ checkCompoundIds(TestConverterData.StaticNestedClass.class);
+ checkCompoundIds(TestConverterData.InnerClass.class);
+ checkCompoundIds(TestConverterData.GenericStaticNestedClass.class);
+ checkCompoundIds(TestAnnotation.class);
+ }
+
+ public void testLeakingParametersAnalysis() throws IOException {
+ checkLeakingParameters(LeakingParametersData.class);
+ }
+
+ private static void checkLeakingParameters(Class<?> jClass) throws IOException {
+ final HashMap<Method, boolean[]> map = new HashMap<Method, boolean[]>();
+
+ // collecting leakedParameters
+ final ClassReader classReader = new ClassReader(new FileInputStream(jClass.getResource("/" + jClass.getName().replace('.', '/') + ".class").getFile()));
+ classReader.accept(new ClassVisitor(Opcodes.ASM5) {
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ final MethodNode node = new MethodNode(Opcodes.ASM5, access, name, desc, signature, exceptions);
+ final Method method = new Method(classReader.getClassName(), name, desc);
+ return new MethodVisitor(Opcodes.ASM5, node) {
+ @Override
+ public void visitEnd() {
+ super.visitEnd();
+ try {
+ map.put(method, cfg.leakingParameters(classReader.getClassName(), node));
+ }
+ catch (AnalyzerException ignore) {}
+ }
+ };
+ }
+ }, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
+
+ for (java.lang.reflect.Method jMethod : jClass.getDeclaredMethods()) {
+ Method method = new Method(Type.getType(jClass).getInternalName(), jMethod.getName(), Type.getMethodDescriptor(jMethod));
+ Annotation[][] annotations = jMethod.getParameterAnnotations();
+ for (int i = 0; i < annotations.length; i++) {
+ boolean isLeaking = false;
+ Annotation[] parameterAnnotations = annotations[i];
+ for (Annotation parameterAnnotation : parameterAnnotations) {
+ if (parameterAnnotation.annotationType() == ExpectLeaking.class) {
+ isLeaking = true;
+ }
+ }
+ assertEquals(method.toString() + " #" + i, isLeaking, map.get(method)[i]);
+ }
+ }
+ }
+
+ private void checkAnnotations(Class<?> javaClass) {
+ PsiClass psiClass = myJavaPsiFacade.findClass(javaClass.getName(), GlobalSearchScope.moduleWithLibrariesScope(myModule));
+ assertNotNull(psiClass);
+
+ for (java.lang.reflect.Method javaMethod : javaClass.getDeclaredMethods()) {
+ PsiMethod psiMethod = psiClass.findMethodsByName(javaMethod.getName(), false)[0];
+ Annotation[][] annotations = javaMethod.getParameterAnnotations();
+
+ // not-null parameters
+ params: for (int i = 0; i < annotations.length; i++) {
+ Annotation[] parameterAnnotations = annotations[i];
+ PsiParameter psiParameter = psiMethod.getParameterList().getParameters()[i];
+ PsiAnnotation inferredAnnotation = myInferredAnnotationsManager.findInferredAnnotation(psiParameter, AnnotationUtil.NOT_NULL);
+ for (Annotation parameterAnnotation : parameterAnnotations) {
+ if (parameterAnnotation.annotationType() == ExpectNotNull.class) {
+ assertNotNull(javaMethod.toString() + " " + i, inferredAnnotation);
+ continue params;
+ }
+ }
+ assertNull(javaMethod.toString() + " " + i, inferredAnnotation);
+ }
+
+ // not-null result
+ ExpectNotNull expectedAnnotation = javaMethod.getAnnotation(ExpectNotNull.class);
+ PsiAnnotation actualAnnotation = myInferredAnnotationsManager.findInferredAnnotation(psiMethod, AnnotationUtil.NOT_NULL);
+ assertEquals(javaMethod.toString(), expectedAnnotation == null, actualAnnotation == null);
+
+
+ // contracts
+ ExpectContract expectedContract = javaMethod.getAnnotation(ExpectContract.class);
+ PsiAnnotation actualContractAnnotation = myInferredAnnotationsManager.findInferredAnnotation(psiMethod, ORG_JETBRAINS_ANNOTATIONS_CONTRACT);
+
+ assertEquals(expectedContract == null, actualContractAnnotation == null);
+
+ if (expectedContract != null) {
+ String expectedContractValue = expectedContract.value();
+ String actualContractValue = AnnotationUtil.getStringAttributeValue(actualContractAnnotation, null);
+ assertEquals(javaMethod.toString(), expectedContractValue, actualContractValue);
+ }
+
+ }
+ }
+
+ private void checkCompoundIds(Class<?> javaClass) throws IOException {
+ String javaClassName = javaClass.getCanonicalName();
+ PsiClass psiClass = myJavaPsiFacade.findClass(javaClassName, GlobalSearchScope.moduleWithLibrariesScope(myModule));
+ assertNotNull(psiClass);
+
+ for (java.lang.reflect.Method javaMethod : javaClass.getDeclaredMethods()) {
+ Method method = new Method(Type.getType(javaClass).getInternalName(), javaMethod.getName(), Type.getMethodDescriptor(javaMethod));
+ boolean noKey = javaMethod.getAnnotation(ExpectNoPsiKey.class) != null;
+ PsiMethod psiMethod = psiClass.findMethodsByName(javaMethod.getName(), false)[0];
+ checkCompoundId(method, psiMethod, noKey);
+ }
+
+ for (Constructor<?> constructor : javaClass.getDeclaredConstructors()) {
+ Method method = new Method(Type.getType(javaClass).getInternalName(), "<init>", Type.getConstructorDescriptor(constructor));
+ boolean noKey = constructor.getAnnotation(ExpectNoPsiKey.class) != null;
+ PsiMethod[] constructors = psiClass.getConstructors();
+ PsiMethod psiMethod = constructors[0];
+ checkCompoundId(method, psiMethod, noKey);
+ }
+ }
+
+ private void checkCompoundId(Method method, PsiMethod psiMethod, boolean noKey) throws IOException {
+ Direction direction = new Out();
+ int psiKey = myBytecodeAnalysisConverter.mkPsiKey(psiMethod, direction);
+ if (noKey) {
+ assertTrue(-1 == psiKey);
+ return;
+ }
+ else {
+ assertFalse(-1 == psiKey);
+ }
+
+ int asmKey = myBytecodeAnalysisConverter.mkAsmKey(new Key(method, direction, true));
+
+ Assert.assertEquals(asmKey, psiKey);
+ }
+
+ private void setUpDataClasses() throws IOException {
+ File classesDir = new File(Test01.class.getResource("/" + Test01.class.getPackage().getName().replace('.', '/')).getFile());
+ File destDir = new File(myModule.getProject().getBaseDir().getPath() + myClassesProjectRelativePath);
+ FileUtil.copyDir(classesDir, destDir);
+ VirtualFile vFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(destDir);
+ assertNotNull(vFile);
+ PsiTestUtil.addLibrary(myModule, "dataClasses", vFile.getPath(), new String[]{""}, ArrayUtil.EMPTY_STRING_ARRAY);
+ }
+
+}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectContract.java
similarity index 62%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
copy to java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectContract.java
index 2a24920..9b78f74 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectContract.java
@@ -13,15 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package com.intellij.codeInspection.bytecodeAnalysis;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author lambdamix
*/
-public class RemoteCancelledException extends com.intellij.remote.RemoteCancelledException {
- public RemoteCancelledException(String s) {
- super(s);
- }
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface ExpectContract {
+ String value() default "";
}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentials.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectLeaking.java
similarity index 72%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentials.java
copy to java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectLeaking.java
index e6be766..3c5ded3 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentials.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectLeaking.java
@@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package com.intellij.codeInspection.bytecodeAnalysis;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author lambdamix
*/
-public interface RemoteCredentials extends com.intellij.remote.RemoteCredentials {
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ExpectLeaking {
}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkData.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectNoPsiKey.java
similarity index 72%
rename from platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkData.java
rename to java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectNoPsiKey.java
index d99ea33..dde06c0 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkData.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectNoPsiKey.java
@@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package com.intellij.codeInspection.bytecodeAnalysis;
-import com.intellij.remote.RemoteSdkCredentials;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author lambdamix
*/
-public interface RemoteSdkData extends RemoteSdkCredentials {
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ExpectNoPsiKey {
}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentials.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectNotNull.java
similarity index 72%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentials.java
copy to java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectNotNull.java
index e6be766..39f1c6e 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentials.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/ExpectNotNull.java
@@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package com.intellij.codeInspection.bytecodeAnalysis;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author lambdamix
*/
-public interface RemoteCredentials extends com.intellij.remote.RemoteCredentials {
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ExpectNotNull {
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/LeakingParametersData.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/LeakingParametersData.java
new file mode 100644
index 0000000..ff5887f
--- /dev/null
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/LeakingParametersData.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis.data;
+
+import com.intellij.codeInspection.bytecodeAnalysis.ExpectLeaking;
+
+/**
+ * @author lambdamix
+ */
+public class LeakingParametersData {
+ int z;
+
+ void test01(@ExpectLeaking Object o1, @ExpectLeaking Object o2, @ExpectLeaking Object o3) {
+ o1.toString();
+ o2.toString();
+ o3.toString();
+ }
+
+ void test02(@ExpectLeaking LeakingParametersData d) {
+ System.out.println(d.z);
+ }
+
+ void test03(int i, @ExpectLeaking LeakingParametersData d) {
+ System.out.println(d.z);
+ }
+
+ void test04(long i, @ExpectLeaking LeakingParametersData d) {
+ System.out.println(d.z);
+ }
+}
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/Test01.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/Test01.java
new file mode 100644
index 0000000..1b90bb6
--- /dev/null
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/Test01.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis.data;
+
+import com.intellij.codeInspection.bytecodeAnalysis.ExpectContract;
+import com.intellij.codeInspection.bytecodeAnalysis.ExpectNotNull;
+
+/**
+ * @author lambdamix
+ */
+public class Test01 {
+ static void f(@ExpectNotNull Object o1, @ExpectNotNull Object o2) {
+ if (o1 == null) throw new NullPointerException();
+ else s(o2, o2);
+ }
+
+ static void g(@ExpectNotNull Object o, boolean b) {
+ if (b) f(o, o);
+ else s(o, o);
+ }
+
+ static void s(@ExpectNotNull Object o1, Object o2) {
+ t(o1);
+ v(o2);
+ }
+
+ static void t(@ExpectNotNull Object o) {
+ o.toString();
+ }
+
+ static void v(Object o) {
+
+ }
+
+ @ExpectContract("null->null")
+ static String toString1(Object o) {
+ return o == null ? null : o.toString();
+ }
+
+ @ExpectContract("null->!null")
+ static String toString2(Object o) {
+ return o == null ? "null" : o.toString();
+ }
+
+ @ExpectNotNull
+ static String constantString() {
+ return "s";
+ }
+
+ @ExpectContract("!null->!null;null->null")
+ static String idString(String s) {
+ return s;
+ }
+
+ @ExpectNotNull
+ public Test01 getThis() {
+ return this;
+ }
+
+ @ExpectNotNull
+ protected Test01 createRoot() {
+ return new Test01();
+ }
+
+}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/Test02.java
similarity index 64%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
copy to java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/Test02.java
index 2a24920..f794ff2 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/Test02.java
@@ -13,15 +13,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package com.intellij.codeInspection.bytecodeAnalysis.data;
+
+import com.intellij.codeInspection.bytecodeAnalysis.ExpectNotNull;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author lambdamix
*/
-public class RemoteCancelledException extends com.intellij.remote.RemoteCancelledException {
- public RemoteCancelledException(String s) {
- super(s);
+public final class Test02 {
+ @ExpectNotNull
+ public String notNullString() {
+ return "";
+ }
+
+ @ExpectNotNull
+ public String notNullStringDelegate() {
+ return notNullString();
}
}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/Test03.java
similarity index 66%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
copy to java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/Test03.java
index 2a24920..9790393 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/Test03.java
@@ -13,15 +13,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package com.intellij.codeInspection.bytecodeAnalysis.data;
+
+import com.intellij.codeInspection.bytecodeAnalysis.ExpectNotNull;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author lambdamix
*/
-public class RemoteCancelledException extends com.intellij.remote.RemoteCancelledException {
- public RemoteCancelledException(String s) {
- super(s);
+public class Test03 {
+
+ public String toString1() {
+ return toString();
+ }
+
+ @Override
+ @ExpectNotNull
+ public String toString() {
+ return "";
}
}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/TestAnnotation.java
similarity index 71%
rename from platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
rename to java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/TestAnnotation.java
index 2a24920..cfe55ff 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/TestAnnotation.java
@@ -13,15 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package com.intellij.codeInspection.bytecodeAnalysis.data;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author lambdamix
*/
-public class RemoteCancelledException extends com.intellij.remote.RemoteCancelledException {
- public RemoteCancelledException(String s) {
- super(s);
- }
+@Retention(RetentionPolicy.RUNTIME)
+public @interface TestAnnotation {
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/TestConverterData.java b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/TestConverterData.java
new file mode 100644
index 0000000..254db418
--- /dev/null
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/bytecodeAnalysis/data/TestConverterData.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2000-2014 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.codeInspection.bytecodeAnalysis.data;
+
+import com.intellij.codeInspection.bytecodeAnalysis.BytecodeAnalysisConverter;
+import com.intellij.codeInspection.bytecodeAnalysis.ExpectNoPsiKey;
+
+/**
+ * @author lambdamix
+ */
+public class TestConverterData {
+
+ public static class StaticNestedClass {
+ public StaticNestedClass(Object o) {
+
+ }
+ public StaticNestedClass[] test01(StaticNestedClass[] ns, StaticNestedClass... ellipsis) {
+ return ns;
+ }
+ }
+
+ public class InnerClass {
+ // a reference to outer class should be inserted when translating PSI -> ASM
+ public InnerClass(Object o) {}
+
+ public InnerClass[] Inner2test01(InnerClass[] tests, InnerClass... ellipsis) {
+ return tests;
+ }
+ }
+
+ public static class GenericStaticNestedClass<A> {
+ public GenericStaticNestedClass(A a) {
+
+ }
+ public GenericStaticNestedClass[] test01(GenericStaticNestedClass[] ns, GenericStaticNestedClass... ellipsis) {
+ return ns;
+ }
+
+ public GenericStaticNestedClass<A>[] test02(GenericStaticNestedClass<A>[] ns, GenericStaticNestedClass<A>... ellipsis) {
+ return ns;
+ }
+
+ public class GenericInnerClass<B> {
+ public GenericInnerClass(B b) {}
+
+ public <C> GenericStaticNestedClass<A> test01(GenericInnerClass<C> c) {
+ return GenericStaticNestedClass.this;
+ }
+ }
+ }
+
+ public TestConverterData(int x) {}
+
+ // BytecodeAnalysisConverter class is not in the project path, so translation from PSI is impossible
+ @ExpectNoPsiKey
+ public BytecodeAnalysisConverter test01(BytecodeAnalysisConverter converter) {
+ return converter;
+ }
+
+ @TestAnnotation
+ public TestConverterData[] test02(@TestAnnotation TestConverterData[] tests) throws Exception {
+ return tests;
+ }
+
+ public boolean[] test03(boolean[] b) {
+ return b;
+ }
+}
diff --git a/java/java-tests/testSrc/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenterTest.java b/java/java-tests/testSrc/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenterTest.java
index 498a117..e9d1da3 100644
--- a/java/java-tests/testSrc/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenterTest.java
+++ b/java/java-tests/testSrc/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenterTest.java
@@ -67,48 +67,48 @@
}
public void testSimpleReturn() throws Exception {
- Class testClass = prepareTest();
+ Class<?> testClass = prepareTest();
Object instance = testClass.newInstance();
Method method = testClass.getMethod("test");
verifyCallThrowsException("@NotNull method SimpleReturn.test must not return null", instance, method);
}
public void testSimpleReturnWithMessage() throws Exception {
- Class testClass = prepareTest();
+ Class<?> testClass = prepareTest();
Object instance = testClass.newInstance();
Method method = testClass.getMethod("test");
verifyCallThrowsException("This method cannot return null", instance, method);
}
public void testMultipleReturns() throws Exception {
- Class testClass = prepareTest();
+ Class<?> testClass = prepareTest();
Object instance = testClass.newInstance();
Method method = testClass.getMethod("test", int.class);
verifyCallThrowsException("@NotNull method MultipleReturns.test must not return null", instance, method, 1);
}
public void testSimpleParam() throws Exception {
- Class testClass = prepareTest();
+ Class<?> testClass = prepareTest();
Object instance = testClass.newInstance();
Method method = testClass.getMethod("test", Object.class);
verifyCallThrowsException("Argument 0 for @NotNull parameter of SimpleParam.test must not be null", instance, method, (Object)null);
}
public void testSimpleParamWithMessage() throws Exception {
- Class testClass = prepareTest();
+ Class<?> testClass = prepareTest();
Object instance = testClass.newInstance();
Method method = testClass.getMethod("test", Object.class);
verifyCallThrowsException("SimpleParamWithMessage.test(o) cant be null", instance, method, (Object)null);
}
public void testConstructorParam() throws Exception {
- Class testClass = prepareTest();
+ Class<?> testClass = prepareTest();
Constructor method = testClass.getConstructor(Object.class);
verifyCallThrowsException("Argument 0 for @NotNull parameter of ConstructorParam.<init> must not be null", null, method, (Object)null);
}
public void testConstructorParamWithMessage() throws Exception {
- Class testClass = prepareTest();
+ Class<?> testClass = prepareTest();
Constructor method = testClass.getConstructor(Object.class);
verifyCallThrowsException("ConstructorParam.ConstructorParam.o cant be null", null, method, (Object)null);
}
@@ -132,6 +132,19 @@
assertNotNull(field);
}
+ public void testCustomExceptionType() throws Exception {
+ Class<?> testClass = prepareTest();
+ try {
+ testClass.getMethod("foo", Object.class, Object.class).invoke(testClass.newInstance(), null, null);
+ fail();
+ }
+ catch (InvocationTargetException e) {
+ //noinspection ThrowableResultOfMethodCallIgnored
+ assertInstanceOf(e.getCause(), NullPointerException.class);
+ assertEquals("Argument 1 for @NotNull parameter of CustomExceptionType.foo must not be null", e.getCause().getMessage());
+ }
+ }
+
public void testEnumConstructorSecondParam() throws Exception {
Class testClass = prepareTest();
Object field = testClass.getField("Value");
diff --git a/java/java-tests/testSrc/com/intellij/find/FindInEditorMultiCaretTest.java b/java/java-tests/testSrc/com/intellij/find/FindInEditorMultiCaretTest.java
new file mode 100644
index 0000000..02f8c589
--- /dev/null
+++ b/java/java-tests/testSrc/com/intellij/find/FindInEditorMultiCaretTest.java
@@ -0,0 +1,222 @@
+/*
+ * Copyright 2000-2014 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.find;
+
+import com.intellij.find.editorHeaderActions.*;
+import com.intellij.openapi.actionSystem.ActionPlaces;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.IdeActions;
+import com.intellij.openapi.util.Getter;
+import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
+
+import javax.swing.text.JTextComponent;
+import java.io.IOException;
+
+public class FindInEditorMultiCaretTest extends LightPlatformCodeInsightFixtureTestCase {
+ public void testBasic() throws IOException {
+ init("abc\n" +
+ "abc\n" +
+ "abc");
+ initFind();
+ setTextToFind("b");
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "abc\n" +
+ "abc");
+ addOccurrence();
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "a<selection>b<caret></selection>c\n" +
+ "abc");
+ nextOccurrence();
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "abc\n" +
+ "a<selection>b<caret></selection>c");
+ prevOccurrence();
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "a<selection>b<caret></selection>c\n" +
+ "abc");
+ removeOccurrence();
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "abc\n" +
+ "abc");
+ allOccurrences();
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "a<selection>b<caret></selection>c\n" +
+ "a<selection>b<caret></selection>c");
+ assertNull(getEditorSearchComponent());
+ }
+
+ public void testActionsWorkFromEditor() throws IOException {
+ init("abc\n" +
+ "abc\n" +
+ "abc");
+ initFind();
+ setTextToFind("b");
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "abc\n" +
+ "abc");
+ addOccurrenceFromEditor();
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "a<selection>b<caret></selection>c\n" +
+ "abc");
+ nextOccurrenceFromEditor();
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "abc\n" +
+ "a<selection>b<caret></selection>c");
+ prevOccurrenceFromEditor();
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "a<selection>b<caret></selection>c\n" +
+ "abc");
+ removeOccurrenceFromEditor();
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "abc\n" +
+ "abc");
+ allOccurrencesFromEditor();
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "a<selection>b<caret></selection>c\n" +
+ "a<selection>b<caret></selection>c");
+ assertNull(getEditorSearchComponent());
+ }
+
+ public void testCloseRetainsMulticaretSelection() throws IOException {
+ init("abc\n" +
+ "abc\n" +
+ "abc");
+ initFind();
+ setTextToFind("b");
+ addOccurrence();
+ closeFind();
+ checkResultByText("a<selection>b<caret></selection>c\n" +
+ "a<selection>b<caret></selection>c\n" +
+ "abc");
+ }
+
+ public void testTextModificationRemovesOldSelections() throws IOException {
+ init("abc\n" +
+ "abc\n" +
+ "abc");
+ initFind();
+ setTextToFind("b");
+ addOccurrence();
+ setTextToFind("bc");
+
+ assertEquals(1, myFixture.getEditor().getCaretModel().getCaretCount());
+ assertEquals("bc", myFixture.getEditor().getSelectionModel().getSelectedText());
+ }
+
+ public void testSecondFindNavigatesToTheSameOccurrence() throws IOException {
+ init("ab<caret>c\n" +
+ "abc\n" +
+ "abc");
+ initFind();
+ setTextToFind("abc");
+ checkResultByText("abc\n" +
+ "<selection>abc<caret></selection>\n" +
+ "abc");
+ closeFind();
+ initFind();
+ setTextToFind("abc");
+ checkResultByText("abc\n" +
+ "<selection>abc<caret></selection>\n" +
+ "abc");
+ }
+
+ private void setTextToFind(String text) {
+ EditorSearchComponent editorSearchComponent = getEditorSearchComponent();
+ assertNotNull(editorSearchComponent);
+ JTextComponent searchField = editorSearchComponent.getSearchField();
+ assertNotNull(searchField);
+ for (int i = 0; i <= text.length(); i++) {
+ searchField.setText(text.substring(0, i)); // emulate typing chars one by one
+ }
+ }
+
+ private void nextOccurrence() {
+ final EditorSearchComponent editorSearchComponent = getEditorSearchComponent();
+ executeAction(new NextOccurrenceAction(editorSearchComponent, new Getter<JTextComponent>() {
+ @Override
+ public JTextComponent get() {
+ return editorSearchComponent.getSearchField();
+ }
+ }));
+ }
+
+ private void prevOccurrence() {
+ final EditorSearchComponent editorSearchComponent = getEditorSearchComponent();
+ executeAction(new PrevOccurrenceAction(editorSearchComponent, new Getter<JTextComponent>() {
+ @Override
+ public JTextComponent get() {
+ return editorSearchComponent.getSearchField();
+ }
+ }));
+ }
+
+ private void addOccurrence() {
+ executeAction(new AddOccurrenceAction(getEditorSearchComponent()));
+ }
+
+ private void removeOccurrence() {
+ executeAction(new RemoveOccurrenceAction(getEditorSearchComponent()));
+ }
+
+ private void allOccurrences() {
+ executeAction(new SelectAllAction(getEditorSearchComponent()));
+ }
+
+ private void nextOccurrenceFromEditor() {
+ myFixture.performEditorAction(IdeActions.ACTION_FIND_NEXT);
+ }
+
+ private void prevOccurrenceFromEditor() {
+ myFixture.performEditorAction(IdeActions.ACTION_FIND_PREVIOUS);
+ }
+
+ private void addOccurrenceFromEditor() {
+ myFixture.performEditorAction(IdeActions.ACTION_SELECT_NEXT_OCCURENCE);
+ }
+
+ private void removeOccurrenceFromEditor() {
+ myFixture.performEditorAction(IdeActions.ACTION_UNSELECT_PREVIOUS_OCCURENCE);
+ }
+
+ private void allOccurrencesFromEditor() {
+ myFixture.performEditorAction(IdeActions.ACTION_SELECT_ALL_OCCURRENCES);
+ }
+
+ private void closeFind() {
+ EditorSearchComponent editorSearchComponent = getEditorSearchComponent();
+ executeAction(new CloseOnESCAction(editorSearchComponent, editorSearchComponent.getSearchField()));
+ }
+
+ private static void executeAction(EditorHeaderAction action) {
+ action.actionPerformed(AnActionEvent.createFromInputEvent(action, null, ActionPlaces.EDITOR_TOOLBAR));
+ }
+
+ private void initFind() {
+ myFixture.performEditorAction("Find");
+ }
+
+ private EditorSearchComponent getEditorSearchComponent() {
+ return (EditorSearchComponent)myFixture.getEditor().getHeaderComponent();
+ }
+
+ private void init(String text) {
+ myFixture.configureByText(getTestName(false) + ".txt", text);
+ }
+
+ private void checkResultByText(String text) {
+ myFixture.checkResult(text);
+ }
+}
diff --git a/java/java-tests/testSrc/com/intellij/find/FindInEditorTest.java b/java/java-tests/testSrc/com/intellij/find/FindInEditorTest.java
index cfe9cdd..043c755f 100644
--- a/java/java-tests/testSrc/com/intellij/find/FindInEditorTest.java
+++ b/java/java-tests/testSrc/com/intellij/find/FindInEditorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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,10 +15,14 @@
*/
package com.intellij.find;
+import com.intellij.codeInsight.hint.EditorHintListener;
import com.intellij.find.impl.livePreview.LivePreview;
import com.intellij.find.impl.livePreview.LivePreviewController;
import com.intellij.find.impl.livePreview.SearchResults;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.project.Project;
import com.intellij.testFramework.LightCodeInsightTestCase;
+import com.intellij.ui.LightweightHint;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
@@ -39,6 +43,13 @@
myOutputStream = new ByteArrayOutputStream();
LivePreview.ourTestOutput = new PrintStream(myOutputStream);
+ EditorHintListener listener = new EditorHintListener() {
+ @Override
+ public void hintShown(Project project, LightweightHint hint, int flags) {
+ LivePreview.processNotFound();
+ }
+ };
+ ApplicationManager.getApplication().getMessageBus().connect(myTestRootDisposable).subscribe(EditorHintListener.TOPIC, listener);
}
private void initFind() {
diff --git a/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java b/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java
index 23895d6..1e3e08a 100644
--- a/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java
+++ b/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java
@@ -188,7 +188,7 @@
}
public void testDirInfos() throws IOException {
- checkInfoNull(myRootVFile);
+ assertNotInProject(myRootVFile);
// beware: files in directory index
checkInfo(myFileLibSrc, null, false, true, "", null, myModule);
@@ -206,21 +206,21 @@
checkInfo(myLibSrcDir, myModule, false, true, "", null, myModule2, myModule3);
checkInfo(myLibClsDir, myModule, true, false, "", null, myModule2, myModule3);
- assertEquals(myLibSrcDir, checkInfoNotNull(myLibSrcDir).getSourceRoot());
+ assertEquals(myLibSrcDir, assertInProject(myLibSrcDir).getSourceRoot());
checkInfo(myModule2Dir, myModule2, false, false, null, null);
checkInfo(mySrcDir2, myModule2, false, false, "", JavaSourceRootType.SOURCE, myModule2, myModule3);
- checkInfoNull(myCvsDir);
- checkInfoNull(myExcludeDir);
- checkInfoNull(myExcludedLibClsDir);
- checkInfoNull(myExcludedLibSrcDir);
+ assertNotInProject(myCvsDir);
+ assertExcluded(myExcludeDir, myModule2);
+ assertExcluded(myExcludedLibClsDir, myModule);
+ assertExcluded(myExcludedLibSrcDir, myModule);
- assertEquals(myModule1Dir, checkInfoNotNull(myLibClsDir).getContentRoot());
+ assertEquals(myModule1Dir, assertInProject(myLibClsDir).getContentRoot());
checkInfo(myModule3Dir, myModule3, false, false, null, null);
VirtualFile cvs = myPack1Dir.createChildDirectory(this, "CVS");
- checkInfoNull(cvs);
+ assertNotInProject(cvs);
assertNull(ProjectRootManager.getInstance(myProject).getFileIndex().getPackageNameByDirectory(cvs));
}
@@ -332,7 +332,7 @@
VirtualFile newDir = myModule1Dir.createChildDirectory(this, "newDir");
myIndex.checkConsistency();
- checkInfoNotNull(newDir);
+ assertInProject(newDir);
final FileTypeManagerEx fileTypeManager = (FileTypeManagerEx)FileTypeManager.getInstance();
final String list = fileTypeManager.getIgnoredFilesList();
@@ -345,7 +345,7 @@
}
});
myIndex.checkConsistency();
- checkInfoNull(newDir);
+ assertNotInProject(newDir);
}
finally {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@@ -354,10 +354,17 @@
fileTypeManager.setIgnoredFilesList(list);
}
});
- checkInfoNotNull(newDir);
+ assertInProject(newDir);
}
}
+ public void testIgnoredFile() throws IOException {
+ VirtualFile ignoredFile = myModule1Dir.createChildData(this, "CVS");
+ DirectoryInfo info = myIndex.getInfoForFile(ignoredFile);
+ assertTrue(info.isIgnored());
+ assertTrue(ProjectRootManager.getInstance(myProject).getFileIndex().isExcluded(ignoredFile));
+ }
+
public void testAddModule() throws Exception {
myIndex.checkConsistency();
@@ -379,16 +386,18 @@
public void testModuleUnderIgnoredDir() throws IOException {
final VirtualFile ignored = myRootVFile.createChildDirectory(this, "RCS");
assertTrue(FileTypeManager.getInstance().isFileIgnored(ignored));
+ assertTrue(ProjectRootManager.getInstance(myProject).getFileIndex().isExcluded(ignored));
final VirtualFile module4 = ignored.createChildDirectory(this, "module4");
assertFalse(FileTypeManager.getInstance().isFileIgnored(module4));
-
+ assertTrue(ProjectRootManager.getInstance(myProject).getFileIndex().isExcluded(module4));
+
new WriteCommandAction.Simple(getProject()) {
@Override
protected void run() throws Throwable {
ModuleManager moduleManager = ModuleManager.getInstance(myProject);
Module module = moduleManager.newModule(myRootVFile.getPath() + "/newModule.iml", StdModuleTypes.JAVA.getId());
PsiTestUtil.addContentRoot(module, module4);
- checkInfoNull(ignored);
+ assertNotInProject(ignored);
checkInfo(module4, module, false, false, null, null);
}
}.execute().throwException();
@@ -418,9 +427,9 @@
public void testExcludedDirsInLibraries() {
ProjectFileIndex index = ProjectRootManager.getInstance(myProject).getFileIndex();
assertFalse(index.isInLibraryClasses(myExcludedLibClsDir));
- assertTrue(index.isIgnored(myExcludedLibClsDir));
+ assertTrue(index.isExcluded(myExcludedLibClsDir));
assertFalse(index.isInLibrarySource(myExcludedLibSrcDir));
- assertTrue(index.isIgnored(myExcludedLibSrcDir));
+ assertTrue(index.isExcluded(myExcludedLibSrcDir));
}
public void testExplicitExcludeOfInner() throws Exception {
@@ -436,20 +445,20 @@
VirtualFile output1 = myModule1Dir.createChildDirectory(this, "output1");
VirtualFile output2 = myModule1Dir.createChildDirectory(this, "output2");
- checkInfoNotNull(output1);
- checkInfoNotNull(output2);
+ assertInProject(output1);
+ assertInProject(output2);
getCompilerProjectExtension().setCompilerOutputUrl(output1.getUrl());
fireRootsChanged();
- checkInfoNull(output1);
- checkInfoNotNull(output2);
+ assertExcluded(output1, myModule);
+ assertInProject(output2);
getCompilerProjectExtension().setCompilerOutputUrl(output2.getUrl());
fireRootsChanged();
- checkInfoNotNull(output1);
- checkInfoNull(output2);
+ assertInProject(output1);
+ assertExcluded(output2, myModule);
}
private void fireRootsChanged() {
@@ -460,12 +469,12 @@
ModuleRootModificationUtil.addModuleLibrary(myModule, "someLib", Collections.<String>emptyList(), Arrays.asList(mySrcDir1.getUrl()));
checkInfo(mySrcDir1, myModule, false, true, "", JavaSourceRootType.SOURCE, myModule, myModule);
- OrderEntry[] entries = myIndex.getInfoForDirectory(mySrcDir1).getOrderEntries();
+ OrderEntry[] entries = myIndex.getInfoForFile(mySrcDir1).getOrderEntries();
assertInstanceOf(entries[0], LibraryOrderEntry.class);
assertInstanceOf(entries[1], ModuleSourceOrderEntry.class);
checkInfo(myTestSrc1, myModule, false, true, "testSrc", JavaSourceRootType.TEST_SOURCE, myModule, myModule);
- entries = myIndex.getInfoForDirectory(myTestSrc1).getOrderEntries();
+ entries = myIndex.getInfoForFile(myTestSrc1).getOrderEntries();
assertInstanceOf(entries[0], LibraryOrderEntry.class);
assertInstanceOf(entries[1], ModuleSourceOrderEntry.class);
}
@@ -473,7 +482,7 @@
public void testModuleSourceAsLibraryClasses() throws Exception {
ModuleRootModificationUtil.addModuleLibrary(myModule, "someLib", Arrays.asList(mySrcDir1.getUrl()), Collections.<String>emptyList());
checkInfo(mySrcDir1, myModule, true, false, "", JavaSourceRootType.SOURCE, myModule);
- assertInstanceOf(assertOneElement(checkInfoNotNull(mySrcDir1).getOrderEntries()), ModuleSourceOrderEntry.class);
+ assertInstanceOf(assertOneElement(assertInProject(mySrcDir1).getOrderEntries()), ModuleSourceOrderEntry.class);
}
public void testModulesWithSameSourceContentRoot() {
@@ -487,7 +496,7 @@
checkInfo(myResDir, myModule, false, false, "", JavaResourceRootType.RESOURCE, myModule);
checkInfo(mySrcDir2, myModule2, false, false, "", JavaSourceRootType.SOURCE, myModule2, myModule3);
- assertEquals(myModule2Dir, myIndex.getInfoForDirectory(mySrcDir2).getContentRoot());
+ assertEquals(myModule2Dir, myIndex.getInfoForFile(mySrcDir2).getContentRoot());
}
public void testModuleWithSameSourceRoot() {
@@ -503,7 +512,7 @@
public void testSameSourceAndOutput() {
PsiTestUtil.setCompilerOutputPath(myModule, mySrcDir1.getUrl(), false);
- checkInfoNull(mySrcDir1);
+ assertExcluded(mySrcDir1, myModule);
}
public void testExcludedDirShouldBeExcludedRightAfterItsCreation() throws Exception {
@@ -512,10 +521,10 @@
VirtualFile module2Output = myModule1Dir.createChildDirectory(this, "module2Output");
VirtualFile module2TestOutput = myModule2Dir.createChildDirectory(this, "module2TestOutput");
- checkInfoNotNull(excluded);
- checkInfoNotNull(projectOutput);
- checkInfoNotNull(module2Output);
- checkInfoNotNull(module2TestOutput);
+ assertInProject(excluded);
+ assertInProject(projectOutput);
+ assertInProject(module2Output);
+ assertInProject(module2TestOutput);
getCompilerProjectExtension().setCompilerOutputUrl(projectOutput.getUrl());
@@ -524,15 +533,10 @@
PsiTestUtil.setCompilerOutputPath(myModule2, module2TestOutput.getUrl(), true);
PsiTestUtil.setExcludeCompileOutput(myModule2, true);
- checkInfoNull(excluded);
- checkInfoNull(projectOutput);
- checkInfoNull(module2Output);
- checkInfoNull(module2TestOutput);
-
- assertFalse(myIndex.isProjectExcludeRoot(excluded));
- assertFalse(myIndex.isProjectExcludeRoot(projectOutput));
- assertFalse(myIndex.isProjectExcludeRoot(module2Output));
- assertFalse(myIndex.isProjectExcludeRoot(module2TestOutput));
+ assertExcluded(excluded, myModule);
+ assertExcluded(projectOutput, myModule);
+ assertExcluded(module2Output, myModule);
+ assertExcluded(module2TestOutput, myModule2);
excluded.delete(this);
projectOutput.delete(this);
@@ -544,46 +548,26 @@
@Override
public void fileCreated(@NotNull VirtualFileEvent e) {
VirtualFile file = e.getFile();
- checkInfoNull(file);
- created.add(file);
-
String fileName = e.getFileName();
- if (fileName.equals("projectOutput")) {
- assertFalse(myIndex.isProjectExcludeRoot(file));
- }
- if (fileName.equals("module2Output")) {
- assertFalse(myIndex.isProjectExcludeRoot(file));
- }
- if (fileName.equals("module2TestOutput")) {
- assertFalse(myIndex.isProjectExcludeRoot(file));
- }
+ assertExcluded(file, fileName.contains("module2TestOutput") ? myModule2 : myModule);
+ created.add(file);
}
};
VirtualFileManager.getInstance().addVirtualFileListener(l, getTestRootDisposable());
excluded = myModule1Dir.createChildDirectory(this, excluded.getName());
- assertFalse(myIndex.isProjectExcludeRoot(excluded));
-
- projectOutput = myModule1Dir.createChildDirectory(this, projectOutput.getName());
- assertFalse(myIndex.isProjectExcludeRoot(projectOutput));
-
- module2Output = myModule1Dir.createChildDirectory(this, module2Output.getName());
- assertFalse(myIndex.isProjectExcludeRoot(module2Output));
-
- module2TestOutput = myModule2Dir.createChildDirectory(this, module2TestOutput.getName());
- assertFalse(myIndex.isProjectExcludeRoot(module2TestOutput));
+ assertExcluded(excluded, myModule);
- checkInfoNull(excluded);
- checkInfoNull(projectOutput);
- checkInfoNull(module2Output);
- checkInfoNull(module2TestOutput);
+ projectOutput = myModule1Dir.createChildDirectory(this, projectOutput.getName());
+ assertExcluded(projectOutput, myModule);
+
+ module2Output = myModule1Dir.createChildDirectory(this, module2Output.getName());
+ assertExcluded(module2Output, myModule);
+
+ module2TestOutput = myModule2Dir.createChildDirectory(this, module2TestOutput.getName());
+ assertExcluded(module2TestOutput, myModule2);
assertEquals(created.toString(), 4, created.size());
-
- assertFalse(myIndex.isProjectExcludeRoot(excluded));
- assertFalse(myIndex.isProjectExcludeRoot(projectOutput));
- assertFalse(myIndex.isProjectExcludeRoot(module2Output));
- assertFalse(myIndex.isProjectExcludeRoot(module2TestOutput));
}
public void testExcludesShouldBeRecognizedRightOnRefresh() throws Exception {
@@ -607,9 +591,9 @@
assertEquals("dir", e.getFileName());
VirtualFile file = e.getFile();
- checkInfoNotNull(file);
- checkInfoNull(file.findFileByRelativePath("excluded"));
- checkInfoNull(file.findFileByRelativePath("excluded/foo"));
+ assertInProject(file);
+ assertExcluded(file.findFileByRelativePath("excluded"), myModule);
+ assertExcluded(file.findFileByRelativePath("excluded/foo"), myModule);
}
};
@@ -638,8 +622,8 @@
});
- checkInfoNull(LocalFileSystem.getInstance().findFileByIoFile(f.getParentFile().getParentFile()));
- checkInfoNotNull(LocalFileSystem.getInstance().findFileByIoFile(f));
+ assertExcluded(LocalFileSystem.getInstance().findFileByIoFile(f.getParentFile().getParentFile()), myModule);
+ assertInProject(LocalFileSystem.getInstance().findFileByIoFile(f));
}
public void testLibraryDirInContent() throws Exception {
@@ -661,7 +645,7 @@
checkInfo(myLibSrcDir, myModule, true, true, "", null, myModule, myModule3);
checkInfo(myResDir, myModule, true, false, "", JavaResourceRootType.RESOURCE, myModule);
- assertInstanceOf(assertOneElement(checkInfoNotNull(myResDir).getOrderEntries()), ModuleSourceOrderEntry.class);
+ assertInstanceOf(assertOneElement(assertInProject(myResDir).getOrderEntries()), ModuleSourceOrderEntry.class);
checkInfo(myExcludedLibSrcDir, null, true, false, "lib.src.exc", null, myModule3, myModule);
checkInfo(myExcludedLibClsDir, null, true, false, "lib.cls.exc", null, myModule3);
@@ -678,11 +662,11 @@
public void testExcludeCompilerOutputOutsideOfContentRoot() throws Exception {
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
- assertTrue(fileIndex.isIgnored(myOutputDir));
- assertTrue(fileIndex.isIgnored(myModule1OutputDir));
- assertFalse(fileIndex.isIgnored(myOutputDir.getParent()));
- assertTrue(myIndex.isProjectExcludeRoot(myOutputDir));
- assertFalse(myIndex.isProjectExcludeRoot(myModule1OutputDir));
+ assertTrue(fileIndex.isExcluded(myOutputDir));
+ assertTrue(fileIndex.isExcluded(myModule1OutputDir));
+ assertFalse(fileIndex.isExcluded(myOutputDir.getParent()));
+ assertExcludedFromProject(myOutputDir);
+ assertExcludedFromProject(myModule1OutputDir);
String moduleOutputUrl = myModule1OutputDir.getUrl();
myOutputDir.delete(this);
@@ -691,9 +675,9 @@
myOutputDir = myRootVFile.createChildDirectory(this, "out");
myModule1OutputDir = myOutputDir.createChildDirectory(this, "module1");
- assertTrue(myIndex.isProjectExcludeRoot(myOutputDir));
- assertTrue(myIndex.isProjectExcludeRoot(myModule1OutputDir));
- assertTrue(fileIndex.isIgnored(myModule1OutputDir));
+ assertExcludedFromProject(myOutputDir);
+ assertExcludedFromProject(myModule1OutputDir);
+ assertTrue(fileIndex.isExcluded(myModule1OutputDir));
PsiTestUtil.setCompilerOutputPath(myModule, moduleOutputUrl, true);
PsiTestUtil.setCompilerOutputPath(myModule2, moduleOutputUrl, false);
@@ -702,20 +686,20 @@
PsiTestUtil.setCompilerOutputPath(myModule3, moduleOutputUrl, true);
// now no module inherits project output dir, but it still should be project-excluded
- assertTrue(myIndex.isProjectExcludeRoot(myOutputDir));
+ assertExcludedFromProject(myOutputDir);
// project output inside module content shouldn't be projectExcludeRoot
VirtualFile projectOutputUnderContent = myModule1Dir.createChildDirectory(this, "projectOutputUnderContent");
getCompilerProjectExtension().setCompilerOutputUrl(projectOutputUnderContent.getUrl());
fireRootsChanged();
- assertFalse(myIndex.isProjectExcludeRoot(myOutputDir));
- assertFalse(myIndex.isProjectExcludeRoot(projectOutputUnderContent));
-
+ assertNotExcluded(myOutputDir);
+ assertExcluded(projectOutputUnderContent, myModule);
+
projectOutputUnderContent.delete(this);
projectOutputUnderContent = myModule1Dir.createChildDirectory(this, "projectOutputUnderContent");
- assertFalse(myIndex.isProjectExcludeRoot(myOutputDir));
- assertFalse(myIndex.isProjectExcludeRoot(projectOutputUnderContent));
+ assertNotExcluded(myOutputDir);
+ assertExcluded(projectOutputUnderContent, myModule);
}
public void testFileContentAndSourceRoots() throws IOException {
@@ -725,7 +709,7 @@
VirtualFile fileSourceRoot = myRootVFile.createChildData(this, "fileSourceRoot.txt");
VirtualFile fileTestSourceRoot = myRootVFile.createChildData(this, "fileTestSourceRoot.txt");
- checkInfoNull(fileRoot);
+ assertNotInProject(fileRoot);
assertFalse(fileIndex.isInContent(fileRoot));
assertIteratedContent(fileIndex, null, Arrays.asList(fileRoot, fileSourceRoot, fileTestSourceRoot));
@@ -758,7 +742,7 @@
// removing file content root
PsiTestUtil.removeContentEntry(myModule, contentEntry);
- checkInfoNull(fileRoot);
+ assertNotInProject(fileRoot);
assertFalse(fileIndex.isInContent(fileRoot));
assertFalse(fileIndex.isInSource(fileRoot));
assertIteratedContent(fileIndex, Arrays.asList(fileSourceRoot, fileTestSourceRoot), Arrays.asList(fileRoot));
@@ -785,7 +769,6 @@
VirtualFile fileSourceRoot = myModule1Dir.createChildData(this, "fileSourceRoot.txt");
assertTrue(fileIndex.isInContent(fileSourceRoot));
assertFalse(fileIndex.isInSource(fileSourceRoot));
- checkInfoNull(fileSourceRoot);
PsiTestUtil.addSourceRoot(myModule, fileSourceRoot);
assertTrue(fileIndex.isInContent(fileSourceRoot));
@@ -796,7 +779,6 @@
PsiTestUtil.removeSourceRoot(myModule, fileSourceRoot);
assertTrue(fileIndex.isInContent(fileSourceRoot));
assertFalse(fileIndex.isInSource(fileSourceRoot));
- checkInfoNull(fileSourceRoot);
}
public void testFileModuleExcludeRootUnderDirectoryRoot() throws IOException {
@@ -805,20 +787,18 @@
VirtualFile fileExcludeRoot = mySrcDir1.createChildData(this, "fileExcludeRoot.txt");
assertTrue(fileIndex.isInContent(fileExcludeRoot));
assertTrue(fileIndex.isInSource(fileExcludeRoot));
- checkInfoNull(fileExcludeRoot);
assertIteratedContent(fileIndex, Arrays.asList(fileExcludeRoot), null);
PsiTestUtil.addExcludedRoot(myModule, fileExcludeRoot);
assertFalse(fileIndex.isInContent(fileExcludeRoot));
assertFalse(fileIndex.isInSource(fileExcludeRoot));
- checkInfoNull(fileExcludeRoot);
+ assertExcluded(fileExcludeRoot, myModule);
assertIteratedContent(fileIndex, null, Arrays.asList(fileExcludeRoot));
// removing file exclude root
PsiTestUtil.removeExcludedRoot(myModule, fileExcludeRoot);
assertTrue(fileIndex.isInContent(fileExcludeRoot));
assertTrue(fileIndex.isInSource(fileExcludeRoot));
- checkInfoNull(fileExcludeRoot);
assertIteratedContent(fileIndex, Arrays.asList(fileExcludeRoot), null);
}
@@ -833,7 +813,7 @@
PsiTestUtil.addExcludedRoot(myModule, fileRoot);
assertFalse(fileIndex.isInContent(fileRoot));
- checkInfoNull(fileRoot);
+ assertExcluded(fileRoot, myModule);
assertIteratedContent(fileIndex, null, Arrays.asList(fileRoot));
// removing file exclude root
@@ -860,7 +840,7 @@
VirtualFile temp = myRootVFile.createChildDirectory(this, "temp");
VirtualFile fileSourceRoot = myRootVFile.createChildData(this, "fileSourceRoot.txt");
- checkInfoNull(fileSourceRoot);
+ assertNotInProject(fileSourceRoot);
PsiTestUtil.addContentRoot(myModule, fileSourceRoot);
PsiTestUtil.addSourceRoot(myModule, fileSourceRoot);
@@ -870,7 +850,7 @@
// delete and recreate
fileSourceRoot.delete(this);
- checkInfoNull(fileSourceRoot);
+ assertNotInProject(fileSourceRoot);
assertFalse(fileIndex.isInContent(fileSourceRoot));
assertFalse(fileIndex.isInSource(fileSourceRoot));
fileSourceRoot = myRootVFile.createChildData(this, "fileSourceRoot.txt");
@@ -880,11 +860,11 @@
// delete and move from another dir
fileSourceRoot.delete(this);
- checkInfoNull(fileSourceRoot);
+ assertNotInProject(fileSourceRoot);
assertFalse(fileIndex.isInContent(fileSourceRoot));
assertFalse(fileIndex.isInSource(fileSourceRoot));
fileSourceRoot = temp.createChildData(this, "fileSourceRoot.txt");
- checkInfoNull(fileSourceRoot);
+ assertNotInProject(fileSourceRoot);
fileSourceRoot.move(this, myRootVFile);
checkInfo(fileSourceRoot, myModule, false, false, "", JavaSourceRootType.SOURCE, myModule);
assertTrue(fileIndex.isInContent(fileSourceRoot));
@@ -892,11 +872,11 @@
// delete and copy from another dir
fileSourceRoot.delete(this);
- checkInfoNull(fileSourceRoot);
+ assertNotInProject(fileSourceRoot);
assertFalse(fileIndex.isInContent(fileSourceRoot));
assertFalse(fileIndex.isInSource(fileSourceRoot));
fileSourceRoot = temp.createChildData(this, "fileSourceRoot.txt");
- checkInfoNull(fileSourceRoot);
+ assertNotInProject(fileSourceRoot);
fileSourceRoot = fileSourceRoot.copy(this, myRootVFile, "fileSourceRoot.txt");
checkInfo(fileSourceRoot, myModule, false, false, "", JavaSourceRootType.SOURCE, myModule);
assertTrue(fileIndex.isInContent(fileSourceRoot));
@@ -904,25 +884,25 @@
// delete and rename from another file
fileSourceRoot.delete(this);
- checkInfoNull(fileSourceRoot);
+ assertNotInProject(fileSourceRoot);
assertFalse(fileIndex.isInContent(fileSourceRoot));
assertFalse(fileIndex.isInSource(fileSourceRoot));
fileSourceRoot = myRootVFile.createChildData(this, "temp_file.txt");
- checkInfoNull(fileSourceRoot);
+ assertNotInProject(fileSourceRoot);
fileSourceRoot.rename(this, "fileSourceRoot.txt");
checkInfo(fileSourceRoot, myModule, false, false, "", JavaSourceRootType.SOURCE, myModule);
assertTrue(fileIndex.isInContent(fileSourceRoot));
assertTrue(fileIndex.isInSource(fileSourceRoot));
}
- private void checkInfo(VirtualFile dir,
+ private void checkInfo(VirtualFile file,
@Nullable Module module,
boolean isInLibrary,
boolean isInLibrarySource,
@Nullable String packageName,
@Nullable final JpsModuleSourceRootType<?> moduleSourceRootType,
Module... modulesOfOrderEntries) {
- DirectoryInfo info = checkInfoNotNull(dir);
+ DirectoryInfo info = assertInProject(file);
assertEquals(module, info.getModule());
if (moduleSourceRootType != null) {
assertTrue("isInModuleSource", info.isInModuleSource());
@@ -935,8 +915,8 @@
assertEquals(isInLibrarySource, info.isInLibrarySource());
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
- if (dir.isDirectory()) {
- assertEquals(packageName, fileIndex.getPackageNameByDirectory(dir));
+ if (file.isDirectory()) {
+ assertEquals(packageName, fileIndex.getPackageNameByDirectory(file));
}
assertEquals(Arrays.toString(info.getOrderEntries()), modulesOfOrderEntries.length, info.getOrderEntries().length);
@@ -946,16 +926,33 @@
}
}
- private void checkInfoNull(VirtualFile dir) {
- assertNull(myIndex.getInfoForDirectory(dir));
+ private void assertNotInProject(VirtualFile file) {
+ DirectoryInfo info = myIndex.getInfoForFile(file);
+ assertFalse(info.toString(), info.isInProject());
+ assertFalse(info.toString(), info.isExcluded());
}
- private DirectoryInfo checkInfoNotNull(VirtualFile output2) {
- DirectoryInfo info = myIndex.getInfoForDirectory(output2);
- assertNotNull(output2.toString(), info);
+
+ private void assertExcluded(VirtualFile file, Module module) {
+ DirectoryInfo info = myIndex.getInfoForFile(file);
+ assertTrue(info.toString(), info.isExcluded());
+ assertEquals(module, info.getModule());
+ }
+
+ private DirectoryInfo assertInProject(VirtualFile file) {
+ DirectoryInfo info = myIndex.getInfoForFile(file);
+ assertTrue(file.toString(), info.isInProject());
info.assertConsistency();
return info;
}
+ private void assertNotExcluded(VirtualFile file) {
+ assertFalse(myIndex.getInfoForFile(file).isExcluded());
+ }
+
+ private void assertExcludedFromProject(VirtualFile file) {
+ assertExcluded(file, null);
+ }
+
private void checkPackage(String packageName, boolean includeLibrarySources, VirtualFile... expectedDirs) {
VirtualFile[] actualDirs = myIndex.getDirectoriesByPackageName(packageName, includeLibrarySources).toArray(VirtualFile.EMPTY_ARRAY);
assertNotNull(actualDirs);
diff --git a/java/java-tests/testSrc/com/intellij/psi/CodeFragmentsTest.java b/java/java-tests/testSrc/com/intellij/psi/CodeFragmentsTest.java
index 8f69568..dd0611f 100644
--- a/java/java-tests/testSrc/com/intellij/psi/CodeFragmentsTest.java
+++ b/java/java-tests/testSrc/com/intellij/psi/CodeFragmentsTest.java
@@ -1,6 +1,10 @@
package com.intellij.psi;
import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.roots.ex.ProjectRootManagerEx;
+import com.intellij.openapi.util.EmptyRunnable;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.testFramework.LightVirtualFile;
import com.intellij.testFramework.PlatformTestCase;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.PsiTestCase;
@@ -30,4 +34,15 @@
PlatformTestUtil.tryGcSoftlyReachableObjects();
assertEquals("ab", PsiDocumentManager.getInstance(myProject).getDocument(fragment).getText());
}
+
+ public void testDontRecreateFragmentPsi() {
+ PsiExpressionCodeFragment fragment = JavaCodeFragmentFactory.getInstance(myProject).createExpressionCodeFragment("a", null, null, true);
+ VirtualFile file = fragment.getViewProvider().getVirtualFile();
+ assertInstanceOf(file, LightVirtualFile.class);
+
+ ProjectRootManagerEx.getInstanceEx(getProject()).makeRootsChange(EmptyRunnable.getInstance(), false, true);
+
+ assertSame(fragment, PsiManager.getInstance(myProject).findFile(file));
+ assertTrue(fragment.isValid());
+ }
}
diff --git a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterBlankLinesTest.java b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterBlankLinesTest.java
index bf11a58..fe005a8 100644
--- a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterBlankLinesTest.java
+++ b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterBlankLinesTest.java
@@ -400,4 +400,36 @@
"}"
);
}
+
+ public void testIDEA126836() {
+ doTextTest(
+ "public class JavaClass { // comment\n" +
+ " public void doSomething() {\n" +
+ " int a = 3;\n" +
+ " }\n" +
+ "}",
+ "public class JavaClass { // comment\n" +
+ " public void doSomething() {\n" +
+ " int a = 3;\n" +
+ " }\n" +
+ "}"
+ );
+ }
+
+ public void testBlankLinesAfterClassHeaderWithComment() {
+ getSettings().BLANK_LINES_AFTER_CLASS_HEADER = 5;
+ doTextTest(
+ "public class JavaClass { // comment\n" +
+ " public void doSomething() {\n" +
+ " int a = 3;\n" +
+ " }\n" +
+ "}",
+ "public class JavaClass { // comment\n" +
+ "\n\n\n\n\n" +
+ " public void doSomething() {\n" +
+ " int a = 3;\n" +
+ " }\n" +
+ "}"
+ );
+ }
}
diff --git a/java/java-tests/testSrc/com/intellij/refactoring/PullUpTest.java b/java/java-tests/testSrc/com/intellij/refactoring/PullUpTest.java
index f0d4e77..665afec 100644
--- a/java/java-tests/testSrc/com/intellij/refactoring/PullUpTest.java
+++ b/java/java-tests/testSrc/com/intellij/refactoring/PullUpTest.java
@@ -163,6 +163,9 @@
public void testPreserveOverride() {
doTest(false, new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class));
}
+ public void testAsDefaultMethodOverAbstract() {
+ doTest(false, "Class <b><code>Test.Printer</code></b> already contains a method <b><code>foo()</code></b>", new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class));
+ }
public void testPublicMethodFromPrivateClassConflict() {
doTest(false, new RefactoringTestUtil.MemberDescriptor("HM", PsiClass.class), new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class));
diff --git a/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineMethodTest.java b/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineMethodTest.java
index 99de5eb..922d5e0 100644
--- a/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineMethodTest.java
+++ b/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineMethodTest.java
@@ -268,6 +268,10 @@
doTest();
}
+ public void testThisNameConflict() throws Exception {
+ doTest();
+ }
+
private void doTestInlineThisOnly() {
@NonNls String fileName = "/refactoring/inlineMethod/" + getTestName(false) + ".java";
configureByFile(fileName);
diff --git a/java/jdkAnnotations/java/text/annotations.xml b/java/jdkAnnotations/java/text/annotations.xml
index 96eb67c..32b437d 100644
--- a/java/jdkAnnotations/java/text/annotations.xml
+++ b/java/jdkAnnotations/java/text/annotations.xml
@@ -93,5 +93,17 @@
<item name='java.text.SimpleDateFormat void setDateFormatSymbols(java.text.DateFormatSymbols) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
+ <item name='java.text.StringCharacterIterator StringCharacterIterator(java.lang.String) 0'>
+ <annotation name='org.jetbrains.annotations.NotNull'/>
+ </item>
+ <item name='java.text.StringCharacterIterator StringCharacterIterator(java.lang.String, int) 0'>
+ <annotation name='org.jetbrains.annotations.NotNull'/>
+ </item>
+ <item name='java.text.StringCharacterIterator StringCharacterIterator(java.lang.String, int, int, int) 0'>
+ <annotation name='org.jetbrains.annotations.NotNull'/>
+ </item>
+ <item name='java.text.StringCharacterIterator void setText(java.lang.String) 0'>
+ <annotation name='org.jetbrains.annotations.NotNull'/>
+ </item>
</root>
diff --git a/java/mockJDK-1.7/jre/lib/annotations.jar b/java/mockJDK-1.7/jre/lib/annotations.jar
index 22b47ab..d96bb1d 100644
--- a/java/mockJDK-1.7/jre/lib/annotations.jar
+++ b/java/mockJDK-1.7/jre/lib/annotations.jar
Binary files differ
diff --git a/java/openapi/src/com/intellij/ui/classFilter/ClassFilter.java b/java/openapi/src/com/intellij/ui/classFilter/ClassFilter.java
index 7521d3b..05500e3 100644
--- a/java/openapi/src/com/intellij/ui/classFilter/ClassFilter.java
+++ b/java/openapi/src/com/intellij/ui/classFilter/ClassFilter.java
@@ -17,20 +17,15 @@
package com.intellij.ui.classFilter;
import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.util.DefaultJDOMExternalizer;
-import com.intellij.openapi.util.InvalidDataException;
-import com.intellij.openapi.util.JDOMExternalizable;
-import com.intellij.openapi.util.WriteExternalException;
import com.intellij.util.xmlb.annotations.Attribute;
import com.intellij.util.xmlb.annotations.Tag;
import com.intellij.util.xmlb.annotations.Transient;
-import org.jdom.Element;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Tag("class-filter")
-public class ClassFilter implements JDOMExternalizable, Cloneable{
+public class ClassFilter implements Cloneable {
private static final Logger LOG = Logger.getInstance("#com.intellij.ui.classFilter.ClassFilter");
public static final ClassFilter[] EMPTY_ARRAY = new ClassFilter[0];
@@ -72,14 +67,6 @@
return getPattern();
}
- public void readExternal(Element element) throws InvalidDataException {
- DefaultJDOMExternalizer.readExternal(this, element);
- }
-
- public void writeExternal(Element element) throws WriteExternalException {
- DefaultJDOMExternalizer.writeExternal(this, element);
- }
-
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ClassFilter)) return false;
@@ -99,6 +86,7 @@
return result;
}
+ @Override
public ClassFilter clone() {
try {
return (ClassFilter) super.clone();
diff --git a/java/openapi/src/com/intellij/ui/classFilter/ClassFilterEditor.java b/java/openapi/src/com/intellij/ui/classFilter/ClassFilterEditor.java
index b4b654d..6d924a3 100644
--- a/java/openapi/src/com/intellij/ui/classFilter/ClassFilterEditor.java
+++ b/java/openapi/src/com/intellij/ui/classFilter/ClassFilterEditor.java
@@ -113,7 +113,7 @@
myTable.setTableHeader(null);
myTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
myTable.setColumnSelectionAllowed(false);
- myTable.setPreferredScrollableViewportSize(new Dimension(200, 100));
+ myTable.setPreferredScrollableViewportSize(new Dimension(200, myTable.getRowHeight() * JBTable.PREFERRED_SCROLLABLE_VIEWPORT_HEIGHT_IN_ROWS));
TableColumnModel columnModel = myTable.getColumnModel();
TableColumn column = columnModel.getColumn(FilterTableModel.CHECK_MARK);
diff --git a/java/remote-servers/impl/remote-servers-java-impl.iml b/java/remote-servers/impl/remote-servers-java-impl.iml
index b0228d7..6999e2d 100644
--- a/java/remote-servers/impl/remote-servers-java-impl.iml
+++ b/java/remote-servers/impl/remote-servers-java-impl.iml
@@ -13,6 +13,8 @@
<orderEntry type="module" module-name="execution-openapi" />
<orderEntry type="module" module-name="lang-impl" />
<orderEntry type="module" module-name="remote-servers-impl" />
+ <orderEntry type="module" module-name="java-impl" />
+ <orderEntry type="module" module-name="openapi" />
</component>
</module>
diff --git a/java/remote-servers/impl/src/META-INF/RemoteServersJava.xml b/java/remote-servers/impl/src/META-INF/RemoteServersJava.xml
index cec87d9..24a0776 100644
--- a/java/remote-servers/impl/src/META-INF/RemoteServersJava.xml
+++ b/java/remote-servers/impl/src/META-INF/RemoteServersJava.xml
@@ -1,7 +1,14 @@
<idea-plugin>
+
+ <extensionPoints>
+ <extensionPoint qualifiedName="com.intellij.remoteServer.moduleBuilderContribution"
+ interface="com.intellij.remoteServer.impl.module.CloudModuleBuilderContribution"/>
+ </extensionPoints>
+
<extensions defaultExtensionNs="com.intellij">
<applicationService serviceInterface="com.intellij.remoteServer.configuration.deployment.JavaDeploymentSourceUtil"
serviceImplementation="com.intellij.remoteServer.impl.configuration.deployment.JavaDeploymentSourceUtilImpl"/>
<remoteServer.deploymentSource.type implementation="com.intellij.remoteServer.impl.configuration.deployment.ArtifactDeploymentSourceType"/>
+ <moduleBuilder builderClass="com.intellij.remoteServer.impl.module.CloudModuleBuilder"/>
</extensions>
</idea-plugin>
\ No newline at end of file
diff --git a/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudApplicationConfigurable.java b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudApplicationConfigurable.java
new file mode 100644
index 0000000..14bd043
--- /dev/null
+++ b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudApplicationConfigurable.java
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2000-2014 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.remoteServer.impl.module;
+
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Disposer;
+import com.intellij.remoteServer.configuration.RemoteServer;
+import com.intellij.remoteServer.runtime.Deployment;
+import com.intellij.remoteServer.runtime.ServerConnection;
+import com.intellij.remoteServer.runtime.ServerConnector;
+import com.intellij.remoteServer.runtime.deployment.ServerRuntimeInstance;
+import com.intellij.remoteServer.util.*;
+import com.intellij.util.concurrency.Semaphore;
+import com.intellij.util.ui.UIUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.Collection;
+import java.util.concurrent.atomic.AtomicReference;
+
+
+public abstract class CloudApplicationConfigurable<
+ SC extends CloudConfigurationBase,
+ DC extends CloudDeploymentNameConfiguration,
+ SR extends CloudMultiSourceServerRuntimeInstance<DC, ?, ?, ?>,
+ AC extends CloudApplicationConfiguration> {
+
+ private final Project myProject;
+ private final Disposable myParentDisposable;
+
+ private DelayedRunner myRunner;
+
+ private RemoteServer<?> myAccount;
+
+ public CloudApplicationConfigurable(@Nullable Project project, Disposable parentDisposable) {
+ myProject = project;
+ myParentDisposable = parentDisposable;
+ }
+
+ public void setAccount(RemoteServer<?> account) {
+ myAccount = account;
+ clearCloudData();
+ }
+
+ protected RemoteServer<SC> getAccount() {
+ return (RemoteServer<SC>)myAccount;
+ }
+
+ public JComponent getComponent() {
+ JComponent result = getMainPanel();
+ if (myRunner == null) {
+ myRunner = new DelayedRunner(result) {
+
+ private RemoteServer<?> myPreviousAccount;
+
+ @Override
+ protected boolean wasChanged() {
+ boolean result = myPreviousAccount != myAccount;
+ if (result) {
+ myPreviousAccount = myAccount;
+ }
+ return result;
+ }
+
+ @Override
+ protected void run() {
+ loadCloudData();
+ }
+ };
+ Disposer.register(myParentDisposable, myRunner);
+ }
+ return result;
+ }
+
+ protected void clearCloudData() {
+ getExistingComboBox().removeAllItems();
+ }
+
+ protected void loadCloudData() {
+ new ConnectionTask<Collection<Deployment>>("Loading existing applications list") {
+
+ @Override
+ protected void run(final ServerConnection<DC> connection,
+ final Semaphore semaphore,
+ final AtomicReference<Collection<Deployment>> result) {
+ connection.connectIfNeeded(new ServerConnector.ConnectionCallback<DC>() {
+
+ @Override
+ public void connected(@NotNull ServerRuntimeInstance<DC> serverRuntimeInstance) {
+ connection.computeDeployments(new Runnable() {
+
+ @Override
+ public void run() {
+ result.set(connection.getDeployments());
+ semaphore.up();
+ UIUtil.invokeLaterIfNeeded(new Runnable() {
+ @Override
+ public void run() {
+ if (!Disposer.isDisposed(myParentDisposable)) {
+ setupExistingApplications(result.get());
+ }
+ }
+ });
+ }
+ });
+ }
+
+ @Override
+ public void errorOccurred(@NotNull String errorMessage) {
+ runtimeErrorOccurred(errorMessage);
+ semaphore.up();
+ }
+ });
+ }
+
+ @Override
+ protected Collection<Deployment> run(SR serverRuntimeInstance) throws ServerRuntimeException {
+ return null;
+ }
+ }.performAsync();
+ }
+
+ private void setupExistingApplications(Collection<Deployment> deployments) {
+ JComboBox existingComboBox = getExistingComboBox();
+ existingComboBox.removeAllItems();
+ for (Deployment deployment : deployments) {
+ existingComboBox.addItem(deployment.getName());
+ }
+ }
+
+ protected Project getProject() {
+ return myProject;
+ }
+
+ protected abstract JComboBox getExistingComboBox();
+
+ protected abstract JComponent getMainPanel();
+
+ public abstract AC createConfiguration();
+
+ public abstract void validate() throws ConfigurationException;
+
+ protected abstract class ConnectionTask<T> extends CloudConnectionTask<T, SC, DC, SR> {
+
+ public ConnectionTask(String title) {
+ super(myProject, title, CloudApplicationConfigurable.this.getAccount());
+ }
+ }
+}
+
diff --git a/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudApplicationConfiguration.java b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudApplicationConfiguration.java
new file mode 100644
index 0000000..9af0f1a
--- /dev/null
+++ b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudApplicationConfiguration.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2014 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.remoteServer.impl.module;
+
+
+public abstract class CloudApplicationConfiguration {
+
+ private boolean myExisting;
+ private final String myExistingAppName;
+
+ protected CloudApplicationConfiguration(boolean existing, String existingAppName) {
+ myExisting = existing;
+ myExistingAppName = existingAppName;
+ }
+
+ public boolean isExisting() {
+ return myExisting;
+ }
+
+ public String getExistingAppName() {
+ return myExistingAppName;
+ }
+}
diff --git a/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilder.java b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilder.java
new file mode 100644
index 0000000..4aa8d60
--- /dev/null
+++ b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilder.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2000-2014 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.remoteServer.impl.module;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.ide.util.projectWizard.JavaModuleBuilder;
+import com.intellij.ide.util.projectWizard.ModuleBuilderListener;
+import com.intellij.ide.util.projectWizard.ModuleWizardStep;
+import com.intellij.ide.util.projectWizard.WizardContext;
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.module.JavaModuleType;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.roots.ui.configuration.ModulesProvider;
+import com.intellij.remoteServer.configuration.RemoteServer;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+
+public class CloudModuleBuilder extends JavaModuleBuilder {
+
+ private RemoteServer<?> myAccount;
+ private CloudApplicationConfiguration myApplicationConfiguration;
+
+ public CloudModuleBuilder() {
+ addListener(new ModuleBuilderListener() {
+
+ @Override
+ public void moduleCreated(@NotNull Module module) {
+ configureModule(module);
+ }
+ });
+ }
+
+ public String getBuilderId() {
+ return getClass().getName();
+ }
+
+ @Override
+ public Icon getBigIcon() {
+ return AllIcons.General.Balloon;
+ }
+
+ @Override
+ public Icon getNodeIcon() {
+ return AllIcons.General.Balloon;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Java module of PAAS cloud application";
+ }
+
+ @Override
+ public String getPresentableName() {
+ return "Clouds";
+ }
+
+ @Override
+ public String getGroupName() {
+ return "Clouds";
+ }
+
+ @Override
+ public String getParentGroup() {
+ return JavaModuleType.JAVA_GROUP;
+ }
+
+ @Override
+ public int getWeight() {
+ return 30;
+ }
+
+ @Override
+ public ModuleWizardStep[] createWizardSteps(@NotNull WizardContext wizardContext, @NotNull ModulesProvider modulesProvider) {
+ return ModuleWizardStep.EMPTY_ARRAY;
+ }
+
+ @Nullable
+ @Override
+ public ModuleWizardStep getCustomOptionsStep(WizardContext context, Disposable parentDisposable) {
+ return new CloudModuleWizardStep(this, context.getProject(), parentDisposable);
+ }
+
+ public void setAccount(RemoteServer<?> account) {
+ myAccount = account;
+ }
+
+ public RemoteServer<?> getAccount() {
+ return myAccount;
+ }
+
+ public void setApplicationConfiguration(CloudApplicationConfiguration applicationConfiguration) {
+ myApplicationConfiguration = applicationConfiguration;
+ }
+
+ private void configureModule(final Module module) {
+ CloudModuleBuilderContribution.getInstanceByType(myAccount.getType()).configureModule(module, myAccount, myApplicationConfiguration);
+ }
+}
diff --git a/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContribution.java b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContribution.java
new file mode 100644
index 0000000..6643c89
--- /dev/null
+++ b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContribution.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2014 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.remoteServer.impl.module;
+
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.project.Project;
+import com.intellij.remoteServer.ServerType;
+import com.intellij.remoteServer.configuration.RemoteServer;
+import org.jetbrains.annotations.Nullable;
+
+
+public abstract class CloudModuleBuilderContribution {
+
+ public static final ExtensionPointName<CloudModuleBuilderContribution> EP_NAME
+ = ExtensionPointName.create("com.intellij.remoteServer.moduleBuilderContribution");
+
+ public abstract ServerType<?> getCloudType();
+
+ public abstract CloudApplicationConfigurable createApplicationConfigurable(@Nullable Project project, Disposable parentDisposable);
+
+ public abstract void configureModule(Module module,
+ RemoteServer<?> account,
+ CloudApplicationConfiguration configuration);
+
+ public static CloudModuleBuilderContribution getInstanceByType(ServerType<?> cloudType) {
+ for (CloudModuleBuilderContribution contribution : EP_NAME.getExtensions()) {
+ if (contribution.getCloudType() == cloudType) {
+ return contribution;
+ }
+ }
+ return null;
+ }
+}
diff --git a/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContributionBase.java b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContributionBase.java
new file mode 100644
index 0000000..6a927d9
--- /dev/null
+++ b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContributionBase.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2000-2014 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.remoteServer.impl.module;
+
+import com.intellij.execution.RunManagerEx;
+import com.intellij.execution.RunnerAndConfigurationSettings;
+import com.intellij.execution.configurations.ConfigurationType;
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModulePointer;
+import com.intellij.openapi.module.ModulePointerManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.MessageType;
+import com.intellij.remoteServer.ServerType;
+import com.intellij.remoteServer.configuration.RemoteServer;
+import com.intellij.remoteServer.impl.configuration.deployment.DeployToServerConfigurationType;
+import com.intellij.remoteServer.impl.configuration.deployment.DeployToServerRunConfiguration;
+import com.intellij.remoteServer.impl.configuration.deployment.ModuleDeploymentSourceImpl;
+import com.intellij.remoteServer.util.*;
+import com.intellij.remoteServer.util.ssh.SshKeyChecker;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+
+public abstract class CloudModuleBuilderContributionBase<
+ SC extends CloudConfigurationBase,
+ DC extends CloudDeploymentNameConfiguration,
+ AC extends CloudApplicationConfiguration,
+ SR extends CloudMultiSourceServerRuntimeInstance<DC, ?, ?, ?>>
+ extends CloudModuleBuilderContribution {
+
+ @Override
+ public void configureModule(Module module,
+ RemoteServer<?> account,
+ CloudApplicationConfiguration applicationConfiguration) {
+ RemoteServer<SC> castedAccount = (RemoteServer<SC>)account;
+ final AC castedApplicationConfiguration = (AC)applicationConfiguration;
+
+ DC deploymentConfiguration = createDeploymentConfiguration();
+
+ if (applicationConfiguration.isExisting()) {
+ deploymentConfiguration.setDefaultDeploymentName(false);
+ deploymentConfiguration.setDeploymentName(applicationConfiguration.getExistingAppName());
+ }
+
+ final DeployToServerRunConfiguration<SC, DC> runConfiguration = createRunConfiguration(module, castedAccount, deploymentConfiguration);
+
+ final String cloudName = account.getType().getPresentableName();
+ final Project project = module.getProject();
+ new CloudConnectionTask<Object, SC, DC, SR>(project, CloudBundle.getText("cloud.support", cloudName), castedAccount) {
+
+ CloudNotifier myNotifier = new CloudNotifier(cloudName);
+
+ boolean myFirstAttempt = true;
+
+ @Override
+ protected Object run(SR serverRuntime) throws ServerRuntimeException {
+ doConfigureModule(castedApplicationConfiguration, runConfiguration, myFirstAttempt, serverRuntime);
+ myNotifier.showMessage(CloudBundle.getText("cloud.support.added", cloudName), MessageType.INFO);
+ return null;
+ }
+
+ @Override
+ protected void runtimeErrorOccurred(@NotNull String errorMessage) {
+ myFirstAttempt = false;
+ new SshKeyChecker().checkServerError(errorMessage, myNotifier, project, this);
+ }
+ }.performAsync();
+ }
+
+ private DeployToServerRunConfiguration<SC, DC> createRunConfiguration(Module module,
+ RemoteServer<SC> server,
+ DC deploymentConfiguration) {
+ Project project = module.getProject();
+
+ String serverName = server.getName();
+
+ String name = generateRunConfigurationName(serverName, module.getName());
+
+ final RunManagerEx runManager = RunManagerEx.getInstanceEx(project);
+ final RunnerAndConfigurationSettings runSettings
+ = runManager.createRunConfiguration(name, getRunConfigurationType().getConfigurationFactories()[0]);
+
+ final DeployToServerRunConfiguration<SC, DC> result = (DeployToServerRunConfiguration<SC, DC>)runSettings.getConfiguration();
+
+ result.setServerName(serverName);
+
+ final ModulePointer modulePointer = ModulePointerManager.getInstance(project).create(module);
+ result.setDeploymentSource(new ModuleDeploymentSourceImpl(modulePointer));
+
+ result.setDeploymentConfiguration(deploymentConfiguration);
+
+ runManager.addConfiguration(runSettings, false);
+ runManager.setSelectedConfiguration(runSettings);
+
+ return result;
+ }
+
+ private static String generateRunConfigurationName(String serverName, String moduleName) {
+ return CloudBundle.getText("run.configuration.name", serverName, moduleName);
+ }
+
+ private DeployToServerConfigurationType getRunConfigurationType() {
+ String id = DeployToServerConfigurationType.getId(getCloudType());
+ for (ConfigurationType configurationType : ConfigurationType.CONFIGURATION_TYPE_EP.getExtensions()) {
+ if (configurationType instanceof DeployToServerConfigurationType) {
+ DeployToServerConfigurationType deployConfigurationType = (DeployToServerConfigurationType)configurationType;
+ if (deployConfigurationType.getId().equals(id)) {
+ return deployConfigurationType;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public abstract ServerType<SC> getCloudType();
+
+ @Override
+ public abstract CloudApplicationConfigurable<SC, DC, SR, AC> createApplicationConfigurable(@Nullable Project project,
+ Disposable parentDisposable);
+
+ protected abstract DC createDeploymentConfiguration();
+
+ protected abstract void doConfigureModule(AC applicationConfiguration,
+ DeployToServerRunConfiguration<SC, DC> runConfiguration,
+ boolean firstAttempt,
+ SR serverRuntime) throws ServerRuntimeException;
+}
diff --git a/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleWizardStep.form b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleWizardStep.form
new file mode 100644
index 0000000..19cbaa7f
--- /dev/null
+++ b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleWizardStep.form
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.remoteServer.impl.module.CloudModuleWizardStep">
+ <grid id="27dc6" binding="myMainPanel" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <xy x="20" y="20" width="415" height="400"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <grid id="b29a2" binding="myAccountPanelPlaceHolder" layout-manager="BorderLayout" hgap="0" vgap="0">
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children/>
+ </grid>
+ <vspacer id="276c3">
+ <constraints>
+ <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+ </constraints>
+ </vspacer>
+ <component id="dd5e7" class="com.intellij.ui.TitledSeparator">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Account"/>
+ </properties>
+ </component>
+ <component id="61d9c" class="com.intellij.ui.TitledSeparator">
+ <constraints>
+ <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Application"/>
+ </properties>
+ </component>
+ <grid id="582a2" binding="myApplicationPanelPlaceHolder" layout-manager="CardLayout" hgap="0" vgap="0">
+ <constraints>
+ <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children/>
+ </grid>
+ </children>
+ </grid>
+</form>
diff --git a/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleWizardStep.java b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleWizardStep.java
new file mode 100644
index 0000000..cf0e283
--- /dev/null
+++ b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleWizardStep.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2000-2014 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.remoteServer.impl.module;
+
+import com.intellij.ide.util.projectWizard.ModuleWizardStep;
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.project.Project;
+import com.intellij.remoteServer.ServerType;
+import com.intellij.remoteServer.configuration.RemoteServer;
+import com.intellij.remoteServer.util.CloudAccountSelectionEditor;
+import com.intellij.util.containers.hash.HashMap;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+
+public class CloudModuleWizardStep extends ModuleWizardStep {
+
+ private JPanel myMainPanel;
+ private JPanel myAccountPanelPlaceHolder;
+ private JPanel myApplicationPanelPlaceHolder;
+
+ private final CloudModuleBuilder myModuleBuilder;
+ private final Project myProject;
+ private final Disposable myParentDisposable;
+
+ private CloudAccountSelectionEditor myAccountSelectionPanel;
+
+ private Map<ServerType<?>, CloudApplicationConfigurable> myCloudType2ApplicationConfigurable;
+
+ public CloudModuleWizardStep(CloudModuleBuilder moduleBuilder, Project project, Disposable parentDisposable) {
+ myModuleBuilder = moduleBuilder;
+ myProject = project;
+ myParentDisposable = parentDisposable;
+
+ myCloudType2ApplicationConfigurable = new HashMap<ServerType<?>, CloudApplicationConfigurable>();
+
+ List<ServerType<?>> cloudTypes = new ArrayList<ServerType<?>>();
+ for (CloudModuleBuilderContribution contribution : CloudModuleBuilderContribution.EP_NAME.getExtensions()) {
+ cloudTypes.add(contribution.getCloudType());
+ }
+
+ myAccountSelectionPanel = new CloudAccountSelectionEditor(cloudTypes);
+ myAccountPanelPlaceHolder.add(myAccountSelectionPanel.getMainPanel());
+
+ myAccountSelectionPanel.setAccountSelectionListener(new Runnable() {
+
+ @Override
+ public void run() {
+ onAccountSelectionChanged();
+ }
+ });
+ onAccountSelectionChanged();
+ }
+
+ private RemoteServer<?> getSelectedAccount() {
+ return myAccountSelectionPanel.getSelectedAccount();
+ }
+
+ private void onAccountSelectionChanged() {
+ CardLayout applicationPlaceHolderLayout = (CardLayout)myApplicationPanelPlaceHolder.getLayout();
+
+ RemoteServer<?> account = getSelectedAccount();
+ boolean haveAccount = account != null;
+ myApplicationPanelPlaceHolder.setVisible(haveAccount);
+ if (!haveAccount) {
+ return;
+ }
+
+ ServerType<?> cloudType = account.getType();
+ String cardName = cloudType.getId();
+ CloudApplicationConfigurable<?, ?, ?, ?> applicationConfigurable = getApplicationConfigurable();
+ if (applicationConfigurable == null) {
+ applicationConfigurable
+ = CloudModuleBuilderContribution.getInstanceByType(cloudType).createApplicationConfigurable(myProject, myParentDisposable);
+ myCloudType2ApplicationConfigurable.put(cloudType, applicationConfigurable);
+ myApplicationPanelPlaceHolder.add(applicationConfigurable.getComponent(), cardName);
+ }
+ applicationPlaceHolderLayout.show(myApplicationPanelPlaceHolder, cardName);
+
+ applicationConfigurable.setAccount(account);
+ }
+
+ @Override
+ public JComponent getComponent() {
+ return myMainPanel;
+ }
+
+ private CloudApplicationConfigurable<?, ?, ?, ?> getApplicationConfigurable() {
+ RemoteServer<?> account = getSelectedAccount();
+ if (account == null) {
+ return null;
+ }
+ return myCloudType2ApplicationConfigurable.get(account.getType());
+ }
+
+ @Override
+ public void updateDataModel() {
+ myModuleBuilder.setAccount(myAccountSelectionPanel.getSelectedAccount());
+ CloudApplicationConfigurable<?, ?, ?, ?> configurable = getApplicationConfigurable();
+ myModuleBuilder.setApplicationConfiguration(configurable == null ? null : configurable.createConfiguration());
+ }
+
+ @Override
+ public boolean validate() throws ConfigurationException {
+ myAccountSelectionPanel.validate();
+ CloudApplicationConfigurable<?, ?, ?, ?> configurable = getApplicationConfigurable();
+ if (configurable != null) {
+ configurable.validate();
+ }
+ return super.validate();
+ }
+}
diff --git a/plugins/structuralsearch/structuralsearch-java/src/META-INF/java.xml b/java/structuralsearch-java/src/META-INF/structuralsearch-java.xml
similarity index 85%
rename from plugins/structuralsearch/structuralsearch-java/src/META-INF/java.xml
rename to java/structuralsearch-java/src/META-INF/structuralsearch-java.xml
index 56c3329..765a70d 100644
--- a/plugins/structuralsearch/structuralsearch-java/src/META-INF/java.xml
+++ b/java/structuralsearch-java/src/META-INF/structuralsearch-java.xml
@@ -1,4 +1,4 @@
-<idea-plugin url="http://www.jetbrains.com/idea">
+<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<structuralsearch.profile implementation="com.intellij.structuralsearch.JavaStructuralSearchProfile"/>
<structuralsearch.matchPredicateProvider implementation="com.intellij.structuralsearch.impl.matcher.JavaMatchPredicateProvider"/>
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/JavaPredefinedConfigurations.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/JavaPredefinedConfigurations.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/JavaPredefinedConfigurations.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/JavaPredefinedConfigurations.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/JavaReplaceHandler.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/JavaReplaceHandler.java
similarity index 87%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/JavaReplaceHandler.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/JavaReplaceHandler.java
index 36b8fff..562c8ae 100644
--- a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/JavaReplaceHandler.java
+++ b/java/structuralsearch-java/src/com/intellij/structuralsearch/JavaReplaceHandler.java
@@ -16,8 +16,10 @@
import com.intellij.structuralsearch.plugin.replace.impl.Replacer;
import com.intellij.structuralsearch.plugin.replace.impl.ReplacerUtil;
import com.intellij.util.IncorrectOperationException;
+import com.siyeh.ig.psiutils.ImportUtils;
import org.jetbrains.annotations.Nullable;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -35,15 +37,12 @@
private PsiCodeBlock getCodeBlock() throws IncorrectOperationException {
if (codeBlock == null) {
- PsiCodeBlock search;
- search = (PsiCodeBlock)MatcherImplUtil.createTreeFromText(
+ codeBlock = (PsiCodeBlock)MatcherImplUtil.createTreeFromText(
myContext.getOptions().getMatchOptions().getSearchPattern(),
PatternTreeContext.Block,
myContext.getOptions().getMatchOptions().getFileType(),
myContext.getProject()
)[0].getParent();
-
- codeBlock = search;
}
return codeBlock;
}
@@ -243,7 +242,7 @@
}
}
- private PsiElement handleSymbolReplacemenent(PsiElement replacement, final PsiElement el) throws IncorrectOperationException {
+ private PsiElement handleSymbolReplacement(PsiElement replacement, final PsiElement el) throws IncorrectOperationException {
PsiNamedElement nameElement = getSymbolReplacementTarget(el);
if (nameElement != null) {
PsiElement oldReplacement = replacement;
@@ -279,7 +278,7 @@
PsiElement replacement = getMatchExpr(statements[0], elementToReplace);
handleModifierList(el, replacement);
- replacement = handleSymbolReplacemenent(replacement, el);
+ replacement = handleSymbolReplacement(replacement, el);
if (replacement instanceof PsiTryStatement) {
final List<PsiCatchSection> unmatchedCatchSections = el.getUserData(JavaMatchingVisitor.UNMATCHED_CATCH_SECTION_CONTENT_VAR_KEY);
@@ -387,7 +386,7 @@
}
}
- replacement = handleSymbolReplacemenent(replacement, el);
+ replacement = handleSymbolReplacement(replacement, el);
el.replace(replacement);
}
@@ -449,9 +448,67 @@
element.getParent().deleteChildRange(firstToDelete, lastToDelete);
}
}
-
- if (options.isToShortenFQN() && elementParent.isValid()) {
- JavaCodeStyleManager.getInstance(project).shortenClassReferences(elementParent, 0, elementParent.getTextLength());
+ }
+
+ @Override
+ public void postProcess(PsiElement affectedElement, ReplaceOptions options) {
+ if (!affectedElement.isValid()) {
+ return;
+ }
+ if (options.isToUseStaticImport()) {
+ shortenWithStaticImports(affectedElement, 0, affectedElement.getTextLength());
+ }
+ if (options.isToShortenFQN()) {
+ final JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(affectedElement.getProject());
+ codeStyleManager.shortenClassReferences(affectedElement, 0, affectedElement.getTextLength());
+ }
+ }
+
+ private static void shortenWithStaticImports(PsiElement affectedElement, int startOffset, int endOffset) {
+ final int elementOffset = affectedElement.getTextOffset();
+ final int finalStartOffset = startOffset + elementOffset;
+ final int finalEndOffset = endOffset + elementOffset;
+ final List<PsiReferenceExpression> references = new ArrayList<PsiReferenceExpression>();
+ final JavaRecursiveElementVisitor collector = new JavaRecursiveElementVisitor() {
+ @Override
+ public void visitReferenceExpression(PsiReferenceExpression expression) {
+ final int offset = expression.getTextOffset();
+ if (offset > finalEndOffset) {
+ return;
+ }
+ super.visitReferenceExpression(expression);
+ if (offset + expression.getTextLength() < finalStartOffset)
+ if (expression.getQualifierExpression() == null) {
+ return;
+ }
+ references.add(expression);
+ }
+ };
+ affectedElement.accept(collector);
+ for (PsiReferenceExpression expression : references) {
+ final PsiElement target = expression.resolve();
+ if (!(target instanceof PsiMember)) {
+ continue;
+ }
+ final PsiMember member = (PsiMember)target;
+ final PsiClass containingClass = member.getContainingClass();
+ if (containingClass == null) {
+ continue;
+ }
+ final String className = containingClass.getQualifiedName();
+ if (className == null) {
+ continue;
+ }
+ final String name = member.getName();
+ if (name == null) {
+ continue;
+ }
+ if (ImportUtils.addStaticImport(className, name, expression)) {
+ final PsiExpression qualifierExpression = expression.getQualifierExpression();
+ if (qualifierExpression != null) {
+ qualifierExpression.delete();
+ }
+ }
}
}
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/JavaStructuralSearchProfile.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/JavaStructuralSearchProfile.java
similarity index 96%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/JavaStructuralSearchProfile.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/JavaStructuralSearchProfile.java
index c738b55..869f01c 100644
--- a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/JavaStructuralSearchProfile.java
+++ b/java/structuralsearch-java/src/com/intellij/structuralsearch/JavaStructuralSearchProfile.java
@@ -411,7 +411,7 @@
final ParameterInfo initInfo = builder.findParameterization(Replacer.stripTypedVariableDecoration(initText));
if (initInfo != null) {
- initInfo.setVariableInitialContext(true);
+ initInfo.setVariableInitializerContext(true);
}
}
}
@@ -432,20 +432,6 @@
}
@Override
- public void visitMethod(PsiMethod method) {
- super.visitMethod(method);
-
- String name = method.getName();
- if (StructuralSearchUtil.isTypedVariable(name)) {
- name = Replacer.stripTypedVariableDecoration(name);
-
- ParameterInfo methodInfo = builder.findParameterization(name);
- methodInfo.setScopeParameterization(true);
- //if (scopedParameterizations != null) scopedParameterizations.put(method.getTextRange(), methodInfo);
- }
- }
-
- @Override
public void visitParameter(PsiParameter parameter) {
super.visitParameter(parameter);
@@ -462,8 +448,8 @@
ParameterInfo typeInfo = builder.findParameterization(type);
if (nameInfo != null && typeInfo != null && !(parameter.getParent() instanceof PsiCatchSection)) {
- nameInfo.setParameterContext(false);
- typeInfo.setParameterContext(false);
+ nameInfo.setArgumentContext(false);
+ typeInfo.setArgumentContext(false);
typeInfo.setMethodParameterContext(true);
nameInfo.setMethodParameterContext(true);
typeInfo.setElement(parameter.getTypeElement());
@@ -524,7 +510,7 @@
buf.append('\n');
}
}
- else if (info.isParameterContext()) {
+ else if (info.isArgumentContext()) {
buf.append(',');
}
else if (parent instanceof PsiClass) {
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaCompiledPattern.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaCompiledPattern.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaCompiledPattern.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaCompiledPattern.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaMatchPredicateProvider.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaMatchPredicateProvider.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaMatchPredicateProvider.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaMatchPredicateProvider.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaMatchingVisitor.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaMatchingVisitor.java
similarity index 97%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaMatchingVisitor.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaMatchingVisitor.java
index 38e77c7..0ea857b 100644
--- a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaMatchingVisitor.java
+++ b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaMatchingVisitor.java
@@ -321,35 +321,32 @@
@Override
public void visitNameValuePair(PsiNameValuePair pair) {
final PsiIdentifier nameIdentifier = pair.getNameIdentifier();
- if (nameIdentifier == null) {
- myMatchingVisitor.setResult(true);
- return;
- }
final PsiNameValuePair elementNameValuePair = (PsiNameValuePair)myMatchingVisitor.getElement();
- PsiIdentifier matchedNameValuePair = elementNameValuePair.getNameIdentifier();
+ final PsiIdentifier otherIdentifier = elementNameValuePair.getNameIdentifier();
- PsiAnnotationMemberValue annotationInitializer = pair.getValue();
- boolean isTypedInitializer = annotationInitializer != null &&
- myMatchingVisitor.getMatchContext().getPattern().isTypedVar(annotationInitializer) &&
- annotationInitializer instanceof PsiReferenceExpression;
+ final PsiAnnotationMemberValue annotationInitializer = pair.getValue();
+ if (annotationInitializer != null) {
+ final boolean isTypedInitializer = myMatchingVisitor.getMatchContext().getPattern().isTypedVar(annotationInitializer) &&
+ annotationInitializer instanceof PsiReferenceExpression;
- myMatchingVisitor.setResult(myMatchingVisitor.match(annotationInitializer, elementNameValuePair.getValue()) ||
- (isTypedInitializer &&
- elementNameValuePair.getValue() == null &&
- allowsAbsenceOfMatch(annotationInitializer)
- ));
+ myMatchingVisitor.setResult(myMatchingVisitor.match(annotationInitializer, elementNameValuePair.getValue()) ||
+ (isTypedInitializer &&
+ elementNameValuePair.getValue() == null &&
+ allowsAbsenceOfMatch(annotationInitializer)
+ ));
+ }
if (myMatchingVisitor.getResult()) {
final MatchingHandler handler = myMatchingVisitor.getMatchContext().getPattern().getHandler(nameIdentifier);
if (handler instanceof SubstitutionHandler) {
- myMatchingVisitor
- .setResult(((SubstitutionHandler)handler).handle(matchedNameValuePair,
- myMatchingVisitor.getMatchContext()));
+ myMatchingVisitor.setResult(((SubstitutionHandler)handler).handle(otherIdentifier, myMatchingVisitor.getMatchContext()));
+ }
+ else if (nameIdentifier != null) {
+ myMatchingVisitor.setResult(myMatchingVisitor.match(nameIdentifier, otherIdentifier));
}
else {
- myMatchingVisitor
- .setResult(myMatchingVisitor.match(nameIdentifier, matchedNameValuePair));
+ myMatchingVisitor.setResult(otherIdentifier == null || otherIdentifier.getText().equals("value"));
}
}
}
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/compiler/JavaCompilingVisitor.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/compiler/JavaCompilingVisitor.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/compiler/JavaCompilingVisitor.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/compiler/JavaCompilingVisitor.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/BlockFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/BlockFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/BlockFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/BlockFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ClassFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ClassFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ClassFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ClassFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/CommentFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/CommentFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/CommentFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/CommentFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ConstantFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ConstantFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ConstantFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ConstantFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/DeclarationFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/DeclarationFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/DeclarationFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/DeclarationFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ExpressionFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ExpressionFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ExpressionFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/ExpressionFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/JavaDocFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/JavaDocFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/JavaDocFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/JavaDocFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/JavaLexicalNodesFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/JavaLexicalNodesFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/JavaLexicalNodesFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/JavaLexicalNodesFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/MethodFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/MethodFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/MethodFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/MethodFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/StatementFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/StatementFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/StatementFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/StatementFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/SymbolNodeFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/SymbolNodeFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/SymbolNodeFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/SymbolNodeFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypeFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypeFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypeFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypeFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypeParameterFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypeParameterFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypeParameterFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypeParameterFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypedSymbolNodeFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypedSymbolNodeFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypedSymbolNodeFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/TypedSymbolNodeFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/VariableFilter.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/VariableFilter.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/VariableFilter.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/VariableFilter.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/DeclarationStatementHandler.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/DeclarationStatementHandler.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/DeclarationStatementHandler.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/DeclarationStatementHandler.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/DocDataHandler.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/DocDataHandler.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/DocDataHandler.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/DocDataHandler.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/ExpressionHandler.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/ExpressionHandler.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/ExpressionHandler.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/ExpressionHandler.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/StatementHandler.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/StatementHandler.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/StatementHandler.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/handlers/StatementHandler.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/iterators/DocValuesIterator.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/iterators/DocValuesIterator.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/iterators/DocValuesIterator.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/iterators/DocValuesIterator.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/iterators/HierarchyNodeIterator.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/iterators/HierarchyNodeIterator.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/iterators/HierarchyNodeIterator.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/iterators/HierarchyNodeIterator.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/ExprTypePredicate.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/ExprTypePredicate.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/ExprTypePredicate.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/ExprTypePredicate.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/FormalArgTypePredicate.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/FormalArgTypePredicate.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/FormalArgTypePredicate.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/FormalArgTypePredicate.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/ReadPredicate.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/ReadPredicate.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/ReadPredicate.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/ReadPredicate.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/WritePredicate.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/WritePredicate.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/WritePredicate.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/predicates/WritePredicate.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/CommentMatchingStrategy.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/CommentMatchingStrategy.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/CommentMatchingStrategy.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/CommentMatchingStrategy.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/ExprMatchingStrategy.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/ExprMatchingStrategy.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/ExprMatchingStrategy.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/ExprMatchingStrategy.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/JavaDocMatchingStrategy.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/JavaDocMatchingStrategy.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/JavaDocMatchingStrategy.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/JavaDocMatchingStrategy.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/MatchingStrategyBase.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/MatchingStrategyBase.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/MatchingStrategyBase.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/MatchingStrategyBase.java
diff --git a/plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/SymbolMatchingStrategy.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/SymbolMatchingStrategy.java
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/SymbolMatchingStrategy.java
rename to java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/strategies/SymbolMatchingStrategy.java
diff --git a/plugins/structuralsearch/structuralsearch-java/structuralsearch-java.iml b/java/structuralsearch-java/structuralsearch-java.iml
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-java/structuralsearch-java.iml
rename to java/structuralsearch-java/structuralsearch-java.iml
diff --git a/java/testFramework/src/com/intellij/codeInsight/CodeInsightTestCaseUtil.java b/java/testFramework/src/com/intellij/codeInsight/CodeInsightTestCaseUtil.java
index aa77a1e..df90bbb 100644
--- a/java/testFramework/src/com/intellij/codeInsight/CodeInsightTestCaseUtil.java
+++ b/java/testFramework/src/com/intellij/codeInsight/CodeInsightTestCaseUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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,13 +15,13 @@
*/
package com.intellij.codeInsight;
-import com.intellij.codeInsight.actions.CodeInsightAction;
import com.intellij.ide.DataManager;
import com.intellij.openapi.actionSystem.ActionManager;
+import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
public class CodeInsightTestCaseUtil {
- public static void doAction(CodeInsightTestCase testCase, CodeInsightAction action, String testName, String ext) throws Exception {
+ public static void doAction(CodeInsightTestCase testCase, AnAction action, String testName, String ext) throws Exception {
testCase.configureByFile(testName + "." + ext);
action.actionPerformed(new AnActionEvent(
diff --git a/plugins/typeMigration/src/META-INF/plugin.xml b/java/typeMigration/src/META-INF/TypeMigration.xml
similarity index 65%
rename from plugins/typeMigration/src/META-INF/plugin.xml
rename to java/typeMigration/src/META-INF/TypeMigration.xml
index 93ad203..b460dad 100644
--- a/plugins/typeMigration/src/META-INF/plugin.xml
+++ b/java/typeMigration/src/META-INF/TypeMigration.xml
@@ -1,20 +1,5 @@
<idea-plugin>
- <name>Type Migration</name>
- <description>
- <![CDATA[
- This plugin adds the type migration refactoring.
- The following features are available:
- <ul>
- <li>Dedicated Refactoring Dialog. (Refactor | Type Migration)</li>
- <li>Ability to review type migration results. (Refactor | Migration | Preview)</li>
- <li>Ability to automatically change a member type or data flow dependent type entries.</li>
- <li>Ability to convert variable or method return type between arrays and collections.</li>
- </ul>
- ]]>
- </description>
- <vendor>JetBrains</vendor>
<extensions defaultExtensionNs="com.intellij">
- <errorHandler implementation="com.intellij.diagnostic.ITNReporter"/>
<codeInsight.changeVariableTypeQuickFixProvider
implementation="com.intellij.refactoring.typeMigration.TypeMigrationVariableTypeFixProvider"/>
<conversion.rule implementation="com.intellij.refactoring.typeMigration.rules.ListArrayConversionRule"/>
@@ -35,5 +20,4 @@
<category>Declaration</category>
</intentionAction>
</extensions>
- <depends>Structural Search</depends>
</idea-plugin>
diff --git a/plugins/typeMigration/src/com/intellij/refactoring/typeMigration/TypeConversionDescriptor.java b/java/typeMigration/src/com/intellij/refactoring/typeMigration/TypeConversionDescriptor.java
similarity index 100%
rename from plugins/typeMigration/src/com/intellij/refactoring/typeMigration/TypeConversionDescriptor.java
rename to java/typeMigration/src/com/intellij/refactoring/typeMigration/TypeConversionDescriptor.java
diff --git a/plugins/typeMigration/src/com/intellij/refactoring/typeMigration/TypeMigrationVariableTypeFixProvider.java b/java/typeMigration/src/com/intellij/refactoring/typeMigration/TypeMigrationVariableTypeFixProvider.java
similarity index 100%
rename from plugins/typeMigration/src/com/intellij/refactoring/typeMigration/TypeMigrationVariableTypeFixProvider.java
rename to java/typeMigration/src/com/intellij/refactoring/typeMigration/TypeMigrationVariableTypeFixProvider.java
diff --git a/plugins/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ChangeClassParametersIntention.java b/java/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ChangeClassParametersIntention.java
similarity index 100%
rename from plugins/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ChangeClassParametersIntention.java
rename to java/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ChangeClassParametersIntention.java
diff --git a/plugins/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ConvertFieldToAtomicIntention.java b/java/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ConvertFieldToAtomicIntention.java
similarity index 100%
rename from plugins/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ConvertFieldToAtomicIntention.java
rename to java/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ConvertFieldToAtomicIntention.java
diff --git a/plugins/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ConvertFieldToThreadLocalIntention.java b/java/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ConvertFieldToThreadLocalIntention.java
similarity index 100%
rename from plugins/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ConvertFieldToThreadLocalIntention.java
rename to java/typeMigration/src/com/intellij/refactoring/typeMigration/intentions/ConvertFieldToThreadLocalIntention.java
diff --git a/plugins/typeMigration/src/com/intellij/refactoring/typeMigration/rules/AtomicConversionRule.java b/java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/AtomicConversionRule.java
similarity index 100%
rename from plugins/typeMigration/src/com/intellij/refactoring/typeMigration/rules/AtomicConversionRule.java
rename to java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/AtomicConversionRule.java
diff --git a/plugins/typeMigration/src/com/intellij/refactoring/typeMigration/rules/BoxingTypeConversionRule.java b/java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/BoxingTypeConversionRule.java
similarity index 100%
rename from plugins/typeMigration/src/com/intellij/refactoring/typeMigration/rules/BoxingTypeConversionRule.java
rename to java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/BoxingTypeConversionRule.java
diff --git a/plugins/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ElementToArrayConversionRule.java b/java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ElementToArrayConversionRule.java
similarity index 100%
rename from plugins/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ElementToArrayConversionRule.java
rename to java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ElementToArrayConversionRule.java
diff --git a/plugins/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ListArrayConversionRule.java b/java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ListArrayConversionRule.java
similarity index 100%
rename from plugins/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ListArrayConversionRule.java
rename to java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ListArrayConversionRule.java
diff --git a/plugins/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ThreadLocalConversionRule.java b/java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ThreadLocalConversionRule.java
similarity index 100%
rename from plugins/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ThreadLocalConversionRule.java
rename to java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/ThreadLocalConversionRule.java
diff --git a/plugins/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/after.java.template b/java/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/after.java.template
similarity index 100%
rename from plugins/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/after.java.template
rename to java/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/after.java.template
diff --git a/plugins/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/before.java.template b/java/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/before.java.template
similarity index 100%
rename from plugins/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/before.java.template
rename to java/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/before.java.template
diff --git a/plugins/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/description.html b/java/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/description.html
similarity index 100%
rename from plugins/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/description.html
rename to java/typeMigration/src/intentionDescriptions/ChangeClassParametersIntention/description.html
diff --git a/plugins/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/after.java.template b/java/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/after.java.template
similarity index 100%
rename from plugins/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/after.java.template
rename to java/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/after.java.template
diff --git a/plugins/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/before.java.template b/java/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/before.java.template
similarity index 100%
rename from plugins/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/before.java.template
rename to java/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/before.java.template
diff --git a/plugins/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/description.html b/java/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/description.html
similarity index 100%
rename from plugins/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/description.html
rename to java/typeMigration/src/intentionDescriptions/ConvertFieldToAtomicIntention/description.html
diff --git a/plugins/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/after.java.template b/java/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/after.java.template
similarity index 100%
rename from plugins/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/after.java.template
rename to java/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/after.java.template
diff --git a/plugins/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/before.java.template b/java/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/before.java.template
similarity index 100%
rename from plugins/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/before.java.template
rename to java/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/before.java.template
diff --git a/plugins/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/description.html b/java/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/description.html
similarity index 100%
rename from plugins/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/description.html
rename to java/typeMigration/src/intentionDescriptions/ConvertFieldToThreadLocalIntention/description.html
diff --git a/plugins/typeMigration/test/com/intellij/codeInsight/ConvertToAtomicIntentionTest.java b/java/typeMigration/test/com/intellij/codeInsight/ConvertToAtomicIntentionTest.java
similarity index 80%
rename from plugins/typeMigration/test/com/intellij/codeInsight/ConvertToAtomicIntentionTest.java
rename to java/typeMigration/test/com/intellij/codeInsight/ConvertToAtomicIntentionTest.java
index 4a0b73d..d4de1aa 100644
--- a/plugins/typeMigration/test/com/intellij/codeInsight/ConvertToAtomicIntentionTest.java
+++ b/java/typeMigration/test/com/intellij/codeInsight/ConvertToAtomicIntentionTest.java
@@ -1,7 +1,7 @@
package com.intellij.codeInsight;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
-import com.intellij.openapi.application.PluginPathManager;
+import com.intellij.testFramework.PlatformTestUtil;
import org.jetbrains.annotations.NotNull;
/**
@@ -21,7 +21,7 @@
@NotNull
@Override
protected String getTestDataPath() {
- return PluginPathManager.getPluginHomePath("typeMigration") + "/testData";
+ return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData";
}
public void test() throws Exception {
diff --git a/plugins/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntentionTest.java b/java/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntentionTest.java
similarity index 80%
rename from plugins/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntentionTest.java
rename to java/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntentionTest.java
index 389ced7..e45b26ba 100644
--- a/plugins/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntentionTest.java
+++ b/java/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntentionTest.java
@@ -1,7 +1,7 @@
package com.intellij.codeInsight;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
-import com.intellij.openapi.application.PluginPathManager;
+import com.intellij.testFramework.PlatformTestUtil;
import org.jetbrains.annotations.NotNull;
/**
@@ -21,7 +21,7 @@
@NotNull
@Override
protected String getTestDataPath() {
- return PluginPathManager.getPluginHomePath("typeMigration") + "/testData";
+ return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData";
}
public void test() throws Exception {
diff --git a/plugins/typeMigration/test/com/intellij/refactoring/AllTypeMigrationTests.java b/java/typeMigration/test/com/intellij/refactoring/AllTypeMigrationTests.java
similarity index 100%
rename from plugins/typeMigration/test/com/intellij/refactoring/AllTypeMigrationTests.java
rename to java/typeMigration/test/com/intellij/refactoring/AllTypeMigrationTests.java
diff --git a/plugins/typeMigration/test/com/intellij/refactoring/ChangeTypeSignatureTest.java b/java/typeMigration/test/com/intellij/refactoring/ChangeTypeSignatureTest.java
similarity index 96%
rename from plugins/typeMigration/test/com/intellij/refactoring/ChangeTypeSignatureTest.java
rename to java/typeMigration/test/com/intellij/refactoring/ChangeTypeSignatureTest.java
index e85b2f7..8feae69 100644
--- a/plugins/typeMigration/test/com/intellij/refactoring/ChangeTypeSignatureTest.java
+++ b/java/typeMigration/test/com/intellij/refactoring/ChangeTypeSignatureTest.java
@@ -4,7 +4,6 @@
*/
package com.intellij.refactoring;
-import com.intellij.openapi.application.PluginPathManager;
import com.intellij.psi.*;
import com.intellij.psi.impl.source.PsiImmediateClassType;
import com.intellij.psi.search.GlobalSearchScope;
@@ -13,13 +12,14 @@
import com.intellij.refactoring.typeMigration.TypeMigrationProcessor;
import com.intellij.refactoring.typeMigration.TypeMigrationRules;
import com.intellij.testFramework.LightCodeInsightTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
import org.jetbrains.annotations.NotNull;
public class ChangeTypeSignatureTest extends LightCodeInsightTestCase {
@NotNull
@Override
protected String getTestDataPath() {
- return PluginPathManager.getPluginHomePath("typeMigration") + "/testData";
+ return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData";
}
private void doTest(boolean success, String migrationTypeText) throws Exception {
diff --git a/plugins/typeMigration/test/com/intellij/refactoring/MigrateTypeSignatureTest.java b/java/typeMigration/test/com/intellij/refactoring/MigrateTypeSignatureTest.java
similarity index 100%
rename from plugins/typeMigration/test/com/intellij/refactoring/MigrateTypeSignatureTest.java
rename to java/typeMigration/test/com/intellij/refactoring/MigrateTypeSignatureTest.java
diff --git a/plugins/typeMigration/test/com/intellij/refactoring/TypeMigrationByAtomicRuleTest.java b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByAtomicRuleTest.java
similarity index 100%
rename from plugins/typeMigration/test/com/intellij/refactoring/TypeMigrationByAtomicRuleTest.java
rename to java/typeMigration/test/com/intellij/refactoring/TypeMigrationByAtomicRuleTest.java
diff --git a/plugins/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java
similarity index 100%
rename from plugins/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java
rename to java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java
diff --git a/plugins/typeMigration/test/com/intellij/refactoring/TypeMigrationTest.java b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationTest.java
similarity index 100%
rename from plugins/typeMigration/test/com/intellij/refactoring/TypeMigrationTest.java
rename to java/typeMigration/test/com/intellij/refactoring/TypeMigrationTest.java
diff --git a/plugins/typeMigration/test/com/intellij/refactoring/TypeMigrationTestBase.java b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationTestBase.java
similarity index 97%
rename from plugins/typeMigration/test/com/intellij/refactoring/TypeMigrationTestBase.java
rename to java/typeMigration/test/com/intellij/refactoring/TypeMigrationTestBase.java
index 8f75c49..2d4c211 100644
--- a/plugins/typeMigration/test/com/intellij/refactoring/TypeMigrationTestBase.java
+++ b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationTestBase.java
@@ -1,6 +1,5 @@
package com.intellij.refactoring;
-import com.intellij.openapi.application.PluginPathManager;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.project.Project;
@@ -15,6 +14,7 @@
import com.intellij.psi.search.LocalSearchScope;
import com.intellij.refactoring.typeMigration.TypeMigrationProcessor;
import com.intellij.refactoring.typeMigration.TypeMigrationRules;
+import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.usageView.UsageInfo;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -30,7 +30,7 @@
public abstract class TypeMigrationTestBase extends MultiFileTestCase {
@Override
protected String getTestDataPath() {
- return PluginPathManager.getPluginHomePath("typeMigration") + "/testData";
+ return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData";
}
protected void doTestFieldType(@NonNls String fieldName, PsiType fromType, PsiType toType) {
diff --git a/plugins/typeMigration/test/com/intellij/refactoring/WildcardTypeMigrationTest.java b/java/typeMigration/test/com/intellij/refactoring/WildcardTypeMigrationTest.java
similarity index 100%
rename from plugins/typeMigration/test/com/intellij/refactoring/WildcardTypeMigrationTest.java
rename to java/typeMigration/test/com/intellij/refactoring/WildcardTypeMigrationTest.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after1.java b/java/typeMigration/testData/intentions/atomic/after1.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after1.java
rename to java/typeMigration/testData/intentions/atomic/after1.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after10.java b/java/typeMigration/testData/intentions/atomic/after10.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after10.java
rename to java/typeMigration/testData/intentions/atomic/after10.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after12.java b/java/typeMigration/testData/intentions/atomic/after12.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after12.java
rename to java/typeMigration/testData/intentions/atomic/after12.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after13.java b/java/typeMigration/testData/intentions/atomic/after13.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after13.java
rename to java/typeMigration/testData/intentions/atomic/after13.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after14.java b/java/typeMigration/testData/intentions/atomic/after14.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after14.java
rename to java/typeMigration/testData/intentions/atomic/after14.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after2.java b/java/typeMigration/testData/intentions/atomic/after2.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after2.java
rename to java/typeMigration/testData/intentions/atomic/after2.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after3.java b/java/typeMigration/testData/intentions/atomic/after3.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after3.java
rename to java/typeMigration/testData/intentions/atomic/after3.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after4.java b/java/typeMigration/testData/intentions/atomic/after4.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after4.java
rename to java/typeMigration/testData/intentions/atomic/after4.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after5.java b/java/typeMigration/testData/intentions/atomic/after5.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after5.java
rename to java/typeMigration/testData/intentions/atomic/after5.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after6.java b/java/typeMigration/testData/intentions/atomic/after6.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after6.java
rename to java/typeMigration/testData/intentions/atomic/after6.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after7.java b/java/typeMigration/testData/intentions/atomic/after7.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after7.java
rename to java/typeMigration/testData/intentions/atomic/after7.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after8.java b/java/typeMigration/testData/intentions/atomic/after8.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after8.java
rename to java/typeMigration/testData/intentions/atomic/after8.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/after9.java b/java/typeMigration/testData/intentions/atomic/after9.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/after9.java
rename to java/typeMigration/testData/intentions/atomic/after9.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/afterExcl.java b/java/typeMigration/testData/intentions/atomic/afterExcl.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/afterExcl.java
rename to java/typeMigration/testData/intentions/atomic/afterExcl.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/afterTA1.java b/java/typeMigration/testData/intentions/atomic/afterTA1.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/afterTA1.java
rename to java/typeMigration/testData/intentions/atomic/afterTA1.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before1.java b/java/typeMigration/testData/intentions/atomic/before1.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before1.java
rename to java/typeMigration/testData/intentions/atomic/before1.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before10.java b/java/typeMigration/testData/intentions/atomic/before10.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before10.java
rename to java/typeMigration/testData/intentions/atomic/before10.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before11.java b/java/typeMigration/testData/intentions/atomic/before11.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before11.java
rename to java/typeMigration/testData/intentions/atomic/before11.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before12.java b/java/typeMigration/testData/intentions/atomic/before12.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before12.java
rename to java/typeMigration/testData/intentions/atomic/before12.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before13.java b/java/typeMigration/testData/intentions/atomic/before13.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before13.java
rename to java/typeMigration/testData/intentions/atomic/before13.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before14.java b/java/typeMigration/testData/intentions/atomic/before14.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before14.java
rename to java/typeMigration/testData/intentions/atomic/before14.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before2.java b/java/typeMigration/testData/intentions/atomic/before2.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before2.java
rename to java/typeMigration/testData/intentions/atomic/before2.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before3.java b/java/typeMigration/testData/intentions/atomic/before3.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before3.java
rename to java/typeMigration/testData/intentions/atomic/before3.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before4.java b/java/typeMigration/testData/intentions/atomic/before4.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before4.java
rename to java/typeMigration/testData/intentions/atomic/before4.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before5.java b/java/typeMigration/testData/intentions/atomic/before5.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before5.java
rename to java/typeMigration/testData/intentions/atomic/before5.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before6.java b/java/typeMigration/testData/intentions/atomic/before6.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before6.java
rename to java/typeMigration/testData/intentions/atomic/before6.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before7.java b/java/typeMigration/testData/intentions/atomic/before7.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before7.java
rename to java/typeMigration/testData/intentions/atomic/before7.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before8.java b/java/typeMigration/testData/intentions/atomic/before8.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before8.java
rename to java/typeMigration/testData/intentions/atomic/before8.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/before9.java b/java/typeMigration/testData/intentions/atomic/before9.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/before9.java
rename to java/typeMigration/testData/intentions/atomic/before9.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/beforeExcl.java b/java/typeMigration/testData/intentions/atomic/beforeExcl.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/beforeExcl.java
rename to java/typeMigration/testData/intentions/atomic/beforeExcl.java
diff --git a/plugins/typeMigration/testData/intentions/atomic/beforeTA1.java b/java/typeMigration/testData/intentions/atomic/beforeTA1.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/atomic/beforeTA1.java
rename to java/typeMigration/testData/intentions/atomic/beforeTA1.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/after1.java b/java/typeMigration/testData/intentions/threadLocal/after1.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/after1.java
rename to java/typeMigration/testData/intentions/threadLocal/after1.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/after2.java b/java/typeMigration/testData/intentions/threadLocal/after2.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/after2.java
rename to java/typeMigration/testData/intentions/threadLocal/after2.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/after3.java b/java/typeMigration/testData/intentions/threadLocal/after3.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/after3.java
rename to java/typeMigration/testData/intentions/threadLocal/after3.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/after4.java b/java/typeMigration/testData/intentions/threadLocal/after4.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/after4.java
rename to java/typeMigration/testData/intentions/threadLocal/after4.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/after5.java b/java/typeMigration/testData/intentions/threadLocal/after5.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/after5.java
rename to java/typeMigration/testData/intentions/threadLocal/after5.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/after6.java b/java/typeMigration/testData/intentions/threadLocal/after6.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/after6.java
rename to java/typeMigration/testData/intentions/threadLocal/after6.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/after7.java b/java/typeMigration/testData/intentions/threadLocal/after7.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/after7.java
rename to java/typeMigration/testData/intentions/threadLocal/after7.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/after8.java b/java/typeMigration/testData/intentions/threadLocal/after8.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/after8.java
rename to java/typeMigration/testData/intentions/threadLocal/after8.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/afterTA1.java b/java/typeMigration/testData/intentions/threadLocal/afterTA1.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/afterTA1.java
rename to java/typeMigration/testData/intentions/threadLocal/afterTA1.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/before1.java b/java/typeMigration/testData/intentions/threadLocal/before1.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/before1.java
rename to java/typeMigration/testData/intentions/threadLocal/before1.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/before2.java b/java/typeMigration/testData/intentions/threadLocal/before2.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/before2.java
rename to java/typeMigration/testData/intentions/threadLocal/before2.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/before3.java b/java/typeMigration/testData/intentions/threadLocal/before3.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/before3.java
rename to java/typeMigration/testData/intentions/threadLocal/before3.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/before4.java b/java/typeMigration/testData/intentions/threadLocal/before4.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/before4.java
rename to java/typeMigration/testData/intentions/threadLocal/before4.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/before5.java b/java/typeMigration/testData/intentions/threadLocal/before5.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/before5.java
rename to java/typeMigration/testData/intentions/threadLocal/before5.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/before6.java b/java/typeMigration/testData/intentions/threadLocal/before6.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/before6.java
rename to java/typeMigration/testData/intentions/threadLocal/before6.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/before7.java b/java/typeMigration/testData/intentions/threadLocal/before7.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/before7.java
rename to java/typeMigration/testData/intentions/threadLocal/before7.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/before8.java b/java/typeMigration/testData/intentions/threadLocal/before8.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/before8.java
rename to java/typeMigration/testData/intentions/threadLocal/before8.java
diff --git a/plugins/typeMigration/testData/intentions/threadLocal/beforeTA1.java b/java/typeMigration/testData/intentions/threadLocal/beforeTA1.java
similarity index 100%
rename from plugins/typeMigration/testData/intentions/threadLocal/beforeTA1.java
rename to java/typeMigration/testData/intentions/threadLocal/beforeTA1.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/CompositeReturnType.java b/java/typeMigration/testData/refactoring/changeTypeSignature/CompositeReturnType.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/CompositeReturnType.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/CompositeReturnType.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/CompositeReturnType.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/CompositeReturnType.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/CompositeReturnType.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/CompositeReturnType.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldTypeMigration.java b/java/typeMigration/testData/refactoring/changeTypeSignature/FieldTypeMigration.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldTypeMigration.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/FieldTypeMigration.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldTypeMigration.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/FieldTypeMigration.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldTypeMigration.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/FieldTypeMigration.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage.java b/java/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage1.java b/java/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage1.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage1.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage1.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage1.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage1.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage1.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/FieldUsage1.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ListTypeArguments.java b/java/typeMigration/testData/refactoring/changeTypeSignature/ListTypeArguments.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ListTypeArguments.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ListTypeArguments.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ListTypeArguments.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/ListTypeArguments.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ListTypeArguments.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ListTypeArguments.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/MethodReturnTypeMigration.java b/java/typeMigration/testData/refactoring/changeTypeSignature/MethodReturnTypeMigration.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/MethodReturnTypeMigration.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/MethodReturnTypeMigration.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/MethodReturnTypeMigration.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/MethodReturnTypeMigration.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/MethodReturnTypeMigration.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/MethodReturnTypeMigration.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration.java b/java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration1.java b/java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration1.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration1.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration1.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration1.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration1.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration1.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration1.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration2.java b/java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration2.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration2.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration2.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration2.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration2.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration2.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ParameterMigration2.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter.java b/java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter1.java b/java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter1.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter1.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter1.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter1.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter1.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter1.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter1.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter2.java b/java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter2.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter2.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter2.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter2.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter2.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter2.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/PassedParameter2.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType.java b/java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType1.java b/java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType1.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType1.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType1.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType1.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType1.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType1.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType1.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType2.java b/java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType2.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType2.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType2.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType2.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType2.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/ReturnType2.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/ReturnType2.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy.java b/java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy1.java b/java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy1.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy1.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy1.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy1.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy1.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy1.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy1.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy2.java b/java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy2.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy2.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy2.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy2.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy2.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy2.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchy2.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsage.java b/java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsage.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsage.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsage.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsage.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsage.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsage.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsage.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsageConflict.java b/java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsageConflict.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsageConflict.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsageConflict.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsageConflict.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsageConflict.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsageConflict.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/TypeHierarchyFieldUsageConflict.java.after
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/UsedInSuper.java b/java/typeMigration/testData/refactoring/changeTypeSignature/UsedInSuper.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/UsedInSuper.java
rename to java/typeMigration/testData/refactoring/changeTypeSignature/UsedInSuper.java
diff --git a/plugins/typeMigration/testData/refactoring/changeTypeSignature/UsedInSuper.java.after b/java/typeMigration/testData/refactoring/changeTypeSignature/UsedInSuper.java.after
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/changeTypeSignature/UsedInSuper.java.after
rename to java/typeMigration/testData/refactoring/changeTypeSignature/UsedInSuper.java.after
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Lvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccess2Rvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/after/Ession.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/after/Ession.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/after/Ession.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/after/Ession.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Lvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprAccessParent2Rvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessNegative/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprArrayAccessPositive/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanBoolean/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanNumeric/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcBooleanReference/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Boolean/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Floating/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2Int/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCalcNumeric2String/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvalueNeg/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprCast2LvaluePos/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2Reference/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatNumeric2String/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Numeric/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprConcatString2Reference/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofNeg/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprInstanceofPos/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralBoolean/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralByte/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralChar/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassExtends/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitive/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassPrimitiveArray/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassRaw/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReference/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassReferenceArray/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralClassSuper/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralDouble/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralFloat/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralInt/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralLong/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralShort/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprLiteralString/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Lvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayArray2Rvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayGen2Rvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Lvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayPrimitive2Rvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Lvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewArrayReftype2Rvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGen/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenExtends/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewGenSuper/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprNewReference/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Lvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprReturn2Rvalue/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/after/Expr.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/after/Expr.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/after/Expr.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/after/Expr.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/after/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/after/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/after/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/after/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/before/Expr.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/before/Expr.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/before/Expr.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/exprTernary/before/Expr.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/after/Overriding.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/after/Overriding.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/after/Overriding.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/after/Overriding.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/after/Parent.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/after/Parent.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/after/Parent.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/after/Parent.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/before/Overriding.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/before/Overriding.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/before/Overriding.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/overridingDown/before/Overriding.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/after/Child.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/after/Child.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/after/Child.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/after/Child.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/after/Overriding.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/after/Overriding.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/after/Overriding.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/after/Overriding.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/before/Overriding.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/before/Overriding.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/before/Overriding.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/overridingUp/before/Overriding.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/after/Spec.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/after/Spec.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/after/Spec.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/after/Spec.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/after/Spec.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/after/Spec.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/after/Spec.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/after/Spec.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/before/Spec.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/before/Spec.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/before/Spec.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/specJavadoc/before/Spec.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/after/Spec.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/after/Spec.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/after/Spec.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/after/Spec.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/after/Spec.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/after/Spec.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/after/Spec.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/after/Spec.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/before/Spec.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/before/Spec.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/before/Spec.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/specNotUsed/before/Spec.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayReftype2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayRoots2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvalueNeg/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeArrayVararg2RvaluePos/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxBoolean2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxByte2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxChar2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxDouble2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxFloat2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxInt2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxLong2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeAutoboxShort2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestor2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenAncestorWildcard2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendant2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenDescendantWildcard2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeGenRaw2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubBoolean2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubByte2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubChar2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubDouble2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubFloat2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubInt2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubLong2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typePrimsubShort2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassChild2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefClassParent2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceChild2Rvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/after/Type.items b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/after/Type.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/after/Type.items
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/after/Type.items
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/after/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/after/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/after/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/after/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/before/Type.java b/java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/before/Type.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/before/Type.java
rename to java/typeMigration/testData/refactoring/migrateTypeSignature/typeRefFaceParent2Lvalue/before/Type.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t01/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t01/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t01/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t01/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t01/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t01/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t01/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t01/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t01/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t01/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t01/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t01/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t02/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t02/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t02/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t02/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t02/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t02/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t02/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t02/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t02/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t02/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t02/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t02/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t03/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t03/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t03/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t03/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t03/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t03/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t03/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t03/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t03/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t03/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t03/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t03/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t04/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t04/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t04/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t04/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t04/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t04/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t04/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t04/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t04/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t04/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t04/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t04/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t05/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t05/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t05/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t05/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t05/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t05/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t05/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t05/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t05/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t05/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t05/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t05/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t06/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t06/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t06/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t06/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t06/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t06/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t06/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t06/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t06/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t06/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t06/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t06/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t07/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t07/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t07/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t07/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t07/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t07/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t07/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t07/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t07/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t07/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t07/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t07/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t08/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t08/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t08/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t08/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t08/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t08/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t08/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t08/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t08/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t08/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t08/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t08/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t09/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t09/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t09/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t09/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t09/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t09/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t09/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t09/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t09/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t09/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t09/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t09/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t10/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t10/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t10/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t10/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t10/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t10/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t10/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t10/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t10/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t10/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t10/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t10/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t100/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t100/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t100/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t100/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t100/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t100/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t100/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t100/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t100/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t100/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t100/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t100/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t101/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t101/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t101/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t101/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t101/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t101/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t101/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t101/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t101/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t101/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t101/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t101/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t102/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t102/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t102/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t102/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t102/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t102/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t102/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t102/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t102/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t102/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t102/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t102/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t103/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t103/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t103/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t103/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t103/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t103/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t103/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t103/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t103/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t103/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t103/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t103/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t104/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t104/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t104/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t104/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t104/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t104/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t104/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t104/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t104/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t104/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t104/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t104/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t105/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t105/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t105/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t105/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t105/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t105/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t105/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t105/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t105/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t105/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t105/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t105/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t106/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t106/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t106/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t106/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t106/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t106/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t106/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t106/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t106/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t106/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t106/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t106/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t107/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t107/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t107/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t107/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t107/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t107/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t107/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t107/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t107/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t107/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t107/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t107/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t108/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t108/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t108/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t108/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t108/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t108/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t108/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t108/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t108/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t108/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t108/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t108/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t109/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t109/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t109/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t109/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t109/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t109/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t109/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t109/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t109/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t109/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t109/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t109/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t11/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t11/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t11/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t11/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t11/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t11/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t11/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t11/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t11/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t11/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t11/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t11/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t110/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t110/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t110/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t110/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t110/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t110/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t110/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t110/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t110/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t110/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t110/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t110/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t111/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t111/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t111/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t111/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t111/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t111/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t111/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t111/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t111/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t111/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t111/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t111/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t112/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t112/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t112/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t112/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t112/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t112/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t112/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t112/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t112/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t112/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t112/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t112/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t113/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t113/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t113/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t113/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t113/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t113/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t113/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t113/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t113/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t113/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t113/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t113/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t114/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t114/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t114/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t114/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t114/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t114/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t114/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t114/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t114/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t114/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t114/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t114/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t115/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t115/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t115/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t115/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t115/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t115/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t115/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t115/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t115/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t115/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t115/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t115/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t116/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t116/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t116/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t116/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t116/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t116/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t116/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t116/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t116/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t116/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t116/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t116/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t117/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t117/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t117/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t117/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t117/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t117/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t117/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t117/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t117/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t117/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t117/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t117/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t118/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t118/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t118/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t118/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t118/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t118/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t118/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t118/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t118/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t118/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t118/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t118/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t119/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t119/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t119/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t119/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t119/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t119/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t119/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t119/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t119/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t119/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t119/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t119/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t12/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t12/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t12/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t12/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t12/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t12/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t12/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t12/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t12/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t12/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t12/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t12/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t120/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t120/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t120/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t120/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t120/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t120/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t120/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t120/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t120/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t120/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t120/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t120/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t121/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t121/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t121/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t121/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t121/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t121/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t121/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t121/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t121/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t121/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t121/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t121/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t122/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t122/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t122/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t122/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t122/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t122/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t122/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t122/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t122/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t122/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t122/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t122/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t123/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t123/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t123/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t123/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t123/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t123/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t123/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t123/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t123/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t123/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t123/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t123/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t124/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t124/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t124/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t124/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t124/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t124/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t124/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t124/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t124/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t124/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t124/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t124/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t125/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t125/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t125/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t125/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t125/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t125/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t125/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t125/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t125/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t125/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t125/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t125/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t126/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t126/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t126/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t126/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t126/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t126/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t126/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t126/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t126/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t126/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t126/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t126/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t127/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t127/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t127/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t127/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t127/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t127/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t127/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t127/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t127/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t127/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t127/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t127/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t128/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t128/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t128/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t128/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t128/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t128/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t128/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t128/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t128/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t128/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t128/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t128/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t129/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t129/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t129/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t129/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t129/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t129/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t129/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t129/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t129/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t129/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t129/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t129/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t13/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t13/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t13/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t13/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t13/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t13/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t13/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t13/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t13/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t13/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t13/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t13/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t130/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t130/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t130/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t130/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t130/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t130/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t130/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t130/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t130/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t130/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t130/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t130/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t131/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t131/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t131/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t131/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t131/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t131/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t131/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t131/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t131/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t131/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t131/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t131/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t132/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t132/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t132/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t132/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t132/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t132/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t132/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t132/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t132/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t132/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t132/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t132/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t133/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t133/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t133/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t133/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t133/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t133/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t133/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t133/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t133/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t133/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t133/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t133/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t134/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t134/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t134/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t134/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t134/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t134/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t134/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t134/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t134/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t134/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t134/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t134/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t135/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t135/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t135/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t135/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t135/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t135/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t135/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t135/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t135/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t135/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t135/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t135/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t136/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t136/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t136/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t136/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t136/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t136/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t136/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t136/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t136/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t136/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t136/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t136/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t137/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t137/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t137/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t137/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t137/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t137/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t137/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t137/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t137/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t137/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t137/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t137/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t138/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t138/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t138/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t138/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t138/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t138/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t138/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t138/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t138/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t138/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t138/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t138/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t139/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t139/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t139/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t139/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t139/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t139/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t139/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t139/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t139/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t139/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t139/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t139/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t14/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t14/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t14/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t14/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t14/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t14/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t14/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t14/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t14/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t14/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t14/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t14/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t15/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t15/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t15/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t15/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t15/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t15/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t15/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t15/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t15/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t15/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t15/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t15/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t16/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t16/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t16/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t16/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t16/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t16/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t16/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t16/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t16/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t16/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t16/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t16/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t17/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t17/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t17/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t17/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t17/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t17/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t17/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t17/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t17/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t17/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t17/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t17/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t18/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t18/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t18/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t18/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t18/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t18/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t18/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t18/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t18/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t18/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t18/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t18/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t19/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t19/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t19/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t19/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t19/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t19/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t19/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t19/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t19/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t19/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t19/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t19/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t20/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t20/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t20/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t20/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t20/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t20/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t20/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t20/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t20/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t20/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t20/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t20/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t21/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t21/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t21/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t21/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t21/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t21/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t21/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t21/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t21/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t21/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t21/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t21/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t22/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t22/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t22/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t22/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t22/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t22/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t22/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t22/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t22/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t22/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t22/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t22/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t23/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t23/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t23/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t23/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t23/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t23/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t23/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t23/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t23/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t23/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t23/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t23/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t24/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t24/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t24/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t24/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t24/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t24/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t24/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t24/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t24/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t24/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t24/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t24/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t25/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t25/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t25/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t25/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t25/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t25/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t25/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t25/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t25/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t25/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t25/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t25/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t26/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t26/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t26/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t26/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t26/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t26/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t26/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t26/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t26/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t26/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t26/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t26/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t27/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t27/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t27/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t27/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t27/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t27/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t27/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t27/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t27/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t27/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t27/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t27/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t28/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t28/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t28/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t28/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t28/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t28/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t28/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t28/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t28/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t28/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t28/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t28/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t29/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t29/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t29/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t29/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t29/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t29/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t29/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t29/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t29/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t29/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t29/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t29/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t30/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t30/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t30/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t30/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t30/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t30/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t30/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t30/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t30/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t30/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t30/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t30/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t31/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t31/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t31/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t31/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t31/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t31/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t31/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t31/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t31/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t31/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t31/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t31/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t32/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t32/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t32/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t32/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t32/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t32/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t32/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t32/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t32/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t32/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t32/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t32/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t33/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t33/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t33/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t33/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t33/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t33/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t33/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t33/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t33/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t33/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t33/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t33/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t34/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t34/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t34/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t34/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t34/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t34/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t34/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t34/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t34/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t34/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t34/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t34/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t35/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t35/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t35/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t35/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t35/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t35/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t35/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t35/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t35/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t35/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t35/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t35/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t36/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t36/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t36/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t36/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t36/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t36/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t36/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t36/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t36/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t36/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t36/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t36/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t37/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t37/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t37/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t37/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t37/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t37/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t37/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t37/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t37/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t37/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t37/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t37/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t38/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t38/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t38/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t38/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t38/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t38/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t38/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t38/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t38/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t38/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t38/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t38/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t39/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t39/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t39/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t39/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t39/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t39/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t39/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t39/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t39/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t39/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t39/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t39/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t40/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t40/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t40/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t40/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t40/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t40/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t40/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t40/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t40/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t40/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t40/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t40/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t41/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t41/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t41/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t41/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t41/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t41/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t41/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t41/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t41/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t41/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t41/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t41/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t42/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t42/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t42/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t42/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t42/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t42/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t42/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t42/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t42/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t42/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t42/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t42/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t43/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t43/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t43/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t43/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t43/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t43/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t43/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t43/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t43/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t43/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t43/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t43/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t44/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t44/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t44/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t44/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t44/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t44/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t44/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t44/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t44/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t44/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t44/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t44/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t45/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t45/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t45/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t45/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t45/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t45/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t45/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t45/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t45/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t45/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t45/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t45/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t46/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t46/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t46/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t46/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t46/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t46/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t46/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t46/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t46/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t46/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t46/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t46/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t47/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t47/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t47/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t47/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t47/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t47/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t47/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t47/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t47/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t47/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t47/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t47/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t48/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t48/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t48/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t48/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t48/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t48/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t48/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t48/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t48/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t48/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t48/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t48/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t49/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t49/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t49/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t49/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t49/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t49/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t49/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t49/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t49/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t49/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t49/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t49/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t50/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t50/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t50/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t50/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t50/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t50/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t50/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t50/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t50/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t50/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t50/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t50/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t51/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t51/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t51/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t51/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t51/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t51/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t51/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t51/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t51/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t51/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t51/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t51/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t52/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t52/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t52/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t52/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t52/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t52/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t52/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t52/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t52/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t52/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t52/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t52/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t53/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t53/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t53/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t53/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t53/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t53/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t53/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t53/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t53/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t53/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t53/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t53/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t54/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t54/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t54/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t54/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t54/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t54/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t54/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t54/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t54/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t54/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t54/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t54/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t55/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t55/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t55/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t55/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t55/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t55/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t55/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t55/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t55/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t55/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t55/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t55/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t56/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t56/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t56/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t56/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t56/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t56/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t56/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t56/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t56/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t56/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t56/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t56/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t57/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t57/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t57/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t57/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t57/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t57/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t57/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t57/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t57/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t57/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t57/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t57/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t58/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t58/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t58/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t58/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t58/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t58/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t58/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t58/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t58/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t58/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t58/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t58/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t59/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t59/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t59/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t59/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t59/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t59/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t59/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t59/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t59/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t59/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t59/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t59/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t60/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t60/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t60/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t60/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t60/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t60/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t60/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t60/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t60/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t60/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t60/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t60/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t61/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t61/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t61/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t61/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t61/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t61/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t61/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t61/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t61/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t61/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t61/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t61/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t62/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t62/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t62/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t62/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t62/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t62/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t62/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t62/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t62/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t62/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t62/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t62/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t63/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t63/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t63/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t63/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t63/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t63/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t63/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t63/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t63/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t63/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t63/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t63/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t64/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t64/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t64/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t64/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t64/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t64/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t64/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t64/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t64/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t64/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t64/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t64/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t65/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t65/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t65/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t65/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t65/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t65/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t65/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t65/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t65/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t65/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t65/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t65/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t66/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t66/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t66/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t66/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t66/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t66/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t66/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t66/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t66/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t66/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t66/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t66/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t67/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t67/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t67/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t67/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t67/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t67/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t67/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t67/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t67/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t67/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t67/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t67/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t68/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t68/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t68/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t68/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t68/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t68/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t68/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t68/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t68/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t68/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t68/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t68/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t69/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t69/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t69/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t69/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t69/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t69/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t69/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t69/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t69/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t69/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t69/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t69/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t70/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t70/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t70/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t70/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t70/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t70/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t70/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t70/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t70/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t70/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t70/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t70/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t71/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t71/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t71/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t71/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t71/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t71/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t71/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t71/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t71/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t71/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t71/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t71/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t72/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t72/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t72/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t72/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t72/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t72/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t72/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t72/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t72/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t72/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t72/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t72/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t73/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t73/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t73/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t73/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t73/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t73/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t73/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t73/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t73/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t73/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t73/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t73/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t74/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t74/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t74/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t74/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t74/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t74/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t74/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t74/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t74/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t74/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t74/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t74/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t75/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t75/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t75/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t75/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t75/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t75/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t75/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t75/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t75/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t75/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t75/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t75/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t76/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t76/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t76/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t76/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t76/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t76/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t76/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t76/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t76/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t76/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t76/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t76/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t77/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t77/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t77/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t77/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t77/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t77/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t77/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t77/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t77/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t77/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t77/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t77/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t78/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t78/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t78/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t78/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t78/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t78/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t78/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t78/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t78/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t78/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t78/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t78/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t79/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t79/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t79/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t79/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t79/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t79/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t79/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t79/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t79/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t79/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t79/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t79/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t80/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t80/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t80/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t80/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t80/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t80/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t80/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t80/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t80/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t80/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t80/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t80/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t81/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t81/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t81/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t81/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t81/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t81/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t81/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t81/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t81/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t81/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t81/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t81/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t82/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t82/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t82/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t82/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t82/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t82/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t82/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t82/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t82/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t82/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t82/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t82/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t83/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t83/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t83/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t83/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t83/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t83/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t83/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t83/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t83/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t83/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t83/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t83/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t84/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t84/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t84/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t84/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t84/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t84/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t84/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t84/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t84/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t84/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t84/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t84/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t85/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t85/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t85/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t85/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t85/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t85/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t85/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t85/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t85/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t85/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t85/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t85/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t86/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t86/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t86/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t86/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t86/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t86/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t86/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t86/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t86/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t86/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t86/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t86/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t87/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t87/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t87/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t87/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t87/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t87/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t87/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t87/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t87/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t87/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t87/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t87/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t88/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t88/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t88/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t88/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t88/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t88/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t88/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t88/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t88/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t88/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t88/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t88/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t89/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t89/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t89/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t89/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t89/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t89/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t89/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t89/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t89/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t89/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t89/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t89/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t90/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t90/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t90/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t90/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t90/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t90/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t90/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t90/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t90/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t90/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t90/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t90/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t91/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t91/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t91/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t91/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t91/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t91/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t91/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t91/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t91/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t91/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t91/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t91/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t92/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t92/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t92/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t92/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t92/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t92/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t92/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t92/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t92/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t92/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t92/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t92/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t93/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t93/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t93/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t93/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t93/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t93/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t93/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t93/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t93/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t93/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t93/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t93/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t94/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t94/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t94/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t94/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t94/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t94/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t94/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t94/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t94/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t94/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t94/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t94/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t95/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t95/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t95/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t95/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t95/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t95/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t95/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t95/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t95/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t95/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t95/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t95/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t96/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t96/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t96/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t96/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t96/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t96/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t96/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t96/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t96/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t96/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t96/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t96/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t97/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t97/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t97/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t97/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t97/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t97/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t97/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t97/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t97/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t97/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t97/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t97/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t98/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t98/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t98/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t98/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t98/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t98/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t98/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t98/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t98/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t98/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t98/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t98/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t99/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/t99/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t99/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/t99/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t99/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/t99/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t99/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t99/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/t99/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/t99/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/t99/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/t99/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/typeAnno/after/Test.items b/java/typeMigration/testData/refactoring/typeMigration/typeAnno/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/typeAnno/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigration/typeAnno/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/typeAnno/after/test.java b/java/typeMigration/testData/refactoring/typeMigration/typeAnno/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/typeAnno/after/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/typeAnno/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigration/typeAnno/before/test.java b/java/typeMigration/testData/refactoring/typeMigration/typeAnno/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigration/typeAnno/before/test.java
rename to java/typeMigration/testData/refactoring/typeMigration/typeAnno/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directAssignments/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directByte/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directConditions/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directForeach/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIncrementDecrement/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directIntArray/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directString/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/directStringArray/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseAssignments/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseByte/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseConditions/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIncrementDecrement/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseString/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseStringArray/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directByte/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directInt/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/directString/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/after/Test.items b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/after/Test.items
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/after/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/after/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/after/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/after/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/before/Test.java b/java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/before/Test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/before/Test.java
rename to java/typeMigration/testData/refactoring/typeMigrationByThreadLocal/languageLevel/before/Test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/assignmentExtends/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/assignmentExtends/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/assignmentExtends/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/assignmentExtends/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/assignmentExtends/after/test.java b/java/typeMigration/testData/refactoring/wildcard/assignmentExtends/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/assignmentExtends/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/assignmentExtends/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/assignmentExtends/before/test.java b/java/typeMigration/testData/refactoring/wildcard/assignmentExtends/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/assignmentExtends/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/assignmentExtends/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/assignmentSuper/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/assignmentSuper/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/assignmentSuper/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/assignmentSuper/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/assignmentSuper/after/test.java b/java/typeMigration/testData/refactoring/wildcard/assignmentSuper/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/assignmentSuper/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/assignmentSuper/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/assignmentSuper/before/test.java b/java/typeMigration/testData/refactoring/wildcard/assignmentSuper/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/assignmentSuper/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/assignmentSuper/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/after/test.java b/java/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/before/test.java b/java/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/assignmentUnbounded/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/consumerExtends/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/consumerExtends/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/consumerExtends/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/consumerExtends/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/consumerExtends/after/test.java b/java/typeMigration/testData/refactoring/wildcard/consumerExtends/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/consumerExtends/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/consumerExtends/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/consumerExtends/before/test.java b/java/typeMigration/testData/refactoring/wildcard/consumerExtends/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/consumerExtends/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/consumerExtends/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/consumerSuper/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/consumerSuper/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/consumerSuper/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/consumerSuper/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/consumerSuper/after/test.java b/java/typeMigration/testData/refactoring/wildcard/consumerSuper/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/consumerSuper/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/consumerSuper/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/consumerSuper/before/test.java b/java/typeMigration/testData/refactoring/wildcard/consumerSuper/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/consumerSuper/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/consumerSuper/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/consumerUnbounded/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/consumerUnbounded/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/consumerUnbounded/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/consumerUnbounded/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/consumerUnbounded/after/test.java b/java/typeMigration/testData/refactoring/wildcard/consumerUnbounded/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/consumerUnbounded/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/consumerUnbounded/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/consumerUnbounded/before/test.java b/java/typeMigration/testData/refactoring/wildcard/consumerUnbounded/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/consumerUnbounded/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/consumerUnbounded/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/after/test.java b/java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/before/test.java b/java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToChildType/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/after/test.java b/java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/before/test.java b/java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToSuperType/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/after/test.java b/java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/before/test.java b/java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getAssignmentExtendsToType/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getExtends/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/getExtends/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getExtends/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/getExtends/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getExtends/after/test.java b/java/typeMigration/testData/refactoring/wildcard/getExtends/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getExtends/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getExtends/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getExtends/before/test.java b/java/typeMigration/testData/refactoring/wildcard/getExtends/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getExtends/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getExtends/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getSuper/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/getSuper/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getSuper/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/getSuper/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getSuper/after/test.java b/java/typeMigration/testData/refactoring/wildcard/getSuper/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getSuper/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getSuper/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getSuper/before/test.java b/java/typeMigration/testData/refactoring/wildcard/getSuper/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getSuper/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getSuper/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getUnbounded/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/getUnbounded/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getUnbounded/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/getUnbounded/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getUnbounded/after/test.java b/java/typeMigration/testData/refactoring/wildcard/getUnbounded/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getUnbounded/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getUnbounded/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/getUnbounded/before/test.java b/java/typeMigration/testData/refactoring/wildcard/getUnbounded/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/getUnbounded/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/getUnbounded/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/lengthSize/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/lengthSize/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/lengthSize/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/lengthSize/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/lengthSize/after/test.java b/java/typeMigration/testData/refactoring/wildcard/lengthSize/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/lengthSize/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/lengthSize/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/lengthSize/before/test.java b/java/typeMigration/testData/refactoring/wildcard/lengthSize/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/lengthSize/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/lengthSize/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/after/test.java b/java/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/before/test.java b/java/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerCollectionChanged/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerExtends/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/producerExtends/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerExtends/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/producerExtends/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerExtends/after/test.java b/java/typeMigration/testData/refactoring/wildcard/producerExtends/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerExtends/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerExtends/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerExtends/before/test.java b/java/typeMigration/testData/refactoring/wildcard/producerExtends/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerExtends/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerExtends/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/after/test.java b/java/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/before/test.java b/java/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerExtendsCollectionChanged/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/after/test.java b/java/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/before/test.java b/java/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerExtendsFailToStopAtWildcard/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/after/test.java b/java/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/before/test.java b/java/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerFailToStopAtWildcard/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/after/test.java b/java/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/before/test.java b/java/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerStopAtWildcard/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerSuper/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/producerSuper/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerSuper/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/producerSuper/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerSuper/after/test.java b/java/typeMigration/testData/refactoring/wildcard/producerSuper/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerSuper/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerSuper/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerSuper/before/test.java b/java/typeMigration/testData/refactoring/wildcard/producerSuper/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerSuper/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerSuper/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerUnbounded/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/producerUnbounded/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerUnbounded/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/producerUnbounded/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerUnbounded/after/test.java b/java/typeMigration/testData/refactoring/wildcard/producerUnbounded/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerUnbounded/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerUnbounded/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/producerUnbounded/before/test.java b/java/typeMigration/testData/refactoring/wildcard/producerUnbounded/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/producerUnbounded/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/producerUnbounded/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/after/test.java b/java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/before/test.java b/java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerExtends/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/after/test.java b/java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/before/test.java b/java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalConsumerSuper/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/after/test.java b/java/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/before/test.java b/java/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalProducerExtends/before/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/after/Test.items b/java/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/after/Test.items
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/after/Test.items
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/after/Test.items
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/after/test.java b/java/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/after/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/after/test.java
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/after/test.java
diff --git a/plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/before/test.java b/java/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/before/test.java
similarity index 100%
rename from plugins/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/before/test.java
rename to java/typeMigration/testData/refactoring/wildcard/threadLocalProducerSuper/before/test.java
diff --git a/plugins/typeMigration/typeMigration.iml b/java/typeMigration/typeMigration.iml
similarity index 100%
rename from plugins/typeMigration/typeMigration.iml
rename to java/typeMigration/typeMigration.iml
diff --git a/jps/jps-builders/src/org/jetbrains/jps/api/CmdlineProtoUtil.java b/jps/jps-builders/src/org/jetbrains/jps/api/CmdlineProtoUtil.java
index 28aaeca..228ba50 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/api/CmdlineProtoUtil.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/api/CmdlineProtoUtil.java
@@ -139,6 +139,10 @@
.setType(CmdlineRemoteProto.Message.ControllerMessage.Type.CANCEL_BUILD_COMMAND).build();
}
+ public static BuilderMessage createCompileProgressMessageResponse(String text) {
+ return createCompileMessage(BuildMessage.Kind.PROGRESS, text, null, -1L, -1L, -1L, -1, -1, -1.0f);
+ }
+
public static BuilderMessage createCompileProgressMessageResponse(String text, float done) {
return createCompileMessage(BuildMessage.Kind.PROGRESS, text, null, -1L, -1L, -1L, -1, -1, done);
}
diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java
index baa67a0..88fdef9 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java
@@ -56,6 +56,7 @@
import org.jetbrains.jps.incremental.storage.OneToManyPathsMapping;
import org.jetbrains.jps.incremental.storage.OutputToTargetRegistry;
import org.jetbrains.jps.indices.ModuleExcludeIndex;
+import org.jetbrains.jps.javac.JavacMain;
import org.jetbrains.jps.model.java.JpsJavaExtensionService;
import org.jetbrains.jps.model.java.compiler.JpsJavaCompilerConfiguration;
import org.jetbrains.jps.model.module.JpsModule;
@@ -176,6 +177,7 @@
final LowMemoryWatcher memWatcher = LowMemoryWatcher.register(new Runnable() {
@Override
public void run() {
+ JavacMain.clearCompilerZipFileCache();
myProjectDescriptor.dataManager.flush(false);
myProjectDescriptor.timestamps.getStorage().force();
}
diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java
index 52e8b28..77538c6 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java
@@ -896,10 +896,10 @@
break;
case MANDATORY_WARNING:
case WARNING:
- case NOTE:
kind = BuildMessage.Kind.WARNING;
myWarningCount++;
break;
+ case NOTE:
default:
kind = BuildMessage.Kind.INFO;
}
diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/messages/BuilderStatisticsMessage.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/messages/BuilderStatisticsMessage.java
index f58546f..3a54a4e 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/incremental/messages/BuilderStatisticsMessage.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/messages/BuilderStatisticsMessage.java
@@ -23,7 +23,7 @@
private final long myElapsedTimeMs;
public BuilderStatisticsMessage(String builderName, long elapsedTimeMs) {
- super(builderName + " elapsed " + elapsedTimeMs + "ms", Kind.INFO);
+ super("", Kind.INFO);
myBuilderName = builderName;
myElapsedTimeMs = elapsedTimeMs;
}
diff --git a/jps/jps-builders/src/org/jetbrains/jps/javac/JavacMain.java b/jps/jps-builders/src/org/jetbrains/jps/javac/JavacMain.java
index c5b6d86..ac4f4a0 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/javac/JavacMain.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/javac/JavacMain.java
@@ -452,4 +452,59 @@
}
}
+ private static class ZipFileIndexCleanupDataHolder {
+ @Nullable
+ static final Method cacheInstanceGetter;
+ @Nullable
+ static final Method cacheClearMethod;
+
+ static {
+ Method getterMethod = null;
+ Method clearMethod = null;
+ try {
+ //trying JDK 6
+ clearMethod = Class.forName("com.sun.tools.javac.zip.ZipFileIndex").getDeclaredMethod("clearCache");
+ clearMethod.setAccessible(true);
+ }
+ catch (Throwable e) {
+ try {
+ final Class<?> cacheClass = Class.forName("com.sun.tools.javac.file.ZipFileIndexCache");
+ clearMethod = cacheClass.getDeclaredMethod("clearCache");
+ getterMethod = cacheClass.getDeclaredMethod("getSharedInstance");
+ clearMethod.setAccessible(true);
+ getterMethod.setAccessible(true);
+ }
+ catch (Throwable ignored2) {
+ clearMethod = null;
+ getterMethod = null;
+ }
+ }
+
+ cacheInstanceGetter = getterMethod;
+ cacheClearMethod = clearMethod;
+ }
+ }
+
+ private static volatile boolean zipCacheCleanupPossible = true;
+
+ public static void clearCompilerZipFileCache() {
+ if (zipCacheCleanupPossible) {
+ final Method clearMethod = ZipFileIndexCleanupDataHolder.cacheClearMethod;
+ if (clearMethod != null) {
+ final Method getter = ZipFileIndexCleanupDataHolder.cacheInstanceGetter;
+ try {
+ Object instance = getter != null? getter.invoke(null) : null;
+ clearMethod.invoke(instance);
+ }
+ catch (Throwable e) {
+ zipCacheCleanupPossible = false;
+ }
+ }
+ else {
+ zipCacheCleanupPossible = false;
+ }
+ }
+ }
+
+
}
diff --git a/jps/jps-builders/src/org/jetbrains/jps/javac/OptimizedFileManager17.java b/jps/jps-builders/src/org/jetbrains/jps/javac/OptimizedFileManager17.java
index 16b6b68..a287947 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/javac/OptimizedFileManager17.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/javac/OptimizedFileManager17.java
@@ -33,6 +33,7 @@
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharsetDecoder;
+import java.nio.file.LinkOption;
import java.util.*;
/**
@@ -362,12 +363,20 @@
if (kind == Kind.OTHER && getKind() != kind) {
return false;
}
- String n = cn + kind.extension;
+ final String n = cn + kind.extension;
if (name.equals(n)) {
return true;
}
if (name.equalsIgnoreCase(n)) {
- return file.getName().equals(n);
+ // if we are on a case-insensitive file system,
+ // try to compare against the real (exactly as on the disk) file name
+ //
+ try {
+ //noinspection Since15
+ return n.equals(file.toPath().toRealPath(LinkOption.NOFOLLOW_LINKS).getFileName().toString());
+ }
+ catch (IOException ignored) {
+ }
}
return false;
}
diff --git a/jps/jps-builders/testSrc/org/jetbrains/jps/builders/ModuleClasspathTest.kt b/jps/jps-builders/testSrc/org/jetbrains/jps/builders/ModuleClasspathTest.kt
index 9d2960d..b76196e 100644
--- a/jps/jps-builders/testSrc/org/jetbrains/jps/builders/ModuleClasspathTest.kt
+++ b/jps/jps-builders/testSrc/org/jetbrains/jps/builders/ModuleClasspathTest.kt
@@ -25,7 +25,6 @@
import java.io.File
import com.intellij.openapi.util.text.StringUtil
import org.junit.Assert
-import java.util.Collections
/**
* @author nik
@@ -79,7 +78,7 @@
private fun assertClasspath(expected: List<String>, classpath: List<String>) {
val basePath = FileUtil.toSystemIndependentName(File(getProjectPath()).getParentFile()!!.getAbsolutePath()) + "/"
val actual = toSystemIndependentPaths(classpath).map { StringUtil.trimStart(it, basePath) }
- Assert.assertEquals(expected.makeString("\n"), actual.makeString("\n"))
+ Assert.assertEquals(expected.join("\n"), actual.join("\n"))
}
private fun toSystemIndependentPaths(classpath: List<String>): List<String> {
diff --git a/jps/lib/optimizedFileManager.jar b/jps/lib/optimizedFileManager.jar
index 5f5aa89..59212c9 100644
--- a/jps/lib/optimizedFileManager.jar
+++ b/jps/lib/optimizedFileManager.jar
Binary files differ
diff --git a/jps/standalone-builder/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy b/jps/standalone-builder/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy
index 627c9f8..d7e52c6 100644
--- a/jps/standalone-builder/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy
+++ b/jps/standalone-builder/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -14,21 +14,23 @@
* limitations under the License.
*/
package org.jetbrains.jps.idea
+
/**
* @author max
*/
public class IdeaProjectLoader {
public static String guessHome(Script script) {
- File home = new File(script["gant.file"].substring("file:".length()))
+ String uri = script["gant.file"]
+ File home = new File(new URI(uri).getSchemeSpecificPart())
while (home != null) {
- if (home.isDirectory()) {
- if (new File(home, ".idea").exists()) return home.getCanonicalPath()
+ if (home.isDirectory() && new File(home, ".idea").exists()) {
+ return home.getCanonicalPath()
}
home = home.getParentFile()
}
- return null
+ throw new IllegalArgumentException("Cannot guess project home from '" + uri + "'")
}
}
diff --git a/lib/ecj-4.3.2.jar b/lib/ecj-4.3.2.jar
deleted file mode 100644
index fd4c47a..0000000
--- a/lib/ecj-4.3.2.jar
+++ /dev/null
Binary files differ
diff --git a/lib/ecj-4.4.jar b/lib/ecj-4.4.jar
new file mode 100644
index 0000000..98f82dc
--- /dev/null
+++ b/lib/ecj-4.4.jar
Binary files differ
diff --git a/lib/jh.jar b/lib/jh.jar
index c38233a..d0ad2e9 100644
--- a/lib/jh.jar
+++ b/lib/jh.jar
Binary files differ
diff --git a/lib/required_for_dist.txt b/lib/required_for_dist.txt
index 77d0b5b..6ea1f4d 100644
--- a/lib/required_for_dist.txt
+++ b/lib/required_for_dist.txt
@@ -14,7 +14,7 @@
fluent-hc-4.3.2.jar
freemarker.jar
httpmime-4.3.2.jar
-ecj-4.3.2.jar
+ecj-4.4.jar
groovy-all-2.2.1.jar
gson-2.2.4.jar
guava-17.0.jar
diff --git a/lib/src/jhsrc.jar b/lib/src/jhsrc.jar
index d9c5b94..42e4b06 100644
--- a/lib/src/jhsrc.jar
+++ b/lib/src/jhsrc.jar
Binary files differ
diff --git a/native/WinLauncher/WinLauncher/WinLauncher.cpp b/native/WinLauncher/WinLauncher/WinLauncher.cpp
index a934a88..3249a9a 100644
--- a/native/WinLauncher/WinLauncher/WinLauncher.cpp
+++ b/native/WinLauncher/WinLauncher/WinLauncher.cpp
@@ -169,12 +169,16 @@
bool FindJVMInRegistry()
{
#ifndef _M_X64
+ if (FindJVMInRegistryWithVersion("1.8", true))
+ return true;
if (FindJVMInRegistryWithVersion("1.7", true))
return true;
if (FindJVMInRegistryWithVersion("1.6", true))
return true;
#endif
+ if (FindJVMInRegistryWithVersion("1.8", false))
+ return true;
if (FindJVMInRegistryWithVersion("1.7", false))
return true;
if (FindJVMInRegistryWithVersion("1.6", false))
diff --git a/native/fileWatcher/fileWatcher3.cpp b/native/fileWatcher/fileWatcher3.cpp
index 7e3669e..07dbe52 100644
--- a/native/fileWatcher/fileWatcher3.cpp
+++ b/native/fileWatcher/fileWatcher3.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -14,20 +14,23 @@
* limitations under the License.
*/
-#include "stdafx.h"
+#include <process.h>
+#include <stdio.h>
+#include <tchar.h>
+#include <windows.h>
struct WatchRootInfo {
- char driveLetter;
- HANDLE hThread;
- HANDLE hStopEvent;
- bool bInitialized;
- bool bUsed;
- bool bFailed;
+ char driveLetter;
+ HANDLE hThread;
+ HANDLE hStopEvent;
+ bool bInitialized;
+ bool bUsed;
+ bool bFailed;
};
struct WatchRoot {
- char *path;
- WatchRoot *next;
+ char *path;
+ WatchRoot *next;
};
const int ROOT_COUNT = 26;
@@ -38,139 +41,123 @@
CRITICAL_SECTION csOutput;
-void NormalizeSlashes(char *path, char slash)
-{
- for(char *p=path; *p; p++)
- if (*p == '\\' || *p == '/')
- *p = slash;
+void NormalizeSlashes(char *path, char slash) {
+ for (char *p = path; *p; p++)
+ if (*p == '\\' || *p == '/')
+ *p = slash;
}
// -- Watchable root checks ---------------------------------------------------
-bool IsNetworkDrive(const char *name)
-{
+bool IsNetworkDrive(const char *name) {
const int BUF_SIZE = 1024;
char buffer[BUF_SIZE];
- UNIVERSAL_NAME_INFO* uni = (UNIVERSAL_NAME_INFO*) buffer;
+ UNIVERSAL_NAME_INFO *uni = (UNIVERSAL_NAME_INFO *) buffer;
DWORD size = BUF_SIZE;
DWORD result = WNetGetUniversalNameA(
- name, // path for network resource
- UNIVERSAL_NAME_INFO_LEVEL, // level of information
- buffer, // name buffer
- &size // size of buffer
+ name, // path for network resource
+ UNIVERSAL_NAME_INFO_LEVEL, // level of information
+ buffer, // name buffer
+ &size // size of buffer
);
return result == NO_ERROR;
}
-bool IsUnwatchableFS(const char *path)
-{
+bool IsUnwatchableFS(const char *path) {
char volumeName[MAX_PATH];
- char fsName[MAX_PATH];
- DWORD fsFlags;
- DWORD maxComponentLength;
- SetErrorMode(SEM_FAILCRITICALERRORS);
- if (!GetVolumeInformationA(path, volumeName, MAX_PATH-1, NULL, &maxComponentLength, &fsFlags, fsName, MAX_PATH-1))
- return false;
- if (strcmp(fsName, "NTFS") && strcmp(fsName, "FAT") && strcmp(fsName, "FAT32") && stricmp(fsName, "exFAT"))
- return true;
+ char fsName[MAX_PATH];
+ DWORD fsFlags;
+ DWORD maxComponentLength;
+ SetErrorMode(SEM_FAILCRITICALERRORS);
+ if (!GetVolumeInformationA(path, volumeName, MAX_PATH - 1, NULL, &maxComponentLength, &fsFlags, fsName, MAX_PATH - 1))
+ return false;
+ if (strcmp(fsName, "NTFS") && strcmp(fsName, "FAT") && strcmp(fsName, "FAT32") && _stricmp(fsName, "exFAT") && _stricmp(fsName, "reFS"))
+ return true;
- if (!strcmp(fsName, "NTFS") && maxComponentLength != 255 && !(fsFlags & FILE_SUPPORTS_REPARSE_POINTS))
- {
- // SAMBA reports itself as NTFS
- return true;
- }
+ if (!strcmp(fsName, "NTFS") && maxComponentLength != 255 && !(fsFlags & FILE_SUPPORTS_REPARSE_POINTS)) {
+ // SAMBA reports itself as NTFS
+ return true;
+ }
- return false;
+ return false;
}
-bool IsWatchable(const char *path)
-{
- if (IsNetworkDrive(path))
- return false;
- if (IsUnwatchableFS(path))
- return false;
- return true;
+bool IsWatchable(const char *path) {
+ if (IsNetworkDrive(path))
+ return false;
+ if (IsUnwatchableFS(path))
+ return false;
+ return true;
}
// -- Substed drive checks ----------------------------------------------------
-void PrintRemapForSubstDrive(char driveLetter)
-{
+void PrintRemapForSubstDrive(char driveLetter) {
const int BUF_SIZE = 1024;
char targetPath[BUF_SIZE];
- char rootPath[8];
- sprintf_s(rootPath, 8, "%c:", driveLetter);
+ char rootPath[8];
+ sprintf_s(rootPath, 8, "%c:", driveLetter);
DWORD result = QueryDosDeviceA(rootPath, targetPath, BUF_SIZE);
if (result == 0) {
return;
}
- else
- {
- if (targetPath[0] == '\\' && targetPath[1] == '?' && targetPath[2] == '?' && targetPath[3] == '\\')
- {
- // example path: \??\C:\jetbrains\idea
- NormalizeSlashes(targetPath, '/');
- printf("%c:\n%s\n", driveLetter, targetPath+4);
- }
+ else {
+ if (targetPath[0] == '\\' && targetPath[1] == '?' && targetPath[2] == '?' && targetPath[3] == '\\') {
+ // example path: \??\C:\jetbrains\idea
+ NormalizeSlashes(targetPath, '/');
+ printf("%c:\n%s\n", driveLetter, targetPath + 4);
+ }
}
}
-void PrintRemapForSubstDrives()
-{
- for(int i=0; i<ROOT_COUNT; i++)
- {
- if (watchRootInfos [i].bUsed)
- {
- PrintRemapForSubstDrive(watchRootInfos [i].driveLetter);
- }
- }
+void PrintRemapForSubstDrives() {
+ for (int i = 0; i < ROOT_COUNT; i++) {
+ if (watchRootInfos[i].bUsed) {
+ PrintRemapForSubstDrive(watchRootInfos[i].driveLetter);
+ }
+ }
}
// -- Mount point enumeration -------------------------------------------------
const int BUFSIZE = 1024;
-void PrintDirectoryReparsePoint(const char *path)
-{
- int size = strlen(path)+2;
- char *directory = (char *) malloc(size);
- strcpy_s(directory, size, path);
- NormalizeSlashes(directory, '\\');
- if (directory [strlen(directory)-1] != '\\')
- strcat_s(directory, size, "\\");
+void PrintDirectoryReparsePoint(const char *path) {
+ int size = strlen(path) + 2;
+ char *directory = (char *) malloc(size);
+ strcpy_s(directory, size, path);
+ NormalizeSlashes(directory, '\\');
+ if (directory[strlen(directory) - 1] != '\\')
+ strcat_s(directory, size, "\\");
- char volumeName[_MAX_PATH];
- int rc = GetVolumeNameForVolumeMountPointA(directory, volumeName, sizeof(volumeName));
- if (rc)
- {
- char volumePathNames[_MAX_PATH];
- DWORD returnLength;
- rc = GetVolumePathNamesForVolumeNameA(volumeName, volumePathNames, sizeof(volumePathNames), &returnLength);
- if (rc)
- {
- char *p = volumePathNames;
- while(*p)
- {
- if (_stricmp(p, directory)) // if it's not the path we've already found
- {
- NormalizeSlashes(directory, '/');
- NormalizeSlashes(p, '/');
- puts(directory);
- puts(p);
- }
- p += strlen(p)+1;
- }
- }
- }
- free(directory);
+ char volumeName[_MAX_PATH];
+ int rc = GetVolumeNameForVolumeMountPointA(directory, volumeName, sizeof(volumeName));
+ if (rc) {
+ char volumePathNames[_MAX_PATH];
+ DWORD returnLength;
+ rc = GetVolumePathNamesForVolumeNameA(volumeName, volumePathNames, sizeof(volumePathNames), &returnLength);
+ if (rc) {
+ char *p = volumePathNames;
+ while (*p) {
+ if (_stricmp(p, directory)) // if it's not the path we've already found
+ {
+ NormalizeSlashes(directory, '/');
+ NormalizeSlashes(p, '/');
+ puts(directory);
+ puts(p);
+ }
+ p += strlen(p) + 1;
+ }
+ }
+ }
+ free(directory);
}
-bool PrintMountPointsForVolume(HANDLE hVol, const char* volumePath, char *Buf)
-{
+bool PrintMountPointsForVolume(HANDLE hVol, const char *volumePath, char *Buf) {
HANDLE hPt; // handle for mount point scan
char Path[BUFSIZE]; // string buffer for mount points
DWORD dwSysFlags; // flags that describe the file system
@@ -182,39 +169,38 @@
// Detect support for reparse points, and therefore for volume
// mount points, which are implemented using reparse points.
- if (! (dwSysFlags & FILE_SUPPORTS_REPARSE_POINTS)) {
- return true;
+ if (!(dwSysFlags & FILE_SUPPORTS_REPARSE_POINTS)) {
+ return true;
}
// Start processing mount points on this volume.
hPt = FindFirstVolumeMountPointA(
- Buf, // root path of volume to be scanned
- Path, // pointer to output string
- BUFSIZE // size of output buffer
+ Buf, // root path of volume to be scanned
+ Path, // pointer to output string
+ BUFSIZE // size of output buffer
);
// Shall we error out?
if (hPt == INVALID_HANDLE_VALUE) {
- return GetLastError() != ERROR_ACCESS_DENIED;
+ return GetLastError() != ERROR_ACCESS_DENIED;
}
// Process the volume mount point.
- char *buf = new char[MAX_PATH];
+ char *buf = new char[MAX_PATH];
do {
- strcpy_s(buf, MAX_PATH, volumePath);
- strcat_s(buf, MAX_PATH, Path);
- PrintDirectoryReparsePoint(buf);
+ strcpy_s(buf, MAX_PATH, volumePath);
+ strcat_s(buf, MAX_PATH, Path);
+ PrintDirectoryReparsePoint(buf);
} while (FindNextVolumeMountPointA(hPt, Path, BUFSIZE));
FindVolumeMountPointClose(hPt);
- return true;
+ return true;
}
-bool PrintMountPoints(const char *path)
-{
- char volumeUniqueName[128];
- BOOL res = GetVolumeNameForVolumeMountPointA(path, volumeUniqueName, 128);
- if (!res) {
+bool PrintMountPoints(const char *path) {
+ char volumeUniqueName[128];
+ BOOL res = GetVolumeNameForVolumeMountPointA(path, volumeUniqueName, 128);
+ if (!res) {
return false;
}
@@ -222,7 +208,7 @@
HANDLE hVol; // handle for the volume scan
// Open a scan for volumes.
- hVol = FindFirstVolumeA(buf, BUFSIZE );
+ hVol = FindFirstVolumeA(buf, BUFSIZE);
// Shall we error out?
if (hVol == INVALID_HANDLE_VALUE) {
@@ -230,329 +216,286 @@
}
bool success = true;
- do {
- if (!strcmp(buf, volumeUniqueName)) {
- success = PrintMountPointsForVolume(hVol, path, buf);
- if (!success) break;
- }
+ do {
+ if (!strcmp(buf, volumeUniqueName)) {
+ success = PrintMountPointsForVolume(hVol, path, buf);
+ if (!success) break;
+ }
} while (FindNextVolumeA(hVol, buf, BUFSIZE));
FindVolumeClose(hVol);
- return success;
+ return success;
}
// -- Searching for mount points in watch roots (fallback) --------------------
-void PrintDirectoryReparsePoints(const char *path)
-{
- char *const buf = _strdup(path);
- while(strchr(buf, '/'))
- {
- DWORD attributes = GetFileAttributesA(buf);
- if (attributes == INVALID_FILE_ATTRIBUTES)
- break;
- if (attributes & FILE_ATTRIBUTE_REPARSE_POINT)
- {
- PrintDirectoryReparsePoint(buf);
- }
- char *pSlash = strrchr(buf, '/');
- if (pSlash)
- {
- *pSlash = '\0';
- }
- }
- free(buf);
+void PrintDirectoryReparsePoints(const char *path) {
+ char *const buf = _strdup(path);
+ while (strchr(buf, '/')) {
+ DWORD attributes = GetFileAttributesA(buf);
+ if (attributes == INVALID_FILE_ATTRIBUTES)
+ break;
+ if (attributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ PrintDirectoryReparsePoint(buf);
+ }
+ char *pSlash = strrchr(buf, '/');
+ if (pSlash) {
+ *pSlash = '\0';
+ }
+ }
+ free(buf);
}
// This is called if we got an ERROR_ACCESS_DENIED when trying to enumerate all mount points for volume.
// In this case, we walk the directory tree up from each watch root, and look at each parent directory
// to check whether it's a reparse point.
-void PrintWatchRootReparsePoints()
-{
- WatchRoot *pWatchRoot = firstWatchRoot;
- while(pWatchRoot)
- {
- PrintDirectoryReparsePoints(pWatchRoot->path);
- pWatchRoot = pWatchRoot->next;
- }
+void PrintWatchRootReparsePoints() {
+ WatchRoot *pWatchRoot = firstWatchRoot;
+ while (pWatchRoot) {
+ PrintDirectoryReparsePoints(pWatchRoot->path);
+ pWatchRoot = pWatchRoot->next;
+ }
}
// -- Watcher thread ----------------------------------------------------------
-void PrintChangeInfo(char *rootPath, FILE_NOTIFY_INFORMATION *info)
-{
- char FileNameBuffer[_MAX_PATH];
- int converted = WideCharToMultiByte(CP_ACP, 0, info->FileName, info->FileNameLength/sizeof(WCHAR), FileNameBuffer, _MAX_PATH-1, NULL, NULL);
- FileNameBuffer[converted] = '\0';
- char *command;
- if (info->Action == FILE_ACTION_ADDED || info->Action == FILE_ACTION_RENAMED_OLD_NAME)
- {
- command = "CREATE";
- }
- else if (info->Action == FILE_ACTION_REMOVED || info->Action == FILE_ACTION_RENAMED_OLD_NAME)
- {
- command = "DELETE";
- }
- else if (info->Action == FILE_ACTION_MODIFIED)
- {
- command = "CHANGE";
- }
- else
- {
- return; // unknown command
- }
+void PrintChangeInfo(char *rootPath, FILE_NOTIFY_INFORMATION *info) {
+ char FileNameBuffer[_MAX_PATH];
+ int converted = WideCharToMultiByte(CP_ACP, 0, info->FileName, info->FileNameLength / sizeof(WCHAR), FileNameBuffer, _MAX_PATH - 1, NULL, NULL);
+ FileNameBuffer[converted] = '\0';
+ char *command;
+ if (info->Action == FILE_ACTION_ADDED || info->Action == FILE_ACTION_RENAMED_OLD_NAME) {
+ command = "CREATE";
+ }
+ else if (info->Action == FILE_ACTION_REMOVED || info->Action == FILE_ACTION_RENAMED_OLD_NAME) {
+ command = "DELETE";
+ }
+ else if (info->Action == FILE_ACTION_MODIFIED) {
+ command = "CHANGE";
+ }
+ else {
+ return; // unknown command
+ }
- EnterCriticalSection(&csOutput);
- puts(command);
- printf("%s", rootPath);
- puts(FileNameBuffer);
- fflush(stdout);
- LeaveCriticalSection(&csOutput);
+ EnterCriticalSection(&csOutput);
+ puts(command);
+ printf("%s", rootPath);
+ puts(FileNameBuffer);
+ fflush(stdout);
+ LeaveCriticalSection(&csOutput);
}
-void PrintEverythingChangedUnderRoot(char *rootPath)
-{
- EnterCriticalSection(&csOutput);
- puts("RECDIRTY");
- puts(rootPath);
- fflush(stdout);
- LeaveCriticalSection(&csOutput);
+void PrintEverythingChangedUnderRoot(char *rootPath) {
+ EnterCriticalSection(&csOutput);
+ puts("RECDIRTY");
+ puts(rootPath);
+ fflush(stdout);
+ LeaveCriticalSection(&csOutput);
}
-DWORD WINAPI WatcherThread(void *param)
-{
- WatchRootInfo *info = (WatchRootInfo *) param;
+DWORD WINAPI WatcherThread(void *param) {
+ WatchRootInfo *info = (WatchRootInfo *) param;
- OVERLAPPED overlapped;
- memset(&overlapped, 0, sizeof(overlapped));
- overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ OVERLAPPED overlapped;
+ memset(&overlapped, 0, sizeof(overlapped));
+ overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- char rootPath[8];
- sprintf_s(rootPath, 8, "%c:\\", info->driveLetter);
- HANDLE hRootDir = CreateFileA(rootPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, NULL);
+ char rootPath[8];
+ sprintf_s(rootPath, 8, "%c:\\", info->driveLetter);
+ HANDLE hRootDir = CreateFileA(rootPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, NULL);
- int buffer_size = 10240;
- char *buffer = new char[buffer_size];
+ int buffer_size = 10240;
+ char *buffer = new char[buffer_size];
- HANDLE handles [2];
- handles [0] = info->hStopEvent;
- handles [1] = overlapped.hEvent;
- while(true)
- {
- int rcDir = ReadDirectoryChangesW(hRootDir, buffer, buffer_size, TRUE,
- FILE_NOTIFY_CHANGE_FILE_NAME |
- FILE_NOTIFY_CHANGE_DIR_NAME |
- FILE_NOTIFY_CHANGE_ATTRIBUTES |
- FILE_NOTIFY_CHANGE_SIZE |
- FILE_NOTIFY_CHANGE_LAST_WRITE,
- NULL,
- &overlapped,
- NULL);
- if (rcDir == 0)
- {
- info->bFailed = true;
- break;
- }
+ HANDLE handles[2];
+ handles[0] = info->hStopEvent;
+ handles[1] = overlapped.hEvent;
+ while (true) {
+ int rcDir = ReadDirectoryChangesW(hRootDir, buffer, buffer_size, TRUE,
+ FILE_NOTIFY_CHANGE_FILE_NAME |
+ FILE_NOTIFY_CHANGE_DIR_NAME |
+ FILE_NOTIFY_CHANGE_ATTRIBUTES |
+ FILE_NOTIFY_CHANGE_SIZE |
+ FILE_NOTIFY_CHANGE_LAST_WRITE,
+ NULL,
+ &overlapped,
+ NULL);
+ if (rcDir == 0) {
+ info->bFailed = true;
+ break;
+ }
- int rc = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
- if (rc == WAIT_OBJECT_0)
- {
- break;
- }
- if (rc == WAIT_OBJECT_0+1)
- {
- DWORD dwBytesReturned;
- if(!GetOverlappedResult(hRootDir, &overlapped, &dwBytesReturned, FALSE))
- {
- info->bFailed = true;
- break;
- }
+ int rc = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
+ if (rc == WAIT_OBJECT_0) {
+ break;
+ }
+ if (rc == WAIT_OBJECT_0 + 1) {
+ DWORD dwBytesReturned;
+ if (!GetOverlappedResult(hRootDir, &overlapped, &dwBytesReturned, FALSE)) {
+ info->bFailed = true;
+ break;
+ }
- if (dwBytesReturned == 0)
- {
- // don't send dirty too much, everything is changed anyway
- if (WaitForSingleObject(info->hStopEvent, 500) == WAIT_OBJECT_0)
- break;
+ if (dwBytesReturned == 0) {
+ // don't send dirty too much, everything is changed anyway
+ if (WaitForSingleObject(info->hStopEvent, 500) == WAIT_OBJECT_0)
+ break;
- // Got a buffer overflow => current changes lost => send RECDIRTY on root
- PrintEverythingChangedUnderRoot(rootPath);
- } else {
- FILE_NOTIFY_INFORMATION *info = (FILE_NOTIFY_INFORMATION *) buffer;
- while(true)
- {
- PrintChangeInfo(rootPath, info);
- if (!info->NextEntryOffset)
- break;
- info = (FILE_NOTIFY_INFORMATION *) ((char *) info + info->NextEntryOffset);
- }
- }
- }
- }
- CloseHandle(overlapped.hEvent);
- CloseHandle(hRootDir);
- delete[] buffer;
- return 0;
+ // Got a buffer overflow => current changes lost => send RECDIRTY on root
+ PrintEverythingChangedUnderRoot(rootPath);
+ } else {
+ FILE_NOTIFY_INFORMATION *info = (FILE_NOTIFY_INFORMATION *) buffer;
+ while (true) {
+ PrintChangeInfo(rootPath, info);
+ if (!info->NextEntryOffset)
+ break;
+ info = (FILE_NOTIFY_INFORMATION *)((char *) info + info->NextEntryOffset);
+ }
+ }
+ }
+ }
+ CloseHandle(overlapped.hEvent);
+ CloseHandle(hRootDir);
+ delete[] buffer;
+ return 0;
}
// -- Roots update ------------------------------------------------------------
-void MarkAllRootsUnused()
-{
- for(int i=0; i<ROOT_COUNT; i++)
- {
- watchRootInfos [i].bUsed = false;
- }
+void MarkAllRootsUnused() {
+ for (int i = 0; i < ROOT_COUNT; i++) {
+ watchRootInfos[i].bUsed = false;
+ }
}
-void StartRoot(WatchRootInfo *info)
-{
- info->hStopEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- info->hThread = CreateThread(NULL, 0, &WatcherThread, info, 0, NULL);
- info->bInitialized = true;
+void StartRoot(WatchRootInfo *info) {
+ info->hStopEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ info->hThread = CreateThread(NULL, 0, &WatcherThread, info, 0, NULL);
+ info->bInitialized = true;
}
-void StopRoot(WatchRootInfo *info)
-{
- SetEvent(info->hStopEvent);
- WaitForSingleObject(info->hThread, INFINITE);
- CloseHandle(info->hThread);
- CloseHandle(info->hStopEvent);
- info->bInitialized = false;
+void StopRoot(WatchRootInfo *info) {
+ SetEvent(info->hStopEvent);
+ WaitForSingleObject(info->hThread, INFINITE);
+ CloseHandle(info->hThread);
+ CloseHandle(info->hStopEvent);
+ info->bInitialized = false;
}
-void UpdateRoots()
-{
- char infoBuffer [256];
- strcpy_s(infoBuffer, "UNWATCHEABLE\n");
- for(int i=0; i<ROOT_COUNT; i++)
- {
- if (watchRootInfos [i].bInitialized && (!watchRootInfos [i].bUsed || watchRootInfos [i].bFailed))
- {
- StopRoot(&watchRootInfos [i]);
- watchRootInfos [i].bFailed = false;
- }
- if (watchRootInfos [i].bUsed)
- {
- char rootPath[8];
- sprintf_s(rootPath, 8, "%c:\\", watchRootInfos [i].driveLetter);
- if (!IsWatchable(rootPath))
- {
- strcat_s(infoBuffer, rootPath);
- strcat_s(infoBuffer, "\n");
- continue;
- }
- if (!watchRootInfos [i].bInitialized)
- {
- StartRoot(&watchRootInfos [i]);
- }
- }
- }
- EnterCriticalSection(&csOutput);
- fprintf(stdout, "%s", infoBuffer);
- puts("#\nREMAP");
- PrintRemapForSubstDrives();
- bool printedMountPoints = true;
- for(int i=0; i<ROOT_COUNT; i++)
- {
- if (watchRootInfos [i].bUsed)
- {
- char rootPath[8];
- sprintf_s(rootPath, 8, "%c:\\", watchRootInfos [i].driveLetter);
- if (!PrintMountPoints(rootPath))
- printedMountPoints = false;
- }
- }
- if (!printedMountPoints)
- {
- PrintWatchRootReparsePoints();
- }
- puts("#");
- fflush(stdout);
- LeaveCriticalSection(&csOutput);
+void UpdateRoots() {
+ char infoBuffer[256];
+ strcpy_s(infoBuffer, "UNWATCHEABLE\n");
+ for (int i = 0; i < ROOT_COUNT; i++) {
+ if (watchRootInfos[i].bInitialized && (!watchRootInfos[i].bUsed || watchRootInfos[i].bFailed)) {
+ StopRoot(&watchRootInfos[i]);
+ watchRootInfos[i].bFailed = false;
+ }
+ if (watchRootInfos[i].bUsed) {
+ char rootPath[8];
+ sprintf_s(rootPath, 8, "%c:\\", watchRootInfos[i].driveLetter);
+ if (!IsWatchable(rootPath)) {
+ strcat_s(infoBuffer, rootPath);
+ strcat_s(infoBuffer, "\n");
+ continue;
+ }
+ if (!watchRootInfos[i].bInitialized) {
+ StartRoot(&watchRootInfos[i]);
+ }
+ }
+ }
+ EnterCriticalSection(&csOutput);
+ fprintf(stdout, "%s", infoBuffer);
+ puts("#\nREMAP");
+ PrintRemapForSubstDrives();
+ bool printedMountPoints = true;
+ for (int i = 0; i < ROOT_COUNT; i++) {
+ if (watchRootInfos[i].bUsed) {
+ char rootPath[8];
+ sprintf_s(rootPath, 8, "%c:\\", watchRootInfos[i].driveLetter);
+ if (!PrintMountPoints(rootPath))
+ printedMountPoints = false;
+ }
+ }
+ if (!printedMountPoints) {
+ PrintWatchRootReparsePoints();
+ }
+ puts("#");
+ fflush(stdout);
+ LeaveCriticalSection(&csOutput);
}
-void AddWatchRoot(const char *path)
-{
- WatchRoot *watchRoot = (WatchRoot *) malloc(sizeof(WatchRoot));
- watchRoot->next = NULL;
- watchRoot->path = _strdup(path);
- watchRoot->next = firstWatchRoot;
- firstWatchRoot = watchRoot;
+void AddWatchRoot(const char *path) {
+ WatchRoot *watchRoot = (WatchRoot *) malloc(sizeof(WatchRoot));
+ watchRoot->next = NULL;
+ watchRoot->path = _strdup(path);
+ watchRoot->next = firstWatchRoot;
+ firstWatchRoot = watchRoot;
}
-void FreeWatchRootsList()
-{
- WatchRoot *pWatchRoot = firstWatchRoot;
- WatchRoot *pNext;
- while(pWatchRoot)
- {
- pNext = pWatchRoot->next;
- free(pWatchRoot->path);
- free(pWatchRoot);
- pWatchRoot=pNext;
- }
- firstWatchRoot = NULL;
+void FreeWatchRootsList() {
+ WatchRoot *pWatchRoot = firstWatchRoot;
+ WatchRoot *pNext;
+ while (pWatchRoot) {
+ pNext = pWatchRoot->next;
+ free(pWatchRoot->path);
+ free(pWatchRoot);
+ pWatchRoot = pNext;
+ }
+ firstWatchRoot = NULL;
}
// -- Main - filewatcher protocol ---------------------------------------------
-int _tmain(int argc, _TCHAR* argv[])
-{
- InitializeCriticalSection(&csOutput);
+int _tmain(int argc, _TCHAR *argv[]) {
+ InitializeCriticalSection(&csOutput);
- for(int i=0; i<26; i++)
- {
- watchRootInfos [i].driveLetter = 'A' + i;
- watchRootInfos [i].bInitialized = false;
- watchRootInfos [i].bUsed = false;
- }
+ for (int i = 0; i < 26; i++) {
+ watchRootInfos[i].driveLetter = 'A' + i;
+ watchRootInfos[i].bInitialized = false;
+ watchRootInfos[i].bUsed = false;
+ }
- char buffer[8192];
- while(true)
- {
- if (!gets_s(buffer, sizeof(buffer)-1))
- break;
+ char buffer[8192];
+ while (true) {
+ if (!gets_s(buffer, sizeof(buffer) - 1))
+ break;
- if (!strcmp(buffer, "ROOTS"))
- {
- MarkAllRootsUnused();
- FreeWatchRootsList();
- bool failed = false;
- while(true)
- {
- if (!gets_s(buffer, sizeof(buffer)-1))
- {
- failed = true;
- break;
- }
- if (buffer [0] == '#')
- break;
- int driveLetterPos = 0;
- char *pDriveLetter = buffer;
- if (*pDriveLetter == '|')
- pDriveLetter++;
+ if (!strcmp(buffer, "ROOTS")) {
+ MarkAllRootsUnused();
+ FreeWatchRootsList();
+ bool failed = false;
+ while (true) {
+ if (!gets_s(buffer, sizeof(buffer) - 1)) {
+ failed = true;
+ break;
+ }
+ if (buffer[0] == '#')
+ break;
+ int driveLetterPos = 0;
+ char *pDriveLetter = buffer;
+ if (*pDriveLetter == '|')
+ pDriveLetter++;
- AddWatchRoot(pDriveLetter);
+ AddWatchRoot(pDriveLetter);
- _strupr_s(buffer, sizeof(buffer)-1);
- char driveLetter = *pDriveLetter;
- if (driveLetter >= 'A' && driveLetter <= 'Z')
- {
- watchRootInfos [driveLetter-'A'].bUsed = true;
- }
- }
- if (failed)
- break;
+ _strupr_s(buffer, sizeof(buffer) - 1);
+ char driveLetter = *pDriveLetter;
+ if (driveLetter >= 'A' && driveLetter <= 'Z') {
+ watchRootInfos[driveLetter - 'A'].bUsed = true;
+ }
+ }
+ if (failed)
+ break;
- UpdateRoots();
- }
- if (!strcmp(buffer, "EXIT"))
- break;
- }
+ UpdateRoots();
+ }
+ if (!strcmp(buffer, "EXIT"))
+ break;
+ }
- MarkAllRootsUnused();
- UpdateRoots();
+ MarkAllRootsUnused();
+ UpdateRoots();
- DeleteCriticalSection(&csOutput);
+ DeleteCriticalSection(&csOutput);
}
diff --git a/native/fileWatcher/fileWatcher3.rc b/native/fileWatcher/fileWatcher3.rc
index 713a55d..9006b54 100644
--- a/native/fileWatcher/fileWatcher3.rc
+++ b/native/fileWatcher/fileWatcher3.rc
@@ -1,100 +1,37 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
+#include <windows.h>
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
+#define FILE_VERSION 14,0,0,1
+#define FILE_VERSION_STR "14.0.0.1"
+#define APP_VERSION 14,0,0,0
+#define APP_VERSION_STR "14"
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Russian (Russia) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
-LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
-#pragma code_page(1251)
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
+#pragma code_page(65001)
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x17L
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
+FILEVERSION FILE_VERSION
+PRODUCTVERSION APP_VERSION
+FILEFLAGSMASK 0
+FILEFLAGS 0
+FILEOS VOS__WINDOWS32
+FILETYPE VFT_APP
+FILESUBTYPE 0
BEGIN
BLOCK "StringFileInfo"
BEGIN
- BLOCK "041904b0"
+ BLOCK "0000fde9"
BEGIN
VALUE "CompanyName", "JetBrains s.r.o."
- VALUE "FileDescription", "File System Notification Processor"
- VALUE "FileVersion", "1, 0, 0, 1"
+ VALUE "FileDescription", "Filesystem events processor"
+ VALUE "FileVersion", FILE_VERSION_STR
VALUE "InternalName", "fsnotifier"
- VALUE "LegalCopyright", "Copyright (C) 2008-13 JetBrains s.r.o."
+ VALUE "LegalCopyright", "Copyright (C) 2008-2014 JetBrains s.r.o."
VALUE "OriginalFilename", "fsnotifier.exe"
- VALUE "ProductName", "IntelliJ IDEA"
- VALUE "ProductVersion", "1, 0, 0, 1"
+ VALUE "ProductName", "IntelliJ Platform"
+ VALUE "ProductVersion", APP_VERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
- VALUE "Translation", 0x419, 1200
+ VALUE "Translation", 0, 0xfde9
END
END
-
-#endif // Russian (Russia) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/native/fileWatcher/fileWatcher3.sln b/native/fileWatcher/fileWatcher3.sln
index 821f143..7d39f3e 100644
--- a/native/fileWatcher/fileWatcher3.sln
+++ b/native/fileWatcher/fileWatcher3.sln
@@ -1,7 +1,9 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fileWatcher3", "fileWatcher3.vcproj", "{0EF2C2DB-0E16-4BC3-9927-9C51AF00EB57}"
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Express 2013 for Windows Desktop
+VisualStudioVersion = 12.0.21005.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fileWatcher3", "fileWatcher3.vcxproj", "{0EF2C2DB-0E16-4BC3-9927-9C51AF00EB57}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/native/fileWatcher/fileWatcher3.vcproj b/native/fileWatcher/fileWatcher3.vcproj
deleted file mode 100644
index 14ec211..0000000
--- a/native/fileWatcher/fileWatcher3.vcproj
+++ /dev/null
@@ -1,221 +0,0 @@
-<?xml version="1.0" encoding="windows-1251"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="fileWatcher3"
- ProjectGUID="{0EF2C2DB-0E16-4BC3-9927-9C51AF00EB57}"
- RootNamespace="fileWatcher3"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="mpr.lib"
- OutputFile="$(OutDir)\fsnotifier.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="mpr.lib"
- OutputFile="$(OutDir)\fsnotifier.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\fileWatcher3.cpp"
- >
- </File>
- <File
- RelativePath=".\stdafx.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\resource.h"
- >
- </File>
- <File
- RelativePath=".\stdafx.h"
- >
- </File>
- <File
- RelativePath=".\targetver.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- <File
- RelativePath=".\fileWatcher3.rc"
- >
- </File>
- </Filter>
- <File
- RelativePath=".\ReadMe.txt"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/native/fileWatcher/fileWatcher3.vcxproj b/native/fileWatcher/fileWatcher3.vcxproj
new file mode 100644
index 0000000..5115e0ae
--- /dev/null
+++ b/native/fileWatcher/fileWatcher3.vcxproj
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{0EF2C2DB-0E16-4BC3-9927-9C51AF00EB57}</ProjectGuid>
+ <RootNamespace>fileWatcher3</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <TargetName>fsnotifier</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <TargetName>fsnotifier</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader />
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader />
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="fileWatcher3.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="fileWatcher3.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/native/fileWatcher/fileWatcher3.vcxproj.filters b/native/fileWatcher/fileWatcher3.vcxproj.filters
new file mode 100644
index 0000000..e6b2270
--- /dev/null
+++ b/native/fileWatcher/fileWatcher3.vcxproj.filters
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="fileWatcher3.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="fileWatcher3.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/native/fileWatcher/resource.h b/native/fileWatcher/resource.h
deleted file mode 100644
index 08209cb..0000000
--- a/native/fileWatcher/resource.h
+++ /dev/null
@@ -1,14 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by fileWatcher3.rc
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 101
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1001
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/native/fileWatcher/stdafx.cpp b/native/fileWatcher/stdafx.cpp
deleted file mode 100644
index 4303745..0000000
--- a/native/fileWatcher/stdafx.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// fileWatcher3.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
diff --git a/native/fileWatcher/stdafx.h b/native/fileWatcher/stdafx.h
deleted file mode 100644
index 624e518..0000000
--- a/native/fileWatcher/stdafx.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include "targetver.h"
-
-#include <stdio.h>
-#include <tchar.h>
-#include <windows.h>
-#include <process.h>
-
-// TODO: reference additional headers your program requires here
diff --git a/native/fileWatcher/targetver.h b/native/fileWatcher/targetver.h
deleted file mode 100644
index 7021c2a..0000000
--- a/native/fileWatcher/targetver.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-
-// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
-// including the version specified.
-
-// Modify the following defines if you have to target a platform prior to the ones specified below.
-// Refer to MSDN for the latest info on corresponding values for different platforms.
-#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
-#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
-#endif
-
diff --git a/platform/analysis-api/src/com/intellij/analysis/AnalysisScope.java b/platform/analysis-api/src/com/intellij/analysis/AnalysisScope.java
index f1255ed..b18bb04 100644
--- a/platform/analysis-api/src/com/intellij/analysis/AnalysisScope.java
+++ b/platform/analysis-api/src/com/intellij/analysis/AnalysisScope.java
@@ -249,7 +249,7 @@
@NotNull
@Override
public Result visitFileEx(@NotNull VirtualFile file) {
- boolean ignored = fileIndex.isIgnored(file);
+ boolean ignored = fileIndex.isExcluded(file);
if (!ignored && !file.isDirectory()) {
files.add(file);
}
diff --git a/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java b/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java
index 492aa78..75a2eca 100644
--- a/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java
+++ b/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java
@@ -107,8 +107,8 @@
}
}
- private static class ImageHolder {
- private static final Image ourErrorMaskImage = ImageLoader.loadFromResource("/general/errorMask.png");
+ public static class ImageHolder {
+ public static final Image ourErrorMaskImage = ImageLoader.loadFromResource("/general/errorMask.png");
}
private static final int EMPTY_ICON_DIM = 12;
@@ -138,24 +138,35 @@
@NotNull
public static Icon createIconByMask(final Color renderColor) {
- return new Icon() {
- @Override
- public void paintIcon(Component c, Graphics g, int x, int y) {
- Graphics2D g2 = (Graphics2D)g;
- g2.drawImage(ImageHolder.ourErrorMaskImage, x, y, renderColor, null);
- }
+ return new SingleColorIconWithMask(renderColor);
+ }
+ public static class SingleColorIconWithMask implements Icon {
- @Override
- public int getIconWidth() {
- return EMPTY_ICON_DIM;
- }
+ private final Color myColor;
+ public SingleColorIconWithMask(final Color color) {
+ myColor = color;
+ }
- @Override
- public int getIconHeight() {
- return EMPTY_ICON_DIM;
- }
- };
+ public Color getColor() {
+ return myColor;
+ }
+
+ @Override
+ public void paintIcon(final Component c, final Graphics g, final int x, final int y) {
+ final Graphics2D g2 = (Graphics2D)g;
+ g2.drawImage(ImageHolder.ourErrorMaskImage, x, y, myColor, null);
+ }
+
+ @Override
+ public int getIconWidth() {
+ return EMPTY_ICON_DIM;
+ }
+
+ @Override
+ public int getIconHeight() {
+ return EMPTY_ICON_DIM;
+ }
}
}
diff --git a/platform/analysis-api/src/com/intellij/codeInspection/ex/ScopeToolState.java b/platform/analysis-api/src/com/intellij/codeInspection/ex/ScopeToolState.java
index e82cbe6..3a75f17 100644
--- a/platform/analysis-api/src/com/intellij/codeInspection/ex/ScopeToolState.java
+++ b/platform/analysis-api/src/com/intellij/codeInspection/ex/ScopeToolState.java
@@ -57,6 +57,10 @@
myLevel = level;
}
+ public ScopeToolState copy() {
+ return new ScopeToolState(myScopeName, myToolWrapper, myEnabled, myLevel);
+ }
+
@Nullable
public NamedScope getScope(Project project) {
if (myScope == null) {
diff --git a/platform/analysis-api/src/com/intellij/psi/search/scope/ProjectFilesScope.java b/platform/analysis-api/src/com/intellij/psi/search/scope/ProjectFilesScope.java
index 52313ea..e55cd9d 100644
--- a/platform/analysis-api/src/com/intellij/psi/search/scope/ProjectFilesScope.java
+++ b/platform/analysis-api/src/com/intellij/psi/search/scope/ProjectFilesScope.java
@@ -42,7 +42,7 @@
if (file == null) return false;
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
return holder.getProject().isInitialized()
- && !fileIndex.isIgnored(file)
+ && !fileIndex.isExcluded(file)
&& fileIndex.getContentRootForFile(file) != null;
}
});
diff --git a/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java b/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java
index e37a348..d8dc5d0 100644
--- a/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java
+++ b/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java
@@ -85,6 +85,7 @@
private final ExternalInfo myExternalInfo = new ExternalInfo();
@TestOnly
public static boolean INIT_INSPECTIONS = false;
+ private List<NamedScope> myScopes = Collections.emptyList();
@Override
public void setModified(final boolean modified) {
@@ -466,8 +467,10 @@
getTools(toolId, element.getProject()).disableTool(element);
}
- public void disableToolByDefault(@NotNull String toolId, Project project) {
- getToolDefaultState(toolId, project).setEnabled(false);
+ public void disableToolByDefault(@NotNull List<String> toolIds, Project project) {
+ for (final String toolId : toolIds) {
+ getToolDefaultState(toolId, project).setEnabled(false);
+ }
}
@NotNull
@@ -475,8 +478,10 @@
return getTools(toolId, project).getDefaultState();
}
- public void enableToolByDefault(@NotNull String toolId, Project project) {
- getToolDefaultState(toolId, project).setEnabled(true);
+ public void enableToolsByDefault(@NotNull List<String> toolIds, Project project) {
+ for (final String toolId : toolIds) {
+ getToolDefaultState(toolId, project).setEnabled(true);
+ }
}
public boolean wasInitialized() {
@@ -587,7 +592,6 @@
final ScopeToolState defaultState = toolList.getDefaultState();
tools.setDefaultState(copyToolSettings(defaultState.getTool()), defaultState.isEnabled(), defaultState.getLevel());
tools.removeAllScopes();
- tools.setEnabled(toolList.isEnabled());
final List<ScopeToolState> nonDefaultToolStates = toolList.getNonDefaultTools();
if (nonDefaultToolStates != null) {
for (ScopeToolState state : nonDefaultToolStates) {
@@ -601,6 +605,7 @@
}
}
}
+ tools.setEnabled(toolList.isEnabled());
}
}
catch (WriteExternalException e) {
@@ -649,11 +654,22 @@
getTools(inspectionTool, project).enableTool(namedScope, project);
}
+ public void enableTools(@NotNull List<String> inspectionTools, NamedScope namedScope, Project project) {
+ for (String inspectionTool : inspectionTools) {
+ enableTool(inspectionTool, namedScope, project);
+ }
+ }
+
@Override
public void disableTool(@NotNull String inspectionTool, NamedScope namedScope, @NotNull Project project) {
getTools(inspectionTool, project).disableTool(namedScope, project);
}
+ public void disableTools(@NotNull List<String> inspectionTools, NamedScope namedScope, @NotNull Project project) {
+ for (String inspectionTool : inspectionTools) {
+ disableTool(inspectionTool, namedScope, project);
+ }
+ }
@Override
public void disableTool(@NotNull String inspectionTool, Project project) {
@@ -833,10 +849,21 @@
return getTools(key.toString(), project).isEnabled(namedScope,project);
}
+ @Deprecated
public void removeScope(@NotNull String toolId, int scopeIdx, Project project) {
getTools(toolId, project).removeScope(scopeIdx);
}
+ public void removeScope(@NotNull String toolId, @NotNull NamedScope scope, Project project) {
+ getTools(toolId, project).removeScope(scope);
+ }
+
+ public void removeScopes(@NotNull List<String> toolIds, @NotNull NamedScope scope, Project project) {
+ for (final String toolId : toolIds) {
+ removeScope(toolId, scope, project);
+ }
+ }
+
public void removeAllScopes(@NotNull String toolId, Project project) {
getTools(toolId, project).removeAllScopes();
}
@@ -884,7 +911,13 @@
getTools(key.toString(), project).setLevel(level, scopeIdx, project);
}
- private ToolsImpl getTools(@NotNull String toolId, Project project) {
+ public void setErrorLevel(@NotNull List<HighlightDisplayKey> keys, @NotNull HighlightDisplayLevel level, int scopeIdx, Project project) {
+ for (HighlightDisplayKey key : keys) {
+ getTools(key.toString(), project).setLevel(level, scopeIdx, project);
+ }
+ }
+
+ public ToolsImpl getTools(@NotNull String toolId, Project project) {
initInspectionTools(project);
return myTools.get(toolId);
}
@@ -910,4 +943,11 @@
public boolean equals(Object o) {
return super.equals(o) && ((InspectionProfileImpl)o).getProfileManager() == getProfileManager();
}
+
+ /**
+ * @return list of used scopes for all inspections
+ */
+ public List<NamedScope> getUsedScopes() {
+ return myScopes;
+ }
}
diff --git a/platform/analysis-impl/src/com/intellij/codeInspection/ex/ToolsImpl.java b/platform/analysis-impl/src/com/intellij/codeInspection/ex/ToolsImpl.java
index 4208c85..b28dad4 100644
--- a/platform/analysis-impl/src/com/intellij/codeInspection/ex/ToolsImpl.java
+++ b/platform/analysis-impl/src/com/intellij/codeInspection/ex/ToolsImpl.java
@@ -58,9 +58,7 @@
private boolean myEnabled;
public ToolsImpl(@NotNull InspectionToolWrapper toolWrapper, @NotNull HighlightDisplayLevel level, boolean enabled, boolean enabledByDefault) {
- myShortName = toolWrapper.getShortName();
- myEnabled = enabled;
- myDefaultState = new ScopeToolState(CustomScopesProviderEx.getAllScope(), toolWrapper, enabledByDefault, level);
+ this(toolWrapper.getShortName(), new ScopeToolState(CustomScopesProviderEx.getAllScope(), toolWrapper, enabledByDefault, level), null, enabled);
}
@TestOnly
@@ -68,6 +66,13 @@
this(toolWrapper, level, enabled, enabled);
}
+ private ToolsImpl(@NotNull String shortName, @NotNull ScopeToolState defaultState, @Nullable List<ScopeToolState> tools, boolean enabled) {
+ myShortName = shortName;
+ myDefaultState = defaultState;
+ myTools = tools;
+ myEnabled = enabled;
+ }
+
@NotNull
public ScopeToolState addTool(@NotNull NamedScope scope, @NotNull InspectionToolWrapper toolWrapper, boolean enabled, @NotNull HighlightDisplayLevel level) {
return insertTool(scope, toolWrapper, enabled, level, myTools != null ? myTools.size() : 0);
@@ -78,13 +83,23 @@
return insertTool(scope, toolWrapper, enabled, level, 0);
}
+ public ScopeToolState addTool(@NotNull String scopeName, @NotNull InspectionToolWrapper toolWrapper, boolean enabled, @NotNull HighlightDisplayLevel level) {
+ return insertTool(new ScopeToolState(scopeName, toolWrapper, enabled, level), myTools != null ? myTools.size() : 0);
+ }
+
@NotNull
private ScopeToolState insertTool(@NotNull NamedScope scope, @NotNull InspectionToolWrapper toolWrapper, boolean enabled, @NotNull HighlightDisplayLevel level, int idx) {
+ return insertTool(new ScopeToolState(scope, toolWrapper, enabled, level), idx);
+ }
+
+ @NotNull
+ private ScopeToolState insertTool(@NotNull final ScopeToolState scopeToolState, final int idx) {
if (myTools == null) {
myTools = new ArrayList<ScopeToolState>();
- setEnabled(true);
+ if (scopeToolState.isEnabled()) {
+ setEnabled(true);
+ }
}
- final ScopeToolState scopeToolState = new ScopeToolState(scope, toolWrapper, enabled, level);
myTools.add(idx, scopeToolState);
return scopeToolState;
}
@@ -166,7 +181,6 @@
myDefaultState.setLevel(level);
final String enabled = toolElement.getAttributeValue(ENABLED_ATTRIBUTE);
final boolean isEnabled = enabled != null && Boolean.parseBoolean(enabled);
- myEnabled = isEnabled;
final String enabledTool = toolElement.getAttributeValue(ENABLED_BY_DEFAULT_ATTRIBUTE);
myDefaultState.setEnabled(enabledTool != null ? Boolean.parseBoolean(enabledTool) : isEnabled);
@@ -208,16 +222,8 @@
if (toolElement.getAttributes().size() > 4 || toolElement.getChildren().size() > scopeElements.size()) {
toolWrapper.getTool().readSettings(toolElement);
}
- }
- public ScopeToolState addTool(@NotNull String scopeName, @NotNull InspectionToolWrapper toolWrapper, boolean enabled, @NotNull HighlightDisplayLevel level) {
- if (myTools == null) {
- myTools = new ArrayList<ScopeToolState>();
- setEnabled(true);
- }
- final ScopeToolState scopeToolState = new ScopeToolState(scopeName, toolWrapper, enabled, level);
- myTools.add(scopeToolState);
- return scopeToolState;
+ myEnabled = isEnabled;
}
@NotNull
@@ -252,6 +258,21 @@
}
}
+ public void removeScope(final NamedScope scope) {
+ if (myTools != null) {
+ for (final ScopeToolState tool : myTools) {
+ if (Comparing.equal(tool.getScopeName(), scope.getName())) {
+ myTools.remove(tool);
+ break;
+ }
+ }
+ if (myTools.isEmpty()) {
+ myTools = null;
+ setEnabled(myDefaultState.isEnabled());
+ }
+ }
+ }
+
public void removeAllScopes() {
myTools = null;
}
diff --git a/platform/annotations/src/org/jetbrains/annotations/NotNull.java b/platform/annotations/src/org/jetbrains/annotations/NotNull.java
index aa7c78b..3ad6003 100644
--- a/platform/annotations/src/org/jetbrains/annotations/NotNull.java
+++ b/platform/annotations/src/org/jetbrains/annotations/NotNull.java
@@ -30,5 +30,17 @@
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})
public @interface NotNull {
+ /**
+ * @return Custom exception message
+ */
String value() default "";
+
+ /**
+ * @return Custom exception type that should be thrown when not-nullity contract is violated.
+ * The exception class should have a constructor with one String argument (message).
+ *
+ * By default, {@link java.lang.IllegalArgumentException} is thrown on null method arguments and
+ * {@link java.lang.IllegalStateException} — on null return value.
+ */
+ Class<? extends Exception> exception() default Exception.class;
}
diff --git a/platform/core-api/src/com/intellij/openapi/project/DumbService.java b/platform/core-api/src/com/intellij/openapi/project/DumbService.java
index ad5c36a..a0f5b43 100644
--- a/platform/core-api/src/com/intellij/openapi/project/DumbService.java
+++ b/platform/core-api/src/com/intellij/openapi/project/DumbService.java
@@ -87,13 +87,15 @@
}
@Nullable
- public <T> T tryRunReadActionInSmartMode(@NotNull Computable<T> task, @NotNull String notification) {
+ public <T> T tryRunReadActionInSmartMode(@NotNull Computable<T> task, @Nullable String notification) {
if (ApplicationManager.getApplication().isReadAccessAllowed()) {
try {
return task.compute();
}
catch (IndexNotReadyException e) {
- showDumbModeNotification(notification);
+ if (notification != null) {
+ showDumbModeNotification(notification);
+ }
return null;
}
}
diff --git a/platform/core-api/src/com/intellij/openapi/util/AsyncValueLoader.java b/platform/core-api/src/com/intellij/openapi/util/AsyncValueLoader.java
index f3b13dc..e5b2307 100644
--- a/platform/core-api/src/com/intellij/openapi/util/AsyncValueLoader.java
+++ b/platform/core-api/src/com/intellij/openapi/util/AsyncValueLoader.java
@@ -2,6 +2,7 @@
import com.intellij.openapi.Disposable;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicReference;
@@ -125,7 +126,7 @@
protected abstract void load(@NotNull AsyncResult<T> result) throws IOException;
- protected boolean isUpToDate(@NotNull T result) {
+ protected boolean isUpToDate(@Nullable T result) {
return loadedModificationCount == modificationCount;
}
diff --git a/platform/core-api/src/com/intellij/patterns/ElementPatternCondition.java b/platform/core-api/src/com/intellij/patterns/ElementPatternCondition.java
index 45b0a16..c335dd6 100644
--- a/platform/core-api/src/com/intellij/patterns/ElementPatternCondition.java
+++ b/platform/core-api/src/com/intellij/patterns/ElementPatternCondition.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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,27 +15,38 @@
*/
package com.intellij.patterns;
-import com.intellij.util.SmartList;
import com.intellij.util.ProcessingContext;
+import com.intellij.util.SmartList;
import org.jetbrains.annotations.Nullable;
+import java.util.Collections;
import java.util.List;
/**
* @author peter
*/
+@SuppressWarnings("ForLoopReplaceableByForEach")
public class ElementPatternCondition<T> {
+
private final InitialPatternCondition<T> myInitialCondition;
- private final List<PatternCondition<? super T>> myConditions = new SmartList<PatternCondition<? super T>>();
+ private final List<PatternCondition<? super T>> myConditions;
public ElementPatternCondition(final InitialPatternCondition<T> startCondition) {
myInitialCondition = startCondition;
+ myConditions = Collections.emptyList();
+ }
+
+ protected ElementPatternCondition(final ElementPatternCondition<T> original,
+ final PatternCondition<? super T> condition) {
+ myInitialCondition = original.getInitialCondition();
+ myConditions = new SmartList<PatternCondition<? super T>>(original.getConditions());
+ myConditions.add(condition);
}
public boolean accepts(@Nullable Object o, final ProcessingContext context) {
if (!myInitialCondition.accepts(o, context)) return false;
final int listSize = myConditions.size();
- for (int i=0; i<listSize; i++) {
+ for (int i = 0; i < listSize; i++) {
if (!myConditions.get(i).accepts((T)o, context)) return false;
}
return true;
@@ -66,9 +77,6 @@
}
public ElementPatternCondition<T> append(PatternCondition<? super T> condition) {
- final ElementPatternCondition<T> copy = new ElementPatternCondition<T>(myInitialCondition);
- copy.myConditions.addAll(myConditions);
- copy.myConditions.add(condition);
- return copy;
+ return new ElementPatternCondition<T>(this, condition);
}
}
diff --git a/platform/core-api/src/com/intellij/patterns/ObjectPattern.java b/platform/core-api/src/com/intellij/patterns/ObjectPattern.java
index cf9f751..5a6a9c6 100644
--- a/platform/core-api/src/com/intellij/patterns/ObjectPattern.java
+++ b/platform/core-api/src/com/intellij/patterns/ObjectPattern.java
@@ -24,7 +24,10 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
/**
* @author peter
@@ -93,7 +96,11 @@
public Self oneOf(final T... values) {
final Collection<T> list;
- if (values.length >= 11) {
+ final int length = values.length;
+ if (length == 1) {
+ list = Collections.singletonList(values[0]);
+ }
+ else if (length >= 11) {
list = new HashSet<T>(Arrays.asList(values));
}
else {
diff --git a/platform/core-api/src/com/intellij/patterns/StringPattern.java b/platform/core-api/src/com/intellij/patterns/StringPattern.java
index 13e148d..ad23535 100644
--- a/platform/core-api/src/com/intellij/patterns/StringPattern.java
+++ b/platform/core-api/src/com/intellij/patterns/StringPattern.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -56,7 +56,7 @@
return with(new PatternCondition<String>("startsWith") {
@Override
public boolean accepts(@NotNull final String str, final ProcessingContext context) {
- return str.startsWith(s);
+ return StringUtil.startsWith(str, s);
}
});
}
@@ -66,7 +66,7 @@
return with(new PatternCondition<String>("endsWith") {
@Override
public boolean accepts(@NotNull final String str, final ProcessingContext context) {
- return str.endsWith(s);
+ return StringUtil.endsWith(str, s);
}
});
}
@@ -76,9 +76,8 @@
return with(new PatternCondition<String>("contains") {
@Override
public boolean accepts(@NotNull final String str, final ProcessingContext context) {
- return str.contains(s);
+ return StringUtil.contains(str, s);
}
-
});
}
@@ -87,10 +86,7 @@
return with(new PatternCondition<String>("containsChars") {
@Override
public boolean accepts(@NotNull final String str, final ProcessingContext context) {
- for (int i=0, len=s.length(); i<len; i++) {
- if (str.indexOf(s.charAt(i))>-1) return true;
- }
- return false;
+ return StringUtil.containsAnyChar(str, s);
}
});
}
@@ -178,6 +174,7 @@
}
});
}
+
public StringPattern shorterThan(final int maxLength) {
return with(new PatternCondition<String>("shorterThan") {
@Override
@@ -186,6 +183,7 @@
}
});
}
+
public StringPattern withLength(final int length) {
return with(new PatternCondition<String>("withLength") {
@Override
diff --git a/platform/core-api/src/com/intellij/psi/stubs/DefaultStubBuilder.java b/platform/core-api/src/com/intellij/psi/stubs/DefaultStubBuilder.java
index 1a8c200..b4290e8 100644
--- a/platform/core-api/src/com/intellij/psi/stubs/DefaultStubBuilder.java
+++ b/platform/core-api/src/com/intellij/psi/stubs/DefaultStubBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -36,11 +36,13 @@
return buildStubTreeFor(file, createStubForFile(file));
}
+ @NotNull
protected StubElement createStubForFile(@NotNull PsiFile file) {
@SuppressWarnings("unchecked") PsiFileStubImpl stub = new PsiFileStubImpl(file);
return stub;
}
+ @NotNull
private StubElement buildStubTreeFor(@NotNull PsiElement root, @NotNull StubElement parentStub) {
Stack<StubElement> parentStubs = new Stack<StubElement>();
Stack<PsiElement> parentElements = new Stack<PsiElement>();
@@ -84,6 +86,7 @@
return false;
}
+ @NotNull
protected StubElement buildStubTreeFor(@NotNull ASTNode root, @NotNull StubElement parentStub) {
Stack<StubElement> parentStubs = new Stack<StubElement>();
Stack<ASTNode> parentNodes = new Stack<ASTNode>();
diff --git a/platform/core-api/src/com/intellij/ui/SimpleTextAttributes.java b/platform/core-api/src/com/intellij/ui/SimpleTextAttributes.java
index 6046a0ec..f56cf7e 100644
--- a/platform/core-api/src/com/intellij/ui/SimpleTextAttributes.java
+++ b/platform/core-api/src/com/intellij/ui/SimpleTextAttributes.java
@@ -54,6 +54,7 @@
public static final SimpleTextAttributes GRAYED_ATTRIBUTES = new SimpleTextAttributes(STYLE_PLAIN, UIUtil.getInactiveTextColor());
public static final SimpleTextAttributes GRAYED_BOLD_ATTRIBUTES = new SimpleTextAttributes(STYLE_BOLD, UIUtil.getInactiveTextColor());
+ public static final SimpleTextAttributes GRAYED_ITALIC_ATTRIBUTES = new SimpleTextAttributes(STYLE_ITALIC, UIUtil.getInactiveTextColor());
public static final SimpleTextAttributes SYNTHETIC_ATTRIBUTES = new SimpleTextAttributes(STYLE_PLAIN, JBColor.blue);
public static final SimpleTextAttributes GRAY_ATTRIBUTES = new SimpleTextAttributes(STYLE_PLAIN, Color.GRAY);
diff --git a/platform/core-impl/src/com/intellij/ide/plugins/PluginDescriptorComparator.java b/platform/core-impl/src/com/intellij/ide/plugins/PluginDescriptorComparator.java
index 3094304..a6b957c 100644
--- a/platform/core-impl/src/com/intellij/ide/plugins/PluginDescriptorComparator.java
+++ b/platform/core-impl/src/com/intellij/ide/plugins/PluginDescriptorComparator.java
@@ -15,7 +15,6 @@
*/
package com.intellij.ide.plugins;
-import com.intellij.ide.IdeBundle;
import com.intellij.openapi.extensions.PluginId;
import com.intellij.util.containers.HashMap;
import gnu.trove.TObjectIntHashMap;
@@ -32,7 +31,7 @@
private final TObjectIntHashMap<PluginId> myIdToNumberMap = new TObjectIntHashMap<PluginId>();
private int myAvailableNumber = 1;
- public PluginDescriptorComparator(IdeaPluginDescriptor[] descriptors) throws Exception{
+ public PluginDescriptorComparator(IdeaPluginDescriptor[] descriptors){
final Map<PluginId, IdeaPluginDescriptor> idToDescriptorMap = new HashMap<PluginId, IdeaPluginDescriptor>();
for (final IdeaPluginDescriptor descriptor : descriptors) {
idToDescriptorMap.put(descriptor.getPluginId(), descriptor);
@@ -46,18 +45,20 @@
}
}
- private void assignNumbers(PluginId id, Map<PluginId, IdeaPluginDescriptor> idToDescriptorMap, Stack<PluginId> visited) throws Exception {
+ private void assignNumbers(PluginId id, Map<PluginId, IdeaPluginDescriptor> idToDescriptorMap, Stack<PluginId> visited){
visited.push(id);
try {
final IdeaPluginDescriptor ideaPluginDescriptor = idToDescriptorMap.get(id);
- if (ideaPluginDescriptor == null) {
- // missing optional dependency
+ if (ideaPluginDescriptor == null || !ideaPluginDescriptor.isEnabled()) {
+ // missing optional dependency or already disabled due to cycles
return;
}
final PluginId[] parentIds = ideaPluginDescriptor.getDependentPluginIds();
for (final PluginId parentId : parentIds) {
if (visited.contains(parentId)) {
- throw new Exception(IdeBundle.message("error.plugins.should.not.have.cyclic.dependencies") + id + "->" + parentId + "->...->" + id);
+ //disable plugins in the cycle
+ ideaPluginDescriptor.setEnabled(false);
+ break;
}
}
for (PluginId parentId1 : parentIds) {
diff --git a/platform/core-impl/src/com/intellij/ide/plugins/PluginManagerCore.java b/platform/core-impl/src/com/intellij/ide/plugins/PluginManagerCore.java
index cf2d45a..8f4fd77 100644
--- a/platform/core-impl/src/com/intellij/ide/plugins/PluginManagerCore.java
+++ b/platform/core-impl/src/com/intellij/ide/plugins/PluginManagerCore.java
@@ -25,10 +25,7 @@
import com.intellij.openapi.components.ExtensionAreas;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.*;
-import com.intellij.openapi.util.BuildNumber;
-import com.intellij.openapi.util.Comparing;
-import com.intellij.openapi.util.Condition;
-import com.intellij.openapi.util.JDOMUtil;
+import com.intellij.openapi.util.*;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.io.StreamUtil;
import com.intellij.openapi.util.io.ZipFileCache;
@@ -479,8 +476,10 @@
}
static void prepareLoadingPluginsErrorMessage(final String errorMessage) {
- if (errorMessage != null) {
- if (!ApplicationManager.getApplication().isHeadlessEnvironment() && !ApplicationManager.getApplication().isUnitTestMode()) {
+ if (!StringUtil.isEmptyOrSpaces(errorMessage)) {
+ if (ApplicationManager.getApplication() != null
+ && !ApplicationManager.getApplication().isHeadlessEnvironment()
+ && !ApplicationManager.getApplication().isUnitTestMode()) {
if (myPluginError == null) {
myPluginError = errorMessage;
}
@@ -499,6 +498,7 @@
}
}
+ @Deprecated
static Comparator<IdeaPluginDescriptor> getPluginDescriptorComparator(Map<PluginId, IdeaPluginDescriptorImpl> idToDescriptorMap) {
final Graph<PluginId> graph = createPluginIdGraph(idToDescriptorMap);
final DFSTBuilder<PluginId> builder = new DFSTBuilder<PluginId>(graph);
@@ -549,6 +549,7 @@
}));
}
+ @Deprecated
static IdeaPluginDescriptorImpl[] findCorePlugin(IdeaPluginDescriptorImpl[] pluginDescriptors) {
for (IdeaPluginDescriptorImpl descriptor : pluginDescriptors) {
if (CORE_PLUGIN_ID.equals(descriptor.getPluginId().getIdString())) {
@@ -820,7 +821,7 @@
message.insert(0, IdeBundle.message("error.problems.found.loading.plugins"));
return message.toString();
}
- return null;
+ return "";
}
static void loadDescriptorsFromClassPath(@NotNull List<IdeaPluginDescriptorImpl> result, @Nullable StartupProgress progress) {
@@ -900,14 +901,7 @@
loadDescriptorsFromClassPath(result, fromSources ? progress : null);
IdeaPluginDescriptorImpl[] pluginDescriptors = result.toArray(new IdeaPluginDescriptorImpl[result.size()]);
- try {
- Arrays.sort(pluginDescriptors, new PluginDescriptorComparator(pluginDescriptors));
- }
- catch (Exception e) {
- prepareLoadingPluginsErrorMessage(IdeBundle.message("error.plugins.were.not.loaded", e.getMessage()));
- getLogger().info(e);
- return findCorePlugin(pluginDescriptors);
- }
+ Arrays.sort(pluginDescriptors, new PluginDescriptorComparator(pluginDescriptors));
return pluginDescriptors;
}
@@ -1090,12 +1084,13 @@
String errorMessage = filterBadPlugins(result, disabledPluginNames);
if (!brokenPluginsList.isEmpty()) {
- errorMessage = "Following plugins are incompatible with current IDE build: " + StringUtil.join(brokenPluginsList, ", ")
- + "<br>\n" + StringUtil.notNullize(errorMessage);
+ if (!StringUtil.isEmptyOrSpaces(errorMessage)) {
+ errorMessage += "<br>";
+ }
+ errorMessage += "Following plugins are incompatible with current IDE build: " + StringUtil.join(brokenPluginsList, ", ")
+ + "<br>\n" + StringUtil.notNullize(errorMessage);
}
- prepareLoadingPluginsErrorMessage(errorMessage);
-
final Map<PluginId, IdeaPluginDescriptorImpl> idToDescriptorMap = new HashMap<PluginId, IdeaPluginDescriptorImpl>();
for (final IdeaPluginDescriptorImpl descriptor : result) {
idToDescriptorMap.put(descriptor.getPluginId(), descriptor);
@@ -1112,8 +1107,28 @@
mergeOptionalConfigs(idToDescriptorMap);
addModulesAsDependents(idToDescriptorMap);
+ final Graph<PluginId> graph = createPluginIdGraph(idToDescriptorMap);
+ final DFSTBuilder<PluginId> builder = new DFSTBuilder<PluginId>(graph);
+ if (!builder.isAcyclic()) {
+ final Couple<PluginId> circularDependency = builder.getCircularDependency();
+ final PluginId id = circularDependency.getFirst();
+ final PluginId parentId = circularDependency.getSecond();
+ if (!StringUtil.isEmptyOrSpaces(errorMessage)) {
+ errorMessage += "<br>";
+ }
+ errorMessage += IdeBundle.message("error.plugins.should.not.have.cyclic.dependencies") + id + "->" + parentId + "->...->" + id;
+ }
+
+ prepareLoadingPluginsErrorMessage(errorMessage);
+
+ final Comparator<PluginId> idComparator = builder.comparator();
// sort descriptors according to plugin dependencies
- Collections.sort(result, getPluginDescriptorComparator(idToDescriptorMap));
+ Collections.sort(result, new Comparator<IdeaPluginDescriptor>() {
+ @Override
+ public int compare(IdeaPluginDescriptor o1, IdeaPluginDescriptor o2) {
+ return idComparator.compare(o1.getPluginId(), o2.getPluginId());
+ }
+ });
for (int i = 0; i < result.size(); i++) {
ourId2Index.put(result.get(i).getPluginId(), i);
diff --git a/platform/platform-impl/src/com/intellij/ide/util/PropertiesComponentImpl.java b/platform/core-impl/src/com/intellij/ide/util/PropertiesComponentImpl.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/ide/util/PropertiesComponentImpl.java
rename to platform/core-impl/src/com/intellij/ide/util/PropertiesComponentImpl.java
diff --git a/platform/core-impl/src/com/intellij/mock/MockApplicationEx.java b/platform/core-impl/src/com/intellij/mock/MockApplicationEx.java
index 60ae541..7415e0d 100644
--- a/platform/core-impl/src/com/intellij/mock/MockApplicationEx.java
+++ b/platform/core-impl/src/com/intellij/mock/MockApplicationEx.java
@@ -53,11 +53,11 @@
}
@Override
- public void exit(boolean force) {
+ public void exit(boolean force, boolean exitConfirmed) {
}
@Override
- public void restart(boolean force) {
+ public void restart(boolean exitConfirmed) {
}
@Override
diff --git a/platform/core-impl/src/com/intellij/openapi/application/ex/ApplicationEx.java b/platform/core-impl/src/com/intellij/openapi/application/ex/ApplicationEx.java
index acb83f1..bf84725 100644
--- a/platform/core-impl/src/com/intellij/openapi/application/ex/ApplicationEx.java
+++ b/platform/core-impl/src/com/intellij/openapi/application/ex/ApplicationEx.java
@@ -60,10 +60,18 @@
void doNotSave(boolean value);
boolean isDoNotSave();
- //force exit
- void exit(boolean force);
+ /**
+ * @param force if true, no additional confirmations will be shown. The application is guaranteed to exit
+ * @param exitConfirmed if true, suppresses any shutdown confirmation. However, if there are any background processes or tasks running,
+ * a corresponding confirmation will be shown with the possibility to cancel the operation
+ */
+ void exit(boolean force, boolean exitConfirmed);
- void restart(boolean force);
+ /**
+ * @param exitConfirmed if true, suppresses any shutdown confirmation. However, if there are any background processes or tasks running,
+ * a corresponding confirmation will be shown with the possibility to cancel the operation
+ */
+ void restart(boolean exitConfirmed);
/**
* Runs modal process. For internal use only, see {@link Task}
diff --git a/platform/core-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java b/platform/core-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java
index 78ce83c..62fbfa5 100644
--- a/platform/core-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java
+++ b/platform/core-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java
@@ -409,7 +409,7 @@
}
}
else {
- buffer.append(getBuild().asString());
+ buffer.append(getBuild().asStringWithAllDetails());
}
return buffer.toString();
}
diff --git a/platform/core-impl/src/com/intellij/psi/impl/file/impl/FileManagerImpl.java b/platform/core-impl/src/com/intellij/psi/impl/file/impl/FileManagerImpl.java
index ce3bc95..7b4e9ec 100644
--- a/platform/core-impl/src/com/intellij/psi/impl/file/impl/FileManagerImpl.java
+++ b/platform/core-impl/src/com/intellij/psi/impl/file/impl/FileManagerImpl.java
@@ -26,12 +26,15 @@
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.fileTypes.ContentBasedFileSubstitutor;
import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.FileTypeRegistry;
import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.FileIndexFacade;
import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.LowMemoryWatcher;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileVisitor;
@@ -55,6 +58,7 @@
public class FileManagerImpl implements FileManager {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.file.impl.FileManagerImpl");
+ private final Key<FileViewProvider> myPsiHardRefKey = Key.create("HARD_REFERENCE_TO_PSI"); //non-static!
private final PsiManagerImpl myManager;
private final FileIndexFacade myFileIndex;
@@ -166,7 +170,7 @@
@NotNull
public FileViewProvider findViewProvider(@NotNull final VirtualFile file) {
assert !file.isDirectory();
- FileViewProvider viewProvider = getFromInjected(file);
+ FileViewProvider viewProvider = findCachedViewProvider(file);
if (viewProvider != null) return viewProvider;
viewProvider = myVFileToViewProviderMap.get(file);
if(viewProvider == null) {
@@ -178,8 +182,9 @@
@Override
public FileViewProvider findCachedViewProvider(@NotNull final VirtualFile file) {
FileViewProvider viewProvider = getFromInjected(file);
- if (viewProvider != null) return viewProvider;
- return myVFileToViewProviderMap.get(file);
+ if (viewProvider == null) viewProvider = myVFileToViewProviderMap.get(file);
+ if (viewProvider == null) viewProvider = file.getUserData(myPsiHardRefKey);
+ return viewProvider;
}
@Nullable
@@ -214,9 +219,14 @@
if (document != null) {
PsiDocumentManagerBase.cachePsi(document, null);
}
+ virtualFile.putUserData(myPsiHardRefKey, null);
}
else {
- myVFileToViewProviderMap.put(virtualFile, fileViewProvider);
+ if (virtualFile instanceof LightVirtualFile) {
+ virtualFile.putUserData(myPsiHardRefKey, fileViewProvider);
+ } else {
+ myVFileToViewProviderMap.put(virtualFile, fileViewProvider);
+ }
}
}
}
@@ -398,7 +408,12 @@
PsiDirectory psiDir = myVFileToPsiDirMap.get(vFile);
if (psiDir != null) return psiDir;
- if (myFileIndex.isExcludedFile(vFile)) return null;
+ if (Registry.is("ide.hide.excluded.files")) {
+ if (myFileIndex.isExcludedFile(vFile)) return null;
+ }
+ else {
+ if (FileTypeRegistry.getInstance().isFileIgnored(vFile)) return null;
+ }
VirtualFile parent = vFile.getParent();
if (parent != null) { //?
@@ -430,7 +445,8 @@
@Nullable
PsiFile getCachedPsiFileInner(@NotNull VirtualFile file) {
- final FileViewProvider fileViewProvider = myVFileToViewProviderMap.get(file);
+ FileViewProvider fileViewProvider = myVFileToViewProviderMap.get(file);
+ if (fileViewProvider == null) fileViewProvider = file.getUserData(myPsiHardRefKey);
return fileViewProvider instanceof SingleRootFileViewProvider
? ((SingleRootFileViewProvider)fileViewProvider).getCachedPsi(fileViewProvider.getBaseLanguage()) : null;
}
diff --git a/platform/core-impl/src/com/intellij/psi/stubs/ObjectStubTree.java b/platform/core-impl/src/com/intellij/psi/stubs/ObjectStubTree.java
index 7d597b7..2d84c92 100644
--- a/platform/core-impl/src/com/intellij/psi/stubs/ObjectStubTree.java
+++ b/platform/core-impl/src/com/intellij/psi/stubs/ObjectStubTree.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -48,6 +48,7 @@
return myRoot;
}
+ @NotNull
public List<T> getPlainList() {
return myPlainList;
}
@@ -65,7 +66,7 @@
return sink.getResult();
}
- protected static void enumerateStubs(final Stub root, final List<Stub> result) {
+ protected static void enumerateStubs(@NotNull Stub root, @NotNull List<Stub> result) {
((ObjectStubBase)root).id = result.size();
result.add(root);
for (Stub child : root.getChildrenStubs()) {
diff --git a/platform/core-impl/src/com/intellij/util/indexing/FileContentImpl.java b/platform/core-impl/src/com/intellij/util/indexing/FileContentImpl.java
index b440a43..bd83093 100644
--- a/platform/core-impl/src/com/intellij/util/indexing/FileContentImpl.java
+++ b/platform/core-impl/src/com/intellij/util/indexing/FileContentImpl.java
@@ -31,6 +31,7 @@
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiFileFactory;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import java.io.IOException;
@@ -48,7 +49,7 @@
private byte[] myContent;
private CharSequence myContentAsText;
private final long myStamp;
- private final byte[] myHash;
+ private byte[] myHash;
@Override
public Project getProject() {
@@ -94,31 +95,26 @@
}
public FileContentImpl(@NotNull final VirtualFile file, @NotNull final CharSequence contentAsText, final Charset charset) {
- this(file, contentAsText, null, charset, -1, null);
+ this(file, contentAsText, null, charset, -1);
}
public FileContentImpl(@NotNull final VirtualFile file, @NotNull final CharSequence contentAsText, final Charset charset, long documentStamp) {
- this(file, contentAsText, null, charset, documentStamp, null);
+ this(file, contentAsText, null, charset, documentStamp);
}
public FileContentImpl(@NotNull final VirtualFile file, @NotNull final byte[] content) {
- this(file, content, null);
- }
-
- public FileContentImpl(@NotNull final VirtualFile file, @NotNull final byte[] content, byte[] hash) {
- this(file, null, content, LoadTextUtil.detectCharsetAndSetBOM(file, content), -1, hash);
+ this(file, null, content, LoadTextUtil.detectCharsetAndSetBOM(file, content), -1);
}
public FileContentImpl(@NotNull final VirtualFile file) {
- this(file, null, null, null, -1, null);
+ this(file, null, null, null, -1);
}
private FileContentImpl(@NotNull VirtualFile file,
CharSequence contentAsText,
byte[] content,
Charset charset,
- long stamp,
- byte[] hash
+ long stamp
) {
myFile = file;
myContentAsText = contentAsText;
@@ -128,7 +124,6 @@
// remember name explicitly because the file could be renamed afterwards
myFileName = file.getName();
myStamp = stamp;
- myHash = hash;
}
@NotNull
@@ -215,10 +210,14 @@
return myFileName;
}
- public byte[] getHash() {
+ public @Nullable byte[] getHash() {
return myHash;
}
+ public void setHash(byte[] hash) {
+ myHash = hash;
+ }
+
public PsiFile getPsiFileAccountingForUnsavedDocument() {
Document document = FileDocumentManager.getInstance().getCachedDocument(getFile());
PsiFile psi = null;
diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/Caret.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/Caret.java
index 43b5e75..ba0743b 100644
--- a/platform/editor-ui-api/src/com/intellij/openapi/editor/Caret.java
+++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/Caret.java
@@ -26,6 +26,12 @@
*/
public interface Caret extends UserDataHolderEx, Disposable {
/**
+ * Returns an instance of Editor, current caret belongs to.
+ */
+ @NotNull
+ Editor getEditor();
+
+ /**
* Returns an instance of CaretModel, current caret is associated with.
*/
@NotNull
diff --git a/platform/editor-ui-ex/src/com/intellij/openapi/editor/ex/util/LexerEditorHighlighter.java b/platform/editor-ui-ex/src/com/intellij/openapi/editor/ex/util/LexerEditorHighlighter.java
index 443e4fb..77092d9 100644
--- a/platform/editor-ui-ex/src/com/intellij/openapi/editor/ex/util/LexerEditorHighlighter.java
+++ b/platform/editor-ui-ex/src/com/intellij/openapi/editor/ex/util/LexerEditorHighlighter.java
@@ -34,6 +34,7 @@
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
import com.intellij.openapi.project.DumbAwareRunnable;
import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
import com.intellij.psi.tree.IElementType;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ui.UIUtil;
@@ -77,8 +78,7 @@
public final synchronized boolean checkContentIsEqualTo(CharSequence sequence) {
final Document document = getDocument();
- if (document != null) return document.getText().equals(sequence.toString());
- return false;
+ return document != null && Comparing.equal(document.getImmutableCharSequence(), sequence);
}
public EditorColorsScheme getScheme() {
diff --git a/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/id/PlatformIdTableBuilding.java b/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/id/PlatformIdTableBuilding.java
index 330dcfd..6a3dd82 100644
--- a/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/id/PlatformIdTableBuilding.java
+++ b/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/id/PlatformIdTableBuilding.java
@@ -213,7 +213,7 @@
}
OccurrenceConsumer occurrenceConsumer = new OccurrenceConsumer(null, true);
for (IndexPattern indexPattern : indexPatterns) {
- Pattern pattern = indexPattern.getPattern();
+ Pattern pattern = indexPattern.getOptimizedIndexingPattern();
if (pattern != null) {
Matcher matcher = pattern.matcher(chars);
while (matcher.find()) {
diff --git a/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/todo/TodoIndex.java b/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/todo/TodoIndex.java
index 09b379e..d955354 100644
--- a/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/todo/TodoIndex.java
+++ b/platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/todo/TodoIndex.java
@@ -127,7 +127,7 @@
@Override
public int getVersion() {
- return 7;
+ return 8;
}
@Override
diff --git a/platform/icons/src/general/projectConfigurable.png b/platform/icons/src/general/projectConfigurable.png
new file mode 100644
index 0000000..d04d56c
--- /dev/null
+++ b/platform/icons/src/general/projectConfigurable.png
Binary files differ
diff --git a/platform/icons/src/general/projectConfigurable@2x.png b/platform/icons/src/general/projectConfigurable@2x.png
new file mode 100644
index 0000000..3550d5f
--- /dev/null
+++ b/platform/icons/src/general/projectConfigurable@2x.png
Binary files differ
diff --git a/platform/icons/src/general/projectConfigurable@2x_dark.png b/platform/icons/src/general/projectConfigurable@2x_dark.png
new file mode 100644
index 0000000..feca756
--- /dev/null
+++ b/platform/icons/src/general/projectConfigurable@2x_dark.png
Binary files differ
diff --git a/platform/icons/src/general/projectConfigurable_dark.png b/platform/icons/src/general/projectConfigurable_dark.png
new file mode 100644
index 0000000..60b9836
--- /dev/null
+++ b/platform/icons/src/general/projectConfigurable_dark.png
Binary files differ
diff --git a/platform/indexing-api/src/com/intellij/psi/search/IndexPattern.java b/platform/indexing-api/src/com/intellij/psi/search/IndexPattern.java
index fc5de78..0066c26 100644
--- a/platform/indexing-api/src/com/intellij/psi/search/IndexPattern.java
+++ b/platform/indexing-api/src/com/intellij/psi/search/IndexPattern.java
@@ -16,6 +16,7 @@
package com.intellij.psi.search;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
@@ -29,6 +30,7 @@
*/
public class IndexPattern {
@NotNull private String myPatternString;
+ private Pattern myOptimizedIndexingPattern;
private boolean myCaseSensitive;
private Pattern myPattern;
@@ -49,10 +51,14 @@
return myPatternString;
}
- public Pattern getPattern() {
+ public @Nullable Pattern getPattern() {
return myPattern;
}
+ public @Nullable Pattern getOptimizedIndexingPattern() {
+ return myOptimizedIndexingPattern;
+ }
+
public boolean isCaseSensitive() {
return myCaseSensitive;
}
@@ -68,16 +74,21 @@
}
private void compilePattern() {
- try{
- if (myCaseSensitive){
- myPattern = Pattern.compile(myPatternString);
+ try {
+ int flags = 0;
+ if (!myCaseSensitive) {
+ flags = Pattern.CASE_INSENSITIVE;
}
- else{
- myPattern = Pattern.compile(myPatternString, Pattern.CASE_INSENSITIVE);
+ myPattern = Pattern.compile(myPatternString, flags);
+ String optimizedPattern = myPatternString;
+ if (optimizedPattern.startsWith(".*")) {
+ optimizedPattern = optimizedPattern.substring(".*".length());
}
+ myOptimizedIndexingPattern = Pattern.compile(optimizedPattern, flags);
}
catch(PatternSyntaxException e){
myPattern = null;
+ myOptimizedIndexingPattern = null;
}
}
diff --git a/platform/indexing-api/src/com/intellij/psi/search/PsiSearchHelper.java b/platform/indexing-api/src/com/intellij/psi/search/PsiSearchHelper.java
index 741b31c..cc283d0 100644
--- a/platform/indexing-api/src/com/intellij/psi/search/PsiSearchHelper.java
+++ b/platform/indexing-api/src/com/intellij/psi/search/PsiSearchHelper.java
@@ -23,6 +23,7 @@
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiReference;
import com.intellij.util.Processor;
+import org.intellij.lang.annotations.MagicConstant;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -166,13 +167,13 @@
boolean processElementsWithWord(@NotNull TextOccurenceProcessor processor,
@NotNull SearchScope searchScope,
@NotNull String text,
- short searchContext,
+ @MagicConstant(flagsFromClass = UsageSearchContext.class) short searchContext,
boolean caseSensitive);
boolean processElementsWithWord(@NotNull TextOccurenceProcessor processor,
@NotNull SearchScope searchScope,
@NotNull String text,
- short searchContext,
+ @MagicConstant(flagsFromClass = UsageSearchContext.class) short searchContext,
boolean caseSensitive,
boolean processInjectedPsi);
diff --git a/platform/indexing-api/src/com/intellij/psi/search/SingleTargetRequestResultProcessor.java b/platform/indexing-api/src/com/intellij/psi/search/SingleTargetRequestResultProcessor.java
index dfc4217..2cfa12e 100644
--- a/platform/indexing-api/src/com/intellij/psi/search/SingleTargetRequestResultProcessor.java
+++ b/platform/indexing-api/src/com/intellij/psi/search/SingleTargetRequestResultProcessor.java
@@ -39,6 +39,10 @@
@Override
public boolean processTextOccurrence(@NotNull PsiElement element, int offsetInElement, @NotNull final Processor<PsiReference> consumer) {
+ if (!myTarget.isValid()) {
+ return false;
+ }
+
final List<PsiReference> references = ourReferenceService.getReferences(element,
new PsiReferenceService.Hints(myTarget, offsetInElement));
for (PsiReference ref : references) {
diff --git a/platform/indexing-api/src/com/intellij/psi/stubs/AbstractStubIndex.java b/platform/indexing-api/src/com/intellij/psi/stubs/AbstractStubIndex.java
index 6e6ce92a..118592a 100644
--- a/platform/indexing-api/src/com/intellij/psi/stubs/AbstractStubIndex.java
+++ b/platform/indexing-api/src/com/intellij/psi/stubs/AbstractStubIndex.java
@@ -19,6 +19,7 @@
import com.intellij.psi.PsiElement;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.util.Processor;
+import org.jetbrains.annotations.NotNull;
import java.util.Collection;
@@ -34,7 +35,7 @@
return StubIndex.getInstance().processAllKeys(getKey(), project, processor);
}
- public Collection<Psi> get(Key key, final Project project, final GlobalSearchScope scope) {
+ public Collection<Psi> get(@NotNull Key key, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
return StubIndex.getInstance().get(getKey(), key, project, scope);
}
diff --git a/platform/indexing-api/src/com/intellij/psi/stubs/StubIndex.java b/platform/indexing-api/src/com/intellij/psi/stubs/StubIndex.java
index ce12c57..11074f8 100644
--- a/platform/indexing-api/src/com/intellij/psi/stubs/StubIndex.java
+++ b/platform/indexing-api/src/com/intellij/psi/stubs/StubIndex.java
@@ -26,6 +26,7 @@
import com.intellij.psi.PsiElement;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.util.PsiUtilCore;
+import com.intellij.util.ObjectUtils;
import com.intellij.util.Processor;
import com.intellij.util.indexing.FileBasedIndex;
import com.intellij.util.indexing.IdFilter;
@@ -51,7 +52,7 @@
public abstract <Key, Psi extends PsiElement> Collection<Psi> get(@NotNull StubIndexKey<Key, Psi> indexKey,
@NotNull Key key,
@NotNull Project project,
- final GlobalSearchScope scope);
+ @Nullable final GlobalSearchScope scope);
/**
* @deprecated use {@link #getElements(StubIndexKey, Object, com.intellij.openapi.project.Project, com.intellij.psi.search.GlobalSearchScope, Class)}
@@ -59,7 +60,7 @@
public <Key, Psi extends PsiElement> Collection<Psi> get(@NotNull StubIndexKey<Key, Psi> indexKey,
@NotNull Key key,
@NotNull Project project,
- final GlobalSearchScope scope,
+ @Nullable final GlobalSearchScope scope,
IdFilter filter) {
return get(indexKey, key, project, scope);
}
@@ -70,7 +71,7 @@
public <Key, Psi extends PsiElement> boolean process(@NotNull StubIndexKey<Key, Psi> indexKey,
@NotNull Key key,
@NotNull Project project,
- GlobalSearchScope scope,
+ @Nullable GlobalSearchScope scope,
@NotNull Processor<? super Psi> processor) {
return processElements(indexKey, key, project, scope, (Class<Psi>)PsiElement.class, processor);
}
@@ -78,7 +79,7 @@
public abstract <Key, Psi extends PsiElement> boolean processElements(@NotNull StubIndexKey<Key, Psi> indexKey,
@NotNull Key key,
@NotNull Project project,
- GlobalSearchScope scope,
+ @Nullable GlobalSearchScope scope,
Class<Psi> requiredClass,
@NotNull Processor<? super Psi> processor);
@@ -88,8 +89,8 @@
public <Key, Psi extends PsiElement> boolean process(@NotNull StubIndexKey<Key, Psi> indexKey,
@NotNull Key key,
@NotNull Project project,
- GlobalSearchScope scope,
- IdFilter idFilter,
+ @Nullable GlobalSearchScope scope,
+ @SuppressWarnings("UnusedParameters") IdFilter idFilter,
@NotNull Processor<? super Psi> processor) {
return process(indexKey, key, project, scope, processor);
}
@@ -97,9 +98,9 @@
public <Key, Psi extends PsiElement> boolean processElements(@NotNull StubIndexKey<Key, Psi> indexKey,
@NotNull Key key,
@NotNull Project project,
- GlobalSearchScope scope,
+ @Nullable GlobalSearchScope scope,
IdFilter idFilter,
- Class<Psi> requiredClass,
+ @NotNull Class<Psi> requiredClass,
@NotNull Processor<? super Psi> processor) {
return process(indexKey, key, project, scope, processor);
}
@@ -109,8 +110,9 @@
public abstract <K> boolean processAllKeys(@NotNull StubIndexKey<K, ?> indexKey, @NotNull Project project, Processor<K> processor);
- public <K> boolean processAllKeys(@NotNull StubIndexKey<K, ?> indexKey, Processor<K> processor, GlobalSearchScope scope, @Nullable IdFilter idFilter) {
- return processAllKeys(indexKey, scope.getProject(), processor);
+ public <K> boolean processAllKeys(@NotNull StubIndexKey<K, ?> indexKey, @NotNull Processor<K> processor,
+ @NotNull GlobalSearchScope scope, @Nullable IdFilter idFilter) {
+ return processAllKeys(indexKey, ObjectUtils.assertNotNull(scope.getProject()), processor);
}
/**
@@ -127,7 +129,7 @@
public static <Key, Psi extends PsiElement> Collection<Psi> getElements(@NotNull StubIndexKey<Key, Psi> indexKey,
@NotNull Key key,
@NotNull final Project project,
- final GlobalSearchScope scope,
+ @Nullable final GlobalSearchScope scope,
@NotNull Class<Psi> requiredClass) {
return getElements(indexKey, key, project, scope, null, requiredClass);
}
@@ -135,7 +137,7 @@
public static <Key, Psi extends PsiElement> Collection<Psi> getElements(@NotNull StubIndexKey<Key, Psi> indexKey,
@NotNull Key key,
@NotNull final Project project,
- final GlobalSearchScope scope,
+ @Nullable final GlobalSearchScope scope,
@Nullable IdFilter idFilter,
@NotNull Class<Psi> requiredClass) {
//noinspection deprecation
diff --git a/platform/indexing-impl/src/com/intellij/openapi/module/impl/scopes/ModuleWithDependentsScope.java b/platform/indexing-impl/src/com/intellij/openapi/module/impl/scopes/ModuleWithDependentsScope.java
index 0a575acd..259ea39 100644
--- a/platform/indexing-impl/src/com/intellij/openapi/module/impl/scopes/ModuleWithDependentsScope.java
+++ b/platform/indexing-impl/src/com/intellij/openapi/module/impl/scopes/ModuleWithDependentsScope.java
@@ -50,27 +50,28 @@
myProjectFileIndex = ProjectRootManager.getInstance(module.getProject()).getFileIndex();
myProjectScope = ProjectScope.getProjectScope(module.getProject());
- myModules = new THashSet<Module>();
- myModules.add(module);
-
- fillModules();
+ myModules = buildDependents(myModule);
}
- private void fillModules() {
- ModuleIndex index = getModuleIndex(myModule.getProject());
+ private static Set<Module> buildDependents(Module module) {
+ Set<Module> result = new THashSet<Module>();
+ result.add(module);
+
+ ModuleIndex index = getModuleIndex(module.getProject());
Queue<Module> walkingQueue = new Queue<Module>(10);
- walkingQueue.addLast(myModule);
+ walkingQueue.addLast(module);
while (!walkingQueue.isEmpty()) {
Module current = walkingQueue.pullFirst();
- myModules.addAll(index.plainUsages.get(current));
+ result.addAll(index.plainUsages.get(current));
for (Module dependent : index.exportingUsages.get(current)) {
- if (myModules.add(dependent)) {
+ if (result.add(dependent)) {
walkingQueue.addLast(dependent);
}
}
}
+ return result;
}
private static class ModuleIndex {
diff --git a/platform/indexing-impl/src/com/intellij/psi/impl/cache/CacheManager.java b/platform/indexing-impl/src/com/intellij/psi/impl/cache/CacheManager.java
index 54a3bf5..e403f60 100644
--- a/platform/indexing-impl/src/com/intellij/psi/impl/cache/CacheManager.java
+++ b/platform/indexing-impl/src/com/intellij/psi/impl/cache/CacheManager.java
@@ -20,7 +20,9 @@
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiFile;
import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.search.UsageSearchContext;
import com.intellij.util.Processor;
+import org.intellij.lang.annotations.MagicConstant;
import org.jetbrains.annotations.NotNull;
public interface CacheManager {
@@ -33,7 +35,13 @@
}
}
- @NotNull PsiFile[] getFilesWithWord(@NotNull String word, short occurenceMask, @NotNull GlobalSearchScope scope, final boolean caseSensitively);
- boolean processFilesWithWord(@NotNull Processor<PsiFile> processor,@NotNull String word, short occurenceMask, @NotNull GlobalSearchScope scope, final boolean caseSensitively);
+ @NotNull
+ PsiFile[] getFilesWithWord(@NotNull String word, short occurenceMask, @NotNull GlobalSearchScope scope, final boolean caseSensitively);
+
+ boolean processFilesWithWord(@NotNull Processor<PsiFile> processor,
+ @NotNull String word,
+ @MagicConstant(flagsFromClass = UsageSearchContext.class) short occurenceMask,
+ @NotNull GlobalSearchScope scope,
+ final boolean caseSensitively);
}
diff --git a/platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/BaseFilterLexer.java b/platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/BaseFilterLexer.java
index cc9dddf..ab774d1 100644
--- a/platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/BaseFilterLexer.java
+++ b/platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/BaseFilterLexer.java
@@ -76,7 +76,7 @@
todoScanningState = new TodoScanningState(patterns, matchers);
for (int i = 0; i < patterns.length; ++i) {
- Pattern pattern = patterns[i].getPattern();
+ Pattern pattern = patterns[i].getOptimizedIndexingPattern();
if (pattern != null) {
matchers[i] = pattern.matcher("");
diff --git a/platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/BaseFilterLexerUtil.java b/platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/BaseFilterLexerUtil.java
index 43f6ce4..3896dc3 100644
--- a/platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/BaseFilterLexerUtil.java
+++ b/platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/BaseFilterLexerUtil.java
@@ -17,7 +17,6 @@
import com.intellij.lexer.Lexer;
import com.intellij.openapi.util.Key;
-import com.intellij.openapi.vfs.StandardFileSystems;
import com.intellij.psi.impl.cache.impl.id.IdIndexEntry;
import com.intellij.psi.impl.cache.impl.id.IdTableBuilding;
import com.intellij.psi.impl.cache.impl.id.LexerBasedIdIndexer;
@@ -40,7 +39,7 @@
return data;
}
- final boolean needTodo = content.getFile().getFileSystem().getProtocol().equals(StandardFileSystems.FILE_PROTOCOL);
+ final boolean needTodo = content.getFile().isInLocalFileSystem(); // same as TodoIndex.getFilter().isAcceptable
final boolean needIdIndex = IdTableBuilding.getFileTypeIndexer(content.getFileType()) instanceof LexerBasedIdIndexer;
final IdDataConsumer consumer = needIdIndex? new IdDataConsumer():null;
diff --git a/platform/indexing-impl/src/com/intellij/psi/stubs/StubProcessingHelperBase.java b/platform/indexing-impl/src/com/intellij/psi/stubs/StubProcessingHelperBase.java
index a97ae21..83bd872 100644
--- a/platform/indexing-impl/src/com/intellij/psi/stubs/StubProcessingHelperBase.java
+++ b/platform/indexing-impl/src/com/intellij/psi/stubs/StubProcessingHelperBase.java
@@ -32,11 +32,19 @@
return stub.getStubType();
}
- public <Psi extends PsiElement> boolean processStubsInFile(final Project project, final VirtualFile file, StubIdList value, final Processor<? super Psi> processor, Class<Psi> requiredClass) {
+ public <Psi extends PsiElement> boolean processStubsInFile(@NotNull final Project project,
+ @NotNull final VirtualFile file,
+ @NotNull StubIdList value,
+ @NotNull final Processor<? super Psi> processor,
+ @NotNull Class<Psi> requiredClass) {
return processStubsInFile(project, file, value, processor, requiredClass, false);
}
- public <Psi extends PsiElement> boolean processStubsInFile(final Project project, final VirtualFile file, StubIdList value, final Processor<? super Psi> processor, Class<Psi> requiredClass, final boolean skipOnErrors) {
+ public <Psi extends PsiElement> boolean processStubsInFile(@NotNull final Project project,
+ @NotNull final VirtualFile file,
+ @NotNull StubIdList value,
+ @NotNull final Processor<? super Psi> processor,
+ @NotNull Class<Psi> requiredClass, final boolean skipOnErrors) {
StubTree stubTree = null;
PsiFile candidatePsiFile = PsiManager.getInstance(project).findFile(file);
diff --git a/platform/lang-api/src/com/intellij/codeInsight/completion/CompletionParameters.java b/platform/lang-api/src/com/intellij/codeInsight/completion/CompletionParameters.java
index a400b20..679e1c5 100644
--- a/platform/lang-api/src/com/intellij/codeInsight/completion/CompletionParameters.java
+++ b/platform/lang-api/src/com/intellij/codeInsight/completion/CompletionParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -33,7 +33,7 @@
private final int myInvocationCount;
CompletionParameters(@NotNull final PsiElement position, @NotNull final PsiFile originalFile,
- final CompletionType completionType, int offset, final int invocationCount, @NotNull Editor editor) {
+ @NotNull CompletionType completionType, int offset, final int invocationCount, @NotNull Editor editor) {
assert offset >= position.getTextRange().getStartOffset();
myPosition = position;
assert position.isValid();
@@ -44,14 +44,17 @@
myEditor = editor;
}
+ @NotNull
public CompletionParameters delegateToClassName() {
return withType(CompletionType.CLASS_NAME).withInvocationCount(myInvocationCount - 1);
}
- public CompletionParameters withType(CompletionType type) {
+ @NotNull
+ public CompletionParameters withType(@NotNull CompletionType type) {
return new CompletionParameters(myPosition, myOriginalFile, type, myOffset, myInvocationCount, myEditor);
}
+ @NotNull
public CompletionParameters withInvocationCount(int newCount) {
return new CompletionParameters(myPosition, myOriginalFile, myCompletionType, myOffset, newCount, myEditor);
}
@@ -94,7 +97,8 @@
return myInvocationCount == 0;
}
- public CompletionParameters withPosition(PsiElement element, int offset) {
+ @NotNull
+ public CompletionParameters withPosition(@NotNull PsiElement element, int offset) {
return new CompletionParameters(element, myOriginalFile, myCompletionType, offset, myInvocationCount, myEditor);
}
@@ -102,6 +106,7 @@
return myCompletionType == CompletionType.BASIC && myInvocationCount >= 2;
}
+ @NotNull
public Editor getEditor() {
return myEditor;
}
diff --git a/platform/lang-api/src/com/intellij/codeInsight/editorActions/smartEnter/SmartEnterProcessor.java b/platform/lang-api/src/com/intellij/codeInsight/editorActions/smartEnter/SmartEnterProcessor.java
index 2e92ef1..0a3f506 100644
--- a/platform/lang-api/src/com/intellij/codeInsight/editorActions/smartEnter/SmartEnterProcessor.java
+++ b/platform/lang-api/src/com/intellij/codeInsight/editorActions/smartEnter/SmartEnterProcessor.java
@@ -36,6 +36,10 @@
public abstract class SmartEnterProcessor {
public abstract boolean process(@NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile psiFile);
+ public boolean processAfterCompletion(@NotNull final Editor editor, @NotNull final PsiFile psiFile) {
+ return process(psiFile.getProject(), editor, psiFile);
+ }
+
protected void reformat(PsiElement atCaret) throws IncorrectOperationException {
final TextRange range = atCaret.getTextRange();
final PsiFile file = atCaret.getContainingFile();
diff --git a/platform/lang-api/src/com/intellij/codeInspection/ui/ListTable.java b/platform/lang-api/src/com/intellij/codeInspection/ui/ListTable.java
index b921a62..c90593a 100644
--- a/platform/lang-api/src/com/intellij/codeInspection/ui/ListTable.java
+++ b/platform/lang-api/src/com/intellij/codeInspection/ui/ListTable.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -62,8 +62,9 @@
super.setModel(dataModel);
}
+ @NotNull
@Override
- public Component prepareRenderer(TableCellRenderer renderer, int row,
+ public Component prepareRenderer(@NotNull TableCellRenderer renderer, int row,
int column) {
final Component component =
super.prepareRenderer(renderer, row, column);
diff --git a/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java b/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java
index bf56114..f79128d 100644
--- a/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java
+++ b/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java
@@ -108,33 +108,4 @@
String type = module.getOptionValue(Module.ELEMENT_TYPE);
return ModuleTypeManager.getInstance().findByID(type);
}
-
- public static void updateExcludedFoldersInWriteAction(final Module module,
- @NotNull final VirtualFile contentRoot,
- final Collection<String> urlsToUnExclude,
- final Collection<String> urlsToExclude) {
- ApplicationManager.getApplication().runWriteAction(new Runnable() {
- public void run() {
- final ModifiableRootModel modifiableModel = ModuleRootManager.getInstance(module).getModifiableModel();
- try {
- for (final ContentEntry contentEntry : modifiableModel.getContentEntries()) {
- if (contentRoot.equals(contentEntry.getFile())) {
- for (String url : urlsToUnExclude) {
- contentEntry.removeExcludeFolder(url);
- }
- for (String url : urlsToExclude) {
- contentEntry.addExcludeFolder(url);
- }
- break;
- }
- }
- modifiableModel.commit();
- }
- catch (Exception e) {
- modifiableModel.dispose();
- throw new RuntimeException(e.getMessage(), e);
- }
- }
- });
- }
}
diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java
index 3eb0954..2c44a32 100644
--- a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java
+++ b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java
@@ -56,6 +56,7 @@
public CodeStyleSettings(boolean loadExtensions) {
super(null);
+ RIGHT_MARGIN = DEFAULT_RIGHT_MARGIN;
initTypeToName();
initImportsByDefault();
@@ -243,7 +244,6 @@
public int INNER_CLASSES_ORDER_WEIGHT = 7;
//----------------- WRAPPING ---------------------------
- public int RIGHT_MARGIN = 120;
public boolean WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = false;
@@ -875,4 +875,38 @@
return myCommonSettingsManager.getCommonSettings(langName);
}
+ /**
+ * Retrieves right margin for the given language. The language may overwrite default RIGHT_MARGIN value with its own RIGHT_MARGIN
+ * in language's CommonCodeStyleSettings instance.
+ *
+ * @param language The language to get right margin for or null if root (default) right margin is requested.
+ * @return The right margin for the language if it is defined (not null) and its settings contain non-negative margin. Root (default)
+ * margin otherwise (CodeStyleSettings.RIGHT_MARGIN).
+ */
+ public int getRightMargin(@Nullable Language language) {
+ if (language != null) {
+ CommonCodeStyleSettings langSettings = getCommonSettings(language);
+ if (langSettings != null) {
+ if (langSettings.RIGHT_MARGIN >= 0) return langSettings.RIGHT_MARGIN;
+ }
+ }
+ return RIGHT_MARGIN;
+ }
+
+ /**
+ * Assigns another right margin for the language or (if it is null) to root (default) margin.
+ *
+ * @param language The language to assign the right margin to or null if root (default) right margin is to be changed.
+ * @param rightMargin New right margin.
+ */
+ public void setRightMargin(@Nullable Language language, int rightMargin) {
+ if (language != null) {
+ CommonCodeStyleSettings langSettings = getCommonSettings(language);
+ if (langSettings != null) {
+ langSettings.RIGHT_MARGIN = rightMargin;
+ return;
+ }
+ }
+ RIGHT_MARGIN = rightMargin;
+ }
}
diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettingsCustomizable.java b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettingsCustomizable.java
index 2658334..290078e 100644
--- a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettingsCustomizable.java
+++ b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettingsCustomizable.java
@@ -111,6 +111,7 @@
}
enum WrappingOrBraceOption {
+ RIGHT_MARGIN,
KEEP_CONTROL_STATEMENT_IN_ONE_LINE,
LINE_COMMENT_AT_FIRST_COLUMN,
BLOCK_COMMENT_AT_FIRST_COLUMN,
diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/CommonCodeStyleSettings.java b/platform/lang-api/src/com/intellij/psi/codeStyle/CommonCodeStyleSettings.java
index 310c005..20b96ca 100644
--- a/platform/lang-api/src/com/intellij/psi/codeStyle/CommonCodeStyleSettings.java
+++ b/platform/lang-api/src/com/intellij/psi/codeStyle/CommonCodeStyleSettings.java
@@ -161,7 +161,13 @@
void copyNonDefaultValuesFrom(CommonCodeStyleSettings from) {
CommonCodeStyleSettings defaultSettings = new CommonCodeStyleSettings(null);
PARENT_SETTINGS_INSTALLED =
- copyFields(getClass().getFields(), from, this, new SupportedFieldsDiffFilter(from, getSupportedFields(), defaultSettings));
+ copyFields(getClass().getFields(), from, this, new SupportedFieldsDiffFilter(from, getSupportedFields(), defaultSettings) {
+ @Override
+ public boolean isAccept(@NotNull Field field) {
+ if ("RIGHT_MARGIN".equals(field.getName())) return false; // Never copy RIGHT_MARGIN, it is inherited automatically if -1
+ return super.isAccept(field);
+ }
+ });
}
private static void copyFields(Field[] fields, Object from, Object to) {
@@ -280,6 +286,8 @@
}
//----------------- GENERAL --------------------
+ public int RIGHT_MARGIN = -1;
+ public final static int DEFAULT_RIGHT_MARGIN = 120;
public boolean LINE_COMMENT_AT_FIRST_COLUMN = true;
public boolean BLOCK_COMMENT_AT_FIRST_COLUMN = true;
diff --git a/platform/lang-api/src/com/intellij/psi/util/PsiUtilBase.java b/platform/lang-api/src/com/intellij/psi/util/PsiUtilBase.java
index df0e0b9..56fe91a 100644
--- a/platform/lang-api/src/com/intellij/psi/util/PsiUtilBase.java
+++ b/platform/lang-api/src/com/intellij/psi/util/PsiUtilBase.java
@@ -23,9 +23,9 @@
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
-import com.intellij.openapi.editor.SelectionModel;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.TextEditor;
@@ -83,20 +83,22 @@
@Nullable
public static Language getLanguageInEditor(@NotNull final Editor editor, @NotNull final Project project) {
+ return getLanguageInEditor(editor.getCaretModel().getCurrentCaret(), project);
+ }
+
+ @Nullable
+ public static Language getLanguageInEditor(@NotNull Caret caret, @NotNull final Project project) {
+ Editor editor = caret.getEditor();
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) return null;
- final SelectionModel selectionModel = editor.getSelectionModel();
- int caretOffset = editor.getCaretModel().getOffset();
- int mostProbablyCorrectLanguageOffset = caretOffset == selectionModel.getSelectionStart() ||
- caretOffset == selectionModel.getSelectionEnd()
- ? selectionModel.getSelectionStart()
- : caretOffset;
+ int caretOffset = caret.getOffset();
+ int mostProbablyCorrectLanguageOffset = caretOffset == caret.getSelectionEnd() ? caret.getSelectionStart() : caretOffset;
PsiElement elt = getElementAtOffset(file, mostProbablyCorrectLanguageOffset);
Language lang = findLanguageFromElement(elt);
- if (selectionModel.hasSelection()) {
- final Language rangeLanguage = evaluateLanguageInRange(selectionModel.getSelectionStart(), selectionModel.getSelectionEnd(), file);
+ if (caret.hasSelection()) {
+ final Language rangeLanguage = evaluateLanguageInRange(caret.getSelectionStart(), caret.getSelectionEnd(), file);
if (rangeLanguage == null) return file.getLanguage();
lang = rangeLanguage;
@@ -115,22 +117,24 @@
@Nullable
public static PsiFile getPsiFileInEditor(@NotNull final Editor editor, @NotNull final Project project) {
+ return getPsiFileInEditor(editor.getCaretModel().getCurrentCaret(), project);
+ }
+
+ @Nullable
+ public static PsiFile getPsiFileInEditor(@NotNull Caret caret, @NotNull final Project project) {
+ Editor editor = caret.getEditor();
final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) return null;
PsiUtilCore.ensureValid(file);
- final Language language = getLanguageInEditor(editor, project);
+ final Language language = getLanguageInEditor(caret, project);
if (language == null) return file;
if (language == file.getLanguage()) return file;
- final SelectionModel selectionModel = editor.getSelectionModel();
- int caretOffset = editor.getCaretModel().getOffset();
- int mostProbablyCorrectLanguageOffset = caretOffset == selectionModel.getSelectionStart() ||
- caretOffset == selectionModel.getSelectionEnd()
- ? selectionModel.getSelectionStart()
- : caretOffset;
+ int caretOffset = caret.getOffset();
+ int mostProbablyCorrectLanguageOffset = caretOffset == caret.getSelectionEnd() ? caret.getSelectionStart() : caretOffset;
return getPsiFileAtOffset(file, mostProbablyCorrectLanguageOffset);
}
diff --git a/platform/lang-impl/src/com/intellij/application/options/CodeCompletionPanel.java b/platform/lang-impl/src/com/intellij/application/options/CodeCompletionPanel.java
index 8e8eba5..6c65209 100644
--- a/platform/lang-impl/src/com/intellij/application/options/CodeCompletionPanel.java
+++ b/platform/lang-impl/src/com/intellij/application/options/CodeCompletionPanel.java
@@ -28,8 +28,10 @@
import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.util.text.StringUtilRt;
import com.intellij.ui.components.JBCheckBox;
import org.intellij.lang.annotations.MagicConstant;
+import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.awt.event.ActionEvent;
@@ -56,7 +58,7 @@
private static final String CASE_SENSITIVE_FIRST_LETTER = ApplicationBundle.message("combobox.autocomplete.case.sensitive.first.letter");
private static final String[] CASE_VARIANTS = {CASE_SENSITIVE_ALL, CASE_SENSITIVE_NONE, CASE_SENSITIVE_FIRST_LETTER};
- public CodeCompletionPanel(){
+ public CodeCompletionPanel() {
//noinspection unchecked
myCaseSensitiveCombo.setModel(new DefaultComboBoxModel(CASE_VARIANTS));
@@ -73,7 +75,7 @@
myCbAutocompletion.addActionListener(
new ActionListener() {
@Override
- public void actionPerformed(ActionEvent event) {
+ public void actionPerformed(@NotNull ActionEvent event) {
boolean selected = myCbAutocompletion.isSelected();
myCbSelectByChars.setEnabled(selected);
}
@@ -83,7 +85,7 @@
myCbAutopopupJavaDoc.addActionListener(
new ActionListener() {
@Override
- public void actionPerformed(ActionEvent event) {
+ public void actionPerformed(@NotNull ActionEvent event) {
myAutopopupJavaDocField.setEnabled(myCbAutopopupJavaDoc.isSelected());
}
}
@@ -92,7 +94,7 @@
myCbParameterInfoPopup.addActionListener(
new ActionListener() {
@Override
- public void actionPerformed(ActionEvent event) {
+ public void actionPerformed(@NotNull ActionEvent event) {
myParameterInfoDelayField.setEnabled(myCbParameterInfoPopup.isSelected());
}
}
@@ -205,16 +207,8 @@
}
private static int getIntegerValue(String s, int defaultValue) {
- int value = defaultValue;
- try {
- value = Integer.parseInt(s);
- if(value < 0) {
- return defaultValue;
- }
- }
- catch (NumberFormatException ignored) {
- }
- return value;
+ int value = StringUtilRt.parseInt(s, defaultValue);
+ return value < 0 ? defaultValue : value;
}
@MagicConstant(intValues = {CodeInsightSettings.ALL, CodeInsightSettings.NONE, CodeInsightSettings.FIRST_LETTER})
diff --git a/platform/lang-impl/src/com/intellij/application/options/CodeStyleAbstractPanel.java b/platform/lang-impl/src/com/intellij/application/options/CodeStyleAbstractPanel.java
index f7c1fd4..2b142a4 100644
--- a/platform/lang-impl/src/com/intellij/application/options/CodeStyleAbstractPanel.java
+++ b/platform/lang-impl/src/com/intellij/application/options/CodeStyleAbstractPanel.java
@@ -201,7 +201,7 @@
private int getAdjustedRightMargin() {
int result = getRightMargin();
- return result > 0 ? result : CodeStyleFacade.getInstance(ProjectUtil.guessCurrentProject(getPanel())).getRightMargin();
+ return result > 0 ? result : CodeStyleFacade.getInstance(ProjectUtil.guessCurrentProject(getPanel())).getRightMargin(getDefaultLanguage());
}
protected abstract int getRightMargin();
@@ -226,7 +226,7 @@
catch (ConfigurationException ignore) {
}
CodeStyleSettings clone = mySettings.clone();
- clone.RIGHT_MARGIN = getAdjustedRightMargin();
+ clone.setRightMargin(getDefaultLanguage(), getAdjustedRightMargin());
CodeStyleSettingsManager.getInstance(project).setTemporarySettings(clone);
PsiFile formatted;
try {
@@ -267,7 +267,7 @@
Document document = documentManager.getDocument(psiFile);
if (document != null) {
CodeStyleSettings clone = mySettings.clone();
- clone.RIGHT_MARGIN = getAdjustedRightMargin();
+ clone.setRightMargin(getDefaultLanguage(), getAdjustedRightMargin());
CodeStyleSettingsManager.getInstance(project).setTemporarySettings(clone);
try {
CodeStyleManager.getInstance(project).reformat(psiFile);
diff --git a/platform/lang-impl/src/com/intellij/application/options/CodeStyleSettingsUtilImpl.java b/platform/lang-impl/src/com/intellij/application/options/CodeStyleSettingsUtilImpl.java
index 640fcac..418cc3c 100644
--- a/platform/lang-impl/src/com/intellij/application/options/CodeStyleSettingsUtilImpl.java
+++ b/platform/lang-impl/src/com/intellij/application/options/CodeStyleSettingsUtilImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -23,7 +23,7 @@
public class CodeStyleSettingsUtilImpl extends CodeStyleSettingsUtil {
/**
- * Shows code style settings sutable for the project passed. I.e. it shows project code style page if one
+ * Shows code style settings suitable for the project passed. I.e. it shows project code style page if one
* is configured to use own code style scheme or global one in other case.
* @param project
* @return Returns true if settings were modified during editing session.
diff --git a/platform/lang-impl/src/com/intellij/application/options/ModuleAwareProjectConfigurable.java b/platform/lang-impl/src/com/intellij/application/options/ModuleAwareProjectConfigurable.java
index f7d8ab8..b005b5e 100644
--- a/platform/lang-impl/src/com/intellij/application/options/ModuleAwareProjectConfigurable.java
+++ b/platform/lang-impl/src/com/intellij/application/options/ModuleAwareProjectConfigurable.java
@@ -35,7 +35,6 @@
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
-import javax.swing.border.EmptyBorder;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
@@ -116,8 +115,7 @@
for (Module module : modules) {
final T configurable = createModuleConfigurable(module);
myModuleConfigurables.put(module, configurable);
- final JComponent component = new JBScrollPane(configurable.createComponent());
- component.setBorder(new EmptyBorder(0, 0, 0, 0));
+ final JComponent component = configurable.createComponent();
cardPanel.add(component, module.getName());
}
moduleList.addListSelectionListener(new ListSelectionListener() {
diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTableWithPreviewPanel.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTableWithPreviewPanel.java
index 099830e..f978d5f 100644
--- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTableWithPreviewPanel.java
+++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTableWithPreviewPanel.java
@@ -340,6 +340,16 @@
addOption(fieldName, title, null, options, values);
}
+ protected void addOption(@NotNull String fieldName,
+ @NotNull String title,
+ @Nullable String groupName,
+ int minValue,
+ int maxValue,
+ int defaultValue,
+ String defaultValueText) {
+ myOptions.add(new IntOption(null, fieldName, title, groupName, null, null, minValue, maxValue, defaultValue, defaultValueText));
+ }
+
protected void addOption(@NotNull String fieldName, @NotNull String title, @Nullable String groupName) {
myOptions.add(new BooleanOption(null, fieldName, title, groupName, null, null));
}
@@ -469,6 +479,78 @@
}
}
+ private class IntOption extends Option {
+
+ private final int myMinValue;
+ private final int myMaxValue;
+ private final int myDefaultValue;
+ @Nullable private String myDefaultValueText;
+
+ public IntOption(Class<? extends CustomCodeStyleSettings> clazz,
+ @NotNull String fieldName,
+ @NotNull String title,
+ @Nullable String groupName,
+ @Nullable OptionAnchor anchor,
+ @Nullable String anchorFiledName,
+ int minValue,
+ int maxValue,
+ int defaultValue,
+ @Nullable String defaultValueText) {
+ super(clazz, fieldName, title, groupName, anchor, anchorFiledName);
+ myMinValue = minValue;
+ myMaxValue = maxValue;
+ myDefaultValue = defaultValue;
+ myDefaultValueText = defaultValueText;
+ }
+
+ @Override
+ public Object getValue(CodeStyleSettings settings) {
+ try {
+ int value = field.getInt(getSettings(settings));
+ return value == myDefaultValue && myDefaultValueText != null ? myDefaultValueText : value;
+ }
+ catch (IllegalAccessException e) {
+ return null;
+ }
+ }
+
+ @Override
+ public void setValue(Object value, CodeStyleSettings settings) {
+ //noinspection EmptyCatchBlock
+ try {
+ if (myDefaultValueText != null && !myDefaultValueText.equals(value)) {
+ field.setInt(getSettings(settings), ((Integer)value).intValue());
+ }
+ else {
+ field.setInt(getSettings(settings), -1);
+ }
+ }
+ catch (IllegalAccessException e) {
+ }
+ }
+
+ public int getMinValue() {
+ return myMinValue;
+ }
+
+ public int getMaxValue() {
+ return myMaxValue;
+ }
+
+ public int getDefaultValue() {
+ return myDefaultValue;
+ }
+
+ public boolean isDefaultText(Object value) {
+ return myDefaultValueText != null && myDefaultValueText.equals(value);
+ }
+
+ @Nullable
+ public String getDefaultValueText() {
+ return myDefaultValueText;
+ }
+ }
+
@SuppressWarnings({"HardCodedStringLiteral"})
public final ColumnInfo TITLE = new ColumnInfo("TITLE") {
@Override
@@ -604,6 +686,7 @@
private final JLabel myComboBox = new JLabel();
private final JCheckBox myCheckBox = new JCheckBox();
private final JPanel myEmptyLabel = new JPanel();
+ private final JLabel myIntLabel = new JLabel();
@Override
public Component getTableCellRendererComponent(JTable table,
@@ -636,6 +719,10 @@
myComboBox.setEnabled(isEnabled);
return myComboBox;
}
+ else if (value instanceof Integer) {
+ myIntLabel.setText(value.toString());
+ return myIntLabel;
+ }
myCheckBox.putClientProperty("JComponent.sizeVariant", "small");
myComboBox.putClientProperty("JComponent.sizeVariant", "small");
@@ -645,12 +732,55 @@
}
}
+ private static class MyIntOptionEditor extends JTextField {
+ private int myMinValue;
+ private int myMaxValue;
+ private int myDefaultValue;
+ private String myDefaultValueText;
+
+ private MyIntOptionEditor() {
+ super();
+ }
+
+ public Object getPresentableValue() {
+ int value = validateAndGetIntOption();
+ return value == myDefaultValue && myDefaultValueText != null ? myDefaultValueText : value;
+ }
+
+ private int validateAndGetIntOption() {
+ try {
+ int value = Integer.parseInt(getText());
+ return value >= myMinValue && value <= myMaxValue ? value : myDefaultValue;
+ }
+ catch (NumberFormatException nfe) {
+ return myDefaultValue;
+ }
+ }
+
+ public void setMinValue(int minValue) {
+ myMinValue = minValue;
+ }
+
+ public void setMaxValue(int maxValue) {
+ myMaxValue = maxValue;
+ }
+
+ public void setDefaultValue(int defaultValue) {
+ myDefaultValue = defaultValue;
+ }
+
+ public void setDefaultValueText(String defaultValueText) {
+ myDefaultValueText = defaultValueText;
+ }
+ }
+
/**
* @author Konstantin Bulenkov
*/
private class MyValueEditor extends AbstractTableCellEditor {
private final JCheckBox myBooleanEditor = new JCheckBox();
private JBComboBoxTableCellEditorComponent myOptionsEditor = new JBComboBoxTableCellEditorComponent();
+ private MyIntOptionEditor myIntOptionsEditor = new MyIntOptionEditor();
private Component myCurrentEditor = null;
private MyTreeNode myCurrentNode = null;
@@ -684,6 +814,9 @@
else if (myCurrentEditor == myBooleanEditor) {
return myBooleanEditor.isSelected() ? Boolean.TRUE : Boolean.FALSE;
}
+ else if (myCurrentEditor == myIntOptionsEditor) {
+ return myIntOptionsEditor.getPresentableValue();
+ }
return null;
}
@@ -702,6 +835,15 @@
myBooleanEditor.setSelected(node.getValue() == Boolean.TRUE);
myBooleanEditor.setEnabled(node.isEnabled());
}
+ else if (node.getKey() instanceof IntOption) {
+ IntOption intOption = (IntOption)node.getKey();
+ myCurrentEditor = myIntOptionsEditor;
+ myIntOptionsEditor.setText(intOption.isDefaultText(node.getValue()) ? "" : node.getValue().toString());
+ myIntOptionsEditor.setMinValue(intOption.getMinValue());
+ myIntOptionsEditor.setMaxValue(intOption.getMaxValue());
+ myIntOptionsEditor.setDefaultValue(intOption.getDefaultValue());
+ myIntOptionsEditor.setDefaultValueText(intOption.getDefaultValueText());
+ }
else {
myCurrentEditor = myOptionsEditor;
myOptionsEditor.setCell(table, row, column);
diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/WrappingAndBracesPanel.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/WrappingAndBracesPanel.java
index 1b27087..c192d0e 100644
--- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/WrappingAndBracesPanel.java
+++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/WrappingAndBracesPanel.java
@@ -32,6 +32,8 @@
@Override
protected void initTables() {
+ addOption("RIGHT_MARGIN", ApplicationBundle.message("editbox.right.margin.columns"), null, 0, 999, -1, ApplicationBundle.message("settings.code.style.default.general"));
+
addOption("KEEP_LINE_BREAKS", ApplicationBundle.message("wrapping.keep.line.breaks"), WRAPPING_KEEP);
addOption("KEEP_FIRST_COLUMN_COMMENT", ApplicationBundle.message("wrapping.keep.comment.at.first.column"), WRAPPING_KEEP);
addOption("KEEP_CONTROL_STATEMENT_IN_ONE_LINE", ApplicationBundle.message("checkbox.keep.when.reformatting.control.statement.in.one.line"), WRAPPING_KEEP);
diff --git a/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.java b/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.java
index 2cabcab..a555108 100644
--- a/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.java
+++ b/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.java
@@ -161,7 +161,7 @@
myCbSurroundSelectionOnTyping.setSelected(codeInsightSettings.SURROUND_SELECTION_ON_QUOTE_TYPED);
- myCbIndentingBackspace.setSelected(codeInsightSettings.INDENTING_BACKSPACE);
+ myCbIndentingBackspace.setSelected(codeInsightSettings.SMART_BACKSPACE == CodeInsightSettings.AUTOINDENT);
super.reset();
}
@@ -182,7 +182,7 @@
codeInsightSettings.SURROUND_SELECTION_ON_QUOTE_TYPED = myCbSurroundSelectionOnTyping.isSelected();
editorSettings.setCamelWords(myCbCamelWords.isSelected());
codeInsightSettings.REFORMAT_ON_PASTE = getReformatPastedBlockValue();
- codeInsightSettings.INDENTING_BACKSPACE = myCbIndentingBackspace.isSelected();
+ codeInsightSettings.SMART_BACKSPACE = myCbIndentingBackspace.isSelected() ? CodeInsightSettings.AUTOINDENT : CodeInsightSettings.OFF;
super.apply();
}
@@ -208,7 +208,7 @@
isModified |= isModified(myCbSurroundSelectionOnTyping, codeInsightSettings.SURROUND_SELECTION_ON_QUOTE_TYPED);
- isModified |= isModified(myCbIndentingBackspace, codeInsightSettings.INDENTING_BACKSPACE);
+ isModified |= isModified(myCbIndentingBackspace, codeInsightSettings.SMART_BACKSPACE == CodeInsightSettings.AUTOINDENT);
return isModified;
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightSettings.java b/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightSettings.java
index 013b080..942cbfa1 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightSettings.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightSettings.java
@@ -100,7 +100,10 @@
public boolean SHOW_FULL_SIGNATURES_IN_PARAMETER_INFO = false;
- public boolean INDENTING_BACKSPACE = true;
+ @MagicConstant(intValues = {OFF, AUTOINDENT})
+ public int SMART_BACKSPACE = AUTOINDENT;
+ public static final int OFF = 0;
+ public static final int AUTOINDENT = 1;
public boolean SMART_INDENT_ON_ENTER = true;
public boolean INSERT_BRACE_ON_ENTER = true;
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/MultiCaretCodeInsightAction.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/MultiCaretCodeInsightAction.java
new file mode 100644
index 0000000..568e17b
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/MultiCaretCodeInsightAction.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2000-2014 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.codeInsight.actions;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.editor.Caret;
+import com.intellij.openapi.editor.CaretAction;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.ScrollType;
+import com.intellij.openapi.editor.actionSystem.DocCommandGroupId;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Ref;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
+import com.intellij.psi.util.PsiUtilBase;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Base class for PSI-aware editor actions that need to support multiple carets.
+ * Recognizes multi-root PSI and injected fragments, so different carets might be processed in context of different
+ * {@link com.intellij.openapi.editor.Editor} and {@link com.intellij.psi.PsiFile} instances.
+ * <p>
+ * Implementations should implement {@link #getHandler()} method, and might override {@link
+ * #isValidFor(com.intellij.openapi.project.Project, com.intellij.openapi.editor.Editor, com.intellij.openapi.editor.Caret, com.intellij.psi.PsiFile)} method.
+ *
+ * @see com.intellij.codeInsight.actions.MultiCaretCodeInsightActionHandler
+ */
+public abstract class MultiCaretCodeInsightAction extends AnAction {
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ final Project project = e.getProject();
+ if (project == null) {
+ return;
+ }
+ final Editor hostEditor = CommonDataKeys.EDITOR.getData(e.getDataContext());
+ if (hostEditor == null) {
+ return;
+ }
+
+ actionPerformedImpl(project, hostEditor);
+ }
+
+ public void actionPerformedImpl(final Project project, final Editor hostEditor) {
+ CommandProcessor.getInstance().executeCommand(project, new Runnable() {
+ @Override
+ public void run() {
+ ApplicationManager.getApplication().runWriteAction(new Runnable() {
+ @Override
+ public void run() {
+ MultiCaretCodeInsightActionHandler handler = getHandler();
+ try {
+ iterateOverCarets(project, hostEditor, handler);
+ }
+ finally {
+ handler.postInvoke();
+ }
+ }
+ });
+ }
+ }, getCommandName(), DocCommandGroupId.noneGroupId(hostEditor.getDocument()));
+
+ hostEditor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ final Presentation presentation = e.getPresentation();
+
+ Project project = e.getProject();
+ if (project == null) {
+ presentation.setEnabled(false);
+ return;
+ }
+
+ Editor hostEditor = CommonDataKeys.EDITOR.getData(e.getDataContext());
+ if (hostEditor == null) {
+ presentation.setEnabled(false);
+ return;
+ }
+
+ final Ref<Boolean> enabled = new Ref<Boolean>(Boolean.FALSE);
+ iterateOverCarets(project, hostEditor, new MultiCaretCodeInsightActionHandler() {
+ @Override
+ public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull Caret caret, @NotNull PsiFile file) {
+ if (isValidFor(project, editor, caret, file)) {
+ enabled.set(Boolean.TRUE);
+ }
+ }
+ });
+ presentation.setEnabled(enabled.get());
+ }
+
+ private static void iterateOverCarets(@NotNull final Project project,
+ @NotNull final Editor hostEditor,
+ @NotNull final MultiCaretCodeInsightActionHandler handler) {
+ PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
+ final PsiFile psiFile = documentManager.getCachedPsiFile(hostEditor.getDocument());
+ documentManager.commitAllDocuments();
+
+ hostEditor.getCaretModel().runForEachCaret(new CaretAction() {
+ @Override
+ public void perform(Caret caret) {
+ Editor editor = hostEditor;
+ if (psiFile != null) {
+ Caret injectedCaret = InjectedLanguageUtil.getCaretForInjectedLanguageNoCommit(caret, psiFile);
+ if (injectedCaret != null) {
+ caret = injectedCaret;
+ editor = caret.getEditor();
+ }
+ }
+ final PsiFile file = PsiUtilBase.getPsiFileInEditor(caret, project);
+ if (file != null) {
+ handler.invoke(project, editor, caret, file);
+ }
+ }
+ }, true);
+ }
+
+ /**
+ * During action status update this method is invoked for each caret in editor. If at least for a single caret it returns
+ * <code>true</code>, action is considered enabled.
+ */
+ protected boolean isValidFor(@NotNull Project project, @NotNull Editor editor, @NotNull Caret caret, @NotNull PsiFile file) {
+ return true;
+ }
+
+ @NotNull
+ protected abstract MultiCaretCodeInsightActionHandler getHandler();
+
+ protected String getCommandName() {
+ String text = getTemplatePresentation().getText();
+ return text == null ? "" : text;
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/MultiCaretCodeInsightActionHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/MultiCaretCodeInsightActionHandler.java
new file mode 100644
index 0000000..bfe7e32
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/MultiCaretCodeInsightActionHandler.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2014 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.codeInsight.actions;
+
+import com.intellij.openapi.editor.Caret;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Delegate class that performs actual work for {@link com.intellij.codeInsight.actions.MultiCaretCodeInsightAction}
+ */
+public abstract class MultiCaretCodeInsightActionHandler {
+ /**
+ * Invoked for each caret in editor (in bottom-to-top order). <code>project</code> value is the same for all carets, <code>editor</code>
+ * and <code>file</code> values can be different in presence of multi-root PSI and injected fragments. For injected fragments
+ * caret instance will belong to corresponding injected editor.
+ */
+ public abstract void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull Caret caret, @NotNull PsiFile file);
+
+ /**
+ * Invoked after processing all carets.
+ */
+ public void postInvoke() {}
+}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java
index 50942cb..4966a94 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java
@@ -174,7 +174,8 @@
}
final TextRange range;
- if (!processWholeFile && editor != null && editor.getSelectionModel().hasSelection()){
+ final boolean processSelectedText = !processWholeFile && hasSelection;
+ if (processSelectedText) {
range = TextRange.create(editor.getSelectionModel().getSelectionStart(), editor.getSelectionModel().getSelectionEnd());
}
else{
@@ -185,7 +186,7 @@
new OptimizeImportsProcessor(new ReformatCodeProcessor(project, file, null, processChangedTextOnly)).run();
}
else {
- new ReformatCodeProcessor(project, file, range, processChangedTextOnly).run();
+ new ReformatCodeProcessor(project, file, range, !processSelectedText && processChangedTextOnly).run();
}
if (rearrangeEntries && file != null && editor != null) {
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java
index e039cec..e0a3be5 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java
@@ -772,11 +772,8 @@
if (context.getCompletionChar() == Lookup.COMPLETE_STATEMENT_SELECT_CHAR) {
final Language language = PsiUtilBase.getLanguageInEditor(editor, project);
if (language != null) {
- final List<SmartEnterProcessor> processors = SmartEnterProcessors.INSTANCE.forKey(language);
- if (processors.size() > 0) {
- for (SmartEnterProcessor processor : processors) {
- processor.process(project, editor, indicator.getParameters().getOriginalFile());
- }
+ for (SmartEnterProcessor processor : SmartEnterProcessors.INSTANCE.forKey(language)) {
+ if (processor.processAfterCompletion(editor, indicator.getParameters().getOriginalFile())) break;
}
}
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java
index 0143e55..e25f050 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java
@@ -17,6 +17,7 @@
package com.intellij.codeInsight.completion;
import com.intellij.codeInsight.CodeInsightSettings;
+import com.intellij.codeInsight.TargetElementUtilBase;
import com.intellij.codeInsight.completion.impl.CompletionServiceImpl;
import com.intellij.codeInsight.completion.impl.CompletionSorterImpl;
import com.intellij.codeInsight.editorActions.CompletionAutoPopupHandler;
@@ -216,7 +217,7 @@
if (!initContext.getOffsetMap().wasModified(CompletionInitializationContext.IDENTIFIER_END_OFFSET)) {
try {
final int selectionEndOffset = initContext.getSelectionEndOffset();
- final PsiReference reference = initContext.getFile().findReferenceAt(selectionEndOffset);
+ final PsiReference reference = TargetElementUtilBase.findReference(myEditor, selectionEndOffset);
if (reference != null) {
initContext.setReplacementOffset(findReplacementOffset(selectionEndOffset, reference));
}
@@ -252,7 +253,7 @@
}
}
- return reference.getElement().getTextRange().getStartOffset() + reference.getRangeInElement().getEndOffset();
+ return selectionEndOffset;
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/FilePathCompletionContributor.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/FilePathCompletionContributor.java
index f23a7a6..4a34e94 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/completion/FilePathCompletionContributor.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/FilePathCompletionContributor.java
@@ -48,6 +48,7 @@
import com.intellij.psi.search.ProjectScope;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -71,9 +72,7 @@
final PsiReference psiReference = parameters.getPosition().getContainingFile().findReferenceAt(parameters.getOffset());
if (getReference(psiReference) != null && parameters.getInvocationCount() == 1) {
final String shortcut = getActionShortcut(IdeActions.ACTION_CODE_COMPLETION);
- if (shortcut != null) {
- result.addLookupAdvertisement(CodeInsightBundle.message("class.completion.file.path", shortcut));
- }
+ result.addLookupAdvertisement(CodeInsightBundle.message("class.completion.file.path", shortcut));
}
}
});
@@ -134,24 +133,30 @@
final PsiFile[] files = FilenameIndex.getFilesByName(project, name, scope);
- if (files.length > 0) {
- for (final PsiFile file : files) {
+ if (files.length <= 0) {
+ continue;
+ }
+ for (final PsiFile file : files) {
+ ProgressManager.checkCanceled();
+
+ final VirtualFile virtualFile = file.getVirtualFile();
+ if (virtualFile == null || !virtualFile.isValid() || Comparing.equal(virtualFile, contextFile)) {
+ continue;
+ }
+ List<FileReferenceHelper> helperList = new ArrayList<FileReferenceHelper>();
+ for (FileReferenceHelper contextHelper : helpers) {
ProgressManager.checkCanceled();
- final VirtualFile virtualFile = file.getVirtualFile();
- if (virtualFile != null && virtualFile.isValid() && !Comparing.equal(virtualFile, contextFile)) {
- for (FileReferenceHelper contextHelper : helpers) {
- ProgressManager.checkCanceled();
-
- if (contextHelper.isMine(project, virtualFile)) {
- if (pathPrefixParts == null ||
- fileMatchesPathPrefix(contextHelper.getPsiFileSystemItem(project, virtualFile), pathPrefixParts)) {
- __result.addElement(new FilePathLookupItem(file, contextHelper));
- }
- }
+ if (contextHelper.isMine(project, virtualFile)) {
+ if (pathPrefixParts == null ||
+ fileMatchesPathPrefix(contextHelper.getPsiFileSystemItem(project, virtualFile), pathPrefixParts)) {
+ helperList.add(contextHelper);
}
}
}
+ if (!helperList.isEmpty()) {
+ __result.addElement(new FilePathLookupItem(file, helperList));
+ }
}
}
}
@@ -159,9 +164,7 @@
if (set.getSuitableFileTypes().length > 0 && parameters.getInvocationCount() == 1) {
final String shortcut = getActionShortcut(IdeActions.ACTION_CODE_COMPLETION);
- if (shortcut != null) {
- result.addLookupAdvertisement(CodeInsightBundle.message("class.completion.file.path.all.variants", shortcut));
- }
+ result.addLookupAdvertisement(CodeInsightBundle.message("class.completion.file.path.all.variants", shortcut));
}
if (fileReferencePair.getSecond()) result.stopHere();
@@ -203,7 +206,7 @@
final String path = StringUtil.join(contextParts, "/");
int nextIndex = 0;
- for (final String s : pathPrefix) {
+ for (@NonNls final String s : pathPrefix) {
if ((nextIndex = path.indexOf(s.toLowerCase(), nextIndex)) == -1) return false;
}
@@ -252,19 +255,19 @@
return null;
}
- public class FilePathLookupItem extends LookupElement {
+ public static class FilePathLookupItem extends LookupElement {
private final String myName;
private final String myPath;
private final String myInfo;
private final Icon myIcon;
private final PsiFile myFile;
- private final FileReferenceHelper myReferenceHelper;
+ private final List<FileReferenceHelper> myHelpers;
- public FilePathLookupItem(@NotNull final PsiFile file, @NotNull final FileReferenceHelper referenceHelper) {
+ public FilePathLookupItem(@NotNull final PsiFile file, @NotNull final List<FileReferenceHelper> helpers) {
myName = file.getName();
myPath = file.getVirtualFile().getPath();
- myReferenceHelper = referenceHelper;
+ myHelpers = helpers;
myInfo = FileInfoManager.getFileAdditionalInfo(file);
myIcon = file.getFileType().getIcon();
@@ -306,10 +309,7 @@
@Override
public void renderElement(LookupElementPresentation presentation) {
- final VirtualFile virtualFile = myFile.getVirtualFile();
- LOG.assertTrue(virtualFile != null);
- final PsiFileSystemItem root = myReferenceHelper.findRoot(myFile.getProject(), virtualFile);
- final String relativePath = PsiFileSystemItemUtil.getRelativePath(root, myReferenceHelper.getPsiFileSystemItem(myFile.getProject(), virtualFile));
+ final String relativePath = getRelativePath();
final StringBuilder sb = new StringBuilder();
if (myInfo != null) {
@@ -340,6 +340,18 @@
presentation.setIcon(myIcon);
}
+ @Nullable
+ private String getRelativePath() {
+ final VirtualFile virtualFile = myFile.getVirtualFile();
+ LOG.assertTrue(virtualFile != null);
+ for (FileReferenceHelper helper : myHelpers) {
+ final PsiFileSystemItem root = helper.findRoot(myFile.getProject(), virtualFile);
+ String path = PsiFileSystemItemUtil.getRelativePath(root, helper.getPsiFileSystemItem(myFile.getProject(), virtualFile));
+ if (path != null) return path;
+ }
+ return null;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java
index 1984230..8ceca4c 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java
@@ -25,7 +25,6 @@
import com.intellij.codeInsight.intention.impl.IntentionHintComponent;
import com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler;
import com.intellij.codeInsight.intention.impl.config.IntentionManagerSettings;
-import com.intellij.codeInsight.lookup.LookupManager;
import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
import com.intellij.codeInsight.template.impl.TemplateState;
import com.intellij.codeInspection.actions.CleanupAllIntention;
@@ -208,8 +207,6 @@
}
private void getIntentionActionsToShow() {
- if (LookupManager.getInstance(myProject).getActiveLookup() != null) return;
-
getActionsToShow(myEditor, myFile, myIntentionsInfo, myPassIdToShowIntentionsFor);
if (myFile instanceof IntentionFilterOwner) {
final IntentionFilterOwner.IntentionActionsFilter actionsFilter = ((IntentionFilterOwner)myFile).getIntentionActionsFilter();
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/analysis/encoding/EncodingReferenceInjector.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/analysis/encoding/EncodingReferenceInjector.java
new file mode 100644
index 0000000..6594a5a
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/analysis/encoding/EncodingReferenceInjector.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2014 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.codeInsight.daemon.impl.analysis.encoding;
+
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiReference;
+import com.intellij.psi.injection.ReferenceInjector;
+import com.intellij.util.ProcessingContext;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class EncodingReferenceInjector extends ReferenceInjector {
+ @NotNull
+ @Override
+ public PsiReference[] getReferences(@NotNull PsiElement element, @NotNull ProcessingContext context, @NotNull TextRange range) {
+ return new PsiReference[]{new EncodingReference(element, range.substring(element.getText()), range)};
+ }
+
+ @NotNull
+ @Override
+ public String getId() {
+ return "encoding-reference";
+ }
+
+ @NotNull
+ @Override
+ public String getDisplayName() {
+ return "Encoding Name";
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java
index df55cba..c27ce40 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java
@@ -54,13 +54,17 @@
import com.intellij.psi.*;
import com.intellij.psi.presentation.java.SymbolPresentationUtil;
import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.util.PsiUtilCore;
import com.intellij.ui.ListScrollingUtil;
import com.intellij.ui.content.Content;
import com.intellij.ui.popup.AbstractPopup;
import com.intellij.ui.popup.NotLookupOrSearchCondition;
import com.intellij.ui.popup.PopupPositionManager;
import com.intellij.ui.popup.PopupUpdateProcessor;
-import com.intellij.util.*;
+import com.intellij.util.Alarm;
+import com.intellij.util.BooleanFunction;
+import com.intellij.util.Consumer;
+import com.intellij.util.Processor;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -572,7 +576,7 @@
final PsiReference ref = TargetElementUtilBase.findReference(editor, offset);
if (ref != null) {
element = assertSameProject(util.adjustReference(ref));
- if (element == null && ref instanceof PsiPolyVariantReference) {
+ if (ref instanceof PsiPolyVariantReference) {
element = assertSameProject(ref.getElement());
}
}
@@ -595,16 +599,17 @@
int offset = editor.getCaretModel().getOffset();
if (offset > 0 && offset == editor.getDocument().getTextLength()) offset--;
- final PsiElement contextElement = file == null? null : file.findElementAt(offset);
- final PsiReference ref = TargetElementUtilBase.findReference(editor, offset);
+ PsiReference ref = TargetElementUtilBase.findReference(editor, offset);
+ PsiElement contextElement = file == null? null : file.findElementAt(offset);
+ PsiElement targetElement = ref != null ? ref.getElement() : contextElement;
+ if (targetElement != null) {
+ PsiUtilCore.ensureValid(targetElement);
+ }
- final DocumentationProvider documentationProvider = getProviderFromElement(file);
+ DocumentationProvider documentationProvider = getProviderFromElement(file);
- return documentationProvider.getDocumentationElementForLookupItem(
- PsiManager.getInstance(myProject),
- item.getObject(),
- ref != null ? ref.getElement():contextElement
- );
+ PsiManager psiManager = PsiManager.getInstance(myProject);
+ return documentationProvider.getDocumentationElementForLookupItem(psiManager, item.getObject(), targetElement);
}
}
return null;
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyHandler.java
index a68a1fd..2a46c08 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyHandler.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyHandler.java
@@ -37,8 +37,6 @@
import java.util.List;
public class CopyHandler extends EditorActionHandler {
- private static final Logger LOG = Logger.getInstance(CopyHandler.class);
-
private final EditorActionHandler myOriginalAction;
public CopyHandler(final EditorActionHandler originalHandler) {
@@ -93,7 +91,10 @@
transferableDatas.addAll(processor.collectTransferableData(file, editor, startOffsets, endOffsets));
}
- String rawText = TextBlockTransferable.convertLineSeparators(selectionModel.getSelectedText(true), "\n", transferableDatas);
+ String text = editor.getCaretModel().supportsMultipleCarets()
+ ? CopyPasteSupport.getSelectedTextForClipboard(editor, transferableDatas)
+ : selectionModel.getSelectedText();
+ String rawText = TextBlockTransferable.convertLineSeparators(text, "\n", transferableDatas);
String escapedText = null;
for (CopyPastePreProcessor processor : Extensions.getExtensions(CopyPastePreProcessor.EP_NAME)) {
escapedText = processor.preprocessOnCopy(file, startOffsets, endOffsets, rawText);
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/IndentingBackspaceHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/IndentingBackspaceHandler.java
index 634b8f5..345cb80 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/IndentingBackspaceHandler.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/IndentingBackspaceHandler.java
@@ -45,7 +45,7 @@
@Override
public boolean charDeleted(char c, PsiFile file, Editor editor) {
- if (!CodeInsightSettings.getInstance().INDENTING_BACKSPACE || !StringUtil.isWhiteSpace(c)) {
+ if (CodeInsightSettings.getInstance().SMART_BACKSPACE != CodeInsightSettings.AUTOINDENT || !StringUtil.isWhiteSpace(c)) {
return false;
}
LanguageCodeStyleSettingsProvider codeStyleSettingsProvider = LanguageCodeStyleSettingsProvider.forLanguage(file.getLanguage());
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/fillParagraph/ParagraphFillHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/fillParagraph/ParagraphFillHandler.java
index 03a7237..3aeefef 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/fillParagraph/ParagraphFillHandler.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/fillParagraph/ParagraphFillHandler.java
@@ -54,7 +54,7 @@
document.replaceString(textRange.getStartOffset(), textRange.getEndOffset(),
replacementText);
final CodeFormatterFacade codeFormatter = new CodeFormatterFacade(
- CodeStyleSettingsManager.getSettings(element.getProject()));
+ CodeStyleSettingsManager.getSettings(element.getProject()), element.getLanguage());
codeFormatter.doWrapLongLinesIfNecessary(editor, element.getProject(), document,
textRange.getStartOffset(),
textRange.getStartOffset() + replacementText.length() + 1);
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java
index ca91511..3704425e 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java
@@ -16,9 +16,9 @@
package com.intellij.codeInsight.generation;
-import com.intellij.codeInsight.CodeInsightActionHandler;
import com.intellij.codeInsight.CodeInsightUtilBase;
import com.intellij.codeInsight.CommentUtil;
+import com.intellij.codeInsight.actions.MultiCaretCodeInsightActionHandler;
import com.intellij.featureStatistics.FeatureUsageTracker;
import com.intellij.ide.highlighter.custom.CustomFileTypeLexer;
import com.intellij.lang.Commenter;
@@ -52,18 +52,20 @@
import java.util.ArrayList;
import java.util.List;
-public class CommentByBlockCommentHandler implements CodeInsightActionHandler {
+public class CommentByBlockCommentHandler extends MultiCaretCodeInsightActionHandler {
private Project myProject;
private Editor myEditor;
+ private Caret myCaret;
private @NotNull PsiFile myFile;
private Document myDocument;
private CommenterDataHolder mySelfManagedCommenterData;
@Override
- public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) {
+ public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull Caret caret, @NotNull PsiFile file) {
if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
myProject = project;
myEditor = editor;
+ myCaret = caret;
myFile = file;
myDocument = editor.getDocument();
@@ -72,19 +74,17 @@
return;
}
FeatureUsageTracker.getInstance().triggerFeatureUsed("codeassists.comment.block");
- final Commenter commenter = findCommenter(myFile, myEditor);
+ final Commenter commenter = findCommenter(myFile, myEditor, caret);
if (commenter == null) return;
- final SelectionModel selectionModel = myEditor.getSelectionModel();
-
final String prefix;
final String suffix;
if (commenter instanceof SelfManagingCommenter) {
final SelfManagingCommenter selfManagingCommenter = (SelfManagingCommenter)commenter;
mySelfManagedCommenterData = selfManagingCommenter.createBlockCommentingState(
- selectionModel.getSelectionStart(),
- selectionModel.getSelectionEnd(),
+ caret.getSelectionStart(),
+ caret.getSelectionEnd(),
myDocument,
myFile
);
@@ -94,12 +94,12 @@
}
prefix = selfManagingCommenter.getBlockCommentPrefix(
- selectionModel.getSelectionStart(),
+ caret.getSelectionStart(),
myDocument,
mySelfManagedCommenterData
);
suffix = selfManagingCommenter.getBlockCommentSuffix(
- selectionModel.getSelectionEnd(),
+ caret.getSelectionEnd(),
myDocument,
mySelfManagedCommenterData
);
@@ -117,9 +117,9 @@
final int commentEnd = commentedRange.getEndOffset();
int selectionStart = commentStart;
int selectionEnd = commentEnd;
- if (selectionModel.hasSelection()) {
- selectionStart = selectionModel.getSelectionStart();
- selectionEnd = selectionModel.getSelectionEnd();
+ if (myCaret.hasSelection()) {
+ selectionStart = myCaret.getSelectionStart();
+ selectionEnd = myCaret.getSelectionEnd();
}
if ((commentStart < selectionStart || commentStart >= selectionEnd) && (commentEnd <= selectionStart || commentEnd > selectionEnd)) {
commentRange(selectionStart, selectionEnd, prefix, suffix, commenter);
@@ -129,9 +129,9 @@
}
}
else {
- if (selectionModel.hasBlockSelection()) {
- final LogicalPosition start = selectionModel.getBlockStart();
- final LogicalPosition end = selectionModel.getBlockEnd();
+ if (myEditor.getSelectionModel().hasBlockSelection()) {
+ final LogicalPosition start = myEditor.getSelectionModel().getBlockStart();
+ final LogicalPosition end = myEditor.getSelectionModel().getBlockEnd();
assert start != null;
assert end != null;
@@ -151,9 +151,9 @@
EditorModificationUtil.insertStringAtCaret(editor, prefix, true, true);
}
}
- else if (selectionModel.hasSelection()) {
- int selectionStart = selectionModel.getSelectionStart();
- int selectionEnd = selectionModel.getSelectionEnd();
+ else if (myCaret.hasSelection()) {
+ int selectionStart = myCaret.getSelectionStart();
+ int selectionEnd = myCaret.getSelectionEnd();
if (commenter instanceof IndentedCommenter) {
final Boolean value = ((IndentedCommenter)commenter).forceIndentedLineComment();
if (value != null && value == Boolean.TRUE) {
@@ -165,7 +165,7 @@
}
else {
EditorUtil.fillVirtualSpaceUntilCaret(editor);
- int caretOffset = myEditor.getCaretModel().getOffset();
+ int caretOffset = myCaret.getOffset();
if (commenter instanceof IndentedCommenter) {
final Boolean value = ((IndentedCommenter)commenter).forceIndentedLineComment();
if (value != null && value == Boolean.TRUE) {
@@ -177,7 +177,7 @@
}
}
myDocument.insertString(caretOffset, prefix + suffix);
- myEditor.getCaretModel().moveToOffset(caretOffset + prefix.length());
+ myCaret.moveToOffset(caretOffset + prefix.length());
}
}
}
@@ -188,12 +188,11 @@
}
private boolean testSelectionForNonComments() {
- SelectionModel model = myEditor.getSelectionModel();
- if (!model.hasSelection()) {
+ if (!myCaret.hasSelection()) {
return true;
}
TextRange range
- = new TextRange(model.getSelectionStart(), model.getSelectionEnd() - 1);
+ = new TextRange(myCaret.getSelectionStart(), myCaret.getSelectionEnd() - 1);
for (PsiElement element = myFile.findElementAt(range.getStartOffset()); element != null && range.intersects(element.getTextRange());
element = element.getNextSibling()) {
if (element instanceof OuterLanguageElement) {
@@ -247,7 +246,7 @@
final FileType fileType = myFile.getFileType();
if (fileType instanceof CustomSyntaxTableFileType) {
Lexer lexer = new CustomFileTypeLexer(((CustomSyntaxTableFileType)fileType).getSyntaxTable());
- final int caretOffset = myEditor.getCaretModel().getOffset();
+ final int caretOffset = myCaret.getOffset();
int commentStart = CharArrayUtil.lastIndexOf(text, commenter.getBlockCommentPrefix(), caretOffset);
if (commentStart == -1) return null;
@@ -261,17 +260,16 @@
final String prefix;
final String suffix;
- final SelectionModel selectionModel = myEditor.getSelectionModel();
if (commenter instanceof SelfManagingCommenter) {
SelfManagingCommenter selfManagingCommenter = (SelfManagingCommenter)commenter;
prefix = selfManagingCommenter.getBlockCommentPrefix(
- selectionModel.getSelectionStart(),
+ myCaret.getSelectionStart(),
myDocument,
mySelfManagedCommenterData
);
suffix = selfManagingCommenter.getBlockCommentSuffix(
- selectionModel.getSelectionEnd(),
+ myCaret.getSelectionEnd(),
myDocument,
mySelfManagedCommenterData
);
@@ -286,8 +284,8 @@
if (commenter instanceof SelfManagingCommenter) {
commentedRange = ((SelfManagingCommenter)commenter).getBlockCommentRange(
- selectionModel.getSelectionStart(),
- selectionModel.getSelectionEnd(),
+ myCaret.getSelectionStart(),
+ myCaret.getSelectionEnd(),
myDocument,
mySelfManagedCommenterData
);
@@ -316,11 +314,10 @@
@Nullable
private TextRange getSelectedComments(CharSequence text, String prefix, String suffix) {
TextRange commentedRange = null;
- final SelectionModel selectionModel = myEditor.getSelectionModel();
- if (selectionModel.hasSelection()) {
- int selectionStart = selectionModel.getSelectionStart();
+ if (myCaret.hasSelection()) {
+ int selectionStart = myCaret.getSelectionStart();
selectionStart = CharArrayUtil.shiftForward(text, selectionStart, " \t\n");
- int selectionEnd = selectionModel.getSelectionEnd() - 1;
+ int selectionEnd = myCaret.getSelectionEnd() - 1;
selectionEnd = CharArrayUtil.shiftBackward(text, selectionEnd, " \t\n") + 1;
if (selectionEnd - selectionStart >= prefix.length() + suffix.length() &&
CharArrayUtil.regionMatches(text, selectionStart, prefix) &&
@@ -332,13 +329,13 @@
}
@Nullable
- private static Commenter findCommenter(PsiFile file, Editor editor) {
+ private static Commenter findCommenter(PsiFile file, Editor editor, Caret caret) {
final FileType fileType = file.getFileType();
if (fileType instanceof AbstractFileType) {
return ((AbstractFileType)fileType).getCommenter();
}
- Language lang = PsiUtilBase.getLanguageInEditor(editor, file.getProject());
+ Language lang = PsiUtilBase.getLanguageInEditor(caret, file.getProject());
return getCommenter(file, editor, lang, lang);
}
@@ -371,9 +368,8 @@
@Nullable
private PsiElement findCommentAtCaret() {
- int offset = myEditor.getCaretModel().getOffset();
- SelectionModel selectionModel = myEditor.getSelectionModel();
- TextRange range = new TextRange(selectionModel.getSelectionStart(), selectionModel.getSelectionEnd());
+ int offset = myCaret.getOffset();
+ TextRange range = new TextRange(myCaret.getSelectionStart(), myCaret.getSelectionEnd());
if (offset == range.getEndOffset()) {
offset--;
}
@@ -383,21 +379,16 @@
PsiElement elt = myFile.getViewProvider().findElementAt(offset);
if (elt == null) return null;
PsiElement comment = PsiTreeUtil.getParentOfType(elt, PsiComment.class, false);
- if (comment == null || selectionModel.hasSelection() && !range.contains(comment.getTextRange())) {
+ if (comment == null || myCaret.hasSelection() && !range.contains(comment.getTextRange())) {
return null;
}
return comment;
}
- @Override
- public boolean startInWriteAction() {
- return true;
- }
-
public void commentRange(int startOffset, int endOffset, String commentPrefix, String commentSuffix, Commenter commenter) {
CharSequence chars = myDocument.getCharsSequence();
- LogicalPosition caretPosition = myEditor.getCaretModel().getLogicalPosition();
+ LogicalPosition caretPosition = myCaret.getLogicalPosition();
if (startOffset == 0 || chars.charAt(startOffset - 1) == '\n') {
if (endOffset == myDocument.getTextLength() || endOffset > 0 && chars.charAt(endOffset - 1) == '\n') {
@@ -426,21 +417,17 @@
nestingSuffix.append("\n");
TextRange range =
insertNestedComments(chars, startOffset, endOffset, nestingPrefix.toString(), nestingSuffix.toString(), commenter);
- myEditor.getSelectionModel().setSelection(range.getStartOffset(), range.getEndOffset());
- //myEditor.getSelectionModel().removeSelection();
+ myCaret.setSelection(range.getStartOffset(), range.getEndOffset());
LogicalPosition pos = new LogicalPosition(caretPosition.line + 1, caretPosition.column);
- myEditor.getCaretModel().moveToLogicalPosition(pos);
- myEditor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+ myCaret.moveToLogicalPosition(pos);
return;
}
}
TextRange range = insertNestedComments(chars, startOffset, endOffset, commentPrefix, commentSuffix, commenter);
- myEditor.getSelectionModel().setSelection(range.getStartOffset(), range.getEndOffset());
- //myEditor.getSelectionModel().removeSelection();
+ myCaret.setSelection(range.getStartOffset(), range.getEndOffset());
LogicalPosition pos = new LogicalPosition(caretPosition.line, caretPosition.column + commentPrefix.length());
- myEditor.getCaretModel().moveToLogicalPosition(pos);
- myEditor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+ myCaret.moveToLogicalPosition(pos);
}
private int doBoundCommentingAndGetShift(int offset,
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java
index ba73ac1..d62f51b 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,12 +16,13 @@
package com.intellij.codeInsight.generation;
-import com.intellij.codeInsight.CodeInsightActionHandler;
import com.intellij.codeInsight.CodeInsightUtilBase;
import com.intellij.codeInsight.CommentUtil;
+import com.intellij.codeInsight.actions.MultiCaretCodeInsightActionHandler;
import com.intellij.featureStatistics.FeatureUsageTracker;
import com.intellij.ide.highlighter.custom.SyntaxTable;
import com.intellij.injected.editor.EditorWindow;
+import com.intellij.injected.editor.InjectedCaret;
import com.intellij.lang.Commenter;
import com.intellij.lang.Language;
import com.intellij.lang.LanguageCommenters;
@@ -38,7 +39,6 @@
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.codeStyle.CodeStyleManager;
@@ -53,181 +53,245 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
-public class CommentByLineCommentHandler implements CodeInsightActionHandler {
-
+public class CommentByLineCommentHandler extends MultiCaretCodeInsightActionHandler {
private Project myProject;
- private PsiFile myFile;
- private Document myDocument;
- private Editor myEditor;
- private int myStartOffset;
- private int myEndOffset;
- private int myStartLine;
- private int myEndLine;
- private int[] myStartOffsets;
- private int[] myEndOffsets;
- private Commenter[] myCommenters;
- private Map<SelfManagingCommenter, CommenterDataHolder> myCommenterStateMap;
private CodeStyleManager myCodeStyleManager;
+ private final List<Block> myBlocks = new ArrayList<Block>();
+
@Override
- public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) {
+ // first pass - adjacent carets are grouped into blocks
+ public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull Caret caret, @NotNull PsiFile file) {
if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
myProject = project;
- myFile = file.getViewProvider().getPsi(file.getViewProvider().getBaseLanguage());
- myEditor = editor;
+ file = file.getViewProvider().getPsi(file.getViewProvider().getBaseLanguage());
- PsiElement context = InjectedLanguageManager.getInstance(myFile.getProject()).getInjectionHost(myFile);
+ PsiElement context = InjectedLanguageManager.getInstance(file.getProject()).getInjectionHost(file);
if (context != null && (context.textContains('\'') || context.textContains('\"'))) {
String s = context.getText();
if (StringUtil.startsWith(s, "\"") || StringUtil.startsWith(s, "\'")) {
- myFile = context.getContainingFile();
- myEditor = editor instanceof EditorWindow ? ((EditorWindow)editor).getDelegate() : editor;
+ file = context.getContainingFile();
+ editor = editor instanceof EditorWindow ? ((EditorWindow)editor).getDelegate() : editor;
+ caret = caret instanceof InjectedCaret ? ((InjectedCaret)caret).getDelegate() : caret;
}
}
- myDocument = myEditor.getDocument();
- if (!FileDocumentManager.getInstance().requestWriting(myDocument, project)) {
+ Document document = editor.getDocument();
+ if (!FileDocumentManager.getInstance().requestWriting(document, project)) {
return;
}
- PsiDocumentManager.getInstance(project).commitDocument(myDocument);
+ boolean hasSelection = caret.hasSelection();
+ int startOffset = caret.getSelectionStart();
+ int endOffset = caret.getSelectionEnd();
- FeatureUsageTracker.getInstance().triggerFeatureUsed("codeassists.comment.line");
-
- myCodeStyleManager = CodeStyleManager.getInstance(myProject);
-
- final SelectionModel selectionModel = myEditor.getSelectionModel();
-
- boolean hasSelection = selectionModel.hasSelection();
- myStartOffset = selectionModel.getSelectionStart();
- myEndOffset = selectionModel.getSelectionEnd();
-
- FoldRegion fold = myEditor.getFoldingModel().getCollapsedRegionAtOffset(myStartOffset);
- if (fold != null && fold.shouldNeverExpand() && fold.getStartOffset() == myStartOffset && fold.getEndOffset() == myEndOffset) {
- // Foldings that never expand are automatically selected, so the fact it is selected must not interfer with commenter's logic
+ FoldRegion fold = editor.getFoldingModel().getCollapsedRegionAtOffset(startOffset);
+ if (fold != null && fold.shouldNeverExpand() && fold.getStartOffset() == startOffset && fold.getEndOffset() == endOffset) {
+ // Foldings that never expand are automatically selected, so the fact it is selected must not interfere with commenter's logic
hasSelection = false;
}
- if (myDocument.getTextLength() == 0) return;
+ if (document.getTextLength() == 0) return;
while (true) {
- int lastLineEnd = myDocument.getLineEndOffset(myDocument.getLineNumber(myEndOffset));
- FoldRegion collapsedAt = myEditor.getFoldingModel().getCollapsedRegionAtOffset(lastLineEnd);
+ int lastLineEnd = document.getLineEndOffset(document.getLineNumber(endOffset));
+ FoldRegion collapsedAt = editor.getFoldingModel().getCollapsedRegionAtOffset(lastLineEnd);
if (collapsedAt != null) {
- final int endOffset = collapsedAt.getEndOffset();
- if (endOffset <= myEndOffset) {
+ final int regionEndOffset = collapsedAt.getEndOffset();
+ if (regionEndOffset <= endOffset) {
break;
}
- myEndOffset = endOffset;
+ endOffset = regionEndOffset;
}
else {
break;
}
}
- boolean wholeLinesSelected = !hasSelection ||
- myStartOffset == myDocument.getLineStartOffset(myDocument.getLineNumber(myStartOffset)) &&
- myEndOffset == myDocument.getLineEndOffset(myDocument.getLineNumber(myEndOffset - 1)) + 1;
+ int startLine = document.getLineNumber(startOffset);
+ int endLine = document.getLineNumber(endOffset);
- boolean startingNewLineComment = !hasSelection && isLineEmpty(myDocument.getLineNumber(myStartOffset)) && !Comparing
- .equal(IdeActions.ACTION_COMMENT_LINE, ActionManagerEx.getInstanceEx().getPrevPreformedActionId());
- doComment();
+ if (endLine > startLine && document.getLineStartOffset(endLine) == endOffset) {
+ endLine--;
+ }
- if (startingNewLineComment) {
- final Commenter commenter = myCommenters[0];
- if (commenter != null) {
- String prefix;
- if (commenter instanceof SelfManagingCommenter) {
- prefix = ((SelfManagingCommenter)commenter).getCommentPrefix(
- myStartLine,
- myDocument,
- myCommenterStateMap.get((SelfManagingCommenter)commenter)
- );
- if (prefix == null) prefix = ""; // TODO
- }
- else {
- prefix = commenter.getLineCommentPrefix();
- if (prefix == null) prefix = commenter.getBlockCommentPrefix();
- }
-
- int lineStart = myDocument.getLineStartOffset(myStartLine);
- lineStart = CharArrayUtil.shiftForward(myDocument.getCharsSequence(), lineStart, " \t");
- lineStart += prefix.length();
- lineStart = CharArrayUtil.shiftForward(myDocument.getCharsSequence(), lineStart, " \t");
- if (lineStart > myDocument.getTextLength()) lineStart = myDocument.getTextLength();
- myEditor.getCaretModel().moveToOffset(lineStart);
- myEditor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
- }
+ Block lastBlock = myBlocks.isEmpty() ? null : myBlocks.get(myBlocks.size() - 1);
+ Block currentBlock;
+ if (lastBlock == null || lastBlock.editor != editor || lastBlock.psiFile != file || endLine < (lastBlock.startLine - 1)) {
+ currentBlock = new Block();
+ currentBlock.editor = editor;
+ currentBlock.psiFile = file;
+ currentBlock.endLine = endLine;
+ myBlocks.add(currentBlock);
}
else {
- if (!hasSelection) {
- // Don't tweak caret position if we're already located on the last document line.
- LogicalPosition position = myEditor.getCaretModel().getLogicalPosition();
- if (position.line < myDocument.getLineCount() - 1) {
- int verticalShift = 1 + myEditor.getSoftWrapModel().getSoftWrapsForLine(position.line).size()
- - position.softWrapLinesOnCurrentLogicalLine;
- myEditor.getCaretModel().moveCaretRelatively(0, verticalShift, false, false, true);
- }
- }
- else {
- if (wholeLinesSelected) {
- selectionModel.setSelection(myStartOffset, selectionModel.getSelectionEnd());
- }
- }
+ currentBlock = lastBlock;
}
- }
+ currentBlock.carets.add(caret);
+ currentBlock.startLine = startLine;
- private boolean isLineEmpty(final int line) {
- final CharSequence chars = myDocument.getCharsSequence();
- int start = myDocument.getLineStartOffset(line);
- int end = Math.min(myDocument.getLineEndOffset(line), myDocument.getTextLength() - 1);
- for (int i = start; i <= end; i++) {
- if (!Character.isWhitespace(chars.charAt(i))) return false;
+ boolean wholeLinesSelected = !hasSelection ||
+ startOffset == document.getLineStartOffset(document.getLineNumber(startOffset)) &&
+ endOffset == document.getLineEndOffset(document.getLineNumber(endOffset - 1)) + 1;
+ boolean startingNewLineComment = !hasSelection
+ && isLineEmpty(document, document.getLineNumber(startOffset))
+ && !Comparing.equal(IdeActions.ACTION_COMMENT_LINE,
+ ActionManagerEx.getInstanceEx().getPrevPreformedActionId());
+ currentBlock.caretUpdate = startingNewLineComment ? CaretUpdate.PUT_AT_COMMENT_START :
+ !hasSelection ? CaretUpdate.SHIFT_DOWN :
+ wholeLinesSelected ? CaretUpdate.RESTORE_SELECTION : null;
}
- return true;
- }
@Override
- public boolean startInWriteAction() {
- return true;
+ public void postInvoke() {
+ FeatureUsageTracker.getInstance().triggerFeatureUsed("codeassists.comment.line");
+
+ myCodeStyleManager = CodeStyleManager.getInstance(myProject);
+
+ // second pass - determining whether we need to comment or to uncomment
+ boolean allLinesCommented = true;
+ for (Block block : myBlocks) {
+ int startLine = block.startLine;
+ int endLine = block.endLine;
+ Document document = block.editor.getDocument();
+ PsiFile psiFile = block.psiFile;
+
+ block.startOffsets = new int[endLine - startLine + 1];
+ block.endOffsets = new int[endLine - startLine + 1];
+ block.commenters = new Commenter[endLine - startLine + 1];
+ block.commenterStateMap = new THashMap<SelfManagingCommenter, CommenterDataHolder>();
+ CharSequence chars = document.getCharsSequence();
+
+ boolean singleline = startLine == endLine;
+ int offset = document.getLineStartOffset(startLine);
+ offset = CharArrayUtil.shiftForward(chars, offset, " \t");
+
+ int endOffset = CharArrayUtil.shiftBackward(chars, document.getLineEndOffset(endLine), " \t\n");
+
+ block.blockSuitableCommenter = getBlockSuitableCommenter(psiFile, offset, endOffset);
+ block.commentWithIndent =
+ !CodeStyleSettingsManager.getSettings(myProject).getCommonSettings(psiFile.getLanguage()).LINE_COMMENT_AT_FIRST_COLUMN;
+
+ for (int line = startLine; line <= endLine; line++) {
+ Commenter commenter = block.blockSuitableCommenter != null ? block.blockSuitableCommenter : findCommenter(block.editor, psiFile, line);
+ if (commenter == null || commenter.getLineCommentPrefix() == null
+ && (commenter.getBlockCommentPrefix() == null || commenter.getBlockCommentSuffix() == null)) {
+ block.skip = true;
+ break;
+ }
+
+ if (commenter instanceof SelfManagingCommenter && block.commenterStateMap.get(commenter) == null) {
+ final SelfManagingCommenter selfManagingCommenter = (SelfManagingCommenter)commenter;
+ CommenterDataHolder state = selfManagingCommenter.createLineCommentingState(startLine, endLine, document, psiFile);
+ if (state == null) state = SelfManagingCommenter.EMPTY_STATE;
+ block.commenterStateMap.put(selfManagingCommenter, state);
+ }
+
+ block.commenters[line - startLine] = commenter;
+ if (!isLineCommented(block, line, commenter) && (singleline || !isLineEmpty(document, line))) {
+ allLinesCommented = false;
+ if (commenter instanceof IndentedCommenter) {
+ final Boolean value = ((IndentedCommenter)commenter).forceIndentedLineComment();
+ if (value != null) {
+ block.commentWithIndent = value;
+ }
+ }
+ break;
+ }
+ }
+ }
+ boolean moveCarets = true;
+ for (Block block : myBlocks) {
+ if (block.carets.size() > 1 && block.startLine != block.endLine) {
+ moveCarets = false;
+ break;
+ }
+ }
+ // third pass - actual change
+ for (Block block : myBlocks) {
+ if (!block.skip) {
+ if (!allLinesCommented) {
+ if (!block.commentWithIndent) {
+ doDefaultCommenting(block);
+ }
+ else {
+ doIndentCommenting(block);
+ }
+ }
+ else {
+ for (int line = block.endLine; line >= block.startLine; line--) {
+ uncommentLine(block, line);
+ }
+ }
+ }
+
+ if (!moveCarets || block.caretUpdate == null) {
+ continue;
+ }
+ Document document = block.editor.getDocument();
+ for (Caret caret : block.carets) {
+ switch (block.caretUpdate) {
+ case PUT_AT_COMMENT_START:
+ final Commenter commenter = block.commenters[0];
+ if (commenter != null) {
+ String prefix;
+ if (commenter instanceof SelfManagingCommenter) {
+ prefix = ((SelfManagingCommenter)commenter).getCommentPrefix(block.startLine,
+ document,
+ block.commenterStateMap.get((SelfManagingCommenter)commenter));
+ if (prefix == null) prefix = ""; // TODO
+ }
+ else {
+ prefix = commenter.getLineCommentPrefix();
+ if (prefix == null) prefix = commenter.getBlockCommentPrefix();
+ }
+
+ int lineStart = document.getLineStartOffset(block.startLine);
+ lineStart = CharArrayUtil.shiftForward(document.getCharsSequence(), lineStart, " \t");
+ lineStart += prefix.length();
+ lineStart = CharArrayUtil.shiftForward(document.getCharsSequence(), lineStart, " \t");
+ if (lineStart > document.getTextLength()) lineStart = document.getTextLength();
+ caret.moveToOffset(lineStart);
+ }
+ break;
+ case SHIFT_DOWN:
+ // Don't tweak caret position if we're already located on the last document line.
+ LogicalPosition position = caret.getLogicalPosition();
+ if (position.line < document.getLineCount() - 1) {
+ int verticalShift = 1 + block.editor.getSoftWrapModel().getSoftWrapsForLine(position.line).size()
+ - position.softWrapLinesOnCurrentLogicalLine;
+ caret.moveCaretRelatively(0, verticalShift, false, true);
+ }
+ break;
+ case RESTORE_SELECTION:
+ caret.setSelection(document.getLineStartOffset(document.getLineNumber(caret.getSelectionStart())), caret.getSelectionEnd());
+ }
+ }
+ }
}
- private void doComment() {
- myStartLine = myDocument.getLineNumber(myStartOffset);
- myEndLine = myDocument.getLineNumber(myEndOffset);
-
- if (myEndLine > myStartLine && myDocument.getLineStartOffset(myEndLine) == myEndOffset) {
- myEndLine--;
- }
-
- myStartOffsets = new int[myEndLine - myStartLine + 1];
- myEndOffsets = new int[myEndLine - myStartLine + 1];
- myCommenters = new Commenter[myEndLine - myStartLine + 1];
- myCommenterStateMap = new THashMap<SelfManagingCommenter, CommenterDataHolder>();
- CharSequence chars = myDocument.getCharsSequence();
-
- boolean singleline = myStartLine == myEndLine;
- int offset = myDocument.getLineStartOffset(myStartLine);
- offset = CharArrayUtil.shiftForward(myDocument.getCharsSequence(), offset, " \t");
-
- int endOffset = CharArrayUtil.shiftBackward(myDocument.getCharsSequence(), myDocument.getLineEndOffset(myEndLine), " \t\n");
+ private static Commenter getBlockSuitableCommenter(final PsiFile file, int offset, int endOffset) {
final Language languageSuitableForCompleteFragment;
if (offset >= endOffset) { // we are on empty line
- PsiElement element = myFile.findElementAt(offset);
+ PsiElement element = file.findElementAt(offset);
if (element != null) languageSuitableForCompleteFragment = element.getParent().getLanguage();
else languageSuitableForCompleteFragment = null;
- } else {
- languageSuitableForCompleteFragment = PsiUtilBase.reallyEvaluateLanguageInRange(offset, endOffset, myFile);
+ }
+ else {
+ languageSuitableForCompleteFragment = PsiUtilBase.reallyEvaluateLanguageInRange(offset, endOffset, file);
}
+
Commenter blockSuitableCommenter =
- languageSuitableForCompleteFragment == null ? LanguageCommenters.INSTANCE.forLanguage(myFile.getLanguage()) : null;
- if (blockSuitableCommenter == null && myFile.getFileType() instanceof CustomSyntaxTableFileType) {
+ languageSuitableForCompleteFragment == null ? LanguageCommenters.INSTANCE.forLanguage(file.getLanguage()) : null;
+ if (blockSuitableCommenter == null && file.getFileType() instanceof CustomSyntaxTableFileType) {
blockSuitableCommenter = new Commenter() {
- final SyntaxTable mySyntaxTable = ((CustomSyntaxTableFileType)myFile.getFileType()).getSyntaxTable();
+ final SyntaxTable mySyntaxTable = ((CustomSyntaxTableFileType)file.getFileType()).getSyntaxTable();
@Override
@Nullable
@@ -259,96 +323,30 @@
};
}
- boolean allLineCommented = true;
- boolean commentWithIndent =
- !CodeStyleSettingsManager.getSettings(myProject).getCommonSettings(myFile.getLanguage()).LINE_COMMENT_AT_FIRST_COLUMN;
-
- for (int line = myStartLine; line <= myEndLine; line++) {
- Commenter commenter = blockSuitableCommenter != null ? blockSuitableCommenter : findCommenter(line);
- if (commenter == null) return;
- if (commenter.getLineCommentPrefix() == null &&
- (commenter.getBlockCommentPrefix() == null || commenter.getBlockCommentSuffix() == null)) {
- return;
- }
-
- if (commenter instanceof SelfManagingCommenter &&
- myCommenterStateMap.get(commenter) == null) {
- final SelfManagingCommenter selfManagingCommenter = (SelfManagingCommenter)commenter;
- CommenterDataHolder state =
- selfManagingCommenter.createLineCommentingState(myStartLine, myEndLine, myDocument, myFile);
- if (state == null) state = SelfManagingCommenter.EMPTY_STATE;
- myCommenterStateMap.put(selfManagingCommenter, state);
- }
-
- myCommenters[line - myStartLine] = commenter;
- if (!isLineCommented(line, chars, commenter) && (singleline || !isLineEmpty(line))) {
- allLineCommented = false;
- if (commenter instanceof IndentedCommenter) {
- final Boolean value = ((IndentedCommenter)commenter).forceIndentedLineComment();
- if (value != null) {
- commentWithIndent = value;
- }
- }
- break;
- }
- }
-
- if (!allLineCommented) {
- if (!commentWithIndent) {
- doDefaultCommenting(blockSuitableCommenter);
- }
- else {
- doIndentCommenting(blockSuitableCommenter);
- }
- }
- else {
- for (int line = myEndLine; line >= myStartLine; line--) {
- uncommentLine(line);
- //int offset1 = myStartOffsets[line - myStartLine];
- //int offset2 = myEndOffsets[line - myStartLine];
- //if (offset1 == offset2) continue;
- //Commenter commenter = myCommenters[line - myStartLine];
- //String prefix = commenter.getBlockCommentPrefix();
- //if (prefix == null || !myDocument.getText().substring(offset1, myDocument.getTextLength()).startsWith(prefix)) {
- // prefix = commenter.getLineCommentPrefix();
- //}
- //
- //String suffix = commenter.getBlockCommentSuffix();
- //if (suffix == null && prefix != null) suffix = "";
- //
- //if (prefix != null && suffix != null) {
- // final int suffixLen = suffix.length();
- // final int prefixLen = prefix.length();
- // if (offset2 >= 0) {
- // if (!CharArrayUtil.regionMatches(chars, offset1 + prefixLen, prefix)) {
- // myDocument.deleteString(offset2 - suffixLen, offset2);
- // }
- // }
- // if (offset1 >= 0) {
- // for (int i = offset2 - suffixLen - 1; i > offset1 + prefixLen; --i) {
- // if (CharArrayUtil.regionMatches(chars, i, suffix)) {
- // myDocument.deleteString(i, i + suffixLen);
- // }
- // else if (CharArrayUtil.regionMatches(chars, i, prefix)) {
- // myDocument.deleteString(i, i + prefixLen);
- // }
- // }
- // myDocument.deleteString(offset1, offset1 + prefixLen);
- // }
- //}
- }
- }
+ return blockSuitableCommenter;
}
- private boolean isLineCommented(final int line, final CharSequence chars, final Commenter commenter) {
+ private static boolean isLineEmpty(Document document, final int line) {
+ final CharSequence chars = document.getCharsSequence();
+ int start = document.getLineStartOffset(line);
+ int end = Math.min(document.getLineEndOffset(line), document.getTextLength() - 1);
+ for (int i = start; i <= end; i++) {
+ if (!Character.isWhitespace(chars.charAt(i))) return false;
+ }
+ return true;
+ }
+
+ private static boolean isLineCommented(Block block, final int line, final Commenter commenter) {
boolean commented;
int lineEndForBlockCommenting = -1;
- int lineStart = myDocument.getLineStartOffset(line);
+ Document document = block.editor.getDocument();
+ int lineStart = document.getLineStartOffset(line);
+ CharSequence chars = document.getCharsSequence();
lineStart = CharArrayUtil.shiftForward(chars, lineStart, " \t");
if (commenter instanceof SelfManagingCommenter) {
final SelfManagingCommenter selfManagingCommenter = (SelfManagingCommenter)commenter;
- commented = selfManagingCommenter.isLineCommented(line, lineStart, myDocument, myCommenterStateMap.get(selfManagingCommenter));
+ commented = selfManagingCommenter.isLineCommented(line, lineStart, document, block.commenterStateMap.get(selfManagingCommenter));
}
else {
String prefix = commenter.getLineCommentPrefix();
@@ -359,8 +357,8 @@
else {
prefix = commenter.getBlockCommentPrefix();
String suffix = commenter.getBlockCommentSuffix();
- final int textLength = myDocument.getTextLength();
- lineEndForBlockCommenting = myDocument.getLineEndOffset(line);
+ final int textLength = document.getTextLength();
+ lineEndForBlockCommenting = document.getLineEndOffset(line);
if (lineEndForBlockCommenting == textLength) {
final int shifted = CharArrayUtil.shiftBackward(chars, textLength - 1, " \t");
if (shifted < textLength - 1) lineEndForBlockCommenting = shifted;
@@ -368,59 +366,61 @@
else {
lineEndForBlockCommenting = CharArrayUtil.shiftBackward(chars, lineEndForBlockCommenting, " \t");
}
- commented = lineStart == lineEndForBlockCommenting && myStartLine != myEndLine ||
+ commented = lineStart == lineEndForBlockCommenting && block.startLine != block.endLine ||
CharArrayUtil.regionMatches(chars, lineStart, prefix)
&& CharArrayUtil.regionMatches(chars, lineEndForBlockCommenting - suffix.length(), suffix);
}
}
if (commented) {
- myStartOffsets[line - myStartLine] = lineStart;
- myEndOffsets[line - myStartLine] = lineEndForBlockCommenting;
+ block.startOffsets[line - block.startLine] = lineStart;
+ block.endOffsets[line - block.startLine] = lineEndForBlockCommenting;
}
return commented;
}
@Nullable
- private Commenter findCommenter(final int line) {
- final FileType fileType = myFile.getFileType();
+ private static Commenter findCommenter(Editor editor, PsiFile file, final int line) {
+ final FileType fileType = file.getFileType();
if (fileType instanceof AbstractFileType) {
return ((AbstractFileType)fileType).getCommenter();
}
- int lineStartOffset = myDocument.getLineStartOffset(line);
- int lineEndOffset = myDocument.getLineEndOffset(line) - 1;
- final CharSequence charSequence = myDocument.getCharsSequence();
+ Document document = editor.getDocument();
+ int lineStartOffset = document.getLineStartOffset(line);
+ int lineEndOffset = document.getLineEndOffset(line) - 1;
+ final CharSequence charSequence = document.getCharsSequence();
lineStartOffset = CharArrayUtil.shiftForward(charSequence, lineStartOffset, " \t");
lineEndOffset = CharArrayUtil.shiftBackward(charSequence, lineEndOffset < 0 ? 0 : lineEndOffset, " \t");
- final Language lineStartLanguage = PsiUtilCore.getLanguageAtOffset(myFile, lineStartOffset);
- final Language lineEndLanguage = PsiUtilCore.getLanguageAtOffset(myFile, lineEndOffset);
- return CommentByBlockCommentHandler.getCommenter(myFile, myEditor, lineStartLanguage, lineEndLanguage);
+ final Language lineStartLanguage = PsiUtilCore.getLanguageAtOffset(file, lineStartOffset);
+ final Language lineEndLanguage = PsiUtilCore.getLanguageAtOffset(file, lineEndOffset);
+ return CommentByBlockCommentHandler.getCommenter(file, editor, lineStartLanguage, lineEndLanguage);
}
- private Indent computeMinIndent(int line1, int line2, CharSequence chars, CodeStyleManager codeStyleManager, FileType fileType) {
- Indent minIndent = CommentUtil.getMinLineIndent(myProject, myDocument, line1, line2, fileType);
+ private Indent computeMinIndent(Editor editor, PsiFile psiFile, int line1, int line2, FileType fileType) {
+ Document document = editor.getDocument();
+ Indent minIndent = CommentUtil.getMinLineIndent(myProject, document, line1, line2, fileType);
if (line1 > 0) {
- int commentOffset = getCommentStart(line1 - 1);
+ int commentOffset = getCommentStart(editor, psiFile, line1 - 1);
if (commentOffset >= 0) {
- int lineStart = myDocument.getLineStartOffset(line1 - 1);
- String space = chars.subSequence(lineStart, commentOffset).toString();
- Indent indent = codeStyleManager.getIndent(space, fileType);
+ int lineStart = document.getLineStartOffset(line1 - 1);
+ String space = document.getCharsSequence().subSequence(lineStart, commentOffset).toString();
+ Indent indent = myCodeStyleManager.getIndent(space, fileType);
minIndent = minIndent != null ? indent.min(minIndent) : indent;
}
}
if (minIndent == null) {
- minIndent = codeStyleManager.zeroIndent();
+ minIndent = myCodeStyleManager.zeroIndent();
}
return minIndent;
}
- private int getCommentStart(int line) {
- int offset = myDocument.getLineStartOffset(line);
- CharSequence chars = myDocument.getCharsSequence();
+ private static int getCommentStart(Editor editor, PsiFile psiFile, int line) {
+ int offset = editor.getDocument().getLineStartOffset(line);
+ CharSequence chars = editor.getDocument().getCharsSequence();
offset = CharArrayUtil.shiftForward(chars, offset, " \t");
- final Commenter commenter = findCommenter(line);
+ final Commenter commenter = findCommenter(editor, psiFile, line);
if (commenter == null) return -1;
String prefix = commenter.getLineCommentPrefix();
if (prefix == null) prefix = commenter.getBlockCommentPrefix();
@@ -428,53 +428,55 @@
return CharArrayUtil.regionMatches(chars, offset, prefix) ? offset : -1;
}
- public void doDefaultCommenting(final Commenter commenter) {
+ public void doDefaultCommenting(final Block block) {
+ final Document document = block.editor.getDocument();
DocumentUtil.executeInBulk(
- myDocument, myEndLine - myStartLine >= Registry.intValue("comment.by.line.bulk.lines.trigger"), new Runnable() {
+ document, block.endLine - block.startLine >= Registry.intValue("comment.by.line.bulk.lines.trigger"), new Runnable() {
@Override
public void run() {
- for (int line = myEndLine; line >= myStartLine; line--) {
- int offset = myDocument.getLineStartOffset(line);
- commentLine(line, offset, commenter);
+ for (int line = block.endLine; line >= block.startLine; line--) {
+ int offset = document.getLineStartOffset(line);
+ commentLine(block, line, offset);
}
}
});
}
- private void doIndentCommenting(final Commenter commenter) {
- final CharSequence chars = myDocument.getCharsSequence();
- final FileType fileType = myFile.getFileType();
- final Indent minIndent = computeMinIndent(myStartLine, myEndLine, chars, myCodeStyleManager, fileType);
+ private void doIndentCommenting(final Block block) {
+ final Document document = block.editor.getDocument();
+ final CharSequence chars = document.getCharsSequence();
+ final FileType fileType = block.psiFile.getFileType();
+ final Indent minIndent = computeMinIndent(block.editor, block.psiFile, block.startLine, block.endLine, fileType);
DocumentUtil.executeInBulk(
- myDocument, myEndLine - myStartLine > Registry.intValue("comment.by.line.bulk.lines.trigger"), new Runnable() {
- @Override
- public void run() {
- for (int line = myEndLine; line >= myStartLine; line--) {
- int lineStart = myDocument.getLineStartOffset(line);
- int offset = lineStart;
- final StringBuilder buffer = new StringBuilder();
- while (true) {
- String space = buffer.toString();
- Indent indent = myCodeStyleManager.getIndent(space, fileType);
- if (indent.isGreaterThan(minIndent) || indent.equals(minIndent)) break;
- char c = chars.charAt(offset);
- if (c != ' ' && c != '\t') {
- String newSpace = myCodeStyleManager.fillIndent(minIndent, fileType);
- myDocument.replaceString(lineStart, offset, newSpace);
- offset = lineStart + newSpace.length();
- break;
+ document, block.endLine - block.startLine > Registry.intValue("comment.by.line.bulk.lines.trigger"), new Runnable() {
+ @Override
+ public void run() {
+ for (int line = block.endLine; line >= block.startLine; line--) {
+ int lineStart = document.getLineStartOffset(line);
+ int offset = lineStart;
+ final StringBuilder buffer = new StringBuilder();
+ while (true) {
+ String space = buffer.toString();
+ Indent indent = myCodeStyleManager.getIndent(space, fileType);
+ if (indent.isGreaterThan(minIndent) || indent.equals(minIndent)) break;
+ char c = chars.charAt(offset);
+ if (c != ' ' && c != '\t') {
+ String newSpace = myCodeStyleManager.fillIndent(minIndent, fileType);
+ document.replaceString(lineStart, offset, newSpace);
+ offset = lineStart + newSpace.length();
+ break;
+ }
+ buffer.append(c);
+ offset++;
}
- buffer.append(c);
- offset++;
+ commentLine(block, line, offset);
}
- commentLine(line, offset, commenter);
}
- }
- });
+ });
}
- private void uncommentRange(int startOffset, int endOffset, @NotNull Commenter commenter) {
+ private static void uncommentRange(Document document, int startOffset, int endOffset, @NotNull Commenter commenter) {
final String commentedSuffix = commenter.getCommentedBlockCommentSuffix();
final String commentedPrefix = commenter.getCommentedBlockCommentPrefix();
final String prefix = commenter.getBlockCommentPrefix();
@@ -482,52 +484,53 @@
if (prefix == null || suffix == null) {
return;
}
- if (endOffset >= suffix.length() && CharArrayUtil.regionMatches(myDocument.getCharsSequence(), endOffset - suffix.length(), suffix)) {
- myDocument.deleteString(endOffset - suffix.length(), endOffset);
- endOffset = myDocument.getTextLength();
+ if (endOffset >= suffix.length() && CharArrayUtil.regionMatches(document.getCharsSequence(), endOffset - suffix.length(), suffix)) {
+ document.deleteString(endOffset - suffix.length(), endOffset);
+ endOffset = document.getTextLength();
}
if (commentedPrefix != null && commentedSuffix != null) {
- CommentByBlockCommentHandler.commentNestedComments(myDocument, new TextRange(startOffset, endOffset), commenter);
+ CommentByBlockCommentHandler.commentNestedComments(document, new TextRange(startOffset, endOffset), commenter);
}
- myDocument.deleteString(startOffset, startOffset + prefix.length());
+ document.deleteString(startOffset, startOffset + prefix.length());
}
- private void uncommentLine(int line) {
- Commenter commenter = myCommenters[line - myStartLine];
- if (commenter == null) commenter = findCommenter(line);
+ private static void uncommentLine(Block block, int line) {
+ Document document = block.editor.getDocument();
+ Commenter commenter = block.commenters[line - block.startLine];
+ if (commenter == null) commenter = findCommenter(block.editor, block.psiFile, line);
if (commenter == null) return;
- final int startOffset = myStartOffsets[line - myStartLine];
+ final int startOffset = block.startOffsets[line - block.startLine];
if (commenter instanceof SelfManagingCommenter) {
final SelfManagingCommenter selfManagingCommenter = (SelfManagingCommenter)commenter;
- selfManagingCommenter.uncommentLine(line, startOffset, myDocument, myCommenterStateMap.get(selfManagingCommenter));
+ selfManagingCommenter.uncommentLine(line, startOffset, document, block.commenterStateMap.get(selfManagingCommenter));
return;
}
- final int endOffset = myEndOffsets[line - myStartLine];
+ final int endOffset = block.endOffsets[line - block.startLine];
if (startOffset == endOffset) {
return;
}
String prefix = commenter.getLineCommentPrefix();
if (prefix != null) {
- CharSequence chars = myDocument.getCharsSequence();
+ CharSequence chars = document.getCharsSequence();
if (commenter instanceof CommenterWithLineSuffix) {
CommenterWithLineSuffix commenterWithLineSuffix = (CommenterWithLineSuffix)commenter;
String suffix = commenterWithLineSuffix.getLineCommentSuffix();
- int theEnd = endOffset > 0 ? endOffset : myDocument.getLineEndOffset(line);
+ int theEnd = endOffset > 0 ? endOffset : document.getLineEndOffset(line);
while (theEnd > startOffset && Character.isWhitespace(chars.charAt(theEnd - 1))) {
theEnd--;
}
- String lineText = myDocument.getText(new TextRange(startOffset, theEnd));
+ String lineText = document.getText(new TextRange(startOffset, theEnd));
if (lineText.indexOf(suffix) != -1) {
int start = startOffset + lineText.indexOf(suffix);
- myDocument.deleteString(start, start + suffix.length());
+ document.deleteString(start, start + suffix.length());
}
}
@@ -544,10 +547,10 @@
charsToDelete++;
}
}
- myDocument.deleteString(startOffset, startOffset + charsToDelete);
+ document.deleteString(startOffset, startOffset + charsToDelete);
return;
}
- String text = myDocument.getCharsSequence().subSequence(startOffset, endOffset).toString();
+ String text = document.getCharsSequence().subSequence(startOffset, endOffset).toString();
prefix = commenter.getBlockCommentPrefix();
final String suffix = commenter.getBlockCommentSuffix();
@@ -575,45 +578,47 @@
assert prefixes.size() == suffixes.size();
for (int i = prefixes.size() - 1; i >= 0; i--) {
- uncommentRange(startOffset + prefixes.get(i), Math.min(startOffset + suffixes.get(i) + suffix.length(), endOffset), commenter);
+ uncommentRange(document, startOffset + prefixes.get(i), Math.min(startOffset + suffixes.get(i) + suffix.length(), endOffset), commenter);
}
}
- private void commentLine(int line, int offset, @Nullable Commenter commenter) {
- if (commenter == null) commenter = findCommenter(line);
+ private static void commentLine(Block block, int line, int offset) {
+ Commenter commenter = block.blockSuitableCommenter;
+ Document document = block.editor.getDocument();
+ if (commenter == null) commenter = findCommenter(block.editor, block.psiFile, line);
if (commenter == null) return;
if (commenter instanceof SelfManagingCommenter) {
final SelfManagingCommenter selfManagingCommenter = (SelfManagingCommenter)commenter;
- selfManagingCommenter.commentLine(line, offset, myDocument, myCommenterStateMap.get(selfManagingCommenter));
+ selfManagingCommenter.commentLine(line, offset, document, block.commenterStateMap.get(selfManagingCommenter));
return;
}
String prefix = commenter.getLineCommentPrefix();
if (prefix != null) {
if (commenter instanceof CommenterWithLineSuffix) {
- int endOffset = myDocument.getLineEndOffset(line);
- endOffset = CharArrayUtil.shiftBackward(myDocument.getCharsSequence(), endOffset, " \t");
- int shiftedStartOffset = CharArrayUtil.shiftForward(myDocument.getCharsSequence(), offset, " \t");
+ int endOffset = document.getLineEndOffset(line);
+ endOffset = CharArrayUtil.shiftBackward(document.getCharsSequence(), endOffset, " \t");
+ int shiftedStartOffset = CharArrayUtil.shiftForward(document.getCharsSequence(), offset, " \t");
String lineSuffix = ((CommenterWithLineSuffix)commenter).getLineCommentSuffix();
- if (!CharArrayUtil.regionMatches(myDocument.getCharsSequence(), shiftedStartOffset, prefix)) {
- if (!CharArrayUtil.regionMatches(myDocument.getCharsSequence(), endOffset - lineSuffix.length(), lineSuffix)) {
- myDocument.insertString(endOffset, lineSuffix);
+ if (!CharArrayUtil.regionMatches(document.getCharsSequence(), shiftedStartOffset, prefix)) {
+ if (!CharArrayUtil.regionMatches(document.getCharsSequence(), endOffset - lineSuffix.length(), lineSuffix)) {
+ document.insertString(endOffset, lineSuffix);
}
- myDocument.insertString(offset, prefix);
+ document.insertString(offset, prefix);
}
}
else {
- myDocument.insertString(offset, prefix);
+ document.insertString(offset, prefix);
}
}
else {
prefix = commenter.getBlockCommentPrefix();
String suffix = commenter.getBlockCommentSuffix();
if (prefix == null || suffix == null) return;
- int endOffset = myDocument.getLineEndOffset(line);
- if (endOffset == offset && myStartLine != myEndLine) return;
- final int textLength = myDocument.getTextLength();
- final CharSequence chars = myDocument.getCharsSequence();
+ int endOffset = document.getLineEndOffset(line);
+ if (endOffset == offset && block.startLine != block.endLine) return;
+ final int textLength = document.getTextLength();
+ final CharSequence chars = document.getCharsSequence();
offset = CharArrayUtil.shiftForward(chars, offset, " \t");
if (endOffset == textLength) {
final int shifted = CharArrayUtil.shiftBackward(chars, textLength - 1, " \t");
@@ -623,7 +628,7 @@
endOffset = CharArrayUtil.shiftBackward(chars, endOffset, " \t");
}
if (endOffset < offset ||
- offset == textLength - 1 && line != myDocument.getLineCount() - 1) {
+ offset == textLength - 1 && line != document.getLineCount() - 1) {
return;
}
final String text = chars.subSequence(offset, endOffset).toString();
@@ -653,7 +658,7 @@
}
}
if (!(commentedSuffix == null && !suffixes.isEmpty() && offset + suffixes.get(suffixes.size() - 1) + suffix.length() >= endOffset)) {
- myDocument.insertString(endOffset, suffix);
+ document.insertString(endOffset, suffix);
}
int nearestPrefix = prefixes.size() - 1;
int nearestSuffix = suffixes.size() - 1;
@@ -662,26 +667,46 @@
final int position = prefixes.get(nearestPrefix);
nearestPrefix--;
if (commentedPrefix != null) {
- myDocument.replaceString(offset + position, offset + position + prefix.length(), commentedPrefix);
+ document.replaceString(offset + position, offset + position + prefix.length(), commentedPrefix);
}
else if (position != 0) {
- myDocument.insertString(offset + position, suffix);
+ document.insertString(offset + position, suffix);
}
}
else {
final int position = suffixes.get(nearestSuffix);
nearestSuffix--;
if (commentedSuffix != null) {
- myDocument.replaceString(offset + position, offset + position + suffix.length(), commentedSuffix);
+ document.replaceString(offset + position, offset + position + suffix.length(), commentedSuffix);
}
else if (offset + position + suffix.length() < endOffset) {
- myDocument.insertString(offset + position + suffix.length(), prefix);
+ document.insertString(offset + position + suffix.length(), prefix);
}
}
}
if (!(commentedPrefix == null && !prefixes.isEmpty() && prefixes.get(0) == 0)) {
- myDocument.insertString(offset, prefix);
+ document.insertString(offset, prefix);
}
}
}
+
+ private static class Block {
+ private Editor editor;
+ private PsiFile psiFile;
+ private List<Caret> carets = new ArrayList<Caret>();
+ private int startLine;
+ private int endLine;
+ private int[] startOffsets;
+ private int[] endOffsets;
+ private Commenter blockSuitableCommenter;
+ private Commenter[] commenters;
+ private Map<SelfManagingCommenter, CommenterDataHolder> commenterStateMap;
+ private boolean commentWithIndent;
+ private CaretUpdate caretUpdate;
+ private boolean skip;
+ }
+
+ private enum CaretUpdate {
+ PUT_AT_COMMENT_START, SHIFT_DOWN, RESTORE_SELECTION
+ }
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/CommentByBlockCommentAction.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/CommentByBlockCommentAction.java
index ce0d3b6..bd24557 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/CommentByBlockCommentAction.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/CommentByBlockCommentAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,11 +16,12 @@
package com.intellij.codeInsight.generation.actions;
-import com.intellij.codeInsight.CodeInsightActionHandler;
-import com.intellij.codeInsight.actions.BaseCodeInsightAction;
+import com.intellij.codeInsight.actions.MultiCaretCodeInsightAction;
+import com.intellij.codeInsight.actions.MultiCaretCodeInsightActionHandler;
import com.intellij.codeInsight.generation.CommentByBlockCommentHandler;
import com.intellij.lang.Commenter;
import com.intellij.lang.LanguageCommenters;
+import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.impl.AbstractFileType;
@@ -29,19 +30,19 @@
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
-public class CommentByBlockCommentAction extends BaseCodeInsightAction implements DumbAware {
+public class CommentByBlockCommentAction extends MultiCaretCodeInsightAction implements DumbAware {
public CommentByBlockCommentAction() {
setEnabledInModalContext(true);
}
@NotNull
@Override
- protected CodeInsightActionHandler getHandler() {
+ protected MultiCaretCodeInsightActionHandler getHandler() {
return new CommentByBlockCommentHandler();
}
@Override
- protected boolean isValidForFile(@NotNull Project project, @NotNull Editor editor, @NotNull final PsiFile file) {
+ protected boolean isValidFor(@NotNull Project project, @NotNull Editor editor, @NotNull Caret caret, @NotNull final PsiFile file) {
final FileType fileType = file.getFileType();
if (fileType instanceof AbstractFileType) {
return ((AbstractFileType)fileType).getCommenter() != null;
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/CommentByLineCommentAction.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/CommentByLineCommentAction.java
index 990e647..3ee4ecc 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/CommentByLineCommentAction.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/CommentByLineCommentAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,9 +16,10 @@
package com.intellij.codeInsight.generation.actions;
-import com.intellij.codeInsight.CodeInsightActionHandler;
-import com.intellij.codeInsight.actions.BaseCodeInsightAction;
+import com.intellij.codeInsight.actions.MultiCaretCodeInsightAction;
+import com.intellij.codeInsight.actions.MultiCaretCodeInsightActionHandler;
import com.intellij.codeInsight.generation.CommentByLineCommentHandler;
+import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.fileTypes.impl.AbstractFileType;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.fileTypes.FileType;
@@ -28,19 +29,19 @@
import com.intellij.lang.LanguageCommenters;
import org.jetbrains.annotations.NotNull;
-public class CommentByLineCommentAction extends BaseCodeInsightAction implements DumbAware {
+public class CommentByLineCommentAction extends MultiCaretCodeInsightAction implements DumbAware {
public CommentByLineCommentAction() {
setEnabledInModalContext(true);
}
@NotNull
@Override
- protected CodeInsightActionHandler getHandler() {
+ protected MultiCaretCodeInsightActionHandler getHandler() {
return new CommentByLineCommentHandler();
}
@Override
- protected boolean isValidForFile(@NotNull Project project, @NotNull Editor editor, @NotNull final PsiFile file) {
+ protected boolean isValidFor(@NotNull Project project, @NotNull Editor editor, @NotNull Caret caret, @NotNull final PsiFile file) {
final FileType fileType = file.getFileType();
if (fileType instanceof AbstractFileType) {
return ((AbstractFileType)fileType).getCommenter() != null;
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java
index 284a8ec..3a1f04b 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java
@@ -623,10 +623,6 @@
}
public boolean performGuardedChange(Runnable change) {
- return performGuardedChange(change, null);
- }
-
- public boolean performGuardedChange(Runnable change, @Nullable final String debug) {
checkValid();
assert !myChangeGuard : "already in change";
@@ -634,7 +630,7 @@
myChangeGuard = true;
boolean result;
try {
- result = myOffsets.performGuardedChange(change, debug);
+ result = myOffsets.performGuardedChange(change);
}
finally {
myEditor.getDocument().stopGuardedBlockChecking();
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupOffsets.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupOffsets.java
index fe53f17..9d918cc 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupOffsets.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupOffsets.java
@@ -15,27 +15,26 @@
*/
package com.intellij.codeInsight.lookup.impl;
-import com.intellij.codeInsight.completion.RangeMarkerSpy;
import com.intellij.codeInsight.lookup.LookupElement;
-import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.RangeMarker;
+import com.intellij.openapi.editor.event.DocumentAdapter;
import com.intellij.openapi.editor.event.DocumentEvent;
-import org.jetbrains.annotations.Nullable;
+import com.intellij.psi.impl.DebugUtil;
+import org.jetbrains.annotations.NotNull;
import java.util.Collection;
/**
* @author peter
*/
-public class LookupOffsets {
- private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.lookup.impl.LookupOffsets");
+public class LookupOffsets extends DocumentAdapter {
private String myAdditionalPrefix = "";
private String myInitialPrefix;
private boolean myStableStart;
- private RangeMarker myLookupStartMarker;
+ private String myStartDisposeTrace;
+ @NotNull private RangeMarker myLookupStartMarker;
private int myRemovedPrefix;
private final RangeMarker myLookupOriginalStartMarker;
private final Editor myEditor;
@@ -43,23 +42,22 @@
public LookupOffsets(Editor editor) {
myEditor = editor;
int caret = getPivotOffset();
- myLookupOriginalStartMarker = editor.getDocument().createRangeMarker(caret, caret);
- myLookupOriginalStartMarker.setGreedyToLeft(true);
- updateLookupStart(0);
+ myLookupOriginalStartMarker = createLeftGreedyMarker(caret);
+ myLookupStartMarker = createLeftGreedyMarker(caret);
+ myEditor.getDocument().addDocumentListener(this);
}
- private void updateLookupStart(int minPrefixLength) {
- int offset = getPivotOffset();
- int start = offset - minPrefixLength - myAdditionalPrefix.length() + myRemovedPrefix;
- start = Math.max(Math.min(start, myEditor.getDocument().getTextLength()), 0);
- if (myLookupStartMarker != null) {
- if (myLookupStartMarker.isValid() && myLookupStartMarker.getStartOffset() == start && myLookupStartMarker.getEndOffset() == start) {
- return;
- }
- myLookupStartMarker.dispose();
+ @Override
+ public void documentChanged(DocumentEvent e) {
+ if (myStartDisposeTrace == null && !myLookupStartMarker.isValid()) {
+ myStartDisposeTrace = e + "\n" + DebugUtil.currentStackTrace();
}
- myLookupStartMarker = myEditor.getDocument().createRangeMarker(start, start);
- myLookupStartMarker.setGreedyToLeft(true);
+ }
+
+ private RangeMarker createLeftGreedyMarker(int start) {
+ RangeMarker marker = myEditor.getDocument().createRangeMarker(start, start);
+ marker.setGreedyToLeft(true);
+ return marker;
}
private int getPivotOffset() {
@@ -101,15 +99,20 @@
}
}
- updateLookupStart(minPrefixLength);
+ int start = getPivotOffset() - minPrefixLength - myAdditionalPrefix.length() + myRemovedPrefix;
+ start = Math.max(Math.min(start, myEditor.getDocument().getTextLength()), 0);
+ if (myLookupStartMarker.isValid() && myLookupStartMarker.getStartOffset() == start && myLookupStartMarker.getEndOffset() == start) {
+ return;
+ }
+
+ myLookupStartMarker.dispose();
+ myLookupStartMarker = createLeftGreedyMarker(start);
+ myStartDisposeTrace = null;
}
int getLookupStart(String disposeTrace) {
- if (myLookupStartMarker == null) {
- LOG.error("disposed: " + disposeTrace);
- }
if (!myLookupStartMarker.isValid()) {
- LOG.error("invalid marker: " + disposeTrace);
+ throw new AssertionError("Invalid lookup start: " + disposeTrace + ";\n" + myStartDisposeTrace);
}
return myLookupStartMarker.getStartOffset();
}
@@ -118,33 +121,14 @@
return myLookupOriginalStartMarker.isValid() ? myLookupOriginalStartMarker.getStartOffset() : -1;
}
- boolean performGuardedChange(Runnable change, @Nullable final String debug) {
- if (myLookupStartMarker == null) {
- throw new AssertionError("null start before");
- }
+ boolean performGuardedChange(Runnable change) {
if (!myLookupStartMarker.isValid()) {
- throw new AssertionError("invalid start");
+ throw new AssertionError("Invalid start: " + myStartDisposeTrace);
}
- final Document document = myEditor.getDocument();
- RangeMarkerSpy spy = new RangeMarkerSpy(myLookupStartMarker) {
- @Override
- protected void invalidated(DocumentEvent e) {
- LOG.info("Lookup start marker invalidated, say thanks to the " + e +
- ", doc=" + document +
- ", debug=" + debug);
- }
- };
- document.addDocumentListener(spy);
- try {
- change.run();
- }
- finally {
- document.removeDocumentListener(spy);
- }
+ change.run();
return myLookupStartMarker.isValid();
}
-
void setInitialPrefix(String presentPrefix, boolean explicitlyInvoked) {
if (myAdditionalPrefix.length() == 0 && myInitialPrefix == null && !explicitlyInvoked) {
myInitialPrefix = presentPrefix;
@@ -165,11 +149,9 @@
}
}
- public void disposeMarkers() {
- if (myLookupStartMarker != null) {
- myLookupStartMarker.dispose();
- myLookupStartMarker = null;
- }
+ void disposeMarkers() {
+ myEditor.getDocument().removeDocumentListener(this);
+ myLookupStartMarker.dispose();
myLookupOriginalStartMarker.dispose();
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java b/platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java
index 512bfa1..9678ef2 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java
@@ -247,8 +247,13 @@
else {
newVarName = varName;
}
- Variable var =
- new Variable(newVarName, template.getExpressionStringAt(i), template.getDefaultValueStringAt(i), template.isAlwaysStopAt(i));
+ Variable var = new Variable(newVarName, template.getExpressionStringAt(i), template.getDefaultValueStringAt(i), template.isAlwaysStopAt(i));
+ if (mySegmentLimit >= 0 && myVariables.size() >= mySegmentLimit) {
+ if (mySegmentLimit > 0) {
+ LOGGER.warn("Template with more than " + mySegmentLimit + " segments had been build. Text: " + myText);
+ }
+ break;
+ }
myVariables.add(var);
myVarNames.add(newVarName);
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/settings/PostfixDescriptionPanel.java b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/settings/PostfixDescriptionPanel.java
index 6032cbe..c5c10ce 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/settings/PostfixDescriptionPanel.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/settings/PostfixDescriptionPanel.java
@@ -42,6 +42,7 @@
private JEditorPane myDescriptionBrowser;
public PostfixDescriptionPanel() {
+ myDescriptionBrowser.setMargin(new Insets(5, 5, 5, 5));
initializeExamplePanel(myAfterPanel);
initializeExamplePanel(myBeforePanel);
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/settings/PostfixTemplatesConfigurable.form b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/settings/PostfixTemplatesConfigurable.form
index 9af302b..2417e0b 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/settings/PostfixTemplatesConfigurable.form
+++ b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/settings/PostfixTemplatesConfigurable.form
@@ -13,7 +13,7 @@
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="1" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
- <text value="&Enable postfix templates"/>
+ <text value="&Enable postfix completion"/>
</properties>
</component>
<component id="9f784" class="com.intellij.ui.components.JBCheckBox" binding="myCompletionEnabledCheckbox">
diff --git a/platform/lang-impl/src/com/intellij/codeInspection/InspectionApplication.java b/platform/lang-impl/src/com/intellij/codeInspection/InspectionApplication.java
index 391232c..86cbe6f 100644
--- a/platform/lang-impl/src/com/intellij/codeInspection/InspectionApplication.java
+++ b/platform/lang-impl/src/com/intellij/codeInspection/InspectionApplication.java
@@ -105,7 +105,7 @@
LOG.error(e);
}
finally {
- if (myErrorCodeRequired) application.exit(true);
+ if (myErrorCodeRequired) application.exit(true, true);
}
}
});
diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/Descriptor.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/Descriptor.java
index c3d4e15..b27befd 100644
--- a/platform/lang-impl/src/com/intellij/codeInspection/ex/Descriptor.java
+++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/Descriptor.java
@@ -40,6 +40,7 @@
private final InspectionToolWrapper myToolWrapper;
private final HighlightDisplayLevel myLevel;
private boolean myEnabled = false;
+ @Nullable
private final NamedScope myScope;
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.ex.Descriptor");
private final ScopeToolState myState;
@@ -99,6 +100,13 @@
return myConfig;
}
+ public void loadConfig() {
+ if (myConfig == null) {
+ InspectionToolWrapper toolWrapper = getToolWrapper();
+ myConfig = createConfigElement(toolWrapper);
+ }
+ }
+
@NotNull
public InspectionToolWrapper getToolWrapper() {
return myToolWrapper;
@@ -106,11 +114,7 @@
@Nullable
public String loadDescription() {
- if (myConfig == null) {
- InspectionToolWrapper toolWrapper = getToolWrapper();
- myConfig = createConfigElement(toolWrapper);
- }
-
+ loadConfig();
return myToolWrapper.loadDescription();
}
@@ -133,6 +137,7 @@
return myGroup;
}
+ @Nullable
public NamedScope getScope() {
return myScope;
}
diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/SeverityEditorDialog.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/SeverityEditorDialog.java
index b5333e8..527235b 100644
--- a/platform/lang-impl/src/com/intellij/codeInspection/ex/SeverityEditorDialog.java
+++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/SeverityEditorDialog.java
@@ -301,6 +301,9 @@
}
private void reset(SeverityBasedTextAttributes info) {
+ if (info == null) {
+ return;
+ }
final MyTextAttributesDescription description =
new MyTextAttributesDescription(info.getType().toString(), null, info.getAttributes(), info.getType().getAttributesKey());
@NonNls Element textAttributes = new Element("temp");
diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/VisibleTreeState.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/VisibleTreeState.java
index 8f81c05..d81fbf6 100644
--- a/platform/lang-impl/src/com/intellij/codeInspection/ex/VisibleTreeState.java
+++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/VisibleTreeState.java
@@ -16,7 +16,7 @@
package com.intellij.codeInspection.ex;
-import com.intellij.profile.codeInspection.ui.InspectionConfigTreeNode;
+import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionConfigTreeNode;
import com.intellij.psi.search.scope.packageSet.NamedScope;
import com.intellij.ui.treeStructure.Tree;
import com.intellij.util.ui.tree.TreeUtil;
@@ -106,7 +106,7 @@
}
private static State getState(InspectionConfigTreeNode node) {
- Descriptor descriptor = node.getDescriptor();
+ Descriptor descriptor = node.getDefaultDescriptor();
final State expandedNode;
if (descriptor != null) {
expandedNode = new State(descriptor);
diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewComparator.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewComparator.java
index cab3fbe..b36ab75 100644
--- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewComparator.java
+++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewComparator.java
@@ -36,7 +36,7 @@
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.profile.codeInspection.ui.InspectionsConfigTreeComparator;
+import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeComparator;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiNamedElement;
diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionTree.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionTree.java
index d50bddc..d1c3c3a 100644
--- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionTree.java
+++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionTree.java
@@ -31,7 +31,7 @@
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.FileStatus;
-import com.intellij.profile.codeInspection.ui.InspectionsConfigTreeComparator;
+import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeComparator;
import com.intellij.ui.ColoredTreeCellRenderer;
import com.intellij.ui.JBColor;
import com.intellij.ui.SimpleTextAttributes;
diff --git a/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleViewImpl.java b/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleViewImpl.java
index bb73809..8a4b1f8 100644
--- a/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleViewImpl.java
+++ b/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleViewImpl.java
@@ -30,7 +30,7 @@
*/
public class LanguageConsoleViewImpl extends ConsoleViewImpl implements LanguageConsoleView {
@NotNull
- protected LanguageConsoleImpl myConsole;
+ protected final LanguageConsoleImpl myConsole;
public LanguageConsoleViewImpl(Project project, String title, Language language) {
this(new LanguageConsoleImpl(project, title, language));
diff --git a/platform/lang-impl/src/com/intellij/find/EditorSearchComponent.java b/platform/lang-impl/src/com/intellij/find/EditorSearchComponent.java
index 8c5864c..8a36638 100644
--- a/platform/lang-impl/src/com/intellij/find/EditorSearchComponent.java
+++ b/platform/lang-impl/src/com/intellij/find/EditorSearchComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -48,6 +48,7 @@
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
@@ -68,11 +69,12 @@
private final Project myProject;
private ActionToolbar myActionsToolbar;
-
+ @NotNull
public Editor getEditor() {
return myEditor;
}
+ @NotNull
private final Editor myEditor;
public JTextComponent getSearchField() {
@@ -173,7 +175,7 @@
return findModel;
}
- public EditorSearchComponent(Editor editor, Project project) {
+ public EditorSearchComponent(@NotNull Editor editor, Project project) {
this(editor, project, createDefaultFindModel(project, editor));
}
@@ -225,7 +227,7 @@
}
@Override
- public void cursorMoved(boolean toChangeSelection) {
+ public void cursorMoved() {
updateExcludeStatus();
}
@@ -233,10 +235,7 @@
public void updateFinished() {
}
- @Override
- public void editorChanged(SearchResults sr, Editor oldEditor) { }
-
- public EditorSearchComponent(final Editor editor, final Project project, FindModel findModel) {
+ public EditorSearchComponent(@NotNull final Editor editor, final Project project, FindModel findModel) {
myFindModel = findModel;
myProject = project;
@@ -367,6 +366,9 @@
actionGroup.add(new ShowHistoryAction(mySearchFieldGetter, this));
actionGroup.add(new PrevOccurrenceAction(this, mySearchFieldGetter));
actionGroup.add(new NextOccurrenceAction(this, mySearchFieldGetter));
+ actionGroup.add(new AddOccurrenceAction(this));
+ actionGroup.add(new RemoveOccurrenceAction(this));
+ actionGroup.add(new SelectAllAction(this));
actionGroup.add(new FindAllAction(this));
actionGroup.add(new ToggleMultiline(this));
actionGroup.add(new ToggleMatchCase(this));
@@ -803,10 +805,6 @@
}
public void close() {
- if (myEditor.getSelectionModel().hasSelection()) {
- myEditor.getCaretModel().moveToOffset(myEditor.getSelectionModel().getSelectionStart());
- myEditor.getSelectionModel().removeSelection();
- }
IdeFocusManager.getInstance(myProject).requestFocus(myEditor.getContentComponent(), false);
myLivePreviewController.dispose();
@@ -937,6 +935,18 @@
return insets;
}
+ public void selectAllOccurrences() {
+ FindUtil.selectSearchResultsInEditor(myEditor, mySearchResults.getOccurrences().iterator(), -1);
+ }
+
+ public void removeOccurrence() {
+ mySearchResults.prevOccurrence(true);
+ }
+
+ public void addNextOccurrence() {
+ mySearchResults.nextOccurrence(true);
+ }
+
private static class MyUndoProvider extends TextComponentUndoProvider {
private boolean myEnabled = true;
public MyUndoProvider(JTextComponent textComponent) {
diff --git a/platform/lang-impl/src/com/intellij/find/FindUtil.java b/platform/lang-impl/src/com/intellij/find/FindUtil.java
index 0728ea0..edc90648 100644
--- a/platform/lang-impl/src/com/intellij/find/FindUtil.java
+++ b/platform/lang-impl/src/com/intellij/find/FindUtil.java
@@ -31,6 +31,7 @@
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.editor.*;
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
+import com.intellij.openapi.editor.actions.EditorActionUtil;
import com.intellij.openapi.editor.actions.IncrementalFindAction;
import com.intellij.openapi.editor.colors.EditorColors;
import com.intellij.openapi.editor.colors.EditorColorsManager;
@@ -70,10 +71,7 @@
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
+import java.util.*;
public class FindUtil {
private static final Key<Direction> KEY = Key.create("FindUtil.KEY");
@@ -385,7 +383,7 @@
}
else {
editor.putUserData(KEY, null);
- offset = editor.getCaretModel().getOffset();
+ offset = model.isGlobal() && model.isForward() ? editor.getSelectionModel().getSelectionEnd() : editor.getCaretModel().getOffset();
if (!model.isForward() && offset > 0) {
offset--;
}
@@ -714,7 +712,18 @@
final ScrollType scrollType = forward ? ScrollType.CENTER_DOWN : ScrollType.CENTER_UP;
if (model.isGlobal()) {
- caretModel.moveToOffset(result.getEndOffset());
+ int targetCaretPosition = result.getEndOffset();
+ if (selection.getSelectionEnd() - selection.getSelectionStart() == result.getLength()) {
+ // keeping caret's position relative to selection
+ // use case: FindNext is used after SelectNextOccurrence action
+ targetCaretPosition = caretModel.getOffset() - selection.getSelectionStart() + result.getStartOffset();
+ }
+ if (caretModel.getCaretAt(editor.offsetToVisualPosition(targetCaretPosition)) != null) {
+ // if there's a different caret at target position, don't move current caret/selection
+ // use case: FindNext is used after SelectNextOccurrence action
+ return result;
+ }
+ caretModel.moveToOffset(targetCaretPosition);
selection.removeSelection();
scrollingModel.scrollToCaret(scrollType);
scrollingModel.runActionOnScrollingFinished(
@@ -829,17 +838,12 @@
editor.getCaretModel().addCaretListener(listener);
}
JComponent component = HintUtil.createInformationLabel(JDOMUtil.escapeText(message, false, false));
-
- if (ApplicationManager.getApplication().isUnitTestMode()) {
- LivePreview.processNotFound();
- } else {
- final LightweightHint hint = new LightweightHint(component);
- HintManagerImpl.getInstanceImpl().showEditorHint(hint, editor, position,
- HintManager.HIDE_BY_ANY_KEY |
- HintManager.HIDE_BY_TEXT_CHANGE |
- HintManager.HIDE_BY_SCROLLING,
- 0, false);
- }
+ final LightweightHint hint = new LightweightHint(component);
+ HintManagerImpl.getInstanceImpl().showEditorHint(hint, editor, position,
+ HintManager.HIDE_BY_ANY_KEY |
+ HintManager.HIDE_BY_TEXT_CHANGE |
+ HintManager.HIDE_BY_SCROLLING,
+ 0, false);
}
public static TextRange doReplace(final Project project,
@@ -954,4 +958,68 @@
});
return view;
}
+
+ /**
+ * Creates a selection in editor per each search result. Existing carets and selections in editor are discarded.
+ *
+ * @param caretShiftFromSelectionStart if non-negative, defines caret position relative to selection start, for each created selection.
+ * if negative, carets will be positioned at selection ends
+ */
+ public static void selectSearchResultsInEditor(@NotNull Editor editor,
+ @NotNull Iterator<FindResult> resultIterator,
+ int caretShiftFromSelectionStart) {
+ if (!editor.getCaretModel().supportsMultipleCarets()) {
+ return;
+ }
+ ArrayList<CaretState> caretStates = new ArrayList<CaretState>();
+ while (resultIterator.hasNext()) {
+ FindResult findResult = resultIterator.next();
+ int caretOffset = getCaretPosition(findResult, caretShiftFromSelectionStart);
+ int selectionStartOffset = findResult.getStartOffset();
+ int selectionEndOffset = findResult.getEndOffset();
+ EditorActionUtil.makePositionVisible(editor, caretOffset);
+ EditorActionUtil.makePositionVisible(editor, selectionStartOffset);
+ EditorActionUtil.makePositionVisible(editor, selectionEndOffset);
+ caretStates.add(new CaretState(editor.offsetToLogicalPosition(caretOffset),
+ editor.offsetToLogicalPosition(selectionStartOffset),
+ editor.offsetToLogicalPosition(selectionEndOffset)));
+ }
+ if (caretStates.isEmpty()) {
+ return;
+ }
+ editor.getCaretModel().setCaretsAndSelections(caretStates);
+ }
+
+ /**
+ * Attempts to add a new caret to editor, with selection corresponding to given search result.
+ *
+ * @param caretShiftFromSelectionStart if non-negative, defines caret position relative to selection start, for each created selection.
+ * if negative, caret will be positioned at selection end
+ * @return <code>true</code> if caret was added successfully, <code>false</code> if it cannot be done, e.g. because a caret already
+ * exists at target position
+ */
+ public static boolean selectSearchResultInEditor(@NotNull Editor editor, @NotNull FindResult result, int caretShiftFromSelectionStart) {
+ if (!editor.getCaretModel().supportsMultipleCarets()) {
+ return false;
+ }
+ int caretOffset = getCaretPosition(result, caretShiftFromSelectionStart);
+ EditorActionUtil.makePositionVisible(editor, caretOffset);
+ Caret newCaret = editor.getCaretModel().addCaret(editor.offsetToVisualPosition(caretOffset));
+ if (newCaret == null) {
+ return false;
+ }
+ else {
+ int selectionStartOffset = result.getStartOffset();
+ int selectionEndOffset = result.getEndOffset();
+ EditorActionUtil.makePositionVisible(editor, selectionStartOffset);
+ EditorActionUtil.makePositionVisible(editor, selectionEndOffset);
+ newCaret.setSelection(selectionStartOffset, selectionEndOffset);
+ return true;
+ }
+ }
+
+ private static int getCaretPosition(FindResult findResult, int caretShiftFromSelectionStart) {
+ return caretShiftFromSelectionStart < 0
+ ? findResult.getEndOffset() : Math.min(findResult.getStartOffset() + caretShiftFromSelectionStart, findResult.getEndOffset());
+ }
}
diff --git a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/AddOccurrenceAction.java b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/AddOccurrenceAction.java
new file mode 100644
index 0000000..9064113
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/AddOccurrenceAction.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2014 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.find.editorHeaderActions;
+
+import com.intellij.find.EditorSearchComponent;
+import com.intellij.icons.AllIcons;
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.project.DumbAware;
+
+import java.util.Arrays;
+
+public class AddOccurrenceAction extends EditorHeaderAction implements DumbAware {
+ public AddOccurrenceAction(EditorSearchComponent editorSearchComponent) {
+ super(editorSearchComponent);
+
+ copyFrom(ActionManager.getInstance().getAction(IdeActions.ACTION_SELECT_NEXT_OCCURENCE));
+ getTemplatePresentation().setIcon(AllIcons.General.Add);
+
+ registerShortcutsForComponent(Arrays.asList(getShortcutSet().getShortcuts()), editorSearchComponent.getSearchField());
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ getEditorSearchComponent().addNextOccurrence();
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ boolean isFind = !getEditorSearchComponent().getFindModel().isReplaceState();
+ boolean hasMatches = getEditorSearchComponent().hasMatches();
+ e.getPresentation().setVisible(isFind);
+ e.getPresentation().setEnabled(isFind && hasMatches);
+ }}
diff --git a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/EditorHeaderAction.java b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/EditorHeaderAction.java
index 6cdba4b..1534873 100644
--- a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/EditorHeaderAction.java
+++ b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/EditorHeaderAction.java
@@ -1,21 +1,34 @@
+/*
+ * Copyright 2000-2014 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.find.editorHeaderActions;
import com.intellij.find.EditorSearchComponent;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.CustomShortcutSet;
-import com.intellij.openapi.actionSystem.KeyboardShortcut;
import com.intellij.openapi.actionSystem.Shortcut;
import javax.swing.*;
-import java.util.ArrayList;
import java.util.List;
public abstract class EditorHeaderAction extends AnAction {
private final EditorSearchComponent myEditorSearchComponent;
- protected static void registerShortcutsForComponent(List<Shortcut> shortcuts, JComponent component, AnAction a) {
- a.registerCustomShortcutSet(
+ protected void registerShortcutsForComponent(List<Shortcut> shortcuts, JComponent component) {
+ registerCustomShortcutSet(
new CustomShortcutSet(shortcuts.toArray(new Shortcut[shortcuts.size()])),
component);
}
diff --git a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/NextOccurrenceAction.java b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/NextOccurrenceAction.java
index 1eb933c..0e6e671 100644
--- a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/NextOccurrenceAction.java
+++ b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/NextOccurrenceAction.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2000-2014 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.find.editorHeaderActions;
import com.intellij.find.EditorSearchComponent;
@@ -35,7 +50,7 @@
shortcuts.add(new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), null));
}
- registerShortcutsForComponent(shortcuts, editorTextField.get(), this);
+ registerShortcutsForComponent(shortcuts, editorTextField.get());
}
@Override
diff --git a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/PrevOccurrenceAction.java b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/PrevOccurrenceAction.java
index f5a2d39..586f90a 100644
--- a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/PrevOccurrenceAction.java
+++ b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/PrevOccurrenceAction.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2000-2014 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.find.editorHeaderActions;
import com.intellij.find.EditorSearchComponent;
@@ -34,7 +49,7 @@
shortcuts.add(new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_DOWN_MASK), null));
}
- registerShortcutsForComponent(shortcuts, editorTextField.get(), this);
+ registerShortcutsForComponent(shortcuts, editorTextField.get());
}
@Override
diff --git a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/RemoveOccurrenceAction.java b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/RemoveOccurrenceAction.java
new file mode 100644
index 0000000..b739f94
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/RemoveOccurrenceAction.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2014 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.find.editorHeaderActions;
+
+import com.intellij.find.EditorSearchComponent;
+import com.intellij.icons.AllIcons;
+import com.intellij.openapi.actionSystem.ActionManager;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.IdeActions;
+import com.intellij.openapi.project.DumbAware;
+
+import java.util.Arrays;
+
+public class RemoveOccurrenceAction extends EditorHeaderAction implements DumbAware {
+ public RemoveOccurrenceAction(EditorSearchComponent editorSearchComponent) {
+ super(editorSearchComponent);
+
+ copyFrom(ActionManager.getInstance().getAction(IdeActions.ACTION_UNSELECT_PREVIOUS_OCCURENCE));
+ getTemplatePresentation().setIcon(AllIcons.General.Remove);
+
+ registerShortcutsForComponent(Arrays.asList(getShortcutSet().getShortcuts()), editorSearchComponent.getSearchField());
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ getEditorSearchComponent().removeOccurrence();
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ boolean isFind = !getEditorSearchComponent().getFindModel().isReplaceState();
+ boolean hasMatches = getEditorSearchComponent().hasMatches();
+ e.getPresentation().setVisible(isFind);
+ e.getPresentation().setEnabled(isFind && hasMatches);
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/RestorePreviousSettingsAction.java b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/RestorePreviousSettingsAction.java
index cad2be2..2607ebf 100644
--- a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/RestorePreviousSettingsAction.java
+++ b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/RestorePreviousSettingsAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -39,8 +39,7 @@
public RestorePreviousSettingsAction(EditorSearchComponent editorSearchComponent, JTextComponent textField) {
super(editorSearchComponent);
myTextField = textField;
- registerShortcutsForComponent(Collections.<Shortcut>singletonList(SHORTCUT),
- textField, this);
+ registerShortcutsForComponent(Collections.<Shortcut>singletonList(SHORTCUT), textField);
}
@Override
diff --git a/platform/lang-impl/src/com/intellij/find/editorHeaderActions/SelectAllAction.java b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/SelectAllAction.java
new file mode 100644
index 0000000..0e52566
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/find/editorHeaderActions/SelectAllAction.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2014 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.find.editorHeaderActions;
+
+import com.intellij.find.EditorSearchComponent;
+import com.intellij.icons.AllIcons;
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.util.containers.ContainerUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SelectAllAction extends EditorHeaderAction implements DumbAware {
+ public SelectAllAction(EditorSearchComponent editorSearchComponent) {
+ super(editorSearchComponent);
+
+ copyFrom(ActionManager.getInstance().getAction(IdeActions.ACTION_SELECT_ALL_OCCURRENCES));
+ getTemplatePresentation().setIcon(AllIcons.Actions.Selectall);
+
+ List<Shortcut> shortcuts = new ArrayList<Shortcut>();
+ ContainerUtil.addAll(shortcuts, getShortcutSet().getShortcuts());
+ ContainerUtil.addAll(shortcuts, CommonShortcuts.ALT_ENTER.getShortcuts());
+ registerShortcutsForComponent(shortcuts, editorSearchComponent.getSearchField());
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ getEditorSearchComponent().selectAllOccurrences();
+ getEditorSearchComponent().close();
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ boolean isFind = !getEditorSearchComponent().getFindModel().isReplaceState();
+ boolean hasMatches = getEditorSearchComponent().hasMatches();
+ e.getPresentation().setVisible(isFind);
+ e.getPresentation().setEnabled(isFind && hasMatches);
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java b/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java
index 23f14c5..e4570b7 100644
--- a/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java
+++ b/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java
@@ -47,6 +47,7 @@
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.openapi.vfs.ex.VirtualFileManagerEx;
import com.intellij.psi.*;
+import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.LocalSearchScope;
import com.intellij.psi.search.SearchScope;
import com.intellij.ui.content.Content;
@@ -54,6 +55,7 @@
import com.intellij.usageView.UsageViewManager;
import com.intellij.usages.ConfigurableUsageTarget;
import com.intellij.usages.FindUsagesProcessPresentation;
+import com.intellij.usages.UsageView;
import com.intellij.usages.UsageViewPresentation;
import com.intellij.util.Function;
import com.intellij.util.PatternUtil;
@@ -324,7 +326,7 @@
return processPresentation;
}
- public static class StringUsageTarget implements ConfigurableUsageTarget, ItemPresentation {
+ public static class StringUsageTarget implements ConfigurableUsageTarget, ItemPresentation, TypeSafeDataProvider {
@NotNull protected final Project myProject;
@NotNull protected final FindModel myFindModel;
@@ -423,5 +425,12 @@
public KeyboardShortcut getShortcut() {
return ActionManager.getInstance().getKeyboardShortcut("FindInPath");
}
+
+ @Override
+ public void calcData(DataKey key, DataSink sink) {
+ if (key == UsageView.USAGE_SCOPE) {
+ sink.put(UsageView.USAGE_SCOPE, GlobalSearchScope.allScope(myProject));
+ }
+ }
}
}
diff --git a/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreview.java b/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreview.java
index c20b592..4ba97e0 100644
--- a/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreview.java
+++ b/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreview.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -121,7 +121,7 @@
}
highlightUsages();
- updateCursorHighlighting(false);
+ updateCursorHighlighting();
if (myInSmartUpdate) {
clearUnusedHightlighters();
myInSmartUpdate = false;
@@ -218,9 +218,9 @@
}
@Override
- public void cursorMoved(boolean toChangeSelection) {
+ public void cursorMoved() {
updateInSelectionHighlighters();
- updateCursorHighlighting(toChangeSelection);
+ updateCursorHighlighting();
}
@Override
@@ -228,14 +228,7 @@
dumpState();
}
- @Override
- public void editorChanged(SearchResults sr, Editor oldEditor) {
- removeFromEditor();
- oldEditor.getDocument().removeDocumentListener(this);
- mySearchResults.getEditor().getDocument().addDocumentListener(this);
- }
-
- private void updateCursorHighlighting(boolean scroll) {
+ private void updateCursorHighlighting() {
hideBalloon();
if (myCursorHighlighter != null) {
@@ -245,7 +238,6 @@
final FindResult cursor = mySearchResults.getCursor();
Editor editor = mySearchResults.getEditor();
- SelectionModel selection = editor.getSelectionModel();
if (cursor != null) {
Set<RangeHighlighter> dummy = new HashSet<RangeHighlighter>();
highlightRange(cursor, new TextAttributes(null, null, Color.BLACK, EffectType.ROUNDED_BOX, 0), dummy);
@@ -253,33 +245,6 @@
myCursorHighlighter = dummy.iterator().next();
}
- if (scroll) {
- if (mySearchResults.getFindModel().isGlobal()) {
- FoldingModel foldingModel = editor.getFoldingModel();
- final FoldRegion[] allRegions = editor.getFoldingModel().getAllFoldRegions();
-
- foldingModel.runBatchFoldingOperation(new Runnable() {
- @Override
- public void run() {
- for (FoldRegion region : allRegions) {
- if (!region.isValid()) continue;
- if (cursor.intersects(TextRange.create(region))) {
- region.setExpanded(true);
- }
- }
- }
- });
- selection.setSelection(cursor.getStartOffset(), cursor.getEndOffset());
-
- editor.getCaretModel().moveToOffset(cursor.getEndOffset());
- editor.getScrollingModel().scrollToCaret(ScrollType.CENTER);
- } else {
- if (!SearchResults.insideVisibleArea(editor, cursor)) {
- LogicalPosition pos = editor.offsetToLogicalPosition(cursor.getStartOffset());
- editor.getScrollingModel().scrollTo(pos, ScrollType.CENTER);
- }
- }
- }
editor.getScrollingModel().runActionOnScrollingFinished(new Runnable() {
@Override
public void run() {
@@ -496,6 +461,8 @@
new Processor<RangeHighlighterEx>() {
@Override
public boolean process(RangeHighlighterEx highlighter) {
+ if (!highlighter.getEditorFilter().avaliableIn(mySearchResults.getEditor())) return true;
+
TextAttributes textAttributes =
highlighter.getTextAttributes();
if (highlighter.getUserData(SEARCH_MARKER) != null &&
diff --git a/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreviewController.java b/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreviewController.java
index 8368f1b..94a6c3f 100644
--- a/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreviewController.java
+++ b/platform/lang-impl/src/com/intellij/find/impl/livePreview/LivePreviewController.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2000-2014 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.find.impl.livePreview;
import com.intellij.find.*;
@@ -83,9 +98,9 @@
public void moveCursor(SearchResults.Direction direction) {
if (direction == SearchResults.Direction.UP) {
- mySearchResults.prevOccurrence();
+ mySearchResults.prevOccurrence(false);
} else {
- mySearchResults.nextOccurrence();
+ mySearchResults.nextOccurrence(false);
}
}
diff --git a/platform/lang-impl/src/com/intellij/find/impl/livePreview/SearchResults.java b/platform/lang-impl/src/com/intellij/find/impl/livePreview/SearchResults.java
index dff4989..39b17dd 100644
--- a/platform/lang-impl/src/com/intellij/find/impl/livePreview/SearchResults.java
+++ b/platform/lang-impl/src/com/intellij/find/impl/livePreview/SearchResults.java
@@ -21,9 +21,7 @@
import com.intellij.find.FindResult;
import com.intellij.find.FindUtil;
import com.intellij.openapi.application.ApplicationManager;
-import com.intellij.openapi.editor.Editor;
-import com.intellij.openapi.editor.RangeMarker;
-import com.intellij.openapi.editor.SelectionModel;
+import com.intellij.openapi.editor.*;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.editor.event.DocumentListener;
import com.intellij.openapi.fileEditor.FileDocumentManager;
@@ -38,6 +36,7 @@
import com.intellij.util.containers.HashSet;
import com.intellij.util.containers.Stack;
import com.intellij.util.ui.UIUtil;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
@@ -70,6 +69,7 @@
private @Nullable FindResult myCursor;
+ @NotNull
private List<FindResult> myOccurrences = new ArrayList<FindResult>();
private final Set<RangeMarker> myExcluded = new HashSet<RangeMarker>();
@@ -90,6 +90,8 @@
private final Stack<Pair<FindModel, FindResult>> myCursorPositions = new Stack<Pair<FindModel, FindResult>>();
+ private final SelectionManager mySelectionManager = new SelectionManager(this);
+
public SearchResults(Editor editor, Project project) {
myEditor = editor;
myProject = project;
@@ -127,9 +129,8 @@
public void exclude(FindResult occurrence) {
boolean include = false;
- final TextRange r = occurrence;
for (RangeMarker rangeMarker : myExcluded) {
- if (TextRange.areSegmentsEqual(rangeMarker, r)) {
+ if (TextRange.areSegmentsEqual(rangeMarker, occurrence)) {
myExcluded.remove(rangeMarker);
rangeMarker.dispose();
include = true;
@@ -137,7 +138,7 @@
}
}
if (!include) {
- myExcluded.add(myEditor.getDocument().createRangeMarker(r.getStartOffset(), r.getEndOffset(), true));
+ myExcluded.add(myEditor.getDocument().createRangeMarker(occurrence.getStartOffset(), occurrence.getEndOffset(), true));
}
notifyChanged();
}
@@ -149,8 +150,7 @@
public interface SearchResultsListener {
void searchResultsUpdated(SearchResults sr);
- void editorChanged(SearchResults sr, Editor oldEditor);
- void cursorMoved(boolean toChangeSelection);
+ void cursorMoved();
void updateFinished();
}
@@ -175,6 +175,7 @@
return myCursor;
}
+ @NotNull
public List<FindResult> getOccurrences() {
return myOccurrences;
}
@@ -184,19 +185,7 @@
return myProject;
}
- public synchronized void setEditor(Editor editor) {
- Editor oldOne = myEditor;
- myEditor = editor;
- notifyEditorChanged(oldOne);
- }
-
- private void notifyEditorChanged(Editor oldOne) {
- for (SearchResultsListener listener : myListeners) {
- listener.editorChanged(this, oldOne);
- }
- }
-
- public synchronized Editor getEditor() {
+ public Editor getEditor() {
return myEditor;
}
@@ -334,7 +323,7 @@
myEditor.getDocument().removeDocumentListener(this);
}
- private void searchCompleted(List<FindResult> occurrences, Editor editor, @Nullable FindModel findModel,
+ private void searchCompleted(@NotNull List<FindResult> occurrences, Editor editor, @Nullable FindModel findModel,
boolean toChangeSelection, @Nullable TextRange next, int stamp) {
if (stamp < myLastUpdatedStamp){
return;
@@ -344,7 +333,7 @@
return;
}
myOccurrences = occurrences;
- final TextRange oldCursorRange = myCursor != null ? myCursor : null;
+ final TextRange oldCursorRange = myCursor;
Collections.sort(myOccurrences, new Comparator<FindResult>() {
@Override
public int compare(FindResult findResult, FindResult findResult1) {
@@ -357,7 +346,10 @@
updateExcluded();
notifyChanged();
if (oldCursorRange == null || myCursor == null || !myCursor.equals(oldCursorRange)) {
- notifyCursorMoved(toChangeSelection);
+ if (toChangeSelection) {
+ mySelectionManager.updateSelection(true, true);
+ }
+ notifyCursorMoved();
}
dumpIfNeeded();
}
@@ -389,7 +381,7 @@
myCursor = firstOccurrenceAfterOffset(oldCursorRange.getEndOffset());
} else {
if (justReplaced) {
- nextOccurrence(false, next, false, justReplaced);
+ nextOccurrence(false, next, false, true, false);
} else {
FindResult afterCaret = oldCursorRange == null ? firstOccurrenceAtOrAfterCaret() : firstOccurrenceAfterCaret();
if (afterCaret != null) {
@@ -405,7 +397,7 @@
}
}
if (!justReplaced && myCursor == null && hasMatches()) {
- nextOccurrence(true, oldCursorRange, false, false);
+ nextOccurrence(true, oldCursorRange, false, false, false);
}
if (toPush && myCursor != null){
push();
@@ -445,6 +437,13 @@
return occurrence;
}
}
+ int selectionStartOffset = getEditor().getSelectionModel().getSelectionStart();
+ int selectionEndOffset = getEditor().getSelectionModel().getSelectionEnd();
+ for (FindResult occurrence : myOccurrences) {
+ if (selectionEndOffset >= occurrence.getEndOffset() && selectionStartOffset <= occurrence.getStartOffset()) {
+ return occurrence;
+ }
+ }
return firstOccurrenceAfterCaret();
}
@@ -462,25 +461,6 @@
}
@Nullable
- private FindResult firstVisibleOccurrence() {
- int offset = Integer.MAX_VALUE;
- FindResult firstOccurrence = null;
- FindResult firstVisibleOccurrence = null;
- for (FindResult o : getOccurrences()) {
- if (insideVisibleArea(myEditor, o)) {
- if (firstVisibleOccurrence == null || o.getStartOffset() < firstVisibleOccurrence.getStartOffset()) {
- firstVisibleOccurrence = o;
- }
- }
- if (o.getStartOffset() < offset) {
- offset = o.getStartOffset();
- firstOccurrence = o;
- }
- }
- return firstVisibleOccurrence != null ? firstVisibleOccurrence : firstOccurrence;
- }
-
- @Nullable
private FindResult firstOccurrenceBeforeCaret() {
int offset = getEditor().getCaretModel().getOffset();
return firstOccurrenceBeforeOffset(offset);
@@ -554,32 +534,45 @@
return null;
}
- public void prevOccurrence() {
- FindResult next = null;
- if (myFindModel == null) return;
- boolean processFromTheBeginning = false;
- if (myNotFoundState) {
- myNotFoundState = false;
- processFromTheBeginning = true;
- }
- if (!myFindModel.isGlobal()) {
- if (myCursor != null) {
- next = prevOccurrence(myCursor);
+ public void prevOccurrence(boolean findSelected) {
+ if (findSelected) {
+ if (mySelectionManager.removeCurrentSelection()) {
+ myCursor = firstOccurrenceAtOrAfterCaret();
}
- } else {
- next = firstOccurrenceBeforeCaret();
+ else {
+ myCursor = null;
+ }
+ notifyCursorMoved();
}
- if (next == null) {
- if (processFromTheBeginning) {
- if (hasMatches()) {
- next = getOccurrences().get(getOccurrences().size()-1);
+ else {
+ FindResult next = null;
+ if (myFindModel == null) return;
+ boolean processFromTheBeginning = false;
+ if (myNotFoundState) {
+ myNotFoundState = false;
+ processFromTheBeginning = true;
+ }
+ if (!myFindModel.isGlobal()) {
+ if (myCursor != null) {
+ next = prevOccurrence(myCursor);
}
- } else {
- setNotFoundState(false);
}
- }
+ else {
+ next = firstOccurrenceBeforeCaret();
+ }
+ if (next == null) {
+ if (processFromTheBeginning) {
+ if (hasMatches()) {
+ next = getOccurrences().get(getOccurrences().size() - 1);
+ }
+ }
+ else {
+ setNotFoundState(false);
+ }
+ }
- moveCursorTo(next);
+ moveCursorTo(next, false);
+ }
push();
}
@@ -587,13 +580,13 @@
myCursorPositions.push(Pair.create(myFindModel, myCursor));
}
- public void nextOccurrence() {
+ public void nextOccurrence(boolean retainOldSelection) {
if (myFindModel == null) return;
- nextOccurrence(false, myCursor != null ? myCursor : null, true, false);
+ nextOccurrence(false, myCursor, true, false, retainOldSelection);
push();
}
- private void nextOccurrence(boolean processFromTheBeginning, TextRange cursor, boolean toNotify, boolean justReplaced) {
+ private void nextOccurrence(boolean processFromTheBeginning, TextRange cursor, boolean toNotify, boolean justReplaced, boolean retainOldSelection) {
FindResult next;
if (myNotFoundState) {
myNotFoundState = false;
@@ -614,22 +607,24 @@
}
}
if (toNotify) {
- moveCursorTo(next);
+ moveCursorTo(next, retainOldSelection);
} else {
myCursor = next;
}
}
- public void moveCursorTo(FindResult next) {
- if (next != null) {
+ public void moveCursorTo(FindResult next, boolean retainOldSelection) {
+ if (next != null && !mySelectionManager.isSelected(next)) {
+ retainOldSelection &= (myCursor != null && mySelectionManager.isSelected(myCursor));
myCursor = next;
- notifyCursorMoved(true);
+ mySelectionManager.updateSelection(!retainOldSelection, false);
+ notifyCursorMoved();
}
}
- private void notifyCursorMoved(boolean toChangeSelection) {
+ private void notifyCursorMoved() {
for (SearchResultsListener listener : myListeners) {
- listener.cursorMoved(toChangeSelection);
+ listener.cursorMoved();
}
}
}
diff --git a/platform/lang-impl/src/com/intellij/find/impl/livePreview/SelectionManager.java b/platform/lang-impl/src/com/intellij/find/impl/livePreview/SelectionManager.java
new file mode 100644
index 0000000..50f3792
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/find/impl/livePreview/SelectionManager.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2000-2014 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.find.impl.livePreview;
+
+import com.intellij.find.FindResult;
+import com.intellij.find.FindUtil;
+import com.intellij.openapi.editor.*;
+import com.intellij.openapi.util.TextRange;
+import org.jetbrains.annotations.NotNull;
+
+public class SelectionManager {
+ @NotNull private final SearchResults mySearchResults;
+
+ public SelectionManager(@NotNull SearchResults results) {
+ mySearchResults = results;
+ }
+
+ public void updateSelection(boolean removePreviousSelection, boolean removeAllPreviousSelections) {
+ Editor editor = mySearchResults.getEditor();
+ if (removeAllPreviousSelections) {
+ editor.getCaretModel().removeSecondaryCarets();
+ }
+ final FindResult cursor = mySearchResults.getCursor();
+ if (cursor == null) {
+ return;
+ }
+ if (mySearchResults.getFindModel().isGlobal()) {
+ if (removePreviousSelection || removeAllPreviousSelections) {
+ FoldingModel foldingModel = editor.getFoldingModel();
+ final FoldRegion[] allRegions = editor.getFoldingModel().getAllFoldRegions();
+
+ foldingModel.runBatchFoldingOperation(new Runnable() {
+ @Override
+ public void run() {
+ for (FoldRegion region : allRegions) {
+ if (!region.isValid()) continue;
+ if (cursor.intersects(TextRange.create(region))) {
+ region.setExpanded(true);
+ }
+ }
+ }
+ });
+ editor.getSelectionModel().setSelection(cursor.getStartOffset(), cursor.getEndOffset());
+ editor.getCaretModel().moveToOffset(cursor.getEndOffset());
+ }
+ else {
+ FindUtil.selectSearchResultInEditor(editor, cursor, -1);
+ }
+ editor.getScrollingModel().scrollToCaret(ScrollType.CENTER);
+ } else {
+ if (!SearchResults.insideVisibleArea(editor, cursor)) {
+ LogicalPosition pos = editor.offsetToLogicalPosition(cursor.getStartOffset());
+ editor.getScrollingModel().scrollTo(pos, ScrollType.CENTER);
+ }
+ }
+ }
+
+ public boolean removeCurrentSelection() {
+ Editor editor = mySearchResults.getEditor();
+ CaretModel caretModel = editor.getCaretModel();
+ Caret primaryCaret = caretModel.getPrimaryCaret();
+ if (caretModel.getCaretCount() > 1) {
+ caretModel.removeCaret(primaryCaret);
+ return true;
+ }
+ else {
+ primaryCaret.moveToOffset(primaryCaret.getSelectionStart());
+ primaryCaret.removeSelection();
+ return false;
+ }
+ }
+
+ public boolean isSelected(@NotNull FindResult result) {
+ Editor editor = mySearchResults.getEditor();
+ return editor.getCaretModel().getCaretAt(editor.offsetToVisualPosition(result.getEndOffset())) != null;
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/formatting/FormatProcessor.java b/platform/lang-impl/src/com/intellij/formatting/FormatProcessor.java
index 90f2387..7d3c7c6 100644
--- a/platform/lang-impl/src/com/intellij/formatting/FormatProcessor.java
+++ b/platform/lang-impl/src/com/intellij/formatting/FormatProcessor.java
@@ -16,6 +16,7 @@
package com.intellij.formatting;
+import com.intellij.lang.ASTNode;
import com.intellij.lang.Language;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
@@ -25,6 +26,8 @@
import com.intellij.openapi.editor.impl.TextChangeImpl;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
import com.intellij.util.ui.UIUtil;
@@ -145,6 +148,7 @@
private WhiteSpace myLastWhiteSpace;
private boolean myDisposed;
private CommonCodeStyleSettings.IndentOptions myJavaIndentOptions;
+ private final int myRightMargin;
@NotNull
private State myCurrentState;
@@ -172,6 +176,23 @@
mySettings = settings;
myDocument = docModel.getDocument();
myCurrentState = new WrapBlocksState(rootBlock, docModel, affectedRanges, interestingOffset);
+ myRightMargin = getRightMargin(rootBlock);
+ }
+
+ private int getRightMargin(Block rootBlock) {
+ if (rootBlock instanceof ASTBlock) {
+ ASTNode node = ((ASTBlock)rootBlock).getNode();
+ if (node != null) {
+ PsiElement psiElement = node.getPsi();
+ if (psiElement.isValid()) {
+ PsiFile psiFile = psiElement.getContainingFile();
+ if (psiFile != null) {
+ return mySettings.getRightMargin(psiFile.getViewProvider().getBaseLanguage());
+ }
+ }
+ }
+ }
+ return mySettings.RIGHT_MARGIN;
}
private LeafBlockWrapper getLastBlock() {
@@ -813,7 +834,7 @@
*/
private boolean lineOver() {
return !myCurrentBlock.containsLineFeeds() &&
- CoreFormatterUtil.getStartColumn(myCurrentBlock) + myCurrentBlock.getLength() > mySettings.RIGHT_MARGIN;
+ CoreFormatterUtil.getStartColumn(myCurrentBlock) + myCurrentBlock.getLength() > myRightMargin;
}
private void defineAlignOffset(final LeafBlockWrapper block) {
diff --git a/platform/lang-impl/src/com/intellij/ide/actions/GotoActionAction.java b/platform/lang-impl/src/com/intellij/ide/actions/GotoActionAction.java
index c939787..e57d1eb 100644
--- a/platform/lang-impl/src/com/intellij/ide/actions/GotoActionAction.java
+++ b/platform/lang-impl/src/com/intellij/ide/actions/GotoActionAction.java
@@ -20,9 +20,8 @@
import com.intellij.ide.DataManager;
import com.intellij.ide.ui.search.OptionDescription;
import com.intellij.ide.util.gotoByName.ChooseByNamePopup;
-import com.intellij.ide.util.gotoByName.DefaultChooseByNameItemProvider;
+import com.intellij.ide.util.gotoByName.GotoActionItemProvider;
import com.intellij.ide.util.gotoByName.GotoActionModel;
-import com.intellij.ide.util.gotoByName.MatchResult;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.ex.ActionUtil;
import com.intellij.openapi.application.ApplicationManager;
@@ -33,27 +32,11 @@
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.util.Pair;
import com.intellij.psi.PsiFile;
-import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.awt.*;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
public class GotoActionAction extends GotoActionBase implements DumbAware {
- public static final Comparator<MatchResult> ELEMENTS_COMPARATOR = new Comparator<MatchResult>() {
- @Override
- public int compare(@NotNull MatchResult o1, @NotNull MatchResult o2) {
- if (o1.elementName.equals(GotoActionModel.INTENTIONS_KEY)) return -1;
- if (o2.elementName.equals(GotoActionModel.INTENTIONS_KEY)) return 1;
-
- if (o1.elementName.equals(GotoActionModel.SETTINGS_KEY)) return 1;
- if (o2.elementName.equals(GotoActionModel.SETTINGS_KEY)) return -1;
-
- return o1.elementName.compareToIgnoreCase(o2.elementName);
- }
- };
@Override
public void gotoActionPerformed(final AnActionEvent e) {
@@ -68,7 +51,7 @@
@Override
public void elementChosen(ChooseByNamePopup popup, final Object element) {
final String enteredText = popup.getEnteredText();
- openOptionOrPerformAction(element, enteredText, project, component, e);
+ openOptionOrPerformAction(((GotoActionModel.MatchedValue)element).value, enteredText, project, component, e);
}
};
@@ -79,12 +62,7 @@
private static ChooseByNamePopup createPopup(Project project, GotoActionModel model, String initialText, int initialIndex) {
return ChooseByNamePopup.createPopup(project,
model,
- new DefaultChooseByNameItemProvider(null) {
- @Override
- protected void sortNamesList(@NotNull String namePattern, @NotNull List<MatchResult> namesList) {
- Collections.sort(namesList, ELEMENTS_COMPARATOR);
- }
- },
+ new GotoActionItemProvider(model),
initialText,
false,
initialIndex);
diff --git a/platform/lang-impl/src/com/intellij/ide/actions/GotoRelatedFileAction.java b/platform/lang-impl/src/com/intellij/ide/actions/GotoRelatedFileAction.java
new file mode 100644
index 0000000..6d734d5
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/ide/actions/GotoRelatedFileAction.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2014 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.actions;
+
+import com.intellij.navigation.GotoRelatedItem;
+import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.ui.popup.JBPopup;
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * @deprecated API compatibility. Utility methods will be moved to NavigationUtil
+ * @author gregsh
+ */
+public class GotoRelatedFileAction {
+
+ /**
+ * @deprecated This method will be moved to NavigationUtil
+ */
+ public static JBPopup createPopup(List<? extends GotoRelatedItem> items, final String title) {
+ return GotoRelatedSymbolAction.createPopup(items, title);
+ }
+
+ /**
+ * @deprecated This method will be moved to NavigationUtil
+ */
+ public static List<GotoRelatedItem> getItems(@NotNull PsiElement contextElement, @Nullable DataContext dataContext) {
+ return GotoRelatedSymbolAction.getItems(contextElement, dataContext);
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/ide/actions/GotoRelatedSymbolAction.java b/platform/lang-impl/src/com/intellij/ide/actions/GotoRelatedSymbolAction.java
index f333c0f3..2870f80 100644
--- a/platform/lang-impl/src/com/intellij/ide/actions/GotoRelatedSymbolAction.java
+++ b/platform/lang-impl/src/com/intellij/ide/actions/GotoRelatedSymbolAction.java
@@ -42,6 +42,7 @@
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.TestOnly;
import javax.swing.*;
import java.awt.*;
@@ -56,26 +57,23 @@
@Override
public void update(AnActionEvent e) {
- PsiFile file = CommonDataKeys.PSI_FILE.getData(e.getDataContext());
- PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(e.getDataContext());
- e.getPresentation().setEnabled(element != null || file != null);
+ PsiElement element = getContextElement(e.getDataContext());
+ e.getPresentation().setEnabled(element != null);
}
@Override
public void actionPerformed(AnActionEvent e) {
- DataContext dataContext = e.getDataContext();
- PsiFile file = CommonDataKeys.PSI_FILE.getData(e.getDataContext());
- Editor editor = CommonDataKeys.EDITOR.getData(e.getDataContext());
- PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(dataContext);
- if (element == null && file == null) return;
+ PsiElement element = getContextElement(e.getDataContext());
+ if (element == null) return;
- List<GotoRelatedItem> items = element == null? getItems(file, editor, dataContext) : getItems(element, dataContext);
+ List<GotoRelatedItem> items = getItems(element, e.getDataContext());
if (items.isEmpty()) return;
+
if (items.size() == 1 && items.get(0).getElement() != null) {
items.get(0).navigate();
return;
}
- createPopup(items, "Choose Target").showInBestPositionFor(dataContext);
+ createPopup(items, "Choose Target").showInBestPositionFor(e.getDataContext());
}
public static JBPopup createPopup(final List<? extends GotoRelatedItem> items, final String title) {
@@ -268,8 +266,25 @@
return popup;
}
+ @TestOnly
@NotNull
public static List<GotoRelatedItem> getItems(@NotNull PsiFile psiFile, @Nullable Editor editor, @Nullable DataContext dataContext) {
+ return getItems(getContextElement(psiFile, editor), dataContext);
+ }
+
+ @Nullable
+ private static PsiElement getContextElement(@NotNull DataContext dataContext) {
+ PsiFile file = CommonDataKeys.PSI_FILE.getData(dataContext);
+ Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
+ PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(dataContext);
+ if (file != null && editor != null) {
+ return getContextElement(file, editor);
+ }
+ return element;
+ }
+
+ @NotNull
+ private static PsiElement getContextElement(@NotNull PsiFile psiFile, @Nullable Editor editor) {
PsiElement contextElement = psiFile;
if (editor != null) {
PsiElement element = psiFile.findElementAt(editor.getCaretModel().getOffset());
@@ -277,7 +292,7 @@
contextElement = element;
}
}
- return getItems(contextElement, dataContext);
+ return contextElement;
}
@NotNull
diff --git a/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java b/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java
index 9966010..ae7ee43 100644
--- a/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java
+++ b/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java
@@ -56,10 +56,9 @@
import com.intellij.openapi.keymap.KeymapManager;
import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.keymap.MacKeymapUtil;
+import com.intellij.openapi.keymap.impl.ModifierKeyDoubleClickHandler;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.SearchableConfigurable;
-import com.intellij.openapi.options.ex.IdeConfigurablesGroup;
-import com.intellij.openapi.options.ex.ProjectConfigurablesGroup;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.util.ProgressIndicatorBase;
@@ -96,6 +95,7 @@
import com.intellij.ui.popup.AbstractPopup;
import com.intellij.ui.popup.PopupPositionManager;
import com.intellij.util.*;
+import com.intellij.util.text.Matcher;
import com.intellij.util.ui.EmptyIcon;
import com.intellij.util.ui.StatusText;
import com.intellij.util.ui.UIUtil;
@@ -138,9 +138,8 @@
MySearchTextField myPopupField;
private volatile GotoClassModel2 myClassModel;
private volatile GotoFileModel myFileModel;
- private volatile GotoActionModel myActionModel;
+ private volatile GotoActionItemProvider myActionProvider;
private volatile GotoSymbolModel2 mySymbolsModel;
- private volatile String[] myActions;
private Component myFocusComponent;
private JBPopup myPopup;
private Map<String, String> myConfigurables = new HashMap<String, String>();
@@ -153,106 +152,25 @@
private Component myContextComponent;
private CalcThread myCalcThread;
private static AtomicBoolean ourShiftIsPressed = new AtomicBoolean(false);
- private final static Couple<AtomicBoolean> ourPressed = Couple.of(new AtomicBoolean(false), new AtomicBoolean(false));
- private final static Couple<AtomicBoolean> ourReleased = Couple.of(new AtomicBoolean(false), new AtomicBoolean(false));
- private static AtomicBoolean ourOtherKeyWasPressed = new AtomicBoolean(false);
- private static AtomicLong ourLastTimePressed = new AtomicLong(0);
private static AtomicBoolean showAll = new AtomicBoolean(false);
private volatile ActionCallback myCurrentWorker = ActionCallback.DONE;
private int myHistoryIndex = 0;
boolean mySkipFocusGain = false;
static {
+ ModifierKeyDoubleClickHandler.getInstance().registerAction(IdeActions.ACTION_SEARCH_EVERYWHERE, KeyEvent.VK_SHIFT, -1);
+
IdeEventQueue.getInstance().addPostprocessor(new IdeEventQueue.EventDispatcher() {
@Override
public boolean dispatch(AWTEvent event) {
if (event instanceof KeyEvent) {
- final KeyEvent keyEvent = (KeyEvent)event;
- final int keyCode = keyEvent.getKeyCode();
-
+ final int keyCode = ((KeyEvent)event).getKeyCode();
if (keyCode == KeyEvent.VK_SHIFT) {
ourShiftIsPressed.set(event.getID() == KeyEvent.KEY_PRESSED);
-
- if (keyEvent.isControlDown() || keyEvent.isAltDown() || keyEvent.isMetaDown()) {
- resetState();
- return false;
- }
- if (ourOtherKeyWasPressed.get() && System.currentTimeMillis() - ourLastTimePressed.get() < 500) {
- resetState();
- return false;
- }
- ourOtherKeyWasPressed.set(false);
- if (ourPressed.first.get() && System.currentTimeMillis() - ourLastTimePressed.get() > 500) {
- resetState();
- }
- handleShift((KeyEvent)event);
- return false;
- } else {
- ourLastTimePressed.set(System.currentTimeMillis());
- ourOtherKeyWasPressed.set(true);
- if (keyCode == KeyEvent.VK_ESCAPE || keyCode == KeyEvent.VK_TAB) {
- ourLastTimePressed.set(0);
- }
}
- resetState();
}
return false;
}
-
- private void resetState() {
- ourPressed.first.set(false);
- ourPressed.second.set(false);
- ourReleased.first.set(false);
- ourReleased.second.set(false);
- }
-
- private void handleShift(KeyEvent event) {
- if (ourPressed.first.get() && System.currentTimeMillis() - ourLastTimePressed.get() > 300) {
- resetState();
- return;
- }
-
- if (event.getID() == KeyEvent.KEY_PRESSED) {
- if (!ourPressed.first.get()) {
- resetState();
- ourPressed.first.set(true);
- ourLastTimePressed.set(System.currentTimeMillis());
- return;
- } else {
- if (ourPressed.first.get() && ourReleased.first.get()) {
- ourPressed.second.set(true);
- ourLastTimePressed.set(System.currentTimeMillis());
- return;
- }
- }
- } else if (event.getID() == KeyEvent.KEY_RELEASED) {
- if (ourPressed.first.get() && !ourReleased.first.get()) {
- ourReleased.first.set(true);
- ourLastTimePressed.set(System.currentTimeMillis());
- return;
- } else if (ourPressed.first.get() && ourReleased.first.get() && ourPressed.second.get()) {
- resetState();
- run(event);
- return;
- }
- }
- resetState();
- }
-
- private void run(KeyEvent event) {
- final ActionManager actionManager = ActionManager.getInstance();
- final AnAction action = actionManager.getAction(IdeActions.ACTION_SEARCH_EVERYWHERE);
- if (KeymapManager.getInstance().getActiveKeymap().getShortcuts(IdeActions.ACTION_SEARCH_EVERYWHERE).length > 0) {
- return;
- }
- final AnActionEvent anActionEvent = new AnActionEvent(event,
- DataManager.getInstance().getDataContext(IdeFocusManager.findInstance().getFocusOwner()),
- ActionPlaces.MAIN_MENU,
- action.getTemplatePresentation(),
- actionManager,
- 0);
- action.actionPerformed(anActionEvent);
- }
}, null);
}
@@ -840,7 +758,9 @@
if (split.length != 3 || text.equals(split[0])) {
continue;
}
- history.add(new HistoryItem(split[0], split[1], split[2]));
+ if (!StringUtil.isEmpty(split[0])) {
+ history.add(new HistoryItem(split[0], split[1], split[2]));
+ }
}
}
history.add(0, new HistoryItem(text, type == null ? null : type.name(), fqn));
@@ -1008,14 +928,18 @@
Component cmp;
PsiFile file = null;
myLocationString = null;
+ String pattern = "*" + myPopupField.getText();
+ Matcher matcher = NameUtil.buildMatcher(pattern, 0, true, true, pattern.toLowerCase().equals(pattern));
if (isMoreItem(index)) {
cmp = More.get(isSelected);
} else if (value instanceof VirtualFile
&& myProject != null
&& (((VirtualFile)value).isDirectory()
|| (file = PsiManager.getInstance(myProject).findFile((VirtualFile)value)) != null)) {
+ myFileRenderer.setPatternMatcher(matcher);
cmp = myFileRenderer.getListCellRendererComponent(list, file == null ? value : file, index, isSelected, cellHasFocus);
} else if (value instanceof PsiElement) {
+ myPsiRenderer.setPatternMatcher(matcher);
cmp = myPsiRenderer.getListCellRendererComponent(list, value, index, isSelected, isSelected);
} else {
cmp = super.getListCellRendererComponent(list, value, index, isSelected, isSelected);
@@ -1185,16 +1109,6 @@
return text;
}
- private void schedulePopupUpdate() {
- myUpdateAlarm.cancelAllRequests();
- myUpdateAlarm.addRequest(new Runnable() {
- @Override
- public void run() {
- updatePopupBounds();
- }
- }, 50);
- }
-
private static boolean isActionValue(Object o) {
return o instanceof GotoActionModel.ActionWrapper || o instanceof AnAction;
}
@@ -1353,21 +1267,16 @@
private SearchResult getActionsOrSettings(final String pattern, final int max, final boolean actions) {
final SearchResult result = new SearchResult();
final MinusculeMatcher matcher = new MinusculeMatcher("*" +pattern, NameUtil.MatchingCaseSensitivity.NONE);
- if (myActions == null) {
- if (myActionModel == null) {
- myActionModel = createActionModel();
- }
- myActions = myActionModel.getNames(true);
+ if (myActionProvider == null) {
+ myActionProvider = createActionProvider();
}
- List<MatchResult> matches = collectResults(pattern, myActions, myActionModel);
-
- for (MatchResult o : matches) {
- check();
- Object[] objects = myActionModel.getElementsByName(o.elementName, true, pattern);
- for (Object object : objects) {
+ myActionProvider.filterElements(pattern, true, new Processor<GotoActionModel.MatchedValue>() {
+ @Override
+ public boolean process(GotoActionModel.MatchedValue matched) {
check();
- if (myListModel.contains(object)) continue;
+ Object object = matched.value;
+ if (myListModel.contains(object)) return true;
if (!actions && isSetting(object)) {
if (matcher.matches(getSettingText((OptionDescription)object))) {
@@ -1376,9 +1285,10 @@
} else if (actions && !isToolWindowAction(object) && isActionValue(object)) {
result.add(object);
}
- if (result.size() == max) return result;
+ return result.size() <= max;
}
- }
+ });
+
return result;
}
@@ -1411,7 +1321,7 @@
}
private synchronized void buildFiles(final String pattern) {
- final SearchResult files = getFiles(pattern, MAX_FILES);
+ final SearchResult files = getFiles(pattern, MAX_FILES, myFileChooseByName);
check();
@@ -1434,7 +1344,7 @@
private synchronized void buildSymbols(final String pattern) {
- final SearchResult symbols = getSymbols(pattern, MAX_SYMBOLS);
+ final SearchResult symbols = getSymbols(pattern, MAX_SYMBOLS, mySymbolsChooseByName);
check();
if (symbols.size() > 0) {
@@ -1522,7 +1432,7 @@
}
check();
- final SearchResult classes = getClasses(pattern, showAll.get(), MAX_CLASSES);
+ final SearchResult classes = getClasses(pattern, showAll.get(), MAX_CLASSES, myClassChooseByName);
check();
@@ -1544,10 +1454,10 @@
}
}
- private SearchResult getSymbols(String pattern, final int max) {
+ private SearchResult getSymbols(String pattern, final int max, ChooseByNamePopup chooseByNamePopup) {
final SearchResult symbols = new SearchResult();
final GlobalSearchScope scope = GlobalSearchScope.projectScope(project);
- mySymbolsChooseByName.getProvider().filterElements(mySymbolsChooseByName, pattern, false,
+ chooseByNamePopup.getProvider().filterElements(chooseByNamePopup, pattern, false,
myProgressIndicator, new Processor<Object>() {
@Override
public boolean process(Object o) {
@@ -1567,9 +1477,12 @@
return symbols;
}
- private SearchResult getClasses(String pattern, boolean includeLibs, final int max) {
+ private SearchResult getClasses(String pattern, boolean includeLibs, final int max, ChooseByNamePopup chooseByNamePopup) {
final SearchResult classes = new SearchResult();
- myClassChooseByName.getProvider().filterElements(myClassChooseByName, pattern, includeLibs,
+ if (chooseByNamePopup == null) {
+ return classes;
+ }
+ chooseByNamePopup.getProvider().filterElements(chooseByNamePopup, pattern, includeLibs,
myProgressIndicator, new Processor<Object>() {
@Override
public boolean process(Object o) {
@@ -1584,15 +1497,18 @@
}
});
if (!includeLibs && classes.isEmpty()) {
- return getClasses(pattern, true, max);
+ return getClasses(pattern, true, max, chooseByNamePopup);
}
return classes;
}
- private SearchResult getFiles(final String pattern, final int max) {
+ private SearchResult getFiles(final String pattern, final int max, ChooseByNamePopup chooseByNamePopup) {
final SearchResult files = new SearchResult();
+ if (chooseByNamePopup == null) {
+ return files;
+ }
final GlobalSearchScope scope = GlobalSearchScope.projectScope(project);
- myFileChooseByName.getProvider().filterElements(myFileChooseByName, pattern, true,
+ chooseByNamePopup.getProvider().filterElements(chooseByNamePopup, pattern, true,
myProgressIndicator, new Processor<Object>() {
@Override
public boolean process(Object o) {
@@ -1786,10 +1702,9 @@
myClassChooseByName = ChooseByNamePopup.createPopup(project, myClassModel, (PsiElement)null);
mySymbolsChooseByName = ChooseByNamePopup.createPopup(project, mySymbolsModel, (PsiElement)null);
project.putUserData(ChooseByNamePopup.CHOOSE_BY_NAME_POPUP_IN_PROJECT_KEY, null);
- myActionModel = createActionModel();
+ myActionProvider = createActionProvider();
myConfigurables.clear();
- fillConfigurablesIds(null, new IdeConfigurablesGroup().getConfigurables());
- fillConfigurablesIds(null, new ProjectConfigurablesGroup(project).getConfigurables());
+ fillConfigurablesIds(null, ShowSettingsUtilImpl.getConfigurables(project, true));
}
}
@@ -1797,14 +1712,16 @@
buildRecentFiles("");
}
- private GotoActionModel createActionModel() {
- return new GotoActionModel(project, myFocusComponent, myEditor, myFile) {
+ private GotoActionItemProvider createActionProvider() {
+ GotoActionModel model = new GotoActionModel(project, myFocusComponent, myEditor, myFile) {
@Override
protected MatchMode actionMatches(String pattern, @NotNull AnAction anAction) {
- return NameUtil.buildMatcher("*" + pattern, NameUtil.MatchingCaseSensitivity.NONE)
- .matches(anAction.getTemplatePresentation().getText()) ? MatchMode.NAME : MatchMode.NONE;
+ String text = anAction.getTemplatePresentation().getText();
+ return text != null && NameUtil.buildMatcher("*" + pattern, NameUtil.MatchingCaseSensitivity.NONE)
+ .matches(text) ? MatchMode.NAME : MatchMode.NONE;
}
};
+ return new GotoActionItemProvider(model);
}
@SuppressWarnings("SSBasedInspection")
@@ -1880,57 +1797,6 @@
});
}
- private List<MatchResult> collectResults(String pattern, String[] names, final ChooseByNameModel model) {
- if (names == null) return Collections.emptyList();
- pattern = ChooseByNamePopup.getTransformedPattern(pattern, model);
- pattern = DefaultChooseByNameItemProvider.getNamePattern(model, pattern);
- if (model != myFileModel && model != myActionModel && !pattern.startsWith("*") && pattern.length() > 1) {
- pattern = "*" + pattern;
- }
- final ArrayList<MatchResult> results = new ArrayList<MatchResult>();
- final String p = pattern;
- MinusculeMatcher matcher = new MinusculeMatcher(pattern, NameUtil.MatchingCaseSensitivity.NONE) {
- @Override
- public boolean matches(@NotNull String name) {
- if (!(model instanceof GotoActionModel) && p.indexOf(' ') > 0 && name.trim().indexOf(' ') < 0) {
- return false;
- }
- return super.matches(name);
- }
- };
- MatchResult result;
-
- for (String name : names) {
- check();
- result = null;
- if (model instanceof CustomMatcherModel) {
- try {
- result = ((CustomMatcherModel)model).matches(name, pattern) ? new MatchResult(name, 0, true) : null;
- if (result != null && model == myActionModel) {
- ((CustomMatcherModel)model).matches(name, pattern);
- }
- }
- catch (Exception ignore) {
- }
- }
- else {
- result = matcher.matches(name) ? new MatchResult(name, matcher.matchingDegree(name), matcher.isStartMatch(name)) : null;
- }
-
- if (result != null) {
- results.add(result);
- }
- }
-
- Collections.sort(results, new Comparator<MatchResult>() {
- @Override
- public int compare(MatchResult o1, MatchResult o2) {
- return o1.compareTo(o2);
- }
- });
- return results;
- }
-
public ActionCallback cancel() {
myProgressIndicator.cancel();
myDone.setRejected();
@@ -1945,10 +1811,10 @@
public void run() {
try {
final SearchResult result
- = id == WidgetID.CLASSES ? getClasses(pattern, showAll.get(), DEFAULT_MORE_STEP_COUNT)
- : id == WidgetID.FILES ? getFiles(pattern, DEFAULT_MORE_STEP_COUNT)
+ = id == WidgetID.CLASSES ? getClasses(pattern, showAll.get(), DEFAULT_MORE_STEP_COUNT, myClassChooseByName)
+ : id == WidgetID.FILES ? getFiles(pattern, DEFAULT_MORE_STEP_COUNT, myFileChooseByName)
: id == WidgetID.RUN_CONFIGURATIONS ? getConfigurations(pattern, DEFAULT_MORE_STEP_COUNT)
- : id == WidgetID.SYMBOLS ? getSymbols(pattern, DEFAULT_MORE_STEP_COUNT)
+ : id == WidgetID.SYMBOLS ? getSymbols(pattern, DEFAULT_MORE_STEP_COUNT, mySymbolsChooseByName)
: id == WidgetID.ACTIONS ? getActionsOrSettings(pattern, DEFAULT_MORE_STEP_COUNT, true)
: id == WidgetID.SETTINGS ? getActionsOrSettings(pattern, DEFAULT_MORE_STEP_COUNT, false)
: new SearchResult();
@@ -2030,8 +1896,7 @@
if (lock != null) {
synchronized (lock) {
myClassModel = null;
- myActionModel = null;
- myActions = null;
+ myActionProvider = null;
mySymbolsModel = null;
myConfigurables.clear();
myFocusComponent = null;
diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/ProjectViewPsiTreeChangeListener.java b/platform/lang-impl/src/com/intellij/ide/projectView/ProjectViewPsiTreeChangeListener.java
index 58bef64..e2c79cf 100644
--- a/platform/lang-impl/src/com/intellij/ide/projectView/ProjectViewPsiTreeChangeListener.java
+++ b/platform/lang-impl/src/com/intellij/ide/projectView/ProjectViewPsiTreeChangeListener.java
@@ -125,8 +125,10 @@
updater.addSubtreeToUpdate(rootNode);
return;
}
-
- updater.addSubtreeToUpdateByElement(element);
+ final PsiElement parent = element.getParent();
+ if (parent == null || !updater.addSubtreeToUpdateByElement(parent)) {
+ updater.addSubtreeToUpdateByElement(element);
+ }
}
else if (propertyName.equals(PsiTreeChangeEvent.PROP_FILE_TYPES)){
updater.addSubtreeToUpdate(rootNode);
diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/actions/MarkExcludeRootAction.java b/platform/lang-impl/src/com/intellij/ide/projectView/actions/MarkExcludeRootAction.java
index 8596485..2e55b4a 100644
--- a/platform/lang-impl/src/com/intellij/ide/projectView/actions/MarkExcludeRootAction.java
+++ b/platform/lang-impl/src/com/intellij/ide/projectView/actions/MarkExcludeRootAction.java
@@ -21,6 +21,7 @@
import com.intellij.openapi.roots.ContentEntry;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
@@ -32,11 +33,13 @@
public void actionPerformed(AnActionEvent e) {
VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
- String message = files.length == 1 ? FileUtil.toSystemDependentName(files[0].getPath()) : files.length + " selected files";
- final int rc = Messages.showOkCancelDialog(e.getData(CommonDataKeys.PROJECT), getPromptText(message), "Mark as Excluded",
- Messages.getQuestionIcon());
- if (rc != Messages.OK) {
- return;
+ if (Registry.is("ide.hide.excluded.files")) {
+ String message = files.length == 1 ? FileUtil.toSystemDependentName(files[0].getPath()) : files.length + " selected files";
+ final int rc = Messages.showOkCancelDialog(e.getData(CommonDataKeys.PROJECT), getPromptText(message), "Mark as Excluded",
+ Messages.getQuestionIcon());
+ if (rc != Messages.OK) {
+ return;
+ }
}
super.actionPerformed(e);
}
diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/actions/MarkRootActionBase.java b/platform/lang-impl/src/com/intellij/ide/projectView/actions/MarkRootActionBase.java
index 815c3e8..ac2326d 100644
--- a/platform/lang-impl/src/com/intellij/ide/projectView/actions/MarkRootActionBase.java
+++ b/platform/lang-impl/src/com/intellij/ide/projectView/actions/MarkRootActionBase.java
@@ -22,7 +22,9 @@
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.DumbAwareAction;
+import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.*;
+import com.intellij.openapi.roots.impl.DirectoryIndex;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
@@ -38,23 +40,24 @@
public abstract class MarkRootActionBase extends DumbAwareAction {
@Override
public void actionPerformed(AnActionEvent e) {
- final Module module = e.getData(LangDataKeys.MODULE);
- VirtualFile[] vFiles = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
- if (module == null || vFiles == null) {
+ VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
+ final Module module = getModule(e, files);
+ if (module == null) {
return;
}
+
final ModifiableRootModel model = ModuleRootManager.getInstance(module).getModifiableModel();
- for (VirtualFile vFile : vFiles) {
- ContentEntry entry = findContentEntry(model, vFile);
+ for (VirtualFile file : files) {
+ ContentEntry entry = findContentEntry(model, file);
if (entry != null) {
final SourceFolder[] sourceFolders = entry.getSourceFolders();
for (SourceFolder sourceFolder : sourceFolders) {
- if (Comparing.equal(sourceFolder.getFile(), vFile)) {
+ if (Comparing.equal(sourceFolder.getFile(), file)) {
entry.removeSourceFolder(sourceFolder);
break;
}
}
- modifyRoots(vFile, entry);
+ modifyRoots(file, entry);
}
}
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@@ -66,7 +69,7 @@
});
}
- protected abstract void modifyRoots(VirtualFile vFile, ContentEntry entry);
+ protected abstract void modifyRoots(VirtualFile file, ContentEntry entry);
@Nullable
public static ContentEntry findContentEntry(@NotNull ModuleRootModel model, @NotNull VirtualFile vFile) {
@@ -82,21 +85,22 @@
@Override
public void update(AnActionEvent e) {
- Module module = e.getData(LangDataKeys.MODULE);
RootsSelection selection = getSelection(e);
- boolean enabled = module != null && (!selection.mySelectedRoots.isEmpty() || !selection.mySelectedDirectories.isEmpty()) && isEnabled(selection, module);
- e.getPresentation().setVisible(enabled);
- e.getPresentation().setEnabled(enabled);
+ doUpdate(e, e.getData(LangDataKeys.MODULE), selection);
+ }
+
+ protected void doUpdate(@NotNull AnActionEvent e, @Nullable Module module, @NotNull RootsSelection selection) {
+ boolean enabled = module != null && (!selection.mySelectedRoots.isEmpty() || !selection.mySelectedDirectories.isEmpty())
+ && selection.mySelectedExcludeRoots.isEmpty() && isEnabled(selection, module);
+ e.getPresentation().setEnabledAndVisible(enabled);
}
protected abstract boolean isEnabled(@NotNull RootsSelection selection, @NotNull Module module);
protected static RootsSelection getSelection(AnActionEvent e) {
- Module module = e.getData(LangDataKeys.MODULE);
VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
- if (module == null || files == null) {
- return RootsSelection.EMPTY;
- }
+ Module module = getModule(e, files);
+ if (module == null) return RootsSelection.EMPTY;
RootsSelection selection = new RootsSelection();
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(module.getProject()).getFileIndex();
@@ -105,7 +109,14 @@
return RootsSelection.EMPTY;
}
if (!fileIndex.isInContent(file)) {
- return RootsSelection.EMPTY;
+ ExcludeFolder excludeFolder = ProjectRootsUtil.findExcludeFolder(module, file);
+ if (excludeFolder != null) {
+ selection.mySelectedExcludeRoots.add(excludeFolder);
+ continue;
+ }
+ else {
+ return RootsSelection.EMPTY;
+ }
}
SourceFolder folder;
if (Comparing.equal(fileIndex.getSourceRootForFile(file), file) && ((folder = ProjectRootsUtil.findSourceFolder(module, file)) != null)) {
@@ -121,10 +132,39 @@
return selection;
}
+ @Nullable
+ private static Module getModule(@NotNull AnActionEvent e, @Nullable VirtualFile[] files) {
+ if (files == null) return null;
+ Module module = e.getData(LangDataKeys.MODULE);
+ if (module == null) {
+ module = findParentModule(e.getProject(), files);
+ }
+ return module;
+ }
+
+ @Nullable
+ private static Module findParentModule(@Nullable Project project, @NotNull VirtualFile[] files) {
+ if (project == null) return null;
+ Module result = null;
+ DirectoryIndex index = DirectoryIndex.getInstance(project);
+ for (VirtualFile file : files) {
+ Module module = index.getInfoForFile(file).getModule();
+ if (module == null) return null;
+ if (result == null) {
+ result = module;
+ }
+ else if (!result.equals(module)) {
+ return null;
+ }
+ }
+ return result;
+ }
+
protected static class RootsSelection {
public static final RootsSelection EMPTY = new RootsSelection();
public List<SourceFolder> mySelectedRoots = new ArrayList<SourceFolder>();
+ public List<ExcludeFolder> mySelectedExcludeRoots = new ArrayList<ExcludeFolder>();
public List<VirtualFile> mySelectedDirectories = new ArrayList<VirtualFile>();
public boolean myHaveSelectedFilesUnderSourceRoots;
}
diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/actions/UnmarkRootAction.java b/platform/lang-impl/src/com/intellij/ide/projectView/actions/UnmarkRootAction.java
index cf2724dc..0689fe1 100644
--- a/platform/lang-impl/src/com/intellij/ide/projectView/actions/UnmarkRootAction.java
+++ b/platform/lang-impl/src/com/intellij/ide/projectView/actions/UnmarkRootAction.java
@@ -18,12 +18,15 @@
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.ContentEntry;
+import com.intellij.openapi.roots.ExcludeFolder;
import com.intellij.openapi.roots.SourceFolder;
import com.intellij.openapi.roots.ui.configuration.ModuleSourceRootEditHandler;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.HashSet;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.module.JpsModuleSourceRootType;
import java.util.Set;
@@ -33,9 +36,16 @@
*/
public class UnmarkRootAction extends MarkRootActionBase {
@Override
- public void update(AnActionEvent e) {
- super.update(e);
- RootsSelection selection = getSelection(e);
+ protected void doUpdate(@NotNull AnActionEvent e, @Nullable Module module, @NotNull RootsSelection selection) {
+ if (!Registry.is("ide.hide.excluded.files") && !selection.mySelectedExcludeRoots.isEmpty()
+ && selection.mySelectedDirectories.isEmpty() && selection.mySelectedRoots.isEmpty()) {
+ e.getPresentation().setEnabledAndVisible(true);
+ e.getPresentation().setText("Cancel Exclusion");
+ return;
+ }
+
+ super.doUpdate(e, module, selection);
+
Set<JpsModuleSourceRootType<?>> selectedRootTypes = new HashSet<JpsModuleSourceRootType<?>>();
for (SourceFolder root : selection.mySelectedRoots) {
selectedRootTypes.add(root.getRootType());
@@ -60,6 +70,12 @@
return selection.mySelectedDirectories.isEmpty() && !selection.mySelectedRoots.isEmpty();
}
- protected void modifyRoots(VirtualFile vFile, ContentEntry entry) {
+ protected void modifyRoots(VirtualFile file, ContentEntry entry) {
+ for (ExcludeFolder excludeFolder : entry.getExcludeFolders()) {
+ if (file.equals(excludeFolder.getFile())) {
+ entry.removeExcludeFolder(excludeFolder);
+ break;
+ }
+ }
}
}
diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewDirectoryHelper.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewDirectoryHelper.java
index ee05f0a..13ba919 100644
--- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewDirectoryHelper.java
+++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewDirectoryHelper.java
@@ -25,6 +25,7 @@
import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.fileTypes.FileTypeRegistry;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleFileIndex;
@@ -32,7 +33,9 @@
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.roots.impl.DirectoryIndex;
+import com.intellij.openapi.roots.impl.DirectoryInfo;
import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiElement;
@@ -123,7 +126,7 @@
final Module module = fileIndex.getModuleForFile(psiDirectory.getVirtualFile());
final ModuleFileIndex moduleFileIndex = module == null ? null : ModuleRootManager.getInstance(module).getFileIndex();
if (!settings.isFlattenPackages() || skipDirectory(psiDirectory)) {
- processPsiDirectoryChildren(psiDirectory, directoryChildrenInProject(psiDirectory),
+ processPsiDirectoryChildren(psiDirectory, directoryChildrenInProject(fileIndex, psiDirectory),
children, fileIndex, null, settings, withSubDirectories);
}
else { // source directory in "flatten packages" mode
@@ -137,7 +140,13 @@
continue;
}
VirtualFile directoryFile = subdir.getVirtualFile();
- if (fileIndex.isIgnored(directoryFile)) continue;
+
+ if (Registry.is("ide.hide.excluded.files")) {
+ if (fileIndex.isExcluded(directoryFile)) continue;
+ }
+ else {
+ if (FileTypeRegistry.getInstance().isFileIgnored(directoryFile)) continue;
+ }
if (withSubDirectories) {
children.add(new PsiDirectoryNode(project, subdir, settings));
@@ -163,9 +172,9 @@
return topLevelContentRoots;
}
- private PsiElement[] directoryChildrenInProject(PsiDirectory psiDirectory) {
+ private PsiElement[] directoryChildrenInProject(ProjectFileIndex fileIndex, PsiDirectory psiDirectory) {
VirtualFile dir = psiDirectory.getVirtualFile();
- if (myIndex.getInfoForDirectory(dir) != null) {
+ if (isInProject(dir)) {
return psiDirectory.getChildren();
}
@@ -189,6 +198,16 @@
return PsiUtilCore.toPsiElementArray(directoriesOnTheWayToContentRoots);
}
+ private boolean isInProject(VirtualFile dir) {
+ DirectoryInfo directoryInfo = myIndex.getInfoForFile(dir);
+ if (directoryInfo.isInProject()) return true;
+
+ if (!Registry.is("ide.hide.excluded.files")) {
+ return directoryInfo.isExcluded();
+ }
+ return false;
+ }
+
// used only for non-flatten packages mode
public void processPsiDirectoryChildren(final PsiDirectory psiDir,
PsiElement[] children,
@@ -211,7 +230,7 @@
vFile = dir.getVirtualFile();
if (!vFile.equals(projectFileIndex.getSourceRootForFile(vFile))) { // if is not a source root
if (viewSettings.isHideEmptyMiddlePackages() && !skipDirectory(psiDir) && isEmptyMiddleDirectory(dir, true)) {
- processPsiDirectoryChildren(dir, directoryChildrenInProject(dir),
+ processPsiDirectoryChildren(dir, directoryChildrenInProject(projectFileIndex, dir),
container, projectFileIndex, moduleFileIndex, viewSettings, withSubDirectories); // expand it recursively
continue;
}
diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java
index a010828..16aa930 100644
--- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java
+++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java
@@ -26,6 +26,7 @@
import com.intellij.ide.projectView.impl.ProjectViewImpl;
import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.fileTypes.FileTypeRegistry;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.project.Project;
@@ -38,6 +39,7 @@
import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VFileProperty;
import com.intellij.openapi.vfs.VfsUtilCore;
@@ -183,9 +185,14 @@
return false;
}
- final Project project = value.getProject();
- final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
- return !fileIndex.isIgnored(file);
+ if (Registry.is("ide.hide.excluded.files")) {
+ final Project project = value.getProject();
+ final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
+ return !fileIndex.isExcluded(file);
+ }
+ else {
+ return !FileTypeRegistry.getInstance().isFileIgnored(file);
+ }
}
@Override
diff --git a/platform/lang-impl/src/com/intellij/ide/ui/search/TraverseUIStarter.java b/platform/lang-impl/src/com/intellij/ide/ui/search/TraverseUIStarter.java
index b1c1e25..eb22b72 100644
--- a/platform/lang-impl/src/com/intellij/ide/ui/search/TraverseUIStarter.java
+++ b/platform/lang-impl/src/com/intellij/ide/ui/search/TraverseUIStarter.java
@@ -129,7 +129,7 @@
System.out.println("Searchable options index builder completed");
- ((ApplicationEx)ApplicationManager.getApplication()).exit(true);
+ ((ApplicationEx)ApplicationManager.getApplication()).exit(true, true);
}
private static void processFileTemplates(Element configurableElement) {
diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionItemProvider.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionItemProvider.java
new file mode 100644
index 0000000..a6e6c8f
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionItemProvider.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2000-2014 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.util.gotoByName;
+
+import com.intellij.ide.DataManager;
+import com.intellij.ide.actions.ApplyIntentionAction;
+import com.intellij.ide.ui.search.ActionFromOptionDescriptorProvider;
+import com.intellij.ide.ui.search.OptionDescription;
+import com.intellij.ide.ui.search.SearchableOptionsRegistrar;
+import com.intellij.ide.ui.search.SearchableOptionsRegistrarImpl;
+import com.intellij.openapi.actionSystem.ActionManager;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.impl.ActionManagerImpl;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.util.Function;
+import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.*;
+
+import static com.intellij.ide.util.gotoByName.GotoActionModel.*;
+
+/**
+ * @author peter
+ */
+public class GotoActionItemProvider implements ChooseByNameItemProvider {
+ private final ActionManager myActionManager = ActionManager.getInstance();
+ protected final SearchableOptionsRegistrar myIndex = SearchableOptionsRegistrar.getInstance();
+ private final GotoActionModel myModel;
+
+ public GotoActionItemProvider(GotoActionModel model) {
+ myModel = model;
+ }
+
+ @NotNull
+ @Override
+ public List<String> filterNames(@NotNull ChooseByNameBase base, @NotNull String[] names, @NotNull String pattern) {
+ return Collections.emptyList(); // no common prefix insertion in goto action
+ }
+
+ @Override
+ public boolean filterElements(@NotNull final ChooseByNameBase base,
+ @NotNull final String pattern,
+ boolean everywhere,
+ @NotNull ProgressIndicator cancelled,
+ @NotNull final Processor<Object> consumer) {
+ return filterElements(pattern, everywhere, new Processor<MatchedValue>() {
+ @Override
+ public boolean process(MatchedValue value) {
+ return consumer.process(value);
+ }
+ });
+ }
+
+ public boolean filterElements(String pattern, boolean everywhere, Processor<MatchedValue> consumer) {
+ DataContext dataContext = DataManager.getInstance().getDataContext(myModel.getContextComponent());
+
+ if (!processIntentions(pattern, consumer, dataContext)) return false;
+ if (!processActions(pattern, everywhere, consumer, dataContext)) return false;
+ if (!processOptions(pattern, consumer, dataContext)) return false;
+
+ return true;
+ }
+
+ private boolean processOptions(String pattern, Processor<MatchedValue> consumer, DataContext dataContext) {
+ List<Comparable> options = ContainerUtil.newArrayList();
+ final Set<String> words = myIndex.getProcessedWords(pattern);
+ Set<OptionDescription> optionDescriptions = null;
+ final String actionManagerName = myActionManager.getComponentName();
+ for (String word : words) {
+ final Set<OptionDescription> descriptions = ((SearchableOptionsRegistrarImpl)myIndex).getAcceptableDescriptions(word);
+ if (descriptions != null) {
+ for (Iterator<OptionDescription> iterator = descriptions.iterator(); iterator.hasNext(); ) {
+ OptionDescription description = iterator.next();
+ if (actionManagerName.equals(description.getPath())) {
+ iterator.remove();
+ }
+ }
+ if (!descriptions.isEmpty()) {
+ if (optionDescriptions == null) {
+ optionDescriptions = descriptions;
+ }
+ else {
+ optionDescriptions.retainAll(descriptions);
+ }
+ }
+ } else {
+ optionDescriptions = null;
+ break;
+ }
+ }
+ if (optionDescriptions != null && !optionDescriptions.isEmpty()) {
+ Set<String> currentHits = new HashSet<String>();
+ for (Iterator<OptionDescription> iterator = optionDescriptions.iterator(); iterator.hasNext(); ) {
+ OptionDescription description = iterator.next();
+ final String hit = description.getHit();
+ if (hit == null || !currentHits.add(hit.trim())) {
+ iterator.remove();
+ }
+ }
+ for (OptionDescription description : optionDescriptions) {
+ for (ActionFromOptionDescriptorProvider converter : ActionFromOptionDescriptorProvider.EP.getExtensions()) {
+ AnAction action = converter.provide(description);
+ if (action != null) options.add(new ActionWrapper(action, null, MatchMode.NAME, dataContext));
+ options.add(description);
+ }
+ }
+ }
+ return processItems(pattern, options, consumer);
+ }
+
+ private boolean processActions(String pattern, boolean everywhere, Processor<MatchedValue> consumer, DataContext dataContext) {
+ List<AnAction> actions = ContainerUtil.newArrayList();
+ if (everywhere) {
+ for (String id : ((ActionManagerImpl)myActionManager).getActionIds()) {
+ ContainerUtil.addIfNotNull(actions, myActionManager.getAction(id));
+ }
+ } else {
+ actions.addAll(myModel.myActionsMap.keySet());
+ }
+
+ List<ActionWrapper> actionWrappers = ContainerUtil.newArrayList();
+ for (AnAction action : actions) {
+ MatchMode mode = myModel.actionMatches(pattern, action);
+ if (mode != MatchMode.NONE) {
+ actionWrappers.add(new ActionWrapper(action, myModel.myActionsMap.get(action), mode, dataContext));
+ }
+ }
+ return processItems(pattern, actionWrappers, consumer);
+ }
+
+ private boolean processIntentions(String pattern, Processor<MatchedValue> consumer, DataContext dataContext) {
+ List<ActionWrapper> intentions = ContainerUtil.newArrayList();
+ for (String intentionText : myModel.myIntentions.keySet()) {
+ final ApplyIntentionAction intentionAction = myModel.myIntentions.get(intentionText);
+ if (myModel.actionMatches(pattern, intentionAction) != MatchMode.NONE) {
+ intentions.add(new ActionWrapper(intentionAction, intentionText, MatchMode.INTENTION, dataContext));
+ }
+ }
+ return processItems(pattern, intentions, consumer);
+ }
+
+ private static boolean processItems(final String pattern, List<? extends Comparable> items, Processor<MatchedValue> consumer) {
+ List<MatchedValue> matched = ContainerUtil.map(items, new Function<Comparable, MatchedValue>() {
+ @Override
+ public MatchedValue fun(Comparable comparable) {
+ return new MatchedValue(comparable, pattern);
+ }
+ });
+ Collections.sort(matched);
+ return ContainerUtil.process(matched, consumer);
+ }
+
+}
diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java
index 45fe6a9..91f0d33 100644
--- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java
+++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java
@@ -16,34 +16,28 @@
package com.intellij.ide.util.gotoByName;
-import com.intellij.ide.DataManager;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.actions.ApplyIntentionAction;
-import com.intellij.ide.ui.search.ActionFromOptionDescriptorProvider;
+import com.intellij.ide.actions.ShowSettingsUtilImpl;
import com.intellij.ide.ui.search.OptionDescription;
import com.intellij.ide.ui.search.SearchableOptionsRegistrar;
-import com.intellij.ide.ui.search.SearchableOptionsRegistrarImpl;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.ex.ActionUtil;
-import com.intellij.openapi.actionSystem.impl.ActionManagerImpl;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.keymap.KeymapManager;
import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.SearchableConfigurable;
-import com.intellij.openapi.options.ex.IdeConfigurablesGroup;
-import com.intellij.openapi.options.ex.ProjectConfigurablesGroup;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiFile;
-import com.intellij.ui.ColorUtil;
-import com.intellij.ui.IdeBorderFactory;
-import com.intellij.ui.LayeredIcon;
-import com.intellij.ui.LightColors;
+import com.intellij.ui.*;
import com.intellij.ui.components.JBLabel;
+import com.intellij.ui.speedSearch.SpeedSearchUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.EmptyIcon;
@@ -58,9 +52,10 @@
import java.util.*;
import java.util.List;
+import static com.intellij.ui.SimpleTextAttributes.STYLE_PLAIN;
+import static com.intellij.ui.SimpleTextAttributes.STYLE_SEARCH_MATCH;
+
public class GotoActionModel implements ChooseByNameModel, CustomMatcherModel, Comparator<Object>, EdtSortingModel {
- @NonNls public static final String SETTINGS_KEY = "$$$SETTINGS$$$";
- @NonNls public static final String INTENTIONS_KEY = "$$$INTENTIONS_KEY$$$";
@Nullable private final Project myProject;
private final Component myContextComponent;
@@ -103,10 +98,7 @@
}
}
myIndex = SearchableOptionsRegistrar.getInstance();
- fillConfigurablesNames(new IdeConfigurablesGroup().getConfigurables());
- if (project != null) {
- fillConfigurablesNames(new ProjectConfigurablesGroup(project).getConfigurables());
- }
+ fillConfigurablesNames(ShowSettingsUtilImpl.getConfigurables(project, true));
}
private void fillConfigurablesNames(Configurable[] configurables) {
@@ -151,13 +143,61 @@
public void saveInitialCheckBoxState(boolean state) {
}
+ public static class MatchedValue implements Comparable<MatchedValue> {
+ @NotNull public final Comparable value;
+ @NotNull final String pattern;
+
+ MatchedValue(@NotNull Comparable value, @NotNull String pattern) {
+ this.value = value;
+ this.pattern = pattern;
+ }
+
+ @Nullable
+ private String getValueText() {
+ if (value instanceof OptionDescription) return ((OptionDescription)value).getHit();
+ if (!(value instanceof ActionWrapper)) return null;
+ return ((ActionWrapper)value).getAction().getTemplatePresentation().getText();
+ }
+
+ private int getMatchingDegree() {
+ String text = getValueText();
+ if (text != null) {
+ if (StringUtil.equalsIgnoreCase(StringUtil.trimEnd(text, "..."), pattern)) return 3;
+ if (StringUtil.startsWithIgnoreCase(text, pattern)) return 2;
+ if (StringUtil.containsIgnoreCase(text, pattern)) return 1;
+ }
+ return 0;
+ }
+
+ @Override
+ public int compareTo(@NotNull MatchedValue o) {
+ if (value instanceof OptionDescription && !(o.value instanceof OptionDescription)) {
+ return 1;
+ }
+ if (o.value instanceof OptionDescription && !(value instanceof OptionDescription)) {
+ return -1;
+ }
+
+ if (value instanceof ActionWrapper && o.value instanceof ActionWrapper && ApplicationManager.getApplication().isDispatchThread()) {
+ boolean p1Enable = ((ActionWrapper)value).isAvailable();
+ boolean p2enable = ((ActionWrapper)o.value).isAvailable();
+ if (p1Enable && !p2enable) return -1;
+ if (!p1Enable && p2enable) return 1;
+ }
+
+ int diff = o.getMatchingDegree() - getMatchingDegree();
+ //noinspection unchecked
+ return diff != 0 ? diff : value.compareTo(o.value);
+ }
+ }
+
@Override
public ListCellRenderer getListCellRenderer() {
return new DefaultListCellRenderer() {
@Override
public Component getListCellRendererComponent(@NotNull final JList list,
- final Object value,
+ final Object matchedValue,
final int index, final boolean isSelected, final boolean cellHasFocus) {
final JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(IdeBorderFactory.createEmptyBorder(2));
@@ -165,21 +205,40 @@
Color bg = UIUtil.getListBackground(isSelected);
panel.setBackground(bg);
+ if (matchedValue instanceof String) { //...
+ final JBLabel label = new JBLabel((String)matchedValue);
+ label.setIcon(EMPTY_ICON);
+ panel.add(label, BorderLayout.WEST);
+ return panel;
+ }
+
Color groupFg = isSelected ? UIUtil.getListSelectionForeground() : UIUtil.getLabelDisabledForeground();
+ Object value = ((MatchedValue) matchedValue).value;
+ String pattern = ((MatchedValue)matchedValue).pattern;
+
+ SimpleColoredComponent nameComponent = new SimpleColoredComponent();
+ nameComponent.setBackground(bg);
+ panel.add(nameComponent, BorderLayout.CENTER);
+
if (value instanceof ActionWrapper) {
final ActionWrapper actionWithParentGroup = (ActionWrapper)value;
final AnAction anAction = actionWithParentGroup.getAction();
final Presentation templatePresentation = anAction.getTemplatePresentation();
- final Icon icon = templatePresentation.getIcon();
final Color fg = defaultActionForeground(isSelected, actionWithParentGroup.getPresentation());
- final JLabel actionLabel = createActionLabel(anAction, templatePresentation.getText(), fg, bg, icon);
- panel.add(actionLabel, BorderLayout.WEST);
+ panel.add(createIconLabel(templatePresentation.getIcon()), BorderLayout.WEST);
- final String groupName = actionWithParentGroup.getGroupName();
+ appendWithColoredMatches(nameComponent, templatePresentation.getText(), pattern, fg, isSelected);
+
+ final Shortcut shortcut = preferKeyboardShortcut(KeymapManager.getInstance().getActiveKeymap().getShortcuts(getActionId(anAction)));
+ if (shortcut != null) {
+ nameComponent.append(" (" + KeymapUtil.getShortcutText(shortcut) + ")", new SimpleTextAttributes(STYLE_PLAIN, groupFg));
+ }
+
+ String groupName = actionWithParentGroup.getAction() instanceof ApplyIntentionAction ? null : actionWithParentGroup.getGroupName();
if (groupName != null) {
final JLabel groupLabel = new JLabel(groupName);
groupLabel.setBackground(bg);
@@ -189,7 +248,9 @@
}
else if (value instanceof OptionDescription) {
if (!isSelected) {
- panel.setBackground(UIUtil.isUnderDarcula() ? ColorUtil.brighter(UIUtil.getListBackground(), 1) : LightColors.SLIGHTLY_GRAY);
+ Color descriptorBg = UIUtil.isUnderDarcula() ? ColorUtil.brighter(UIUtil.getListBackground(), 1) : LightColors.SLIGHTLY_GRAY;
+ panel.setBackground(descriptorBg);
+ nameComponent.setBackground(descriptorBg);
}
String hit = ((OptionDescription)value).getHit();
if (hit == null) {
@@ -200,23 +261,31 @@
hit = hit.replace(" ", " "); //avoid extra spaces from mnemonics and xml conversion
final Color fg = UIUtil.getListForeground(isSelected);
- final JLabel label = new JLabel(hit.trim());
- label.setIcon(EMPTY_ICON);
- label.setForeground(fg);
- label.setBackground(bg);
- panel.add(label, BorderLayout.WEST);
+
+ appendWithColoredMatches(nameComponent, hit.trim(), pattern, fg, isSelected);
+
+ panel.add(new JLabel(EMPTY_ICON), BorderLayout.WEST);
+
final JLabel settingsLabel = new JLabel(getGroupName((OptionDescription)value));
settingsLabel.setForeground(groupFg);
settingsLabel.setBackground(bg);
panel.add(settingsLabel, BorderLayout.EAST);
}
- else if (value instanceof String) {
- final JBLabel label = new JBLabel((String)value);
- label.setIcon(EMPTY_ICON);
- panel.add(label, BorderLayout.WEST);
- }
return panel;
}
+
+ private void appendWithColoredMatches(SimpleColoredComponent nameComponent, String name, String pattern, Color fg, boolean selected) {
+ final SimpleTextAttributes plain = new SimpleTextAttributes(STYLE_PLAIN, fg);
+ final SimpleTextAttributes highlighted = new SimpleTextAttributes(null, fg, null, STYLE_SEARCH_MATCH);
+ List<TextRange> fragments = ContainerUtil.newArrayList();
+ if (selected) {
+ int matchStart = StringUtil.indexOfIgnoreCase(name, pattern, 0);
+ if (matchStart >= 0) {
+ fragments.add(TextRange.from(matchStart, pattern.length()));
+ }
+ }
+ SpeedSearchUtil.appendColoredFragments(nameComponent, name, fragments, plain, highlighted);
+ }
};
}
@@ -224,6 +293,18 @@
return myActionManager.getId(anAction);
}
+ private static JLabel createIconLabel(final Icon icon) {
+ final LayeredIcon layeredIcon = new LayeredIcon(2);
+ layeredIcon.setIcon(EMPTY_ICON, 0);
+ if (icon != null && icon.getIconWidth() <= EMPTY_ICON.getIconWidth() && icon.getIconHeight() <= EMPTY_ICON.getIconHeight()) {
+ layeredIcon
+ .setIcon(icon, 1, (-icon.getIconWidth() + EMPTY_ICON.getIconWidth()) / 2, (EMPTY_ICON.getIconHeight() - icon.getIconHeight()) / 2);
+ }
+
+ return new JLabel(layeredIcon);
+ }
+
+
protected JLabel createActionLabel(final AnAction anAction, final String anActionName,
final Color fg, final Color bg,
final Icon icon) {
@@ -256,23 +337,7 @@
public int compare(@NotNull Object o1, @NotNull Object o2) {
if (ChooseByNameBase.EXTRA_ELEM.equals(o1)) return 1;
if (ChooseByNameBase.EXTRA_ELEM.equals(o2)) return -1;
-
- if (o1 instanceof OptionDescription && !(o2 instanceof OptionDescription)) {
- return 1;
- }
- if (o2 instanceof OptionDescription && !(o1 instanceof OptionDescription)) {
- return -1;
- }
-
- if (o1 instanceof OptionDescription) {
- return ((OptionDescription)o1).compareTo(o2);
- }
-
- if (o1 instanceof ActionWrapper && o2 instanceof ActionWrapper) {
- return ((ActionWrapper)o1).compareTo((ActionWrapper)o2);
- }
-
- return StringUtil.compare(getFullName(o1), getFullName(o2), true);
+ return ((MatchedValue) o1).compareTo((MatchedValue)o2);
}
public static AnActionEvent updateActionBeforeShow(AnAction anAction, DataContext dataContext) {
@@ -293,107 +358,17 @@
@Override
@NotNull
public String[] getNames(boolean checkBoxState) {
- final LinkedHashSet<String> result = new LinkedHashSet<String>();
- result.add(INTENTIONS_KEY);
- for (AnAction action : myActionsMap.keySet()) {
- result.add(getActionId(action));
- }
- if (checkBoxState) {
- final Set<String> ids = ((ActionManagerImpl)myActionManager).getActionIds();
- for (String id : ids) {
- result.add(id);
- }
- }
- result.add(SETTINGS_KEY);
- return ArrayUtil.toStringArray(result);
+ return ArrayUtil.EMPTY_STRING_ARRAY;
}
@Override
@NotNull
public Object[] getElementsByName(final String id, final boolean checkBoxState, final String pattern) {
- List<Object> objects = new ArrayList<Object>();
- final AnAction act = myActionManager.getAction(id);
- DataContext dataContext = DataManager.getInstance().getDataContext(myContextComponent);
- if (act != null) {
- final HashMap<AnAction, String> map = new HashMap<AnAction, String>();
- final MatchMode matchMode = actionMatches(pattern, act);
- final String groupName = myActionsMap.get(act);
- if (map.put(act, groupName) == null) {
- objects.add(new ActionWrapper(act, groupName, matchMode, dataContext));
- }
- if (checkBoxState) {
- final Set<String> ids = ((ActionManagerImpl)myActionManager).getActionIds();
- for (AnAction action : map.keySet()) { //do not add already included actions
- ids.remove(getActionId(action));
- }
- if (ids.contains(id)) {
- final AnAction anAction = myActionManager.getAction(id);
- map.put(anAction, null);
- if (anAction != null) {
- objects.add(new ActionWrapper(anAction, null, MatchMode.NON_MENU, dataContext));
- }
- }
- }
- } else if (Comparing.strEqual(id, INTENTIONS_KEY)) {
- for (String intentionText : myIntentions.keySet()) {
- final ApplyIntentionAction intentionAction = myIntentions.get(intentionText);
- if (actionMatches(pattern, intentionAction) != MatchMode.NONE) {
- objects.add(new ActionWrapper(intentionAction, intentionText, MatchMode.INTENTION, dataContext));
- }
- }
- }
- if (Comparing.strEqual(id, SETTINGS_KEY)) {
- final Set<String> words = myIndex.getProcessedWords(pattern);
- Set<OptionDescription> optionDescriptions = null;
- final String actionManagerName = myActionManager.getComponentName();
- for (String word : words) {
- final Set<OptionDescription> descriptions = ((SearchableOptionsRegistrarImpl)myIndex).getAcceptableDescriptions(word);
- if (descriptions != null) {
- for (Iterator<OptionDescription> iterator = descriptions.iterator(); iterator.hasNext(); ) {
- OptionDescription description = iterator.next();
- if (actionManagerName.equals(description.getPath())) {
- iterator.remove();
- }
- }
- if (!descriptions.isEmpty()) {
- if (optionDescriptions == null) {
- optionDescriptions = descriptions;
- }
- else {
- optionDescriptions.retainAll(descriptions);
- }
- }
- } else {
- optionDescriptions = null;
- break;
- }
- }
- if (optionDescriptions != null && !optionDescriptions.isEmpty()) {
- Set<String> currentHits = new HashSet<String>();
- for (Iterator<OptionDescription> iterator = optionDescriptions.iterator(); iterator.hasNext(); ) {
- OptionDescription description = iterator.next();
- final String hit = description.getHit();
- if (hit == null || !currentHits.add(hit.trim())) {
- iterator.remove();
- }
- }
- for (OptionDescription description : optionDescriptions) {
- for (ActionFromOptionDescriptorProvider converter : ActionFromOptionDescriptorProvider.EP.getExtensions()) {
- AnAction action = converter.provide(description);
- if (action != null) {
- String title = getGroupName(description);
- objects.add(new ActionWrapper(action, title, MatchMode.NAME, dataContext));
- }
- objects.add(description);
- }
- }
- }
- }
- return objects.toArray(new Object[objects.size()]);
+ return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
@NotNull
- private String getGroupName(@NotNull OptionDescription description) {
+ String getGroupName(@NotNull OptionDescription description) {
String id = description.getConfigurableId();
String name = myConfigurablesNames.get(id);
String settings = SystemInfo.isMac ? "Preferences" : "Settings";
@@ -459,10 +434,8 @@
}
@Override
- public String getElementName(final Object element) {
- if (element instanceof OptionDescription) return ((OptionDescription)element).getHit();
- if (!(element instanceof ActionWrapper)) return null;
- return ((ActionWrapper)element).getAction().getTemplatePresentation().getText();
+ public String getElementName(final Object mv) {
+ return ((MatchedValue) mv).getValueText();
}
@Override
@@ -485,7 +458,10 @@
return MatchMode.DESCRIPTION;
}
final String groupName = myActionsMap.get(anAction);
- return groupName != null && text != null && matcher.matches(groupName + " " + text, compiledPattern) ? MatchMode.GROUP : MatchMode.NONE;
+ if (groupName == null) {
+ return text != null && matcher.matches(text, compiledPattern) ? MatchMode.NON_MENU : MatchMode.NONE;
+ }
+ return text != null && matcher.matches(groupName + " " + text, compiledPattern) ? MatchMode.GROUP : MatchMode.NONE;
}
@Nullable
@@ -498,7 +474,7 @@
}
@NotNull
- private Pattern getPattern(@NotNull String pattern) {
+ Pattern getPattern(@NotNull String pattern) {
String converted = convertPattern(pattern.trim());
Pattern compiledPattern = myCompiledPattern;
if (compiledPattern != null && !Comparing.strEqual(converted, compiledPattern.getPattern())) {
@@ -528,7 +504,7 @@
NONE, INTENTION, NAME, DESCRIPTION, GROUP, NON_MENU
}
- private static String convertPattern(String pattern) {
+ static String convertPattern(String pattern) {
final int eol = pattern.indexOf('\n');
if (eol != -1) {
pattern = pattern.substring(0, eol);
@@ -632,7 +608,7 @@
return new Perl5Matcher();
}
};
- private PatternMatcher getMatcher() {
+ PatternMatcher getMatcher() {
return myMatcher.get();
}
@@ -660,20 +636,13 @@
@Override
public int compareTo(@NotNull ActionWrapper o) {
- if (ApplicationManager.getApplication().isDispatchThread()) {
- boolean p1Enable = visible();
- boolean p2enable = o.visible();
- if (p1Enable && !p2enable) return -1;
- if (!p1Enable && p2enable) return 1;
- }
-
int compared = myMode.compareTo(o.getMode());
return compared != 0
? compared
: StringUtil.compare(myAction.getTemplatePresentation().getText(), o.getAction().getTemplatePresentation().getText(), true);
}
- private boolean visible() {
+ private boolean isAvailable() {
return getPresentation().isEnabledAndVisible();
}
diff --git a/platform/lang-impl/src/com/intellij/injected/editor/InjectedCaret.java b/platform/lang-impl/src/com/intellij/injected/editor/InjectedCaret.java
index 19651a7..e52fa66 100644
--- a/platform/lang-impl/src/com/intellij/injected/editor/InjectedCaret.java
+++ b/platform/lang-impl/src/com/intellij/injected/editor/InjectedCaret.java
@@ -15,17 +15,14 @@
*/
package com.intellij.injected.editor;
-import com.intellij.openapi.editor.Caret;
-import com.intellij.openapi.editor.CaretModel;
-import com.intellij.openapi.editor.LogicalPosition;
-import com.intellij.openapi.editor.VisualPosition;
+import com.intellij.openapi.editor.*;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.ProperTextRange;
import com.intellij.openapi.util.TextRange;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-class InjectedCaret implements Caret {
+public class InjectedCaret implements Caret {
private final EditorWindow myEditorWindow;
final Caret myDelegate;
@@ -36,10 +33,20 @@
@NotNull
@Override
+ public Editor getEditor() {
+ return myEditorWindow;
+ }
+
+ @NotNull
+ @Override
public CaretModel getCaretModel() {
return myEditorWindow.getCaretModel();
}
+ public Caret getDelegate() {
+ return myDelegate;
+ }
+
@Override
public boolean isValid() {
return myDelegate.isValid();
diff --git a/platform/lang-impl/src/com/intellij/internal/DumpDirectoryInfoAction.java b/platform/lang-impl/src/com/intellij/internal/DumpDirectoryInfoAction.java
index b5d0ae16..2f278bb 100644
--- a/platform/lang-impl/src/com/intellij/internal/DumpDirectoryInfoAction.java
+++ b/platform/lang-impl/src/com/intellij/internal/DumpDirectoryInfoAction.java
@@ -18,14 +18,12 @@
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
-import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ContentIterator;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.roots.impl.DirectoryIndex;
-import com.intellij.openapi.roots.impl.DirectoryInfo;
import com.intellij.openapi.vfs.VirtualFile;
/**
@@ -53,10 +51,7 @@
public boolean processFile(VirtualFile fileOrDir) {
LOG.info(fileOrDir.getPath());
- final DirectoryInfo directoryInfo = index.getInfoForDirectory(fileOrDir);
- if (directoryInfo != null) {
- LOG.info(directoryInfo.toString());
- }
+ LOG.info(index.getInfoForFile(fileOrDir).toString());
return true;
}
};
diff --git a/platform/lang-impl/src/com/intellij/internal/DumpVfsInfoForExcludedFilesAction.java b/platform/lang-impl/src/com/intellij/internal/DumpVfsInfoForExcludedFilesAction.java
new file mode 100644
index 0000000..c4fb34c
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/internal/DumpVfsInfoForExcludedFilesAction.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2000-2014 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.internal;
+
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleManager;
+import com.intellij.openapi.project.DumbAwareAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ModuleRootManager;
+import com.intellij.openapi.roots.impl.DirectoryIndexExcludePolicy;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.VirtualFileManager;
+import com.intellij.openapi.vfs.newvfs.NewVirtualFile;
+import com.intellij.openapi.vfs.newvfs.persistent.FSRecords;
+import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS;
+
+import java.util.*;
+
+/**
+ * @author nik
+ */
+@SuppressWarnings("UseOfSystemOutOrSystemErr")
+public class DumpVfsInfoForExcludedFilesAction extends DumbAwareAction {
+ public DumpVfsInfoForExcludedFilesAction() {
+ super("Dump VFS content for files under excluded roots");
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ Project project = e.getProject();
+ if (project == null) return;
+
+ Set<String> excludeRoots = new HashSet<String>();
+ for (Module module : ModuleManager.getInstance(project).getModules()) {
+ Collections.addAll(excludeRoots, ModuleRootManager.getInstance(module).getExcludeRootUrls());
+ }
+ for (DirectoryIndexExcludePolicy policy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(project)) {
+ for (VirtualFile file : policy.getExcludeRootsForProject()) {
+ excludeRoots.add(file.getUrl());
+ }
+ }
+
+ if (excludeRoots.isEmpty()) {
+ System.out.println("No excluded roots found in project.");
+ }
+
+ for (String root : excludeRoots) {
+ VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(root);
+ if (file == null) {
+ System.out.println(root + " not in VFS");
+ continue;
+ }
+ dumpChildrenInDbRecursively(file, 0);
+ }
+ }
+
+ private static void dumpChildrenInDbRecursively(VirtualFile dir, int depth) {
+ if (!(dir instanceof NewVirtualFile)) {
+ System.out.println(dir.getPresentableUrl() + ": not in db (" + dir.getClass().getName() + ")");
+ return;
+ }
+
+ List<VirtualFile> dirs = new ArrayList<VirtualFile>();
+ int inDb = 0, contentInDb = 0, nullChildren = 0;
+ PersistentFS persistentFS = PersistentFS.getInstance();
+ if (persistentFS.wereChildrenAccessed(dir)) {
+ for (String name : persistentFS.listPersisted(dir)) {
+ inDb++;
+ NewVirtualFile child = ((NewVirtualFile)dir).refreshAndFindChild(name);
+ if (child == null) {
+ nullChildren++;
+ continue;
+ }
+ if (child.isDirectory()) {
+ dirs.add(child);
+ }
+ else if (FSRecords.getContentId(child.getId()) != 0) {
+ contentInDb++;
+ }
+ }
+ }
+ System.out.print(dir.getPresentableUrl() + ": " + inDb + " children in db");
+ if (contentInDb > 0) {
+ System.out.print(", content of " + contentInDb + " files in db");
+ }
+ if (nullChildren > 0) {
+ System.out.print(", " + nullChildren + " invalid files in db");
+ }
+ System.out.println();
+
+ if (depth > 10) {
+ System.out.println("too deep, skipping children");
+ }
+ else {
+ for (VirtualFile childDir : dirs) {
+ dumpChildrenInDbRecursively(childDir, depth+1);
+ }
+ }
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/lang/parser/GeneratedParserUtilBase.java b/platform/lang-impl/src/com/intellij/lang/parser/GeneratedParserUtilBase.java
index ecda31d..ad322c23 100644
--- a/platform/lang-impl/src/com/intellij/lang/parser/GeneratedParserUtilBase.java
+++ b/platform/lang-impl/src/com/intellij/lang/parser/GeneratedParserUtilBase.java
@@ -2,6 +2,7 @@
// Do not modify or refactor without complete investigation and/or review.
package com.intellij.lang.parser;
+import com.intellij.codeInsight.completion.impl.CamelHumpMatcher;
import com.intellij.lang.*;
import com.intellij.lang.impl.PsiBuilderAdapter;
import com.intellij.lang.impl.PsiBuilderImpl;
@@ -337,18 +338,18 @@
}
else if (diff > 0 && diff <= length) {
CharSequence fragment = builder_.getOriginalText().subSequence(offset, completionState.offset);
- add = StringUtil.startsWithIgnoreCase(text, fragment.toString());
+ add = completionState.prefixMatches(fragment.toString(), text);
}
else if (diff < 0) {
for (int i=-1; ; i--) {
IElementType type = builder_.rawLookup(i);
int tokenStart = builder_.rawTokenTypeStart(i);
- if (((PsiBuilderImpl)((Builder)builder_).getDelegate()).whitespaceOrComment(type)) {
+ if (isWhitespaceOrComment(builder_, type)) {
diff = completionState.offset - tokenStart;
}
else if (type != null && tokenStart < completionState.offset) {
CharSequence fragment = builder_.getOriginalText().subSequence(tokenStart, completionState.offset);
- if (StringUtil.startsWithIgnoreCase(text, fragment.toString())) {
+ if (completionState.prefixMatches(fragment.toString(), text)) {
diff = completionState.offset - tokenStart;
}
break;
@@ -364,6 +365,10 @@
}
}
+ public static boolean isWhitespaceOrComment(@NotNull PsiBuilder builder_, @Nullable IElementType type) {
+ return ((PsiBuilderImpl)((Builder)builder_).getDelegate()).whitespaceOrComment(type);
+ }
+
// here's the new section API for compact parsers & less IntelliJ platform API exposure
public static final int _NONE_ = 0x0;
public static final int _COLLAPSE_ = 0x1;
@@ -514,7 +519,9 @@
}
// propagate errorReportedAt up the stack to avoid duplicate reporting
Frame prevFrame = willFail && eatMore == null ? null : state.frameStack.peekLast();
- if (prevFrame != null && prevFrame.errorReportedAt < frame.errorReportedAt) prevFrame.errorReportedAt = frame.errorReportedAt;
+ if (prevFrame != null && prevFrame.errorReportedAt < frame.errorReportedAt) {
+ prevFrame.errorReportedAt = frame.errorReportedAt;
+ }
state.FRAMES.recycle(frame);
}
@@ -657,9 +664,17 @@
return o.toString();
}
- public void addItem(PsiBuilder builder, String text) {
+ public void addItem(@NotNull PsiBuilder builder, @NotNull String text) {
items.add(text);
}
+
+ public boolean prefixMatches(@NotNull String prefix, @NotNull String variant) {
+ boolean matches = new CamelHumpMatcher(prefix, false).prefixMatches(variant.replace(' ', '_'));
+ if (matches && StringUtil.isWhiteSpace(prefix.charAt(prefix.length() - 1))) {
+ return StringUtil.startsWithIgnoreCase(variant, prefix);
+ }
+ return matches;
+ }
}
public static class Builder extends PsiBuilderAdapter {
diff --git a/platform/lang-impl/src/com/intellij/openapi/diff/impl/settings/DiffPreviewProvider.java b/platform/lang-impl/src/com/intellij/openapi/diff/impl/settings/DiffPreviewProvider.java
index 7aa83ad..1de4d4a 100644
--- a/platform/lang-impl/src/com/intellij/openapi/diff/impl/settings/DiffPreviewProvider.java
+++ b/platform/lang-impl/src/com/intellij/openapi/diff/impl/settings/DiffPreviewProvider.java
@@ -66,7 +66,7 @@
" long value;\n" +
"\n" +
" void foo() {\n" +
- " // Left changes\n" +
+ " // Right changes\n" +
" }\n" +
"\n" +
" void removedFromLeft() {}\n" +
diff --git a/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectAllOccurrencesAction.java b/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectAllOccurrencesAction.java
index d135b52..3e284ff6 100644
--- a/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectAllOccurrencesAction.java
+++ b/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectAllOccurrencesAction.java
@@ -15,9 +15,9 @@
*/
package com.intellij.openapi.editor.actions;
-import com.intellij.find.FindManager;
-import com.intellij.find.FindModel;
-import com.intellij.find.FindResult;
+import com.intellij.find.*;
+import com.intellij.find.editorHeaderActions.EditorHeaderAction;
+import com.intellij.find.editorHeaderActions.SelectAllAction;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.editor.Editor;
@@ -27,6 +27,8 @@
import com.intellij.openapi.util.TextRange;
import org.jetbrains.annotations.Nullable;
+import java.util.Iterator;
+
public class SelectAllOccurrencesAction extends EditorAction {
protected SelectAllOccurrencesAction() {
super(new Handler());
@@ -39,7 +41,9 @@
}
@Override
- public void doExecute(Editor editor, @Nullable Caret c, DataContext dataContext) {
+ public void doExecute(final Editor editor, @Nullable Caret c, DataContext dataContext) {
+ if (executeEquivalentFindPanelAction(editor, dataContext)) return;
+
Caret caret = c == null ? editor.getCaretModel().getPrimaryCaret() : c;
boolean wholeWordsSearch = false;
@@ -58,25 +62,36 @@
}
int caretShiftFromSelectionStart = caret.getOffset() - caret.getSelectionStart();
- FindManager findManager = FindManager.getInstance(project);
+ final FindManager findManager = FindManager.getInstance(project);
- FindModel model = new FindModel();
- model.setStringToFind(selectedText);
- model.setCaseSensitive(true);
- model.setWholeWordsOnly(wholeWordsSearch);
+ final FindModel model = getFindModel(selectedText, wholeWordsSearch);
- int searchStartOffset = 0;
- FindResult findResult = findManager.findString(editor.getDocument().getCharsSequence(), searchStartOffset, model);
- while (findResult.isStringFound()) {
- int newCaretOffset = caretShiftFromSelectionStart + findResult.getStartOffset();
- EditorActionUtil.makePositionVisible(editor, newCaretOffset);
- Caret newCaret = editor.getCaretModel().addCaret(editor.offsetToVisualPosition(newCaretOffset));
- if (newCaret != null) {
- setSelection(editor, newCaret, findResult);
+ FindUtil.selectSearchResultsInEditor(editor, new Iterator<FindResult>() {
+ FindResult findResult = findManager.findString(editor.getDocument().getCharsSequence(), 0, model);
+
+ @Override
+ public boolean hasNext() {
+ return findResult.isStringFound();
}
- findResult = findManager.findString(editor.getDocument().getCharsSequence(), findResult.getEndOffset(), model);
- }
+
+ @Override
+ public FindResult next() {
+ FindResult result = findResult;
+ findResult = findManager.findString(editor.getDocument().getCharsSequence(), findResult.getEndOffset(), model);
+ return result;
+ }
+
+ @Override
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ }, caretShiftFromSelectionStart);
editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
}
+
+ @Override
+ protected EditorHeaderAction getEquivalentFindPanelAction(EditorSearchComponent searchComponent) {
+ return new SelectAllAction(searchComponent);
+ }
}
}
diff --git a/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectNextOccurrenceAction.java b/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectNextOccurrenceAction.java
index cc4783b..7d3c408 100644
--- a/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectNextOccurrenceAction.java
+++ b/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectNextOccurrenceAction.java
@@ -15,9 +15,9 @@
*/
package com.intellij.openapi.editor.actions;
-import com.intellij.find.FindManager;
-import com.intellij.find.FindModel;
-import com.intellij.find.FindResult;
+import com.intellij.find.*;
+import com.intellij.find.editorHeaderActions.AddOccurrenceAction;
+import com.intellij.find.editorHeaderActions.EditorHeaderAction;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.editor.Editor;
@@ -40,6 +40,8 @@
@Override
public void doExecute(Editor editor, @Nullable Caret c, DataContext dataContext) {
+ if (executeEquivalentFindPanelAction(editor, dataContext)) return;
+
Caret caret = c == null ? editor.getCaretModel().getPrimaryCaret() : c;
TextRange wordSelectionRange = getSelectionRange(editor, caret);
boolean notFoundPreviously = getAndResetNotFoundStatus(editor);
@@ -52,26 +54,21 @@
}
FindManager findManager = FindManager.getInstance(project);
- FindModel model = new FindModel();
- model.setStringToFind(selectedText);
- model.setCaseSensitive(true);
- model.setWholeWordsOnly(wholeWordSearch);
+ FindModel model = getFindModel(selectedText, wholeWordSearch);
+
+ findManager.setFindWasPerformed();
+ findManager.setFindNextModel(model);
int searchStartOffset = notFoundPreviously ? 0 : caret.getSelectionEnd();
FindResult findResult = findManager.findString(editor.getDocument().getCharsSequence(), searchStartOffset, model);
if (findResult.isStringFound()) {
- int newCaretOffset = caret.getOffset() - caret.getSelectionStart() + findResult.getStartOffset();
- EditorActionUtil.makePositionVisible(editor, newCaretOffset);
- Caret newCaret = editor.getCaretModel().addCaret(editor.offsetToVisualPosition(newCaretOffset));
- if (newCaret == null) {
+ boolean caretAdded = FindUtil.selectSearchResultInEditor(editor, findResult, caret.getOffset() - caret.getSelectionStart());
+ if (!caretAdded) {
// this means that the found occurence is already selected
if (notFoundPreviously) {
setNotFoundStatus(editor); // to make sure we won't show hint anymore if there are no more occurrences
}
}
- else {
- setSelection(editor, newCaret, findResult);
- }
}
else {
setNotFoundStatus(editor);
@@ -87,5 +84,10 @@
}
editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
}
+
+ @Override
+ protected EditorHeaderAction getEquivalentFindPanelAction(EditorSearchComponent searchComponent) {
+ return new AddOccurrenceAction(searchComponent);
+ }
}
}
diff --git a/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectOccurrencesActionHandler.java b/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectOccurrencesActionHandler.java
index c43eae7..7b18928 100644
--- a/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectOccurrencesActionHandler.java
+++ b/platform/lang-impl/src/com/intellij/openapi/editor/actions/SelectOccurrencesActionHandler.java
@@ -19,8 +19,11 @@
import com.intellij.codeInsight.hint.HintManager;
import com.intellij.codeInsight.hint.HintManagerImpl;
import com.intellij.codeInsight.hint.HintUtil;
+import com.intellij.find.EditorSearchComponent;
import com.intellij.find.FindBundle;
-import com.intellij.openapi.actionSystem.IdeActions;
+import com.intellij.find.FindModel;
+import com.intellij.find.editorHeaderActions.EditorHeaderAction;
+import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorLastActionTracker;
@@ -28,13 +31,24 @@
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.TextRange;
import com.intellij.ui.LightweightHint;
+import com.intellij.util.containers.HashSet;
import org.jetbrains.annotations.Nullable;
+import java.util.Arrays;
+import java.util.Set;
+
abstract public class SelectOccurrencesActionHandler extends EditorActionHandler {
private static final Key<Boolean> NOT_FOUND = Key.create("select.next.occurence.not.found");
private static final Key<Boolean> WHOLE_WORDS = Key.create("select.next.occurence.whole.words");
+ private static final Set<String> SELECT_ACTIONS = new HashSet<String>(Arrays.asList(
+ IdeActions.ACTION_SELECT_NEXT_OCCURENCE,
+ IdeActions.ACTION_UNSELECT_PREVIOUS_OCCURENCE,
+ IdeActions.ACTION_FIND_NEXT,
+ IdeActions.ACTION_FIND_PREVIOUS
+ ));
+
protected static void setSelection(Editor editor, Caret caret, TextRange selectionRange) {
EditorActionUtil.makePositionVisible(editor, selectionRange.getStartOffset());
EditorActionUtil.makePositionVisible(editor, selectionRange.getEndOffset());
@@ -83,6 +97,35 @@
protected static boolean isRepeatedActionInvocation() {
String lastActionId = EditorLastActionTracker.getInstance().getLastActionId();
- return IdeActions.ACTION_SELECT_NEXT_OCCURENCE.equals(lastActionId) || IdeActions.ACTION_UNSELECT_PREVIOUS_OCCURENCE.equals(lastActionId);
+ return SELECT_ACTIONS.contains(lastActionId);
+ }
+
+ protected static FindModel getFindModel(String text, boolean wholeWords) {
+ FindModel model = new FindModel();
+ model.setStringToFind(text);
+ model.setCaseSensitive(true);
+ model.setWholeWordsOnly(wholeWords);
+ return model;
+ }
+
+ protected boolean executeEquivalentFindPanelAction(Editor editor, DataContext context) {
+ if (editor.getHeaderComponent() instanceof EditorSearchComponent) {
+ EditorSearchComponent searchComponent = (EditorSearchComponent)editor.getHeaderComponent();
+ EditorHeaderAction action = getEquivalentFindPanelAction(searchComponent);
+ if (action != null) {
+ Presentation presentation = new Presentation();
+ AnActionEvent event = new AnActionEvent(null, context, ActionPlaces.MAIN_MENU, presentation, ActionManager.getInstance(), 0);
+ action.update(event);
+ if (presentation.isEnabled()) {
+ action.actionPerformed(event);
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ protected EditorHeaderAction getEquivalentFindPanelAction(EditorSearchComponent searchComponent) {
+ return null;
}
}
diff --git a/platform/lang-impl/src/com/intellij/openapi/editor/actions/UnselectPreviousOccurrenceAction.java b/platform/lang-impl/src/com/intellij/openapi/editor/actions/UnselectPreviousOccurrenceAction.java
index a5657ff8..fffff56 100644
--- a/platform/lang-impl/src/com/intellij/openapi/editor/actions/UnselectPreviousOccurrenceAction.java
+++ b/platform/lang-impl/src/com/intellij/openapi/editor/actions/UnselectPreviousOccurrenceAction.java
@@ -15,6 +15,9 @@
*/
package com.intellij.openapi.editor.actions;
+import com.intellij.find.EditorSearchComponent;
+import com.intellij.find.editorHeaderActions.EditorHeaderAction;
+import com.intellij.find.editorHeaderActions.RemoveOccurrenceAction;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.editor.Editor;
@@ -35,6 +38,8 @@
@Override
public void doExecute(Editor editor, @Nullable Caret caret, DataContext dataContext) {
+ if (executeEquivalentFindPanelAction(editor, dataContext)) return;
+
if (editor.getCaretModel().getCaretCount() > 1) {
editor.getCaretModel().removeCaret(editor.getCaretModel().getPrimaryCaret());
}
@@ -44,5 +49,10 @@
getAndResetNotFoundStatus(editor);
editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
}
+
+ @Override
+ protected EditorHeaderAction getEquivalentFindPanelAction(EditorSearchComponent searchComponent) {
+ return new RemoveOccurrenceAction(searchComponent);
+ }
}
}
diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java b/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java
index 2f5485d..b138568 100644
--- a/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java
+++ b/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java
@@ -149,12 +149,19 @@
@Override
public DirectoryInfo getInfoForDirectory(@NotNull VirtualFile dir) {
+ DirectoryInfo info = getInfoForFile(dir);
+ return info.isInProject() ? info : null;
+ }
+
+ @NotNull
+ @Override
+ public DirectoryInfo getInfoForFile(@NotNull VirtualFile file) {
checkAvailability();
dispatchPendingEvents();
- if (!(dir instanceof NewVirtualFile)) return null;
+ if (!(file instanceof NewVirtualFile)) return NonProjectDirectoryInfo.NOT_SUPPORTED_VIRTUAL_FILE_IMPLEMENTATION;
- return getRootIndex().getInfoForDirectory(dir);
+ return getRootIndex().getInfoForFile(file);
}
@Override
@@ -167,22 +174,6 @@
}
@Override
- public boolean isProjectExcludeRoot(@NotNull VirtualFile dir) {
- checkAvailability();
- if (!(dir instanceof NewVirtualFile)) return false;
-
- return getRootIndex().isProjectExcludeRoot(dir);
- }
-
- @Override
- public boolean isModuleExcludeRoot(@NotNull VirtualFile dir) {
- checkAvailability();
- if (!(dir instanceof NewVirtualFile)) return false;
-
- return getRootIndex().isModuleExcludeRoot(dir);
- }
-
- @Override
public String getPackageName(@NotNull VirtualFile dir) {
checkAvailability();
if (!(dir instanceof NewVirtualFile)) return null;
diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdater.java b/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java
similarity index 91%
rename from platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdater.java
rename to platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java
index cb4b940..a96432e 100644
--- a/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdater.java
+++ b/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java
@@ -53,7 +53,7 @@
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
-public class PushedFilePropertiesUpdater {
+public class PushedFilePropertiesUpdaterImpl extends PushedFilePropertiesUpdater {
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.roots.impl.PushedFilePropertiesUpdater");
private final Project myProject;
@@ -62,12 +62,7 @@
private final Queue<Runnable> myTasks = new ConcurrentLinkedQueue<Runnable>();
private final MessageBusConnection myConnection;
- @NotNull
- public static PushedFilePropertiesUpdater getInstance(Project project) {
- return project.getComponent(PushedFilePropertiesUpdater.class);
- }
-
- public PushedFilePropertiesUpdater(final Project project) {
+ public PushedFilePropertiesUpdaterImpl(final Project project) {
myProject = project;
myPushers = Extensions.getExtensions(FilePropertyPusher.EP_NAME);
myFilePushers = ContainerUtil.findAllAsArray(myPushers, new Condition<FilePropertyPusher>() {
@@ -122,22 +117,24 @@
});
}
+ @Override
public void initializeProperties() {
for (final FilePropertyPusher pusher : myPushers) {
pusher.initExtra(myProject, myProject.getMessageBus(), new FilePropertyPusher.Engine() {
@Override
public void pushAll() {
- PushedFilePropertiesUpdater.this.pushAll(pusher);
+ PushedFilePropertiesUpdaterImpl.this.pushAll(pusher);
}
@Override
public void pushRecursively(VirtualFile file, Project project) {
- PushedFilePropertiesUpdater.this.schedulePushRecursively(file, pusher);
+ PushedFilePropertiesUpdaterImpl.this.schedulePushRecursively(file, pusher);
}
});
}
}
+ @Override
public void pushAllPropertiesNow() {
performPushTasks();
doPushAll(myPushers);
@@ -222,6 +219,7 @@
return projectValue != null ? projectValue : pusher.getDefaultValue();
}
+ @Override
public void pushAll(final FilePropertyPusher... pushers) {
queueTask(new Runnable() {
@Override
@@ -289,7 +287,7 @@
pusher = pushers[i];
if (!isDir && (pusher.pushDirectoriesOnly() || !pusher.acceptsFile(fileOrDir))) continue;
else if (isDir && !pusher.acceptsDirectory(fileOrDir, myProject)) continue;
- findAndUpdateValue(myProject, fileOrDir, pusher, moduleValues != null ? moduleValues[i]:null);
+ findAndUpdateValue(fileOrDir, pusher, moduleValues != null ? moduleValues[i]:null);
}
}
catch (AbstractMethodError ame) { // acceptsDirectory is missed
@@ -298,17 +296,18 @@
}
}
- public static <T> void findAndUpdateValue(final Project project, final VirtualFile fileOrDir, final FilePropertyPusher<T> pusher, final T moduleValue) {
- final T value = findPusherValuesUpwards(project, fileOrDir, pusher, moduleValue);
- updateValue(fileOrDir, value, pusher);
+ @Override
+ public <T> void findAndUpdateValue(final VirtualFile fileOrDir, final FilePropertyPusher<T> pusher, final T moduleValue) {
+ final T value = findPusherValuesUpwards(myProject, fileOrDir, pusher, moduleValue);
+ updateValue(myProject, fileOrDir, value, pusher);
}
- private static <T> void updateValue(final VirtualFile fileOrDir, final T value, final FilePropertyPusher<T> pusher) {
+ private static <T> void updateValue(final Project project, final VirtualFile fileOrDir, final T value, final FilePropertyPusher<T> pusher) {
final T oldValue = fileOrDir.getUserData(pusher.getFileDataKey());
if (value != oldValue) {
fileOrDir.putUserData(pusher.getFileDataKey(), value);
try {
- pusher.persistAttribute(fileOrDir, value);
+ pusher.persistAttribute(project, fileOrDir, value);
}
catch (IOException e) {
LOG.error(e);
@@ -316,7 +315,8 @@
}
}
- public static void filePropertiesChanged(@NotNull final VirtualFile file) {
+ @Override
+ public void filePropertiesChanged(@NotNull final VirtualFile file) {
ApplicationManager.getApplication().assertReadAccessAllowed();
FileBasedIndex.getInstance().requestReindex(file);
for (final Project project : ProjectManager.getInstance().getOpenProjects()) {
@@ -344,6 +344,7 @@
}
}
+ @Override
public void processPendingEvents() {
myConnection.deliverImmediately();
}
diff --git a/platform/lang-impl/src/com/intellij/openapi/util/registry/RegistryUi.java b/platform/lang-impl/src/com/intellij/openapi/util/registry/RegistryUi.java
index 5937af14..0978f8f 100644
--- a/platform/lang-impl/src/com/intellij/openapi/util/registry/RegistryUi.java
+++ b/platform/lang-impl/src/com/intellij/openapi/util/registry/RegistryUi.java
@@ -109,11 +109,11 @@
final RegistryValue value = myModel.getRegistryValue(selected);
String desc = value.getDescription();
if (value.isRestartRequired()) {
- String required = "Requires IDE restart.";
+ String required = " Requires IDE restart.";
if (desc.endsWith(".")) {
desc += required;
} else {
- desc += ". " + required;
+ desc += "." + required;
}
}
myDescriptionLabel.setText(desc);
diff --git a/platform/lang-impl/src/com/intellij/packageDependencies/ui/ProjectPatternProvider.java b/platform/lang-impl/src/com/intellij/packageDependencies/ui/ProjectPatternProvider.java
index 5fd50cf..df0a5ca 100644
--- a/platform/lang-impl/src/com/intellij/packageDependencies/ui/ProjectPatternProvider.java
+++ b/platform/lang-impl/src/com/intellij/packageDependencies/ui/ProjectPatternProvider.java
@@ -27,11 +27,14 @@
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.packageDependencies.DependencyUISettings;
+import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.search.scope.packageSet.FilePatternPackageSet;
import com.intellij.psi.search.scope.packageSet.PackageSet;
@@ -103,7 +106,10 @@
pattern += recursively ? "*/" : "*";
}
}
- return new FilePatternPackageSet(getModulePattern(node), pattern);
+ final VirtualFile vDir = ((DirectoryNode)node).getDirectory();
+ final PsiElement psiElement = node.getPsiElement();
+ final Module module = psiElement != null ? ModuleUtilCore.findModuleForFile(vDir, psiElement.getProject()) : null;
+ return new FilePatternPackageSet(module != null ? module.getName() : null, pattern);
}
else if (node instanceof FileNode) {
if (recursively) return null;
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/AddScopeUtil.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/AddScopeUtil.java
new file mode 100644
index 0000000..d924452
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/AddScopeUtil.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2000-2012 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.
+ */
+
+/*
+ * User: anna
+ * Date: 14-May-2009
+ */
+package com.intellij.profile.codeInspection.ui;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInspection.ex.Descriptor;
+import com.intellij.codeInspection.ex.InspectionProfileImpl;
+import com.intellij.codeInspection.ex.InspectionToolWrapper;
+import com.intellij.codeInspection.ex.ScopeToolState;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionConfigTreeNode;
+import com.intellij.psi.search.scope.packageSet.CustomScopesProviderEx;
+import com.intellij.psi.search.scope.packageSet.NamedScope;
+import com.intellij.psi.search.scope.packageSet.NamedScopesHolder;
+import com.intellij.ui.treeStructure.Tree;
+import com.intellij.ui.treeStructure.treetable.TreeTable;
+import com.intellij.util.ArrayUtil;
+
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+import java.util.*;
+
+public class AddScopeUtil {
+ public static ScopeToolState performAddScope(final TreeTable treeTable,
+ final Project project,
+ final InspectionProfileImpl inspectionProfile,
+ final Collection<InspectionConfigTreeNode> selectedNodes) {
+ final List<InspectionConfigTreeNode> nodes = new ArrayList<InspectionConfigTreeNode>();
+ final List<Descriptor> descriptors = new ArrayList<Descriptor>();
+ for (final InspectionConfigTreeNode node : selectedNodes) {
+ collect(descriptors, nodes, node);
+ }
+
+ final List<String> availableScopes = getAvailableScopes(descriptors, project, inspectionProfile);
+ final int idx = Messages.showChooseDialog(treeTable, "Scope:", "Choose Scope", ArrayUtil.toStringArray(availableScopes), availableScopes.get(0), Messages.getQuestionIcon());
+ if (idx == -1) return null;
+ final NamedScope chosenScope = NamedScopesHolder.getScope(project, availableScopes.get(idx));
+
+ ScopeToolState scopeToolState = null;
+ final Tree tree = treeTable.getTree();
+
+ for (final InspectionConfigTreeNode node : nodes) {
+ final Descriptor descriptor = node.getDefaultDescriptor();
+ final InspectionToolWrapper toolWrapper = descriptor.getToolWrapper().createCopy(); //copy
+ final HighlightDisplayLevel level = inspectionProfile.getErrorLevel(descriptor.getKey(), chosenScope, project);
+ final boolean enabled = inspectionProfile.isToolEnabled(descriptor.getKey());
+ scopeToolState = inspectionProfile.addScope(toolWrapper, chosenScope, level, enabled, project);
+ node.dropCache();
+ ((DefaultTreeModel)tree.getModel()).reload(node);
+ tree.expandPath(new TreePath(node.getPath()));
+ }
+ tree.revalidate();
+ return scopeToolState;
+ }
+
+ private static void collect(final List<Descriptor> descriptors,
+ final List<InspectionConfigTreeNode> nodes,
+ final InspectionConfigTreeNode node) {
+ final ToolDescriptors currentDescriptors = node.getDescriptors();
+ if (currentDescriptors != null) {
+ nodes.add(node);
+ descriptors.add(currentDescriptors.getDefaultDescriptor());
+ descriptors.addAll(currentDescriptors.getNonDefaultDescriptors());
+ } else if (node.getUserObject() instanceof String) {
+ for(int i = 0; i < node.getChildCount(); i++) {
+ final InspectionConfigTreeNode childNode = (InspectionConfigTreeNode)node.getChildAt(i);
+ collect(descriptors, nodes, childNode);
+ }
+ }
+ }
+
+ private static List<String> getAvailableScopes(final List<Descriptor> descriptors, final Project project, final InspectionProfileImpl inspectionProfile) {
+ final ArrayList<NamedScope> scopes = new ArrayList<NamedScope>();
+ for (final NamedScopesHolder holder : NamedScopesHolder.getAllNamedScopeHolders(project)) {
+ Collections.addAll(scopes, holder.getScopes());
+ }
+ scopes.remove(CustomScopesProviderEx.getAllScope());
+
+ CustomScopesProviderEx.filterNoSettingsScopes(project, scopes);
+
+ final Set<NamedScope> used = new HashSet<NamedScope>();
+ for (final Descriptor descriptor : descriptors) {
+ final List<ScopeToolState> nonDefaultTools = inspectionProfile.getNonDefaultTools(descriptor.getKey().toString(), project);
+ if (nonDefaultTools != null) {
+ for (final ScopeToolState state : nonDefaultTools) {
+ used.add(state.getScope(project));
+ }
+ }
+ }
+ scopes.removeAll(used);
+
+ final List<String> availableScopes = new ArrayList<String>();
+ for (final NamedScope scope : scopes) {
+ availableScopes.add(scope.getName());
+ }
+ return availableScopes;
+ }
+}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionConfigTreeNode.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionConfigTreeNode.java
deleted file mode 100644
index f8fdc2c..0000000
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionConfigTreeNode.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright 2000-2012 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.profile.codeInspection.ui;
-
-import com.intellij.codeInspection.ex.Descriptor;
-import com.intellij.codeInspection.ex.ScopeToolState;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.ClearableLazyValue;
-import com.intellij.psi.search.scope.packageSet.NamedScope;
-import com.intellij.ui.CheckedTreeNode;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * @author anna
- * @since 14-May-2009
- */
-public class InspectionConfigTreeNode extends CheckedTreeNode {
- private final ScopeToolState myState;
- private boolean myByDefault;
- private boolean myInspectionNode;
- private final ClearableLazyValue<Boolean> myProperSetting = new ClearableLazyValue<Boolean>() {
- @NotNull
- @Override
- protected Boolean compute() {
- Descriptor descriptor = getDescriptor();
- if (descriptor != null) return descriptor.getInspectionProfile().isProperSetting(descriptor.getToolWrapper().getShortName());
- for (int i = 0; i < getChildCount(); i++) {
- InspectionConfigTreeNode node = (InspectionConfigTreeNode)getChildAt(i);
- if (node.isProperSetting()) {
- return true;
- }
- }
- return false;
- }
- };
-
- public InspectionConfigTreeNode(@NotNull Object userObject, ScopeToolState state, boolean byDefault, boolean inspectionNode) {
- super(userObject);
- myState = state;
- myByDefault = byDefault;
- myInspectionNode = inspectionNode;
- if (state != null) {
- setChecked(state.isEnabled());
- }
- }
-
- public InspectionConfigTreeNode(@NotNull Descriptor descriptor, ScopeToolState state, boolean byDefault, boolean isEnabled,
- boolean inspectionNode) {
- this(descriptor, state, byDefault, inspectionNode);
- setChecked(isEnabled);
- }
-
- @Nullable
- public Descriptor getDescriptor() {
- if (userObject instanceof String) return null;
- return (Descriptor)userObject;
- }
-
- @Nullable
- public NamedScope getScope(Project project) {
- return myState == null ? null : myState.getScope(project);
- }
-
- public boolean isByDefault() {
- return myByDefault;
- }
-
- @Nullable
- public String getGroupName() {
- return userObject instanceof String ? (String)userObject : null;
- }
-
- public boolean isInspectionNode() {
- return myInspectionNode;
- }
-
- public void setInspectionNode(boolean inspectionNode) {
- myInspectionNode = inspectionNode;
- }
-
- public void setByDefault(boolean byDefault) {
- myByDefault = byDefault;
- }
-
- @Nullable
- public String getScopeName() {
- return myState != null ? myState.getScopeName() : null;
- }
-
- public boolean isProperSetting() {
- return myProperSetting.getValue();
- }
-
- public void dropCache() {
- myProperSetting.drop();
- }
-
- @Override
- public String toString() {
- if (userObject instanceof Descriptor) {
- return ((Descriptor)userObject).getText();
- }
- return super.toString();
- }
-}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.java
index ad2b444..7949452 100644
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.java
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.java
@@ -151,7 +151,7 @@
final Set<String> levels = new HashSet<String>();
for (Object o : rootElement.getChildren("inspection_tool")) {
final Element inspectElement = (Element)o;
- levels.add(inspectElement.getAttributeValue("level"));
+ levels.add(inspectElement.getAttributeValue("l"));
for (Object s : inspectElement.getChildren("scope")) {
levels.add(((Element)s).getAttributeValue("level"));
}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsAggregationUtil.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsAggregationUtil.java
new file mode 100644
index 0000000..3707c03
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsAggregationUtil.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui;
+
+import com.intellij.codeInsight.daemon.HighlightDisplayKey;
+import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionConfigTreeNode;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.Queue;
+import gnu.trove.THashSet;
+
+import javax.swing.tree.TreePath;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public class InspectionsAggregationUtil {
+ public static List<HighlightDisplayKey> getInspectionsKeys(final InspectionConfigTreeNode node) {
+ return ContainerUtil.map(getInspectionsNodes(node), new Function<InspectionConfigTreeNode, HighlightDisplayKey>() {
+ @Override
+ public HighlightDisplayKey fun(final InspectionConfigTreeNode node) {
+ return node.getKey();
+ }
+ });
+ }
+
+ public static List<InspectionConfigTreeNode> getInspectionsNodes(final InspectionConfigTreeNode node) {
+ final Queue<InspectionConfigTreeNode> q = new Queue<InspectionConfigTreeNode>(1);
+ q.addLast(node);
+ return getInspectionsNodes(q);
+ }
+
+ public static List<InspectionConfigTreeNode> getInspectionsNodes(final TreePath[] paths) {
+ final Queue<InspectionConfigTreeNode> q = new Queue<InspectionConfigTreeNode>(paths.length);
+ for (final TreePath path : paths) {
+ if (path != null) {
+ q.addLast((InspectionConfigTreeNode)path.getLastPathComponent());
+ }
+ }
+ return getInspectionsNodes(q);
+ }
+
+ private static List<InspectionConfigTreeNode> getInspectionsNodes(final Queue<InspectionConfigTreeNode> queue) {
+ final Set<InspectionConfigTreeNode> nodes = new THashSet<InspectionConfigTreeNode>();
+ while (!queue.isEmpty()) {
+ final InspectionConfigTreeNode node = queue.pullFirst();
+ if (node.getDescriptors() == null) {
+ for (int i = 0; i < node.getChildCount(); i++) {
+ final InspectionConfigTreeNode childNode = (InspectionConfigTreeNode) node.getChildAt(i);
+ queue.addLast(childNode);
+ }
+ } else {
+ nodes.add(node);
+ }
+ }
+ return new ArrayList<InspectionConfigTreeNode>(nodes);
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/LevelChooser.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/LevelChooser.java
index 2229550..5bc7925 100644
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/LevelChooser.java
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/LevelChooser.java
@@ -56,7 +56,8 @@
addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
- final SeverityEditorDialog dlg = new SeverityEditorDialog(LevelChooser.this, (HighlightSeverity)getComboBox().getSelectedItem(), severityRegistrar);
+ final SeverityEditorDialog dlg =
+ new SeverityEditorDialog(LevelChooser.this, (HighlightSeverity)getComboBox().getSelectedItem(), severityRegistrar);
dlg.show();
if (dlg.isOK()) {
final Object item = getComboBox().getSelectedItem();
@@ -64,7 +65,8 @@
final HighlightInfoType type = dlg.getSelectedType();
if (type != null) {
getComboBox().setSelectedItem(type.getSeverity(null));
- } else {
+ }
+ else {
getComboBox().setSelectedItem(item);
}
}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/LevelChooserAction.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/LevelChooserAction.java
index ec2fbce..1067a60 100644
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/LevelChooserAction.java
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/LevelChooserAction.java
@@ -19,6 +19,7 @@
import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
+import com.intellij.codeInspection.ex.InspectionProfileImpl;
import com.intellij.codeInspection.ex.SeverityEditorDialog;
import com.intellij.lang.annotation.HighlightSeverity;
import com.intellij.openapi.actionSystem.AnAction;
@@ -26,6 +27,7 @@
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.actionSystem.ex.ComboBoxAction;
+import com.intellij.profile.codeInspection.SeverityProvider;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
@@ -40,24 +42,15 @@
private final SeverityRegistrar mySeverityRegistrar;
private HighlightSeverity myChosen = null;
- public LevelChooserAction(final SeverityRegistrar severityRegistrar) {
- mySeverityRegistrar = severityRegistrar;
+ public LevelChooserAction(final InspectionProfileImpl profile) {
+ mySeverityRegistrar = ((SeverityProvider)profile.getProfileManager()).getOwnSeverityRegistrar();
}
@NotNull
@Override
- protected DefaultActionGroup createPopupActionGroup(final JComponent button) {
+ public DefaultActionGroup createPopupActionGroup(final JComponent anchor) {
final DefaultActionGroup group = new DefaultActionGroup();
-
- final SortedSet<HighlightSeverity> severities = new TreeSet<HighlightSeverity>(mySeverityRegistrar);
- for (final SeverityRegistrar.SeverityBasedTextAttributes type : SeverityUtil.getRegisteredHighlightingInfoTypes(mySeverityRegistrar)) {
- severities.add(type.getSeverity());
- }
- severities.add(HighlightSeverity.ERROR);
- severities.add(HighlightSeverity.WARNING);
- severities.add(HighlightSeverity.WEAK_WARNING);
- severities.add(HighlightSeverity.GENERIC_SERVER_ERROR_OR_WARNING);
- for (final HighlightSeverity severity : severities) {
+ for (final HighlightSeverity severity : getSeverities(mySeverityRegistrar)) {
final HighlightSeverityAction action = new HighlightSeverityAction(severity);
if (myChosen == null) {
setChosen(action.getSeverity());
@@ -68,7 +61,7 @@
group.add(new AnAction("Edit severities...") {
@Override
public void actionPerformed(final AnActionEvent e) {
- final SeverityEditorDialog dlg = new SeverityEditorDialog(button, myChosen, mySeverityRegistrar);
+ final SeverityEditorDialog dlg = new SeverityEditorDialog(anchor, myChosen, mySeverityRegistrar);
dlg.show();
if (dlg.isOK()) {
final HighlightInfoType type = dlg.getSelectedType();
@@ -83,6 +76,18 @@
return group;
}
+ public static SortedSet<HighlightSeverity> getSeverities(final SeverityRegistrar severityRegistrar) {
+ final SortedSet<HighlightSeverity> severities = new TreeSet<HighlightSeverity>(severityRegistrar);
+ for (final SeverityRegistrar.SeverityBasedTextAttributes type : SeverityUtil.getRegisteredHighlightingInfoTypes(severityRegistrar)) {
+ severities.add(type.getSeverity());
+ }
+ severities.add(HighlightSeverity.ERROR);
+ severities.add(HighlightSeverity.WARNING);
+ severities.add(HighlightSeverity.WEAK_WARNING);
+ severities.add(HighlightSeverity.GENERIC_SERVER_ERROR_OR_WARNING);
+ return severities;
+ }
+
protected abstract void onChosen(final HighlightSeverity severity);
public void setChosen(final HighlightSeverity severity) {
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/MultiScopeSeverityIcon.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/MultiScopeSeverityIcon.java
new file mode 100644
index 0000000..2bf9096
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/MultiScopeSeverityIcon.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.List;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public class MultiScopeSeverityIcon implements Icon {
+ private final int mySize;
+ private final List<Color> myColors;
+
+ public MultiScopeSeverityIcon(final int size, final List<Color> colors) {
+ mySize = size;
+ myColors = colors;
+ }
+
+ @Override
+ public void paintIcon(final Component c, final Graphics g, final int i, final int j) {
+ final int iconWidth = getIconWidth();
+ final int iconHeightCoordinate = j + getIconHeight();
+
+ final int partWidth = iconWidth / myColors.size();
+
+ for (int idx = 0; idx < myColors.size(); idx++) {
+ final Color color = myColors.get(idx);
+ g.setColor(color);
+ final int x = i + partWidth * idx;
+ g.fillRect(x, j, x + partWidth, iconHeightCoordinate);
+ }
+ }
+
+ @Override
+ public int getIconWidth() {
+ return mySize;
+ }
+
+ @Override
+ public int getIconHeight() {
+ return mySize;
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ScopesChooser.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ScopesChooser.java
new file mode 100644
index 0000000..4932e7f
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ScopesChooser.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui;
+
+import com.intellij.codeInspection.ex.Descriptor;
+import com.intellij.codeInspection.ex.InspectionProfileImpl;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DefaultActionGroup;
+import com.intellij.openapi.actionSystem.ex.ComboBoxAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.search.scope.packageSet.CustomScopesProviderEx;
+import com.intellij.psi.search.scope.packageSet.NamedScope;
+import com.intellij.psi.search.scope.packageSet.NamedScopesHolder;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collections;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public abstract class ScopesChooser extends ComboBoxAction {
+
+ private final List<Descriptor> myDefaultDescriptors;
+ private final InspectionProfileImpl myInspectionProfile;
+ private final Project myProject;
+
+ public ScopesChooser(final List<Descriptor> defaultDescriptors, final InspectionProfileImpl inspectionProfile, final Project project) {
+ myDefaultDescriptors = defaultDescriptors;
+ myInspectionProfile = inspectionProfile;
+ myProject = project;
+ setPopupTitle("Select a scope to change its settings");
+ getTemplatePresentation().setText("In All Scopes");
+ }
+
+ @NotNull
+ @Override
+ protected DefaultActionGroup createPopupActionGroup(final JComponent button) {
+ final DefaultActionGroup group = new DefaultActionGroup();
+
+ final List<NamedScope> predefinedScopes = new ArrayList<NamedScope>();
+ final List<NamedScope> customScopes = new ArrayList<NamedScope>();
+ for (final NamedScopesHolder holder : NamedScopesHolder.getAllNamedScopeHolders(myProject)) {
+ Collections.addAll(customScopes, holder.getEditableScopes());
+ predefinedScopes.addAll(holder.getPredefinedScopes());
+ }
+ predefinedScopes.remove(CustomScopesProviderEx.getAllScope());
+ fillActionGroup(group, predefinedScopes, myDefaultDescriptors, myInspectionProfile);
+ group.addSeparator();
+ fillActionGroup(group, customScopes, myDefaultDescriptors, myInspectionProfile);
+
+ //TODO edit scopes order
+ //group.addSeparator();
+ //group.add(new AnAction("Edit Scopes Order...") {
+ // @Override
+ // public void actionPerformed(final AnActionEvent e) {
+ //
+ // }
+ //});
+
+ return group;
+ }
+
+ protected abstract void onScopeAdded();
+
+ private void fillActionGroup(final DefaultActionGroup group,
+ final List<NamedScope> scopes,
+ final List<Descriptor> defaultDescriptors,
+ final InspectionProfileImpl inspectionProfile) {
+ for (final NamedScope scope : scopes) {
+ group.add(new AnAction(scope.getName()) {
+ @Override
+ public void actionPerformed(final AnActionEvent e) {
+ for (final Descriptor defaultDescriptor : defaultDescriptors) {
+ inspectionProfile.addScope(defaultDescriptor.getToolWrapper().createCopy(), scope, defaultDescriptor.getLevel(), true, getEventProject(e));
+ }
+ onScopeAdded();
+ }
+ });
+ }
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java
index 62993f5..ce5f308 100644
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java
@@ -52,19 +52,25 @@
import com.intellij.profile.codeInspection.InspectionProfileManagerImpl;
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
import com.intellij.profile.codeInspection.SeverityProvider;
-import com.intellij.profile.codeInspection.ui.actions.AddScopeAction;
-import com.intellij.profile.codeInspection.ui.actions.DeleteScopeAction;
-import com.intellij.profile.codeInspection.ui.actions.MoveScopeAction;
+import com.intellij.profile.codeInspection.ui.filter.InspectionFilterAction;
+import com.intellij.profile.codeInspection.ui.filter.InspectionsFilter;
+import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionConfigTreeNode;
+import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeComparator;
+import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeRenderer;
+import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeTable;
+import com.intellij.profile.codeInspection.ui.table.ScopesAndSeveritiesTable;
import com.intellij.psi.search.scope.packageSet.NamedScope;
import com.intellij.ui.*;
+import com.intellij.ui.components.JBLabel;
import com.intellij.ui.treeStructure.Tree;
import com.intellij.util.Alarm;
-import com.intellij.util.IconUtil;
+import com.intellij.util.Function;
import com.intellij.util.config.StorageAccessors;
-import com.intellij.util.containers.Convertor;
+import com.intellij.util.containers.*;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.tree.TreeUtil;
import com.intellij.xml.util.XmlStringUtil;
+import gnu.trove.THashSet;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -76,7 +82,6 @@
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.DefaultTreeSelectionModel;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
import java.awt.*;
@@ -85,6 +90,7 @@
import java.io.IOException;
import java.io.StringReader;
import java.util.*;
+import java.util.HashSet;
import java.util.List;
/**
@@ -95,17 +101,23 @@
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.ex.InspectionToolsPanel");
@NonNls private static final String INSPECTION_FILTER_HISTORY = "INSPECTION_FILTER_HISTORY";
private static final String UNDER_CONSTRUCTION = InspectionsBundle.message("inspection.tool.description.under.construction.text");
- private final Map<Descriptor, List<Descriptor>> myDescriptors = new HashMap<Descriptor, List<Descriptor>>();
+ private final List<ToolDescriptors> myInitialToolDescriptors = new ArrayList<ToolDescriptors>();
private InspectionProfileImpl mySelectedProfile;
private JEditorPane myBrowser;
private JPanel myOptionsPanel;
private JPanel myInspectionProfilePanel = null;
private FilterComponent myProfileFilter;
+ private final InspectionsFilter myInspectionsFilter = new InspectionsFilter() {
+ @Override
+ protected void filterChanged() {
+ filterTree(myProfileFilter.getFilter());
+ }
+ };
private final InspectionConfigTreeNode myRoot =
- new InspectionConfigTreeNode(InspectionsBundle.message("inspection.root.node.title"), null, false, false);
+ new InspectionConfigTreeNode(InspectionsBundle.message("inspection.root.node.title"));
private final Alarm myAlarm = new Alarm();
private boolean myModified = false;
- private Tree myTree;
+ private InspectionsConfigTreeTable myTreeTable;
private TreeExpander myTreeExpander;
@NotNull
private String myInitialProfile;
@@ -171,21 +183,21 @@
}
public void updateSelection() {
- if (myTree != null) {
- final TreePath selectionPath = myTree.getSelectionPath();
+ if (myTreeTable != null) {
+ final TreePath selectionPath = myTreeTable.getTree().getSelectionPath();
if (selectionPath != null) {
- TreeUtil.selectNode(myTree, (TreeNode)selectionPath.getLastPathComponent());
- TreeUtil.showRowCentered(myTree, myTree.getRowForPath(selectionPath), false);
+ TreeUtil.selectNode(myTreeTable.getTree(), (TreeNode)selectionPath.getLastPathComponent());
+ TreeUtil.showRowCentered(myTreeTable.getTree(), myTreeTable.getTree().getRowForPath(selectionPath), false);
}
}
}
private void wereToolSettingsModified() {
- for (Map.Entry<Descriptor, List<Descriptor>> entry : myDescriptors.entrySet()) {
- Descriptor desc = entry.getKey();
+ for (final ToolDescriptors toolDescriptor : myInitialToolDescriptors) {
+ Descriptor desc = toolDescriptor.getDefaultDescriptor();
if (wereToolSettingsModified(desc)) return;
- List<Descriptor> descriptors = entry.getValue();
+ List<Descriptor> descriptors = toolDescriptor.getNonDefaultDescriptors();
for (Descriptor descriptor : descriptors) {
if (wereToolSettingsModified(descriptor)) return;
}
@@ -206,7 +218,7 @@
myAlarm.addRequest(new Runnable() {
@Override
public void run() {
- myTree.repaint();
+ myTreeTable.repaint();
}
}, 300);
myModified = true;
@@ -216,10 +228,10 @@
}
private void updateProperSettingsForSelection() {
- final TreePath selectionPath = myTree.getSelectionPath();
+ final TreePath selectionPath = myTreeTable.getTree().getSelectionPath();
if (selectionPath != null) {
InspectionConfigTreeNode node = (InspectionConfigTreeNode)selectionPath.getLastPathComponent();
- final Descriptor descriptor = node.getDescriptor();
+ final Descriptor descriptor = node.getDefaultDescriptor();
if (descriptor != null) {
final boolean properSetting = mySelectedProfile.isProperSetting(descriptor.getKey().toString());
if (node.isProperSetting() != properSetting) {
@@ -227,7 +239,7 @@
myAlarm.addRequest(new Runnable() {
@Override
public void run() {
- myTree.repaint();
+ myTreeTable.repaint();
}
}, 300);
node.dropCache();
@@ -237,21 +249,14 @@
}
}
- private void initDescriptors() {
+ private void initToolStates() {
final InspectionProfileImpl profile = mySelectedProfile;
if (profile == null) return;
- myDescriptors.clear();
- List<ScopeToolState> tools = profile.getDefaultStates(myProjectProfileManager.getProject());
- for (ScopeToolState state : tools) {
- final ArrayList<Descriptor> descriptors = new ArrayList<Descriptor>();
+ myInitialToolDescriptors.clear();
+ final Project project = myProjectProfileManager.getProject();
+ for (final ScopeToolState state : profile.getDefaultStates(myProjectProfileManager.getProject())) {
if (!accept(state.getTool())) continue;
- Project project = myProjectProfileManager.getProject();
- myDescriptors.put(new Descriptor(state, profile, project), descriptors);
- InspectionToolWrapper toolWrapper = state.getTool();
- final List<ScopeToolState> nonDefaultTools = profile.getNonDefaultTools(toolWrapper.getShortName(), project);
- for (ScopeToolState nonDefaultToolState : nonDefaultTools) {
- descriptors.add(new Descriptor(nonDefaultToolState, profile, project));
- }
+ myInitialToolDescriptors.add(ToolDescriptors.fromScopeToolState(state, profile, project));
}
}
@@ -267,7 +272,7 @@
}
fillTreeData(myProfileFilter.getFilter(), true);
repaintTableData();
- updateOptionsAndDescriptionPanel(myTree.getSelectionPath());
+ updateOptionsAndDescriptionPanel(myTreeTable.getTree().getSelectionPaths());
}
@Nullable
@@ -311,22 +316,26 @@
myProfileFilter.setFilter(filter);
}
- public void filterTree(String filter) {
- if (myTree != null) {
- getExpandedNodes(mySelectedProfile).saveVisibleState(myTree);
+ private void filterTree(@Nullable String filter) {
+ if (myTreeTable != null) {
+ getExpandedNodes(mySelectedProfile).saveVisibleState(myTreeTable.getTree());
fillTreeData(filter, true);
reloadModel();
restoreTreeState();
- if (myTree.getSelectionPath() == null) {
- TreeUtil.selectFirstNode(myTree);
+ if (myTreeTable.getTree().getSelectionPath() == null) {
+ TreeUtil.selectFirstNode(myTreeTable.getTree());
}
}
}
+ private void filterTree() {
+ filterTree(myProfileFilter != null ? myProfileFilter.getFilter() : null);
+ }
+
private void reloadModel() {
try {
myIsInRestore = true;
- ((DefaultTreeModel)myTree.getModel()).reload();
+ ((DefaultTreeModel)myTreeTable.getTree().getModel()).reload();
}
finally {
myIsInRestore = false;
@@ -338,7 +347,7 @@
try {
myIsInRestore = true;
- getExpandedNodes(mySelectedProfile).restoreVisibleState(myTree);
+ getExpandedNodes(mySelectedProfile).restoreVisibleState(myTreeTable.getTree());
}
finally {
myIsInRestore = false;
@@ -349,13 +358,17 @@
final CommonActionsManager actionManager = CommonActionsManager.getInstance();
DefaultActionGroup actions = new DefaultActionGroup();
- actions.add(actionManager.createExpandAllAction(myTreeExpander, myTree));
- actions.add(actionManager.createCollapseAllAction(myTreeExpander, myTree));
+
+ actions.add(new InspectionFilterAction(mySelectedProfile, myInspectionsFilter));
+ actions.addSeparator();
+
+ actions.add(actionManager.createExpandAllAction(myTreeExpander, myTreeTable));
+ actions.add(actionManager.createCollapseAllAction(myTreeExpander, myTreeTable));
actions.add(new AnAction(CommonBundle.message("button.reset.to.default"), CommonBundle.message("button.reset.to.default"),
AllIcons.General.Reset) {
{
- registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_MASK)), myTree);
+ registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_MASK)), myTreeTable);
}
@Override
public void update(AnActionEvent e) {
@@ -395,41 +408,14 @@
}
});
- actions.addSeparator();
- actions.add(new MyAddScopeAction());
- actions.add(new MyDeleteScopeAction());
- actions.add(new MoveScopeAction(myTree, "Move Scope Up", IconUtil.getMoveUpIcon(), -1) {
- @Override
- protected boolean isEnabledFor(int idx, InspectionConfigTreeNode parent) {
- return idx > 0;
- }
-
- @Override
- protected InspectionProfileImpl getSelectedProfile() {
- return mySelectedProfile;
- }
- });
- actions.add(new MoveScopeAction(myTree, "Move Scope Down", IconUtil.getMoveDownIcon(), 1) {
- @Override
- protected boolean isEnabledFor(int idx, InspectionConfigTreeNode parent) {
- return idx < parent.getChildCount() - 2;
- }
-
- @Override
- protected InspectionProfileImpl getSelectedProfile() {
- return mySelectedProfile;
- }
- });
- actions.addSeparator();
-
final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actions, true);
actionToolbar.setTargetComponent(this);
return actionToolbar;
}
private void repaintTableData() {
- if (myTree != null) {
- getExpandedNodes(mySelectedProfile).saveVisibleState(myTree);
+ if (myTreeTable != null) {
+ getExpandedNodes(mySelectedProfile).saveVisibleState(myTreeTable.getTree());
reloadModel();
restoreTreeState();
}
@@ -438,8 +424,8 @@
public void selectInspectionTool(String name) {
final InspectionConfigTreeNode node = findNodeByKey(name, myRoot);
if (node != null) {
- TreeUtil.showRowCentered(myTree, myTree.getRowForPath(new TreePath(node.getPath())) - 1, true);//myTree.isRootVisible ? 0 : 1;
- TreeUtil.selectNode(myTree, node);
+ TreeUtil.showRowCentered(myTreeTable.getTree(), myTreeTable.getTree().getRowForPath(new TreePath(node.getPath())) - 1, true);//myTree.isRootVisible ? 0 : 1;
+ TreeUtil.selectNode(myTreeTable.getTree(), node);
}
}
@@ -447,7 +433,7 @@
private static InspectionConfigTreeNode findNodeByKey(String name, InspectionConfigTreeNode root) {
for (int i = 0; i < root.getChildCount(); i++) {
final InspectionConfigTreeNode child = (InspectionConfigTreeNode)root.getChildAt(i);
- final Descriptor descriptor = child.getDescriptor();
+ final Descriptor descriptor = child.getDefaultDescriptor();
if (descriptor != null) {
if (descriptor.getKey().toString().equals(name)) {
return child;
@@ -462,42 +448,37 @@
}
private JScrollPane initTreeScrollPane() {
-
fillTreeData(null, true);
- final InspectionsConfigTreeRenderer renderer = new InspectionsConfigTreeRenderer(myProjectProfileManager.getProject()){
+ final InspectionsConfigTreeRenderer renderer = new InspectionsConfigTreeRenderer(){
@Override
protected String getFilter() {
return myProfileFilter != null ? myProfileFilter.getFilter() : null;
}
};
- myTree = new CheckboxTree(renderer, myRoot) {
+ myTreeTable = new InspectionsConfigTreeTable(new InspectionsConfigTreeTable.InspectionsConfigTreeTableSettings(myRoot, myProjectProfileManager.getProject()) {
@Override
- public Dimension getPreferredScrollableViewportSize() {
- Dimension size = super.getPreferredScrollableViewportSize();
- size = new Dimension(size.width + 10, size.height);
- return size;
+ protected void onChanged(final InspectionConfigTreeNode node) {
+ updateOptionsAndDescriptionPanel();
+ updateUpHierarchy(node, (InspectionConfigTreeNode)node.getParent());
}
@Override
- protected void onNodeStateChanged(final CheckedTreeNode node) {
- toggleToolNode((InspectionConfigTreeNode)node);
+ public InspectionProfileImpl getInspectionProfile() {
+ return mySelectedProfile;
}
- };
+ });
+ myTreeTable.setTreeCellRenderer(renderer);
+ myTreeTable.setRootVisible(false);
+ UIUtil.setLineStyleAngled(myTreeTable.getTree());
+ TreeUtil.installActions(myTreeTable.getTree());
- myTree.setCellRenderer(renderer);
- myTree.setRootVisible(false);
- myTree.setShowsRootHandles(true);
- UIUtil.setLineStyleAngled(myTree);
- TreeUtil.installActions(myTree);
-
-
- myTree.addTreeSelectionListener(new TreeSelectionListener() {
+ myTreeTable.getTree().addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
- if (myTree.getSelectionPaths() != null && myTree.getSelectionPaths().length == 1) {
- updateOptionsAndDescriptionPanel(myTree.getSelectionPaths()[0]);
+ if (myTreeTable.getTree().getSelectionPaths() != null) {
+ updateOptionsAndDescriptionPanel(myTreeTable.getTree().getSelectionPaths());
}
else {
initOptionsAndDescriptionPanel();
@@ -508,9 +489,9 @@
if (selected != null) {
InspectionProfileImpl baseProfile = (InspectionProfileImpl)selected.getParentProfile();
if (baseProfile != null) {
- getExpandedNodes(baseProfile).setSelectionPaths(myTree.getSelectionPaths());
+ getExpandedNodes(baseProfile).setSelectionPaths(myTreeTable.getTree().getSelectionPaths());
}
- getExpandedNodes(selected).setSelectionPaths(myTree.getSelectionPaths());
+ getExpandedNodes(selected).setSelectionPaths(myTreeTable.getTree().getSelectionPaths());
}
}
@@ -518,36 +499,35 @@
});
- myTree.addMouseListener(new PopupHandler() {
+ myTreeTable.addMouseListener(new PopupHandler() {
@Override
public void invokePopup(Component comp, int x, int y) {
- final int[] selectionRows = myTree.getSelectionRows();
- if (selectionRows != null && myTree.getPathForLocation(x, y) != null && Arrays.binarySearch(selectionRows, myTree.getRowForLocation(x, y)) > -1)
- {
+ final int[] selectionRows = myTreeTable.getTree().getSelectionRows();
+ if (selectionRows != null &&
+ myTreeTable.getTree().getPathForLocation(x, y) != null &&
+ Arrays.binarySearch(selectionRows, myTreeTable.getTree().getRowForLocation(x, y)) > -1) {
compoundPopup().show(comp, x, y);
}
}
});
- new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
+ new TreeSpeedSearch(myTreeTable.getTree(), new Convertor<TreePath, String>() {
@Override
public String convert(TreePath o) {
final InspectionConfigTreeNode node = (InspectionConfigTreeNode)o.getLastPathComponent();
- final Descriptor descriptor = node.getDescriptor();
+ final Descriptor descriptor = node.getDefaultDescriptor();
return descriptor != null ? InspectionsConfigTreeComparator.getDisplayTextToSort(descriptor.getText()) : InspectionsConfigTreeComparator
.getDisplayTextToSort(node.getGroupName());
}
});
- myTree.setSelectionModel(new DefaultTreeSelectionModel());
-
- final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTree);
+ final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTreeTable);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
- TreeUtil.collapseAll(myTree, 1);
+ TreeUtil.collapseAll(myTreeTable.getTree(), 1);
- myTree.addTreeExpansionListener(new TreeExpansionListener() {
+ myTreeTable.getTree().addTreeExpansionListener(new TreeExpansionListener() {
@Override
@@ -556,9 +536,9 @@
final InspectionConfigTreeNode node = (InspectionConfigTreeNode)event.getPath().getLastPathComponent();
final InspectionProfileImpl parentProfile = (InspectionProfileImpl)selected.getParentProfile();
if (parentProfile != null) {
- getExpandedNodes(parentProfile).saveVisibleState(myTree);
+ getExpandedNodes(parentProfile).saveVisibleState(myTreeTable.getTree());
}
- getExpandedNodes(selected).saveVisibleState(myTree);
+ getExpandedNodes(selected).saveVisibleState(myTreeTable.getTree());
}
@Override
@@ -575,7 +555,17 @@
}
});
- myTreeExpander = new DefaultTreeExpander(myTree);
+ myTreeExpander = new DefaultTreeExpander(myTreeTable.getTree()) {
+ @Override
+ public boolean canExpand() {
+ return myTreeTable.isShowing();
+ }
+
+ @Override
+ public boolean canCollapse() {
+ return myTreeTable.isShowing();
+ }
+ };
myProfileFilter = new MyFilterComponent();
return scrollPane;
@@ -603,54 +593,14 @@
});
}
group.add(Separator.getInstance());
- group.add(new MyAddScopeAction());
- group.add(new MyDeleteScopeAction());
ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.UNKNOWN, group);
return menu.getComponent();
}
- static String renderSeverity(HighlightSeverity severity) {
+ public static String renderSeverity(HighlightSeverity severity) {
return StringUtil.capitalizeWords(severity.getName().toLowerCase(), true);
}
- private void toggleToolNode(final InspectionConfigTreeNode toolNode) {
- final Descriptor descriptor = toolNode.getDescriptor();
- Project project = myProjectProfileManager.getProject();
- if (descriptor!= null) {
- final HighlightDisplayKey key = descriptor.getKey();
- final String toolShortName = key.toString();
- if (toolNode.isChecked()) {
- if (toolNode.getScope(project) != null){
- if (toolNode.isByDefault()) {
- mySelectedProfile.enableToolByDefault(toolShortName, project);
- }
- else {
- mySelectedProfile.enableTool(toolShortName, toolNode.getScope(project), project);
- }
- } else {
- mySelectedProfile.enableTool(toolShortName, project);
- }
- }
- else {
- if (toolNode.getScope(project) != null) {
- if (toolNode.isByDefault()) {
- mySelectedProfile.disableToolByDefault(toolShortName, project);
- } else {
- mySelectedProfile.disableTool(toolShortName, toolNode.getScope(project), project);
- }
- } else if (toolNode.getChildCount() == 0){ //default node and no scopes configured
- mySelectedProfile.disableTool(toolShortName, project);
- }
- }
- toolNode.dropCache();
- updateUpHierarchy(toolNode, (InspectionConfigTreeNode)toolNode.getParent());
- }
- final TreePath path = new TreePath(toolNode.getPath());
- if (Comparing.equal(myTree.getSelectionPath(), path)) {
- updateOptionsAndDescriptionPanel(path);
- }
- }
-
private static void updateUpHierarchy(final InspectionConfigTreeNode node, final InspectionConfigTreeNode parent) {
if (parent != null) {
parent.dropCache();
@@ -701,10 +651,9 @@
return forceInclude;
}
- private void fillTreeData(String filter, boolean forceInclude) {
+ private void fillTreeData(@Nullable String filter, boolean forceInclude) {
if (mySelectedProfile == null) return;
myRoot.removeAllChildren();
- myRoot.setChecked(false);
myRoot.dropCache();
List<Set<String>> keySetList = new ArrayList<Set<String>>();
final Set<String> quoted = new HashSet<String>();
@@ -712,23 +661,17 @@
keySetList.addAll(SearchUtil.findKeys(filter, quoted));
}
Project project = myProjectProfileManager.getProject();
- for (Descriptor descriptor : myDescriptors.keySet()) {
+ final boolean emptyFilter = myInspectionsFilter.isEmptyFilter();
+ for (ToolDescriptors toolDescriptors : myInitialToolDescriptors) {
+ final Descriptor descriptor = toolDescriptors.getDefaultDescriptor();
if (filter != null && !filter.isEmpty() && !isDescriptorAccepted(descriptor, filter, forceInclude, keySetList, quoted)) {
continue;
}
- final List<ScopeToolState> nonDefaultTools = mySelectedProfile.getNonDefaultTools(descriptor.getKey().toString(), project);
- final HighlightDisplayKey key = descriptor.getKey();
- final boolean enabled = mySelectedProfile.isToolEnabled(key);
- boolean hasNonDefaultScope = !nonDefaultTools.isEmpty();
- final InspectionConfigTreeNode node = new InspectionConfigTreeNode(descriptor, null, !hasNonDefaultScope, enabled, !hasNonDefaultScope);
- getGroupNode(myRoot, descriptor.getGroup()).add(node);
- if (hasNonDefaultScope) {
- for (Descriptor desc : myDescriptors.get(descriptor)) {
- node.add(new InspectionConfigTreeNode(desc, desc.getState(), false, false));
- }
- node.add(new InspectionConfigTreeNode(descriptor, descriptor.getState(), true, false));
+ if (!emptyFilter && !myInspectionsFilter.matches(mySelectedProfile.getTools(toolDescriptors.getDefaultDescriptor().getKey().toString(), project))) {
+ continue;
}
- myRoot.setEnabled(myRoot.isEnabled() || enabled);
+ final InspectionConfigTreeNode node = new InspectionConfigTreeNode(toolDescriptors);
+ getGroupNode(myRoot, toolDescriptors.getDefaultDescriptor().getGroup()).add(node);
myRoot.dropCache();
}
if (filter != null && forceInclude && myRoot.getChildCount() == 0) {
@@ -740,19 +683,24 @@
TreeUtil.sort(myRoot, new InspectionsConfigTreeComparator());
}
- private void updateOptionsAndDescriptionPanel(TreePath path) {
+ private void updateOptionsAndDescriptionPanel(final TreePath... paths) {
+ if (paths == null || paths.length == 0) {
+ return;
+ }
+ final TreePath path = paths[0];
if (path == null) return;
- final InspectionConfigTreeNode node = (InspectionConfigTreeNode)path.getLastPathComponent();
- final Descriptor descriptor = node.getDescriptor();
- if (descriptor != null) {
- final String description = descriptor.loadDescription();
-
- if (description != null) {
+ final List<InspectionConfigTreeNode> nodes = InspectionsAggregationUtil.getInspectionsNodes(paths);
+ if (!nodes.isEmpty()) {
+ final InspectionConfigTreeNode singleNode = nodes.size() == 1 ? ContainerUtil.getFirstItem(nodes) : null;
+ if (singleNode != null && singleNode.getDefaultDescriptor().loadDescription() != null) {
// need this in order to correctly load plugin-supplied descriptions
+ final Descriptor defaultDescriptor = singleNode.getDefaultDescriptor();
+ final String description = defaultDescriptor.loadDescription();
try {
final HintHint hintHint = new HintHint(myBrowser, new Point(0, 0));
hintHint.setFont(myBrowser.getFont());
- myBrowser.read(new StringReader(SearchUtil.markup(HintUtil.prepareHintText(description, hintHint), myProfileFilter.getFilter())), null);
+ myBrowser
+ .read(new StringReader(SearchUtil.markup(HintUtil.prepareHintText(description, hintHint), myProfileFilter.getFilter())), null);
}
catch (IOException e2) {
try {
@@ -764,7 +712,10 @@
}
}
catch (Throwable t) {
- LOG.error("Failed to load description for: " + descriptor.getToolWrapper().getTool().getClass() + "; description: " + description, t);
+ LOG.error("Failed to load description for: " +
+ defaultDescriptor.getToolWrapper().getTool().getClass() +
+ "; description: " +
+ description, t);
}
}
@@ -778,41 +729,123 @@
}
myOptionsPanel.removeAll();
+ final Project project = myProjectProfileManager.getProject();
+ final JPanel severityPanel = new JPanel(new GridBagLayout());
+ final double severityPanelWeightY;
+ final JPanel configPanelAnchor = new JPanel(new GridLayout());
+ configPanelAnchor.setBorder(IdeBorderFactory.createTitledBorder("Options", false, new Insets(0, 0, 0, 0)));
- final NamedScope scope = node.getScope(myProjectProfileManager.getProject());
- if (scope != null || node.isInspectionNode()) {
- final HighlightDisplayKey key = descriptor.getKey();
- final LevelChooserAction chooser =
- new LevelChooserAction(((SeverityProvider)mySelectedProfile.getProfileManager()).getOwnSeverityRegistrar()) {
+ final Set<String> scopesNames = new THashSet<String>();
+ for (final InspectionConfigTreeNode node : nodes) {
+ final List<ScopeToolState> nonDefaultTools = mySelectedProfile.getNonDefaultTools(node.getDefaultDescriptor().getKey().toString(), project);
+ for (final ScopeToolState tool : nonDefaultTools) {
+ scopesNames.add(tool.getScopeName());
+ }
+ }
+
+ if (scopesNames.isEmpty()) {
+
+ final LevelChooserAction severityLevelChooser =
+ new LevelChooserAction(mySelectedProfile) {
@Override
protected void onChosen(final HighlightSeverity severity) {
final HighlightDisplayLevel level = HighlightDisplayLevel.find(severity);
- final Project project = myProjectProfileManager.getProject();
- final boolean toUpdate = mySelectedProfile.getErrorLevel(key, scope, project) != level;
- mySelectedProfile.setErrorLevel(key, level,
- node.isInspectionNode() || node.isByDefault() ? -1 : node.getParent().getIndex(node),
- project);
- if (toUpdate) node.dropCache();
+ for (final InspectionConfigTreeNode node : nodes) {
+ final HighlightDisplayKey key = node.getDefaultDescriptor().getKey();
+ final NamedScope scope = node.getDefaultDescriptor().getScope();
+ final boolean toUpdate = mySelectedProfile.getErrorLevel(key, scope, project) != level;
+ mySelectedProfile.setErrorLevel(key, level, -1, project);
+ if (toUpdate) node.dropCache();
+ }
+
}
};
- chooser.setChosen(mySelectedProfile.getErrorLevel(key, scope, myProjectProfileManager.getProject()).getSeverity());
+ final HighlightSeverity severity =
+ ScopesAndSeveritiesTable.getSeverity(ContainerUtil.map(nodes, new Function<InspectionConfigTreeNode, ScopeToolState>() {
+ @Override
+ public ScopeToolState fun(InspectionConfigTreeNode node) {
+ return node.getDefaultDescriptor().getState();
+ }
+ }));
+ severityLevelChooser.setChosen(severity);
- final JPanel withSeverity = new JPanel(new GridBagLayout());
- withSeverity.add(new JLabel(InspectionsBundle.message("inspection.severity")),
- new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST,
- GridBagConstraints.NONE, new Insets(0, 0, 10, 10), 0, 0));
- withSeverity.add(chooser.createCustomComponent(chooser.getTemplatePresentation()), new GridBagConstraints(1, 0, 1, 1, 1.0, 0, GridBagConstraints.WEST,
- GridBagConstraints.NONE, new Insets(0, 0, 10, 0), 0, 0));
+ final ScopesChooser scopesChooser = new ScopesChooser(ContainerUtil.map(nodes, new Function<InspectionConfigTreeNode, Descriptor>() {
+ @Override
+ public Descriptor fun(final InspectionConfigTreeNode node) {
+ return node.getDefaultDescriptor();
+ }
+ }), mySelectedProfile, project) {
+ @Override
+ protected void onScopeAdded() {
+ updateOptionsAndDescriptionPanel();
+ }
+ };
- final JComponent comp = descriptor.getState().getAdditionalConfigPanel();
- withSeverity.add(comp,
- new GridBagConstraints(0, 1, 2, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST,
- GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-
- myOptionsPanel.add(withSeverity, BorderLayout.CENTER);
+ severityPanel.add(new JLabel(InspectionsBundle.message("inspection.severity")),
+ new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL,
+ new Insets(10, 0, 10, 10), 0, 0));
+ severityPanel.add(severityLevelChooser.createCustomComponent(severityLevelChooser.getTemplatePresentation()),
+ new GridBagConstraints(1, 0, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL,
+ new Insets(10, 0, 10, 0), 0, 0));
+ severityPanel.add(scopesChooser.createCustomComponent(scopesChooser.getTemplatePresentation()),
+ new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL,
+ new Insets(10, 0, 10, 0), 0, 0));
+ severityPanelWeightY = 0.0;
+ if (singleNode != null) {
+ setConfigPanel(configPanelAnchor, mySelectedProfile.getToolDefaultState(singleNode.getDefaultDescriptor().getKey().toString(),
+ project));
+ }
}
+ else {
+ if (singleNode != null) {
+ for (final Descriptor descriptor : singleNode.getDescriptors().getNonDefaultDescriptors()) {
+ descriptor.loadConfig();
+ }
+ }
+ final JTable scopesAndScopesAndSeveritiesTable =
+ new ScopesAndSeveritiesTable(new ScopesAndSeveritiesTable.TableSettings(nodes, mySelectedProfile, myTreeTable, project) {
+ @Override
+ protected void onScopeChosen(@NotNull final ScopeToolState state) {
+ setConfigPanel(configPanelAnchor, state);
+ configPanelAnchor.revalidate();
+ configPanelAnchor.repaint();
+ }
+
+ @Override
+ protected void onChange() {
+ myTreeTable.getTree().updateUI();
+ }
+
+ @Override
+ protected void onScopeAdded() {
+ }
+
+ @Override
+ protected void onScopeRemoved(final int scopesCount) {
+ if (scopesCount == 1) {
+ updateOptionsAndDescriptionPanel();
+ }
+ }
+ });
+
+
+ final ToolbarDecorator wrappedTable = ToolbarDecorator.createDecorator(scopesAndScopesAndSeveritiesTable);
+ final JPanel panel = wrappedTable.createPanel();
+ severityPanel.add(new JBLabel("Scopes & Severities"),
+ new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
+ new Insets(5, 0, 2, 10), 0, 0));
+ severityPanel.add(new JBLabel("Add scope to change its settings", UIUtil.ComponentStyle.SMALL),
+ new GridBagConstraints(1, 0, 1, 1, 1.0, 0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE,
+ new Insets(5, 0, 2, 0), 0, 0));
+ severityPanel.add(panel, new GridBagConstraints(0, 1, 2, 1, 0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
+ new Insets(0, 0, 0, 0), 0, 0));
+ severityPanelWeightY = 0.3;
+ }
+ myOptionsPanel.add(severityPanel, new GridBagConstraints(0, 0, 1, 1, 1.0, severityPanelWeightY, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
+ myOptionsPanel.add(configPanelAnchor, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH,
+ new Insets(0, 0, 0, 0), 0, 0));
myOptionsPanel.revalidate();
- GuiUtils.enableChildren(myOptionsPanel, node.isChecked());
+ GuiUtils.enableChildren(myOptionsPanel, isThoughOneNodeEnabled(nodes));
}
else {
initOptionsAndDescriptionPanel();
@@ -820,6 +853,26 @@
myOptionsPanel.repaint();
}
+ private boolean isThoughOneNodeEnabled(final List<InspectionConfigTreeNode> nodes) {
+ final Project project = myProjectProfileManager.getProject();
+ for (final InspectionConfigTreeNode node : nodes) {
+ final String toolId = node.getDefaultDescriptor().getKey().toString();
+ if (mySelectedProfile.getTools(toolId, project).isEnabled()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void updateOptionsAndDescriptionPanel() {
+ final TreePath[] paths = myTreeTable.getTree().getSelectionPaths();
+ if (paths != null) {
+ updateOptionsAndDescriptionPanel(paths);
+ } else {
+ initOptionsAndDescriptionPanel();
+ }
+ }
+
private void initOptionsAndDescriptionPanel() {
myOptionsPanel.removeAll();
try {
@@ -832,6 +885,11 @@
myOptionsPanel.repaint();
}
+ private static void setConfigPanel(final JPanel configPanelAnchor, final ScopeToolState state) {
+ configPanelAnchor.removeAll();
+ configPanelAnchor.add(state.getAdditionalConfigPanel());
+ }
+
private static InspectionConfigTreeNode getGroupNode(InspectionConfigTreeNode root, String[] groupPath) {
InspectionConfigTreeNode currentRoot = root;
for (final String group : groupPath) {
@@ -848,7 +906,7 @@
return child;
}
}
- InspectionConfigTreeNode child = new InspectionConfigTreeNode(group, null, false, false);
+ InspectionConfigTreeNode child = new InspectionConfigTreeNode(group);
root.add(child);
return child;
}
@@ -868,8 +926,8 @@
if (mySelectedProfile != null) {
myInitialProfile = mySelectedProfile.getName();
}
- initDescriptors();
- filterTree(myProfileFilter != null ? myProfileFilter.getFilter() : null);
+ initToolStates();
+ filterTree();
}
@Override
@@ -900,7 +958,7 @@
myBrowser.setBorder(IdeBorderFactory.createEmptyBorder(5, 5, 5, 5));
myBrowser.addHyperlinkListener(new BrowserHyperlinkListener());
- initDescriptors();
+ initToolStates();
fillTreeData(myProfileFilter != null ? myProfileFilter.getFilter() : null, true);
JPanel descriptionPanel = new JPanel(new BorderLayout());
@@ -912,9 +970,7 @@
myRightSplitter.setFirstComponent(descriptionPanel);
myRightSplitter.setProportion(myProperties.getFloat(HORIZONTAL_DIVIDER_PROPORTION, 0.5f));
- myOptionsPanel = new JPanel(new BorderLayout());
- myOptionsPanel.setBorder(IdeBorderFactory.createTitledBorder("Options", false,
- new Insets(0, 0, 0, 0)));
+ myOptionsPanel = new JPanel(new GridBagLayout());
initOptionsAndDescriptionPanel();
myRightSplitter.setSecondComponent(myOptionsPanel);
myRightSplitter.setHonorComponentsMinimumSize(true);
@@ -925,8 +981,8 @@
final JPanel northPanel = new JPanel(new GridBagLayout());
northPanel.setBorder(IdeBorderFactory.createEmptyBorder(2, 0, 2, 0));
- northPanel.add(createTreeToolbarPanel().getComponent(), new GridBagConstraints(0, 0, 1, 1, 0.5, 1, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- northPanel.add(myProfileFilter, new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.BASELINE_TRAILING, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
+ northPanel.add(myProfileFilter, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.BASELINE_TRAILING, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
+ northPanel.add(createTreeToolbarPanel().getComponent(), new GridBagConstraints(1, 0, 1, 1, 0.5, 1, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
treePanel.add(northPanel, BorderLayout.NORTH);
myMainSplitter = new Splitter(false);
@@ -1020,8 +1076,8 @@
}
private boolean descriptorsAreChanged() {
- for (Map.Entry<Descriptor, List<Descriptor>> entry : myDescriptors.entrySet()) {
- Descriptor desc = entry.getKey();
+ for (ToolDescriptors toolDescriptors : myInitialToolDescriptors) {
+ Descriptor desc = toolDescriptors.getDefaultDescriptor();
Project project = myProjectProfileManager.getProject();
if (mySelectedProfile.isToolEnabled(desc.getKey(), null, project) != desc.isEnabled()){
return true;
@@ -1029,7 +1085,7 @@
if (mySelectedProfile.getErrorLevel(desc.getKey(), desc.getScope(), project) != desc.getLevel()) {
return true;
}
- final List<Descriptor> descriptors = entry.getValue();
+ final List<Descriptor> descriptors = toolDescriptors.getNonDefaultDescriptors();
for (Descriptor descriptor : descriptors) {
if (mySelectedProfile.isToolEnabled(descriptor.getKey(), descriptor.getScope(), project) != descriptor.isEnabled()) {
return true;
@@ -1055,8 +1111,8 @@
return false;
}
- public Tree getTree() {
- return myTree;
+ public Tree getTreeTable() {
+ return myTreeTable.getTree();
}
public boolean isProfileShared() {
@@ -1076,13 +1132,13 @@
}
private void setNewHighlightingLevel(@NotNull HighlightDisplayLevel level) {
- final int[] rows = myTree.getSelectionRows();
+ final int[] rows = myTreeTable.getTree().getSelectionRows();
final boolean showOptionsAndDescriptorPanels = rows != null && rows.length == 1;
for (int i = 0; rows != null && i < rows.length; i++) {
- final InspectionConfigTreeNode node = (InspectionConfigTreeNode)myTree.getPathForRow(rows[i]).getLastPathComponent();
+ final InspectionConfigTreeNode node = (InspectionConfigTreeNode)myTreeTable.getTree().getPathForRow(rows[i]).getLastPathComponent();
final InspectionConfigTreeNode parent = (InspectionConfigTreeNode)node.getParent();
final Object userObject = node.getUserObject();
- if (userObject instanceof Descriptor && (node.getScopeName() != null || node.isLeaf())) {
+ if (userObject instanceof ToolDescriptors && (node.getScopeName() != null || node.isLeaf())) {
updateErrorLevel(node, showOptionsAndDescriptorPanels, level);
updateUpHierarchy(node, parent);
}
@@ -1091,8 +1147,8 @@
updateUpHierarchy(node, parent);
}
}
- if (rows != null && rows.length == 1) {
- updateOptionsAndDescriptionPanel(myTree.getPathForRow(rows[0]));
+ if (rows != null) {
+ updateOptionsAndDescriptionPanel(myTreeTable.getTree().getSelectionPaths());
}
else {
initOptionsAndDescriptionPanel();
@@ -1107,7 +1163,7 @@
for (int j = 0; j < node.getChildCount(); j++) {
final InspectionConfigTreeNode child = (InspectionConfigTreeNode)node.getChildAt(j);
final Object userObject = child.getUserObject();
- if (userObject instanceof Descriptor && (child.getScopeName() != null || child.isLeaf())) {
+ if (userObject instanceof ToolDescriptors && (child.getScopeName() != null || child.isLeaf())) {
updateErrorLevel(child, showOptionsAndDescriptorPanels, level);
}
else {
@@ -1119,15 +1175,18 @@
private void updateErrorLevel(final InspectionConfigTreeNode child,
final boolean showOptionsAndDescriptorPanels,
@NotNull HighlightDisplayLevel level) {
- final HighlightDisplayKey key = child.getDescriptor().getKey();
- mySelectedProfile.setErrorLevel(key, level, child.isInspectionNode() || child.isByDefault() ? -1 : child.getParent().getIndex(child),
- myProjectProfileManager.getProject());
+ final HighlightDisplayKey key = child.getDefaultDescriptor().getKey();
+ mySelectedProfile.setErrorLevel(key, level, -1, myProjectProfileManager.getProject());
child.dropCache();
if (showOptionsAndDescriptorPanels) {
updateOptionsAndDescriptionPanel(new TreePath(child.getPath()));
}
}
+ public JComponent getTree() {
+ return myTreeTable.getTree();
+ }
+
private class MyFilterComponent extends FilterComponent {
private MyFilterComponent() {
super(INSPECTION_FILTER_HISTORY, 10);
@@ -1143,47 +1202,14 @@
protected void onlineFilter() {
if (mySelectedProfile == null) return;
final String filter = getFilter();
- getExpandedNodes(mySelectedProfile).saveVisibleState(myTree);
+ getExpandedNodes(mySelectedProfile).saveVisibleState(myTreeTable.getTree());
fillTreeData(filter, true);
reloadModel();
if (filter == null || filter.isEmpty()) {
restoreTreeState();
} else {
- TreeUtil.expandAll(myTree);
+ TreeUtil.expandAll(myTreeTable.getTree());
}
}
}
-
- private class MyAddScopeAction extends AddScopeAction {
- public MyAddScopeAction() {
- super(SingleInspectionProfilePanel.this.myTree);
- }
-
- @Override
- protected InspectionProfileImpl getSelectedProfile() {
- return mySelectedProfile;
- }
-
- @Override
- public void actionPerformed(AnActionEvent e) {
- super.actionPerformed(e);
- final TreePath[] paths = myTree.getSelectionPaths();
- if (paths != null && paths.length == 1) {
- updateOptionsAndDescriptionPanel(myTree.getSelectionPath());
- } else {
- initOptionsAndDescriptionPanel();
- }
- }
- }
-
- private class MyDeleteScopeAction extends DeleteScopeAction {
- public MyDeleteScopeAction() {
- super(SingleInspectionProfilePanel.this.myTree);
- }
-
- @Override
- protected InspectionProfileImpl getSelectedProfile() {
- return mySelectedProfile;
- }
- }
}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ToolDescriptors.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ToolDescriptors.java
new file mode 100644
index 0000000..47826735
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ToolDescriptors.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui;
+
+import com.intellij.codeInspection.ex.Descriptor;
+import com.intellij.codeInspection.ex.InspectionProfileImpl;
+import com.intellij.codeInspection.ex.InspectionToolWrapper;
+import com.intellij.codeInspection.ex.ScopeToolState;
+import com.intellij.openapi.project.Project;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public class ToolDescriptors {
+
+ @NotNull
+ private final Descriptor myDefaultDescriptor;
+ @NotNull
+ private final List<Descriptor> myNonDefaultDescriptors;
+
+ private ToolDescriptors(final @NotNull Descriptor defaultDescriptor,
+ final @NotNull List<Descriptor> nonDefaultDescriptors) {
+ myDefaultDescriptor = defaultDescriptor;
+ myNonDefaultDescriptors = nonDefaultDescriptors;
+ }
+
+ public static ToolDescriptors fromScopeToolState(final ScopeToolState state,
+ final InspectionProfileImpl profile,
+ final Project project) {
+ final InspectionToolWrapper toolWrapper = state.getTool();
+ final List<ScopeToolState> nonDefaultTools = profile.getNonDefaultTools(toolWrapper.getShortName(), project);
+ final ArrayList<Descriptor> descriptors = new ArrayList<Descriptor>(nonDefaultTools.size());
+ for (final ScopeToolState nonDefaultToolState : nonDefaultTools) {
+ descriptors.add(new Descriptor(nonDefaultToolState, profile, project));
+ }
+ return new ToolDescriptors(new Descriptor(state, profile, project), descriptors);
+ }
+
+ @NotNull
+ public Descriptor getDefaultDescriptor() {
+ return myDefaultDescriptor;
+ }
+
+ @NotNull
+ public List<Descriptor> getNonDefaultDescriptors() {
+ return myNonDefaultDescriptors;
+ }
+
+ @NotNull
+ public ScopeToolState getDefaultScopeToolState() {
+ return myDefaultDescriptor.getState();
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/actions/AddScopeAction.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/actions/AddScopeAction.java
deleted file mode 100644
index 3a10319..0000000
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/actions/AddScopeAction.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright 2000-2012 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.
- */
-
-/*
- * User: anna
- * Date: 14-May-2009
- */
-package com.intellij.profile.codeInspection.ui.actions;
-
-import com.intellij.codeHighlighting.HighlightDisplayLevel;
-import com.intellij.codeInspection.ex.Descriptor;
-import com.intellij.codeInspection.ex.InspectionProfileImpl;
-import com.intellij.codeInspection.ex.InspectionToolWrapper;
-import com.intellij.codeInspection.ex.ScopeToolState;
-import com.intellij.openapi.actionSystem.*;
-import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.project.ProjectManager;
-import com.intellij.openapi.roots.ProjectRootManager;
-import com.intellij.openapi.ui.Messages;
-import com.intellij.packageDependencies.DefaultScopesProvider;
-import com.intellij.profile.codeInspection.ui.InspectionConfigTreeNode;
-import com.intellij.psi.search.scope.packageSet.CustomScopesProviderEx;
-import com.intellij.psi.search.scope.packageSet.NamedScope;
-import com.intellij.psi.search.scope.packageSet.NamedScopesHolder;
-import com.intellij.ui.treeStructure.Tree;
-import com.intellij.util.ArrayUtil;
-import com.intellij.util.IconUtil;
-
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreePath;
-import java.util.*;
-
-public abstract class AddScopeAction extends AnAction {
- private final Tree myTree;
- private static final Logger LOG = Logger.getInstance("#" + AddScopeAction.class.getName());
-
- public AddScopeAction(Tree tree) {
- super("Add Scope", "Add Scope", IconUtil.getAddIcon());
- myTree = tree;
- registerCustomShortcutSet(CommonShortcuts.INSERT, myTree);
- }
-
- @Override
- public void update(AnActionEvent e) {
- final Presentation presentation = e.getPresentation();
- presentation.setEnabled(false);
- if (getSelectedProfile() == null) return;
- final Project project = getProject(e);
- final InspectionConfigTreeNode[] selectedNodes = myTree.getSelectedNodes(InspectionConfigTreeNode.class, null);
- if (selectedNodes == null) return;
- final List<Descriptor> descriptors = new ArrayList<Descriptor>();
- for (InspectionConfigTreeNode node : selectedNodes) {
- collect(descriptors, new ArrayList<InspectionConfigTreeNode>(), node);
- }
-
- presentation.setEnabled(!getAvailableScopes(project, descriptors).isEmpty());
- }
-
- private static Project getProject(AnActionEvent e) {
- Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
- if (project == null) {
- project = ProjectManager.getInstance().getDefaultProject();
- }
- return project;
- }
-
- @Override
- public void actionPerformed(AnActionEvent e) {
- final List<Descriptor> descriptors = new ArrayList<Descriptor>();
- final InspectionConfigTreeNode[] selectedNodes = myTree.getSelectedNodes(InspectionConfigTreeNode.class, null);
- LOG.assertTrue(selectedNodes != null);
-
- final List<InspectionConfigTreeNode> nodes = new ArrayList<InspectionConfigTreeNode>(Arrays.asList(selectedNodes));
- for (InspectionConfigTreeNode node : selectedNodes) {
- collect(descriptors, nodes, node);
- }
-
- final Project project = getProject(e);
- final List<String> availableScopes = getAvailableScopes(project, descriptors);
- final int idx = Messages.showChooseDialog(myTree, "Scope:", "Choose Scope", ArrayUtil.toStringArray(availableScopes), availableScopes.get(0), Messages.getQuestionIcon());
- if (idx == -1) return;
- final NamedScope chosenScope = NamedScopesHolder.getScope(project, availableScopes.get(idx));
-
- for (InspectionConfigTreeNode node : nodes) {
- final Descriptor descriptor = node.getDescriptor();
- if (node.getScopeName() != null || descriptor == null) continue;
- final InspectionToolWrapper toolWrapper = descriptor.getToolWrapper(); //copy
- InspectionProfileImpl selectedProfile = getSelectedProfile();
- HighlightDisplayLevel level = selectedProfile.getErrorLevel(descriptor.getKey(), chosenScope, project);
- boolean enabled = selectedProfile.isToolEnabled(descriptor.getKey());
- final ScopeToolState scopeToolState = selectedProfile.addScope(toolWrapper, chosenScope, level, enabled, project);
- final Descriptor addedDescriptor = new Descriptor(scopeToolState, selectedProfile, project);
- if (node.getChildCount() == 0) {
- node.add(new InspectionConfigTreeNode(descriptor, selectedProfile.getToolDefaultState(descriptor.getKey().toString(), project), true, true, false));
- }
- node.insert(new InspectionConfigTreeNode(addedDescriptor, scopeToolState, false, false), 0);
- node.setInspectionNode(false);
- node.dropCache();
- ((DefaultTreeModel)myTree.getModel()).reload(node);
- myTree.expandPath(new TreePath(node.getPath()));
- }
- myTree.revalidate();
- }
-
- private static void collect(List<Descriptor> descriptors,
- List<InspectionConfigTreeNode> nodes,
- InspectionConfigTreeNode node) {
- final Descriptor descriptor = node.getDescriptor();
- if (descriptor != null) {
- if (node.getScopeName() == null) {
- descriptors.add(descriptor);
- }
- } else if (node.getUserObject() instanceof String) {
- for(int i = 0; i < node.getChildCount(); i++) {
- final InspectionConfigTreeNode childNode = (InspectionConfigTreeNode)node.getChildAt(i);
- nodes.add(childNode);
- collect(descriptors, nodes, childNode);
- }
- }
- }
-
- private List<String> getAvailableScopes(Project project, List<Descriptor> descriptors) {
- final ArrayList<NamedScope> scopes = new ArrayList<NamedScope>();
- for (NamedScopesHolder holder : NamedScopesHolder.getAllNamedScopeHolders(project)) {
- Collections.addAll(scopes, holder.getScopes());
- }
- scopes.remove(CustomScopesProviderEx.getAllScope());
-
- CustomScopesProviderEx.filterNoSettingsScopes(project, scopes);
-
- final Set<NamedScope> used = new HashSet<NamedScope>();
- for (Descriptor descriptor : descriptors) {
- final List<ScopeToolState> nonDefaultTools = getSelectedProfile().getNonDefaultTools(descriptor.getKey().toString(), project);
- if (nonDefaultTools != null) {
- for (ScopeToolState state : nonDefaultTools) {
- used.add(state.getScope(project));
- }
- }
- }
- scopes.removeAll(used);
-
- final List<String> availableScopes = new ArrayList<String>();
- for (NamedScope scope : scopes) {
- availableScopes.add(scope.getName());
- }
- return availableScopes;
- }
-
- protected abstract InspectionProfileImpl getSelectedProfile();
-}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/actions/DeleteScopeAction.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/actions/DeleteScopeAction.java
deleted file mode 100644
index 1fc94c2..0000000
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/actions/DeleteScopeAction.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2000-2012 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.
- */
-
-/*
- * User: anna
- * Date: 14-May-2009
- */
-package com.intellij.profile.codeInspection.ui.actions;
-
-import com.intellij.codeInsight.daemon.HighlightDisplayKey;
-import com.intellij.codeInspection.ex.Descriptor;
-import com.intellij.codeInspection.ex.InspectionProfileImpl;
-import com.intellij.openapi.actionSystem.AnAction;
-import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.CommonShortcuts;
-import com.intellij.openapi.actionSystem.Presentation;
-import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.profile.codeInspection.ui.InspectionConfigTreeNode;
-import com.intellij.ui.treeStructure.Tree;
-import com.intellij.util.PlatformIcons;
-
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreePath;
-
-public abstract class DeleteScopeAction extends AnAction {
- private static final Logger LOG = Logger.getInstance("#" + DeleteScopeAction.class.getName());
- private final Tree myTree;
-
- public DeleteScopeAction(Tree tree) {
- super("Delete Scope", "Delete Scope", PlatformIcons.DELETE_ICON);
- myTree = tree;
- registerCustomShortcutSet(CommonShortcuts.getDelete(), myTree);
- }
-
- @Override
- public void update(AnActionEvent e) {
- final Presentation presentation = e.getPresentation();
- presentation.setEnabled(false);
- if (getSelectedProfile() == null) return;
- final InspectionConfigTreeNode[] nodes = myTree.getSelectedNodes(InspectionConfigTreeNode.class, null);
- if (nodes.length > 0) {
- for (InspectionConfigTreeNode node : nodes) {
- if (node.getScopeName() == null || node.isByDefault()) return;
- }
- presentation.setEnabled(true);
- }
- }
-
- @Override
- public void actionPerformed(AnActionEvent e) {
- InspectionConfigTreeNode parent = null;
- final InspectionConfigTreeNode[] nodes = myTree.getSelectedNodes(InspectionConfigTreeNode.class, null);
- for (InspectionConfigTreeNode node : nodes) {
- final Descriptor descriptor = node.getDescriptor();
- LOG.assertTrue(descriptor != null);
- parent = (InspectionConfigTreeNode)node.getParent();
- final HighlightDisplayKey key = descriptor.getKey();
- if (parent.getChildCount() <= 2) { //remove default with last non-default
- getSelectedProfile().removeAllScopes(key.toString(), e.getProject());
- parent.removeAllChildren();
- parent.setInspectionNode(true);
- parent.setByDefault(true);
- }
- else {
- getSelectedProfile().removeScope(key.toString(), parent.getIndex(node), e.getProject());
- node.removeFromParent();
- }
- ((DefaultTreeModel)myTree.getModel()).reload(parent);
- }
- if (parent != null) {
- myTree.setSelectionPath(new TreePath(parent.getPath()));
- }
- myTree.revalidate();
- }
-
- protected abstract InspectionProfileImpl getSelectedProfile();
-}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/actions/MoveScopeAction.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/actions/MoveScopeAction.java
deleted file mode 100644
index 40d4b43..0000000
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/actions/MoveScopeAction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2000-2012 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.
- */
-
-/*
- * User: anna
- * Date: 14-May-2009
- */
-package com.intellij.profile.codeInspection.ui.actions;
-
-import com.intellij.codeInspection.ex.Descriptor;
-import com.intellij.codeInspection.ex.InspectionProfileImpl;
-import com.intellij.openapi.actionSystem.AnAction;
-import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.Presentation;
-import com.intellij.profile.codeInspection.ui.InspectionConfigTreeNode;
-import com.intellij.ui.treeStructure.Tree;
-
-import javax.swing.*;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-
-public abstract class MoveScopeAction extends AnAction {
- private final Tree myTree;
- private final int myDir;
-
- public MoveScopeAction(Tree tree, String text, Icon icon, int dir) {
- super(text, text, icon);
- myTree = tree;
- myDir = dir;
- }
-
- protected abstract boolean isEnabledFor(int idx, InspectionConfigTreeNode parent);
-
-
- @Override
- public void update(AnActionEvent e) {
- final Presentation presentation = e.getPresentation();
- presentation.setEnabled(false);
- if (getSelectedProfile() == null) return;
- final InspectionConfigTreeNode[] nodes = myTree.getSelectedNodes(InspectionConfigTreeNode.class, null);
- if (nodes.length > 0) {
- final InspectionConfigTreeNode treeNode = nodes[0];
- if (treeNode.getScope(getEventProject(e)) != null && !treeNode.isByDefault()) {
- final TreeNode parent = treeNode.getParent();
- final int index = parent.getIndex(treeNode);
- presentation.setEnabled(isEnabledFor(index, (InspectionConfigTreeNode)parent));
- }
- }
- }
-
- @Override
- public void actionPerformed(AnActionEvent e) {
- final InspectionConfigTreeNode[] nodes = myTree.getSelectedNodes(InspectionConfigTreeNode.class, null);
- final InspectionConfigTreeNode node = nodes[0];
- final Descriptor descriptor = node.getDescriptor();
- final TreeNode parent = node.getParent();
- final int index = parent.getIndex(node);
- getSelectedProfile().moveScope(descriptor.getKey().toString(), index, myDir, e.getProject());
- node.removeFromParent();
- ((InspectionConfigTreeNode)parent).insert(node, index + myDir);
- ((DefaultTreeModel)myTree.getModel()).reload(parent);
- myTree.setSelectionPath(new TreePath(node.getPath()));
- myTree.revalidate();
- }
-
- protected abstract InspectionProfileImpl getSelectedProfile();
-}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionFilterAction.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionFilterAction.java
new file mode 100644
index 0000000..cbd1c24
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionFilterAction.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui.filter;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
+import com.intellij.codeInspection.ex.InspectionProfileImpl;
+import com.intellij.icons.AllIcons;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DefaultActionGroup;
+import com.intellij.openapi.actionSystem.ex.CheckboxAction;
+import com.intellij.profile.codeInspection.SeverityProvider;
+import com.intellij.profile.codeInspection.ui.LevelChooserAction;
+import com.intellij.profile.codeInspection.ui.SingleInspectionProfilePanel;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.SortedSet;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public class InspectionFilterAction extends DefaultActionGroup {
+
+ private final SeverityRegistrar mySeverityRegistrar;
+ private final InspectionsFilter myInspectionsFilter;
+
+ public InspectionFilterAction(final InspectionProfileImpl profile, final InspectionsFilter inspectionsFilter) {
+ super("Filter Inspections", true);
+ myInspectionsFilter = inspectionsFilter;
+ mySeverityRegistrar = ((SeverityProvider)profile.getProfileManager()).getOwnSeverityRegistrar();
+ getTemplatePresentation().setIcon(AllIcons.General.Filter);
+ tune();
+ }
+
+ private void tune() {
+ addAction(new ShowEnabledOrDisabledInspectionsAction(null));
+ addAction(new ShowEnabledOrDisabledInspectionsAction(true));
+ addAction(new ShowEnabledOrDisabledInspectionsAction(false));
+ addSeparator();
+
+ final SortedSet<HighlightSeverity> severities = LevelChooserAction.getSeverities(mySeverityRegistrar);
+ for (final HighlightSeverity severity : severities) {
+ add(new ShowWithSpecifiedSeverityInspectionsAction(severity));
+ }
+ addSeparator();
+
+ add(new ShowAvailableOnlyOnAnalyzeInspectionsAction());
+ }
+
+ private class ShowAvailableOnlyOnAnalyzeInspectionsAction extends CheckboxAction {
+
+ public ShowAvailableOnlyOnAnalyzeInspectionsAction() {
+ super("Show Only \"Available only for Analyze | Inspect Code\"");
+ }
+
+ @Override
+ public boolean isSelected(final AnActionEvent e) {
+ return myInspectionsFilter.isAvailableOnlyForAnalyze();
+ }
+
+ @Override
+ public void setSelected(final AnActionEvent e, final boolean state) {
+ myInspectionsFilter.setAvailableOnlyForAnalyze(state);
+ }
+ }
+
+ private class ShowWithSpecifiedSeverityInspectionsAction extends CheckboxAction {
+
+ private final HighlightSeverity mySeverity;
+
+ private ShowWithSpecifiedSeverityInspectionsAction(final HighlightSeverity severity) {
+ super(SingleInspectionProfilePanel.renderSeverity(severity),
+ null,
+ HighlightDisplayLevel.find(severity).getIcon());
+ mySeverity = severity;
+ }
+
+
+ @Override
+ public boolean isSelected(final AnActionEvent e) {
+ return myInspectionsFilter.containsSeverity(mySeverity);
+ }
+
+ @Override
+ public void setSelected(final AnActionEvent e, final boolean state) {
+ if (state) {
+ myInspectionsFilter.add(mySeverity);
+ } else {
+ myInspectionsFilter.remove(mySeverity);
+ }
+ }
+ }
+
+ private class ShowEnabledOrDisabledInspectionsAction extends CheckboxAction {
+
+ private final Boolean myShowEnabledActions;
+
+ public ShowEnabledOrDisabledInspectionsAction(@Nullable final Boolean showEnabledActions) {
+ super(showEnabledActions == null ? "All Inspections" : (showEnabledActions ? "Enabled" : "Disabled"));
+ myShowEnabledActions = showEnabledActions;
+ }
+
+
+ @Override
+ public boolean isSelected(final AnActionEvent e) {
+ return myInspectionsFilter.getSuitableInspectionsStates() == myShowEnabledActions;
+ }
+
+ @Override
+ public void setSelected(final AnActionEvent e, final boolean state) {
+ myInspectionsFilter.setSuitableInspectionsStates(myShowEnabledActions);
+ }
+ }
+}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionsFilter.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionsFilter.java
new file mode 100644
index 0000000..432ef56
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionsFilter.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui.filter;
+
+import com.intellij.codeInspection.ex.GlobalInspectionToolWrapper;
+import com.intellij.codeInspection.ex.InspectionToolWrapper;
+import com.intellij.codeInspection.ex.ScopeToolState;
+import com.intellij.codeInspection.ex.Tools;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.util.containers.HashSet;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Set;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public abstract class InspectionsFilter {
+
+ private final Set<HighlightSeverity> mySuitableSeverities = new HashSet<HighlightSeverity>();
+ private Boolean mySuitableInspectionsStates;
+ private boolean myAvailableOnlyForAnalyze;
+
+ public boolean isAvailableOnlyForAnalyze() {
+ return myAvailableOnlyForAnalyze;
+ }
+
+ public Boolean getSuitableInspectionsStates() {
+ return mySuitableInspectionsStates;
+ }
+
+ public boolean containsSeverity(final HighlightSeverity severity) {
+ return mySuitableSeverities.contains(severity);
+ }
+
+ public void setAvailableOnlyForAnalyze(final boolean availableOnlyForAnalyze) {
+ myAvailableOnlyForAnalyze = availableOnlyForAnalyze;
+ filterChanged();
+ }
+
+ public void setSuitableInspectionsStates(@Nullable final Boolean suitableInspectionsStates) {
+ mySuitableInspectionsStates = suitableInspectionsStates;
+ filterChanged();
+ }
+
+ public void add(final HighlightSeverity severity) {
+ mySuitableSeverities.add(severity);
+ filterChanged();
+ }
+
+ public void remove(final HighlightSeverity severity) {
+ mySuitableSeverities.remove(severity);
+ filterChanged();
+ }
+
+ public boolean isEmptyFilter() {
+ return mySuitableInspectionsStates == null && !myAvailableOnlyForAnalyze && mySuitableSeverities.isEmpty();
+ }
+
+ public boolean matches(final Tools tools) {
+ if (mySuitableInspectionsStates != null && mySuitableInspectionsStates != tools.isEnabled()) {
+ return false;
+ }
+
+ if (myAvailableOnlyForAnalyze != isAvailableOnlyForAnalyze(tools)) {
+ return false;
+ }
+
+ if (mySuitableSeverities.isEmpty()) {
+ return true;
+ }
+ for (final ScopeToolState state : tools.getTools()) {
+ if (mySuitableInspectionsStates != null && mySuitableInspectionsStates != state.isEnabled()) {
+ continue;
+ }
+ if (mySuitableSeverities.contains(tools.getDefaultState().getLevel().getSeverity())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected abstract void filterChanged();
+
+ private static boolean isAvailableOnlyForAnalyze(final Tools tools) {
+ final InspectionToolWrapper tool = tools.getTool();
+ return tool instanceof GlobalInspectionToolWrapper && ((GlobalInspectionToolWrapper)tool).worksInBatchModeOnly();
+ }
+}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionConfigTreeNode.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionConfigTreeNode.java
new file mode 100644
index 0000000..1f26308
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionConfigTreeNode.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2000-2012 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.profile.codeInspection.ui.inspectionsTree;
+
+import com.intellij.codeInsight.daemon.HighlightDisplayKey;
+import com.intellij.codeInspection.ex.Descriptor;
+import com.intellij.openapi.util.ClearableLazyValue;
+import com.intellij.profile.codeInspection.ui.ToolDescriptors;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+
+/**
+ * @author anna
+ * @since 14-May-2009
+ */
+public class InspectionConfigTreeNode extends DefaultMutableTreeNode {
+ private final ClearableLazyValue<Boolean> myProperSetting = new ClearableLazyValue<Boolean>() {
+ @NotNull
+ @Override
+ protected Boolean compute() {
+ ToolDescriptors descriptors = getDescriptors();
+ if (descriptors != null) {
+ final Descriptor defaultDescriptor = descriptors.getDefaultDescriptor();
+ return defaultDescriptor.getInspectionProfile().isProperSetting(defaultDescriptor.getToolWrapper().getShortName());
+ }
+ for (int i = 0; i < getChildCount(); i++) {
+ InspectionConfigTreeNode node = (InspectionConfigTreeNode)getChildAt(i);
+ if (node.isProperSetting()) {
+ return true;
+ }
+ }
+ return false;
+ }
+ };
+
+ public InspectionConfigTreeNode(@NotNull Object userObject) {
+ super(userObject);
+ }
+
+ public HighlightDisplayKey getKey() {
+ return getDefaultDescriptor().getKey();
+ }
+
+ @Nullable
+ public Descriptor getDefaultDescriptor() {
+ final ToolDescriptors descriptors = getDescriptors();
+ return descriptors == null ? null : descriptors.getDefaultDescriptor();
+ }
+
+ @Nullable
+ public ToolDescriptors getDescriptors() {
+ if (userObject instanceof String) return null;
+ return (ToolDescriptors)userObject;
+ }
+
+ @Nullable
+ public String getGroupName() {
+ return userObject instanceof String ? (String)userObject : null;
+ }
+
+ @Nullable
+ public String getScopeName() {
+ final ToolDescriptors descriptors = getDescriptors();
+ return descriptors != null ? descriptors.getDefaultScopeToolState().getScopeName() : null;
+ }
+
+ public boolean isProperSetting() {
+ return myProperSetting.getValue();
+ }
+
+ public void dropCache() {
+ myProperSetting.drop();
+ }
+
+ @Override
+ public String toString() {
+ if (userObject instanceof Descriptor) {
+ return ((Descriptor)userObject).getText();
+ }
+ return super.toString();
+ }
+}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeComparator.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeComparator.java
similarity index 80%
rename from platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeComparator.java
rename to platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeComparator.java
index fe60c51..b920b0b 100644
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeComparator.java
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeComparator.java
@@ -18,9 +18,9 @@
* User: anna
* Date: 14-May-2009
*/
-package com.intellij.profile.codeInspection.ui;
+package com.intellij.profile.codeInspection.ui.inspectionsTree;
-import com.intellij.codeInspection.ex.Descriptor;
+import com.intellij.profile.codeInspection.ui.ToolDescriptors;
import java.util.Comparator;
@@ -44,11 +44,11 @@
return getDisplayTextToSort(s1).compareToIgnoreCase(getDisplayTextToSort(s2));
}
- final Descriptor descriptor1 = o1.getDescriptor();
- final Descriptor descriptor2 = o2.getDescriptor();
- if (descriptor1 != null && descriptor2 != null) {
- s1 = descriptor1.getText();
- s2 = descriptor2.getText();
+ final ToolDescriptors descriptors1 = o1.getDescriptors();
+ final ToolDescriptors descriptors2 = o2.getDescriptors();
+ if (descriptors1 != null && descriptors2 != null) {
+ s1 = descriptors1.getDefaultDescriptor().getText();
+ s2 = descriptors2.getDefaultDescriptor().getText();
}
if (s1 != null && s2 != null) {
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeRenderer.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeRenderer.java
similarity index 68%
rename from platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeRenderer.java
rename to platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeRenderer.java
index 8094a1b..43b791c 100644
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeRenderer.java
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeRenderer.java
@@ -18,7 +18,7 @@
* User: anna
* Date: 14-May-2009
*/
-package com.intellij.profile.codeInspection.ui;
+package com.intellij.profile.codeInspection.ui.inspectionsTree;
import com.intellij.codeInspection.InspectionsBundle;
import com.intellij.codeInspection.ex.Descriptor;
@@ -26,29 +26,23 @@
import com.intellij.codeInspection.ex.InspectionToolWrapper;
import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
import com.intellij.ide.ui.search.SearchUtil;
-import com.intellij.openapi.project.Project;
-import com.intellij.ui.CheckboxTree;
-import com.intellij.ui.JBColor;
+import com.intellij.profile.codeInspection.ui.ToolDescriptors;
+import com.intellij.ui.ColoredTreeCellRenderer;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.ui.PlatformColors;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.*;
-abstract class InspectionsConfigTreeRenderer extends CheckboxTree.CheckboxTreeCellRenderer {
- private final Project myProject;
-
- public InspectionsConfigTreeRenderer(Project project) {
- myProject = project;
- }
-
+public abstract class InspectionsConfigTreeRenderer extends ColoredTreeCellRenderer {
protected abstract String getFilter();
@Override
- public void customizeRenderer(final JTree tree,
+ public void customizeCellRenderer(@NotNull final JTree tree,
final Object value,
final boolean selected,
final boolean expanded,
@@ -73,41 +67,25 @@
style = SimpleTextAttributes.STYLE_BOLD;
}
else {
- final Descriptor descriptor = node.getDescriptor();
- final String scopeName = node.getScopeName();
- if (scopeName != null) {
- if (node.isByDefault()) {
- text = "Everywhere else";
- }
- else {
- text = "In scope \'" + scopeName + "\'";
- if (node.getScope(myProject) == null) {
- foreground = JBColor.RED;
- }
- }
- } else {
- text = descriptor.getText();
- }
- hint = getHint(descriptor);
+ final ToolDescriptors descriptors = node.getDescriptors();
+ assert descriptors != null;
+ final Descriptor defaultDescriptor = descriptors.getDefaultDescriptor();
+ text = defaultDescriptor.getText();
+ hint = getHint(defaultDescriptor);
}
if (text != null) {
- SearchUtil.appendFragments(getFilter(), text, style, foreground, background,
- getTextRenderer());
+ SearchUtil.appendFragments(getFilter(), text, style, foreground, background, this);
}
if (hint != null) {
- getTextRenderer()
- .append(" " + hint, selected ? new SimpleTextAttributes(Font.PLAIN, foreground) : SimpleTextAttributes.GRAYED_ATTRIBUTES);
+ append(" " + hint, selected ? new SimpleTextAttributes(Font.PLAIN, foreground) : SimpleTextAttributes.GRAYED_ATTRIBUTES);
}
setForeground(foreground);
}
@Nullable
- private static String getHint(Descriptor descriptor) {
+ private static String getHint(final Descriptor descriptor) {
final InspectionToolWrapper toolWrapper = descriptor.getToolWrapper();
- if (toolWrapper == null) {
- return InspectionsBundle.message("inspection.tool.availability.in.tree.node");
- }
if (toolWrapper instanceof LocalInspectionToolWrapper ||
toolWrapper instanceof GlobalInspectionToolWrapper && !((GlobalInspectionToolWrapper)toolWrapper).worksInBatchModeOnly()) {
return null;
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java
new file mode 100644
index 0000000..966a456
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui.inspectionsTree;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.daemon.HighlightDisplayKey;
+import com.intellij.codeInspection.ex.InspectionProfileImpl;
+import com.intellij.codeInspection.ex.ScopeToolState;
+import com.intellij.ide.IdeTooltip;
+import com.intellij.ide.IdeTooltipManager;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.profile.codeInspection.ui.InspectionsAggregationUtil;
+import com.intellij.profile.codeInspection.ui.table.ScopesAndSeveritiesTable;
+import com.intellij.profile.codeInspection.ui.table.ThreeStateCheckBoxRenderer;
+import com.intellij.ui.treeStructure.treetable.TreeTable;
+import com.intellij.ui.treeStructure.treetable.TreeTableModel;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.table.TableColumn;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeNode;
+import java.awt.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.*;
+import java.util.List;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public class InspectionsConfigTreeTable extends TreeTable {
+ private final static Logger LOG = Logger.getInstance(InspectionsConfigTreeTable.class);
+
+ private final static int TREE_COLUMN = 0;
+ private final static int SEVERITIES_COLUMN = 1;
+ private final static int IS_ENABLED_COLUMN = 2;
+
+ public InspectionsConfigTreeTable(final InspectionsConfigTreeTableSettings settings) {
+ super(new InspectionsConfigTreeTableModel(settings));
+
+ final TableColumn severitiesColumn = getColumnModel().getColumn(SEVERITIES_COLUMN);
+ severitiesColumn.setMaxWidth(20);
+
+ final TableColumn isEnabledColumn = getColumnModel().getColumn(IS_ENABLED_COLUMN);
+ isEnabledColumn.setMaxWidth(20);
+ isEnabledColumn.setCellRenderer(new ThreeStateCheckBoxRenderer());
+ isEnabledColumn.setCellEditor(new ThreeStateCheckBoxRenderer());
+
+ addMouseMotionListener(new MouseAdapter() {
+ @Override
+ public void mouseMoved(final MouseEvent e) {
+ final Point point = e.getPoint();
+ final int column = columnAtPoint(point);
+ if (column != SEVERITIES_COLUMN) {
+ return;
+ }
+ final int row = rowAtPoint(point);
+ final Object maybeIcon = getModel().getValueAt(row, column);
+ if (maybeIcon instanceof MultiScopeSeverityIcon) {
+ final LinkedHashMap<String, HighlightSeverity> scopeToAverageSeverityMap =
+ ((MultiScopeSeverityIcon)maybeIcon).getScopeToAverageSeverityMap();
+ IdeTooltipManager.getInstance().show(new IdeTooltip(InspectionsConfigTreeTable.this, point, new ScopesAndSeveritiesHintTable(scopeToAverageSeverityMap)), false);
+ }
+ }
+ });
+ }
+
+ public abstract static class InspectionsConfigTreeTableSettings {
+ private final TreeNode myRoot;
+ private final Project myProject;
+
+ public InspectionsConfigTreeTableSettings(final TreeNode root, final Project project) {
+ myRoot = root;
+ myProject = project;
+ }
+
+ public TreeNode getRoot() {
+ return myRoot;
+ }
+
+ public Project getProject() {
+ return myProject;
+ }
+
+ protected abstract InspectionProfileImpl getInspectionProfile();
+
+ protected abstract void onChanged(InspectionConfigTreeNode node);
+ }
+
+ private static class InspectionsConfigTreeTableModel extends DefaultTreeModel implements TreeTableModel {
+
+ private final InspectionsConfigTreeTableSettings mySettings;
+
+ public InspectionsConfigTreeTableModel(final InspectionsConfigTreeTableSettings settings) {
+ super(settings.getRoot());
+ mySettings = settings;
+ }
+
+ @Override
+ public int getColumnCount() {
+ return 3;
+ }
+
+ @Nullable
+ @Override
+ public String getColumnName(final int column) {
+ return null;
+ }
+
+ @Override
+ public Class getColumnClass(final int column) {
+ switch (column) {
+ case TREE_COLUMN:
+ return TreeTableModel.class;
+ case SEVERITIES_COLUMN:
+ return Icon.class;
+ case IS_ENABLED_COLUMN:
+ return Boolean.class;
+ }
+ throw new IllegalArgumentException();
+ }
+
+ @Nullable
+ @Override
+ public Object getValueAt(final Object node, final int column) {
+ if (column == TREE_COLUMN) {
+ return null;
+ }
+ final InspectionConfigTreeNode treeNode = (InspectionConfigTreeNode)node;
+ final List<HighlightDisplayKey> inspectionsKeys = InspectionsAggregationUtil.getInspectionsKeys(treeNode);
+ if (column == SEVERITIES_COLUMN) {
+ final MultiColoredHighlightSeverityIconSink sink = new MultiColoredHighlightSeverityIconSink();
+ for (final HighlightDisplayKey selectedInspectionsNode : inspectionsKeys) {
+ final String toolId = selectedInspectionsNode.toString();
+ if (mySettings.getInspectionProfile().getTools(toolId, mySettings.getProject()).isEnabled()) {
+ sink.put(mySettings.getInspectionProfile().getToolDefaultState(toolId, mySettings.getProject()),
+ mySettings.getInspectionProfile().getNonDefaultTools(toolId, mySettings.getProject()));
+ }
+ }
+ return sink.constructIcon();
+ } else if (column == IS_ENABLED_COLUMN) {
+ return isEnabled(inspectionsKeys);
+ }
+ throw new IllegalArgumentException();
+ }
+
+ @Nullable
+ private Boolean isEnabled(final List<HighlightDisplayKey> selectedInspectionsNodes) {
+ Boolean isPreviousEnabled = null;
+ for (final HighlightDisplayKey key : selectedInspectionsNodes) {
+ final boolean enabled = mySettings.getInspectionProfile().getTools(key.toString(), mySettings.getProject()).isEnabled();
+ if (isPreviousEnabled == null) {
+ isPreviousEnabled = enabled;
+ } else if (!isPreviousEnabled.equals(enabled)) {
+ return null;
+ }
+ }
+ return isPreviousEnabled;
+ }
+
+ @Override
+ public boolean isCellEditable(final Object node, final int column) {
+ return column == IS_ENABLED_COLUMN;
+ }
+
+ @Override
+ public void setValueAt(final Object aValue, final Object node, final int column) {
+ LOG.assertTrue(column == IS_ENABLED_COLUMN);
+ LOG.assertTrue(aValue != null);
+ final boolean doEnable = (Boolean) aValue;
+ for (final InspectionConfigTreeNode aNode : InspectionsAggregationUtil.getInspectionsNodes((InspectionConfigTreeNode) node)) {
+ final String toolId = aNode.getKey().toString();
+ if (doEnable) {
+ mySettings.getInspectionProfile().enableTool(toolId, mySettings.getProject());
+ } else {
+ mySettings.getInspectionProfile().disableTool(toolId, mySettings.getProject());
+ }
+ aNode.dropCache();
+ mySettings.onChanged(aNode);
+ }
+ }
+
+ @Override
+ public void setTree(final JTree tree) {
+ }
+ }
+
+ private static class MultiColoredHighlightSeverityIconSink {
+
+ private final LinkedHashMap<String, HighlightSeverity> myScopeToAverageSeverityMap = new LinkedHashMap<String, HighlightSeverity>();
+
+ private boolean myIsFirst = true;
+
+ public Icon constructIcon() {
+ if (myScopeToAverageSeverityMap.isEmpty()) {
+ return null;
+ }
+ //TODO order scopes
+ return !allScopesHasMixedSeverity()
+ ? new MultiScopeSeverityIcon(myScopeToAverageSeverityMap)
+ : ScopesAndSeveritiesTable.MIXED_FAKE_LEVEL.getIcon();
+ }
+
+ private boolean allScopesHasMixedSeverity() {
+ for (final Map.Entry<String, HighlightSeverity> e : myScopeToAverageSeverityMap.entrySet()) {
+ if (!ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY.equals(e.getValue())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public void put(final ScopeToolState defaultState, final Collection<ScopeToolState> nonDefault) {
+ putOne(defaultState);
+ for (final ScopeToolState scopeToolState : nonDefault) {
+ putOne(scopeToolState);
+ }
+ if (myIsFirst) {
+ myIsFirst = false;
+ }
+ }
+
+ public void putOne(final ScopeToolState state) {
+ final Icon icon = state.getLevel().getIcon();
+ final String scopeName = state.getScopeName();
+ if (icon instanceof HighlightDisplayLevel.SingleColorIconWithMask) {
+ if (myIsFirst) {
+ myScopeToAverageSeverityMap.put(scopeName, state.getLevel().getSeverity());
+ } else {
+ final HighlightSeverity severity = myScopeToAverageSeverityMap.get(scopeName);
+ if (!ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY.equals(severity) && !Comparing.equal(severity, state.getLevel().getSeverity())) {
+ myScopeToAverageSeverityMap.put(scopeName, ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY);
+ }
+ }
+ } else if (!ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY.equals(myScopeToAverageSeverityMap.get(scopeName))) {
+ myScopeToAverageSeverityMap.put(scopeName, ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY);
+ }
+ }
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/MultiScopeSeverityIcon.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/MultiScopeSeverityIcon.java
new file mode 100644
index 0000000..6f093ca
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/MultiScopeSeverityIcon.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui.inspectionsTree;
+
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.ui.JBColor;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public class MultiScopeSeverityIcon implements Icon {
+ private final static JBColor MIXED_SEVERITY_COLOR = JBColor.DARK_GRAY;
+
+ private final static int SIZE = 12;
+
+ private final LinkedHashMap<String, HighlightSeverity> myScopeToAverageSeverityMap;
+
+ public MultiScopeSeverityIcon(final LinkedHashMap<String, HighlightSeverity> scopeToAverageSeverityMap) {
+ myScopeToAverageSeverityMap = scopeToAverageSeverityMap;
+ }
+
+ public LinkedHashMap<String, HighlightSeverity> getScopeToAverageSeverityMap() {
+ return myScopeToAverageSeverityMap;
+ }
+
+ @Override
+ public void paintIcon(final Component c, final Graphics g, final int i, final int j) {
+ final int iconWidth = getIconWidth();
+
+ final int partWidth = iconWidth / myScopeToAverageSeverityMap.size();
+
+ final Collection<HighlightSeverity> values = myScopeToAverageSeverityMap.values();
+ int idx = 0;
+ for (final HighlightSeverity severity : values) {
+ final Icon icon = HighlightDisplayLevel.find(severity).getIcon();
+ g.setColor(icon instanceof HighlightDisplayLevel.SingleColorIconWithMask ?
+ ((HighlightDisplayLevel.SingleColorIconWithMask)icon).getColor() : MIXED_SEVERITY_COLOR);
+ final int x = i + partWidth * idx;
+ g.fillRect(x, j, partWidth, getIconHeight());
+ idx++;
+ }
+ g.drawImage(HighlightDisplayLevel.ImageHolder.ourErrorMaskImage, i, j, null);
+ }
+
+ @Override
+ public int getIconWidth() {
+ return SIZE;
+ }
+
+ @Override
+ public int getIconHeight() {
+ return SIZE;
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/ScopesAndSeveritiesHintTable.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/ScopesAndSeveritiesHintTable.java
new file mode 100644
index 0000000..05cb7ab
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/ScopesAndSeveritiesHintTable.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui.inspectionsTree;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.profile.codeInspection.ui.SingleInspectionProfilePanel;
+import com.intellij.ui.table.JBTable;
+
+import javax.swing.*;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public class ScopesAndSeveritiesHintTable extends JBTable {
+ private final static int SCOPE_COLUMN = 0;
+ private final static int SEVERITY_COLUMN = 1;
+
+ public ScopesAndSeveritiesHintTable(final LinkedHashMap<String, HighlightSeverity> scopeToAverageSeverityMap) {
+ super(new MyModel(scopeToAverageSeverityMap));
+
+ final DefaultTableCellRenderer cellRenderer = new DefaultTableCellRenderer();
+ cellRenderer.setOpaque(false);
+ getColumnModel().getColumn(SCOPE_COLUMN).setCellRenderer(cellRenderer);
+
+ getColumnModel().getColumn(SEVERITY_COLUMN).setCellRenderer(new DefaultTableCellRenderer() {
+ @Override
+ public Component getTableCellRendererComponent(final JTable table,
+ final Object value,
+ final boolean isSelected,
+ final boolean hasFocus,
+ final int row,
+ final int column) {
+ super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+ final HighlightSeverity severity = (HighlightSeverity)value;
+ setIcon(HighlightDisplayLevel.find(severity).getIcon());
+ setText(SingleInspectionProfilePanel.renderSeverity(severity));
+ setOpaque(false);
+ return this;
+ }
+ });
+ setShowGrid(false);
+ setRowSelectionAllowed(false);
+ setColumnSelectionAllowed(false);
+ setOpaque(false);
+ }
+
+ private final static class MyModel extends AbstractTableModel {
+
+ private final LinkedHashMap<String, HighlightSeverity> myScopeToAverageSeverityMap;
+ private final List<String> myScopes;
+
+ public MyModel(final LinkedHashMap<String, HighlightSeverity> scopeToAverageSeverityMap) {
+ myScopeToAverageSeverityMap = scopeToAverageSeverityMap;
+ myScopes = new ArrayList<String>(myScopeToAverageSeverityMap.keySet());
+ }
+
+ @Override
+ public Class<?> getColumnClass(final int columnIndex) {
+ switch (columnIndex) {
+ case SCOPE_COLUMN: return String.class;
+ case SEVERITY_COLUMN: return HighlightSeverity.class;
+ default: throw new IllegalArgumentException();
+ }
+ }
+
+ @Override
+ public int getRowCount() {
+ return myScopes.size();
+ }
+
+ @Override
+ public int getColumnCount() {
+ return 2;
+ }
+
+ @Override
+ public Object getValueAt(final int rowIndex, final int columnIndex) {
+ switch (columnIndex) {
+ case SCOPE_COLUMN: return myScopes.get(rowIndex);
+ case SEVERITY_COLUMN: return myScopeToAverageSeverityMap.get(myScopes.get(rowIndex));
+ default: throw new IllegalArgumentException();
+ }
+
+ }
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ScopesAndSeveritiesTable.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ScopesAndSeveritiesTable.java
new file mode 100644
index 0000000..ad7dc94
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ScopesAndSeveritiesTable.java
@@ -0,0 +1,404 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui.table;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.daemon.HighlightDisplayKey;
+import com.intellij.codeInspection.ex.InspectionProfileImpl;
+import com.intellij.codeInspection.ex.ScopeToolState;
+import com.intellij.icons.AllIcons;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.profile.codeInspection.ui.AddScopeUtil;
+import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionConfigTreeNode;
+import com.intellij.psi.search.scope.packageSet.NamedScope;
+import com.intellij.ui.table.JBTable;
+import com.intellij.ui.treeStructure.treetable.TreeTable;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.SmartList;
+import com.intellij.util.ui.EditableModel;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableColumnModel;
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public class ScopesAndSeveritiesTable extends JBTable {
+ private final static Logger LOG = Logger.getInstance(ScopesAndSeveritiesTable.class);
+
+ public static final HighlightSeverity MIXED_FAKE_SEVERITY = new HighlightSeverity("Mixed", -1);
+ @SuppressWarnings("UnusedDeclaration")
+ public static final HighlightDisplayLevel MIXED_FAKE_LEVEL = new HighlightDisplayLevel(MIXED_FAKE_SEVERITY, AllIcons.Actions.Help);
+
+ private final static int SCOPE_ENABLED_COLUMN = 0;
+ private final static int SCOPE_NAME_COLUMN = 1;
+ private final static int SEVERITY_COLUMN = 2;
+
+ public ScopesAndSeveritiesTable(final TableSettings tableSettings) {
+ super(new MyTableModel(tableSettings));
+
+ final TableColumnModel columnModel = getColumnModel();
+
+ final TableColumn scopeEnabledColumn = columnModel.getColumn(SCOPE_ENABLED_COLUMN);
+ scopeEnabledColumn.setMaxWidth(30);
+ scopeEnabledColumn.setCellRenderer(new ThreeStateCheckBoxRenderer());
+ scopeEnabledColumn.setCellEditor(new ThreeStateCheckBoxRenderer());
+
+ final TableColumn severityColumn = columnModel.getColumn(SEVERITY_COLUMN);
+ severityColumn.setCellRenderer(SeverityRenderer.create(tableSettings.getInspectionProfile()));
+ severityColumn.setCellEditor(SeverityRenderer.create(tableSettings.getInspectionProfile()));
+
+ setColumnSelectionAllowed(false);
+ setRowSelectionAllowed(true);
+ setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+
+ getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+ @Override
+ public void valueChanged(final ListSelectionEvent e) {
+ final int idx = getSelectionModel().getMinSelectionIndex();
+ if (idx >= 0) {
+ final ExistedScopesStatesAndNonExistNames scopeToolState = ((MyTableModel)getModel()).getScopeToolState(idx);
+ final List<ScopeToolState> existedStates = scopeToolState.getExistedStates();
+ if (existedStates.size() == 1) {
+ tableSettings.onScopeChosen(existedStates.get(0));
+ }
+ }
+ }
+ });
+ setRowSelectionInterval(0, 0);
+
+ setStriped(true);
+ setShowGrid(false);
+ }
+
+ public abstract static class TableSettings {
+ private final List<InspectionConfigTreeNode> myNodes;
+ private final List<String> myKeyNames;
+ private final List<HighlightDisplayKey> myKeys;
+ private final InspectionProfileImpl myInspectionProfile;
+ private final TreeTable myTreeTable;
+ private final Project myProject;
+
+ protected TableSettings(final List<InspectionConfigTreeNode> nodes,
+ final InspectionProfileImpl inspectionProfile,
+ final TreeTable treeTable,
+ final Project project) {
+ myNodes = nodes;
+ myKeys = new ArrayList<HighlightDisplayKey>(myNodes.size());
+ myKeyNames = new ArrayList<String>(myNodes.size());
+ for(final InspectionConfigTreeNode node : nodes) {
+ final HighlightDisplayKey key = node.getDefaultDescriptor().getKey();
+ myKeys.add(key);
+ myKeyNames.add(key.toString());
+ }
+
+ myInspectionProfile = inspectionProfile;
+ myTreeTable = treeTable;
+ myProject = project;
+ }
+
+ public List<HighlightDisplayKey> getKeys() {
+ return myKeys;
+ }
+
+ public List<String> getKeyNames() {
+ return myKeyNames;
+ }
+
+ public List<InspectionConfigTreeNode> getNodes() {
+ return myNodes;
+ }
+
+ public InspectionProfileImpl getInspectionProfile() {
+ return myInspectionProfile;
+ }
+
+ public TreeTable getTreeTable() {
+ return myTreeTable;
+ }
+
+ public Project getProject() {
+ return myProject;
+ }
+
+ protected abstract void onScopeAdded();
+
+ protected abstract void onScopeRemoved(final int scopesCount);
+
+ protected abstract void onScopeChosen(final @NotNull ScopeToolState scopeToolState);
+
+ protected abstract void onChange();
+ }
+
+ @NotNull
+ public static HighlightSeverity getSeverity(final List<ScopeToolState> scopeToolStates) {
+ HighlightSeverity previousValue = null;
+ for (final ScopeToolState scopeToolState : scopeToolStates) {
+ final HighlightSeverity currentValue = scopeToolState.getLevel().getSeverity();
+ if (previousValue == null) {
+ previousValue = currentValue;
+ } else if (!previousValue.equals(currentValue)){
+ return MIXED_FAKE_SEVERITY;
+ }
+ }
+ return previousValue;
+ }
+
+ private static class MyTableModel extends AbstractTableModel implements EditableModel {
+ private final InspectionProfileImpl myInspectionProfile;
+ private final List<String> myKeyNames;
+ private final List<InspectionConfigTreeNode> myNodes;
+ private final TreeTable myTreeTable;
+ private final Project myProject;
+ private final TableSettings myTableSettings;
+ private final List<HighlightDisplayKey> myKeys;
+
+ private String[] myScopeNames;
+
+ public MyTableModel(final TableSettings tableSettings) {
+ myTableSettings = tableSettings;
+ myProject = tableSettings.getProject();
+ myInspectionProfile = tableSettings.getInspectionProfile();
+ myKeys = tableSettings.getKeys();
+ myKeyNames = tableSettings.getKeyNames();
+ myNodes = tableSettings.getNodes();
+ myTreeTable = tableSettings.getTreeTable();
+ refreshAggregatedScopes();
+ }
+
+ @Override
+ public boolean isCellEditable(final int rowIndex, final int columnIndex) {
+ return columnIndex != SCOPE_NAME_COLUMN;
+ }
+
+ @Override
+ public int getRowCount() {
+ return lastRowIndex() + 1;
+ }
+
+ @Nullable
+ @Override
+ public String getColumnName(final int column) {
+ return null;
+ }
+
+ @Override
+ public int getColumnCount() {
+ return 3;
+ }
+
+ @Override
+ public Class<?> getColumnClass(final int columnIndex) {
+ if (SCOPE_ENABLED_COLUMN == columnIndex) {
+ return Boolean.class;
+ }
+ if (SCOPE_NAME_COLUMN == columnIndex) {
+ return String.class;
+ }
+ if (SEVERITY_COLUMN == columnIndex) {
+ return HighlightSeverity.class;
+ }
+ throw new IllegalArgumentException();
+ }
+
+ @Override
+ public Object getValueAt(final int rowIndex, final int columnIndex) {
+ if (rowIndex < 0) {
+ return null;
+ }
+ switch (columnIndex) {
+ case SCOPE_ENABLED_COLUMN:
+ return isEnabled(rowIndex);
+ case SCOPE_NAME_COLUMN:
+ return getScope(rowIndex).getName();
+ case SEVERITY_COLUMN:
+ return getSeverity(rowIndex);
+ default:
+ throw new IllegalArgumentException("Invalid column index " + columnIndex);
+ }
+ }
+
+ private NamedScope getScope(final int rowIndex) {
+ return getScopeToolState(rowIndex).getExistedStates().get(0).getScope(myProject);
+ }
+
+ @NotNull
+ private HighlightSeverity getSeverity(final int rowIndex) {
+ final ExistedScopesStatesAndNonExistNames existedScopesStatesAndNonExistNames = getScopeToolState(rowIndex);
+ if (!existedScopesStatesAndNonExistNames.getNonExistNames().isEmpty()) {
+ return MIXED_FAKE_SEVERITY;
+ }
+ return ScopesAndSeveritiesTable.getSeverity(existedScopesStatesAndNonExistNames.getExistedStates());
+ }
+
+ @Nullable
+ private Boolean isEnabled(final int rowIndex) {
+ Boolean previousValue = null;
+ final ExistedScopesStatesAndNonExistNames existedScopesStatesAndNonExistNames = getScopeToolState(rowIndex);
+ for (final ScopeToolState scopeToolState : existedScopesStatesAndNonExistNames.getExistedStates()) {
+ final boolean currentValue = scopeToolState.isEnabled();
+ if (previousValue == null) {
+ previousValue = currentValue;
+ } else if (!previousValue.equals(currentValue)){
+ return null;
+ }
+ }
+ if (!existedScopesStatesAndNonExistNames.getNonExistNames().isEmpty() && !Boolean.FALSE.equals(previousValue)) {
+ return null;
+ }
+ return previousValue;
+ }
+
+ private ExistedScopesStatesAndNonExistNames getScopeToolState(final int rowIndex) {
+ final List<String> nonExistNames = new SmartList<String>();
+ final List<ScopeToolState> existedStates = new SmartList<ScopeToolState>();
+ for (final String keyName : myKeyNames) {
+ final ScopeToolState scopeToolState = getScopeToolState(keyName, rowIndex);
+ if (scopeToolState != null) {
+ existedStates.add(scopeToolState);
+ } else {
+ nonExistNames.add(keyName);
+ }
+ }
+ return new ExistedScopesStatesAndNonExistNames(existedStates, nonExistNames);
+ }
+
+ @Nullable
+ private ScopeToolState getScopeToolState(final String keyName, final int rowIndex) {
+ if (rowIndex == lastRowIndex()) {
+ return myInspectionProfile.getToolDefaultState(keyName, myProject);
+ }
+ else {
+ final String scopeName = myScopeNames[rowIndex];
+ final List<ScopeToolState> nonDefaultTools = myInspectionProfile.getNonDefaultTools(keyName, myProject);
+ for (final ScopeToolState nonDefaultTool : nonDefaultTools) {
+ if (Comparing.equal(scopeName, nonDefaultTool.getScopeName())) {
+ return nonDefaultTool;
+ }
+ }
+ }
+ return null;
+ }
+
+ private void refreshAggregatedScopes() {
+ final LinkedHashSet<String> scopesNames = new LinkedHashSet<String>();
+ for (final String keyName : myKeyNames) {
+ final List<ScopeToolState> nonDefaultTools = myInspectionProfile.getNonDefaultTools(keyName, myProject);
+ for (final ScopeToolState tool : nonDefaultTools) {
+ scopesNames.add(tool.getScopeName());
+ }
+ }
+ myScopeNames = ArrayUtil.toStringArray(scopesNames);
+ }
+
+ private int lastRowIndex() {
+ return myScopeNames.length;
+ }
+
+ @Override
+ public void setValueAt(final Object value, final int rowIndex, final int columnIndex) {
+ if (value == null) {
+ return;
+ }
+ if (columnIndex == SEVERITY_COLUMN) {
+ final HighlightDisplayLevel level = HighlightDisplayLevel.find(((HighlightSeverity)value).getName());
+ if (level == null) {
+ LOG.error("no display level found for name " + ((HighlightSeverity)value).getName());
+ return;
+ }
+ final int idx = rowIndex == lastRowIndex() ? -1 : rowIndex;
+ myInspectionProfile.setErrorLevel(myKeys, level, idx, myProject);
+ }
+ else if (columnIndex == SCOPE_ENABLED_COLUMN) {
+ final NamedScope scope = getScope(rowIndex);
+ if ((Boolean)value) {
+ if (rowIndex == lastRowIndex()) {
+ myInspectionProfile.enableToolsByDefault(myKeyNames, myProject);
+ }
+ else {
+ //TODO create scopes states if not exist (need scope sorting)
+ myInspectionProfile.enableTools(myKeyNames, scope, myProject);
+ }
+ }
+ else {
+ if (rowIndex == lastRowIndex()) {
+ myInspectionProfile.disableToolByDefault(myKeyNames, myProject);
+ }
+ else {
+ myInspectionProfile.disableTools(myKeyNames, scope, myProject);
+ }
+ }
+ }
+ myTableSettings.onChange();
+ }
+
+ @Override
+ public void removeRow(final int idx) {
+ if (idx != lastRowIndex()) {
+ myInspectionProfile.removeScopes(myKeyNames, getScope(idx), myProject);
+ refreshAggregatedScopes();
+ myTableSettings.onScopeRemoved(getRowCount());
+ }
+ }
+
+ @Override
+ public void addRow() {
+ AddScopeUtil.performAddScope(myTreeTable, myProject, myInspectionProfile, myNodes);
+ myTableSettings.onScopeAdded();
+ refreshAggregatedScopes();
+ }
+
+ @Override
+ public void exchangeRows(final int oldIndex, final int newIndex) {
+ }
+
+ @Override
+ public boolean canExchangeRows(final int oldIndex, final int newIndex) {
+ return false;
+ }
+ }
+
+ private static class ExistedScopesStatesAndNonExistNames {
+
+ private final List<ScopeToolState> myExistedStates;
+ private final List<String> myNonExistNames;
+
+ public ExistedScopesStatesAndNonExistNames(final List<ScopeToolState> existedStates, final List<String> nonExistNames) {
+ myExistedStates = existedStates;
+ myNonExistNames = nonExistNames;
+ }
+
+ public List<ScopeToolState> getExistedStates() {
+ return myExistedStates;
+ }
+
+ public List<String> getNonExistNames() {
+ return myNonExistNames;
+ }
+ }
+}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/SeverityRenderer.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/SeverityRenderer.java
new file mode 100644
index 0000000..2fe95e6
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/SeverityRenderer.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui.table;
+
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInspection.ex.InspectionProfileImpl;
+import com.intellij.lang.annotation.HighlightSeverity;
+import com.intellij.openapi.ui.ComboBoxTableRenderer;
+import com.intellij.profile.codeInspection.SeverityProvider;
+import com.intellij.profile.codeInspection.ui.LevelChooserAction;
+import com.intellij.profile.codeInspection.ui.SingleInspectionProfilePanel;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.event.MouseEvent;
+import java.util.EventObject;
+import java.util.SortedSet;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public class SeverityRenderer extends ComboBoxTableRenderer<HighlightSeverity> {
+ public SeverityRenderer(final HighlightSeverity[] values) {
+ super(values);
+ }
+
+ public static SeverityRenderer create(final InspectionProfileImpl inspectionProfile) {
+ final SortedSet<HighlightSeverity> severities =
+ LevelChooserAction.getSeverities(((SeverityProvider)inspectionProfile.getProfileManager()).getOwnSeverityRegistrar());
+ return new SeverityRenderer(severities.toArray(new HighlightSeverity[severities.size()]));
+ }
+
+
+ @Override
+ protected String getTextFor(@NotNull final HighlightSeverity value) {
+ return SingleInspectionProfilePanel.renderSeverity(value);
+ }
+
+ @Override
+ protected Icon getIconFor(@NotNull final HighlightSeverity value) {
+ return HighlightDisplayLevel.find(value).getIcon();
+ }
+
+ @Override
+ public boolean isCellEditable(final EventObject event) {
+ if (event instanceof MouseEvent) {
+ return ((MouseEvent)event).getClickCount() >= 1;
+ }
+ return true;
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java
new file mode 100644
index 0000000..7d8cfdf
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2000-2014 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.profile.codeInspection.ui.table;
+
+import com.intellij.ui.ClickListener;
+import com.intellij.util.SmartList;
+import com.intellij.util.ui.ThreeStateCheckBox;
+import com.intellij.util.ui.UIUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.event.CellEditorListener;
+import javax.swing.event.ChangeEvent;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import java.awt.*;
+import java.awt.event.MouseEvent;
+import java.util.EventObject;
+import java.util.List;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public class ThreeStateCheckBoxRenderer extends ThreeStateCheckBox implements TableCellRenderer, TableCellEditor {
+
+ private final List<CellEditorListener> myListeners = new SmartList<CellEditorListener>();
+
+ public ThreeStateCheckBoxRenderer() {
+ setThirdStateEnabled(false);
+ setHorizontalAlignment(CENTER);
+ setVerticalAlignment(CENTER);
+ }
+
+ @Override
+ public Component getTableCellEditorComponent(final JTable table, final Object value, final boolean isSelected, final int row, final int column) {
+ return tune(value, isSelected, row, table);
+ }
+
+ @Override
+ public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) {
+ return tune(value, isSelected, row, table);
+ }
+
+ private JCheckBox tune(final Object value, final boolean isSelected, final int row, final JTable table) {
+ final Color bg = UIUtil.isUnderNimbusLookAndFeel() && row % 2 == 1 ? UIUtil.TRANSPARENT_COLOR : table.getBackground();
+ final Color fg = table.getForeground();
+ final Color selBg = table.getSelectionBackground();
+ final Color selFg = table.getSelectionForeground();
+
+ setForeground(isSelected ? selFg : fg);
+ setBackground(isSelected ? selBg : bg);
+
+ if (value == null) {
+ setState(State.DONT_CARE);
+ } else {
+ setSelected((Boolean) value);
+ }
+ new ClickListener() {
+ @Override
+ public boolean onClick(@NotNull final MouseEvent event, final int clickCount) {
+ if (clickCount == 1) {
+ stopCellEditing();
+ return true;
+ }
+ return false;
+ }
+ }.installOn(this);
+ return this;
+ }
+
+ @Nullable
+ @Override
+ public Object getCellEditorValue() {
+ return getState() != State.DONT_CARE ? isSelected() : null;
+ }
+
+ @Override
+ public boolean isCellEditable(final EventObject anEvent) {
+ return true;
+ }
+
+ @Override
+ public boolean shouldSelectCell(final EventObject anEvent) {
+ return true;
+ }
+
+ @Override
+ public boolean stopCellEditing() {
+ final ChangeEvent e = new ChangeEvent(this);
+ for (final CellEditorListener listener : myListeners) {
+ listener.editingStopped(e);
+ }
+ return true;
+ }
+
+ @Override
+ public void cancelCellEditing() {
+ final ChangeEvent e = new ChangeEvent(this);
+ for (final CellEditorListener listener : myListeners) {
+ listener.editingCanceled(e);
+ }
+ }
+
+ @Override
+ public void addCellEditorListener(final CellEditorListener l) {
+ myListeners.add(l);
+ }
+
+ @Override
+ public void removeCellEditorListener(final CellEditorListener l) {
+ myListeners.remove(l);
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/psi/impl/file/DirectoryIconProvider.java b/platform/lang-impl/src/com/intellij/psi/impl/file/DirectoryIconProvider.java
index d12bc93..6aaa810 100644
--- a/platform/lang-impl/src/com/intellij/psi/impl/file/DirectoryIconProvider.java
+++ b/platform/lang-impl/src/com/intellij/psi/impl/file/DirectoryIconProvider.java
@@ -20,11 +20,15 @@
*/
package com.intellij.psi.impl.file;
+import com.intellij.icons.AllIcons;
import com.intellij.ide.IconProvider;
import com.intellij.ide.projectView.impl.ProjectRootsUtil;
import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.roots.SourceFolder;
import com.intellij.openapi.roots.ui.configuration.SourceRootPresentation;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiElement;
@@ -39,11 +43,18 @@
if (element instanceof PsiDirectory) {
final PsiDirectory psiDirectory = (PsiDirectory)element;
final VirtualFile vFile = psiDirectory.getVirtualFile();
- SourceFolder sourceFolder = ProjectRootsUtil.getModuleSourceRoot(vFile, psiDirectory.getProject());
+ Project project = psiDirectory.getProject();
+ SourceFolder sourceFolder = ProjectRootsUtil.getModuleSourceRoot(vFile, project);
if (sourceFolder != null) {
return SourceRootPresentation.getSourceRootIcon(sourceFolder);
}
else {
+ if (!Registry.is("ide.hide.excluded.files")) {
+ boolean ignored = ProjectRootManager.getInstance(project).getFileIndex().isExcluded(vFile);
+ if (ignored) {
+ return AllIcons.Modules.ExcludeRoot;
+ }
+ }
return PlatformIcons.DIRECTORY_CLOSED_ICON;
}
}
diff --git a/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.java b/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.java
index bb2c938..17dd2bc 100644
--- a/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.java
+++ b/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.java
@@ -443,7 +443,7 @@
public void run() {
PsiTreeChangeEventImpl treeEvent = new PsiTreeChangeEventImpl(myManager);
- boolean isExcluded = vFile.isDirectory() && myProjectRootManager.getFileIndex().isIgnored(vFile);
+ boolean isExcluded = vFile.isDirectory() && myProjectRootManager.getFileIndex().isExcluded(vFile);
if (oldParentDir != null && !isExcluded) {
if (newParentDir != null) {
treeEvent.setOldParent(oldParentDir);
diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/PostprocessReformattingAspect.java b/platform/lang-impl/src/com/intellij/psi/impl/source/PostprocessReformattingAspect.java
index 6341332..c5b183c 100644
--- a/platform/lang-impl/src/com/intellij/psi/impl/source/PostprocessReformattingAspect.java
+++ b/platform/lang-impl/src/com/intellij/psi/impl/source/PostprocessReformattingAspect.java
@@ -636,7 +636,7 @@
final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myPsiManager.getProject());
final Document document = viewProvider.getDocument();
assert document != null;
- final CodeFormatterFacade codeFormatter = new CodeFormatterFacade(styleSettings);
+ final CodeFormatterFacade codeFormatter = new CodeFormatterFacade(styleSettings, viewProvider.getBaseLanguage());
documentManager.commitDocument(document);
return codeFormatter;
diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeFormatterFacade.java b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeFormatterFacade.java
index e76aecf..fa1dd9e 100644
--- a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeFormatterFacade.java
+++ b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeFormatterFacade.java
@@ -78,10 +78,12 @@
private final CodeStyleSettings mySettings;
private final FormatterTagHandler myTagHandler;
+ private final int myRightMargin;
- public CodeFormatterFacade(CodeStyleSettings settings) {
+ public CodeFormatterFacade(CodeStyleSettings settings, @Nullable Language language) {
mySettings = settings;
myTagHandler = new FormatterTagHandler(settings);
+ myRightMargin = mySettings.getRightMargin(language);
}
public ASTNode processElement(ASTNode element) {
@@ -637,8 +639,8 @@
}
private int wrapPositionForTextWithoutTabs(int startLineOffset, int endLineOffset, int targetRangeEndOffset) {
- if (Math.min(endLineOffset, targetRangeEndOffset) - startLineOffset > mySettings.RIGHT_MARGIN) {
- return startLineOffset + mySettings.RIGHT_MARGIN - FormatConstants.RESERVED_LINE_WRAP_WIDTH_IN_COLUMNS;
+ if (Math.min(endLineOffset, targetRangeEndOffset) - startLineOffset > myRightMargin) {
+ return startLineOffset + myRightMargin - FormatConstants.RESERVED_LINE_WRAP_WIDTH_IN_COLUMNS;
}
return -1;
}
@@ -659,13 +661,13 @@
case '\t': symbolWidth = tabSize - (width % tabSize); break;
default: symbolWidth = 1;
}
- if (width + symbolWidth + FormatConstants.RESERVED_LINE_WRAP_WIDTH_IN_COLUMNS >= mySettings.RIGHT_MARGIN
+ if (width + symbolWidth + FormatConstants.RESERVED_LINE_WRAP_WIDTH_IN_COLUMNS >= myRightMargin
&& (Math.min(endLineOffset, targetRangeEndOffset) - i) >= FormatConstants.RESERVED_LINE_WRAP_WIDTH_IN_COLUMNS)
{
// Remember preferred position.
result = i - 1;
}
- if (width + symbolWidth >= mySettings.RIGHT_MARGIN) {
+ if (width + symbolWidth >= myRightMargin) {
wrapLine = true;
break;
}
@@ -700,12 +702,12 @@
break;
default: newX = x + EditorUtil.charWidth(c, Font.PLAIN, editor); symbolWidth = 1;
}
- if (width + symbolWidth + FormatConstants.RESERVED_LINE_WRAP_WIDTH_IN_COLUMNS >= mySettings.RIGHT_MARGIN
+ if (width + symbolWidth + FormatConstants.RESERVED_LINE_WRAP_WIDTH_IN_COLUMNS >= myRightMargin
&& (Math.min(endLineOffset, targetRangeEndOffset) - i) >= FormatConstants.RESERVED_LINE_WRAP_WIDTH_IN_COLUMNS)
{
result = i - 1;
}
- if (width + symbolWidth >= mySettings.RIGHT_MARGIN) {
+ if (width + symbolWidth >= myRightMargin) {
wrapLine = true;
break;
}
diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleFacadeImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleFacadeImpl.java
index a9031f3..81eda35 100644
--- a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleFacadeImpl.java
+++ b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleFacadeImpl.java
@@ -20,6 +20,7 @@
package com.intellij.psi.impl.source.codeStyle;
import com.intellij.codeStyle.CodeStyleFacade;
+import com.intellij.lang.Language;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.options.Configurable;
@@ -68,8 +69,8 @@
}
@Override
- public int getRightMargin() {
- return CodeStyleSettingsManager.getSettings(myProject).RIGHT_MARGIN;
+ public int getRightMargin(Language language) {
+ return CodeStyleSettingsManager.getSettings(myProject).getRightMargin(language);
}
@Override
diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleManagerImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleManagerImpl.java
index 043ac48..767152f 100644
--- a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleManagerImpl.java
+++ b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleManagerImpl.java
@@ -101,7 +101,7 @@
}
ASTNode treeElement = SourceTreeToPsiMap.psiElementToTree(element);
- final PsiElement formatted = SourceTreeToPsiMap.treeElementToPsi(new CodeFormatterFacade(getSettings()).processElement(treeElement));
+ final PsiElement formatted = SourceTreeToPsiMap.treeElementToPsi(new CodeFormatterFacade(getSettings(), element.getLanguage()).processElement(treeElement));
if (!canChangeWhiteSpacesOnly) {
return postProcessElement(formatted);
}
@@ -180,7 +180,7 @@
ASTNode treeElement = SourceTreeToPsiMap.psiElementToTree(file);
transformAllChildren(treeElement);
- final CodeFormatterFacade codeFormatter = new CodeFormatterFacade(getSettings());
+ final CodeFormatterFacade codeFormatter = new CodeFormatterFacade(getSettings(), file.getLanguage());
LOG.assertTrue(file.isValid());
if (editor == null) {
@@ -274,7 +274,7 @@
}
ASTNode treeElement = SourceTreeToPsiMap.psiElementToTree(element);
- final CodeFormatterFacade codeFormatter = new CodeFormatterFacade(getSettings());
+ final CodeFormatterFacade codeFormatter = new CodeFormatterFacade(getSettings(), element.getLanguage());
final PsiElement formatted = SourceTreeToPsiMap.treeElementToPsi(codeFormatter.processRange(treeElement, startOffset, endOffset));
return canChangeWhiteSpacesOnly ? formatted : postProcessElement(formatted);
diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java
index f286346..27089fa 100644
--- a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java
+++ b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java
@@ -20,6 +20,7 @@
import com.intellij.lang.Language;
import com.intellij.lang.LanguageUtil;
import com.intellij.lang.injection.InjectedLanguageManager;
+import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.SelectionModel;
@@ -158,6 +159,22 @@
return getEditorForInjectedLanguageNoCommit(editor, file, offset);
}
+ public static Caret getCaretForInjectedLanguageNoCommit(@Nullable Caret caret, @Nullable PsiFile file) {
+ if (caret == null || file == null || caret instanceof InjectedCaret) return caret;
+
+ PsiFile injectedFile = findInjectedPsiNoCommit(file, caret.getOffset());
+ Editor injectedEditor = getInjectedEditorForInjectedFile(caret.getEditor(), injectedFile);
+ if (!(injectedEditor instanceof EditorWindow)) {
+ return caret;
+ }
+ for (Caret injectedCaret : injectedEditor.getCaretModel().getAllCarets()) {
+ if (((InjectedCaret)injectedCaret).getDelegate() == caret) {
+ return injectedCaret;
+ }
+ }
+ return null;
+ }
+
public static Editor getEditorForInjectedLanguageNoCommit(@Nullable Editor editor, @Nullable PsiFile file, final int offset) {
if (editor == null || file == null || editor instanceof EditorWindow) return editor;
PsiFile injectedFile = findInjectedPsiNoCommit(file, offset);
diff --git a/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java b/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java
index fc17bf2..d791f14 100644
--- a/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java
+++ b/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java
@@ -154,15 +154,24 @@
break;
}
catch (IOException e) {
- LOG.info(e);
needRebuild = true;
- FileUtil.delete(indexRootDir);
- IndexingStamp.rewriteVersion(versionFile, version); // todo snapshots indices
+ onExceptionInstantiatingIndex(version, versionFile, indexRootDir, e);
+ } catch (RuntimeException e) {
+ //noinspection ThrowableResultOfMethodCallIgnored
+ Throwable cause = FileBasedIndexImpl.getCauseToRebuildIndex(e);
+ if (cause == null) throw e;
+ onExceptionInstantiatingIndex(version, versionFile, indexRootDir, e);
}
}
return needRebuild;
}
+ private static void onExceptionInstantiatingIndex(int version, File versionFile, File indexRootDir, Exception e) throws IOException {
+ LOG.info(e);
+ FileUtil.delete(indexRootDir);
+ IndexingStamp.rewriteVersion(versionFile, version); // todo snapshots indices
+ }
+
private static class StubIdExternalizer implements DataExternalizer<StubIdList> {
@Override
public void save(@NotNull final DataOutput out, @NotNull final StubIdList value) throws IOException {
@@ -207,7 +216,7 @@
public <Key, Psi extends PsiElement> Collection<Psi> get(@NotNull final StubIndexKey<Key, Psi> indexKey,
@NotNull final Key key,
@NotNull final Project project,
- final GlobalSearchScope scope) {
+ @Nullable final GlobalSearchScope scope) {
return get(indexKey, key, project, scope, null);
}
@@ -215,7 +224,7 @@
public <Key, Psi extends PsiElement> Collection<Psi> get(@NotNull StubIndexKey<Key, Psi> indexKey,
@NotNull Key key,
@NotNull Project project,
- GlobalSearchScope scope,
+ @Nullable GlobalSearchScope scope,
IdFilter filter) {
final List<Psi> result = new SmartList<Psi>();
process(indexKey, key, project, scope, filter, new CommonProcessors.CollectProcessor<Psi>(result));
@@ -226,7 +235,7 @@
public <Key, Psi extends PsiElement> boolean processElements(@NotNull StubIndexKey<Key, Psi> indexKey,
@NotNull Key key,
@NotNull Project project,
- GlobalSearchScope scope,
+ @Nullable GlobalSearchScope scope,
Class<Psi> requiredClass,
@NotNull Processor<? super Psi> processor) {
return processElements(indexKey, key, project, scope, null, requiredClass, processor);
@@ -238,7 +247,7 @@
@NotNull final Project project,
@Nullable final GlobalSearchScope scope,
@Nullable IdFilter idFilter,
- final Class<Psi> requiredClass,
+ @NotNull final Class<Psi> requiredClass,
@NotNull final Processor<? super Psi> processor) {
final FileBasedIndexImpl fileBasedIndex = (FileBasedIndexImpl)FileBasedIndex.getInstance();
fileBasedIndex.ensureUpToDate(StubUpdatingIndex.INDEX_ID, project, scope);
@@ -315,7 +324,7 @@
return processAllKeys(indexKey, processor, GlobalSearchScope.allScope(project), null);
}
- public <K> boolean processAllKeys(@NotNull StubIndexKey<K, ?> indexKey, Processor<K> processor, GlobalSearchScope scope, @Nullable IdFilter idFilter) {
+ public <K> boolean processAllKeys(@NotNull StubIndexKey<K, ?> indexKey, @NotNull Processor<K> processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter idFilter) {
FileBasedIndex.getInstance().ensureUpToDate(StubUpdatingIndex.INDEX_ID, scope.getProject(), scope);
diff --git a/platform/lang-impl/src/com/intellij/refactoring/actions/RefactoringQuickListPopupAction.java b/platform/lang-impl/src/com/intellij/refactoring/actions/RefactoringQuickListPopupAction.java
index aea9826..1592795 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/actions/RefactoringQuickListPopupAction.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/actions/RefactoringQuickListPopupAction.java
@@ -26,6 +26,10 @@
public class RefactoringQuickListPopupAction extends QuickSwitchSchemeAction {
+ public RefactoringQuickListPopupAction() {
+ setInjectedContext(true);
+ }
+
@Override
protected void fillActions(@Nullable final Project project,
@NotNull final DefaultActionGroup group,
@@ -64,6 +68,7 @@
child instanceof CopyElementAction) {
final Presentation presentation = new Presentation();
final AnActionEvent event = new AnActionEvent(null, dataContext, ActionPlaces.UNKNOWN, presentation, actionManager, 0);
+ event.setInjectedContext(child.isInInjectedContext());
child.update(event);
if (presentation.isEnabled() && presentation.isVisible()) {
destinationGroup.add(child);
diff --git a/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/AbstractInplaceIntroducer.java b/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/AbstractInplaceIntroducer.java
index e761e9a..81a2885 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/AbstractInplaceIntroducer.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/AbstractInplaceIntroducer.java
@@ -45,6 +45,8 @@
import com.intellij.psi.search.searches.ReferencesSearch;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.refactoring.RefactoringActionHandler;
+import com.intellij.refactoring.listeners.RefactoringEventData;
+import com.intellij.refactoring.listeners.RefactoringEventListener;
import com.intellij.refactoring.rename.inplace.InplaceRefactoring;
import com.intellij.ui.DottedBorder;
import com.intellij.util.ui.PositionTracker;
@@ -537,6 +539,13 @@
CommandProcessor.getInstance().executeCommand(myProject, new Runnable() {
@Override
public void run() {
+ final String refactoringId = getRefactoringId();
+ if (refactoringId != null) {
+ final RefactoringEventData beforeData = new RefactoringEventData();
+ beforeData.addElements(new PsiElement[] {getLocalVariable(), getExpr()});
+ myProject.getMessageBus()
+ .syncPublisher(RefactoringEventListener.REFACTORING_EVENT_TOPIC).refactoringStarted(refactoringId, beforeData);
+ }
performIntroduce();
}
}, getCommandName(), getCommandName());
@@ -567,9 +576,20 @@
}
if (success) {
performPostIntroduceTasks();
+ final String refactoringId = getRefactoringId();
+ if (refactoringId != null) {
+ final RefactoringEventData afterData = new RefactoringEventData();
+ afterData.addElement(getVariable());
+ myProject.getMessageBus()
+ .syncPublisher(RefactoringEventListener.REFACTORING_EVENT_TOPIC).refactoringDone(refactoringId, afterData);
+ }
}
}
+ protected String getRefactoringId() {
+ return null;
+ }
+
@Override
protected boolean startsOnTheSameElement(RefactoringActionHandler handler, PsiElement element) {
return super.startsOnTheSameElement(handler, element) || getLocalVariable() == element;
diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/InplaceRefactoring.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/InplaceRefactoring.java
index db30a10..aa4f696 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/InplaceRefactoring.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/InplaceRefactoring.java
@@ -773,32 +773,31 @@
if (ApplicationManager.getApplication().isHeadlessEnvironment()) return;
final BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createDialogBalloonBuilder(component, null).setSmallVariant(true);
myBalloon = balloonBuilder.createBalloon();
- final Editor topLevelEditor = InjectedLanguageUtil.getTopLevelEditor(myEditor);
Disposer.register(myProject, myBalloon);
Disposer.register(myBalloon, new Disposable() {
@Override
public void dispose() {
releaseIfNotRestart();
- topLevelEditor.putUserData(PopupFactoryImpl.ANCHOR_POPUP_POSITION, null);
+ myEditor.putUserData(PopupFactoryImpl.ANCHOR_POPUP_POSITION, null);
}
});
- topLevelEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);
+ myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);
final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
- myBalloon.show(new PositionTracker<Balloon>(topLevelEditor.getContentComponent()) {
+ myBalloon.show(new PositionTracker<Balloon>(myEditor.getContentComponent()) {
@Override
public RelativePoint recalculateLocation(Balloon object) {
- if (myTarget != null && !popupFactory.isBestPopupLocationVisible(topLevelEditor)) {
+ if (myTarget != null && !popupFactory.isBestPopupLocationVisible(myEditor)) {
return myTarget;
}
if (myCaretRangeMarker != null && myCaretRangeMarker.isValid()) {
- topLevelEditor.putUserData(PopupFactoryImpl.ANCHOR_POPUP_POSITION,
- topLevelEditor.offsetToVisualPosition(myCaretRangeMarker.getStartOffset()));
+ myEditor.putUserData(PopupFactoryImpl.ANCHOR_POPUP_POSITION,
+ myEditor.offsetToVisualPosition(myCaretRangeMarker.getStartOffset()));
}
- final RelativePoint target = popupFactory.guessBestPopupLocation(topLevelEditor);
+ final RelativePoint target = popupFactory.guessBestPopupLocation(myEditor);
final Point screenPoint = target.getScreenPoint();
int y = screenPoint.y;
- if (target.getPoint().getY() > topLevelEditor.getLineHeight() + myBalloon.getPreferredSize().getHeight()) {
- y -= topLevelEditor.getLineHeight();
+ if (target.getPoint().getY() > myEditor.getLineHeight() + myBalloon.getPreferredSize().getHeight()) {
+ y -= myEditor.getLineHeight();
}
myTarget = new RelativePoint(new Point(screenPoint.x, y));
return myTarget;
diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/MemberInplaceRenamer.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/MemberInplaceRenamer.java
index bd3c52a..5e5907c 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/MemberInplaceRenamer.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/MemberInplaceRenamer.java
@@ -177,6 +177,11 @@
return false;
}
+ @Override
+ protected String getRefactoringId() {
+ return null;
+ }
+
private void appendAdditionalElement(Collection<Pair<PsiElement, TextRange>> stringUsages,
PsiNamedElement variable,
PsiElement element) {
diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java
index 3765615..6fa0ed2 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java
@@ -38,6 +38,8 @@
import com.intellij.refactoring.RefactoringActionHandler;
import com.intellij.refactoring.RefactoringBundle;
import com.intellij.refactoring.listeners.RefactoringElementListener;
+import com.intellij.refactoring.listeners.RefactoringEventData;
+import com.intellij.refactoring.listeners.RefactoringEventListener;
import com.intellij.refactoring.rename.*;
import com.intellij.refactoring.rename.naming.AutomaticRenamer;
import com.intellij.refactoring.rename.naming.AutomaticRenamerFactory;
@@ -137,6 +139,10 @@
protected boolean shouldCreateSnapshot() {
return true;
}
+
+ protected String getRefactoringId() {
+ return "refactoring.rename";
+ }
@Override
protected void beforeTemplateStart() {
@@ -204,11 +210,18 @@
protected void performRefactoringRename(final String newName,
final StartMarkAction markAction) {
+ final String refactoringId = getRefactoringId();
try {
+ PsiNamedElement elementToRename = getVariable();
+ if (refactoringId != null) {
+ final RefactoringEventData beforeData = new RefactoringEventData();
+ beforeData.addElement(elementToRename);
+ myProject.getMessageBus()
+ .syncPublisher(RefactoringEventListener.REFACTORING_EVENT_TOPIC).refactoringStarted(refactoringId, beforeData);
+ }
if (!isIdentifier(newName, myLanguage)) {
return;
}
- PsiNamedElement elementToRename = getVariable();
if (elementToRename != null) {
new WriteCommandAction(myProject, getCommandName()) {
@Override
@@ -278,6 +291,14 @@
}
}
finally {
+
+ if (refactoringId != null) {
+ final RefactoringEventData afterData = new RefactoringEventData();
+ afterData.addElement(getVariable());
+ myProject.getMessageBus()
+ .syncPublisher(RefactoringEventListener.REFACTORING_EVENT_TOPIC).refactoringDone(refactoringId, afterData);
+ }
+
try {
((EditorImpl)InjectedLanguageUtil.getTopLevelEditor(myEditor)).stopDumbLater();
}
diff --git a/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceOnErrorAction.java b/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceOnErrorAction.java
index e1de663..d3385e8 100644
--- a/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceOnErrorAction.java
+++ b/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceOnErrorAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -19,26 +19,28 @@
import com.intellij.diagnostic.IdeErrorsDialog;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.CommonDataKeys;
-import com.intellij.openapi.actionSystem.DataContext;
-import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
/**
* @author spleaner
*/
public class AnalyzeStacktraceOnErrorAction extends AnAction {
+ @Override
+ public void update(AnActionEvent e) {
+ Project project = e.getProject();
+ String message = getMessage(e);
+ e.getPresentation().setEnabledAndVisible(project != null && message != null);
+ }
@Override
public void actionPerformed(AnActionEvent e) {
- final DataContext dataContext = e.getDataContext();
+ Project project = e.getProject();
+ String message = getMessage(e);
+ if (project == null || message == null) return;
+ AnalyzeStacktraceUtil.addConsole(project, null, "<Stacktrace>", message);
+ }
- final Project project = CommonDataKeys.PROJECT.getData(dataContext);
- if (project == null) return;
-
- final String message = IdeErrorsDialog.CURRENT_TRACE_KEY.getData(dataContext);
- if (message != null) {
- AnalyzeStacktraceUtil.addConsole(project, null, "<Stacktrace>", message);
- }
+ private static String getMessage(AnActionEvent e) {
+ return IdeErrorsDialog.CURRENT_TRACE_KEY.getData(e.getDataContext());
}
}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/util/indexing/ContentHashesSupport.java b/platform/lang-impl/src/com/intellij/util/indexing/ContentHashesSupport.java
index d20d01d..34f80dae 100644
--- a/platform/lang-impl/src/com/intellij/util/indexing/ContentHashesSupport.java
+++ b/platform/lang-impl/src/com/intellij/util/indexing/ContentHashesSupport.java
@@ -21,6 +21,7 @@
import com.intellij.openapi.vfs.newvfs.persistent.FlushingDaemon;
import com.intellij.util.io.IOUtil;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
@@ -63,19 +64,19 @@
}
static void flushContentHashes() {
- if (ourHashesWithFileType.isDirty()) ourHashesWithFileType.force();
+ if (ourHashesWithFileType != null && ourHashesWithFileType.isDirty()) ourHashesWithFileType.force();
}
- static int calcContentHashIdWithFileType(@NotNull byte[] bytes, @NotNull FileType fileType) throws IOException {
- return enumerateHash(calcContentHashWithFileType(bytes, fileType));
+ static int calcContentHashIdWithFileType(@NotNull byte[] bytes, @Nullable Charset charset, @NotNull FileType fileType) throws IOException {
+ return enumerateHash(calcContentHashWithFileType(bytes, charset, fileType));
}
static int enumerateHash(@NotNull byte[] digest) throws IOException {
return ourHashesWithFileType.enumerate(digest);
}
- static byte[] calcContentHashWithFileType(@NotNull byte[] bytes, @NotNull FileType fileType) throws IOException {
+ static byte[] calcContentHashWithFileType(@NotNull byte[] bytes, @Nullable Charset charset, @NotNull FileType fileType) throws IOException {
MessageDigest messageDigest = ContentHashesUtil.HASHER_CACHE.getValue();
Charset defaultCharset = Charset.defaultCharset();
@@ -83,6 +84,8 @@
messageDigest.update((byte)0);
messageDigest.update(String.valueOf(bytes.length).getBytes(defaultCharset));
messageDigest.update((byte)0);
+ messageDigest.update((charset != null ? charset.displayName():"null_charset").getBytes(defaultCharset));
+ messageDigest.update((byte)0);
messageDigest.update(bytes, 0, bytes.length);
return messageDigest.digest();
diff --git a/platform/lang-impl/src/com/intellij/util/indexing/DebugAssertions.java b/platform/lang-impl/src/com/intellij/util/indexing/DebugAssertions.java
index 0b7650a..6c866ad 100644
--- a/platform/lang-impl/src/com/intellij/util/indexing/DebugAssertions.java
+++ b/platform/lang-impl/src/com/intellij/util/indexing/DebugAssertions.java
@@ -19,6 +19,8 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.SystemProperties;
+import java.util.Formatter;
+
public class DebugAssertions {
private static final Logger LOG = Logger.getInstance(DebugAssertions.class);
@@ -29,7 +31,7 @@
public static final boolean EXTRA_SANITY_CHECKS = SystemProperties.getBooleanProperty(
"intellij.idea.indices.debug.extra.sanity",
- DEBUG && ApplicationManager.getApplication().isInternal()
+ true
);
public static void assertTrue(boolean value) {
@@ -37,4 +39,14 @@
LOG.assertTrue(false);
}
}
+
+ public static void assertTrue(boolean value, String message, Object ... args) {
+ if (!value) {
+ error(message, args);
+ }
+ }
+
+ public static void error(String message, Object ... args) {
+ LOG.error(new Formatter().format(message, args));
+ }
}
diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java
index c81f7c4..5242ee3 100644
--- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java
+++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java
@@ -380,9 +380,9 @@
LOG.info("Version has changed for index " + name + ". The index will be rebuilt.");
}
if (extension.hasSnapshotMapping() && (isCurrentVersionCorrupted || versionChanged)) {
- safeDelete(IndexInfrastructure.getPersistentIndexRootDir(name));
+ FileUtil.delete(IndexInfrastructure.getPersistentIndexRootDir(name));
}
- safeDelete(IndexInfrastructure.getIndexRootDir(name));
+ FileUtil.delete(IndexInfrastructure.getIndexRootDir(name));
IndexingStamp.rewriteVersion(versionFile, version);
}
@@ -458,22 +458,16 @@
catch (Exception ignored) {
}
- safeDelete(IndexInfrastructure.getIndexRootDir(name));
+ FileUtil.delete(IndexInfrastructure.getIndexRootDir(name));
if (extension.hasSnapshotMapping() && (!contentHashesEnumeratorOk || instantiatedStorage)) {
- safeDelete(IndexInfrastructure.getPersistentIndexRootDir(name)); // todo there is possibility of corruption of storage and content hashes
+ FileUtil.delete(IndexInfrastructure.getPersistentIndexRootDir(name));
}
IndexingStamp.rewriteVersion(versionFile, version);
}
}
}
- private static boolean safeDelete(File dir) {
- File directory = FileUtil.findSequentNonexistentFile(dir.getParentFile(), dir.getName(), "");
- boolean success = dir.renameTo(directory);
- return FileUtil.delete(success ? directory:dir);
- }
-
private static void saveRegisteredIndices(@NotNull Collection<ID<?, ?>> ids) {
final File file = getRegisteredIndicesFile();
try {
@@ -1206,6 +1200,7 @@
@Nullable
public static Throwable getCauseToRebuildIndex(@NotNull RuntimeException e) {
+ if (e instanceof IndexOutOfBoundsException) return e; // something wrong with direct byte buffer
Throwable cause = e.getCause();
if (cause instanceof StorageException || cause instanceof IOException ||
cause instanceof IllegalArgumentException) return cause;
@@ -1568,7 +1563,7 @@
indicesToDrop.remove(key.toString());
}
for (String s : indicesToDrop) {
- safeDelete(IndexInfrastructure.getIndexRootDir(ID.create(s)));
+ FileUtil.delete(IndexInfrastructure.getIndexRootDir(ID.create(s)));
}
}
@@ -1664,21 +1659,26 @@
}
byte[] currentBytes;
- byte[] hash;
try {
currentBytes = content.getBytes();
- if (fileType.isBinary() || !IdIndex.ourSnapshotMappingsEnabled) {
- hash = null;
- } else {
- hash = ContentHashesSupport
- .calcContentHashWithFileType(currentBytes, SubstitutedFileType.substituteFileType(file, fileType, project));
- }
}
catch (IOException e) {
currentBytes = ArrayUtil.EMPTY_BYTE_ARRAY;
- hash = null;
}
- fc = new FileContentImpl(file, currentBytes, hash);
+ fc = new FileContentImpl(file, currentBytes);
+
+ if (!fileType.isBinary() && IdIndex.ourSnapshotMappingsEnabled) {
+ try {
+ byte[] hash = ContentHashesSupport.calcContentHashWithFileType(
+ currentBytes,
+ fc.getCharset(),
+ SubstitutedFileType.substituteFileType(file, fileType, project)
+ );
+ fc.setHash(hash);
+ } catch (IOException e) {
+ LOG.error(e);
+ }
+ }
psiFile = content.getUserData(IndexingDataKeys.PSI_FILE);
initFileContent(fc, project, psiFile);
@@ -1909,21 +1909,26 @@
@Override
public void beforePropertyChange(@NotNull final VirtualFilePropertyEvent event) {
- if (event.getPropertyName().equals(VirtualFile.PROP_NAME)) {
- // indexes may depend on file name
- final VirtualFile file = event.getFile();
+ String propertyName = event.getPropertyName();
+ if (propertyName.equals(VirtualFile.PROP_NAME)) {
+ // indexes may depend on file name
// name change may lead to filetype change so the file might become not indexable
// in general case have to 'unindex' the file and index it again if needed after the name has been changed
- invalidateIndices(file, false);
+ invalidateIndices(event.getFile(), false);
+ } else if (propertyName.equals(VirtualFile.PROP_ENCODING)) {
+ invalidateIndices(event.getFile(), true);
}
}
@Override
public void propertyChanged(@NotNull final VirtualFilePropertyEvent event) {
- if (event.getPropertyName().equals(VirtualFile.PROP_NAME)) {
+ String propertyName = event.getPropertyName();
+ if (propertyName.equals(VirtualFile.PROP_NAME)) {
// indexes may depend on file name
markDirty(event, false);
+ } else if (propertyName.equals(VirtualFile.PROP_ENCODING)) {
+ markDirty(event, true);
}
}
diff --git a/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java b/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java
index 7bea700..6bdd55b 100644
--- a/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java
+++ b/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java
@@ -59,7 +59,7 @@
private static final long UNINDEXED_STAMP = -1L; // we don't store trivial "absent" state
private static final long INDEX_DATA_OUTDATED_STAMP = -2L;
- private static final int VERSION = 11;
+ private static final int VERSION = 12;
private static final ConcurrentHashMap<ID<?, ?>, Long> ourIndexIdToCreationStamp = new ConcurrentHashMap<ID<?, ?>, Long>();
private static volatile long ourLastStamp; // ensure any file index stamp increases
diff --git a/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java b/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java
index 3ad505b..ebb7911 100644
--- a/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java
+++ b/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java
@@ -22,18 +22,16 @@
import com.intellij.openapi.util.io.BufferExposingByteArrayOutputStream;
import com.intellij.openapi.util.io.ByteSequence;
import com.intellij.psi.search.GlobalSearchScope;
-import com.intellij.util.Processor;
-import com.intellij.util.SmartList;
-import com.intellij.util.SystemProperties;
+import com.intellij.util.*;
import com.intellij.util.io.*;
+import com.intellij.util.io.DataOutputStream;
import gnu.trove.THashMap;
import gnu.trove.TObjectObjectProcedure;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import java.io.DataInputStream;
-import java.io.File;
-import java.io.IOException;
+import java.io.*;
+import java.nio.charset.Charset;
import java.util.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -56,6 +54,7 @@
private PersistentHashMap<Integer, Collection<Key>> myInputsIndex;
private PersistentHashMap<Integer, ByteSequence> myContents;
private PersistentHashMap<Integer, Integer> myInputsSnapshotMapping;
+ private PersistentHashMap<Integer, String> myIndexingTrace;
private final ReentrantReadWriteLock myLock = new ReentrantReadWriteLock();
@@ -127,6 +126,10 @@
cleanMapping(myInputsSnapshotMapping);
myInputsSnapshotMapping = createInputSnapshotMapping();
}
+ if (myIndexingTrace != null) {
+ cleanMapping(myIndexingTrace);
+ myIndexingTrace = createIndexingTrace();
+ }
if (myContents != null) {
cleanMapping(myContents);
myContents = createContentsIndex();
@@ -161,6 +164,31 @@
}
}
+ private PersistentHashMap<Integer, String> createIndexingTrace() throws IOException {
+ assert myIndexId != null;
+ final File mapFile = new File(IndexInfrastructure.getIndexRootDir(myIndexId), "indextrace");
+ try {
+ return new PersistentHashMap<Integer, String>(mapFile, EnumeratorIntegerDescriptor.INSTANCE,
+ new DataExternalizer<String>() {
+ @Override
+ public void save(@NotNull DataOutput out, String value) throws IOException {
+ out.write((byte[])CompressionUtil.compressCharSequence(value, Charset.defaultCharset()));
+ }
+
+ @Override
+ public String read(@NotNull DataInput in) throws IOException {
+ byte[] b = new byte[((InputStream)in).available()];
+ in.readFully(b);
+ return (String)CompressionUtil.uncompressCharSequence(b, Charset.defaultCharset());
+ }
+ }, 4096);
+ }
+ catch (IOException ex) {
+ IOUtil.deleteAllFilesStartingWith(mapFile);
+ throw ex;
+ }
+ }
+
private static void cleanMapping(@NotNull PersistentHashMap<?, ?> index) {
final File baseFile = index.getBaseFile();
try {
@@ -178,6 +206,7 @@
getReadLock().lock();
doForce(myInputsIndex);
doForce(myInputsSnapshotMapping);
+ doForce(myIndexingTrace);
doForce(myContents);
myStorage.flush();
}
@@ -216,6 +245,7 @@
finally {
doClose(myInputsIndex);
doClose(myInputsSnapshotMapping);
+ doClose(myIndexingTrace);
doClose(myContents);
}
}
@@ -283,6 +313,9 @@
myInputsSnapshotMapping = createInputSnapshotMapping();
}
myInputsIndex = createInputsIndex();
+ if (DebugAssertions.EXTRA_SANITY_CHECKS && myIndexId != null) {
+ myIndexingTrace = createIndexingTrace();
+ }
}
@Nullable
@@ -318,7 +351,8 @@
if (myContents != null && weProcessPhysicalContent && content != null) {
try {
- hashId = getHashOfContent((FileContent)content);
+ FileContent fileContent = (FileContent)content;
+ hashId = getHashOfContent(fileContent);
if (doReadSavedPersistentData) {
if (!myContents.isBusyReading()) { // avoid blocking read, we can calculate index value
ByteSequence bytes = myContents.get(hashId);
@@ -326,7 +360,19 @@
data = deserializeSavedPersistentData(bytes);
havePersistentData = true;
if (DebugAssertions.EXTRA_SANITY_CHECKS) {
- DebugAssertions.assertTrue(myIndexer.map(content).equals(data));
+ Map<Key, Value> contentData = myIndexer.map(content);
+ boolean sameValueForSavedIndexedResultAndCurrentOne = contentData.equals(data);
+ if (!sameValueForSavedIndexedResultAndCurrentOne) {
+ DebugAssertions.error(
+ "Unexpected difference in indexing of %s by index %s, file type %s, charset %s\ndiff %s\nprevious indexed info %s",
+ fileContent.getFile(),
+ myIndexId,
+ fileContent.getFileType(),
+ ((FileContentImpl)fileContent).getCharset(),
+ buildDiff(data, contentData),
+ myIndexingTrace.get(hashId)
+ );
+ }
}
}
} else {
@@ -344,16 +390,27 @@
if (data == null) data = content != null ? myIndexer.map(content) : Collections.<Key, Value>emptyMap();
if (hashId != null && !havePersistentData) {
- savePersistentData(data, hashId, skippedReadingPersistentDataButMayHaveIt);
+ boolean saved = savePersistentData(data, hashId, skippedReadingPersistentDataButMayHaveIt);
+ if (DebugAssertions.EXTRA_SANITY_CHECKS) {
+ if (saved) {
+
+ FileContent fileContent = (FileContent)content;
+ try {
+ myIndexingTrace.put(hashId, ((FileContentImpl)fileContent).getCharset() + "," + fileContent.getFileType()+"," + fileContent.getFile().getPath() + "," +
+ ExceptionUtil.getThrowableText(new Throwable()));
+ } catch (IOException ex) {
+ LOG.error(ex);
+ }
+ }
+ }
}
ProgressManager.checkCanceled();
final NotNullComputable<Collection<Key>> oldKeysGetter;
final int savedInputId;
- if (myHasSnapshotMapping && weProcessPhysicalContent) {
+ if (myHasSnapshotMapping) {
try {
-
- oldKeysGetter = new NotNullComputable<Collection<Key>>() {
+ final NotNullComputable<Collection<Key>> keysForGivenInputId = new NotNullComputable<Collection<Key>>() {
@NotNull
@Override
public Collection<Key> compute() {
@@ -369,15 +426,38 @@
}
return currentKeys;
- } catch (IOException e) {
+ }
+ catch (IOException e) {
throw new RuntimeException(e);
}
}
};
- if (content instanceof FileContent) {
- savedInputId = getHashOfContent((FileContent)content);
+ if (weProcessPhysicalContent) {
+ if (content instanceof FileContent) {
+ savedInputId = getHashOfContent((FileContent)content);
+ }
+ else {
+ savedInputId = NULL_MAPPING;
+ }
+ oldKeysGetter = keysForGivenInputId;
} else {
+ oldKeysGetter = new NotNullComputable<Collection<Key>>() {
+ @NotNull
+ @Override
+ public Collection<Key> compute() {
+ try {
+ Collection<Key> oldKeys = myInputsIndex.get(inputId);
+ if (oldKeys == null) {
+ return keysForGivenInputId.compute();
+ }
+ return oldKeys;
+ }
+ catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
savedInputId = NULL_MAPPING;
}
} catch (IOException ex) {
@@ -429,6 +509,41 @@
};
}
+ private StringBuilder buildDiff(Map<Key, Value> data, Map<Key, Value> contentData) {
+ StringBuilder moreInfo = new StringBuilder();
+ if (contentData.size() != data.size()) {
+ moreInfo.append("Indexer has different number of elements, previously ").append(data.size()).append(" after ")
+ .append(contentData.size()).append("\n");
+ } else {
+ moreInfo.append("total ").append(contentData.size()).append(" entries\n");
+ }
+
+ for(Map.Entry<Key, Value> keyValueEntry:contentData.entrySet()) {
+ if (!data.containsKey(keyValueEntry.getKey())) {
+ moreInfo.append("Previous data doesn't contain:").append(keyValueEntry.getKey()).append( " with value ").append(keyValueEntry.getValue()).append("\n");
+ }
+ else {
+ Value value = data.get(keyValueEntry.getKey());
+ if (!Comparing.equal(keyValueEntry.getValue(), value)) {
+ moreInfo.append("Previous data has different value for key:").append(keyValueEntry.getKey()).append( ", new value ").append(keyValueEntry.getValue()).append( ", oldValue:").append(value).append("\n");
+ }
+ }
+ }
+
+ for(Map.Entry<Key, Value> keyValueEntry:data.entrySet()) {
+ if (!contentData.containsKey(keyValueEntry.getKey())) {
+ moreInfo.append("New data doesn't contain:").append(keyValueEntry.getKey()).append( " with value ").append(keyValueEntry.getValue()).append("\n");
+ }
+ else {
+ Value value = contentData.get(keyValueEntry.getKey());
+ if (!Comparing.equal(keyValueEntry.getValue(), value)) {
+ moreInfo.append("New data has different value for key:").append(keyValueEntry.getKey()).append( " new value ").append(value).append( ", oldValue:").append(keyValueEntry.getValue()).append("\n");
+ }
+ }
+ }
+ return moreInfo;
+ }
+
private Map<Key, Value> deserializeSavedPersistentData(ByteSequence bytes) throws IOException {
DataInputStream stream = new DataInputStream(new UnsyncByteArrayInputStream(bytes.getBytes(), bytes.getOffset(), bytes.getLength()));
int pairs = DataInputOutputUtil.readINT(stream);
@@ -447,8 +562,9 @@
if (previouslyCalculatedContentHashId == null) {
byte[] hash = content instanceof FileContentImpl ? ((FileContentImpl)content).getHash():null;
if (hash == null) {
+ Charset charset = content instanceof FileContentImpl ? ((FileContentImpl)content).getCharset() : null;
previouslyCalculatedContentHashId = ContentHashesSupport
- .calcContentHashIdWithFileType(content.getContent(), content.getFileType());
+ .calcContentHashIdWithFileType(content.getContent(), charset, content.getFileType());
} else {
previouslyCalculatedContentHashId = ContentHashesSupport.enumerateHash(hash);
}
@@ -459,9 +575,9 @@
private static final ThreadLocalCachedByteArray ourSpareByteArray = new ThreadLocalCachedByteArray();
- private void savePersistentData(Map<Key, Value> data, int id, boolean delayedReading) {
+ private boolean savePersistentData(Map<Key, Value> data, int id, boolean delayedReading) {
try {
- if (delayedReading && myContents.containsMapping(id)) return;
+ if (delayedReading && myContents.containsMapping(id)) return false;
BufferExposingByteArrayOutputStream out = new BufferExposingByteArrayOutputStream(ourSpareByteArray.getBuffer(4 * data.size()));
DataOutputStream stream = new DataOutputStream(out);
int size = data.size();
@@ -496,6 +612,7 @@
} catch (IOException ex) {
throw new RuntimeException(ex);
}
+ return true;
}
private static final com.intellij.openapi.util.Key<Integer> ourSavedContentHashIdKey = com.intellij.openapi.util.Key.create("saved.content.hash.id");
diff --git a/platform/lang-impl/src/com/intellij/util/indexing/containers/ChangeBufferingList.java b/platform/lang-impl/src/com/intellij/util/indexing/containers/ChangeBufferingList.java
index 77c5b50..103f7d5 100644
--- a/platform/lang-impl/src/com/intellij/util/indexing/containers/ChangeBufferingList.java
+++ b/platform/lang-impl/src/com/intellij/util/indexing/containers/ChangeBufferingList.java
@@ -255,8 +255,9 @@
if (intContainer == null && removals == 0) {
ValueContainer.IntIterator iterator = new ChangesIterator(changes, length);
if (DEBUG) {
- iterator = SortedFileIdSetIterator.getTransientIterator(iterator);
- DebugAssertions.assertTrue(iterator.size() == length);
+ ValueContainer.IntIterator iteratorSurelyWithoutDupes = SortedFileIdSetIterator.getTransientIterator(iterator);
+ DebugAssertions.assertTrue(iteratorSurelyWithoutDupes.size() == length);
+ iterator = iterator.createCopyInInitialState();
}
return iterator;
}
diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java b/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java
index 1a91691..30822c0 100644
--- a/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java
+++ b/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java
@@ -73,7 +73,7 @@
if (Comparing.equal(each.getWorkspaceFile(), f)) return false;
ProjectFileIndex index = ProjectRootManager.getInstance(each).getFileIndex();
- if (index.isIgnored(f)) return false;
+ if (index.isExcluded(f)) return false;
isInContent |= index.isInContent(f);
}
if (shouldBeInContent && !isInContent) return false;
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TextBlockTransferable.java b/platform/platform-api/src/com/intellij/codeInsight/editorActions/TextBlockTransferable.java
similarity index 98%
rename from platform/lang-impl/src/com/intellij/codeInsight/editorActions/TextBlockTransferable.java
rename to platform/platform-api/src/com/intellij/codeInsight/editorActions/TextBlockTransferable.java
index 075f761..7d97281 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TextBlockTransferable.java
+++ b/platform/platform-api/src/com/intellij/codeInsight/editorActions/TextBlockTransferable.java
@@ -30,7 +30,7 @@
import java.util.Collections;
import java.util.List;
-class TextBlockTransferable implements Transferable {
+public class TextBlockTransferable implements Transferable {
private final Collection<TextBlockTransferableData> myExtraData;
private final RawText myRawText;
private final String myText;
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TextBlockTransferableData.java b/platform/platform-api/src/com/intellij/codeInsight/editorActions/TextBlockTransferableData.java
similarity index 95%
rename from platform/lang-impl/src/com/intellij/codeInsight/editorActions/TextBlockTransferableData.java
rename to platform/platform-api/src/com/intellij/codeInsight/editorActions/TextBlockTransferableData.java
index c15a50e..bdaf6f2 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TextBlockTransferableData.java
+++ b/platform/platform-api/src/com/intellij/codeInsight/editorActions/TextBlockTransferableData.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
diff --git a/platform/platform-api/src/com/intellij/codeStyle/CodeStyleFacade.java b/platform/platform-api/src/com/intellij/codeStyle/CodeStyleFacade.java
index 8b424cc..0bc7ed4 100644
--- a/platform/platform-api/src/com/intellij/codeStyle/CodeStyleFacade.java
+++ b/platform/platform-api/src/com/intellij/codeStyle/CodeStyleFacade.java
@@ -19,6 +19,7 @@
*/
package com.intellij.codeStyle;
+import com.intellij.lang.Language;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileTypes.FileType;
@@ -53,7 +54,7 @@
public abstract boolean isSmartTabs(final FileType fileType);
- public abstract int getRightMargin();
+ public abstract int getRightMargin(Language language);
public abstract boolean isWrapWhenTypingReachesRightMargin();
diff --git a/platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java b/platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java
index d4ac053..1d4fea4 100644
--- a/platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java
+++ b/platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java
@@ -50,6 +50,8 @@
@NonNls String ACTION_EDITOR_COMPLETE_STATEMENT = "EditorCompleteStatement";
@NonNls String ACTION_EDITOR_USE_SOFT_WRAPS = "EditorToggleUseSoftWraps";
@NonNls String ACTION_EDITOR_ADD_OR_REMOVE_CARET= "EditorAddOrRemoveCaret";
+ @NonNls String ACTION_EDITOR_CLONE_CARET_BELOW= "EditorCloneCaretBelow";
+ @NonNls String ACTION_EDITOR_CLONE_CARET_ABOVE= "EditorCloneCaretAbove";
@NonNls String ACTION_EDITOR_NEXT_TEMPLATE_VARIABLE = "NextTemplateVariable";
@NonNls String ACTION_EDITOR_PREVIOUS_TEMPLATE_VARIABLE = "PreviousTemplateVariable";
@@ -267,6 +269,7 @@
String ACTION_UNDO = "$Undo";
String ACTION_REDO = "$Redo";
String GROUP_REFACTOR = "RefactoringMenu";
+ String SELECTED_CHANGES_ROLLBACK = "RollbackLineStatusChanges";
String CHANGES_VIEW_ROLLBACK = "ChangesView.Rollback";
String CONSOLE_CLEAR_ALL = "ConsoleView.ClearAll";
diff --git a/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ComboBoxAction.java b/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ComboBoxAction.java
index e724288..92a1d9c 100644
--- a/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ComboBoxAction.java
+++ b/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ComboBoxAction.java
@@ -47,6 +47,7 @@
private static final Icon DISABLED_ARROW_ICON = IconLoader.getDisabledIcon(ARROW_ICON);
private boolean mySmallVariant = true;
+ private String myPopupTitle;
private DataContext myDataContext;
protected ComboBoxAction() {
@@ -77,6 +78,10 @@
mySmallVariant = smallVariant;
}
+ public void setPopupTitle(String popupTitle) {
+ myPopupTitle = popupTitle;
+ }
+
@Override
public void update(AnActionEvent e) {
super.update(e);
@@ -247,7 +252,7 @@
DataContext context = getDataContext();
myDataContext = null;
final ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(
- null, group, context, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false, onDispose, getMaxRows());
+ myPopupTitle, group, context, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false, onDispose, getMaxRows());
popup.setMinimumSize(new Dimension(getMinWidth(), getMinHeight()));
return popup;
}
diff --git a/platform/platform-api/src/com/intellij/openapi/editor/CaretStateTransferableData.java b/platform/platform-api/src/com/intellij/openapi/editor/CaretStateTransferableData.java
new file mode 100644
index 0000000..f0d2085
--- /dev/null
+++ b/platform/platform-api/src/com/intellij/openapi/editor/CaretStateTransferableData.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2014 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.editor;
+
+import com.intellij.codeInsight.editorActions.TextBlockTransferableData;
+
+import java.awt.datatransfer.DataFlavor;
+
+public class CaretStateTransferableData implements TextBlockTransferableData {
+ public static final DataFlavor FLAVOR = new DataFlavor(CaretStateTransferableData.class, "Caret state");
+
+ public final int[] startOffsets;
+ public final int[] endOffsets;
+
+ public CaretStateTransferableData(int[] startOffsets, int[] endOffsets) {
+ this.startOffsets = startOffsets;
+ this.endOffsets = endOffsets;
+ }
+
+ @Override
+ public DataFlavor getFlavor() {
+ return FLAVOR;
+ }
+
+ @Override
+ public int getOffsetCount() {
+ return startOffsets.length + endOffsets.length;
+ }
+
+ @Override
+ public int getOffsets(int[] offsets, int index) {
+ System.arraycopy(startOffsets, 0, offsets, index, startOffsets.length);
+ System.arraycopy(endOffsets, 0, offsets, index + startOffsets.length, endOffsets.length);
+ return index + getOffsetCount();
+ }
+
+ @Override
+ public int setOffsets(int[] offsets, int index) {
+ System.arraycopy(offsets, index, startOffsets, 0, startOffsets.length);
+ System.arraycopy(offsets, index + startOffsets.length, endOffsets, 0, endOffsets.length);
+ return index + getOffsetCount();
+ }
+}
diff --git a/platform/platform-api/src/com/intellij/openapi/editor/ClipboardTextPerCaretSplitter.java b/platform/platform-api/src/com/intellij/openapi/editor/ClipboardTextPerCaretSplitter.java
index afc58b8..a3e6241 100644
--- a/platform/platform-api/src/com/intellij/openapi/editor/ClipboardTextPerCaretSplitter.java
+++ b/platform/platform-api/src/com/intellij/openapi/editor/ClipboardTextPerCaretSplitter.java
@@ -15,12 +15,16 @@
*/
package com.intellij.openapi.editor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class ClipboardTextPerCaretSplitter {
- public List<String> split(String input, int caretCount) {
+ @NotNull
+ public List<String> split(@NotNull String input, @Nullable CaretStateTransferableData caretData, int caretCount) {
if (caretCount <= 0) {
throw new IllegalArgumentException("Caret count must be positive");
}
@@ -28,9 +32,17 @@
return Collections.singletonList(input);
}
List<String> result = new ArrayList<String>(caretCount);
- String[] lines = input.split("\n", -1);
+ int sourceCaretCount = caretData == null ? -1 : caretData.startOffsets.length;
+ String[] lines = sourceCaretCount == 1 || sourceCaretCount == caretCount ? null : input.split("\n", -1);
for (int i = 0; i < caretCount; i++) {
- if (lines.length == 0) {
+ if (sourceCaretCount == 1) {
+ result.add(input);
+ }
+ else if (sourceCaretCount == caretCount) {
+ //noinspection ConstantConditions
+ result.add(new String(input.substring(caretData.startOffsets[i], caretData.endOffsets[i])));
+ }
+ else if (lines.length == 0) {
result.add("");
}
else if (lines.length == 1) {
diff --git a/platform/platform-api/src/com/intellij/openapi/editor/CopyPasteSupport.java b/platform/platform-api/src/com/intellij/openapi/editor/CopyPasteSupport.java
new file mode 100644
index 0000000..7095080
--- /dev/null
+++ b/platform/platform-api/src/com/intellij/openapi/editor/CopyPasteSupport.java
@@ -0,0 +1,212 @@
+/*
+ * Copyright 2000-2014 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.editor;
+
+import com.intellij.codeInsight.editorActions.TextBlockTransferable;
+import com.intellij.codeInsight.editorActions.TextBlockTransferableData;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.ide.CopyPasteManager;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.LineTokenizer;
+import com.intellij.util.Producer;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+public class CopyPasteSupport {
+ private static final Logger LOG = Logger.getInstance(CopyPasteSupport.class);
+
+ private CopyPasteSupport() { }
+
+ public static void copySelectionToClipboard(@NotNull Editor editor) {
+ ApplicationManager.getApplication().assertIsDispatchThread();
+ List<TextBlockTransferableData> extraData = new ArrayList<TextBlockTransferableData>();
+ String s = editor.getCaretModel().supportsMultipleCarets() ? getSelectedTextForClipboard(editor, extraData)
+ : editor.getSelectionModel().getSelectedText();
+ if (s == null) return;
+
+ s = TextBlockTransferable.convertLineSeparators(s, "\n", extraData);
+ Transferable contents = editor.getCaretModel().supportsMultipleCarets() ? new TextBlockTransferable(s, extraData, null) : new StringSelection(s);
+ CopyPasteManager.getInstance().setContents(contents);
+ }
+
+ public static String getSelectedTextForClipboard(@NotNull Editor editor, @NotNull Collection<TextBlockTransferableData> extraDataCollector) {
+ final StringBuilder buf = new StringBuilder();
+ String separator = "";
+ List<Caret> carets = editor.getCaretModel().getAllCarets();
+ int[] startOffsets = new int[carets.size()];
+ int[] endOffsets = new int[carets.size()];
+ for (int i = 0; i < carets.size(); i++) {
+ buf.append(separator);
+ String caretSelectedText = carets.get(i).getSelectedText();
+ startOffsets[i] = buf.length();
+ if (caretSelectedText != null) {
+ buf.append(caretSelectedText);
+ }
+ endOffsets[i] = buf.length();
+ separator = "\n";
+ }
+ extraDataCollector.add(new CaretStateTransferableData(startOffsets, endOffsets));
+ return buf.toString();
+ }
+
+
+ public static TextRange pasteFromClipboard(Editor editor) {
+ return pasteTransferable(editor, (Producer<Transferable>)null);
+ }
+
+ public static TextRange pasteTransferable(Editor editor, final Transferable content) {
+ return pasteTransferable(editor, new Producer<Transferable>() {
+ @Nullable
+ @Override
+ public Transferable produce() {
+ return content;
+ }
+ });
+ }
+
+ @Nullable
+ public static TextRange pasteTransferable(final Editor editor, @Nullable Producer<Transferable> producer) {
+ Transferable content = getTransferable(producer);
+ if (content == null) return null;
+ String text = getStringContent(content);
+ if (text == null) return null;
+
+ if (editor.getCaretModel().supportsMultipleCarets()) {
+ int caretCount = editor.getCaretModel().getCaretCount();
+ if (caretCount == 1 && editor.isColumnMode()) {
+ int pastedLineCount = LineTokenizer.calcLineCount(text, true);
+ EditorModificationUtil.deleteSelectedText(editor);
+ Caret caret = editor.getCaretModel().getPrimaryCaret();
+ for (int i = 0; i < pastedLineCount - 1; i++) {
+ caret = caret.clone(false);
+ if (caret == null) {
+ break;
+ }
+ }
+ caretCount = editor.getCaretModel().getCaretCount();
+ }
+ CaretStateTransferableData caretData = null;
+ try {
+ caretData = content.isDataFlavorSupported(CaretStateTransferableData.FLAVOR)
+ ? (CaretStateTransferableData)content.getTransferData(CaretStateTransferableData.FLAVOR) : null;
+ }
+ catch (Exception e) {
+ LOG.error(e);
+ }
+ final Iterator<String> segments = new ClipboardTextPerCaretSplitter().split(text, caretData, caretCount).iterator();
+ editor.getCaretModel().runForEachCaret(new CaretAction() {
+ @Override
+ public void perform(Caret caret) {
+ EditorModificationUtil.insertStringAtCaret(editor, segments.next(), false, true);
+ }
+ });
+ return null;
+ }
+ else {
+ int caretOffset = editor.getCaretModel().getOffset();
+ EditorModificationUtil.insertStringAtCaret(editor, text, false, true);
+ return new TextRange(caretOffset, caretOffset + text.length());
+ }
+ }
+
+ public static void pasteTransferableAsBlock(Editor editor, @Nullable Producer<Transferable> producer) {
+ Transferable content = getTransferable(producer);
+ if (content == null) return;
+ String text = getStringContent(content);
+ if (text == null) return;
+
+ int caretLine = editor.getCaretModel().getLogicalPosition().line;
+ int originalCaretLine = caretLine;
+ int selectedLinesCount = 0;
+
+ final SelectionModel selectionModel = editor.getSelectionModel();
+ if (selectionModel.hasBlockSelection()) {
+ final LogicalPosition start = selectionModel.getBlockStart();
+ final LogicalPosition end = selectionModel.getBlockEnd();
+ assert start != null;
+ assert end != null;
+ LogicalPosition caret = new LogicalPosition(Math.min(start.line, end.line), Math.min(start.column, end.column));
+ selectedLinesCount = Math.abs(end.line - start.line);
+ caretLine = caret.line;
+
+ EditorModificationUtil.deleteSelectedText(editor);
+ editor.getCaretModel().moveToLogicalPosition(caret);
+ }
+
+ LogicalPosition caretToRestore = editor.getCaretModel().getLogicalPosition();
+
+ String[] lines = LineTokenizer.tokenize(text.toCharArray(), false);
+ if (lines.length > 1 || selectedLinesCount == 0) {
+ int longestLineLength = 0;
+ for (int i = 0; i < lines.length; i++) {
+ String line = lines[i];
+ longestLineLength = Math.max(longestLineLength, line.length());
+ editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(caretLine + i, caretToRestore.column));
+ EditorModificationUtil.insertStringAtCaret(editor, line, false, true);
+ }
+ caretToRestore = new LogicalPosition(originalCaretLine, caretToRestore.column + longestLineLength);
+ }
+ else {
+ for (int i = 0; i <= selectedLinesCount; i++) {
+ editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(caretLine + i, caretToRestore.column));
+ EditorModificationUtil.insertStringAtCaret(editor, text, false, true);
+ }
+ caretToRestore = new LogicalPosition(originalCaretLine, caretToRestore.column + text.length());
+ }
+
+ editor.getCaretModel().moveToLogicalPosition(caretToRestore);
+ EditorModificationUtil.zeroWidthBlockSelectionAtCaretColumn(editor, caretLine, caretLine + selectedLinesCount);
+ }
+
+ @Nullable
+ private static String getStringContent(@NotNull Transferable content) {
+ RawText raw = RawText.fromTransferable(content);
+ if (raw != null) return raw.rawText;
+
+ try {
+ return (String)content.getTransferData(DataFlavor.stringFlavor);
+ }
+ catch (UnsupportedFlavorException ignore) { }
+ catch (IOException ignore) { }
+
+ return null;
+ }
+
+ private static Transferable getTransferable(Producer<Transferable> producer) {
+ Transferable content = null;
+ if (producer != null) {
+ content = producer.produce();
+ }
+ else {
+ CopyPasteManager manager = CopyPasteManager.getInstance();
+ if (manager.areDataFlavorsAvailable(DataFlavor.stringFlavor)) {
+ content = manager.getContents();
+ }
+ }
+ return content;
+ }
+}
diff --git a/platform/platform-api/src/com/intellij/openapi/editor/EditorModificationUtil.java b/platform/platform-api/src/com/intellij/openapi/editor/EditorModificationUtil.java
index 3fddbc3..ee55279 100644
--- a/platform/platform-api/src/com/intellij/openapi/editor/EditorModificationUtil.java
+++ b/platform/platform-api/src/com/intellij/openapi/editor/EditorModificationUtil.java
@@ -19,20 +19,14 @@
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.editor.event.MockDocumentEvent;
-import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.TextRange;
-import com.intellij.openapi.util.text.LineTokenizer;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.util.Producer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.IOException;
-import java.util.Iterator;
import java.util.List;
public class EditorModificationUtil {
@@ -99,7 +93,7 @@
zeroWidthBlockSelectionAtCaretColumn(editor, startLine, endLine);
}
- private static void zeroWidthBlockSelectionAtCaretColumn(final Editor editor, final int startLine, final int endLine) {
+ public static void zeroWidthBlockSelectionAtCaretColumn(final Editor editor, final int startLine, final int endLine) {
int caretColumn = editor.getCaretModel().getLogicalPosition().column;
editor.getSelectionModel().setBlockSelection(new LogicalPosition(startLine, caretColumn), new LogicalPosition(endLine, caretColumn));
}
@@ -181,112 +175,21 @@
return offset;
}
+ /**
+ * @deprecated Use {@link com.intellij.openapi.editor.CopyPasteSupport#pasteTransferable(Editor, com.intellij.util.Producer)} instead.
+ * (to remove in IDEA 15)
+ */
@Nullable
public static TextRange pasteTransferable(final Editor editor, @Nullable Producer<Transferable> producer) {
- String text = getStringContent(producer);
- if (text == null) return null;
-
- if (editor.getCaretModel().supportsMultipleCarets()) {
- int caretCount = editor.getCaretModel().getCaretCount();
- if (caretCount == 1 && editor.isColumnMode()) {
- int pastedLineCount = LineTokenizer.calcLineCount(text, true);
- deleteSelectedText(editor);
- Caret caret = editor.getCaretModel().getPrimaryCaret();
- for (int i = 0; i < pastedLineCount - 1; i++) {
- caret = caret.clone(false);
- if (caret == null) {
- break;
- }
- }
- caretCount = editor.getCaretModel().getCaretCount();
- }
- final Iterator<String> segments = new ClipboardTextPerCaretSplitter().split(text, caretCount).iterator();
- editor.getCaretModel().runForEachCaret(new CaretAction() {
- @Override
- public void perform(Caret caret) {
- insertStringAtCaret(editor, segments.next(), false, true);
- }
- });
- return null;
- }
- else {
- int caretOffset = editor.getCaretModel().getOffset();
- insertStringAtCaret(editor, text, false, true);
- return new TextRange(caretOffset, caretOffset + text.length());
- }
+ return CopyPasteSupport.pasteTransferable(editor, producer);
}
+ /**
+ * @deprecated Use {@link com.intellij.openapi.editor.CopyPasteSupport#pasteTransferableAsBlock(Editor, com.intellij.util.Producer)} instead.
+ * (to remove in IDEA 15)
+ */
public static void pasteTransferableAsBlock(Editor editor, @Nullable Producer<Transferable> producer) {
- String text = getStringContent(producer);
- if (text == null) return;
-
- int caretLine = editor.getCaretModel().getLogicalPosition().line;
- int originalCaretLine = caretLine;
- int selectedLinesCount = 0;
-
- final SelectionModel selectionModel = editor.getSelectionModel();
- if (selectionModel.hasBlockSelection()) {
- final LogicalPosition start = selectionModel.getBlockStart();
- final LogicalPosition end = selectionModel.getBlockEnd();
- assert start != null;
- assert end != null;
- LogicalPosition caret = new LogicalPosition(Math.min(start.line, end.line), Math.min(start.column, end.column));
- selectedLinesCount = Math.abs(end.line - start.line);
- caretLine = caret.line;
-
- deleteSelectedText(editor);
- editor.getCaretModel().moveToLogicalPosition(caret);
- }
-
- LogicalPosition caretToRestore = editor.getCaretModel().getLogicalPosition();
-
- String[] lines = LineTokenizer.tokenize(text.toCharArray(), false);
- if (lines.length > 1 || selectedLinesCount == 0) {
- int longestLineLength = 0;
- for (int i = 0; i < lines.length; i++) {
- String line = lines[i];
- longestLineLength = Math.max(longestLineLength, line.length());
- editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(caretLine + i, caretToRestore.column));
- insertStringAtCaret(editor, line, false, true);
- }
- caretToRestore = new LogicalPosition(originalCaretLine, caretToRestore.column + longestLineLength);
- }
- else {
- for (int i = 0; i <= selectedLinesCount; i++) {
- editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(caretLine + i, caretToRestore.column));
- insertStringAtCaret(editor, text, false, true);
- }
- caretToRestore = new LogicalPosition(originalCaretLine, caretToRestore.column + text.length());
- }
-
- editor.getCaretModel().moveToLogicalPosition(caretToRestore);
- zeroWidthBlockSelectionAtCaretColumn(editor, caretLine, caretLine + selectedLinesCount);
- }
-
- @Nullable
- private static String getStringContent(@Nullable Producer<Transferable> producer) {
- Transferable content = null;
- if (producer != null) {
- content = producer.produce();
- }
- else {
- CopyPasteManager manager = CopyPasteManager.getInstance();
- if (manager.areDataFlavorsAvailable(DataFlavor.stringFlavor)) {
- content = manager.getContents();
- }
- }
- if (content == null) return null;
-
- RawText raw = RawText.fromTransferable(content);
- if (raw != null) return raw.rawText;
-
- try {
- return (String)content.getTransferData(DataFlavor.stringFlavor);
- }
- catch (UnsupportedFlavorException ignore) { }
- catch (IOException ignore) { }
-
- return null;
+ CopyPasteSupport.pasteTransferableAsBlock(editor, producer);
}
/**
@@ -494,40 +397,4 @@
CaretModel caretModel = editor.getCaretModel();
caretModel.moveToOffset(caretModel.getOffset() + caretShift);
}
-
- /** @deprecated use {@link #pasteTransferable(Editor, Producer)} (to remove in IDEA 14) */
- @SuppressWarnings("UnusedDeclaration")
- public static TextRange pasteFromClipboard(Editor editor) {
- return pasteTransferable(editor, null);
- }
-
- /** @deprecated use {@link #pasteTransferable(Editor, Producer)} (to remove in IDEA 14) */
- @SuppressWarnings("SpellCheckingInspection,UnusedDeclaration")
- public static TextRange pasteFromTransferrable(final Transferable content, Editor editor) {
- return pasteTransferable(editor, new Producer<Transferable>() {
- @Nullable
- @Override
- public Transferable produce() {
- return content;
- }
- });
- }
-
- @SuppressWarnings("UnusedDeclaration")
- /** @deprecated use {@link #pasteTransferableAsBlock(Editor, Producer)} (to remove in IDEA 14) */
- public static void pasteFromClipboardAsBlock(Editor editor) {
- pasteTransferableAsBlock(editor, (Producer<Transferable>)null);
- }
-
- @SuppressWarnings("UnusedDeclaration")
- /** @deprecated use {@link #pasteTransferableAsBlock(Editor, Producer)} (to remove in IDEA 14) */
- public static void pasteTransferableAsBlock(Editor editor, @Nullable final Transferable content) {
- pasteTransferableAsBlock(editor, new Producer<Transferable>() {
- @Nullable
- @Override
- public Transferable produce() {
- return content;
- }
- });
- }
}
diff --git a/platform/platform-api/src/com/intellij/openapi/editor/highlighter/FragmentedEditorHighlighter.java b/platform/platform-api/src/com/intellij/openapi/editor/highlighter/FragmentedEditorHighlighter.java
index 13b2c43..9cd9ab2 100644
--- a/platform/platform-api/src/com/intellij/openapi/editor/highlighter/FragmentedEditorHighlighter.java
+++ b/platform/platform-api/src/com/intellij/openapi/editor/highlighter/FragmentedEditorHighlighter.java
@@ -19,6 +19,7 @@
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.editor.markup.TextAttributes;
+import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;
@@ -74,8 +75,8 @@
if (myMergeByTextAttributes && !myPieces.isEmpty()) {
Element element = myPieces.get(myPieces.size() - 1);
if (element.getEnd() >= offset + relativeStart &&
- element.getAttributes().equals(iterator.getTextAttributes()) &&
- element.getElementType().equals(iterator.getTokenType())) {
+ Comparing.equal(element.getAttributes(), iterator.getTextAttributes()) &&
+ Comparing.equal(element.getElementType(), iterator.getTokenType())) {
merged = true;
myPieces.add(new Element(element.getStart(),
offset + relativeEnd,
diff --git a/platform/platform-api/src/com/intellij/openapi/options/ConfigurableEP.java b/platform/platform-api/src/com/intellij/openapi/options/ConfigurableEP.java
index 07430dd..11c8bdd 100644
--- a/platform/platform-api/src/com/intellij/openapi/options/ConfigurableEP.java
+++ b/platform/platform-api/src/com/intellij/openapi/options/ConfigurableEP.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -90,6 +90,8 @@
@Attribute("id")
public String id;
+ @Attribute("groupId")
+ public String groupId;
/** Marks project level configurables that do not apply to the default project. */
@Attribute("nonDefaultProject")
diff --git a/platform/platform-api/src/com/intellij/openapi/options/SearchableConfigurable.java b/platform/platform-api/src/com/intellij/openapi/options/SearchableConfigurable.java
index 6341448..e98bb05 100644
--- a/platform/platform-api/src/com/intellij/openapi/options/SearchableConfigurable.java
+++ b/platform/platform-api/src/com/intellij/openapi/options/SearchableConfigurable.java
@@ -36,41 +36,49 @@
boolean hasOwnContent();
boolean isVisible();
-
abstract class Abstract implements Parent {
private Configurable[] myKids;
+ @Override
public JComponent createComponent() {
return null;
}
+ @Override
public boolean hasOwnContent() {
return false;
}
+ @Override
public boolean isModified() {
return false;
}
+ @Override
public void apply() throws ConfigurationException {
}
+ @Override
public void reset() {
}
+ @Override
public void disposeUIResources() {
myKids = null;
}
+ @Override
public Runnable enableSearch(final String option) {
return null;
}
+ @Override
public boolean isVisible() {
return true;
}
+ @Override
public final Configurable[] getConfigurables() {
if (myKids != null) return myKids;
myKids = buildConfigurables();
diff --git a/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java b/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java
index 9e6c0aa..5d2ecaf 100644
--- a/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java
+++ b/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java
@@ -76,6 +76,10 @@
return value.toString();
}
+ protected Icon getIconFor(@NotNull T value) {
+ return null;
+ }
+
protected Runnable onChosen(@NotNull final T value) {
stopCellEditing(value);
@@ -137,6 +141,11 @@
return ComboBoxTableRenderer.this.getTextFor(value);
}
+ @Override
+ public Icon getIconFor(T value) {
+ return ComboBoxTableRenderer.this.getIconFor(value);
+ }
+
public PopupStep onChosen(T selectedValue, boolean finalChoice) {
myFinalRunnable = ComboBoxTableRenderer.this.onChosen(selectedValue);
return FINAL_CHOICE;
@@ -169,6 +178,9 @@
protected void customizeComponent(final T value, final JTable table, final boolean isSelected) {
setOpaque(true);
setText(value == null ? "" : getTextFor(value));
+ if (value != null) {
+ setIcon(getIconFor(value));
+ }
setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
setForeground(isSelected ? table.getSelectionForeground() : table.getForeground());
}
diff --git a/platform/platform-api/src/com/intellij/openapi/ui/DetailsComponent.java b/platform/platform-api/src/com/intellij/openapi/ui/DetailsComponent.java
index 5bbd3d1..34aaa93 100644
--- a/platform/platform-api/src/com/intellij/openapi/ui/DetailsComponent.java
+++ b/platform/platform-api/src/com/intellij/openapi/ui/DetailsComponent.java
@@ -170,11 +170,7 @@
myContent.setBorder(new EmptyBorder(UIUtil.PANEL_REGULAR_INSETS));
}
else {
- if (Registry.is("ide.new.project.settings")) {
- myContent.setBorder(new EmptyBorder(16, 10, 16, 10));
- } else {
- myContent.setBorder(null);
- }
+ myContent.setBorder(null);
}
}
diff --git a/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java b/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java
index 6f38d9a..101444a 100644
--- a/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java
+++ b/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java
@@ -87,7 +87,7 @@
public Dimension getPreferredSize() {
if (myComponent != null) {
int size = myComponent.getPreferredSize().height;
- if (myComponent instanceof ComboBox && (UIUtil.isUnderIntelliJLaF() || UIUtil.isUnderDarcula())) {
+ if (myComponent instanceof JComboBox && (UIUtil.isUnderIntelliJLaF() || UIUtil.isUnderDarcula())) {
size -= 2; // decrement to match JTextField's preferred height
}
return new Dimension(size, size);
@@ -120,9 +120,7 @@
public void setBounds(Rectangle r) {
if (r.width != r.height) {
int size = Math.min(r.width, r.height);
- r = new Rectangle(r);
- r.width = size;
- r.height = size;
+ r = new Rectangle(r.x, r.y, size, size);
}
super.setBounds(r);
}
diff --git a/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java b/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java
index 35e81b0..816349ed 100644
--- a/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java
+++ b/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java
@@ -135,11 +135,7 @@
mySplitter.setSplitterProportionKey("ProjectStructure.SecondLevelElements");
mySplitter.setHonorComponentsMinimumSize(true);
if (Registry.is("ide.new.project.settings")) {
- mySplitter.setDividerWidth(1);
- mySplitter.setShowDividerIcon(false);
- mySplitter.getDivider().setBackground(Gray._153.withAlpha(128));
- mySplitter.setShowDividerControls(false);
- mySplitter.setOrientation(mySplitter.getOrientation());
+ mySplitter.setOnePixelMode();
}
installAutoScroll();
diff --git a/platform/platform-api/src/com/intellij/openapi/ui/ThreeComponentsSplitter.java b/platform/platform-api/src/com/intellij/openapi/ui/ThreeComponentsSplitter.java
index faa26e2..62864d0 100644
--- a/platform/platform-api/src/com/intellij/openapi/ui/ThreeComponentsSplitter.java
+++ b/platform/platform-api/src/com/intellij/openapi/ui/ThreeComponentsSplitter.java
@@ -26,6 +26,7 @@
import com.intellij.util.ui.update.Activatable;
import com.intellij.util.ui.update.UiNotifyConnector;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.*;
@@ -56,9 +57,9 @@
private final Divider myFirstDivider;
private final Divider myLastDivider;
- private JComponent myFirstComponent;
- private JComponent myInnerComponent;
- private JComponent myLastComponent;
+ @Nullable private JComponent myFirstComponent;
+ @Nullable private JComponent myInnerComponent;
+ @Nullable private JComponent myLastComponent;
private int myFirstSize = 10;
private int myLastSize = 10;
@@ -303,6 +304,7 @@
repaint();
}
+ @Nullable
public JComponent getFirstComponent() {
return myFirstComponent;
}
@@ -312,7 +314,7 @@
* repaint the splitter. If there is already
*
*/
- public void setFirstComponent(JComponent component) {
+ public void setFirstComponent(@Nullable JComponent component) {
if (myFirstComponent != component) {
if (myFirstComponent != null) {
remove(myFirstComponent);
@@ -325,6 +327,7 @@
}
}
+ @Nullable
public JComponent getLastComponent() {
return myLastComponent;
}
@@ -335,7 +338,7 @@
* repaint the splitter.
*
*/
- public void setLastComponent(JComponent component) {
+ public void setLastComponent(@Nullable JComponent component) {
if (myLastComponent != component) {
if (myLastComponent != null) {
remove(myLastComponent);
@@ -348,7 +351,7 @@
}
}
-
+ @Nullable
public JComponent getInnerComponent() {
return myInnerComponent;
}
@@ -359,7 +362,7 @@
* repaint the splitter.
*
*/
- public void setInnerComponent(JComponent component) {
+ public void setInnerComponent(@Nullable JComponent component) {
if (myInnerComponent != component) {
if (myInnerComponent != null) {
remove(myInnerComponent);
diff --git a/platform/platform-api/src/com/intellij/openapi/wm/FocusCommand.java b/platform/platform-api/src/com/intellij/openapi/wm/FocusCommand.java
index 6584184..fc9eec2 100644
--- a/platform/platform-api/src/com/intellij/openapi/wm/FocusCommand.java
+++ b/platform/platform-api/src/com/intellij/openapi/wm/FocusCommand.java
@@ -15,6 +15,7 @@
*/
package com.intellij.openapi.wm;
+import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.popup.util.PopupUtil;
import com.intellij.openapi.util.ActionCallback;
@@ -22,12 +23,13 @@
import com.intellij.openapi.util.Expirable;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.registry.Registry;
-import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.*;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
import java.util.Arrays;
/**
@@ -41,6 +43,8 @@
private boolean myInvalidatesPendingFurtherRequestors = true;
private Expirable myExpirable;
+ public static final Logger LOG = Logger.getInstance("#com.intellij.openapi.wm.FocusCommand");
+
public boolean isForced() {
return myForced;
}
@@ -154,46 +158,51 @@
public static class ByComponent extends FocusCommand {
private Component myToFocus;
+ private Throwable myAllocation;
- public ByComponent(@Nullable Component toFocus) {
- this(toFocus, toFocus);
+ public ByComponent(@Nullable Component toFocus, @NotNull Throwable allocation) {
+ this(toFocus, toFocus, allocation);
}
- public ByComponent(@Nullable Component toFocus, @Nullable Component dominationComponent) {
+ public ByComponent(@Nullable Component toFocus, @Nullable Component dominationComponent, @NotNull Throwable allocation) {
super(toFocus, dominationComponent);
+ myAllocation = allocation;
myToFocus = toFocus;
}
@NotNull
public final ActionCallback run() {
- if (myToFocus != null) {
- if (Registry.is("actionSystem.doNotStealFocus")) {
- Window topWindow = SwingUtilities.windowForComponent(myToFocus);
- UIUtil.setAutoRequestFocus(topWindow, topWindow.isActive());
- while (topWindow.getOwner() != null) {
- topWindow = SwingUtilities.windowForComponent(topWindow);
- UIUtil.setAutoRequestFocus(topWindow, topWindow.isActive());
- }
- if (topWindow.isActive()) {
- if (!myToFocus.requestFocusInWindow()) {
- myToFocus.requestFocus();
- }
- } else {
- myToFocus.requestFocusInWindow();
- }
+ boolean shouldLogFocuses = Registry.is("ide.log.focuses");
- } else {
- // This change seems reasonable to me. But as far as some implementations
- // can ignore the "forced" parameter we can get bad focus behaviour.
- // So let's start from mac.
- if (!(myToFocus.requestFocusInWindow())) {
- if (!SystemInfo.isMac || isForced() ) {
- myToFocus.requestFocus();
- }
+ if (shouldLogFocuses) {
+ myToFocus.addFocusListener(new FocusAdapter() {
+ @Override
+ public void focusGained(FocusEvent e) {
+ if (isExpired()) return;
+ super.focusGained(e);
+ LOG.info("Focus gained on " + myToFocus.getClass().getName());
+ myToFocus.removeFocusListener(this);
+ }
+ });
+ }
+
+ if (!(myToFocus.requestFocusInWindow())) {
+ if (shouldLogFocuses) {
+ LOG.info("We could not request focus in window on " + myToFocus.getClass().getName());
+ LOG.info(myAllocation);
+ }
+ if (!SystemInfo.isMac || isForced() ) {
+ myToFocus.requestFocus();
+ if (shouldLogFocuses) {
+ LOG.info("Force request focus on " + myToFocus.getClass().getName());
}
}
+ } else if (shouldLogFocuses) {
+ LOG.info("We have successfully requested focus in window on " + myToFocus.getClass().getName());
+ LOG.info(myAllocation);
}
+
clear();
return new ActionCallback.Done();
}
diff --git a/platform/platform-api/src/com/intellij/ui/BooleanTableCellRenderer.java b/platform/platform-api/src/com/intellij/ui/BooleanTableCellRenderer.java
index 5c5426d..4a2dc6e 100644
--- a/platform/platform-api/src/com/intellij/ui/BooleanTableCellRenderer.java
+++ b/platform/platform-api/src/com/intellij/ui/BooleanTableCellRenderer.java
@@ -30,8 +30,12 @@
private final JPanel myPanel = new JPanel();
public BooleanTableCellRenderer() {
+ this(CENTER);
+ }
+
+ public BooleanTableCellRenderer(final int horizontalAlignment) {
super();
- setHorizontalAlignment(CENTER);
+ setHorizontalAlignment(horizontalAlignment);
setVerticalAlignment(CENTER);
setBorder(null);
setOpaque(true);
diff --git a/platform/platform-api/src/com/intellij/ui/ColorChooser.java b/platform/platform-api/src/com/intellij/ui/ColorChooser.java
index 9c8123a..6777ed7 100644
--- a/platform/platform-api/src/com/intellij/ui/ColorChooser.java
+++ b/platform/platform-api/src/com/intellij/ui/ColorChooser.java
@@ -18,6 +18,9 @@
import org.jetbrains.annotations.Nullable;
import java.awt.*;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
/**
* Utility wrapper around JColorChooser. Helps to avoid memory leak through JColorChooser.ColorChooserDialog.cancelButton.
@@ -27,24 +30,38 @@
*/
public class ColorChooser {
@Nullable
+ @Deprecated
+ /**
+ * @deprecated Use {@link #chooseColor(java.awt.Component, String, java.awt.Color, boolean, java.util.List, boolean)}
+ */
public static Color chooseColor(Component parent,
String caption,
@Nullable Color preselectedColor,
boolean enableOpacity,
ColorPickerListener[] listeners,
boolean opacityInPercent) {
+ return chooseColor(parent, caption, preselectedColor, enableOpacity, Arrays.asList(listeners), opacityInPercent);
+ }
+
+ @Nullable
+ public static Color chooseColor(Component parent,
+ String caption,
+ @Nullable Color preselectedColor,
+ boolean enableOpacity,
+ List<ColorPickerListener> listeners,
+ boolean opacityInPercent) {
return ColorChooserService.getInstance().showDialog(parent, caption, preselectedColor, enableOpacity, listeners, opacityInPercent);
}
@Nullable
public static Color chooseColor(Component parent, String caption, @Nullable Color preselectedColor, boolean enableOpacity) {
- return chooseColor(parent, caption, preselectedColor, enableOpacity, ColorPickerListener.EMPTY_ARRAY, false);
+ return chooseColor(parent, caption, preselectedColor, enableOpacity, Collections.<ColorPickerListener>emptyList(), false);
}
@Nullable
public static Color chooseColor(Component parent, String caption, @Nullable Color preselectedColor, boolean enableOpacity,
boolean opacityInPercent) {
- return chooseColor(parent, caption, preselectedColor, enableOpacity, ColorPickerListener.EMPTY_ARRAY, opacityInPercent);
+ return chooseColor(parent, caption, preselectedColor, enableOpacity, Collections.<ColorPickerListener>emptyList(), opacityInPercent);
}
@Nullable
diff --git a/platform/platform-api/src/com/intellij/ui/ColorChooserService.java b/platform/platform-api/src/com/intellij/ui/ColorChooserService.java
index 6ecad03..6f34e5e 100644
--- a/platform/platform-api/src/com/intellij/ui/ColorChooserService.java
+++ b/platform/platform-api/src/com/intellij/ui/ColorChooserService.java
@@ -19,6 +19,7 @@
import org.jetbrains.annotations.Nullable;
import java.awt.*;
+import java.util.List;
/**
* @author Konstantin Bulenkov
@@ -29,10 +30,22 @@
}
@Nullable
+ @Deprecated
+ /**
+ * @deprecated Use {@link #showDialog(java.awt.Component, String, java.awt.Color, boolean, java.util.List, boolean)}
+ */
public abstract Color showDialog(Component parent, String caption, Color preselectedColor, boolean enableOpacity,
ColorPickerListener[] listeners);
@Nullable
+ @Deprecated
+ /**
+ * @deprecated Use {@link #showDialog(java.awt.Component, String, java.awt.Color, boolean, java.util.List, boolean)}
+ */
public abstract Color showDialog(Component parent, String caption, Color preselectedColor, boolean enableOpacity,
ColorPickerListener[] listeners, boolean opacityInPercent);
+
+ @Nullable
+ public abstract Color showDialog(Component parent, String caption, Color preselectedColor, boolean enableOpacity,
+ List<ColorPickerListener> listeners, boolean opacityInPercent);
}
diff --git a/platform/platform-api/src/com/intellij/ui/ColorPickerListener.java b/platform/platform-api/src/com/intellij/ui/ColorPickerListener.java
index f028dde..772265f 100644
--- a/platform/platform-api/src/com/intellij/ui/ColorPickerListener.java
+++ b/platform/platform-api/src/com/intellij/ui/ColorPickerListener.java
@@ -20,6 +20,7 @@
import java.awt.*;
public interface ColorPickerListener {
+ @Deprecated
ColorPickerListener[] EMPTY_ARRAY = new ColorPickerListener[0];
/**
diff --git a/platform/platform-api/src/com/intellij/ui/ExpandedItemRendererComponentWrapper.java b/platform/platform-api/src/com/intellij/ui/ExpandedItemRendererComponentWrapper.java
index 4e6d1c5..eea2011 100644
--- a/platform/platform-api/src/com/intellij/ui/ExpandedItemRendererComponentWrapper.java
+++ b/platform/platform-api/src/com/intellij/ui/ExpandedItemRendererComponentWrapper.java
@@ -19,6 +19,7 @@
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
+import javax.swing.border.Border;
import java.awt.*;
public class ExpandedItemRendererComponentWrapper extends JComponent {
@@ -40,4 +41,16 @@
}
});
}
+
+ @Override
+ public void setBorder(Border border) {
+ if (getComponentCount() == 1) {
+ Component component = getComponent(0);
+ if (component instanceof JComponent) {
+ ((JComponent)component).setBorder(border);
+ return;
+ }
+ }
+ super.setBorder(border);
+ }
}
diff --git a/platform/platform-api/src/com/intellij/ui/GroupedElementsRenderer.java b/platform/platform-api/src/com/intellij/ui/GroupedElementsRenderer.java
index 3ddbf47..76bacb9 100644
--- a/platform/platform-api/src/com/intellij/ui/GroupedElementsRenderer.java
+++ b/platform/platform-api/src/com/intellij/ui/GroupedElementsRenderer.java
@@ -15,9 +15,7 @@
*/
package com.intellij.ui;
-import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.components.panels.OpaquePanel;
-import com.intellij.util.ui.GraphicsUtil;
import com.intellij.util.ui.UIUtil;
import javax.swing.*;
@@ -26,38 +24,14 @@
import javax.swing.tree.TreeCellRenderer;
import java.awt.*;
-import static javax.swing.SwingConstants.CENTER;
-import static javax.swing.SwingConstants.LEFT;
-
public abstract class GroupedElementsRenderer {
public static final Color POPUP_SEPARATOR_FOREGROUND = new JBColor(Color.gray.brighter(), Gray._43);
public static final Color POPUP_SEPARATOR_TEXT_FOREGROUND = Color.gray;
public static final Color SELECTED_FRAME_FOREGROUND = Color.black;
- protected SeparatorWithText mySeparatorComponent = new SeparatorWithText() {
- @Override
- protected void paintComponent(Graphics g) {
- if (Registry.is("ide.new.project.settings")) {
- g.setColor(POPUP_SEPARATOR_FOREGROUND);
- Rectangle viewR = new Rectangle(0, getVgap(), getWidth() - 1, getHeight() - getVgap() - 1);
- Rectangle iconR = new Rectangle();
- Rectangle textR = new Rectangle();
- String s = SwingUtilities
- .layoutCompoundLabel(g.getFontMetrics(), getCaption(), null, CENTER,
- LEFT,
- CENTER,
- LEFT,
- viewR, iconR, textR, 0);
- GraphicsUtil.setupAAPainting(g);
- g.setColor(Gray._255.withAlpha(80));
- g.drawString(s, textR.x + 10, textR.y + 1 + g.getFontMetrics().getAscent());
- g.setColor(new Color(0x5F6D7B));
- g.drawString(s, textR.x + 10, textR.y + g.getFontMetrics().getAscent());
- } else {
- super.paintComponent(g);
- }
- }
- };
+ protected SeparatorWithText mySeparatorComponent = createSeparator();
+
+ protected abstract JComponent createItemComponent();
protected JComponent myComponent;
protected MyComponent myRendererComponent;
@@ -75,7 +49,9 @@
protected abstract void layout();
- protected abstract JComponent createItemComponent();
+ protected SeparatorWithText createSeparator() {
+ return new SeparatorWithText();
+ }
protected final JComponent configureComponent(String text, String tooltip, Icon icon, Icon disabledIcon, boolean isSelected, boolean hasSeparatorAbove, String separatorTextAbove, int preferredForcedWidth) {
mySeparatorComponent.setVisible(hasSeparatorAbove);
@@ -127,9 +103,9 @@
}
- protected final void setDeselected(JComponent aComponent) {
+ protected final void setDeselected(JComponent aComponent) {
aComponent.setBackground(getBackground());
- aComponent.setForeground(Registry.is("ide.new.project.settings") ? Gray._60 : getForeground());
+ aComponent.setForeground(getForeground());
}
protected abstract Color getSelectionBackground();
@@ -154,7 +130,7 @@
public abstract static class List extends GroupedElementsRenderer {
@Override
- protected final void layout() {
+ protected void layout() {
myRendererComponent.add(mySeparatorComponent, BorderLayout.NORTH);
myRendererComponent.add(myComponent, BorderLayout.CENTER);
}
diff --git a/platform/platform-api/src/com/intellij/ui/JBSplitter.java b/platform/platform-api/src/com/intellij/ui/JBSplitter.java
index f25c2ae..b4000db 100644
--- a/platform/platform-api/src/com/intellij/ui/JBSplitter.java
+++ b/platform/platform-api/src/com/intellij/ui/JBSplitter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -94,6 +94,14 @@
saveProportion();
}
+ public void setOnePixelMode() {
+ setDividerWidth(1);
+ setShowDividerIcon(false);
+ getDivider().setBackground(new JBColor(Gray._153.withAlpha(128), Gray._100.withAlpha(128)));
+ setShowDividerControls(false);
+ setOrientation(getOrientation());
+ }
+
protected void loadProportion() {
if (! StringUtil.isEmpty(mySplitterProportionKey)) {
setProportion(PropertiesComponent.getInstance().getFloat(mySplitterProportionKey, myProportion));
diff --git a/platform/platform-api/src/com/intellij/ui/TextFieldWithHistoryWithBrowseButton.java b/platform/platform-api/src/com/intellij/ui/TextFieldWithHistoryWithBrowseButton.java
index 9534bf0..e16e421 100644
--- a/platform/platform-api/src/com/intellij/ui/TextFieldWithHistoryWithBrowseButton.java
+++ b/platform/platform-api/src/com/intellij/ui/TextFieldWithHistoryWithBrowseButton.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -50,4 +50,8 @@
super.addBrowseFolderListener(title, description, project, fileChooserDescriptor, accessor, autoRemoveOnHide);
FileChooserFactory.getInstance().installFileCompletion(getChildComponent().getTextEditor(), fileChooserDescriptor, false, project);
}
+
+ public String getText() {
+ return getChildComponent().getText();
+ }
}
diff --git a/platform/platform-api/src/com/intellij/ui/dualView/DualView.java b/platform/platform-api/src/com/intellij/ui/dualView/DualView.java
index 56fe320..475220c 100644
--- a/platform/platform-api/src/com/intellij/ui/dualView/DualView.java
+++ b/platform/platform-api/src/com/intellij/ui/dualView/DualView.java
@@ -36,6 +36,7 @@
import com.intellij.util.ui.ColumnInfo;
import com.intellij.util.ui.ListTableModel;
import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import javax.swing.border.Border;
@@ -239,8 +240,9 @@
return createWrappedRenderer(super.getCellRenderer(row, column));
}
+ @NotNull
@Override
- public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
+ public Component prepareRenderer(@NotNull TableCellRenderer renderer, int row, int column) {
final Component c = super.prepareRenderer(renderer, row, column);
if (c instanceof JComponent && !myFlatView.getCellSelectionEnabled()) {
((JComponent)c).setBorder(null);
diff --git a/platform/platform-api/src/com/intellij/ui/speedSearch/SpeedSearchSupply.java b/platform/platform-api/src/com/intellij/ui/speedSearch/SpeedSearchSupply.java
index de3452d..736c4db 100644
--- a/platform/platform-api/src/com/intellij/ui/speedSearch/SpeedSearchSupply.java
+++ b/platform/platform-api/src/com/intellij/ui/speedSearch/SpeedSearchSupply.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -30,6 +30,10 @@
* @author Konstantin Bulenkov
*/
public abstract class SpeedSearchSupply {
+ /**
+ * Client property key to use in jcomponents for passing the actual search query to renderers
+ */
+ public static final String SEARCH_QUERY_KEY = "SEARCH_QUERY";
private static final Key SPEED_SEARCH_COMPONENT_MARKER = new Key("SPEED_SEARCH_COMPONENT_MARKER");
public static final DataKey<String> SPEED_SEARCH_CURRENT_QUERY = DataKey.create("SPEED_SEARCH_CURRENT_QUERY");
diff --git a/platform/platform-api/src/com/intellij/ui/table/JBTable.java b/platform/platform-api/src/com/intellij/ui/table/JBTable.java
index d8736f6..e7ff935 100644
--- a/platform/platform-api/src/com/intellij/ui/table/JBTable.java
+++ b/platform/platform-api/src/com/intellij/ui/table/JBTable.java
@@ -38,6 +38,8 @@
import java.util.EventObject;
public class JBTable extends JTable implements ComponentWithEmptyText, ComponentWithExpandableItems<TableCell> {
+ public static final int PREFERRED_SCROLLABLE_VIEWPORT_HEIGHT_IN_ROWS = 7;
+
private final StatusText myEmptyText;
private final ExpandableItemsHandler<TableCell> myExpandableItemsHandler;
@@ -84,30 +86,29 @@
}
@Override
- public void columnSelectionChanged(ListSelectionEvent e) {
+ public void columnSelectionChanged(@NotNull ListSelectionEvent e) {
}
@Override
- public void columnAdded(TableColumnModelEvent e) {
+ public void columnAdded(@NotNull TableColumnModelEvent e) {
}
@Override
- public void columnMoved(TableColumnModelEvent e) {
+ public void columnMoved(@NotNull TableColumnModelEvent e) {
}
@Override
- public void columnRemoved(TableColumnModelEvent e) {
+ public void columnRemoved(@NotNull TableColumnModelEvent e) {
}
});
final TableModelListener modelListener = new TableModelListener() {
@Override
- public void tableChanged(final TableModelEvent e) {
+ public void tableChanged(@NotNull final TableModelEvent e) {
if (!myRowHeightIsExplicitlySet) {
myRowHeight = -1;
}
- if ((e.getType() == TableModelEvent.DELETE && isEmpty())
- || (e.getType() == TableModelEvent.INSERT && !isEmpty())) {
+ if (e.getType() == TableModelEvent.DELETE && isEmpty() || e.getType() == TableModelEvent.INSERT && !isEmpty()) {
repaintViewport();
}
}
@@ -116,7 +117,7 @@
if (getModel() != null) getModel().addTableModelListener(modelListener);
addPropertyChangeListener("model", new PropertyChangeListener() {
@Override
- public void propertyChange(PropertyChangeEvent evt) {
+ public void propertyChange(@NotNull PropertyChangeEvent evt) {
repaintViewport();
if (evt.getOldValue() instanceof TableModel) {
@@ -197,6 +198,7 @@
}
}
+ @NotNull
@Override
protected JTableHeader createDefaultTableHeader() {
return new JBTableHeader();
@@ -237,7 +239,7 @@
}
@Override
- protected void paintComponent(Graphics g) {
+ protected void paintComponent(@NotNull Graphics g) {
if (myEnableAntialiasing) {
GraphicsUtil.setupAntialiasing(g);
}
@@ -320,7 +322,7 @@
}
@Override
- public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
+ public int getScrollableUnitIncrement(@NotNull Rectangle visibleRect, int orientation, int direction) {
if (orientation == SwingConstants.VERTICAL) {
return super.getScrollableUnitIncrement(visibleRect, orientation, direction);
}
@@ -339,7 +341,7 @@
}
@Override
- public void paint(Graphics g) {
+ public void paint(@NotNull Graphics g) {
if (!isEnabled()) {
g = new TableGrayer((Graphics2D)g);
}
@@ -470,8 +472,9 @@
isTypeAhead = false;
}
+ @NotNull
@Override
- public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
+ public Component prepareRenderer(@NotNull TableCellRenderer renderer, int row, int column) {
Component result = super.prepareRenderer(renderer, row, column);
// Fix GTK background
@@ -506,7 +509,7 @@
}
@Override
- public void propertyChange(final PropertyChangeEvent e) {
+ public void propertyChange(@NotNull final PropertyChangeEvent e) {
if (!isEditing()) {
return;
}
@@ -541,7 +544,7 @@
private final class MyMouseListener extends MouseAdapter {
@Override
- public void mousePressed(final MouseEvent e) {
+ public void mousePressed(@NotNull final MouseEvent e) {
if (SwingUtilities.isRightMouseButton(e)) {
final int[] selectedRows = getSelectedRows();
if (selectedRows.length < 2) {
@@ -629,6 +632,7 @@
return myModel.getValueAt(row, column);
}
+ @NotNull
@Override
public String getStringValueAt(int row, int column) {
TableStringConverter converter = getStringConverter();
@@ -666,7 +670,7 @@
super(JBTable.this.columnModel);
JBTable.this.addPropertyChangeListener(new PropertyChangeListener() {
@Override
- public void propertyChange(PropertyChangeEvent evt) {
+ public void propertyChange(@NotNull PropertyChangeEvent evt) {
JBTableHeader.this.revalidate();
JBTableHeader.this.repaint();
}
@@ -674,7 +678,7 @@
}
@Override
- public void paint(Graphics g) {
+ public void paint(@NotNull Graphics g) {
if (myEnableAntialiasing) {
GraphicsUtil.setupAntialiasing(g);
}
@@ -685,7 +689,7 @@
}
@Override
- public String getToolTipText(final MouseEvent event) {
+ public String getToolTipText(@NotNull final MouseEvent event) {
final TableModel model = getModel();
if (model instanceof SortableColumnModel) {
final int i = columnAtPoint(event.getPoint());
@@ -719,6 +723,7 @@
super.setColor(color);
}
+ @NotNull
@Override
public Graphics create() {
return new TableGrayer((Graphics2D)super.create());
diff --git a/platform/platform-api/src/com/intellij/ui/table/TableView.java b/platform/platform-api/src/com/intellij/ui/table/TableView.java
index a563c82..44b40e9 100644
--- a/platform/platform-api/src/com/intellij/ui/table/TableView.java
+++ b/platform/platform-api/src/com/intellij/ui/table/TableView.java
@@ -101,10 +101,12 @@
final RowSorter<? extends TableModel> sorter = getRowSorter();
final RowSorter.SortKey sortKey = sorter == null ? null : ContainerUtil.getFirstItem(sorter.getSortKeys());
- ColumnInfo[] columns = getListTableModel().getColumnInfos();
- int[] sizeMode = new int[columns.length];
- int[] headers = new int[columns.length];
- int[] widths = new int[columns.length];
+ ColumnInfo[] columnInfos = getListTableModel().getColumnInfos();
+ TableColumnModel columnModel = getColumnModel();
+ int visibleColumnCount = columnModel.getColumnCount();
+ int[] sizeMode = new int[visibleColumnCount];
+ int[] headers = new int[visibleColumnCount];
+ int[] widths = new int[visibleColumnCount];
int allColumnWidth = 0;
int allColumnCurrent = 0;
int varCount = 0;
@@ -112,9 +114,9 @@
Icon sortIcon = UIManager.getIcon("Table.ascendingSortIcon");
// calculate
- for (int i = 0; i < columns.length; i++) {
- final ColumnInfo columnInfo = columns[i];
- final TableColumn column = getColumnModel().getColumn(i);
+ for (int i = 0; i < visibleColumnCount; i++) {
+ final TableColumn column = columnModel.getColumn(i);
+ final ColumnInfo columnInfo = columnInfos[column.getModelIndex()];
TableCellRenderer columnHeaderRenderer = column.getHeaderRenderer();
if (columnHeaderRenderer == null) {
@@ -162,8 +164,8 @@
allColumnWidth < (1 - gold) * viewWidth ? (1 - gold) * viewWidth :
viewWidth) - allColumnWidth) / varCount;
- for (int i=0 ; i<columns.length; i ++) {
- TableColumn column = getColumnModel().getColumn(i);
+ for (int i = 0 ; i < visibleColumnCount; i++) {
+ TableColumn column = columnModel.getColumn(i);
int width = widths[i];
if (sizeMode[i] == 1) {
column.setMaxWidth(width);
diff --git a/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java b/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java
index 532c95a..a058badd 100644
--- a/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java
+++ b/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java
@@ -930,7 +930,7 @@
if (isShowing()) {
- return myFocusManager.requestFocus(new FocusCommand.ByComponent(toFocus), true);
+ return myFocusManager.requestFocus(new FocusCommand.ByComponent(toFocus, new Exception()), true);
}
else {
final ActionCallback result = new ActionCallback();
@@ -948,7 +948,7 @@
@Override
public void run() {
queued.set(true);
- requestor.requestFocus(new FocusCommand.ByComponent(toFocus), true).notify(result);
+ requestor.requestFocus(new FocusCommand.ByComponent(toFocus, new Exception()), true).notify(result);
}
};
return result;
diff --git a/platform/platform-api/src/com/intellij/util/net/HTTPProxySettings.form b/platform/platform-api/src/com/intellij/util/net/HTTPProxySettings.form
index 72db588..5ffe378 100644
--- a/platform/platform-api/src/com/intellij/util/net/HTTPProxySettings.form
+++ b/platform/platform-api/src/com/intellij/util/net/HTTPProxySettings.form
@@ -117,6 +117,7 @@
</grid>
</constraints>
<properties>
+ <lineWrap value="true"/>
<toolTipText value=""/>
</properties>
</component>
diff --git a/platform/platform-api/src/com/intellij/util/ui/NSScrollerHelper.java b/platform/platform-api/src/com/intellij/util/ui/NSScrollerHelper.java
index db82442..6498ed4 100644
--- a/platform/platform-api/src/com/intellij/util/ui/NSScrollerHelper.java
+++ b/platform/platform-api/src/com/intellij/util/ui/NSScrollerHelper.java
@@ -75,6 +75,8 @@
ID delegateClass = Foundation.allocateObjcClassPair(Foundation.getObjcClass("NSObject"), "NSScrollerChangesObserver");
if (!ID.NIL.equals(delegateClass)) {
+ // This static initializer might be called more than once (with different class loaders). In that case NSScrollerChangesObserver
+ // already exists.
if (!Foundation.addMethod(delegateClass, Foundation.createSelector("handleScrollerStyleChanged:"), APPEARANCE_CALLBACK, "v@")) {
throw new RuntimeException("Cannot add observer method");
}
diff --git a/platform/platform-impl/src/com/intellij/codeStyle/DefaultCodeStyleFacade.java b/platform/platform-impl/src/com/intellij/codeStyle/DefaultCodeStyleFacade.java
index bf748ab..4d9a34a 100644
--- a/platform/platform-impl/src/com/intellij/codeStyle/DefaultCodeStyleFacade.java
+++ b/platform/platform-impl/src/com/intellij/codeStyle/DefaultCodeStyleFacade.java
@@ -19,6 +19,7 @@
*/
package com.intellij.codeStyle;
+import com.intellij.lang.Language;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.options.Configurable;
@@ -39,7 +40,7 @@
return "\n";
}
- public int getRightMargin() {
+ public int getRightMargin(Language language) {
return 80;
}
diff --git a/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java b/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java
index 88d3aa28..26a6f63 100644
--- a/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java
+++ b/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java
@@ -45,7 +45,7 @@
private ThreadMXBean myThreadMXBean;
private final DateFormat myDateFormat = new SimpleDateFormat("yyyyMMdd-HHmmss");
//private DateFormat myPrintDateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
- private File myLogDir;
+ private File mySessionLogDir;
private int myUnresponsiveDuration = 0;
private File myCurHangLogDir;
private List<StackTraceElement> myStacktraceCommonPart;
@@ -98,9 +98,9 @@
}
});
- myLogDir = new File(PathManager.getLogPath() + "/threadDumps-" + myDateFormat.format(new Date())
+ mySessionLogDir = new File(PathManager.getLogPath() + "/threadDumps-" + myDateFormat.format(new Date())
+ "-" + ApplicationInfo.getInstance().getBuild().asString());
- myCurHangLogDir = myLogDir;
+ myCurHangLogDir = mySessionLogDir;
try {
myShutdownSemaphore.acquire();
@@ -164,22 +164,22 @@
}
if (mySwingThreadCounter != myLoopCounter) {
myUnresponsiveDuration += UNRESPONSIVE_INTERVAL;
- if (myUnresponsiveDuration == UNRESPONSIVE_THRESHOLD) {
- //System.out.println("EDT is not responding at " + myPrintDateFormat.format(new Date()));
- myCurHangLogDir = new File(myLogDir, myDateFormat.format(new Date()));
- }
if (myUnresponsiveDuration >= UNRESPONSIVE_THRESHOLD) {
+ if (myCurHangLogDir == mySessionLogDir) {
+ //System.out.println("EDT is not responding at " + myPrintDateFormat.format(new Date()));
+ myCurHangLogDir = new File(mySessionLogDir, myDateFormat.format(new Date()));
+ }
dumpThreads(false);
}
}
else {
if (myUnresponsiveDuration >= UNRESPONSIVE_THRESHOLD) {
//System.out.println("EDT was unresponsive for " + myUnresponsiveDuration + " seconds");
- if (myCurHangLogDir.exists()) {
- myCurHangLogDir.renameTo(new File(myLogDir, getLogDirForHang()));
+ if (myCurHangLogDir != mySessionLogDir && myCurHangLogDir.exists()) {
+ myCurHangLogDir.renameTo(new File(mySessionLogDir, getLogDirForHang()));
}
myUnresponsiveDuration = 0;
- myCurHangLogDir = myLogDir;
+ myCurHangLogDir = mySessionLogDir;
myStacktraceCommonPart = null;
}
diff --git a/platform/platform-impl/src/com/intellij/execution/impl/EditorHyperlinkSupport.java b/platform/platform-impl/src/com/intellij/execution/impl/EditorHyperlinkSupport.java
index 26429fc..d263288 100644
--- a/platform/platform-impl/src/com/intellij/execution/impl/EditorHyperlinkSupport.java
+++ b/platform/platform-impl/src/com/intellij/execution/impl/EditorHyperlinkSupport.java
@@ -181,7 +181,8 @@
new FilteringProcessor<RangeHighlighterEx>(new Condition<RangeHighlighterEx>() {
@Override
public boolean value(RangeHighlighterEx rangeHighlighterEx) {
- return HYPERLINK_LAYER == rangeHighlighterEx.getLayer() &&
+ return rangeHighlighterEx.getEditorFilter().avaliableIn(editor) &&
+ HYPERLINK_LAYER == rangeHighlighterEx.getLayer() &&
rangeHighlighterEx.isValid() &&
getHyperlinkInfo(rangeHighlighterEx) != null;
}
diff --git a/platform/platform-impl/src/com/intellij/help/impl/KeymapGenerator.java b/platform/platform-impl/src/com/intellij/help/impl/KeymapGenerator.java
index acd74f9..f38ef84 100644
--- a/platform/platform-impl/src/com/intellij/help/impl/KeymapGenerator.java
+++ b/platform/platform-impl/src/com/intellij/help/impl/KeymapGenerator.java
@@ -23,9 +23,11 @@
import com.intellij.openapi.keymap.ex.KeymapManagerEx;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
+import gnu.trove.THashSet;
import java.io.File;
import java.io.IOException;
+import java.util.Set;
/**
* @author Konstantin Bulenkov
@@ -47,13 +49,20 @@
xml.append("<Keymaps>\n");
for (Keymap keymap : KeymapManagerEx.getInstanceEx().getAllKeymaps()) {
- xml.append(" <Keymap name=\"").append(keymap.getName()).append("\">\n");
+
+ xml.append(" <Keymap name=\"").append(keymap.getPresentableName()).append("\">\n");
for (String id : keymap.getActionIds()) {
String shortcuts = KeymapUtil.getShortcutsText(keymap.getShortcuts(id));
if (!StringUtil.isEmpty(shortcuts)) {
xml.append(" <Action id=\"").append(id).append("\">\n");
+ Set<String> addedShortcuts = new THashSet<String>();
for (Shortcut shortcut : keymap.getShortcuts(id)) {
- xml.append(" <Shortcut>").append(KeymapUtil.getShortcutText(shortcut)).append("</Shortcut>\n");
+ // Different shortcuts may have equal display strings (e.g. shift+minus and shift+subtract)
+ // We don't want them do be duplicated for users
+ String shortcutText = KeymapUtil.getShortcutText(shortcut);
+ if (addedShortcuts.add(shortcutText)) {
+ xml.append(" <Shortcut>").append(shortcutText).append("</Shortcut>\n");
+ }
}
xml.append(" </Action>\n");
}
diff --git a/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java b/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java
index e92f80f..1bbd749 100644
--- a/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java
+++ b/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java
@@ -44,6 +44,7 @@
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.HashMap;
import com.intellij.util.ui.UIUtil;
+import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -53,6 +54,7 @@
import java.awt.event.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.*;
import java.util.List;
@@ -731,9 +733,29 @@
}
}
+ private static Field stickyAltField;
//IDEA-17359
private static void fixStickyAlt(AWTEvent e) {
- if (SystemInfo.isWindowsXP && e instanceof KeyEvent && ((KeyEvent)e).getKeyCode() == KeyEvent.VK_ALT) {
+ if (Registry.is("actionSystem.win.suppressAlt.new")) {
+ if (SystemInfo.isWindows
+ && UIManager.getLookAndFeel() instanceof WindowsLookAndFeel
+ && e instanceof InputEvent
+ && (((InputEvent)e).getModifiers() & (InputEvent.ALT_MASK | InputEvent.ALT_DOWN_MASK)) != 0
+ && !(e instanceof KeyEvent && ((KeyEvent)e).getKeyCode() == KeyEvent.VK_ALT)) {
+ try {
+ if (stickyAltField == null) {
+ stickyAltField = Class
+ .forName("com.sun.java.swing.plaf.windows.WindowsRootPaneUI$AltProcessor")
+ .getDeclaredField("menuCanceledOnPress");
+ stickyAltField.setAccessible(true);
+ }
+ stickyAltField.set(null, true);
+ }
+ catch (Exception exception) {
+ LOG.error(exception);
+ }
+ }
+ } else if (SystemInfo.isWindowsXP && e instanceof KeyEvent && ((KeyEvent)e).getKeyCode() == KeyEvent.VK_ALT) {
((KeyEvent)e).consume();
}
}
@@ -940,7 +962,7 @@
@Override
public boolean dispatch(AWTEvent e) {
boolean dispatch = true;
- if (e instanceof KeyEvent) {
+ if (!Registry.is("actionSystem.win.suppressAlt.new") && e instanceof KeyEvent) {
KeyEvent ke = (KeyEvent)e;
final Component component = ke.getComponent();
final Window window = component == null ? null : SwingUtilities.windowForComponent(component);
diff --git a/platform/platform-impl/src/com/intellij/ide/MacOSApplicationProvider.java b/platform/platform-impl/src/com/intellij/ide/MacOSApplicationProvider.java
index 798c029..a90d0df 100644
--- a/platform/platform-impl/src/com/intellij/ide/MacOSApplicationProvider.java
+++ b/platform/platform-impl/src/com/intellij/ide/MacOSApplicationProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -28,8 +28,6 @@
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.components.ApplicationComponent;
import com.intellij.openapi.options.ShowSettingsUtil;
-import com.intellij.openapi.options.ex.IdeConfigurablesGroup;
-import com.intellij.openapi.options.ex.ProjectConfigurablesGroup;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.util.SystemInfo;
@@ -98,8 +96,7 @@
}
if (!((ShowSettingsUtilImpl)ShowSettingsUtil.getInstance()).isAlreadyShown()) {
- ShowSettingsUtil.getInstance().showSettingsDialog(project, new ProjectConfigurablesGroup(project),
- new IdeConfigurablesGroup());
+ ShowSettingsUtil.getInstance().showSettingsDialog(project, ShowSettingsUtilImpl.getConfigurableGroups(project, true));
}
applicationEvent.setHandled(true);
}
diff --git a/platform/platform-impl/src/com/intellij/ide/TipOfTheDayManager.java b/platform/platform-impl/src/com/intellij/ide/TipOfTheDayManager.java
index 3c510c0..a93fea7 100644
--- a/platform/platform-impl/src/com/intellij/ide/TipOfTheDayManager.java
+++ b/platform/platform-impl/src/com/intellij/ide/TipOfTheDayManager.java
@@ -39,7 +39,7 @@
ToolWindowManager.getInstance(project).invokeLater(new Runnable() {
public void run() {
if (project.isDisposed()) return;
- new TipDialog().show();
+ TipDialog.createForProject(project).show();
}
});
}
diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsAction.java b/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsAction.java
index e89a7a3..eda6ec9 100644
--- a/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsAction.java
+++ b/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -20,8 +20,6 @@
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.options.ShowSettingsUtil;
-import com.intellij.openapi.options.ex.IdeConfigurablesGroup;
-import com.intellij.openapi.options.ex.ProjectConfigurablesGroup;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
@@ -60,7 +58,6 @@
}
}
});
- ShowSettingsUtil.getInstance().showSettingsDialog(project, new ProjectConfigurablesGroup(project),
- new IdeConfigurablesGroup());
+ ShowSettingsUtil.getInstance().showSettingsDialog(project, ShowSettingsUtilImpl.getConfigurableGroups(project, true));
}
}
diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsUtilImpl.java b/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsUtilImpl.java
index 7e31726..4df11f7 100644
--- a/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsUtilImpl.java
+++ b/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsUtilImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -22,6 +22,7 @@
import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.options.ex.ConfigurableExtensionPointUtil;
import com.intellij.openapi.options.ex.IdeConfigurablesGroup;
+import com.intellij.openapi.options.ex.MixedConfigurableGroup;
import com.intellij.openapi.options.ex.ProjectConfigurablesGroup;
import com.intellij.openapi.options.ex.SingleConfigurableEditor;
import com.intellij.openapi.options.newEditor.OptionsEditor;
@@ -29,6 +30,7 @@
import com.intellij.openapi.options.newEditor.PreferencesDialog;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
+import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.ui.update.Activatable;
import com.intellij.util.ui.update.UiNotifyConnector;
@@ -47,11 +49,62 @@
private static final Logger LOG = Logger.getInstance("#com.intellij.ide.actions.ShowSettingsUtilImpl");
private AtomicBoolean myShown = new AtomicBoolean(false);
+ @NotNull
+ private static Project getProject(@Nullable Project project) {
+ return project != null ? project : ProjectManager.getInstance().getDefaultProject();
+ }
+
+ @NotNull
+ private static DialogWrapper getDialog(@Nullable Project project, @NotNull ConfigurableGroup[] groups, @Nullable Configurable toSelect) {
+ return Registry.is("ide.perProjectModality")
+ ? new OptionsEditorDialog(getProject(project), filterEmptyGroups(groups), toSelect, true)
+ : Registry.is("ide.new.preferences")
+ ? new PreferencesDialog(getProject(project), filterEmptyGroups(groups))
+ : new OptionsEditorDialog(getProject(project), filterEmptyGroups(groups), toSelect);
+ }
+
+ @NotNull
+ public static ConfigurableGroup[] getConfigurableGroups(@Nullable Project project, boolean withIdeSettings) {
+ ConfigurableGroup[] groups = !withIdeSettings
+ ? new ConfigurableGroup[]{new ProjectConfigurablesGroup(getProject(project))}
+ : (project == null)
+ ? new ConfigurableGroup[]{new IdeConfigurablesGroup()}
+ : new ConfigurableGroup[]{
+ new ProjectConfigurablesGroup(project),
+ new IdeConfigurablesGroup()};
+
+ return Registry.is("ide.file.settings.order.new")
+ ? MixedConfigurableGroup.getGroups(getConfigurables(groups, true))
+ : groups;
+ }
+
+ @NotNull
+ public static Configurable[] getConfigurables(@Nullable Project project, boolean withGroupReverseOrder) {
+ return getConfigurables(getConfigurableGroups(project, true), withGroupReverseOrder);
+ }
+
+ @NotNull
+ private static Configurable[] getConfigurables(@NotNull ConfigurableGroup[] groups, boolean withGroupReverseOrder) {
+ Configurable[][] arrays = new Configurable[groups.length][];
+ int length = 0;
+ for (int i = 0; i < groups.length; i++) {
+ arrays[i] = groups[withGroupReverseOrder ? groups.length - 1 - i : i].getConfigurables();
+ length += arrays[i].length;
+ }
+ Configurable[] configurables = new Configurable[length];
+ int offset = 0;
+ for (Configurable[] array : arrays) {
+ System.arraycopy(array, 0, configurables, offset, array.length);
+ offset += array.length;
+ }
+ return configurables;
+ }
+
@Override
public void showSettingsDialog(@NotNull Project project, @NotNull ConfigurableGroup[] group) {
try {
myShown.set(true);
- _showSettingsDialog(project, group, null);
+ getDialog(project, group, null).show();
}
catch (Exception e) {
LOG.error(e);
@@ -61,41 +114,17 @@
}
}
- private static void _showSettingsDialog(@NotNull final Project project, @NotNull ConfigurableGroup[] group, @Nullable Configurable toSelect) {
- group = filterEmptyGroups(group);
- if (Registry.is("ide.perProjectModality")) {
- new OptionsEditorDialog(project, group, toSelect, true).show();
- } else {
- if (Registry.is("ide.new.preferences")) {
- new PreferencesDialog(project, group).show();
- } else {
- new OptionsEditorDialog(project, group, toSelect).show();
- }
- }
- }
-
@Override
public void showSettingsDialog(@Nullable final Project project, final Class configurableClass) {
assert Configurable.class.isAssignableFrom(configurableClass) : "Not a configurable: " + configurableClass.getName();
- ConfigurableGroup[] groups;
- IdeConfigurablesGroup commonGroup = new IdeConfigurablesGroup();
- ProjectConfigurablesGroup projectGroup = project == null ? null : new ProjectConfigurablesGroup(project);
- if (projectGroup == null) {
- groups = new ConfigurableGroup[] {commonGroup};
- } else {
- groups = new ConfigurableGroup[] {projectGroup, commonGroup};
- }
+ ConfigurableGroup[] groups = getConfigurableGroups(project, true);
- Configurable config = findByClass(commonGroup.getConfigurables(), configurableClass);
- if (config == null && projectGroup != null) {
- config = findByClass(projectGroup.getConfigurables(), configurableClass);
- }
+ Configurable config = findByClass(getConfigurables(groups, true), configurableClass);
assert config != null : "Cannot find configurable: " + configurableClass.getName();
- @NotNull Project nnProject = project != null ? project : ProjectManager.getInstance().getDefaultProject();
- _showSettingsDialog(nnProject, groups, config);
+ getDialog(project, groups, config).show();
}
@Nullable
@@ -110,15 +139,9 @@
@Override
public void showSettingsDialog(@Nullable final Project project, @NotNull final String nameToSelect) {
- ConfigurableGroup[] group;
- if (project == null) {
- group = new ConfigurableGroup[]{new IdeConfigurablesGroup()};
- }
- else {
- group = new ConfigurableGroup[]{new ProjectConfigurablesGroup(project), new IdeConfigurablesGroup()};
- }
+ ConfigurableGroup[] group = getConfigurableGroups(project, true);
- Project actualProject = project != null ? project : ProjectManager.getInstance().getDefaultProject();
+ Project actualProject = getProject(project);
group = filterEmptyGroups(group);
@@ -133,15 +156,9 @@
}
public static void showSettingsDialog(@Nullable Project project, final String id2Select, final String filter) {
- ConfigurableGroup[] group;
- if (project == null) {
- group = new ConfigurableGroup[]{new IdeConfigurablesGroup()};
- }
- else {
- group = new ConfigurableGroup[]{new ProjectConfigurablesGroup(project), new IdeConfigurablesGroup()};
- }
+ ConfigurableGroup[] group = getConfigurableGroups(project, true);
- Project actualProject = project != null ? project : ProjectManager.getInstance().getDefaultProject();
+ Project actualProject = getProject(project);
group = filterEmptyGroups(group);
final Configurable configurable2Select = findConfigurable2Select(id2Select, group);
@@ -191,10 +208,7 @@
@Override
public void showSettingsDialog(@NotNull final Project project, final Configurable toSelect) {
- _showSettingsDialog(project, new ConfigurableGroup[]{
- new ProjectConfigurablesGroup(project),
- new IdeConfigurablesGroup()
- }, toSelect);
+ getDialog(project, getConfigurableGroups(project, true), toSelect).show();
}
@NotNull
diff --git a/platform/platform-impl/src/com/intellij/ide/actions/TemplateProjectPropertiesAction.java b/platform/platform-impl/src/com/intellij/ide/actions/TemplateProjectPropertiesAction.java
index 75657c5..6c2b7d8 100644
--- a/platform/platform-impl/src/com/intellij/ide/actions/TemplateProjectPropertiesAction.java
+++ b/platform/platform-impl/src/com/intellij/ide/actions/TemplateProjectPropertiesAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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,7 +18,6 @@
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.options.ShowSettingsUtil;
-import com.intellij.openapi.options.ex.ProjectConfigurablesGroup;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ex.ProjectManagerEx;
@@ -26,6 +25,6 @@
public class TemplateProjectPropertiesAction extends AnAction implements DumbAware {
public void actionPerformed(AnActionEvent e) {
Project defaultProject = ProjectManagerEx.getInstanceEx().getDefaultProject();
- ShowSettingsUtil.getInstance().showSettingsDialog(defaultProject, new ProjectConfigurablesGroup(defaultProject));
+ ShowSettingsUtil.getInstance().showSettingsDialog(defaultProject, ShowSettingsUtilImpl.getConfigurableGroups(defaultProject, false));
}
}
diff --git a/platform/platform-impl/src/com/intellij/ide/customize/PluginGroups.java b/platform/platform-impl/src/com/intellij/ide/customize/PluginGroups.java
index de154f2..930901d 100644
--- a/platform/platform-impl/src/com/intellij/ide/customize/PluginGroups.java
+++ b/platform/platform-impl/src/com/intellij/ide/customize/PluginGroups.java
@@ -17,6 +17,7 @@
import com.intellij.ide.plugins.IdeaPluginDescriptor;
import com.intellij.ide.plugins.PluginManager;
+import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.ide.plugins.RepositoryHelper;
import com.intellij.idea.StartupUtil;
import com.intellij.openapi.application.PathManager;
@@ -58,14 +59,14 @@
}
private PluginGroups() {
- myAllPlugins = PluginManager.loadDescriptors(null);
+ myAllPlugins = PluginManagerCore.loadDescriptors(null);
try {
myPluginsFromRepository.addAll(RepositoryHelper.loadPluginsFromRepository(null));
}
catch (Exception e) {
//OK, it's offline
}
- PluginManager.loadDisabledPlugins(new File(PathManager.getConfigPath()).getPath(), myDisabledPluginIds);
+ PluginManagerCore.loadDisabledPlugins(new File(PathManager.getConfigPath()).getPath(), myDisabledPluginIds);
myTree.put(CORE, Pair.create((String)null, Arrays.asList(
@@ -74,7 +75,6 @@
"org.intellij.intelliLang",
"com.intellij.properties",
"Refactor-X",//?
- "Structural Search",
"Type Migration",
"ZKM"
)));
diff --git a/platform/platform-impl/src/com/intellij/ide/file/BatchFileChangeListener.java b/platform/platform-impl/src/com/intellij/ide/file/BatchFileChangeListener.java
new file mode 100644
index 0000000..593c398
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/ide/file/BatchFileChangeListener.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2014 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.file;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.util.messages.Topic;
+
+/**
+ * This listener is notified when some operation performs a massive batch file change, and when this change is completed.
+ * <p/>
+ * To subscribe to such batch file changes, connect to the Project's {@link com.intellij.util.messages.MessageBus}
+ * via the {@link #TOPIC} defined below.
+ */
+public interface BatchFileChangeListener {
+
+ Topic<BatchFileChangeListener> TOPIC = Topic.create("Batch File Update", BatchFileChangeListener.class);
+
+ class Adapter implements BatchFileChangeListener {
+ @Override
+ public void batchChangeStarted(Project project) {
+ }
+ @Override
+ public void batchChangeCompleted(Project project) {
+ }
+ }
+
+
+ void batchChangeStarted(Project project);
+
+ void batchChangeCompleted(Project project);
+
+}
diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/HelpID.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/HelpID.java
index b05021f..a805638 100644
--- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/HelpID.java
+++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/HelpID.java
@@ -24,6 +24,8 @@
* Time: 2:09 PM
*/
public interface HelpID {
- @NonNls String RESET_PASSWORD = "reference_ide_settings_master_password_reset";
- @NonNls String CHANGE_PASSWORD = "reference_settings_password_safe_master_password";
+ @NonNls String INIT_PASSWORD = "settings_passwords_master_password_init";
+ @NonNls String ENTER_PASSWORD = "settings_passwords_master_password_enter";
+ @NonNls String RESET_PASSWORD = "settings_passwords_master_password_reset";
+ @NonNls String CHANGE_PASSWORD = "settings_passwords_master_password_change";
}
diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/PasswordStorage.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/PasswordStorage.java
index b1ea133..e5b9f15 100644
--- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/PasswordStorage.java
+++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/PasswordStorage.java
@@ -25,15 +25,21 @@
* The interface defines basic password management operations
*/
public interface PasswordStorage {
+
/**
- * <p>Get password stored in a password safe.</p>
- *
- * <p><b>NB: </b>
- * This method may be called from the background,
- * and it may need to ask user to enter the master password to access the database by calling
- * {@link Application#invokeAndWait(Runnable, ModalityState) invokeAndWait()} to show a modal dialog.
- * So make sure not to call it from the read action.
- * Calling this method from the dispatch thread is allowed.</p>
+ * @deprecated To remove in IDEA 15. Use {@link #getPassword(Project, Class, String, ModalityState)}
+ */
+ @Deprecated
+ @Nullable
+ String getPassword(@Nullable Project project, @NotNull Class requestor, String key) throws PasswordSafeException;
+
+ /**
+ * Get password stored in a password safe.
+ * <p/>
+ * The method may be called from any thread. It may need to show a master password dialog to unlock the password database,
+ * and then will use {@link Application#invokeAndWait(Runnable, ModalityState) invokeAndWait()}.
+ * So make sure to pass correct {@link ModalityState} to the method to make sure the dialog is shown above all other dialog or progress
+ * windows.
*
* @param project the project, that is used to ask for the master password if this is the first access to password safe
* @param requestor the requestor class
@@ -43,19 +49,16 @@
* @throws IllegalStateException if the method is called from the read action.
*/
@Nullable
- String getPassword(@Nullable Project project, @NotNull Class requestor, String key) throws PasswordSafeException;
- /**
- * Remove password stored in a password safe
- *
- * @param project the project, that is used to ask for the master password if this is the first access to password safe
- * @param requestor the requestor class
- * @param key the key for the password
- * @return the plugin key
- * @throws PasswordSafeException if password safe cannot be accessed
- */
- void removePassword(@Nullable Project project, @NotNull Class requestor, String key) throws PasswordSafeException;
+ String getPassword(@Nullable Project project, @NotNull Class requestor, String key,
+ @Nullable ModalityState state) throws PasswordSafeException;
+
/**
* Store password in password safe
+ * <p/>
+ * The method may be called from any thread. It may need to show a master password dialog to unlock the password database,
+ * and then will use {@link Application#invokeAndWait(Runnable, ModalityState) invokeAndWait()}.
+ * So make sure to pass correct {@link ModalityState} to the method to make sure the dialog is shown above all other dialog or progress
+ * windows.
*
* @param project the project, that is used to ask for the master password if this is the first access to password safe
* @param requestor the requestor class
@@ -63,5 +66,36 @@
* @param value the value to store
* @throws PasswordSafeException if password safe cannot be accessed
*/
+ void storePassword(@Nullable Project project, @NotNull Class requestor, String key, String value,
+ @Nullable ModalityState modalityState) throws PasswordSafeException;
+
+ /**
+ * @deprecated To remove in IDEA 15. Use {@link #storePassword(Project, Class, String, String, ModalityState)}
+ */
+ @Deprecated
void storePassword(@Nullable Project project, @NotNull Class requestor, String key, String value) throws PasswordSafeException;
+
+ /**
+ * @deprecated To remove in IDEA 15. Use {@link #removePassword(Project, Class, String, ModalityState)}
+ */
+ @Deprecated
+ void removePassword(@Nullable Project project, @NotNull Class requestor, String key) throws PasswordSafeException;
+
+ /**
+ * Remove password stored in a password safe
+ * <p/>
+ * The method may be called from any thread. It may need to show a master password dialog to unlock the password database,
+ * and then will use {@link Application#invokeAndWait(Runnable, ModalityState) invokeAndWait()}.
+ * So make sure to pass correct {@link ModalityState} to the method to make sure the dialog is shown above all other dialog or progress
+ * windows.
+ *
+ * @param project the project, that is used to ask for the master password if this is the first access to password safe
+ * @param requestor the requestor class
+ * @param key the key for the password
+ * @return the plugin key
+ * @throws PasswordSafeException if password safe cannot be accessed
+ */
+ void removePassword(@Nullable Project project, @NotNull Class requestor, String key,
+ @Nullable ModalityState modalityState) throws PasswordSafeException;
+
}
diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/PasswordSafeImpl.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/PasswordSafeImpl.java
index 11dc4d7..34aee7a 100644
--- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/PasswordSafeImpl.java
+++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/PasswordSafeImpl.java
@@ -22,42 +22,19 @@
import com.intellij.ide.passwordSafe.impl.providers.masterKey.PasswordDatabase;
import com.intellij.ide.passwordSafe.impl.providers.memory.MemoryPasswordSafe;
import com.intellij.ide.passwordSafe.impl.providers.nil.NilProvider;
+import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-/**
- * The implementation of password safe service
- */
public class PasswordSafeImpl extends PasswordSafe {
- /**
- * The logger instance
- */
private static final Logger LOG = Logger.getInstance(PasswordSafeImpl.class.getName());
- /**
- * The current settings
- */
private final PasswordSafeSettings mySettings;
- /**
- * The master key provider
- */
private final MasterKeyPasswordSafe myMasterKeyProvider;
- /**
- * The nil provider
- */
private final NilProvider myNilProvider;
- /**
- * The memory provider
- */
private final MemoryPasswordSafe myMemoryProvider;
- /**
- * The constructor
- *
- * @param settings the settings for the password safe
- * @param database the password database
- */
public PasswordSafeImpl(PasswordSafeSettings settings, PasswordDatabase database) {
mySettings = settings;
myMasterKeyProvider = new MasterKeyPasswordSafe(database);
@@ -89,21 +66,24 @@
return p;
}
-
- /**
- * @return settings for the passwords safe
- */
public PasswordSafeSettings getSettings() {
return mySettings;
}
+ @Nullable
+ @Override
+ public String getPassword(@Nullable Project project, @NotNull Class requester, String key) throws PasswordSafeException {
+ return getPassword(project, requester, key, null);
+ }
@Nullable
- public String getPassword(@Nullable Project project, @NotNull Class requester, String key) throws PasswordSafeException {
+ @Override
+ public String getPassword(@Nullable Project project, @NotNull Class requester, String key,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
if (mySettings.getProviderType().equals(PasswordSafeSettings.ProviderType.MASTER_PASSWORD)) {
- String password = getMemoryProvider().getPassword(project, requester, key);
+ String password = getMemoryProvider().getPassword(project, requester, key, modalityState);
if (password == null) {
- password = provider().getPassword(project, requester, key);
+ password = provider().getPassword(project, requester, key, modalityState);
if (password != null) {
// cache the password in memory as well for easier access during the session
getMemoryProvider().storePassword(project, requester, key, password);
@@ -111,27 +91,35 @@
}
return password;
}
- return provider().getPassword(project, requester, key);
+ return provider().getPassword(project, requester, key, modalityState);
}
- /**
- * {@inheritDoc}
- */
- public void removePassword(@Nullable Project project, @NotNull Class requester, String key) throws PasswordSafeException {
+ @Override
+ public void removePassword(@Nullable Project project, @NotNull Class requestor, String key) throws PasswordSafeException {
+ removePassword(project, requestor, key, null);
+ }
+
+ @Override
+ public void removePassword(@Nullable Project project, @NotNull Class requester, String key,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
if (mySettings.getProviderType().equals(PasswordSafeSettings.ProviderType.MASTER_PASSWORD)) {
getMemoryProvider().removePassword(project, requester, key);
}
- provider().removePassword(project, requester, key);
+ provider().removePassword(project, requester, key, modalityState);
}
- /**
- * {@inheritDoc}
- */
- public void storePassword(@Nullable Project project, @NotNull Class requester, String key, String value) throws PasswordSafeException {
+ @Override
+ public void storePassword(@Nullable Project project, @NotNull Class requestor, String key, String value) throws PasswordSafeException {
+ storePassword(project, requestor, key, value, null);
+ }
+
+ @Override
+ public void storePassword(@Nullable Project project, @NotNull Class requester, String key, String value,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
if (mySettings.getProviderType().equals(PasswordSafeSettings.ProviderType.MASTER_PASSWORD)) {
getMemoryProvider().storePassword(project, requester, key, value);
}
- provider().storePassword(project, requester, key, value);
+ provider().storePassword(project, requester, key, value, modalityState);
}
/**
diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/PasswordSafeProvider.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/PasswordSafeProvider.java
index 18dee7c..3a40d61 100644
--- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/PasswordSafeProvider.java
+++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/PasswordSafeProvider.java
@@ -15,7 +15,11 @@
*/
package com.intellij.ide.passwordSafe.impl;
+import com.intellij.ide.passwordSafe.PasswordSafeException;
import com.intellij.ide.passwordSafe.PasswordStorage;
+import com.intellij.openapi.project.Project;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* The provider for password safe component
@@ -34,4 +38,21 @@
* @return the name of provider
*/
public abstract String getName();
+
+ @Nullable
+ @Override
+ public String getPassword(@Nullable Project project, @NotNull Class requestor, String key) throws PasswordSafeException {
+ return getPassword(project, requestor, key, null);
+ }
+
+ @Override
+ public void storePassword(@Nullable Project project, @NotNull Class requestor, String key, String value) throws PasswordSafeException {
+ storePassword(project, requestor, key, value, null);
+ }
+
+ @Override
+ public void removePassword(@Nullable Project project, @NotNull Class requestor, String key) throws PasswordSafeException {
+ removePassword(project, requestor, key, null);
+ }
+
}
diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/BasePasswordSafeProvider.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/BasePasswordSafeProvider.java
index c72c65d..8c8f921 100644
--- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/BasePasswordSafeProvider.java
+++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/BasePasswordSafeProvider.java
@@ -43,16 +43,15 @@
* @throws PasswordSafeException in case of problems with access to the password database.
* @throws IllegalStateException if the method is called from the read action.
*/
- protected abstract byte[] key(@Nullable Project project, @NotNull Class requestor) throws PasswordSafeException;
+ protected abstract byte[] key(@Nullable Project project, @NotNull Class requestor,
+ @Nullable ModalityState modalityState) throws PasswordSafeException;
- /**
- * {@inheritDoc}
- */
@Nullable
- public String getPassword(@Nullable Project project, @NotNull Class requestor, String key) throws PasswordSafeException {
- byte[] k = dbKey(project, requestor, key);
+ public String getPassword(@Nullable Project project, @NotNull Class requestor, String key,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
+ byte[] k = dbKey(project, requestor, key, modalityState);
byte[] ct = getEncryptedPassword(k);
- return ct == null ? null : EncryptionUtil.decryptText(key(project, requestor), ct);
+ return ct == null ? null : EncryptionUtil.decryptText(key(project, requestor, modalityState), ct);
}
/**
@@ -69,17 +68,17 @@
* @param project
* @param requestor the requestor class
* @param key the key to use
+ * @param modalityState
* @return the key to use for map
*/
- private byte[] dbKey(@Nullable Project project, Class requestor, String key) throws PasswordSafeException {
- return EncryptionUtil.dbKey(key(project, requestor), requestor, key);
+ private byte[] dbKey(@Nullable Project project, @NotNull Class requestor, String key,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
+ return EncryptionUtil.dbKey(key(project, requestor, modalityState), requestor, key);
}
- /**
- * {@inheritDoc}
- */
- public void removePassword(@Nullable Project project, @NotNull Class requester, String key) throws PasswordSafeException {
- byte[] k = dbKey(project, requester, key);
+ public void removePassword(@Nullable Project project, @NotNull Class requester, String key,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
+ byte[] k = dbKey(project, requester, key, modalityState);
removeEncryptedPassword(k);
}
@@ -90,12 +89,10 @@
*/
protected abstract void removeEncryptedPassword(byte[] key);
- /**
- * {@inheritDoc}
- */
- public void storePassword(@Nullable Project project, @NotNull Class requestor, String key, String value) throws PasswordSafeException {
- byte[] k = dbKey(project, requestor, key);
- byte[] ct = EncryptionUtil.encryptText(key(project, requestor), value);
+ public void storePassword(@Nullable Project project, @NotNull Class requestor, String key, String value,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
+ byte[] k = dbKey(project, requestor, key, modalityState);
+ byte[] ct = EncryptionUtil.encryptText(key(project, requestor, modalityState), value);
storeEncryptedPassword(k, ct);
}
diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/EnterPasswordComponent.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/EnterPasswordComponent.java
index 638e2e2..304b31e 100644
--- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/EnterPasswordComponent.java
+++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/EnterPasswordComponent.java
@@ -16,6 +16,7 @@
package com.intellij.ide.passwordSafe.impl.providers.masterKey;
import com.intellij.ide.TypePresentationService;
+import com.intellij.ide.passwordSafe.HelpID;
import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
@@ -46,4 +47,9 @@
String password = new String(myPasswordField.getPassword());
return mySafe.changeMasterPassword(password, password, myEncryptCheckBox.isSelected());
}
+
+ @Override
+ public String getHelpId() {
+ return HelpID.ENTER_PASSWORD;
+ }
}
diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/MasterKeyPasswordSafe.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/MasterKeyPasswordSafe.java
index 95fba48..b74e513 100644
--- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/MasterKeyPasswordSafe.java
+++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/MasterKeyPasswordSafe.java
@@ -42,17 +42,8 @@
* The password safe that stores information in configuration file encrypted by master password
*/
public class MasterKeyPasswordSafe extends BasePasswordSafeProvider {
- /**
- * The test password key
- */
private static final String TEST_PASSWORD_KEY = "TEST_PASSWORD:";
- /**
- * The test password value
- */
private static final String TEST_PASSWORD_VALUE = "test password";
- /**
- * The password database instance
- */
final PasswordDatabase database;
/**
* The key to use to encrypt data
@@ -68,18 +59,10 @@
}
};
- /**
- * The constructor
- *
- * @param database the password database
- */
public MasterKeyPasswordSafe(PasswordDatabase database) {
this.database = database;
}
- /**
- * @return true if the component is running in the test mode
- */
protected boolean isTestMode() {
return false;
}
@@ -130,7 +113,6 @@
else {
return true;
}
-
}
/**
@@ -167,18 +149,13 @@
}
- /**
- * The test key
- *
- * @param password the password for the test key
- * @return the test key
- */
private static String testKey(String password) {
return TEST_PASSWORD_KEY + password;
}
@Override
- protected byte[] key(@Nullable final Project project, @NotNull final Class requestor) throws PasswordSafeException {
+ protected byte[] key(@Nullable final Project project, @NotNull final Class requestor,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
Application application = ApplicationManager.getApplication();
if (!isTestMode() && application.isHeadlessEnvironment()) {
throw new MasterPasswordUnavailableException("The provider is not available in headless environment");
@@ -223,7 +200,7 @@
}
}
}
- }, ModalityState.defaultModalityState());
+ }, modalityState == null ? ModalityState.defaultModalityState() : modalityState);
//noinspection ThrowableResultOfMethodCallIgnored
if (ex.get() != null) {
throw ex.get();
@@ -233,20 +210,15 @@
return result.get();
}
- /**
- * {@inheritDoc}
- */
@Override
- public String getPassword(@Nullable Project project, @NotNull Class requestor, String key) throws PasswordSafeException {
+ public String getPassword(@Nullable Project project, @NotNull Class requestor, String key,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
if (database.isEmpty()) {
return null;
}
- return super.getPassword(project, requestor, key);
+ return super.getPassword(project, requestor, key, modalityState);
}
- /**
- * {@inheritDoc}
- */
@Override
public void removePassword(@Nullable Project project, @NotNull Class requester, String key) throws PasswordSafeException {
if (database.isEmpty()) {
@@ -255,50 +227,32 @@
super.removePassword(project, requester, key);
}
- /**
- * {@inheritDoc}
- */
@Override
protected byte[] getEncryptedPassword(byte[] key) {
return database.get(key);
}
- /**
- * {@inheritDoc}
- */
@Override
protected void removeEncryptedPassword(byte[] key) {
database.remove(key);
}
- /**
- * {@inheritDoc}
- */
@Override
protected void storeEncryptedPassword(byte[] key, byte[] encryptedPassword) {
database.put(key, encryptedPassword);
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean isSupported() {
return !ApplicationManager.getApplication().isHeadlessEnvironment();
}
- /**
- * {@inheritDoc}
- */
@Override
public String getDescription() {
return "This provider stores passwords in IDEA config and uses master password to encrypt other passwords. " +
"The passwords for the same resources are shared between different projects.";
}
- /**
- * {@inheritDoc}
- */
@Override
public String getName() {
return "Master Key PasswordSafe";
@@ -309,9 +263,6 @@
return setMasterPassword("");
}
- /**
- * @return true, if OS protected passwords are supported for the current platform
- */
@SuppressWarnings({"MethodMayBeStatic"})
public boolean isOsProtectedPasswordSupported() {
// TODO extension point needed?
@@ -351,9 +302,6 @@
}
}
- /**
- * @return true, if the password is currently encrypted in the database
- */
public boolean isPasswordEncrypted() {
if (!isOsProtectedPasswordSupported()) return false;
@@ -361,9 +309,6 @@
return i != null && i.length > 0;
}
- /**
- * @return check if provider database is empty
- */
public boolean isEmpty() {
return database.isEmpty();
}
diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/ResetPasswordComponent.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/ResetPasswordComponent.java
index ce75bdb..faa36c1 100644
--- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/ResetPasswordComponent.java
+++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/ResetPasswordComponent.java
@@ -49,7 +49,7 @@
@Override
public String getHelpId() {
- return HelpID.RESET_PASSWORD;
+ return myFirstTime ? HelpID.INIT_PASSWORD : HelpID.RESET_PASSWORD;
}
@Override
diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/memory/MemoryPasswordSafe.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/memory/MemoryPasswordSafe.java
index 5be4a25..da82bb9 100644
--- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/memory/MemoryPasswordSafe.java
+++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/memory/MemoryPasswordSafe.java
@@ -19,10 +19,12 @@
import com.intellij.ide.passwordSafe.impl.providers.BasePasswordSafeProvider;
import com.intellij.ide.passwordSafe.impl.providers.ByteArrayWrapper;
import com.intellij.ide.passwordSafe.impl.providers.EncryptionUtil;
+import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.security.SecureRandom;
import java.util.Collections;
@@ -57,13 +59,8 @@
return Registry.intValue("passwordSafe.memorySafe.ttl");
}
- /**
- * @param project the project to use
- * @param requestor
- * @return the secret key used by provider
- */
@Override
- protected byte[] key(Project project, @NotNull Class requestor) {
+ protected byte[] key(Project project, @NotNull Class requestor, @Nullable ModalityState modalityState) {
if (key.get() == null) {
byte[] rnd = new byte[EncryptionUtil.SECRET_KEY_SIZE_BYTES * 16];
new SecureRandom().nextBytes(rnd);
@@ -72,49 +69,31 @@
return key.get();
}
- /**
- * {@inheritDoc}
- */
@Override
protected byte[] getEncryptedPassword(byte[] key) {
return database.get().get(new ByteArrayWrapper(key));
}
- /**
- * {@inheritDoc}
- */
@Override
protected void removeEncryptedPassword(byte[] key) {
database.get().remove(new ByteArrayWrapper(key));
}
- /**
- * {@inheritDoc}
- */
@Override
protected void storeEncryptedPassword(byte[] key, byte[] encryptedPassword) {
database.get().put(new ByteArrayWrapper(key), encryptedPassword);
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean isSupported() {
return true;
}
- /**
- * {@inheritDoc}
- */
@Override
public String getDescription() {
return "Memory-based password safe provider. The passwords are stored only for the duration of IDEA process.";
}
- /**
- * {@inheritDoc}
- */
@Override
public String getName() {
return "Memory PasswordSafe";
diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/nil/NilProvider.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/nil/NilProvider.java
index 581df18..e3a7732 100644
--- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/nil/NilProvider.java
+++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/nil/NilProvider.java
@@ -17,6 +17,7 @@
import com.intellij.ide.passwordSafe.PasswordSafeException;
import com.intellij.ide.passwordSafe.impl.PasswordSafeProvider;
+import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -25,49 +26,38 @@
* The most secure provider that does not store anything, so it cannot be cracked
*/
public final class NilProvider extends PasswordSafeProvider {
- /**
- * {@inheritDoc}
- */
+
@Override
public boolean isSupported() {
return true;
}
- /**
- * {@inheritDoc}
- */
@Override
public String getDescription() {
return "The provider that does not remembers password.";
}
- /**
- * {@inheritDoc}
- */
@Override
public String getName() {
return "Do not Store";
}
- /**
- * {@inheritDoc}
- */
- public String getPassword(@Nullable Project project, @NotNull Class requester, String key) throws PasswordSafeException {
+ @Nullable
+ public String getPassword(@Nullable Project project, @NotNull Class requester, String key,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
// nothing is stored
return null;
}
- /**
- * {@inheritDoc}
- */
- public void removePassword(@Nullable Project project, @NotNull Class requester, String key) throws PasswordSafeException {
+ @Override
+ public void removePassword(@Nullable Project project, @NotNull Class requester, String key,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
// do nothing
}
- /**
- * {@inheritDoc}
- */
- public void storePassword(@Nullable Project project, @NotNull Class requester, String key, String value) throws PasswordSafeException {
+ @Override
+ public void storePassword(@Nullable Project project, @NotNull Class requester, String key, String value,
+ @Nullable ModalityState modalityState) throws PasswordSafeException {
// just forget about password
}
}
diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/ui/PasswordSafePromptDialog.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/ui/PasswordSafePromptDialog.java
index def7aa9..353e836 100644
--- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/ui/PasswordSafePromptDialog.java
+++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/ui/PasswordSafePromptDialog.java
@@ -176,7 +176,7 @@
ps.removePassword(project, requestor, key);
}
else {
- String pw = ps.getPassword(project, requestor, key);
+ String pw = ps.getPassword(project, requestor, key, modalityState);
if (pw != null) {
return pw;
}
diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/PluginInstaller.java b/platform/platform-impl/src/com/intellij/ide/plugins/PluginInstaller.java
index 7919d1f..b093773 100644
--- a/platform/platform-impl/src/com/intellij/ide/plugins/PluginInstaller.java
+++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginInstaller.java
@@ -159,33 +159,35 @@
}
}
- synchronized (myLock) {
- PluginDownloader downloader = null;
- final String repositoryName = pluginNode.getRepositoryName();
- if (repositoryName != null) {
- try {
- final Map<PluginId, PluginDownloader> downloaders = new HashMap<PluginId, PluginDownloader>();
- if (!UpdateChecker.checkPluginsHost(repositoryName, downloaders)) {
- return false;
- }
- downloader = downloaders.get(pluginNode.getPluginId());
- if (downloader == null) return false;
- }
- catch (Exception e) {
+ PluginDownloader downloader = null;
+ final String repositoryName = pluginNode.getRepositoryName();
+ if (repositoryName != null) {
+ try {
+ final Map<PluginId, PluginDownloader> downloaders = new HashMap<PluginId, PluginDownloader>();
+ if (!UpdateChecker.checkPluginsHost(repositoryName, downloaders)) {
return false;
}
+ downloader = downloaders.get(pluginNode.getPluginId());
+ if (downloader == null) return false;
}
- else {
- downloader = PluginDownloader.createDownloader(pluginNode);
- }
- if (downloader.prepareToInstall(ProgressManager.getInstance().getProgressIndicator())) {
- downloader.install();
- pluginNode.setStatus(PluginNode.STATUS_DOWNLOADED);
- }
- else {
+ catch (Exception e) {
return false;
}
}
+ else {
+ downloader = PluginDownloader.createDownloader(pluginNode);
+ }
+
+ if (downloader.prepareToInstall(ProgressManager.getInstance().getProgressIndicator())) {
+ synchronized (myLock) {
+ downloader.install();
+ }
+ pluginNode.setStatus(PluginNode.STATUS_DOWNLOADED);
+ }
+ else {
+ return false;
+ }
+
return true;
}
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 49b20d2..20a41e3 100644
--- a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerMain.java
+++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerMain.java
@@ -49,6 +49,7 @@
import com.intellij.ui.*;
import com.intellij.ui.border.CustomLineBorder;
import com.intellij.ui.components.JBLabel;
+import com.intellij.ui.speedSearch.SpeedSearchSupply;
import com.intellij.util.concurrency.SwingWorker;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.update.UiNotifyConnector;
@@ -663,7 +664,7 @@
app.restart(true);
}
else {
- app.exit(true);
+ app.exit(false, true);
}
}
}).notify(project);
@@ -676,6 +677,7 @@
}
public void filter() {
+ getPluginTable().putClientProperty(SpeedSearchSupply.SEARCH_QUERY_KEY, getFilter());
pluginsModel.filter(getFilter().toLowerCase());
TableUtil.ensureSelectionExists(getPluginTable());
}
diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/PluginsTableRenderer.form b/platform/platform-impl/src/com/intellij/ide/plugins/PluginsTableRenderer.form
index 2e09735..1791089 100644
--- a/platform/platform-impl/src/com/intellij/ide/plugins/PluginsTableRenderer.form
+++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginsTableRenderer.form
@@ -69,13 +69,11 @@
<size top="0" left="0" bottom="2" right="0"/>
</border>
<children>
- <component id="a5e28" class="com.intellij.ui.components.JBLabel" binding="myName">
+ <component id="edd99" class="com.intellij.ui.SimpleColoredComponent" binding="myName">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
- <properties>
- <text value="Plugin Name"/>
- </properties>
+ <properties/>
</component>
</children>
</grid>
diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/PluginsTableRenderer.java b/platform/platform-impl/src/com/intellij/ide/plugins/PluginsTableRenderer.java
index be7fd44..c903062 100644
--- a/platform/platform-impl/src/com/intellij/ide/plugins/PluginsTableRenderer.java
+++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginsTableRenderer.java
@@ -23,10 +23,16 @@
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.FileStatus;
+import com.intellij.psi.codeStyle.NameUtil;
import com.intellij.ui.Gray;
import com.intellij.ui.JBColor;
+import com.intellij.ui.SimpleColoredComponent;
+import com.intellij.ui.SimpleTextAttributes;
+import com.intellij.ui.speedSearch.SpeedSearchSupply;
+import com.intellij.ui.speedSearch.SpeedSearchUtil;
import com.intellij.util.Function;
import com.intellij.util.text.DateFormatUtil;
+import com.intellij.util.text.Matcher;
import com.intellij.util.ui.UIUtil;
import javax.swing.*;
@@ -40,7 +46,7 @@
* @author Konstantin Bulenkov
*/
public class PluginsTableRenderer extends DefaultTableCellRenderer {
- private JLabel myName;
+ private SimpleColoredComponent myName;
private JLabel myStatus;
private RatesPanel myRating;
private JLabel myDownloads;
@@ -85,7 +91,23 @@
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (myPluginDescriptor != null) {
final PluginId pluginId = myPluginDescriptor.getPluginId();
- myName.setText(myPluginDescriptor.getName() + " ");
+ myName.clear();
+ myName.setOpaque(false);
+ String pluginName = myPluginDescriptor.getName() + " ";
+ Object query = table.getClientProperty(SpeedSearchSupply.SEARCH_QUERY_KEY);
+ if (query instanceof String) {
+ String pattern = "*" + query;
+ Matcher matcher = NameUtil.buildMatcher(pattern, 0, true, true, pattern.toLowerCase().equals(pattern));
+ SimpleTextAttributes attr = new SimpleTextAttributes(UIUtil.getListBackground(isSelected),
+ UIUtil.getListForeground(isSelected),
+ JBColor.RED,
+ SimpleTextAttributes.STYLE_PLAIN);
+
+ SpeedSearchUtil.appendColoredFragmentForMatcher(pluginName, myName, attr, matcher,
+ UIUtil.getTableBackground(isSelected), true);
+ } else {
+ myName.append(pluginName);
+ }
final Color fg = UIUtil.getTableForeground(isSelected);
final Color bg = UIUtil.getTableBackground(isSelected);
diff --git a/platform/platform-impl/src/com/intellij/ide/ui/search/SearchUtil.java b/platform/platform-impl/src/com/intellij/ide/ui/search/SearchUtil.java
index 0a7b70e..8febc9a 100644
--- a/platform/platform-impl/src/com/intellij/ide/ui/search/SearchUtil.java
+++ b/platform/platform-impl/src/com/intellij/ide/ui/search/SearchUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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,13 +17,12 @@
package com.intellij.ide.ui.search;
import com.intellij.application.options.SkipSelfSearchComponent;
+import com.intellij.ide.actions.ShowSettingsUtilImpl;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurableGroup;
import com.intellij.openapi.options.MasterDetails;
import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.options.ex.GlassPanel;
-import com.intellij.openapi.options.ex.IdeConfigurablesGroup;
-import com.intellij.openapi.options.ex.ProjectConfigurablesGroup;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.JBPopup;
import com.intellij.openapi.ui.popup.JBPopupFactory;
@@ -66,8 +65,7 @@
}
public static void processProjectConfigurables(Project project, HashMap<SearchableConfigurable, TreeSet<OptionDescription>> options) {
- processConfigurables(new ProjectConfigurablesGroup(project).getConfigurables(), options);
- processConfigurables(new IdeConfigurablesGroup().getConfigurables(), options);
+ processConfigurables(ShowSettingsUtilImpl.getConfigurables(project, false), options);
}
private static void processConfigurables(final Configurable[] configurables,
diff --git a/platform/platform-impl/src/com/intellij/ide/util/TipDialog.java b/platform/platform-impl/src/com/intellij/ide/util/TipDialog.java
index 33501b5..0744e37 100644
--- a/platform/platform-impl/src/com/intellij/ide/util/TipDialog.java
+++ b/platform/platform-impl/src/com/intellij/ide/util/TipDialog.java
@@ -19,32 +19,44 @@
import com.intellij.CommonBundle;
import com.intellij.ide.IdeBundle;
import com.intellij.internal.statistic.UsageTrigger;
+import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.impl.DialogWrapperPeerImpl;
+import com.intellij.openapi.wm.ex.WindowManagerEx;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
+import java.awt.*;
import java.awt.event.ActionEvent;
public class TipDialog extends DialogWrapper{
- private final TipPanel myTipPanel;
+ private TipPanel myTipPanel;
public TipDialog(){
- super(true);
- setModal(false);
- setTitle(IdeBundle.message("title.tip.of.the.day"));
- setCancelButtonText(CommonBundle.getCloseButtonText());
- myTipPanel = new TipPanel();
- myTipPanel.nextTip();
- setHorizontalStretch(1.33f);
- setVerticalStretch(1.25f);
- init();
- if (getPeer() instanceof DialogWrapperPeerImpl) {
- ((DialogWrapperPeerImpl)getPeer()).setAutoRequestFocus(false);
- }
+ super(WindowManagerEx.getInstanceEx().findVisibleFrame(), true);
+ initialize();
}
+ public TipDialog(@NotNull final Window parent) {
+ super(parent, true);
+ initialize();
+ }
+
+ private void initialize () {
+ setModal(false);
+ setTitle(IdeBundle.message("title.tip.of.the.day"));
+ setCancelButtonText(CommonBundle.getCloseButtonText());
+ myTipPanel = new TipPanel();
+ myTipPanel.nextTip();
+ setHorizontalStretch(1.33f);
+ setVerticalStretch(1.25f);
+ init();
+ if (getPeer() instanceof DialogWrapperPeerImpl) {
+ ((DialogWrapperPeerImpl)getPeer()).setAutoRequestFocus(false);
+ }
+ }
+
@NotNull
protected Action[] createActions(){
return new Action[]{new PreviousTipAction(),new NextTipAction(),getCancelAction()};
@@ -58,6 +70,11 @@
super.dispose();
}
+ public static TipDialog createForProject(final Project project) {
+ final Window w = WindowManagerEx.getInstanceEx().suggestParentWindow(project);
+ return (w == null) ? new TipDialog() : new TipDialog(w);
+ }
+
private class PreviousTipAction extends AbstractAction{
public PreviousTipAction(){
super(IdeBundle.message("action.previous.tip"));
diff --git a/platform/platform-impl/src/com/intellij/idea/IdeaLogger.java b/platform/platform-impl/src/com/intellij/idea/IdeaLogger.java
index 3a8f733..67a7c0f 100644
--- a/platform/platform-impl/src/com/intellij/idea/IdeaLogger.java
+++ b/platform/platform-impl/src/com/intellij/idea/IdeaLogger.java
@@ -199,7 +199,7 @@
@Override
public String getInfo() {
final ApplicationInfoEx info = ApplicationInfoImpl.getShadowInstance();
- return info.getFullApplicationName() + " " + "Build #" + info.getBuild().asString();
+ return info.getFullApplicationName() + " " + "Build #" + info.getBuild().asStringWithAllDetails();
}
};
}
diff --git a/platform/platform-impl/src/com/intellij/idea/StartupUtil.java b/platform/platform-impl/src/com/intellij/idea/StartupUtil.java
index 611e1a6..10f9c73 100644
--- a/platform/platform-impl/src/com/intellij/idea/StartupUtil.java
+++ b/platform/platform-impl/src/com/intellij/idea/StartupUtil.java
@@ -319,7 +319,7 @@
ApplicationInfo appInfo = ApplicationInfoImpl.getShadowInstance();
ApplicationNamesInfo namesInfo = ApplicationNamesInfo.getInstance();
String buildDate = new SimpleDateFormat("dd MMM yyyy HH:ss", Locale.US).format(appInfo.getBuildDate().getTime());
- log.info("IDE: " + namesInfo.getFullProductName() + " (build #" + appInfo.getBuild() + ", " + buildDate + ")");
+ log.info("IDE: " + namesInfo.getFullProductName() + " (build #" + appInfo.getBuild().asStringWithAllDetails() + ", " + buildDate + ")");
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/jps/impl/JpsIdePluginManagerImpl.java b/platform/platform-impl/src/com/intellij/jps/impl/JpsIdePluginManagerImpl.java
index 72e7b8a..a4d4637 100644
--- a/platform/platform-impl/src/com/intellij/jps/impl/JpsIdePluginManagerImpl.java
+++ b/platform/platform-impl/src/com/intellij/jps/impl/JpsIdePluginManagerImpl.java
@@ -37,15 +37,26 @@
public JpsIdePluginManagerImpl() {
ExtensionsArea rootArea = Extensions.getRootArea();
- //todo[nik] introduce more generic platform extension for JPS plugins instead
+ //todo[nik] get rid of this check: currently this class is used in jps-builders tests instead of JpsPluginManagerImpl because platform-impl module is added to classpath via testFramework
+ if (rootArea.hasExtensionPoint(JpsPluginBean.EP_NAME.getName())) {
+ rootArea.getExtensionPoint(JpsPluginBean.EP_NAME).addExtensionPointListener(new ExtensionPointListener<JpsPluginBean>() {
+ @Override
+ public void extensionAdded(@NotNull JpsPluginBean extension, @Nullable PluginDescriptor pluginDescriptor) {
+ ContainerUtil.addIfNotNull(pluginDescriptor, myExternalBuildPlugins);
+ }
+
+ @Override
+ public void extensionRemoved(@NotNull JpsPluginBean extension, @Nullable PluginDescriptor pluginDescriptor) {
+ }
+ });
+ }
if (rootArea.hasExtensionPoint("com.intellij.compileServer.plugin")) {
ExtensionPoint extensionPoint = rootArea.getExtensionPoint("com.intellij.compileServer.plugin");
+ //noinspection unchecked
extensionPoint.addExtensionPointListener(new ExtensionPointListener() {
@Override
public void extensionAdded(@NotNull Object extension, @Nullable PluginDescriptor pluginDescriptor) {
- if (pluginDescriptor != null) {
- myExternalBuildPlugins.add(pluginDescriptor);
- }
+ ContainerUtil.addIfNotNull(pluginDescriptor, myExternalBuildPlugins);
}
@Override
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java b/platform/platform-impl/src/com/intellij/jps/impl/JpsPluginBean.java
similarity index 62%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
copy to platform/platform-impl/src/com/intellij/jps/impl/JpsPluginBean.java
index 2a24920..4979dd7 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
+++ b/platform/platform-impl/src/com/intellij/jps/impl/JpsPluginBean.java
@@ -13,15 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package com.intellij.jps.impl;
+
+import com.intellij.openapi.extensions.AbstractExtensionPointBean;
+import com.intellij.openapi.extensions.ExtensionPointName;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author nik
*/
-public class RemoteCancelledException extends com.intellij.remote.RemoteCancelledException {
- public RemoteCancelledException(String s) {
- super(s);
- }
+public class JpsPluginBean extends AbstractExtensionPointBean {
+ public static final ExtensionPointName<JpsPluginBean> EP_NAME = ExtensionPointName.create("com.intellij.jps.plugin");
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java
index 308d5db..7c8acbc 100644
--- a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java
@@ -767,12 +767,12 @@
@Override
public void exit() {
- exit(false);
+ exit(false, false);
}
@Override
- public void exit(final boolean force) {
- exit(force, true, false);
+ public void exit(boolean force, final boolean exitConfirmed) {
+ exit(false, exitConfirmed, true, false);
}
@Override
@@ -781,8 +781,8 @@
}
@Override
- public void restart(boolean force) {
- exit(force, true, true);
+ public void restart(boolean exitConfirmed) {
+ exit(false, exitConfirmed, true, true);
}
/*
@@ -796,7 +796,7 @@
*/
private static volatile boolean exiting = false;
- public void exit(final boolean force, final boolean allowListenersToCancel, final boolean restart) {
+ public void exit(final boolean force, final boolean exitConfirmed, final boolean allowListenersToCancel, final boolean restart) {
if (exiting) return;
exiting = true;
@@ -808,7 +808,7 @@
Runnable runnable = new Runnable() {
@Override
public void run() {
- if (!confirmExitIfNeeded(force)) {
+ if (!force && !confirmExitIfNeeded(exitConfirmed)) {
saveAll();
return;
}
@@ -857,9 +857,9 @@
return true;
}
- private static boolean confirmExitIfNeeded(boolean force) {
+ private static boolean confirmExitIfNeeded(boolean exitConfirmed) {
final boolean hasUnsafeBgTasks = ProgressManager.getInstance().hasUnsafeProgressIndicator();
- if (force && !hasUnsafeBgTasks) {
+ if (exitConfirmed && !hasUnsafeBgTasks) {
return true;
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/diff/impl/Rediffers.java b/platform/platform-impl/src/com/intellij/openapi/diff/impl/Rediffers.java
index a29e519..3a1f8b0 100644
--- a/platform/platform-impl/src/com/intellij/openapi/diff/impl/Rediffers.java
+++ b/platform/platform-impl/src/com/intellij/openapi/diff/impl/Rediffers.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -24,8 +24,6 @@
import com.intellij.util.Alarm;
import com.intellij.util.containers.HashMap;
-import java.util.Iterator;
-
public class Rediffers {
private final HashMap<EditorSource, Rediff> myRediffers = new HashMap<EditorSource, Rediff>();
private final DiffPanelImpl myPanel;
@@ -43,8 +41,7 @@
}
public void dispose() {
- for (Iterator<Rediff> iterator = myRediffers.values().iterator(); iterator.hasNext();) {
- Rediff rediff = iterator.next();
+ for (Rediff rediff : myRediffers.values()) {
rediff.stopListen();
}
myRediffers.clear();
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/actions/EditorActionUtil.java b/platform/platform-impl/src/com/intellij/openapi/editor/actions/EditorActionUtil.java
index 8b77910..a0355cf 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/actions/EditorActionUtil.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/actions/EditorActionUtil.java
@@ -601,7 +601,9 @@
}
}
caretModel.moveToOffset(newOffset);
- editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+ if (editor.getCaretModel().getCurrentCaret() == editor.getCaretModel().getPrimaryCaret()) {
+ editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+ }
setupSelection(editor, isWithSelection, selectionStart, blockSelectionStart);
}
@@ -673,7 +675,9 @@
if (isWordStart(text, newOffset, camel)) break;
}
editor.getCaretModel().moveToOffset(newOffset);
- editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+ if (editor.getCaretModel().getCurrentCaret() == editor.getCaretModel().getPrimaryCaret()) {
+ editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
+ }
setupSelection(editor, isWithSelection, selectionStart, blockSelectionStart);
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/ex/SoftWrapModelEx.java b/platform/platform-impl/src/com/intellij/openapi/editor/ex/SoftWrapModelEx.java
index 48d43bc..e3c03c2 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/ex/SoftWrapModelEx.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/ex/SoftWrapModelEx.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,6 +16,7 @@
package com.intellij.openapi.editor.ex;
import com.intellij.openapi.editor.*;
+import com.intellij.openapi.editor.impl.EditorTextRepresentationHelper;
import com.intellij.openapi.editor.impl.softwrap.SoftWrapDrawingType;
import org.jetbrains.annotations.NotNull;
@@ -149,4 +150,6 @@
* Allows to instruct current model to always return <code>'true'</code> from {@link #isRespectAdditionalColumns()}.
*/
void forceAdditionalColumnsUsage();
+
+ EditorTextRepresentationHelper getEditorTextRepresentationHelper();
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/BorderEffect.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/BorderEffect.java
index cc1a23f..2872699 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/BorderEffect.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/BorderEffect.java
@@ -86,6 +86,8 @@
markupModel.processRangeHighlightersOverlappingWith(myStartOffset, myEndOffset, new Processor<RangeHighlighterEx>() {
@Override
public boolean process(RangeHighlighterEx rangeHighlighter) {
+ if (!rangeHighlighter.getEditorFilter().avaliableIn(myEditor)) return true;
+
TextAttributes textAttributes = rangeHighlighter.getTextAttributes();
if (isBorder(textAttributes) && intersectsRange(rangeHighlighter)) {
paintBorder(rangeHighlighter, textAttributes);
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretImpl.java
index 068f25e..cfd039a 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretImpl.java
@@ -1453,10 +1453,17 @@
return marker != null && marker.isValid() && isVirtualSelectionEnabled() && myEndVirtualOffset > myStartVirtualOffset;
}
+ @Override
+ @NotNull
public EditorImpl getEditor() {
return myEditor;
}
+ @Override
+ public String toString() {
+ return "Caret at " + myVisibleCaret + (mySelectionMarker == null ? "" : (", selection marker: " + mySelectionMarker.toString()));
+ }
+
/**
* Encapsulates information about target vertical range info - its <code>'y'</code> coordinate and height in pixels.
*/
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java
index a18d454..8d6608e 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java
@@ -282,11 +282,9 @@
}
}
- boolean addCaret(CaretImpl caretToAdd) {
+ boolean addCaret(@NotNull CaretImpl caretToAdd) {
for (CaretImpl caret : myCarets) {
- VisualPosition newVisualPosition = caretToAdd.getVisualPosition();
- int newOffset = myEditor.logicalPositionToOffset(myEditor.visualToLogicalPosition(newVisualPosition));
- if (caret.getVisualPosition().equals(newVisualPosition) || newOffset >= caret.getSelectionStart() && newOffset <= caret.getSelectionEnd()) {
+ if (caretsOverlap(caret, caretToAdd)) {
return false;
}
}
@@ -384,8 +382,7 @@
it.next();
}
CaretImpl currCaret = it.next();
- if (prevCaret != null && (currCaret.getVisualPosition().equals(prevCaret.getVisualPosition())
- || selectionsIntersect(currCaret, prevCaret))) {
+ if (prevCaret != null && caretsOverlap(currCaret, prevCaret)) {
int newSelectionStart = Math.min(currCaret.getSelectionStart(), prevCaret.getSelectionStart());
int newSelectionEnd = Math.max(currCaret.getSelectionEnd(), prevCaret.getSelectionEnd());
CaretImpl toRetain, toRemove;
@@ -410,7 +407,10 @@
}
}
- private static boolean selectionsIntersect(CaretImpl firstCaret, CaretImpl secondCaret) {
+ private static boolean caretsOverlap(@NotNull CaretImpl firstCaret, @NotNull CaretImpl secondCaret) {
+ if (firstCaret.getVisualPosition().equals(secondCaret.getVisualPosition())) {
+ return true;
+ }
int firstStart = firstCaret.getSelectionStart();
int secondStart = secondCaret.getSelectionStart();
int firstEnd = firstCaret.getSelectionEnd();
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/DefaultEditorTextRepresentationHelper.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/DefaultEditorTextRepresentationHelper.java
index 9b2e473..61415eb9 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/DefaultEditorTextRepresentationHelper.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/DefaultEditorTextRepresentationHelper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,14 +16,14 @@
package com.intellij.openapi.editor.impl;
import com.intellij.openapi.editor.Editor;
-import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.ex.util.EditorUtil;
import gnu.trove.TObjectIntHashMap;
import org.intellij.lang.annotations.JdkConstants;
import org.jetbrains.annotations.NotNull;
/**
- * Not thread-safe.
+ * Not thread-safe. Performs caching of char widths, so cache reset must be invoked (via {@link #clearSymbolWidthCache()} method) when
+ * font settings are changed in editor.
*
* @author Denis Zhdanov
* @since Jul 27, 2010 4:06:27 PM
@@ -60,9 +60,6 @@
public int charWidth(char c, int fontType) {
// Symbol width retrieval is detected to be a bottleneck, hence, we perform a caching here in assumption that every representation
// helper is editor-bound and cache size is not too big.
- EditorColorsScheme colorsScheme = myEditor.getColorsScheme();
- mySharedKey.fontName = colorsScheme.getEditorFontName();
- mySharedKey.fontSize = colorsScheme.getEditorFontSize();
mySharedKey.fontType = fontType;
mySharedKey.c = c;
@@ -83,9 +80,6 @@
// Symbol width retrieval is detected to be a bottleneck, hence, we perform a caching here in assumption that every representation
// helper is editor-bound and cache size is not too big.
- EditorColorsScheme colorsScheme = myEditor.getColorsScheme();
- mySharedKey.fontName = colorsScheme.getEditorFontName();
- mySharedKey.fontSize = colorsScheme.getEditorFontSize();
mySharedKey.fontType = fontType;
for (int i = startToUse; i < end; i++) {
@@ -107,7 +101,7 @@
return result;
}
Key key = mySharedKey.clone();
- FontInfo font = ComplementaryFontsRegistry.getFontAbleToDisplay(c, key.fontSize, key.fontType, key.fontName);
+ FontInfo font = ComplementaryFontsRegistry.getFontAbleToDisplay(c, key.fontType, myEditor.getColorsScheme().getFontPreferences());
result = font.charWidth(c);
if (mySymbolWidthCache.size() >= MAX_SYMBOLS_WIDTHS_CACHE_SIZE) {
// Don't expect to be here.
@@ -117,33 +111,31 @@
return result;
}
+ public void clearSymbolWidthCache() {
+ mySymbolWidthCache.clear();
+ }
+
private static class Key {
- public String fontName;
- private int fontSize;
@JdkConstants.FontStyle private int fontType;
private char c;
private Key() {
- this(null, 0, 0, ' ');
+ this(0, ' ');
}
- Key(String fontName, int fontSize, @JdkConstants.FontStyle int fontType, char c) {
- this.fontName = fontName;
- this.fontSize = fontSize;
+ Key(@JdkConstants.FontStyle int fontType, char c) {
this.fontType = fontType;
this.c = c;
}
@Override
protected Key clone() {
- return new Key(fontName, fontSize, fontType, c);
+ return new Key(fontType, c);
}
@Override
public int hashCode() {
- int result = fontName != null ? fontName.hashCode() : 0;
- result = 31 * result + fontSize;
- result = 31 * result + fontType;
+ int result = fontType;
result = 31 * result + c;
return result;
}
@@ -155,10 +147,8 @@
Key key = (Key)o;
- if (fontSize != key.fontSize) return false;
if (fontType != key.fontType) return false;
if (c != key.c) return false;
- if (fontName != null ? !fontName.equals(key.fontName) : key.fontName != null) return false;
return true;
}
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 e37ad8f..b708f38 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
@@ -66,6 +66,8 @@
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.IdeGlassPane;
+import com.intellij.openapi.wm.ToolWindowAnchor;
+import com.intellij.openapi.wm.ex.ToolWindowManagerEx;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.ui.*;
@@ -320,7 +322,7 @@
myScheme = createBoundColorSchemeDelegate(null);
initTabPainter();
myIsViewer = viewer;
- mySettings = new SettingsImpl(this);
+ mySettings = new SettingsImpl(this, project);
mySelectionModel = new SelectionModelImpl(this);
myMarkupModel = new EditorMarkupModelImpl(this);
@@ -1979,6 +1981,8 @@
myMarkupModel.processRangeHighlightersOverlappingWith(clipStartOffset, clipEndOffset, new Processor<RangeHighlighterEx>() {
@Override
public boolean process(@NotNull RangeHighlighterEx highlighter) {
+ if (!highlighter.getEditorFilter().avaliableIn(EditorImpl.this)) return true;
+
final CustomHighlighterRenderer customRenderer = highlighter.getCustomRenderer();
if (customRenderer != null && clipStartOffset < highlighter.getEndOffset() && highlighter.getStartOffset() < clipEndOffset) {
customRenderer.paint(EditorImpl.this, highlighter, g);
@@ -2124,6 +2128,8 @@
Processor<RangeHighlighterEx> paintProcessor = new Processor<RangeHighlighterEx>() {
@Override
public boolean process(@NotNull RangeHighlighterEx highlighter) {
+ if (!highlighter.getEditorFilter().avaliableIn(EditorImpl.this)) return true;
+
paintSegmentHighlighterAfterEndOfLine(g, highlighter, startLine, endLine);
return true;
}
@@ -2978,6 +2984,8 @@
markupModel.processRangeHighlightersOverlappingWith(clipStartOffset, clipEndOffset, new Processor<RangeHighlighterEx>() {
@Override
public boolean process(@NotNull RangeHighlighterEx lineMarker) {
+ if (!lineMarker.getEditorFilter().avaliableIn(EditorImpl.this)) return true;
+
paintLineMarkerSeparator(lineMarker, clip, g);
return true;
}
@@ -6735,7 +6743,7 @@
}
}
- private static class TablessBorder extends SideBorder {
+ private class TablessBorder extends SideBorder {
private TablessBorder() {
super(UIUtil.getBorderColor(), SideBorder.ALL);
}
@@ -6760,7 +6768,9 @@
@Override
public Insets getBorderInsets(Component c) {
Container splitters = SwingUtilities.getAncestorOfClass(EditorsSplitters.class, c);
- return splitters == null ? super.getBorderInsets(c) : new Insets(1, 0, 0, 0);
+ boolean thereIsSomethingAbove = !SystemInfo.isMac || UISettings.getInstance().SHOW_MAIN_TOOLBAR || UISettings.getInstance().SHOW_NAVIGATION_BAR ||
+ EditorImpl.this.myProject != null && !ToolWindowManagerEx.getInstanceEx(EditorImpl.this.myProject).getIdsOn(ToolWindowAnchor.TOP).isEmpty();
+ return splitters == null ? super.getBorderInsets(c) : new Insets(thereIsSomethingAbove ? 1 : 0, 0, 0, 0);
}
@Override
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorMarkupModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorMarkupModelImpl.java
index c721a5a..a2f45fe 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorMarkupModelImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorMarkupModelImpl.java
@@ -45,6 +45,7 @@
import com.intellij.openapi.ui.popup.Balloon;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.ProperTextRange;
+import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.wm.ToolWindowAnchor;
import com.intellij.openapi.wm.ex.ToolWindowManagerEx;
import com.intellij.ui.*;
@@ -229,6 +230,8 @@
markupModel.processRangeHighlightersOverlappingWith(startOffset, endOffset, new Processor<RangeHighlighterEx>() {
@Override
public boolean process(RangeHighlighterEx highlighter) {
+ if (!highlighter.getEditorFilter().avaliableIn(myEditor)) return true;
+
if (highlighter.getErrorStripeMarkColor() != null) {
if (highlighter.getStartOffset() < endOffset && highlighter.getEndOffset() > startOffset) {
highlighters.add(highlighter);
@@ -266,6 +269,8 @@
markupModel.processRangeHighlightersOverlappingWith(startOffset, endOffset, new Processor<RangeHighlighterEx>() {
@Override
public boolean process(RangeHighlighterEx highlighter) {
+ if (!highlighter.getEditorFilter().avaliableIn(myEditor)) return true;
+
if (highlighter.getErrorStripeMarkColor() != null) {
ProperTextRange range = offsetsToYPositions(highlighter.getStartOffset(), highlighter.getEndOffset());
if (scrollBarY >= range.getStartOffset() - myMinMarkHeight * 2 &&
@@ -432,7 +437,7 @@
errorIconBounds.y = bounds.height / 2 - errorIconBounds.height / 2;
try {
- if (UISettings.getInstance().PRESENTATION_MODE) {
+ if (UISettings.getInstance().PRESENTATION_MODE || SystemInfo.isMac) {
g.setColor(getEditor().getColorsScheme().getDefaultBackground());
g.fillRect(0, 0, bounds.width, bounds.height);
@@ -523,7 +528,7 @@
@Override
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) {
- if (UISettings.getInstance().PRESENTATION_MODE) {
+ if (UISettings.getInstance().PRESENTATION_MODE || SystemInfo.isMac) {
super.paintThumb(g, c, thumbBounds);
return;
}
@@ -560,16 +565,16 @@
@Override
protected int getThickness() {
- if (UISettings.getInstance().PRESENTATION_MODE) return super.getThickness();
+ if (UISettings.getInstance().PRESENTATION_MODE || SystemInfo.isMac) return super.getThickness();
return super.getThickness() + (isMacOverlayScrollbar() ? 2 : 7);
}
@Override
protected void doPaintTrack(Graphics g, JComponent c, Rectangle bounds) {
- if (UISettings.getInstance().PRESENTATION_MODE) {
+ if (UISettings.getInstance().PRESENTATION_MODE || SystemInfo.isMac) {
g.setColor(getEditor().getColorsScheme().getDefaultBackground());
g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height);
- return;
+ //return;
}
Rectangle clip = g.getClipBounds().intersection(bounds);
if (clip.height == 0) return;
@@ -604,7 +609,7 @@
}
private void paintTrackBasement(Graphics g, Rectangle bounds) {
- if (UISettings.getInstance().PRESENTATION_MODE) {
+ if (UISettings.getInstance().PRESENTATION_MODE || SystemInfo.isMac) {
return;
}
@@ -661,6 +666,8 @@
markup.processRangeHighlightersOverlappingWith(startOffset, endOffset, new Processor<RangeHighlighterEx>() {
@Override
public boolean process(RangeHighlighterEx highlighter) {
+ if (!highlighter.getEditorFilter().avaliableIn(myEditor)) return true;
+
Color color = highlighter.getErrorStripeMarkColor();
if (color == null) return true;
boolean isThin = highlighter.isThinErrorStripeMark();
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/FoldingModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/FoldingModelImpl.java
index 694bc75..b929704 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/FoldingModelImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/FoldingModelImpl.java
@@ -265,9 +265,6 @@
if (line >= myEditor.getDocument().getLineCount()) return null;
- //leftmost folded block position
- if (myEditor.xyToVisualPosition(p).equals(myEditor.logicalToVisualPosition(pos))) return null;
-
int offset = myEditor.logicalPositionToOffset(pos);
return myFoldTree.fetchOutermost(offset);
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/SelectionModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/SelectionModelImpl.java
index 263ea77..2f5a811 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/SelectionModelImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/SelectionModelImpl.java
@@ -36,16 +36,13 @@
import com.intellij.openapi.editor.ex.PrioritizedDocumentListener;
import com.intellij.openapi.editor.ex.util.EditorUtil;
import com.intellij.openapi.editor.markup.TextAttributes;
-import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.util.Pair;
-import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.containers.ContainerUtil;
import gnu.trove.TIntArrayList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import java.awt.datatransfer.StringSelection;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
@@ -570,13 +567,7 @@
@Override
public void copySelectionToClipboard() {
- validateContext(true);
- String s = getSelectedText(true);
- if (s == null) return;
-
- s = StringUtil.convertLineSeparators(s);
- StringSelection contents = new StringSelection(s);
- CopyPasteManager.getInstance().setContents(contents);
+ CopyPasteSupport.copySelectionToClipboard(myEditor);
}
@Override
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/SettingsImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/SettingsImpl.java
index dabf5e9..f2dbc67 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/SettingsImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/SettingsImpl.java
@@ -25,6 +25,8 @@
package com.intellij.openapi.editor.impl;
import com.intellij.codeStyle.CodeStyleFacade;
+import com.intellij.lang.Language;
+import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.EditorSettings;
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.editor.ex.EditorSettingsExternalizable;
@@ -32,10 +34,14 @@
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class SettingsImpl implements EditorSettings {
@Nullable private final EditorEx myEditor;
+ @Nullable private final Language myLanguage;
private Boolean myIsCamelWords;
// This group of settings does not have UI
@@ -78,9 +84,14 @@
private Boolean myRenamePreselect = null;
private Boolean myWrapWhenTypingReachesRightMargin = null;
private Boolean myShowIntentionBulb = null;
+
+ public SettingsImpl() {
+ this(null, null);
+ }
- public SettingsImpl(@Nullable EditorEx editor) {
+ public SettingsImpl(@Nullable EditorEx editor, @Nullable Project project) {
myEditor = editor;
+ myLanguage = editor != null && project != null ? getDocumentLanguage(project, editor.getDocument()) : null;
}
@Override
@@ -144,7 +155,17 @@
@Override
public int getRightMargin(Project project) {
return myRightMargin != null ? myRightMargin.intValue() :
- CodeStyleFacade.getInstance(project).getRightMargin();
+ CodeStyleFacade.getInstance(project).getRightMargin(myLanguage);
+ }
+
+ @Nullable
+ private static Language getDocumentLanguage(@Nullable Project project, @NotNull Document document) {
+ if (project != null) {
+ PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
+ PsiFile file = documentManager.getPsiFile(document);
+ if (file != null) return file.getLanguage();
+ }
+ return null;
}
@Override
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java
index cccf86c..6f1b982 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java
@@ -21,6 +21,7 @@
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.*;
+import com.intellij.openapi.editor.colors.FontPreferences;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.editor.event.DocumentListener;
import com.intellij.openapi.editor.ex.*;
@@ -89,9 +90,10 @@
private SoftWrapPainter myPainter;
private final SoftWrapApplianceManager myApplianceManager;
private final SoftWrapAwareVisualSizeManager myVisualSizeManager;
+ private EditorTextRepresentationHelper myEditorTextRepresentationHelper;
private final EditorEx myEditor;
-
+
/**
* We don't want to use soft wraps-aware processing from non-EDT and profiling shows that 'is EDT' check that is called too
* often is rather expensive. Hence, we use caching here for performance improvement.
@@ -101,6 +103,8 @@
private int myActive;
private boolean myUseSoftWraps;
private int myTabWidth = -1;
+ @NotNull
+ private FontPreferences myFontPreferences;
/**
* Soft wraps need to be kept up-to-date on all editor modification (changing text, adding/removing/expanding/collapsing fold
@@ -132,9 +136,9 @@
myEditor = editor;
myStorage = new SoftWrapsStorage();
myPainter = new CompositeSoftWrapPainter(editor);
- DefaultEditorTextRepresentationHelper representationHelper = new DefaultEditorTextRepresentationHelper(editor);
- myDataMapper = new CachingSoftWrapDataMapper(editor, myStorage, representationHelper);
- myApplianceManager = new SoftWrapApplianceManager(myStorage, editor, myPainter, representationHelper, myDataMapper);
+ myEditorTextRepresentationHelper = new DefaultEditorTextRepresentationHelper(editor);
+ myDataMapper = new CachingSoftWrapDataMapper(editor, myStorage);
+ myApplianceManager = new SoftWrapApplianceManager(myStorage, editor, myPainter, myDataMapper);
myFoldBasedApplianceStrategy = new SoftWrapFoldBasedApplianceStrategy(editor);
myVisualSizeManager = new SoftWrapAwareVisualSizeManager(myPainter);
@@ -150,6 +154,7 @@
});
EditorSettings settings = myEditor.getSettings();
myUseSoftWraps = settings.isUseSoftWraps();
+ myFontPreferences = myEditor.getColorsScheme().getFontPreferences();
editor.addPropertyChangeListener(this);
@@ -168,8 +173,16 @@
int tabWidthBefore = myTabWidth;
myTabWidth = getCurrentTabWidth();
+
+ boolean fontsChanged = false;
+ if (!myFontPreferences.equals(myEditor.getColorsScheme().getFontPreferences())
+ && myEditorTextRepresentationHelper instanceof DefaultEditorTextRepresentationHelper) {
+ fontsChanged = true;
+ myFontPreferences = myEditor.getColorsScheme().getFontPreferences();
+ ((DefaultEditorTextRepresentationHelper)myEditorTextRepresentationHelper).clearSymbolWidthCache();
+ }
- if ((myUseSoftWraps ^ softWrapsUsedBefore) || (tabWidthBefore >= 0 && myTabWidth != tabWidthBefore)) {
+ if ((myUseSoftWraps ^ softWrapsUsedBefore) || (tabWidthBefore >= 0 && myTabWidth != tabWidthBefore) || fontsChanged) {
myApplianceManager.reset();
myDeferredFoldRegions.clear();
myEditor.getScrollingModel().scrollToCaret(ScrollType.CENTER);
@@ -705,6 +718,20 @@
myVisualSizeManager.setSoftWrapPainter(painter);
}
+ public static EditorTextRepresentationHelper getEditorTextRepresentationHelper(@NotNull Editor editor) {
+ return ((SoftWrapModelEx)editor.getSoftWrapModel()).getEditorTextRepresentationHelper();
+ }
+
+ public EditorTextRepresentationHelper getEditorTextRepresentationHelper() {
+ return myEditorTextRepresentationHelper;
+ }
+
+ @TestOnly
+ public void setEditorTextRepresentationHelper(EditorTextRepresentationHelper editorTextRepresentationHelper) {
+ myEditorTextRepresentationHelper = editorTextRepresentationHelper;
+ myApplianceManager.reset();
+ }
+
@NotNull
@Override
public String dumpState() {
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/AbstractMappingStrategy.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/AbstractMappingStrategy.java
index 26c8086..bccdf4c 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/AbstractMappingStrategy.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/AbstractMappingStrategy.java
@@ -15,12 +15,10 @@
*/
package com.intellij.openapi.editor.impl.softwrap.mapping;
-import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.FoldRegion;
import com.intellij.openapi.editor.LogicalPosition;
-import com.intellij.openapi.editor.impl.EditorTextRepresentationHelper;
import com.intellij.openapi.editor.impl.softwrap.SoftWrapsStorage;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -39,10 +37,7 @@
*/
abstract class AbstractMappingStrategy<T> implements MappingStrategy<T> {
- private static final Logger LOG = Logger.getInstance("#" + AbstractMappingStrategy.class.getName());
-
protected final Editor myEditor;
- protected final EditorTextRepresentationHelper myRepresentationHelper;
protected final SoftWrapsStorage myStorage;
protected final List<CacheEntry> myCache;
@@ -53,13 +48,11 @@
AbstractMappingStrategy(@NotNull Editor editor,
@NotNull SoftWrapsStorage storage,
- @NotNull List<CacheEntry> cache,
- @NotNull EditorTextRepresentationHelper representationHelper)
+ @NotNull List<CacheEntry> cache)
{
myEditor = editor;
myStorage = storage;
myCache = cache;
- myRepresentationHelper = representationHelper;
}
@Nullable
@@ -73,7 +66,7 @@
}
protected void setFirstInitialPosition() {
- myInitialPosition = new EditorPosition(new LogicalPosition(0, 0), 0, myEditor, myRepresentationHelper);
+ myInitialPosition = new EditorPosition(new LogicalPosition(0, 0), 0, myEditor);
}
@Nullable
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CacheEntry.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CacheEntry.java
index 57ef56c..27362b5 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CacheEntry.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CacheEntry.java
@@ -17,7 +17,6 @@
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.FoldRegion;
-import com.intellij.openapi.editor.impl.EditorTextRepresentationHelper;
import com.intellij.openapi.util.Ref;
import gnu.trove.TIntObjectHashMap;
import gnu.trove.TIntObjectProcedure;
@@ -25,7 +24,10 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
/**
* Encapsulates information to cache for the single visual line.
@@ -59,7 +61,6 @@
public boolean locked;
private final Editor myEditor;
- private final EditorTextRepresentationHelper myRepresentationHelper;
/** Holds positions for the tabulation symbols on a target visual line sorted by offset in ascending order. */
private List<TabData> myTabPositions = Collections.EMPTY_LIST;
@@ -67,10 +68,9 @@
/** Holds information about single line fold regions representation data. */
private TIntObjectHashMap<FoldingData> myFoldingData = DUMMY;
- CacheEntry(int visualLine, @NotNull Editor editor, @NotNull EditorTextRepresentationHelper representationHelper) {
+ CacheEntry(int visualLine, @NotNull Editor editor) {
this.visualLine = visualLine;
myEditor = editor;
- myRepresentationHelper = representationHelper;
}
public void setLineStartPosition(@NotNull EditorPosition context) {
@@ -99,7 +99,7 @@
}
public EditorPosition buildStartLinePosition() {
- EditorPosition result = new EditorPosition(myEditor, myRepresentationHelper);
+ EditorPosition result = new EditorPosition(myEditor);
result.logicalLine = startLogicalLine;
result.logicalColumn = startLogicalColumn;
result.offset = startOffset;
@@ -114,7 +114,7 @@
}
public EditorPosition buildEndLinePosition() {
- EditorPosition result = new EditorPosition(myEditor, myRepresentationHelper);
+ EditorPosition result = new EditorPosition(myEditor);
result.logicalLine = endLogicalLine;
result.logicalColumn = endLogicalColumn;
result.offset = endOffset;
@@ -246,7 +246,7 @@
@Override
protected CacheEntry clone() {
- final CacheEntry result = new CacheEntry(visualLine, myEditor, myRepresentationHelper);
+ final CacheEntry result = new CacheEntry(visualLine, myEditor);
result.startLogicalLine = startLogicalLine;
result.startLogicalColumn = startLogicalColumn;
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapper.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapper.java
index 08bf0211..2f21b03 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapper.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapper.java
@@ -21,7 +21,7 @@
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.editor.ex.FoldingModelEx;
import com.intellij.openapi.editor.impl.EditorImpl;
-import com.intellij.openapi.editor.impl.EditorTextRepresentationHelper;
+import com.intellij.openapi.editor.impl.SoftWrapModelImpl;
import com.intellij.openapi.editor.impl.softwrap.SoftWrapDataMapper;
import com.intellij.openapi.editor.impl.softwrap.SoftWrapImpl;
import com.intellij.openapi.editor.impl.softwrap.SoftWrapsStorage;
@@ -71,19 +71,16 @@
private final VisualToLogicalCalculationStrategy myVisualToLogicalStrategy;
private final EditorEx myEditor;
private final SoftWrapsStorage myStorage;
- private final EditorTextRepresentationHelper myRepresentationHelper;
private final CacheEntry mySearchKey;
- public CachingSoftWrapDataMapper(@NotNull EditorEx editor, @NotNull SoftWrapsStorage storage,
- @NotNull EditorTextRepresentationHelper representationHelper)
+ public CachingSoftWrapDataMapper(@NotNull EditorEx editor, @NotNull SoftWrapsStorage storage)
{
myEditor = editor;
myStorage = storage;
- myRepresentationHelper = representationHelper;
- mySearchKey = new CacheEntry(0, editor, representationHelper);
+ mySearchKey = new CacheEntry(0, editor);
- myOffsetToLogicalStrategy = new OffsetToLogicalCalculationStrategy(editor, storage, myCache, representationHelper);
- myVisualToLogicalStrategy = new VisualToLogicalCalculationStrategy(editor, storage, myCache, representationHelper);
+ myOffsetToLogicalStrategy = new OffsetToLogicalCalculationStrategy(editor, storage, myCache);
+ myVisualToLogicalStrategy = new VisualToLogicalCalculationStrategy(editor, storage, myCache);
}
@NotNull
@@ -146,7 +143,7 @@
// Count soft wrap column offset only if it's located at the same line as the target offset.
if (column < 0 && softWrap.getStart() >= targetLogicalLineStartOffset) {
- column = softWrap.getIndentInColumns() + myRepresentationHelper.toVisualColumnSymbolsNumber(
+ column = softWrap.getIndentInColumns() + SoftWrapModelImpl.getEditorTextRepresentationHelper(myEditor).toVisualColumnSymbolsNumber(
myEditor.getDocument().getCharsSequence(), softWrap.getStart(), maxOffset, softWrap.getIndentInPixels()
);
@@ -326,7 +323,7 @@
return lastEntry;
}
else if (lastEntry.visualLine < visualLine && createIfNecessary) {
- CacheEntry result = new CacheEntry(visualLine, myEditor, myRepresentationHelper);
+ CacheEntry result = new CacheEntry(visualLine, myEditor);
myCache.add(result);
return result;
}
@@ -357,7 +354,7 @@
if (cacheEntryIndex < 0) {
cacheEntryIndex = start;
if (createIfNecessary) {
- myCache.add(cacheEntryIndex, result = new CacheEntry(visualLine, myEditor, myRepresentationHelper));
+ myCache.add(cacheEntryIndex, result = new CacheEntry(visualLine, myEditor));
}
}
else {
@@ -666,7 +663,7 @@
@NotNull List<Pair<Integer, FoldRegion>> foldRegions,
@NotNull List<Pair<Integer, Integer>> tabData)
{
- final CacheEntry entry = new CacheEntry(visualLine, myEditor, myRepresentationHelper);
+ final CacheEntry entry = new CacheEntry(visualLine, myEditor);
entry.startOffset = startOffset;
entry.endOffset = endOffset;
entry.startLogicalLine = startLogicalLine;
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/EditorPosition.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/EditorPosition.java
index 903243c..1097f28 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/EditorPosition.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/EditorPosition.java
@@ -16,7 +16,7 @@
package com.intellij.openapi.editor.impl.softwrap.mapping;
import com.intellij.openapi.editor.*;
-import com.intellij.openapi.editor.impl.EditorTextRepresentationHelper;
+import com.intellij.openapi.editor.impl.SoftWrapModelImpl;
import org.jetbrains.annotations.NotNull;
/**
@@ -46,29 +46,24 @@
public int symbolWidthInPixels;
private final Editor myEditor;
- private final EditorTextRepresentationHelper myRepresentationHelper;
- EditorPosition(@NotNull Editor editor, @NotNull EditorTextRepresentationHelper representationHelper) {
+ EditorPosition(@NotNull Editor editor) {
myEditor = editor;
- myRepresentationHelper = representationHelper;
}
EditorPosition(@NotNull LogicalPosition logical,
int offset,
- @NotNull Editor editor,
- @NotNull EditorTextRepresentationHelper representationHelper)
+ @NotNull Editor editor)
{
- this(logical, logical.toVisualPosition(), offset, editor, representationHelper);
+ this(logical, logical.toVisualPosition(), offset, editor);
}
EditorPosition(@NotNull LogicalPosition logical,
@NotNull VisualPosition visual,
int offset,
- @NotNull Editor editor,
- @NotNull EditorTextRepresentationHelper representationHelper)
+ @NotNull Editor editor)
{
myEditor = editor;
- myRepresentationHelper = representationHelper;
logicalLine = logical.line;
logicalColumn = logical.column;
softWrapLinesBefore = logical.softWrapLinesBeforeCurrentLogicalLine;
@@ -148,10 +143,11 @@
if (logicalLine == endOffsetLogicalLine) {
// Single-line fold region.
if (collapsedSymbolsWidthInColumns < 0) {
- collapsedSymbolsWidthInColumns = myRepresentationHelper.toVisualColumnSymbolsNumber(document.getCharsSequence(),
- foldRegion.getStartOffset(),
- foldRegion.getEndOffset(),
- x);
+ collapsedSymbolsWidthInColumns = SoftWrapModelImpl.getEditorTextRepresentationHelper(myEditor)
+ .toVisualColumnSymbolsNumber(document.getCharsSequence(),
+ foldRegion.getStartOffset(),
+ foldRegion.getEndOffset(),
+ x);
}
logicalColumn += collapsedSymbolsWidthInColumns;
foldingColumnDiff += placeholder.length() - collapsedSymbolsWidthInColumns;
@@ -159,10 +155,11 @@
else {
// Multi-line fold region.
if (collapsedSymbolsWidthInColumns < 0) {
- collapsedSymbolsWidthInColumns = myRepresentationHelper.toVisualColumnSymbolsNumber(document.getCharsSequence(),
- foldRegion.getStartOffset(),
- foldRegion.getEndOffset(),
- 0);
+ collapsedSymbolsWidthInColumns = SoftWrapModelImpl.getEditorTextRepresentationHelper(myEditor)
+ .toVisualColumnSymbolsNumber(document.getCharsSequence(),
+ foldRegion.getStartOffset(),
+ foldRegion.getEndOffset(),
+ 0);
}
int linesDiff = endOffsetLogicalLine - logicalLine;
logicalLine += linesDiff;
@@ -191,7 +188,7 @@
@Override
protected EditorPosition clone() {
- EditorPosition result = new EditorPosition(myEditor, myRepresentationHelper);
+ EditorPosition result = new EditorPosition(myEditor);
result.logicalLine = logicalLine;
result.logicalColumn = logicalColumn;
result.visualLine = visualLine;
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/LogicalToVisualMappingStrategy.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/LogicalToVisualMappingStrategy.java
index 773d4fd..6ed9046 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/LogicalToVisualMappingStrategy.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/LogicalToVisualMappingStrategy.java
@@ -16,7 +16,7 @@
package com.intellij.openapi.editor.impl.softwrap.mapping;
import com.intellij.openapi.editor.*;
-import com.intellij.openapi.editor.impl.EditorTextRepresentationHelper;
+import com.intellij.openapi.editor.impl.SoftWrapModelImpl;
import com.intellij.openapi.editor.impl.softwrap.SoftWrapsStorage;
import org.jetbrains.annotations.NotNull;
@@ -32,10 +32,10 @@
private LogicalPosition myTargetLogical;
LogicalToVisualMappingStrategy(@NotNull LogicalPosition logical, @NotNull Editor editor, @NotNull SoftWrapsStorage storage,
- @NotNull EditorTextRepresentationHelper representationHelper, @NotNull List<CacheEntry> cache)
+ @NotNull List<CacheEntry> cache)
throws IllegalStateException
{
- super(editor, storage, cache, representationHelper);
+ super(editor, storage, cache);
myTargetLogical = logical;
}
@@ -121,7 +121,7 @@
int foldEndColumn;
if (data == null) {
int xStart = myEditor.getDocument().getLineNumber(foldRegion.getStartOffset()) == foldEndLine ? context.x : 0;
- foldEndColumn = myRepresentationHelper.toVisualColumnSymbolsNumber(
+ foldEndColumn = SoftWrapModelImpl.getEditorTextRepresentationHelper(myEditor).toVisualColumnSymbolsNumber(
myEditor.getDocument().getCharsSequence(), foldRegion.getStartOffset(), foldRegion.getEndOffset(), xStart
);
} else {
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/OffsetToLogicalCalculationStrategy.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/OffsetToLogicalCalculationStrategy.java
index 39fe252..399406f 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/OffsetToLogicalCalculationStrategy.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/OffsetToLogicalCalculationStrategy.java
@@ -16,7 +16,7 @@
package com.intellij.openapi.editor.impl.softwrap.mapping;
import com.intellij.openapi.editor.*;
-import com.intellij.openapi.editor.impl.EditorTextRepresentationHelper;
+import com.intellij.openapi.editor.impl.SoftWrapModelImpl;
import com.intellij.openapi.editor.impl.softwrap.SoftWrapsStorage;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -31,10 +31,9 @@
private int myTargetOffset;
- OffsetToLogicalCalculationStrategy(@NotNull Editor editor, @NotNull SoftWrapsStorage storage, @NotNull List<CacheEntry> cache,
- @NotNull EditorTextRepresentationHelper representationHelper)
+ OffsetToLogicalCalculationStrategy(@NotNull Editor editor, @NotNull SoftWrapsStorage storage, @NotNull List<CacheEntry> cache)
{
- super(editor, storage, cache, representationHelper);
+ super(editor, storage, cache);
}
public void init(final int targetOffset, final List<CacheEntry> cache) {
@@ -157,13 +156,13 @@
int targetLogicalLine = document.getLineNumber(myTargetOffset);
if (targetLogicalLine == position.logicalLine) {
// Target offset is located on the same logical line as folding start.
- position.logicalColumn += myRepresentationHelper.toVisualColumnSymbolsNumber(
+ position.logicalColumn += SoftWrapModelImpl.getEditorTextRepresentationHelper(myEditor).toVisualColumnSymbolsNumber(
document.getCharsSequence(), foldRegion.getStartOffset(), myTargetOffset, position.x
);
}
else {
// Target offset is located on a different line with folding start.
- position.logicalColumn = myRepresentationHelper.toVisualColumnSymbolsNumber(
+ position.logicalColumn = SoftWrapModelImpl.getEditorTextRepresentationHelper(myEditor).toVisualColumnSymbolsNumber(
document.getCharsSequence(), foldRegion.getStartOffset(), myTargetOffset, 0
);
position.softWrapColumnDiff = 0;
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java
index 549cd18..3a819d88 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java
@@ -28,10 +28,7 @@
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.editor.ex.ScrollingModelEx;
import com.intellij.openapi.editor.ex.util.EditorUtil;
-import com.intellij.openapi.editor.impl.EditorImpl;
-import com.intellij.openapi.editor.impl.EditorTextRepresentationHelper;
-import com.intellij.openapi.editor.impl.IterationState;
-import com.intellij.openapi.editor.impl.TextChangeImpl;
+import com.intellij.openapi.editor.impl.*;
import com.intellij.openapi.editor.impl.softwrap.*;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.util.text.StringUtil;
@@ -99,7 +96,6 @@
private int myVerticalScrollBarWidth = -1;
private VisibleAreaWidthProvider myWidthProvider;
- private EditorTextRepresentationHelper myRepresentationHelper;
private LineWrapPositionStrategy myLineWrapPositionStrategy;
private IncrementalCacheUpdateEvent myEventBeingProcessed;
private boolean myVisualAreaListenerAttached;
@@ -112,12 +108,11 @@
public SoftWrapApplianceManager(@NotNull SoftWrapsStorage storage,
@NotNull EditorEx editor,
@NotNull SoftWrapPainter painter,
- @NotNull EditorTextRepresentationHelper representationHelper, SoftWrapDataMapper dataMapper)
+ SoftWrapDataMapper dataMapper)
{
myStorage = storage;
myEditor = editor;
myPainter = painter;
- myRepresentationHelper = representationHelper;
myDataMapper = dataMapper;
myWidthProvider = new DefaultVisibleAreaWidthProvider(editor);
}
@@ -272,7 +267,7 @@
myContext.fontType = attributes.getFontType();
myContext.rangeEndOffset = event.getNewEndOffset();
- EditorPosition position = new EditorPosition(logical, start, myEditor, myRepresentationHelper);
+ EditorPosition position = new EditorPosition(logical, start, myEditor);
position.x = point.x;
int spaceWidth = EditorUtil.getSpaceWidth(myContext.fontType, myEditor);
@@ -333,7 +328,8 @@
}
int placeholderWidthInPixels = 0;
for (int i = 0; i < placeholder.length(); i++) {
- placeholderWidthInPixels += myRepresentationHelper.charWidth(placeholder.charAt(i), myContext.fontType);
+ placeholderWidthInPixels += SoftWrapModelImpl.getEditorTextRepresentationHelper(myEditor)
+ .charWidth(placeholder.charAt(i), myContext.fontType);
}
int newX = myContext.currentPosition.x + placeholderWidthInPixels;
@@ -617,7 +613,7 @@
return EditorUtil.nextTabStop(myContext.currentPosition.x, myEditor);
}
else {
- return myContext.currentPosition.x + myRepresentationHelper.charWidth(c, myContext.fontType);
+ return myContext.currentPosition.x + SoftWrapModelImpl.getEditorTextRepresentationHelper(myEditor).charWidth(c, myContext.fontType);
//FontInfo fontInfo = EditorUtil.fontForChar(c, myContext.fontType, myEditor);
//return myContext.currentPosition.x + fontInfo.charWidth(c, myContext.contentComponent);
}
@@ -1009,11 +1005,6 @@
reset();
}
- public void setRepresentationHelper(@NotNull EditorTextRepresentationHelper representationHelper) {
- myRepresentationHelper = representationHelper;
- reset();
- }
-
@NotNull
@Override
public String dumpState() {
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/VisualToLogicalCalculationStrategy.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/VisualToLogicalCalculationStrategy.java
index d79e3bf..7c7c6e4 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/VisualToLogicalCalculationStrategy.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/VisualToLogicalCalculationStrategy.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,7 +16,6 @@
package com.intellij.openapi.editor.impl.softwrap.mapping;
import com.intellij.openapi.editor.*;
-import com.intellij.openapi.editor.impl.EditorTextRepresentationHelper;
import com.intellij.openapi.editor.impl.softwrap.SoftWrapsStorage;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -33,11 +32,10 @@
private final CacheEntry mySearchKey;
private VisualPosition myTargetVisual;
- VisualToLogicalCalculationStrategy(@NotNull Editor editor, @NotNull SoftWrapsStorage storage, @NotNull List<CacheEntry> cache,
- @NotNull EditorTextRepresentationHelper representationHelper)
+ VisualToLogicalCalculationStrategy(@NotNull Editor editor, @NotNull SoftWrapsStorage storage, @NotNull List<CacheEntry> cache)
{
- super(editor, storage, cache, representationHelper);
- mySearchKey = new CacheEntry(0, editor, representationHelper);
+ super(editor, storage, cache);
+ mySearchKey = new CacheEntry(0, editor);
}
public void init(@NotNull final VisualPosition targetVisual, @NotNull final List<CacheEntry> cache) {
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentCaret.java b/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentCaret.java
index 5541e61..92ef12c 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentCaret.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentCaret.java
@@ -29,6 +29,12 @@
@NotNull
@Override
+ public Editor getEditor() {
+ return myEditor;
+ }
+
+ @NotNull
+ @Override
public CaretModel getCaretModel() {
return myEditor.getCaretModel();
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentEditor.java b/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentEditor.java
index 80e0cbb..486a7c5 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentEditor.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentEditor.java
@@ -136,7 +136,7 @@
@NotNull
public EditorSettings getSettings() {
if (mySettings == null) {
- mySettings = new SettingsImpl(null);
+ mySettings = new SettingsImpl();
}
return mySettings;
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorWindow.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorWindow.java
index 860ba32..3519ab6 100644
--- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorWindow.java
+++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorWindow.java
@@ -264,11 +264,11 @@
}
public void closeFile(final VirtualFile file) {
- closeFile (file, true);
+ closeFile(file, true);
}
- public void closeFile(final VirtualFile file, final boolean unsplit) {
- closeFile(file, unsplit, true);
+ public void closeFile(final VirtualFile file, final boolean disposeIfNeeded) {
+ closeFile(file, disposeIfNeeded, true);
}
public boolean hasClosedTabs() {
@@ -286,7 +286,7 @@
}
}
- public void closeFile(final VirtualFile file, final boolean unsplit, final boolean transferFocus) {
+ public void closeFile(final VirtualFile file, final boolean disposeIfNeeded, final boolean transferFocus) {
final FileEditorManagerImpl editorManager = getManager();
editorManager.runChange(new FileEditorManagerChange() {
@Override
@@ -317,13 +317,15 @@
}
}
- if (unsplit && getTabCount() == 0) {
- unsplit (true);
+ if (disposeIfNeeded && getTabCount() == 0) {
+ removeFromSplitter();
}
- myPanel.revalidate ();
- if (myTabbedPane == null) {
- // in tabless mode
- myPanel.repaint();
+ else {
+ myPanel.revalidate();
+ if (myTabbedPane == null) {
+ // in tabless mode
+ myPanel.repaint();
+ }
}
}
finally {
@@ -347,6 +349,39 @@
}, myOwner);
}
+ private void removeFromSplitter() {
+ if (!inSplitter()) return;
+
+ if (myOwner.getCurrentWindow() == this) {
+ EditorWindow[] siblings = findSiblings();
+ myOwner.setCurrentWindow(siblings[0], false);
+ }
+
+ Splitter splitter = (Splitter)myPanel.getParent();
+ JComponent otherComponent = splitter.getOtherComponent(myPanel);
+
+ Container parent = splitter.getParent().getParent();
+ if (parent instanceof Splitter) {
+ Splitter parentSplitter = (Splitter)parent;
+ if (parentSplitter.getFirstComponent() == splitter.getParent()) {
+ parentSplitter.setFirstComponent(otherComponent);
+ }
+ else {
+ parentSplitter.setSecondComponent(otherComponent);
+ }
+ }
+ else if (parent instanceof EditorsSplitters) {
+ parent.removeAll();
+ parent.add(otherComponent, BorderLayout.CENTER);
+ ((JComponent)parent).revalidate();
+ }
+ else {
+ throw new IllegalStateException("Unknown container: " + parent);
+ }
+
+ dispose();
+ }
+
private int calcIndexToSelect(VirtualFile fileBeingClosed, final int fileIndex) {
final int currentlySelectedIndex = myTabbedPane.getSelectedIndex();
if (currentlySelectedIndex != fileIndex) {
@@ -503,6 +538,8 @@
public void requestFocus(boolean forced) {
if (myTabbedPane != null) {
myTabbedPane.requestFocus(forced);
+ } else {
+ IdeFocusManager.findInstanceByComponent(myPanel).requestFocus(myPanel, forced);
}
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java
index 5def1e1..f396b1e 100644
--- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java
@@ -173,8 +173,12 @@
document.setModificationStamp(file.getModificationStamp());
final FileType fileType = file.getFileType();
document.setReadOnly(!file.isWritable() || fileType.isBinary());
- myDocuments.put(file, document);
- document.putUserData(FILE_KEY, file);
+ if (file instanceof LightVirtualFile) {
+ registerDocument(document, file);
+ } else {
+ myDocuments.put(file, document);
+ document.putUserData(FILE_KEY, file);
+ }
if (!(file instanceof LightVirtualFile || file.getFileSystem() instanceof DummyFileSystem)) {
document.addDocumentListener(
diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java
index 34be36b..9a566e9 100644
--- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java
+++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java
@@ -314,6 +314,30 @@
}
}
+ private static KeyStroke getKeyStrokeWithoutCtrlModifier(KeyStroke originalKeyStroke){
+ int modifier=originalKeyStroke.getModifiers()&~InputEvent.CTRL_MASK&~InputEvent.CTRL_DOWN_MASK;
+ try {
+ Method[] methods=AWTKeyStroke.class.getDeclaredMethods();
+ Method getCachedStrokeMethod=null;
+ for (Method method : methods) {
+ if (GET_CACHED_STROKE_METHOD_NAME.equals(method.getName())) {
+ getCachedStrokeMethod = method;
+ getCachedStrokeMethod.setAccessible(true);
+ break;
+ }
+ }
+ if(getCachedStrokeMethod==null){
+ throw new IllegalStateException("not found method with name getCachedStrokeMethod");
+ }
+ Object[] getCachedStrokeMethodArgs=
+ {originalKeyStroke.getKeyChar(), originalKeyStroke.getKeyCode(), modifier, originalKeyStroke.isOnKeyRelease()};
+ return (KeyStroke)getCachedStrokeMethod.invoke(originalKeyStroke, getCachedStrokeMethodArgs);
+ }
+ catch(Exception exc){
+ throw new IllegalStateException(exc.getMessage());
+ }
+ }
+
private boolean inSecondStrokeInProgressState() {
KeyEvent e = myContext.getInputEvent();
@@ -396,6 +420,15 @@
KeyStroke originalKeyStroke=KeyStroke.getKeyStrokeForEvent(e);
KeyStroke keyStroke=getKeyStrokeWithoutMouseModifiers(originalKeyStroke);
+
+
+ if (Registry.is("fix.jdk7.alt.shortcuts") && SystemInfo.isMac && SystemInfo.isOracleJvm && (keyStroke.getModifiers() & InputEvent.ALT_MASK) == InputEvent.ALT_MASK)
+ {
+ if (KeymapManager.getInstance().getActiveKeymap().getActionIds(new KeyboardShortcut(keyStroke, null)).length == 0) {
+ keyStroke = getKeyStrokeWithoutCtrlModifier(keyStroke);
+ }
+ }
+
if (myKeyGestureProcessor.processInitState()) {
return true;
}
@@ -601,7 +634,9 @@
processor.onUpdatePassed(e, action, actionEvent);
- ((DataManagerImpl.MyDataContext)myContext.getDataContext()).setEventCount(IdeEventQueue.getInstance().getEventCount(), this);
+ if (myContext.getDataContext() instanceof DataManagerImpl.MyDataContext) { // this is not true for test data contexts
+ ((DataManagerImpl.MyDataContext)myContext.getDataContext()).setEventCount(IdeEventQueue.getInstance().getEventCount(), this);
+ }
actionManager.fireBeforeActionPerformed(action, actionEvent.getDataContext(), actionEvent);
Component component = PlatformDataKeys.CONTEXT_COMPONENT.getData(actionEvent.getDataContext());
if (component != null && !component.isShowing()) {
diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapManagerImpl.java
index 4c09321..7b4f5a0 100644
--- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapManagerImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapManagerImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.openapi.keymap.impl;
+import com.intellij.openapi.actionSystem.IdeActions;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.components.*;
import com.intellij.openapi.diagnostic.Logger;
@@ -27,6 +28,7 @@
import com.intellij.openapi.options.SchemesManagerFactory;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.containers.ContainerUtil;
import org.jdom.Document;
import org.jdom.Element;
@@ -35,6 +37,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.awt.event.KeyEvent;
import java.io.File;
import java.io.IOException;
import java.util.*;
@@ -92,6 +95,14 @@
}
}
load();
+
+ if (Registry.is("editor.add.carets.on.double.control.arrows")) {
+ ModifierKeyDoubleClickHandler.getInstance().registerAction(IdeActions.ACTION_EDITOR_CLONE_CARET_ABOVE, KeyEvent.VK_CONTROL, KeyEvent.VK_UP);
+ ModifierKeyDoubleClickHandler.getInstance().registerAction(IdeActions.ACTION_EDITOR_CLONE_CARET_BELOW, KeyEvent.VK_CONTROL, KeyEvent.VK_DOWN);
+ ModifierKeyDoubleClickHandler.getInstance().registerAction(IdeActions.ACTION_EDITOR_MOVE_CARET_LEFT, KeyEvent.VK_CONTROL, KeyEvent.VK_LEFT);
+ ModifierKeyDoubleClickHandler.getInstance().registerAction(IdeActions.ACTION_EDITOR_MOVE_CARET_RIGHT, KeyEvent.VK_CONTROL, KeyEvent.VK_RIGHT);
+ }
+
ourKeymapManagerInitialized = true;
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandler.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandler.java
new file mode 100644
index 0000000..2853645
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandler.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2000-2014 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.keymap.impl;
+
+import com.intellij.ide.DataManager;
+import com.intellij.ide.IdeEventQueue;
+import com.intellij.openapi.actionSystem.ActionManager;
+import com.intellij.openapi.actionSystem.ActionPlaces;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.keymap.KeymapManager;
+import com.intellij.openapi.util.Clock;
+import com.intellij.openapi.util.Couple;
+import com.intellij.openapi.wm.IdeFocusManager;
+import com.intellij.util.containers.ConcurrentHashMap;
+import gnu.trove.TIntIntHashMap;
+import gnu.trove.TIntIntProcedure;
+import org.jetbrains.annotations.NotNull;
+
+import java.awt.*;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * Support for keyboard shortcuts like Control-double-click or Control-double-click+A
+ */
+public class ModifierKeyDoubleClickHandler {
+ private static final ModifierKeyDoubleClickHandler INSTANCE = new ModifierKeyDoubleClickHandler();
+
+ private final ConcurrentMap<String, IdeEventQueue.EventDispatcher> myDispatchers = new ConcurrentHashMap<String, IdeEventQueue.EventDispatcher>();
+
+ private ModifierKeyDoubleClickHandler() { }
+
+ public static ModifierKeyDoubleClickHandler getInstance() {
+ return INSTANCE;
+ }
+
+ /**
+ * @param actionId Id of action to be triggered on modifier+modifier[+actionKey]
+ * @param modifierKeyCode keyCode for modifier, e.g. KeyEvent.VK_SHIFT
+ * @param actionKeyCode keyCode for actionKey, or -1 if action should be triggered on bare modifier double click
+ */
+ public void registerAction(@NotNull String actionId,
+ int modifierKeyCode,
+ int actionKeyCode) {
+ final MyDispatcher dispatcher = new MyDispatcher(actionId, modifierKeyCode, actionKeyCode);
+ IdeEventQueue.EventDispatcher oldDispatcher = myDispatchers.put(actionId, dispatcher);
+ IdeEventQueue.getInstance().addDispatcher(dispatcher, null);
+ if (oldDispatcher != null) {
+ IdeEventQueue.getInstance().removeDispatcher(oldDispatcher);
+ }
+ }
+
+ public void unregisterAction(@NotNull String actionId) {
+ IdeEventQueue.EventDispatcher oldDispatcher = myDispatchers.remove(actionId);
+ if (oldDispatcher != null) {
+ IdeEventQueue.getInstance().removeDispatcher(oldDispatcher);
+ }
+ }
+
+ private static class MyDispatcher implements IdeEventQueue.EventDispatcher {
+ private static final TIntIntHashMap KEY_CODE_TO_MODIFIER_MAP = new TIntIntHashMap();
+ static {
+ KEY_CODE_TO_MODIFIER_MAP.put(KeyEvent.VK_ALT, InputEvent.ALT_MASK);
+ KEY_CODE_TO_MODIFIER_MAP.put(KeyEvent.VK_CONTROL, InputEvent.CTRL_MASK);
+ KEY_CODE_TO_MODIFIER_MAP.put(KeyEvent.VK_META, InputEvent.META_MASK);
+ KEY_CODE_TO_MODIFIER_MAP.put(KeyEvent.VK_SHIFT, InputEvent.SHIFT_MASK);
+ }
+
+ private final String myActionId;
+ private final int myModifierKeyCode;
+ private final int myActionKeyCode;
+
+ private final Couple<AtomicBoolean> ourPressed = Couple.of(new AtomicBoolean(false), new AtomicBoolean(false));
+ private final Couple<AtomicBoolean> ourReleased = Couple.of(new AtomicBoolean(false), new AtomicBoolean(false));
+ private final AtomicBoolean ourOtherKeyWasPressed = new AtomicBoolean(false);
+ private final AtomicLong ourLastTimePressed = new AtomicLong(0);
+
+ public MyDispatcher(@NotNull String actionId, int modifierKeyCode, int actionKeyCode) {
+ myActionId = actionId;
+ myModifierKeyCode = modifierKeyCode;
+ myActionKeyCode = actionKeyCode;
+ }
+
+ @Override
+ public boolean dispatch(AWTEvent event) {
+ if (event instanceof KeyEvent) {
+ final KeyEvent keyEvent = (KeyEvent)event;
+ final int keyCode = keyEvent.getKeyCode();
+
+ if (keyCode == myModifierKeyCode) {
+ if (hasOtherModifiers(keyEvent)) {
+ resetState();
+ return false;
+ }
+ if (ourOtherKeyWasPressed.get() && Clock.getTime() - ourLastTimePressed.get() < 500) {
+ resetState();
+ return false;
+ }
+ ourOtherKeyWasPressed.set(false);
+ if (ourPressed.first.get() && Clock.getTime() - ourLastTimePressed.get() > 500) {
+ resetState();
+ }
+ handleModifier((KeyEvent)event);
+ return false;
+ } else if (ourPressed.first.get() && ourReleased.first.get() && ourPressed.second.get() && myActionKeyCode != -1) {
+ if (keyCode == myActionKeyCode) {
+ if (event.getID() == KeyEvent.KEY_RELEASED) {
+ run(keyEvent);
+ }
+ return true;
+ }
+ return false;
+ } else {
+ ourLastTimePressed.set(Clock.getTime());
+ ourOtherKeyWasPressed.set(true);
+ if (keyCode == KeyEvent.VK_ESCAPE || keyCode == KeyEvent.VK_TAB) {
+ ourLastTimePressed.set(0);
+ }
+ }
+ resetState();
+ }
+ return false;
+ }
+
+ private boolean hasOtherModifiers(KeyEvent keyEvent) {
+ final int modifiers = keyEvent.getModifiers();
+ return !KEY_CODE_TO_MODIFIER_MAP.forEachEntry(new TIntIntProcedure() {
+ @Override
+ public boolean execute(int keyCode, int modifierMask) {
+ return keyCode == myModifierKeyCode || (modifiers & modifierMask) == 0;
+ }
+ });
+ }
+
+ private void handleModifier(KeyEvent event) {
+ if (ourPressed.first.get() && Clock.getTime() - ourLastTimePressed.get() > 300) {
+ resetState();
+ return;
+ }
+
+ if (event.getID() == KeyEvent.KEY_PRESSED) {
+ if (!ourPressed.first.get()) {
+ resetState();
+ ourPressed.first.set(true);
+ ourLastTimePressed.set(Clock.getTime());
+ return;
+ } else {
+ if (ourPressed.first.get() && ourReleased.first.get()) {
+ ourPressed.second.set(true);
+ ourLastTimePressed.set(Clock.getTime());
+ return;
+ }
+ }
+ } else if (event.getID() == KeyEvent.KEY_RELEASED) {
+ if (ourPressed.first.get() && !ourReleased.first.get()) {
+ ourReleased.first.set(true);
+ ourLastTimePressed.set(Clock.getTime());
+ return;
+ } else if (ourPressed.first.get() && ourReleased.first.get() && ourPressed.second.get()) {
+ resetState();
+ if (myActionKeyCode == -1 && !isActionBound()) {
+ run(event);
+ }
+ return;
+ }
+ }
+ resetState();
+ }
+
+ private void resetState() {
+ ourPressed.first.set(false);
+ ourPressed.second.set(false);
+ ourReleased.first.set(false);
+ ourReleased.second.set(false);
+ }
+
+ private void run(KeyEvent event) {
+ final ActionManager actionManager = ActionManager.getInstance();
+ final AnAction action = actionManager.getAction(myActionId);
+ final AnActionEvent anActionEvent = new AnActionEvent(event,
+ DataManager.getInstance().getDataContext(IdeFocusManager.findInstance().getFocusOwner()),
+ ActionPlaces.MAIN_MENU,
+ action.getTemplatePresentation(),
+ actionManager,
+ 0);
+ action.actionPerformed(anActionEvent);
+ }
+
+ private boolean isActionBound() {
+ return KeymapManager.getInstance().getActiveKeymap().getShortcuts(myActionId).length > 0;
+ }
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/openapi/options/ConfigurableBase.java b/platform/platform-impl/src/com/intellij/openapi/options/ConfigurableBase.java
new file mode 100644
index 0000000..104dc7b
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/openapi/options/ConfigurableBase.java
@@ -0,0 +1,52 @@
+package com.intellij.openapi.options;
+
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+public abstract class ConfigurableBase<UI extends ConfigurableUi<S>, S> implements SearchableConfigurable, Configurable.NoScroll {
+ private UI ui;
+
+ @Nullable
+ @Override
+ public Runnable enableSearch(String option) {
+ return null;
+ }
+
+ protected abstract S getSettings();
+
+ @Override
+ public void reset() {
+ if (ui != null) {
+ ui.reset(getSettings());
+ }
+ }
+
+ @Nullable
+ @Override
+ public final JComponent createComponent() {
+ if (ui == null) {
+ ui = createUi();
+ }
+ return ui.getComponent();
+ }
+
+ protected abstract UI createUi();
+
+ @Override
+ public final boolean isModified() {
+ return ui != null && ui.isModified(getSettings());
+ }
+
+ @Override
+ public final void apply() {
+ if (ui != null) {
+ ui.apply(getSettings());
+ }
+ }
+
+ @Override
+ public void disposeUIResources() {
+ ui = null;
+ }
+}
\ No newline at end of file
diff --git a/platform/platform-impl/src/com/intellij/openapi/options/ConfigurableUi.java b/platform/platform-impl/src/com/intellij/openapi/options/ConfigurableUi.java
new file mode 100644
index 0000000..e454099
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/openapi/options/ConfigurableUi.java
@@ -0,0 +1,16 @@
+package com.intellij.openapi.options;
+
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+public interface ConfigurableUi<S> {
+ void reset(@NotNull S settings);
+
+ boolean isModified(@NotNull S settings);
+
+ void apply(@NotNull S settings);
+
+ @NotNull
+ JComponent getComponent();
+}
\ No newline at end of file
diff --git a/platform/platform-impl/src/com/intellij/openapi/options/ex/ConfigurableWrapper.java b/platform/platform-impl/src/com/intellij/openapi/options/ex/ConfigurableWrapper.java
index ed72e27..5f8dc0e 100644
--- a/platform/platform-impl/src/com/intellij/openapi/options/ex/ConfigurableWrapper.java
+++ b/platform/platform-impl/src/com/intellij/openapi/options/ex/ConfigurableWrapper.java
@@ -47,8 +47,17 @@
@Nullable
public static <T extends UnnamedConfigurable> T wrapConfigurable(ConfigurableEP<T> ep) {
- if (ep.displayName != null || ep.key != null) {
- return (T)(ep.children != null || ep.childrenEPName != null || ep.dynamic ? new CompositeWrapper(ep) : new ConfigurableWrapper(ep));
+ if (ep.displayName != null || ep.key != null || ep.groupId != null) {
+ T configurable = null;
+ if (ep.providerClass != null) {
+ configurable = ep.createConfigurable();
+ if (configurable == null) {
+ return null; // it is allowed to return null from provider
+ }
+ }
+ return ep.children != null || ep.childrenEPName != null || ep.dynamic
+ ? (T)new CompositeWrapper(ep, configurable)
+ : (T)new ConfigurableWrapper(ep, configurable);
}
else {
return ep.createConfigurable();
@@ -76,8 +85,9 @@
private final ConfigurableEP myEp;
- private ConfigurableWrapper(@NotNull ConfigurableEP ep) {
+ private ConfigurableWrapper(@NotNull ConfigurableEP ep, @Nullable UnnamedConfigurable configurable) {
myEp = ep;
+ myConfigurable = configurable;
}
private UnnamedConfigurable myConfigurable;
@@ -95,6 +105,12 @@
@Nls
@Override
public String getDisplayName() {
+ if (myEp.displayName == null && myEp.key == null) {
+ UnnamedConfigurable configurable = getConfigurable();
+ if (configurable instanceof Configurable) {
+ return ((Configurable)configurable).getDisplayName();
+ }
+ }
return myEp.getDisplayName();
}
@@ -141,16 +157,24 @@
@NotNull
@Override
public String getId() {
- return myEp.id == null ? myEp.instanceClass : myEp.id;
+ return myEp.id == null ? myEp.instanceClass == null ? myEp.providerClass : myEp.instanceClass : myEp.id;
}
+ @NotNull
+ public ConfigurableEP getExtensionPoint() {
+ return myEp;
+ }
+
+ public String getGroupId() {
+ return myEp.groupId;
+ }
public String getParentId() {
return myEp.parentId;
}
public ConfigurableWrapper addChild(Configurable configurable) {
- return new CompositeWrapper(myEp, configurable);
+ return new CompositeWrapper(myEp, null, configurable);
}
@Override
@@ -169,8 +193,8 @@
private Configurable[] myKids;
- private CompositeWrapper(ConfigurableEP ep, Configurable... kids) {
- super(ep);
+ private CompositeWrapper(@NotNull ConfigurableEP ep, @Nullable UnnamedConfigurable configurable, Configurable... kids) {
+ super(ep, configurable);
if (ep.dynamic) {
kids = ((Composite)getConfigurable()).getConfigurables();
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/options/ex/MixedConfigurableGroup.java b/platform/platform-impl/src/com/intellij/openapi/options/ex/MixedConfigurableGroup.java
new file mode 100644
index 0000000..f465e2d
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/openapi/options/ex/MixedConfigurableGroup.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2000-2014 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.options.ex;
+
+import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.options.ConfigurableGroup;
+import com.intellij.openapi.options.OptionsBundle;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map.Entry;
+
+public final class MixedConfigurableGroup implements ConfigurableGroup {
+ private final String myGroupId;
+ private Configurable[] myConfigurables;
+
+ private MixedConfigurableGroup(String groupId, ArrayList<Configurable> configurables) {
+ myGroupId = groupId;
+ myConfigurables = (configurables != null)
+ ? configurables.toArray(new Configurable[configurables.size()])
+ : new Configurable[0];
+ }
+
+ private MixedConfigurableGroup(String groupId, HashMap<String, ArrayList<Configurable>> configurables) {
+ this(groupId, configurables.remove(groupId));
+ }
+
+ @Override
+ public String getDisplayName() {
+ return OptionsBundle.message("configurable.group." + myGroupId + ".settings.display.name");
+ }
+
+ @Override
+ public String getShortName() {
+ return getDisplayName();
+ }
+
+ @Override
+ public Configurable[] getConfigurables() {
+ return myConfigurables;
+ }
+
+ public static ConfigurableGroup[] getGroups(Configurable... configurables) {
+ HashMap<String, ArrayList<Configurable>> map = new HashMap<String, ArrayList<Configurable>>();
+ for (Configurable configurable : configurables) {
+ String groupId = null;
+ if (configurable instanceof ConfigurableWrapper) {
+ groupId = ((ConfigurableWrapper)configurable).getGroupId();
+ }
+ ArrayList<Configurable> list = map.get(groupId);
+ if (list == null) {
+ map.put(groupId, list = new ArrayList<Configurable>());
+ }
+ list.add(configurable);
+ }
+ ArrayList<ConfigurableGroup> groups = new ArrayList<ConfigurableGroup>(map.size());
+ groups.add(new MixedConfigurableGroup("appearance", map));
+ groups.add(new MixedConfigurableGroup("editor", map));
+ groups.add(new MixedConfigurableGroup("project", map));
+ groups.add(new MixedConfigurableGroup("build", map));
+ groups.add(new MixedConfigurableGroup("language", map));
+ groups.add(new MixedConfigurableGroup("tools", map));
+ ConfigurableGroup other = new MixedConfigurableGroup(null, map);
+ for(Entry<String, ArrayList<Configurable>>entry: map.entrySet()){
+ groups.add(new MixedConfigurableGroup(entry.getKey(), entry.getValue()));
+ }
+ groups.add(other);
+ return groups.toArray(new ConfigurableGroup[groups.size()]);
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsTree.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsTree.java
index bd84313..5524df2 100644
--- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsTree.java
+++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsTree.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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,15 +15,19 @@
*/
package com.intellij.openapi.options.newEditor;
+import com.intellij.icons.AllIcons;
import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurableGroup;
+import com.intellij.openapi.options.OptionsBundle;
import com.intellij.openapi.options.SearchableConfigurable;
+import com.intellij.openapi.options.ex.ConfigurableWrapper;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.*;
import com.intellij.ui.components.panels.NonOpaquePanel;
import com.intellij.ui.treeStructure.*;
@@ -287,7 +291,7 @@
class Renderer extends GroupedElementsRenderer.Tree {
-
+ private JLabel myProjectIcon;
private JLabel myHandle;
@Override
@@ -304,6 +308,9 @@
myHandle.setOpaque(false);
content.add(myHandle, BorderLayout.WEST);
content.add(myComponent, BorderLayout.CENTER);
+ myProjectIcon = new JLabel(" ", AllIcons.General.ProjectConfigurable, SwingConstants.LEFT);
+ myProjectIcon.setOpaque(true);
+ content.add(myProjectIcon, BorderLayout.EAST);
myRendererComponent.add(content, BorderLayout.CENTER);
}
@@ -393,10 +400,39 @@
myTextLabel.setForeground(selected ? UIUtil.getTreeSelectionForeground() : fg);
myTextLabel.setOpaque(selected);
+ if (Registry.is("ide.file.settings.order.new")) {
+ myTextLabel.setBorder(new EmptyBorder(1,2,1,0));
+ }
+ Project project = getConfigurableProject(base);
+ if (project != null && Registry.is("ide.file.settings.order.new")) {
+ myProjectIcon.setBackground(selected ? getSelectionBackground() : getBackground());
+ myProjectIcon.setVisible(true);
+ tree.setToolTipText(OptionsBundle.message(project.isDefault()
+ ? "configurable.default.project.tooltip"
+ : "configurable.current.project.tooltip"));
+ } else {
+ myProjectIcon.setVisible(false);
+ tree.setToolTipText(null);
+ }
return result;
}
+ private Project getConfigurableProject(SimpleNode node) {
+ if (node == null) {
+ return null;
+ }
+ if (node instanceof EditorNode) {
+ EditorNode editor = (EditorNode)node;
+ Configurable configurable = editor.getConfigurable();
+ if (configurable instanceof ConfigurableWrapper) {
+ ConfigurableWrapper wrapper = (ConfigurableWrapper)configurable;
+ return wrapper.getExtensionPoint().getProject();
+ }
+ }
+ return getConfigurableProject(node.getParent());
+ }
+
protected JComponent createItemComponent() {
myTextLabel = new ErrorLabel();
return myTextLabel;
@@ -602,6 +638,12 @@
private MyTree() {
getInputMap().clear();
+ setOpaque(true);
+ }
+
+ @Override
+ protected boolean paintNodes() {
+ return false;
}
@Override
diff --git a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java
index c79e411..2f95c21 100644
--- a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java
@@ -752,8 +752,11 @@
message = ProjectBundle.message("project.reload.external.change.multiple", filesBuilder.toString());
}
- return Messages.showTwoStepConfirmationDialog(message, ProjectBundle.message("project.reload.external.change.title"), "Reload project",
- Messages.getQuestionIcon()) == 0;
+ return Messages.showDialog(message,
+ ProjectBundle.message("project.reload.external.change.title"),
+ new String[]{"&Reload Project", "&Discard Changes"},
+ -1,
+ Messages.getQuestionIcon()) == 0;
}
@Override
diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/PluginUpdateInfoPanel.form b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/PluginUpdateInfoPanel.form
index 167e5ef..0e86bad 100644
--- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/PluginUpdateInfoPanel.form
+++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/PluginUpdateInfoPanel.form
@@ -20,7 +20,7 @@
<grid id="3559e" binding="myPluginsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
- <gridbag top="3" left="0" bottom="3" right="0" weightx="1.0" weighty="0.0"/>
+ <gridbag top="3" left="0" bottom="3" right="0" weightx="1.0" weighty="1.0"/>
</constraints>
<properties>
<autoscrolls value="false"/>
@@ -41,12 +41,6 @@
<contentType value="text/html"/>
</properties>
</component>
- <vspacer id="bf1d9">
- <constraints>
- <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
- <gridbag weightx="0.0" weighty="1.0"/>
- </constraints>
- </vspacer>
</children>
</grid>
</form>
diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java
index f734654..8d00a82 100644
--- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java
+++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java
@@ -120,9 +120,6 @@
}
});
}
- else if (!isUpToDate(myExecutable)) {
- notifyOnFailure(ApplicationBundle.message("watcher.exe.outdated"), null);
- }
else {
try {
startupProcess(false);
@@ -181,30 +178,16 @@
@Nullable
private static File getExecutable() {
- String execPath = null;
+ String execPath = System.getProperty(PROPERTY_WATCHER_EXECUTABLE_PATH);
+ if (execPath != null) return new File(execPath);
- final String altExecPath = System.getProperty(PROPERTY_WATCHER_EXECUTABLE_PATH);
- if (altExecPath != null && new File(altExecPath).isFile()) {
- execPath = FileUtil.toSystemDependentName(altExecPath);
- }
+ String execName = getExecutableName(false);
+ if (execName == null) return null;
- if (execPath == null) {
- final String execName = getExecutableName(false);
- if (execName == null) {
- return null;
- }
- execPath = FileUtil.join(PathManager.getBinPath(), execName);
- }
-
- File exec = new File(execPath);
- if (!exec.exists()) {
- String homePath = PathManager.getHomePath();
- if (new File(homePath, "community").exists()) {
- homePath += File.separator + "community";
- }
- exec = new File(FileUtil.join(homePath, "bin", getExecutableName(true)));
- }
- return exec;
+ return FileUtil.findFirstThatExist(
+ FileUtil.join(PathManager.getBinPath(), execName),
+ FileUtil.join(PathManager.getHomePath(), "community", "bin", getExecutableName(true)),
+ FileUtil.join(PathManager.getBinPath(), getExecutableName(true)));
}
@Nullable
@@ -215,14 +198,6 @@
return null;
}
- private static boolean isUpToDate(File executable) {
- long length = SystemInfo.isWindows ? 71208 :
- SystemInfo.isMac ? 13984 :
- SystemInfo.isLinux ? SystemInfo.isAMD64 ? 29155 : 22791 :
- -1;
- return length < 0 || length == executable.length();
- }
-
public void notifyOnFailure(final String cause, @Nullable final NotificationListener listener) {
LOG.warn(cause);
@@ -580,8 +555,11 @@
case CREATE:
case DELETE:
for (String p : paths) {
+ myDirtyPaths.dirtyPaths.add(p);
String parentPath = new File(p).getParent();
- myDirtyPaths.dirtyPaths.add(parentPath != null ? parentPath : p);
+ if (parentPath != null) {
+ myDirtyPaths.dirtyPaths.add(parentPath);
+ }
}
break;
diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java
index 72cd066..b05b7a2 100644
--- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java
+++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java
@@ -1338,7 +1338,11 @@
private static final MessageDigest myDigest = ContentHashesUtil.createHashDigest();
public static void writeContent(int fileId, ByteSequence bytes, boolean readOnly) throws IOException {
- new ContentOutputStream(fileId, readOnly).writeBytes(bytes);
+ try {
+ new ContentOutputStream(fileId, readOnly).writeBytes(bytes);
+ } catch (Throwable e) {
+ throw DbConnection.handleError(e);
+ }
}
public static int storeUnlinkedContent(byte[] bytes) {
diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/FocusManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/FocusManagerImpl.java
index 36a79f2..c302cce 100644
--- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/FocusManagerImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/FocusManagerImpl.java
@@ -195,7 +195,7 @@
@Override
@NotNull
public ActionCallback requestFocus(@NotNull final Component c, final boolean forced) {
- return requestFocus(new FocusCommand.ByComponent(c), forced);
+ return requestFocus(new FocusCommand.ByComponent(c, new Exception()), forced);
}
@Override
@@ -1148,7 +1148,7 @@
}
if (toFocus != null) {
- return requestFocus(new FocusCommand.ByComponent(toFocus).setToInvalidateRequestors(false), forced);
+ return requestFocus(new FocusCommand.ByComponent(toFocus, new Exception()).setToInvalidateRequestors(false), forced);
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButton.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButton.java
index 7d534d5..f62ff2c 100644
--- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButton.java
+++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButton.java
@@ -30,6 +30,7 @@
import com.intellij.openapi.wm.ToolWindowAnchor;
import com.intellij.ui.MouseDragHelper;
import com.intellij.ui.PopupHandler;
+import com.intellij.util.ui.JBImageIcon;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -183,12 +184,22 @@
if (myDragPane == null) return;
final BufferedImage image = UIUtil.createImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB);
paint(image.getGraphics());
- myDragButtonImage = new JLabel(new ImageIcon(image)) {
+ myDragButtonImage = new JLabel(new JBImageIcon(image)) {
public String toString() {
return "Image for: " + StripeButton.this.toString();
}
};
+
+ myDragButtonImage.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseReleased(MouseEvent e) {
+ finishDragging();
+ myPressedPoint = null;
+ myDragButtonImage = null;
+ super.mouseReleased(e);
+ }
+ });
myDragPane.add(myDragButtonImage, JLayeredPane.POPUP_LAYER);
myDragButtonImage.setSize(myDragButtonImage.getPreferredSize());
setVisible(false);
diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/TestWindowManager.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/TestWindowManager.java
index b2fc056..aa7d022 100644
--- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/TestWindowManager.java
+++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/TestWindowManager.java
@@ -22,6 +22,7 @@
import com.intellij.openapi.ui.MessageType;
import com.intellij.openapi.ui.popup.BalloonHandler;
import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.wm.IdeFrame;
import com.intellij.openapi.wm.StatusBar;
@@ -38,14 +39,16 @@
import java.awt.*;
import java.awt.event.ComponentEvent;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author Anton Katilin
* @author Vladimir Kondratyev
*/
public final class TestWindowManager extends WindowManagerEx {
- private static final StatusBarEx ourStatusBar = new DummyStatusBar();
+ private static final Key<StatusBar> STATUS_BAR = Key.create("STATUS_BAR");
public final void doNotSuggestAsParent(final Window window) { }
@@ -66,7 +69,13 @@
@Override
public final StatusBar getStatusBar(final Project project) {
- return ourStatusBar;
+ synchronized (STATUS_BAR) {
+ StatusBar statusBar = project.getUserData(STATUS_BAR);
+ if (statusBar == null) {
+ project.putUserData(STATUS_BAR, statusBar = new DummyStatusBar());
+ }
+ return statusBar;
+ }
}
@Override
@@ -86,6 +95,8 @@
public void resetWindow(final Window window) { }
private static final class DummyStatusBar implements StatusBarEx {
+ private final Map<String, StatusBarWidget> myWidgetMap = new HashMap<String, StatusBarWidget>();
+
@Override
public Dimension getSize() {
return new Dimension(0, 0);
@@ -140,33 +151,39 @@
}
@Override
+ public void addWidget(@NotNull StatusBarWidget widget) {
+ myWidgetMap.put(widget.ID(), widget);
+ }
+
+ @Override
+ public void addWidget(@NotNull StatusBarWidget widget, @NotNull String anchor) {
+ addWidget(widget);
+ }
+
+ @Override
public void addWidget(@NotNull StatusBarWidget widget, @NotNull Disposable parentDisposable) {
Disposer.register(parentDisposable, widget);
+ addWidget(widget);
}
@Override
public void addWidget(@NotNull StatusBarWidget widget, @NotNull String anchor, @NotNull Disposable parentDisposable) {
Disposer.register(parentDisposable, widget);
+ addWidget(widget);
}
@Override
public void updateWidgets() { }
@Override
- public void addWidget(@NotNull StatusBarWidget widget) { }
-
- @Override
public void dispose() { }
@Override
- public void addWidget(@NotNull StatusBarWidget widget, @NotNull String anchor) { }
-
- @Override
public void updateWidget(@NotNull String id) { }
@Override
public StatusBarWidget getWidget(String id) {
- return null;
+ return myWidgetMap.get(id);
}
@Override
diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java
index ae1e533..efcdd14 100644
--- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java
@@ -357,7 +357,7 @@
ApplicationManager.getApplication().assertIsDispatchThread();
final Icon oldIcon = getIcon();
if (oldIcon != icon && !(icon instanceof LayeredIcon) && (icon.getIconHeight() != 13 || icon.getIconWidth() != 13)) {
- LOG.warn("ToolWindow icons should be 13x13. Please fix " + icon);
+ LOG.warn("ToolWindow icons should be 13x13. Please fix ToolWindow (ID: " + getId() + ") or icon " + icon);
}
getSelectedContent().setIcon(icon);
myIcon = icon;
diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/RequestFocusInToolWindowCmd.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/RequestFocusInToolWindowCmd.java
index d58d3b9..c8f5421 100644
--- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/RequestFocusInToolWindowCmd.java
+++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/RequestFocusInToolWindowCmd.java
@@ -184,7 +184,7 @@
}).notify(result);
}
else {
- myManager.getFocusManager().requestFocus(new FocusCommand.ByComponent(c, myToolWindow.getComponent()), myForced)
+ myManager.getFocusManager().requestFocus(new FocusCommand.ByComponent(c, myToolWindow.getComponent(), new Exception()), myForced)
.doWhenProcessed(new Runnable() {
@Override
public void run() {
diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java
index 84b6e6a7..e00c195 100644
--- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java
+++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java
@@ -368,7 +368,8 @@
myRefreshAndInfoPanel.revalidate();
myRefreshAndInfoPanel.repaint();
- if (UISettings.getInstance().PRESENTATION_MODE) {
+ UISettings uiSettings = UISettings.getInstance();
+ if (uiSettings.PRESENTATION_MODE || !uiSettings.SHOW_STATUS_BAR && Registry.is("ide.show.progress.without.status.bar")) {
final JRootPane pane = myInfoPanel.getRootPane();
final RelativePoint point = new RelativePoint(pane, new Point(pane.getWidth() - 250, 60));
final PresentationModeProgressPanel panel = new PresentationModeProgressPanel(inline);
diff --git a/platform/platform-impl/src/com/intellij/remote/PathMappingProvider.java b/platform/platform-impl/src/com/intellij/remote/PathMappingProvider.java
index 2d4a76f..4e5482d 100644
--- a/platform/platform-impl/src/com/intellij/remote/PathMappingProvider.java
+++ b/platform/platform-impl/src/com/intellij/remote/PathMappingProvider.java
@@ -5,7 +5,6 @@
import com.google.common.collect.Lists;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.util.PathMappingSettings;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -33,8 +32,4 @@
@NotNull
public abstract PathMappingSettings getPathMappingSettings(@NotNull Project project, @NotNull RemoteSdkAdditionalData data);
-
- @Deprecated //Remove in IDEA 14
- @NotNull
- public abstract PathMappingSettings getPathMapping(@NotNull Project project, @NotNull com.intellij.remotesdk.RemoteSdkAdditionalData data);
}
diff --git a/platform/platform-impl/src/com/intellij/remote/RemoteFile.java b/platform/platform-impl/src/com/intellij/remote/RemoteFile.java
index 4a2e113..724ec31 100644
--- a/platform/platform-impl/src/com/intellij/remote/RemoteFile.java
+++ b/platform/platform-impl/src/com/intellij/remote/RemoteFile.java
@@ -2,7 +2,6 @@
import com.intellij.openapi.util.io.FileUtil;
import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/**
* @author traff
@@ -25,14 +24,14 @@
this(resolveChild(parent, child, isWin), isWin);
}
- @Nullable
+ @NotNull
public String getName() {
int ind = myPath.lastIndexOf(getSeparator(myWin));
if (ind != -1 && ind < myPath.length() - 1) { //not last char
return myPath.substring(ind + 1);
}
else {
- return null;
+ return myPath;
}
}
@@ -88,6 +87,10 @@
return detectSystemByPath(path).createRemoteFile(path, script);
}
+ public static RemoteFile createRemoteFile(String path) {
+ return detectSystemByPath(path).createRemoteFile(path);
+ }
+
public static RemoteFile createRemoteFile(final String path, final String script, final boolean isWindows) {
return new RemoteFileBuilder(isWindows).createRemoteFile(path, script);
}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/MutableRemoteCredentials.java b/platform/platform-impl/src/com/intellij/remotesdk/MutableRemoteCredentials.java
deleted file mode 100644
index 0b630fe..0000000
--- a/platform/platform-impl/src/com/intellij/remotesdk/MutableRemoteCredentials.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2000-2014 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.remotesdk;
-
-/**
- * @deprecated Remove in IDEA 14
- * @author traff
- */
-public interface MutableRemoteCredentials extends com.intellij.remote.MutableRemoteCredentials {
-}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentialsHolder.java b/platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentialsHolder.java
deleted file mode 100644
index 8860529..0000000
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentialsHolder.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2000-2014 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.remotesdk;
-
-/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
- */
-public class RemoteCredentialsHolder extends com.intellij.remote.RemoteCredentialsHolder {
-}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteFile.java b/platform/platform-impl/src/com/intellij/remotesdk/RemoteFile.java
deleted file mode 100644
index 73274cc..0000000
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteFile.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2000-2014 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.remotesdk;
-
-import org.jetbrains.annotations.NotNull;
-
-/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
- */
-public class RemoteFile extends com.intellij.remote.RemoteFile {
-
- public RemoteFile(@NotNull String path, boolean isWin) {
- super(path, isWin);
- }
-
- public RemoteFile(@NotNull String parent, String child) {
- super(parent, child);
- }
-
- public RemoteFile(@NotNull String parent, String child, boolean isWin) {
- super(parent, child, isWin);
- }
-}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteInterpreterException.java b/platform/platform-impl/src/com/intellij/remotesdk/RemoteInterpreterException.java
deleted file mode 100644
index b3d3b35..0000000
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteInterpreterException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2000-2014 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.remotesdk;
-
-import com.intellij.remote.RemoteSdkException;
-
-/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
- */
-public class RemoteInterpreterException extends RemoteSdkException {
- public RemoteInterpreterException(String s, Throwable throwable) {
- super(s, throwable);
- }
-}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteProcessHandlerBase.java b/platform/platform-impl/src/com/intellij/remotesdk/RemoteProcessHandlerBase.java
deleted file mode 100644
index a83d2bd..0000000
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteProcessHandlerBase.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2000-2014 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.remotesdk;
-
-/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
- */
-public interface RemoteProcessHandlerBase extends com.intellij.remote.RemoteProcessHandlerBase {
-}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkAdditionalData.java b/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkAdditionalData.java
deleted file mode 100644
index e4c79ed..0000000
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkAdditionalData.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.intellij.remotesdk;
-
-import com.intellij.openapi.projectRoots.SdkAdditionalData;
-import com.intellij.remote.RemoteSdkCredentials;
-
-/**
- * @deprecated Remove in IDEA 14
- * @author traff
- */
-public interface RemoteSdkAdditionalData extends RemoteSdkCredentials, SdkAdditionalData {
- void completeInitialization();
-}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkDataBuilder.java b/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkDataBuilder.java
deleted file mode 100644
index f2dd2658..0000000
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkDataBuilder.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2000-2014 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.remotesdk;
-
-import com.intellij.remote.RemoteSdkCredentialsBuilder;
-
-/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
- */
-public class RemoteSdkDataBuilder extends RemoteSdkCredentialsBuilder {
-}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkFactory.java b/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkFactory.java
deleted file mode 100644
index 1934d1a..0000000
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkFactory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.remotesdk;
-
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.projectRoots.Sdk;
-import com.intellij.remote.RemoteSdkException;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.awt.*;
-import java.util.Collection;
-
-/**
- * @deprecated Remove in IDEA 14
- * @author traff
- */
-public interface RemoteSdkFactory<T extends RemoteSdkAdditionalData> {
- Sdk createRemoteSdk(@Nullable Project project, @NotNull T data, @Nullable String sdkName, Collection<Sdk> existingSdks)
- throws RemoteInterpreterException;
-
- Sdk createUnfinished(T data, Collection<Sdk> existingSdks);
-
- String getDefaultUnfinishedName();
-
- @NotNull
- String sdkName();
-
- boolean canSaveUnfinished();
-
- void initSdk(@NotNull Sdk sdk, @Nullable Project project, @Nullable Component ownerComponent);
-}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSshProcess.java b/platform/platform-impl/src/com/intellij/remotesdk/RemoteSshProcess.java
deleted file mode 100644
index 3abe39b..0000000
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSshProcess.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2000-2014 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.remotesdk;
-
-/**
- * @deprecated Remove in IDEA 14
- * @author traff
- */
-public abstract class RemoteSshProcess extends com.intellij.remote.RemoteSshProcess {
-}
diff --git a/platform/platform-impl/src/com/intellij/ui/AbstractExpandableItemsHandler.java b/platform/platform-impl/src/com/intellij/ui/AbstractExpandableItemsHandler.java
index 7226ee8..4e65063 100644
--- a/platform/platform-impl/src/com/intellij/ui/AbstractExpandableItemsHandler.java
+++ b/platform/platform-impl/src/com/intellij/ui/AbstractExpandableItemsHandler.java
@@ -54,6 +54,16 @@
myTipComponent = new TipComponent();
+ myTipComponent.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseExited(MouseEvent e) {
+ // don't hide the hint if mouse exited to myComponent
+ if (myComponent.getMousePosition() == null) {
+ hideHint();
+ }
+ }
+ });
+
myComponent.addMouseListener(
new MouseListener() {
@Override
@@ -63,7 +73,10 @@
@Override
public void mouseExited(MouseEvent e) {
- hideHint();
+ // don't hide the hint if mouse exited to it
+ if (myTipComponent.getMousePosition() == null) {
+ hideHint();
+ }
}
@Override
@@ -319,7 +332,7 @@
g.setClip(null);
doFillBackground(height, width, g);
g.translate(-(visibleRect.x + visibleRect.width - cellBounds.x), 0);
- doPaintTooltipImage(renderer, cellBounds, height, g, key);
+ doPaintTooltipImage(renderer, cellBounds, g, key);
if (isPaintBorder()) {
g.translate(visibleRect.x + visibleRect.width - cellBounds.x, 0);
@@ -354,8 +367,8 @@
g.fillRect(0, 0, width, height);
}
- protected void doPaintTooltipImage(Component rComponent, Rectangle cellBounds, int height, Graphics2D g, KeyType key) {
- myRendererPane.paintComponent(g, rComponent, myComponent, 0, 0, cellBounds.width, height, true);
+ protected void doPaintTooltipImage(Component rComponent, Rectangle cellBounds, Graphics2D g, KeyType key) {
+ myRendererPane.paintComponent(g, rComponent, myComponent, 0, 0, cellBounds.width, cellBounds.height, true);
}
protected Rectangle getVisibleRect(KeyType key) {
diff --git a/platform/platform-impl/src/com/intellij/ui/CellRendererPanel.java b/platform/platform-impl/src/com/intellij/ui/CellRendererPanel.java
index 2c33b7c..653aba2 100644
--- a/platform/platform-impl/src/com/intellij/ui/CellRendererPanel.java
+++ b/platform/platform-impl/src/com/intellij/ui/CellRendererPanel.java
@@ -25,6 +25,9 @@
* @author gregsh
*/
public class CellRendererPanel extends JPanel {
+ public CellRendererPanel() {
+ super(null); // we do the layout ourselves
+ }
// property change support ----------------
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
@@ -46,7 +49,10 @@
@Override
public void doLayout() {
if (getComponentCount() != 1) return;
- getComponent(0).setBounds(0, 0, getWidth(), getHeight());
+ Insets insets = getInsets();
+ getComponent(0).setBounds(insets.left, insets.top,
+ getWidth() - insets.left - insets.right,
+ getHeight() - insets.top - insets.bottom);
}
@Override
diff --git a/platform/platform-impl/src/com/intellij/ui/ColorChooserServiceImpl.java b/platform/platform-impl/src/com/intellij/ui/ColorChooserServiceImpl.java
index 4bc4213..355c2a8 100644
--- a/platform/platform-impl/src/com/intellij/ui/ColorChooserServiceImpl.java
+++ b/platform/platform-impl/src/com/intellij/ui/ColorChooserServiceImpl.java
@@ -15,10 +15,11 @@
*/
package com.intellij.ui;
-import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.Nullable;
import java.awt.*;
+import java.util.Arrays;
+import java.util.List;
/**
* @author Konstantin Bulenkov
@@ -31,7 +32,7 @@
Color preselectedColor,
boolean enableOpacity,
ColorPickerListener[] listeners) {
- return ColorPicker.showDialog(parent, caption, preselectedColor, enableOpacity, listeners, false);
+ return showDialog(parent, caption, preselectedColor, enableOpacity, Arrays.asList(listeners), false);
}
@Nullable
@@ -42,6 +43,17 @@
boolean enableOpacity,
ColorPickerListener[] listeners,
boolean opacityInPercent) {
+ return showDialog(parent, caption, preselectedColor, enableOpacity, Arrays.asList(listeners), opacityInPercent);
+ }
+
+ @Nullable
+ @Override
+ public Color showDialog(Component parent,
+ String caption,
+ Color preselectedColor,
+ boolean enableOpacity,
+ List<ColorPickerListener> listeners,
+ boolean opacityInPercent) {
return ColorPicker.showDialog(parent, caption, preselectedColor, enableOpacity, listeners, opacityInPercent);
}
}
diff --git a/platform/platform-impl/src/com/intellij/ui/ColorPicker.java b/platform/platform-impl/src/com/intellij/ui/ColorPicker.java
index d78e681..e7b9368 100644
--- a/platform/platform-impl/src/com/intellij/ui/ColorPicker.java
+++ b/platform/platform-impl/src/com/intellij/ui/ColorPicker.java
@@ -46,6 +46,7 @@
import java.awt.image.MemoryImageSource;
import java.text.ParseException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -64,7 +65,7 @@
private final JTextField myBlue;
private final JTextField myHex;
private final Alarm myUpdateQueue;
- private final ColorPickerListener[] myExternalListeners;
+ private final List<ColorPickerListener> myExternalListeners;
private final boolean myOpacityInPercent;
@@ -88,13 +89,13 @@
};
public ColorPicker(@NotNull Disposable parent, @Nullable Color color, boolean enableOpacity) {
- this(parent, color, true, enableOpacity, new ColorPickerListener[0], false);
+ this(parent, color, true, enableOpacity, Collections.<ColorPickerListener>emptyList(), false);
}
private ColorPicker(Disposable parent,
@Nullable Color color,
boolean restoreColors, boolean enableOpacity,
- ColorPickerListener[] listeners, boolean opacityInPercent) {
+ List<ColorPickerListener> listeners, boolean opacityInPercent) {
myUpdateQueue = new Alarm(Alarm.ThreadToUse.SWING_THREAD, parent);
myRed = createColorField(false);
myGreen = createColorField(false);
@@ -332,7 +333,7 @@
String caption,
Color preselectedColor,
boolean enableOpacity,
- ColorPickerListener[] listeners,
+ List<ColorPickerListener> listeners,
boolean opacityInPercent) {
final ColorPickerDialog dialog = new ColorPickerDialog(parent, caption, preselectedColor, enableOpacity, listeners, opacityInPercent);
dialog.show();
@@ -884,7 +885,7 @@
static class ColorPickerDialog extends DialogWrapper {
private final Color myPreselectedColor;
- private final ColorPickerListener[] myListeners;
+ private final List<ColorPickerListener> myListeners;
private ColorPicker myColorPicker;
private final boolean myEnableOpacity;
private ColorPipette myPicker;
@@ -894,7 +895,7 @@
String caption,
@Nullable Color preselectedColor,
boolean enableOpacity,
- ColorPickerListener[] listeners,
+ List<ColorPickerListener> listeners,
boolean opacityInPercent) {
super(parent, true);
myListeners = listeners;
diff --git a/platform/platform-impl/src/com/intellij/ui/ColorPickerListenerFactory.java b/platform/platform-impl/src/com/intellij/ui/ColorPickerListenerFactory.java
index 6f1c047..dbed5e5 100644
--- a/platform/platform-impl/src/com/intellij/ui/ColorPickerListenerFactory.java
+++ b/platform/platform-impl/src/com/intellij/ui/ColorPickerListenerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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,29 +17,32 @@
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.psi.PsiElement;
-import com.intellij.util.Function;
+import com.intellij.util.SmartList;
import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
-/**
- * User: ksafonov
- */
public abstract class ColorPickerListenerFactory {
private static final ExtensionPointName<ColorPickerListenerFactory> EP_NAME =
ExtensionPointName.create("com.intellij.colorPickerListenerFactory");
- public static ColorPickerListener[] createListenersFor(@Nullable final PsiElement element) {
- final List<ColorPickerListener> listeners =
- ContainerUtil.mapNotNull(EP_NAME.getExtensions(), new Function<ColorPickerListenerFactory, ColorPickerListener>() {
- @Override
- public ColorPickerListener fun(ColorPickerListenerFactory factory) {
- return factory.createListener(element);
+ @NotNull
+ public static List<ColorPickerListener> createListenersFor(@Nullable PsiElement element) {
+ List<ColorPickerListener> listeners = null;
+ for (ColorPickerListenerFactory factory : EP_NAME.getExtensions()) {
+ ColorPickerListener listener = factory.createListener(element);
+ if (listener != null) {
+ if (listeners == null) {
+ listeners = new SmartList<ColorPickerListener>();
}
- });
- return listeners.toArray(new ColorPickerListener[listeners.size()]);
+ listeners.add(listener);
+ }
+ }
+ return ContainerUtil.notNullize(listeners);
}
+ @Nullable
public abstract ColorPickerListener createListener(@Nullable PsiElement element);
}
diff --git a/platform/platform-impl/src/com/intellij/ui/EditorTextFieldCellRenderer.java b/platform/platform-impl/src/com/intellij/ui/EditorTextFieldCellRenderer.java
index e803fa5..d11e990 100644
--- a/platform/platform-impl/src/com/intellij/ui/EditorTextFieldCellRenderer.java
+++ b/platform/platform-impl/src/com/intellij/ui/EditorTextFieldCellRenderer.java
@@ -57,39 +57,39 @@
protected abstract EditorColorsScheme getColorScheme();
- protected abstract String getText(JTable table, Object value, int row, int column);
+ protected abstract String getText(FontMetrics fontMetrics, JTable table, Object value, int row, int column);
protected void customizeEditor(EditorEx editor, Object value, boolean selected, int row, int col) {
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
- String text = getText(table, value, row, column);
MyPanel panel = getEditorPanel(table);
EditorEx editor = panel.editor;
int tableFontSize = table.getFont().getSize();
if (editor.getColorsScheme().getEditorFontSize() != tableFontSize) {
editor.getColorsScheme().setEditorFontSize(tableFontSize);
}
- setText(editor, text);
+ setText(editor, getText(((EditorImpl)editor).getFontMetrics(Font.PLAIN), table, value, row, column));
- if (isSelected) {
- ((EditorImpl)editor).setPaintSelection(true);
- editor.getColorsScheme().setColor(EditorColors.SELECTION_BACKGROUND_COLOR, table.getSelectionBackground());
- editor.getColorsScheme().setColor(EditorColors.SELECTION_FOREGROUND_COLOR, table.getSelectionForeground());
- editor.getSelectionModel().setSelection(0, editor.getDocument().getTextLength());
- editor.setBackgroundColor(table.getSelectionBackground());
- }
- else {
- ((EditorImpl)editor).setPaintSelection(false);
- editor.getSelectionModel().setSelection(0, 0);
- boolean selectedRow = table.getSelectedRowCount() > 0 && table.getSelectedRows()[table.getSelectedRowCount() - 1] == row;
- editor.setBackgroundColor(!selectedRow ? table.getBackground() : getColorScheme().getColor(EditorColors.CARET_ROW_COLOR));
- }
+ ((EditorImpl)editor).setPaintSelection(isSelected);
+ editor.getSelectionModel().setSelection(0, isSelected ? editor.getDocument().getTextLength() : 0);
+ editor.getColorsScheme().setColor(EditorColors.SELECTION_BACKGROUND_COLOR, table.getSelectionBackground());
+ editor.getColorsScheme().setColor(EditorColors.SELECTION_FOREGROUND_COLOR, table.getSelectionForeground());
+ editor.setBackgroundColor(getCellBackgroundColor(getColorScheme(), table, isSelected, row));
+
+ panel.setBorder(null); // prevents double border painting when ExtendedItemRendererComponentWrapper is used
+
customizeEditor(editor, value, isSelected, row, column);
return panel;
}
+ public static Color getCellBackgroundColor(EditorColorsScheme colorsScheme, JTable table, boolean isSelected, int row) {
+ return isSelected ? table.getSelectionBackground() :
+ table.getSelectionModel().getLeadSelectionIndex() == row ? colorsScheme.getColor(EditorColors.CARET_ROW_COLOR) :
+ table.getBackground();
+ }
+
@NotNull
private MyPanel getEditorPanel(JTable table) {
MyPanel panel = (MyPanel)table.getClientProperty(MY_PANEL_PROPERTY);
@@ -142,6 +142,16 @@
}
@Override
+ protected void paintComponent(Graphics g) {
+ if (getBorder() == null) return;
+ Color oldColor = g.getColor();
+ Rectangle clip = g.getClipBounds();
+ g.setColor(editor.getBackgroundColor());
+ g.fillRect(clip.x, clip.y, clip.width, clip.height);
+ g.setColor(oldColor);
+ }
+
+ @Override
public void dispose() {
EditorFactory.getInstance().releaseEditor(editor);
}
diff --git a/platform/platform-impl/src/com/intellij/ui/ShowColorPickerAction.java b/platform/platform-impl/src/com/intellij/ui/ShowColorPickerAction.java
index 95f4b7e..5327c84 100644
--- a/platform/platform-impl/src/com/intellij/ui/ShowColorPickerAction.java
+++ b/platform/platform-impl/src/com/intellij/ui/ShowColorPickerAction.java
@@ -18,12 +18,12 @@
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
-import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.IdeFrame;
import com.intellij.openapi.wm.WindowManager;
import javax.swing.*;
+import java.util.List;
/**
* @author Konstantin Bulenkov
@@ -34,9 +34,8 @@
final Project project = e.getProject();
JComponent root = rootComponent(project);
if (root != null) {
- ColorPickerListener[] listeners = ColorPickerListenerFactory.createListenersFor(e.getData(CommonDataKeys.PSI_ELEMENT));
- final ColorPicker.ColorPickerDialog picker =
- new ColorPicker.ColorPickerDialog(root, "Color Picker", null, true, listeners, true);
+ List<ColorPickerListener> listeners = ColorPickerListenerFactory.createListenersFor(e.getData(CommonDataKeys.PSI_ELEMENT));
+ ColorPicker.ColorPickerDialog picker = new ColorPicker.ColorPickerDialog(root, "Color Picker", null, true, listeners, true);
picker.setModal(false);
picker.show();
}
diff --git a/platform/platform-impl/src/com/intellij/ui/Splash.java b/platform/platform-impl/src/com/intellij/ui/Splash.java
index 0f4147f..023cef7 100644
--- a/platform/platform-impl/src/com/intellij/ui/Splash.java
+++ b/platform/platform-impl/src/com/intellij/ui/Splash.java
@@ -44,6 +44,7 @@
*/
public class Splash extends JDialog implements StartupProgress {
@Nullable public static Rectangle BOUNDS;
+
private final Icon myImage;
private int myProgressHeight = 2;
private Color myProgressColor = null;
@@ -84,8 +85,16 @@
}
private void setLocationInTheCenterOfScreen() {
- Rectangle deviceBounds = getGraphicsConfiguration().getBounds();
- setLocation((deviceBounds.width - getWidth()) / 2, (deviceBounds.height - getHeight()) / 2);
+ Rectangle bounds = getGraphicsConfiguration().getBounds();
+ if (SystemInfo.isWindows) {
+ Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(getGraphicsConfiguration());
+ int x = insets.left + (bounds.width - insets.left - insets.right - getWidth()) / 2;
+ int y = insets.top + (bounds.height - insets.top - insets.bottom - getHeight()) / 2;
+ setLocation(x, y);
+ }
+ else {
+ setLocation((bounds.width - getWidth()) / 2, (bounds.height - getHeight()) / 2);
+ }
}
public Splash(ApplicationInfoEx info) {
diff --git a/platform/platform-impl/src/com/intellij/ui/TableExpandableItemsHandler.java b/platform/platform-impl/src/com/intellij/ui/TableExpandableItemsHandler.java
index af4707c..b7704a6 100644
--- a/platform/platform-impl/src/com/intellij/ui/TableExpandableItemsHandler.java
+++ b/platform/platform-impl/src/com/intellij/ui/TableExpandableItemsHandler.java
@@ -106,22 +106,12 @@
}
public Pair<Component, Rectangle> getCellRendererAndBounds(TableCell key) {
- Rectangle cellRect = getCellRect(key);
-
- int modelColumnIndex = myComponent.convertColumnIndexToModel(key.column);
- final int modelRowIndex = myComponent.convertRowIndexToModel(key.row);
- TableModel model = myComponent.getModel();
- if (key.row < 0 || key.row >= model.getRowCount() || key.column < 0 || key.column >= model.getColumnCount()) {
+ if (key.row < 0 || key.row >= myComponent.getRowCount() || key.column < 0 || key.column >= myComponent.getColumnCount()) {
return null;
}
- Component renderer = myComponent
- .getCellRenderer(key.row, key.column)
- .getTableCellRendererComponent(myComponent,
- model.getValueAt(modelRowIndex, modelColumnIndex),
- myComponent.getSelectionModel().isSelectedIndex(key.row),
- myComponent.hasFocus(),
- key.row, key.column);
+ Rectangle cellRect = getCellRect(key);
+ Component renderer = myComponent.prepareRenderer(myComponent.getCellRenderer(key.row, key.column), key.row, key.column);
cellRect.width = renderer.getPreferredSize().width;
return Pair.create(renderer, cellRect);
diff --git a/platform/platform-impl/src/com/intellij/ui/TableSpeedSearch.java b/platform/platform-impl/src/com/intellij/ui/TableSpeedSearch.java
index 93a9d93..b596204 100644
--- a/platform/platform-impl/src/com/intellij/ui/TableSpeedSearch.java
+++ b/platform/platform-impl/src/com/intellij/ui/TableSpeedSearch.java
@@ -55,7 +55,9 @@
@Override
protected boolean isSpeedSearchEnabled() {
- return !getComponent().isEditing() && super.isSpeedSearchEnabled();
+ JTable table = getComponent();
+ boolean tableIsNotEmpty = table.getRowCount() != 0 && table.getColumnCount() != 0;
+ return tableIsNotEmpty && !table.isEditing() && super.isSpeedSearchEnabled();
}
@Override
diff --git a/platform/platform-impl/src/com/intellij/ui/TreeExpandableItemsHandler.java b/platform/platform-impl/src/com/intellij/ui/TreeExpandableItemsHandler.java
index ad54662..b24e10b 100644
--- a/platform/platform-impl/src/com/intellij/ui/TreeExpandableItemsHandler.java
+++ b/platform/platform-impl/src/com/intellij/ui/TreeExpandableItemsHandler.java
@@ -148,7 +148,6 @@
@Override
protected void doPaintTooltipImage(final Component rComponent,
final Rectangle cellBounds,
- final int height,
final Graphics2D g,
Integer key) {
final boolean opaque = rComponent.isOpaque();
@@ -169,7 +168,7 @@
rComponent.setBackground(bg);
}
- super.doPaintTooltipImage(rComponent, cellBounds, height, g, key);
+ super.doPaintTooltipImage(rComponent, cellBounds, g, key);
if (rComponent instanceof JComponent) {
((JComponent)rComponent).setOpaque(opaque);
diff --git a/platform/platform-impl/src/com/intellij/ui/messages/JBMacMessages.java b/platform/platform-impl/src/com/intellij/ui/messages/JBMacMessages.java
index 6ce0375..2a70b61 100644
--- a/platform/platform-impl/src/com/intellij/ui/messages/JBMacMessages.java
+++ b/platform/platform-impl/src/com/intellij/ui/messages/JBMacMessages.java
@@ -73,10 +73,14 @@
Icon icon = errorStyle ? UIUtil.getErrorIcon() : UIUtil.getInformationIcon();
- focusedOptionIndex = (defaultOptionIndex == focusedOptionIndex) ? buttons.length - 1 : focusedOptionIndex;
+ if (focusedOptionIndex != -1) {
+ focusedOptionIndex = (defaultOptionIndex == focusedOptionIndex) ? buttons.length - 1 : focusedOptionIndex;
+ }
- SheetMessage sheetMessage = new SheetMessage(window, title, message, icon, buttons, doNotAskDialogOption, buttons[defaultOptionIndex],
- buttons[focusedOptionIndex]);
+ final String defaultOptionTitle = defaultOptionIndex == -1 ? null : buttons[defaultOptionIndex];
+ final String focusedButtonTitle = focusedOptionIndex == -1 ? null : buttons[focusedOptionIndex];
+
+ final SheetMessage sheetMessage = new SheetMessage(window, title, message, icon, buttons, doNotAskDialogOption, defaultOptionTitle, focusedButtonTitle);
String result = sheetMessage.getResult();
for (int i = 0; i < buttons.length; i++) {
if (result.equals(buttons[i])) {
diff --git a/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java b/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java
index e1c326d..78802cc 100644
--- a/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java
+++ b/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java
@@ -337,7 +337,7 @@
}
public void setShowHints(boolean show) {
- final Window ancestor = SwingUtilities.getWindowAncestor(myComponent);
+ final Window ancestor = getContentWindow(myComponent);
if (ancestor instanceof RootPaneContainer) {
final JRootPane rootPane = ((RootPaneContainer)ancestor).getRootPane();
if (rootPane != null) {
@@ -757,7 +757,33 @@
PopupComponent.Factory factory = getFactory(myForcedHeavyweight || myResizable, forcedDialog);
myNativePopup = factory.isNativePopup();
- myPopup = factory.getPopup(myOwner, myContent, targetBounds.x, targetBounds.y, this);
+ Component popupOwner = myOwner;
+ if (popupOwner instanceof RootPaneContainer) {
+ // JDK uses cached heavyweight popup for a window ancestor
+ RootPaneContainer root = (RootPaneContainer)popupOwner;
+ popupOwner = root.getRootPane();
+ }
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("expected preferred size: " + myContent.getPreferredSize());
+ }
+ myPopup = factory.getPopup(popupOwner, myContent, targetBounds.x, targetBounds.y, this);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug(" actual preferred size: " + myContent.getPreferredSize());
+ }
+ if ((targetBounds.width != myContent.getWidth()) || (targetBounds.height != myContent.getHeight())) {
+ // JDK uses cached heavyweight popup that is not initialized properly
+ LOG.debug("the expected size is not equal to the actual size");
+ Window popup = myPopup.getWindow();
+ if (popup != null) {
+ popup.setSize(targetBounds.width, targetBounds.height);
+ if (myContent.getParent().getComponentCount() != 1) {
+ LOG.debug("unexpected count of components in heavy-weight popup");
+ }
+ }
+ else {
+ LOG.debug("cannot fix size for non-heavy-weight popup");
+ }
+ }
if (myResizable) {
final JRootPane root = myContent.getRootPane();
@@ -799,13 +825,10 @@
listener.beforeShown(new LightweightWindowEvent(this));
}
- // can be improved by moving in myPopup code
- myPopup.getWindow().setSize(myContent.getSize());
-
myPopup.setRequestFocus(myRequestFocus);
myPopup.show();
- final Window window = SwingUtilities.getWindowAncestor(myContent);
+ final Window window = getContentWindow(myContent);
myWindow = window;
@@ -1185,14 +1208,17 @@
size = computeWindowSize(size);
- final Window window = SwingUtilities.getWindowAncestor(myContent);
- window.setSize(size);
+ final Window window = getContentWindow(myContent);
+ if (window != null) {
+ window.setSize(size);
+ }
}
public void pack() {
- final Window window = SwingUtilities.getWindowAncestor(myContent);
-
- window.pack();
+ final Window window = getContentWindow(myContent);
+ if (window != null) {
+ window.pack();
+ }
}
public JComponent getComponent() {
@@ -1211,6 +1237,10 @@
}
myDisposed = true;
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("start disposing " + myContent);
+ }
+
Disposer.dispose(this, false);
ApplicationManager.getApplication().assertIsDispatchThread();
@@ -1257,6 +1287,10 @@
IdeFocusManager.getInstance(myProject).typeAheadUntil(typeAheadDone);
getFocusManager().doWhenFocusSettlesDown(runFinal);
}
+
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("stop disposing content");
+ }
}
private void resetWindow() {
@@ -1385,15 +1419,27 @@
}
public static Window moveTo(JComponent content, Point screenPoint, final Dimension headerCorrectionSize) {
- setDefaultCursor(content);
- final Window wnd = SwingUtilities.getWindowAncestor(content);
- if (headerCorrectionSize != null) {
- screenPoint.y -= headerCorrectionSize.height;
+ final Window wnd = getContentWindow(content);
+ if (wnd != null) {
+ wnd.setCursor(Cursor.getDefaultCursor());
+ if (headerCorrectionSize != null) {
+ screenPoint.y -= headerCorrectionSize.height;
+ }
+ wnd.setLocation(screenPoint);
}
- wnd.setLocation(screenPoint);
return wnd;
}
+ private static Window getContentWindow(Component content) {
+ Window window = SwingUtilities.getWindowAncestor(content);
+ if (window == null) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("no window ancestor for " + content);
+ }
+ }
+ return window;
+ }
+
@Override
public Point getLocationOnScreen() {
Dimension headerCorrectionSize = myLocateByContent ? myHeaderPanel.getPreferredSize() : null;
@@ -1467,7 +1513,7 @@
}
public static void setDefaultCursor(JComponent content) {
- final Window wnd = SwingUtilities.getWindowAncestor(content);
+ final Window wnd = getContentWindow(content);
if (wnd != null) {
wnd.setCursor(Cursor.getDefaultCursor());
}
diff --git a/platform/platform-impl/src/com/intellij/ui/popup/PopupFactoryImpl.java b/platform/platform-impl/src/com/intellij/ui/popup/PopupFactoryImpl.java
index c7194ca..2d7a8e3 100644
--- a/platform/platform-impl/src/com/intellij/ui/popup/PopupFactoryImpl.java
+++ b/platform/platform-impl/src/com/intellij/ui/popup/PopupFactoryImpl.java
@@ -227,8 +227,11 @@
Presentation presentation = new Presentation();
presentation.setDescription(action.getTemplatePresentation().getDescription());
final String actualActionPlace = actionPlace == null ? ActionPlaces.UNKNOWN : actionPlace;
- action.update(new AnActionEvent(null, DataManager.getInstance().getDataContext(myComponent), actualActionPlace, presentation,
- ActionManager.getInstance(), 0));
+ final AnActionEvent actionEvent =
+ new AnActionEvent(null, DataManager.getInstance().getDataContext(myComponent), actualActionPlace, presentation,
+ ActionManager.getInstance(), 0);
+ actionEvent.setInjectedContext(action.isInInjectedContext());
+ action.update(actionEvent);
ActionMenu.showDescriptionInStatusBar(true, myComponent, presentation.getDescription());
}
});
@@ -730,7 +733,10 @@
myFinalRunnable = new Runnable() {
@Override
public void run() {
- action.actionPerformed(new AnActionEvent(null, dataContext, ActionPlaces.UNKNOWN, action.getTemplatePresentation().clone(), ActionManager.getInstance(), eventModifiers));
+ final AnActionEvent event = new AnActionEvent(null, dataContext, ActionPlaces.UNKNOWN, action.getTemplatePresentation().clone(),
+ ActionManager.getInstance(), eventModifiers);
+ event.setInjectedContext(action.isInInjectedContext());
+ action.actionPerformed(event);
}
};
return FINAL_CHOICE;
@@ -879,7 +885,10 @@
@NotNull
private AnActionEvent createActionEvent(@NotNull AnAction actionGroup) {
- return new AnActionEvent(null, myDataContext, myActionPlace, getPresentation(actionGroup), ActionManager.getInstance(), 0);
+ final AnActionEvent actionEvent =
+ new AnActionEvent(null, myDataContext, myActionPlace, getPresentation(actionGroup), ActionManager.getInstance(), 0);
+ actionEvent.setInjectedContext(actionGroup.isInInjectedContext());
+ return actionEvent;
}
private void appendActionsFromGroup(@NotNull ActionGroup actionGroup) {
diff --git a/platform/platform-impl/src/com/intellij/ui/popup/list/GroupedItemsListRenderer.java b/platform/platform-impl/src/com/intellij/ui/popup/list/GroupedItemsListRenderer.java
index 72f2e1d..9383f5c 100644
--- a/platform/platform-impl/src/com/intellij/ui/popup/list/GroupedItemsListRenderer.java
+++ b/platform/platform-impl/src/com/intellij/ui/popup/list/GroupedItemsListRenderer.java
@@ -18,9 +18,7 @@
import com.intellij.openapi.ui.popup.ListItemDescriptor;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.ui.EngravedLabel;
import com.intellij.ui.ErrorLabel;
-import com.intellij.ui.Gray;
import com.intellij.ui.GroupedElementsRenderer;
import com.intellij.ui.components.panels.OpaquePanel;
@@ -58,15 +56,8 @@
@Override
protected JComponent createItemComponent() {
- if (Registry.is("ide.new.project.settings")) {
- myTextLabel = new EngravedLabel();
- myTextLabel.setFont(myTextLabel.getFont().deriveFont(Font.BOLD));
- myTextLabel.setForeground(Gray._240);
- } else {
- myTextLabel = new ErrorLabel();
- myTextLabel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
- }
-
+ myTextLabel = new ErrorLabel();
+ myTextLabel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
myTextLabel.setOpaque(true);
return layoutComponent(myTextLabel);
}
diff --git a/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java b/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java
new file mode 100644
index 0000000..ac4c1b1
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java
@@ -0,0 +1,465 @@
+package com.intellij.util.ui;
+
+import com.intellij.ide.BrowserUtil;
+import com.intellij.openapi.actionSystem.ActionManager;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DefaultActionGroup;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.fileChooser.FileChooserFactory;
+import com.intellij.openapi.ide.CopyPasteManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.ComponentWithBrowseButton;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.ui.TextComponentAccessor;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.ui.HyperlinkLabel;
+import com.intellij.ui.TextFieldWithHistory;
+import com.intellij.ui.TextFieldWithHistoryWithBrowseButton;
+import com.intellij.util.NotNullProducer;
+import com.intellij.util.PlatformIcons;
+import com.intellij.util.containers.ComparatorUtil;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.event.PopupMenuEvent;
+import javax.swing.event.PopupMenuListener;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+import java.awt.*;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+public class SwingHelper {
+
+ private static final Logger LOG = Logger.getInstance(SwingHelper.class);
+
+ /**
+ * Creates panel whose content consists of given {@code children} components
+ * stacked vertically each on another in a given order.
+ *
+ * @param childAlignmentX Component.LEFT_ALIGNMENT, Component.CENTER_ALIGNMENT or Component.RIGHT_ALIGNMENT
+ * @param children children components
+ * @return created panel
+ */
+ @NotNull
+ public static JPanel newVerticalPanel(float childAlignmentX, Component... children) {
+ return newGenericBoxPanel(true, childAlignmentX, children);
+ }
+
+ @NotNull
+ public static JPanel newLeftAlignedVerticalPanel(Component... children) {
+ return newVerticalPanel(Component.LEFT_ALIGNMENT, children);
+ }
+
+ @NotNull
+ public static JPanel newLeftAlignedVerticalPanel(@NotNull Collection<Component> children) {
+ return newVerticalPanel(Component.LEFT_ALIGNMENT, children);
+ }
+
+ @NotNull
+ public static JPanel newVerticalPanel(float childAlignmentX, @NotNull Collection<Component> children) {
+ return newVerticalPanel(childAlignmentX, children.toArray(new Component[children.size()]));
+ }
+
+ /**
+ * Creates panel whose content consists of given {@code children} components horizontally
+ * stacked each on another in a given order.
+ *
+ * @param childAlignmentY Component.TOP_ALIGNMENT, Component.CENTER_ALIGNMENT or Component.BOTTOM_ALIGNMENT
+ * @param children children components
+ * @return created panel
+ */
+ @NotNull
+ public static JPanel newHorizontalPanel(float childAlignmentY, Component... children) {
+ return newGenericBoxPanel(false, childAlignmentY, children);
+ }
+
+ @NotNull
+ public static JPanel newHorizontalPanel(float childAlignmentY, @NotNull Collection<Component> children) {
+ return newHorizontalPanel(childAlignmentY, children.toArray(new Component[children.size()]));
+ }
+
+ private static JPanel newGenericBoxPanel(boolean verticalOrientation,
+ float childAlignment,
+ Component... children) {
+ JPanel panel = new JPanel();
+ int axis = verticalOrientation ? BoxLayout.Y_AXIS : BoxLayout.X_AXIS;
+ panel.setLayout(new BoxLayout(panel, axis));
+ for (Component child : children) {
+ panel.add(child, childAlignment);
+ if (child instanceof JComponent) {
+ JComponent jChild = (JComponent) child;
+ if (verticalOrientation) {
+ jChild.setAlignmentX(childAlignment);
+ } else {
+ jChild.setAlignmentY(childAlignment);
+ }
+ }
+ }
+ return panel;
+ }
+
+ @NotNull
+ public static JPanel wrapWithoutStretch(@NotNull JComponent component) {
+ JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
+ panel.add(component);
+ return panel;
+ }
+
+ @NotNull
+ public static JPanel wrapWithHorizontalStretch(@NotNull JComponent component) {
+ JPanel panel = new JPanel(new BorderLayout(0, 0));
+ panel.add(component, BorderLayout.NORTH);
+ return panel;
+ }
+
+ public static void setPreferredWidthToFitText(@NotNull TextFieldWithHistoryWithBrowseButton component) {
+ int childWidth = calcWidthToFitText(component.getChildComponent().getTextEditor(), 35);
+ setPreferredWidthForComponentWithBrowseButton(component, childWidth);
+ }
+
+ public static void setPreferredWidthToFitText(@NotNull TextFieldWithBrowseButton component) {
+ int childWidth = calcWidthToFitText(component.getChildComponent(), 20);
+ setPreferredWidthForComponentWithBrowseButton(component, childWidth);
+ }
+
+ private static <T extends JComponent> void setPreferredWidthForComponentWithBrowseButton(@NotNull ComponentWithBrowseButton<T> component,
+ int childPrefWidth) {
+ Dimension buttonPrefSize = component.getButton().getPreferredSize();
+ setPreferredWidth(component, childPrefWidth + buttonPrefSize.width);
+ }
+
+ public static void setPreferredWidthToFitText(@NotNull JTextField textField) {
+ setPreferredWidthToFitText(textField, 15);
+ }
+
+ public static void setPreferredWidthToFitText(@NotNull JTextField textField, int additionalWidth) {
+ setPreferredSizeToFitText(textField, StringUtil.notNullize(textField.getText()), additionalWidth);
+ }
+
+ public static void setPreferredWidthToFitText(@NotNull JTextField textField, @NotNull String text) {
+ setPreferredSizeToFitText(textField, text, 15);
+ }
+
+ private static void setPreferredSizeToFitText(@NotNull JTextField textField, @NotNull String text, int additionalWidth) {
+ int width = calcWidthToFitText(textField, text, additionalWidth);
+ setPreferredWidth(textField, width);
+ }
+
+ private static int calcWidthToFitText(@NotNull JTextField textField, int additionalWidth) {
+ return calcWidthToFitText(textField, textField.getText(), additionalWidth);
+ }
+
+ private static int calcWidthToFitText(@NotNull JTextField textField, @NotNull String text, int additionalWidth) {
+ return textField.getFontMetrics(textField.getFont()).stringWidth(text) + additionalWidth;
+ }
+
+ public static void adjustDialogSizeToFitPreferredSize(@NotNull DialogWrapper dialogWrapper) {
+ JRootPane rootPane = dialogWrapper.getRootPane();
+ Dimension componentSize = rootPane.getSize();
+ Dimension componentPreferredSize = rootPane.getPreferredSize();
+ if (componentPreferredSize.width <= componentSize.width && componentPreferredSize.height <= componentSize.height) {
+ return;
+ }
+ int dw = Math.max(0, componentPreferredSize.width - componentSize.width);
+ int dh = Math.max(0, componentPreferredSize.height - componentSize.height);
+
+ Dimension oldDialogSize = dialogWrapper.getSize();
+ Dimension newDialogSize = new Dimension(oldDialogSize.width + dw, oldDialogSize.height + dh);
+
+ dialogWrapper.setSize(newDialogSize.width, newDialogSize.height);
+ rootPane.revalidate();
+ rootPane.repaint();
+
+ LOG.info("DialogWrapper '" + dialogWrapper.getTitle() + "' has been resized (added width: " + dw + ", added height: " + dh + ")");
+ }
+
+ public static <T> void updateItems(@NotNull JComboBox comboBox,
+ @NotNull List<T> newItems,
+ @Nullable T newSelectedItemIfSelectionCannotBePreserved) {
+ if (!shouldUpdate(comboBox, newItems)) {
+ return;
+ }
+ Object selectedItem = comboBox.getSelectedItem();
+ //noinspection SuspiciousMethodCalls
+ if (selectedItem != null && !newItems.contains(selectedItem)) {
+ selectedItem = null;
+ }
+ if (selectedItem == null && newItems.contains(newSelectedItemIfSelectionCannotBePreserved)) {
+ selectedItem = newSelectedItemIfSelectionCannotBePreserved;
+ }
+ comboBox.removeAllItems();
+ for (T newItem : newItems) {
+ comboBox.addItem(newItem);
+ }
+ if (selectedItem != null) {
+ int count = comboBox.getItemCount();
+ for (int i = 0; i < count; i++) {
+ Object item = comboBox.getItemAt(i);
+ if (selectedItem.equals(item)) {
+ comboBox.setSelectedIndex(i);
+ break;
+ }
+ }
+ }
+ }
+
+ private static <T> boolean shouldUpdate(@NotNull JComboBox comboBox, @NotNull List<T> newItems) {
+ int count = comboBox.getItemCount();
+ if (newItems.size() != count) {
+ return true;
+ }
+ for (int i = 0; i < count; i++) {
+ Object oldItem = comboBox.getItemAt(i);
+ T newItem = newItems.get(i);
+ if (!ComparatorUtil.equalsNullable(oldItem, newItem)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static void setNoBorderCellRendererFor(@NotNull TableColumn column) {
+ final TableCellRenderer previous = column.getCellRenderer();
+ column.setCellRenderer(new DefaultTableCellRenderer() {
+ @Override
+ public Component getTableCellRendererComponent(JTable table,
+ Object value,
+ boolean isSelected,
+ boolean hasFocus,
+ int row,
+ int column) {
+ Component component;
+ if (previous != null) {
+ component = previous.getTableCellRendererComponent(table, value, isSelected, false, row, column);
+ }
+ else {
+ component = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
+ }
+ if (component instanceof JComponent) {
+ ((JComponent)component).setBorder(null);
+ }
+ return component;
+ }
+ });
+ }
+
+ public static void addHistoryOnExpansion(@NotNull final TextFieldWithHistory textFieldWithHistory,
+ @NotNull final NotNullProducer<List<String>> historyProvider) {
+ textFieldWithHistory.addPopupMenuListener(new PopupMenuListener() {
+ @Override
+ public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
+ List<String> newHistory = historyProvider.produce();
+ Set<String> newHistorySet = ContainerUtil.newHashSet(newHistory);
+ List<String> oldHistory = textFieldWithHistory.getHistory();
+ List<String> mergedHistory = ContainerUtil.newArrayList();
+ for (String item : oldHistory) {
+ if (!newHistorySet.contains(item)) {
+ mergedHistory.add(item);
+ }
+ }
+ mergedHistory.addAll(newHistory);
+ textFieldWithHistory.setHistory(mergedHistory);
+
+ setLongestAsPrototype(textFieldWithHistory, mergedHistory);
+
+ // one-time initialization
+ textFieldWithHistory.removePopupMenuListener(this);
+ }
+
+ @Override
+ public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
+ }
+
+ @Override
+ public void popupMenuCanceled(PopupMenuEvent e) {
+ }
+ });
+ }
+
+ private static void setLongestAsPrototype(@NotNull JComboBox comboBox, @NotNull List<String> variants) {
+ Object prototypeDisplayValue = comboBox.getPrototypeDisplayValue();
+ String prototypeDisplayValueStr = null;
+ if (prototypeDisplayValue instanceof String) {
+ prototypeDisplayValueStr = (String) prototypeDisplayValue;
+ }
+ else if (prototypeDisplayValue != null) {
+ return;
+ }
+ String longest = StringUtil.notNullize(prototypeDisplayValueStr);
+ boolean updated = false;
+ for (String s : variants) {
+ if (longest.length() < s.length()) {
+ longest = s;
+ updated = true;
+ }
+ }
+ if (updated) {
+ comboBox.setPrototypeDisplayValue(longest);
+ }
+ }
+
+ public static void installFileCompletionAndBrowseDialog(@Nullable Project project,
+ @NotNull TextFieldWithHistoryWithBrowseButton textFieldWithHistoryWithBrowseButton,
+ @NotNull String browseDialogTitle,
+ @NotNull FileChooserDescriptor fileChooserDescriptor) {
+ doInstall(project,
+ textFieldWithHistoryWithBrowseButton,
+ textFieldWithHistoryWithBrowseButton.getChildComponent().getTextEditor(),
+ browseDialogTitle,
+ fileChooserDescriptor,
+ TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
+ }
+
+ public static void installFileCompletionAndBrowseDialog(@Nullable Project project,
+ @NotNull TextFieldWithBrowseButton textFieldWithBrowseButton,
+ @NotNull String browseDialogTitle,
+ @NotNull FileChooserDescriptor fileChooserDescriptor) {
+ doInstall(project,
+ textFieldWithBrowseButton,
+ textFieldWithBrowseButton.getTextField(),
+ browseDialogTitle,
+ fileChooserDescriptor,
+ TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
+ }
+
+ private static <T extends JComponent> void doInstall(@Nullable Project project,
+ @NotNull ComponentWithBrowseButton<T> componentWithBrowseButton,
+ @NotNull JTextField textField,
+ @NotNull String browseDialogTitle,
+ @NotNull FileChooserDescriptor fileChooserDescriptor,
+ @NotNull TextComponentAccessor<T> textComponentAccessor) {
+ fileChooserDescriptor = fileChooserDescriptor.withShowHiddenFiles(SystemInfo.isUnix);
+ componentWithBrowseButton.addBrowseFolderListener(
+ project,
+ new ComponentWithBrowseButton.BrowseFolderActionListener<T>(
+ browseDialogTitle,
+ null,
+ componentWithBrowseButton,
+ project,
+ fileChooserDescriptor,
+ textComponentAccessor
+ ),
+ true
+ );
+ FileChooserFactory.getInstance().installFileCompletion(
+ textField,
+ fileChooserDescriptor,
+ true,
+ project
+ );
+ }
+
+ @NotNull
+ public static HyperlinkLabel createWebHyperlink(@NotNull String url) {
+ return createWebHyperlink(url, url);
+ }
+
+ @NotNull
+ public static HyperlinkLabel createWebHyperlink(@NotNull String text, @NotNull String url) {
+ HyperlinkLabel hyperlink = new HyperlinkLabel(text);
+ hyperlink.setHyperlinkTarget(url);
+
+ DefaultActionGroup actionGroup = new DefaultActionGroup();
+ actionGroup.add(new OpenLinkInBrowser(url));
+ actionGroup.add(new CopyLinkAction(url));
+
+ hyperlink.setComponentPopupMenu(ActionManager.getInstance().createActionPopupMenu("web hyperlink", actionGroup).getComponent());
+ return hyperlink;
+ }
+
+ public static void setPreferredWidth(@NotNull JComponent component, int width) {
+ Dimension preferredSize = component.getPreferredSize();
+ preferredSize.width = width;
+ component.setPreferredSize(preferredSize);
+ }
+
+ @NotNull
+ public static JEditorPane createHtmlViewer(boolean carryTextOver,
+ @Nullable Font font,
+ @Nullable Color background,
+ @Nullable Color foreground) {
+ final JEditorPane textPane;
+ if (carryTextOver) {
+ textPane = new JEditorPane() {
+ @Override
+ public Dimension getPreferredSize() {
+ // This trick makes text component to carry text over to the next line
+ // if the text line width exceeds parent's width
+ Dimension dimension = super.getPreferredSize();
+ dimension.width = 0;
+ return dimension;
+ }
+ };
+ }
+ else {
+ textPane = new JEditorPane();
+ }
+ textPane.setFont(font != null ? font : UIUtil.getLabelFont());
+ textPane.setContentType(UIUtil.HTML_MIME);
+ textPane.setEditable(false);
+ textPane.setBackground(background != null ? background : UIUtil.getLabelBackground());
+ textPane.setForeground(foreground != null ? foreground : UIUtil.getLabelForeground());
+ return textPane;
+ }
+
+ public static void setHtml(@NotNull JEditorPane editorPane, @NotNull String bodyInnerHtml) {
+ String html = String.format(
+ "<html><head>%s</head><body>%s</body></html>",
+ UIUtil.getCssFontDeclaration(editorPane.getFont(), null, null, null),
+ bodyInnerHtml
+ );
+ editorPane.setText(html);
+ }
+
+ private static class CopyLinkAction extends AnAction {
+
+ private final String myUrl;
+
+ private CopyLinkAction(@NotNull String url) {
+ super("Copy Link Address", null, PlatformIcons.COPY_ICON);
+ myUrl = url;
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ e.getPresentation().setEnabled(true);
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ Transferable content = new StringSelection(myUrl);
+ CopyPasteManager.getInstance().setContents(content);
+ }
+ }
+
+ private static class OpenLinkInBrowser extends AnAction {
+
+ private final String myUrl;
+
+ private OpenLinkInBrowser(@NotNull String url) {
+ super("Open Link in Browser", null, PlatformIcons.WEB_ICON);
+ myUrl = url;
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ e.getPresentation().setEnabled(true);
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ BrowserUtil.browse(myUrl);
+ }
+ }
+}
\ No newline at end of file
diff --git a/platform/platform-impl/src/com/intellij/util/ui/table/TableModelEditor.java b/platform/platform-impl/src/com/intellij/util/ui/table/TableModelEditor.java
index dd41a33..8b148a3 100644
--- a/platform/platform-impl/src/com/intellij/util/ui/table/TableModelEditor.java
+++ b/platform/platform-impl/src/com/intellij/util/ui/table/TableModelEditor.java
@@ -22,6 +22,7 @@
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.*;
+import com.intellij.ui.table.JBTable;
import com.intellij.ui.table.TableView;
import com.intellij.util.Function;
import com.intellij.util.FunctionUtil;
@@ -42,6 +43,7 @@
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.TableModel;
+import java.awt.*;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Collections;
@@ -71,6 +73,8 @@
table = new TableView<T>(model);
table.setDefaultEditor(Enum.class, ComboBoxTableCellEditor.INSTANCE);
table.setStriped(true);
+ table.setEnableAntialiasing(true);
+ preferredScrollableViewportHeightInRows(JBTable.PREFERRED_SCROLLABLE_VIEWPORT_HEIGHT_IN_ROWS);
new TableSpeedSearch(table);
if (columns[0].getColumnClass() == Boolean.class && columns[0].getName().isEmpty()) {
TableUtil.setupCheckboxColumn(table.getColumnModel().getColumn(0));
@@ -97,6 +101,11 @@
}
}
+ public TableModelEditor<T> preferredScrollableViewportHeightInRows(int rows) {
+ table.setPreferredScrollableViewportSize(new Dimension(200, table.getRowHeight() * rows));
+ return this;
+ }
+
private void addDialogActions() {
toolbarDecorator.setEditAction(new AnActionButtonRunnable() {
@Override
diff --git a/platform/platform-resources-en/src/messages/ActionsBundle.properties b/platform/platform-resources-en/src/messages/ActionsBundle.properties
index cf3ca01..1c05af2 100644
--- a/platform/platform-resources-en/src/messages/ActionsBundle.properties
+++ b/platform/platform-resources-en/src/messages/ActionsBundle.properties
@@ -110,7 +110,7 @@
action.EditorAddOrRemoveCaret.text=Add or Remove Caret
action.EditorCloneCaretBelow.text=Clone Caret Below
action.EditorCloneCaretAbove.text=Clone Caret Above
-action.SelectNextOccurrence.text=Select Next Occurrence
+action.SelectNextOccurrence.text=Add Selection for Next Occurrence
action.SelectAllOccurrences.text=Select All Occurrences
action.UnselectPreviousOccurrence.text=Unselect Occurrence
action.EditorToggleStickySelection.text=Toggle Sticky Selection
@@ -329,10 +329,10 @@
action.FindModal.description=Find a string in active editor, shows modal dialog
action.Replace.text=_Replace...
action.Replace.description=Replace a string in active editor with another string
-action.FindNext.text=Find _Next
-action.FindNext.description=Repeat the last Find/Replace operation
-action.FindPrevious.text=Find Pre_vious
-action.FindPrevious.description=Repeat the last Find/Replace operation in reverse direction
+action.FindNext.text=Find _Next / Move to Next Occurrence
+action.FindNext.description=Repeat the last Find/Replace operation, or moving to next occurrence of selected text
+action.FindPrevious.text=Find Pre_vious / Move to Previous Occurrence
+action.FindPrevious.description=Repeat the last Find/Replace operation in reverse direction, or moving to previous occurrence of selected text
action.FindWordAtCaret.text=Find _Word at Caret
action.FindWordAtCaret.description=Find next occurrence of the word at caret
action.IncrementalSearch.text=Incrementa_l Search
@@ -1014,6 +1014,8 @@
action.Vcs.ShowDiffAction.description=Show changes
action.Vcs.RollbackChanges.text=Rollback Changes
action.Vcs.RollbackChanges.description=Rollback changes
+action.RollbackLineStatusChanges.text=Rollback
+action.RollbackLineStatusChanges.description=Rollback selected local changes
action.Vcs.EditSourceAction.text=Edit Source
action.Vcs.EditSourceAction.description=Edit source
action.Vcs.ExcludeAction.text=Exclude from Commit
@@ -1391,3 +1393,9 @@
action.SaveDocument.text=Save Document
action.SaveDocument.description=Saves only the file opened in the current editor
+
+action.StructuralSearchPlugin.StructuralSearchAction.text=Search S_tructurally...
+action.StructuralSearchPlugin.StructuralSearchAction.description=Structural Search
+action.StructuralSearchPlugin.StructuralReplaceAction.text=Repla_ce Structurally...
+action.StructuralSearchPlugin.StructuralReplaceAction.description=Structural Replace
+
diff --git a/platform/platform-resources-en/src/messages/ApplicationBundle.properties b/platform/platform-resources-en/src/messages/ApplicationBundle.properties
index fb3d471..bbd737a 100644
--- a/platform/platform-resources-en/src/messages/ApplicationBundle.properties
+++ b/platform/platform-resources-en/src/messages/ApplicationBundle.properties
@@ -575,7 +575,6 @@
watcher.slow.sync=External file changes sync may be slow
watcher.exe.not.found=Native file watcher executable not found
watcher.exe.not.exe=Native file watcher is not executable: <a href="{0}">{0}</a>
-watcher.exe.outdated=Native file watcher executable is outdated
watcher.failed.to.start=File watcher failed to start
watcher.gave.up=File watcher gave up to operate
watcher.non.watchable.project=Project files cannot be watched (are they under network mount?)
@@ -642,4 +641,6 @@
group.richcopy=Rich-text copy
combobox.richcopy.color.scheme=Color scheme
-combobox.richcopy.color.scheme.active=Active scheme
\ No newline at end of file
+combobox.richcopy.color.scheme.active=Active scheme
+
+settings.code.style.default.general=Default (General)
\ No newline at end of file
diff --git a/platform/platform-resources-en/src/messages/CodeInsightBundle.properties b/platform/platform-resources-en/src/messages/CodeInsightBundle.properties
index 23931e7..e7a7b43 100644
--- a/platform/platform-resources-en/src/messages/CodeInsightBundle.properties
+++ b/platform/platform-resources-en/src/messages/CodeInsightBundle.properties
@@ -244,11 +244,11 @@
<center>To enable/disable a particular intention, select the intention inside this category.</center>\
</font></body></html>
templates.postfix.settings.category.text=<html><body><font face=\"verdana\" size=\"-1\">\
- <center>You have selected the postfix completion language.</center>\
- <center>By clicking the checkbox, you can enable/disable all postfix completions for the language.</center>\
- <center>To enable/disable a particular postfix completion select the postfix completion inside the language.</center>\
+ You have selected the postfix completion language.<br>\
+ By clicking the checkbox, you can enable/disable all postfix templates for the language.<br>\
+ To enable/disable a postfix template select it inside the group.<br>\
</font></body></html>
-templates.postfix.settings.category.before=The sample code featuring selected intention will be shown here.\n \
+templates.postfix.settings.category.before=The sample code featuring selected template will be shown here.\n \
<spot>Flashing rectangle</spot> shows the place where intention is applicable.
templates.postfix.settings.category.after=Postfix completion invocation result will be shown here.
javadoc.description.copied.from.interface=Description copied from interface:
diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties
index 7a3e4e2..016c62b 100644
--- a/platform/platform-resources-en/src/messages/IdeBundle.properties
+++ b/platform/platform-resources-en/src/messages/IdeBundle.properties
@@ -23,7 +23,7 @@
button.wizard.next=&Next
title.system.error=System Error
title.select.path.to.browser=Select Path to Browser
-title.general=General
+title.general=System Settings
editbox.default.encoding.for.properties.files=Default encoding for properties files:
checkbox.transparent.native.to.ascii.conversion=Transparent native-to-ascii conversion
checkbox.autodetect.utf=Autodetect UTF-encoded files
diff --git a/platform/platform-resources-en/src/messages/InspectionsBundle.properties b/platform/platform-resources-en/src/messages/InspectionsBundle.properties
index 0e423f5..40940d6 100644
--- a/platform/platform-resources-en/src/messages/InspectionsBundle.properties
+++ b/platform/platform-resources-en/src/messages/InspectionsBundle.properties
@@ -347,6 +347,7 @@
inspection.errors.occurred.dialog.title=Errors Occurred
inspection.profiles.presentable.name=Inspection profiles
inspection.severity=Se&verity:
+inspection.scopes.and.severities=Scopes and Se&vereties:
inspection.description.title=Description
inspection.as=As {0}
inspection.new.profile.dialog.title=Create new profile
diff --git a/platform/platform-resources-en/src/messages/OptionsBundle.properties b/platform/platform-resources-en/src/messages/OptionsBundle.properties
index b1c60ece..aa2d104 100644
--- a/platform/platform-resources-en/src/messages/OptionsBundle.properties
+++ b/platform/platform-resources-en/src/messages/OptionsBundle.properties
@@ -198,6 +198,17 @@
settings.panel.title=Settings
+configurable.group.appearance.settings.display.name=Appearance and Behavior
+configurable.group.editor.settings.display.name=Editor
+configurable.group.project.settings.display.name=Current Project
+configurable.group.build.settings.display.name=Build, Execution, Deployment
+configurable.group.language.settings.display.name=Languages and Frameworks
+configurable.group.tools.settings.display.name=Tools
+configurable.group.null.settings.display.name=Other Settings
+
+configurable.default.project.tooltip=For default project
+configurable.current.project.tooltip=For current project
+
control.panel.classic.view.button=Classic &View
options.page.modified.save.message.text=The page has been modified. Save changes made on this page?
options.save.changes.message.title=Save Changes
diff --git a/platform/platform-resources-en/src/messages/XDebuggerBundle.properties b/platform/platform-resources-en/src/messages/XDebuggerBundle.properties
index 523c8b6..878c814 100644
--- a/platform/platform-resources-en/src/messages/XDebuggerBundle.properties
+++ b/platform/platform-resources-en/src/messages/XDebuggerBundle.properties
@@ -1,6 +1,8 @@
xdebugger.colors.page.name=Debugger
debugger.configurable.display.name=Debugger
+debugger.dataViews.display.name=Data Views
+debugger.stepping.display.name=Stepping
xdebugger.default.content.title=Debug
xdebugger.debugger.tab.title=Debugger
@@ -52,6 +54,7 @@
xdebugger.evaluate.dialog.close=Close
xdebugger.dialog.title.evaluate.expression=Evaluate Expression
xdebugger.evaluate.label.expression=Expression:
+xdebugger.evaluate.addtowatches.hint=Use Control+Enter 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
@@ -110,4 +113,11 @@
scope.class = Class
scope.instance = Instance
scope.library = Library
-scope.unknown = Unknown
\ No newline at end of file
+scope.unknown = Unknown
+
+setting.value.tooltip.delay.label=&Value tooltip delay (ms):
+setting.enable.auto.expressions.label=Enable auto expressions in Variables view
+setting.sort.alphabetically.label=Sort a&lphabetically
+
+setting.hide.window.label=Hide debug &window on process termination
+setting.focus.app.on.breakpoint.label=Focus application on breakpoint
diff --git a/platform/platform-resources-en/src/misc/registry.properties b/platform/platform-resources-en/src/misc/registry.properties
index 8febeb0..0f430e0 100644
--- a/platform/platform-resources-en/src/misc/registry.properties
+++ b/platform/platform-resources-en/src/misc/registry.properties
@@ -1,26 +1,21 @@
localHistory.daysToKeep=5
-# suppress inspection "UnusedProperty"
localHistory.daysToKeep.description=Specify how many working days changes should be remembered.\n\
WARNING: Do not use local history as main version control since it may become corrupted if the IDE hangs.
undo.globalUndoLimit=10
undo.documentUndoLimit=100
actionSystem.fixLostTyping=true
-# suppress inspection "UnusedProperty"
actionSystem.fixLostTyping.description=Redispatch events, lost between actions and dialog show/close.
actionSystem.fixStickyFocusedWindows=true
actionSystem.fixNullFocusedComponent=true
actionSystem.noDefaultComponent=true
actionSystem.commandProcessingTimeout=30000
-# suppress inspection "UnusedProperty"
actionSystem.commandProcessingTimeout.description=Timeout after which currently processed command is forcibly cancelled.
actionSystem.typeAheadTimeBeforeDialog=2000
-# suppress inspection "UnusedProperty"
actionSystem.typeAheadTimeBeforeDialog.description=If dialog shown as a result of some typing, all key types withing this time\
will be re-dispatched after dialog is closed.
actionSystem.typeAheadTimeAfterPopupAction=500
actionSystem.playback.delay=20
-# suppress inspection "UnusedProperty"
actionSystem.playback.delay.description=Delay between events generated by the playback runner.
actionSystem.playback.useDirectActionCall=true
actionSystem.playback.useTypingTargets=true
@@ -29,7 +24,6 @@
actionSystem.keyGestures.enabled=false
actionSystem.keyGestureDblClickTime=650
actionSystem.suspendFocusTransferIfApplicationInactive=true
-actionSystem.doNotStealFocus=false
actionSystem.xWindow.remove.focus.from.nonFocusable.popups=true
actionSystem.xWindow.remove.focus.from.nonFocusable.popups.delay=50
actionSystem.noContextComponentWhileFocusTransfer=true
@@ -42,31 +36,33 @@
actionSystem.quickAccessModifiers=
actionSystem.quickAccessShowSpotsTime=1500
actionSystem.win.suppressAlt=true
+actionSystem.win.suppressAlt.new=true
actionSystem.mouseGesturesEnabled=true
actionSystem.assertFocusAccessFromEdt=true
actionSystem.enableAbbreviations=true
ide.firstStartup=true
ide.debugMode=false
-# suppress inspection "UnusedProperty"
ide.debugMode.description=Record additional information to make bug reports more informative.
ide.debug.minProgressTime=0
ide.forcedShowTooltip=alt
-# suppress inspection "UnusedProperty"
ide.forcedShowTooltip.description=Shortcut for forced show tooltip.
ide.popup.dropShadow=false
ide.consumeKnownToolkitBugs=true
ide.highlight.match.in.selected.only=true
ide.lazyIconLoading=true
ide.checkDuplicateMnemonics=false
-# suppress inspection "UnusedProperty"
ide.checkDuplicateMnemonics.description=Check for duplicate mnemonics.
ide.dnd.textHints=false
ide.max.recent.projects=25
+ide.hide.excluded.files=true
+ide.hide.excluded.files.restartRequired=true
+ide.hide.excluded.files.description=Do not show excluded files in Project View and exclude them from VCS
+
idea.fix.mac.env=true
-# suppress inspection "UnusedProperty"
-idea.fix.mac.env.description=On Mac, use shell environment for external processes (effective on restart).
+idea.fix.mac.env.restartRequired=true
+idea.fix.mac.env.description=On Mac, use shell environment for external processes.
ide.x11.override.wm=true
@@ -125,6 +121,8 @@
editor.skip.copy.and.cut.for.empty.selection=false
editor.distraction.free.mode=false
+editor.add.carets.on.double.control.arrows=true
+
ide.showIndexRebuildMessage=false
ide.tabbedPane.bufferedPaint=true
@@ -143,9 +141,9 @@
ide.mac.useNativeClipboard=false
ide.mac.boldEditorTabs=false
ide.mac.disableMacScrollbars=false
-ide.mac.disableMacScrollbars.description=Disables OS X overlay scrollbars (effective on restart)
+ide.mac.disableMacScrollbars.restartRequired=true
+ide.mac.disableMacScrollbars.description=Disables OS X overlay scrollbars
ide.perProjectModality=false
-# suppress inspection "UnusedProperty"
ide.perProjectModality.description=New modality approach. All dialogs are DOCUMENT_MODAL expect ide-wide dialogs
ide.mac.retina.disableDrawingFix=false
@@ -154,25 +152,21 @@
ide.new.license.dialog=true
debugger.valueTooltipAutoShow=true
-# suppress inspection "UnusedProperty"
debugger.valueTooltipAutoShow.description=Auto show tooltip on mouse over.
debugger.mayBringFrameToFrontOnBreakpoint=true
debugger.breakpoint.message.full.trace=false
-# suppress inspection "UnusedProperty"
debugger.breakpoint.message.full.trace.description='Log message to console' breakpoint action will out full stacktrace\
for the thread that hit the breakpoint.
+debugger.batch.evaluation=false
analyze.exceptions.on.the.fly=false
-# suppress inspection "UnusedProperty"
analyze.exceptions.on.the.fly.description=Automatically analyze clipboard on frame activation,\
and if there is a stacktrace calls Analyze Stacktrace.
compiler.perform.outputs.refresh.on.start=false
-# suppress inspection "UnusedProperty"
compiler.perform.outputs.refresh.on.start.description=Whether to perform initial FS refresh before compilation starts.\
Need this to detect external changes to output dirs.
compiler.max.static.constants.searches=3000
-# suppress inspection "UnusedProperty"
compiler.max.static.constants.searches.description=If the number of changed compile time constants exceeds this value,\
make will start full-project rebuild
@@ -180,29 +174,24 @@
compiler.process.jdk.description=Path to a JDK home. Force build process to be run using the JDK specified. It is assumed that the jdk is at least of version 1.6.
compiler.process.32bit.vm.on.mac=true
-# suppress inspection "UnusedProperty"
compiler.process.32bit.vm.on.mac.description=Force -d32 VM option on Mac (recommended for faster startup and lower memory footprint).
compiler.process.use.memory.temp.cache=true
-# suppress inspection "UnusedProperty"
compiler.process.use.memory.temp.cache.description=Store temporary data in memory for faster compilation;\
requires larger heap size for the build process. If parallel build is enabled, the option is ignored and temp data is always stored in memory.
compiler.process.use.external.javac=false
-# suppress inspection "UnusedProperty"
compiler.process.use.external.javac.description=Run javac compiler in a separate process (allows to run build process with smaller heap size).
compiler.process.debug.port=-1
compiler.automake.trigger.delay=300
-# suppress inspection "UnusedProperty"
compiler.automake.trigger.delay.description=Delay in milliseconds before triggering auto-make in response to file system events
compiler.automake.force.fs.rescan=false
compiler.automake.force.fs.rescan.description=When enabled, for all automatically started builds (automake) collected VFS changes will be ignored and modified files will be determined with FS rescan will be forces
compiler.document.save.trigger.delay=1500
-# suppress inspection "UnusedProperty"
compiler.document.save.trigger.delay.description=Delay in milliseconds before triggering save in response to document changes
vcs.show.colored.annotations=true
@@ -244,22 +233,17 @@
documentation.component.editor.font=false
ide.completion.show.better.matching.classes=true
-# suppress inspection "UnusedProperty"
ide.completion.show.better.matching.classes.description=Show non-imported but good matching classes in basic completion
ide.completion.show.lower.case.classes=false
-# suppress inspection "UnusedProperty"
ide.completion.show.lower.case.classes.description=Show non-imported classes starting with a lowercase letter in basic completion
ide.completion.delay.autopopup.until.completed=false
-# suppress inspection "UnusedProperty"
ide.completion.delay.autopopup.until.completed.description=Controls if completion autopopup is shown immediately and populated in background, or delayed until all suggestion are calculated
ide.completion.middle.matching=true
-# suppress inspection "UnusedProperty"
ide.completion.middle.matching.description=Suggest items in completion that contain the entered string somewhere in the middle.
ide.goto.middle.matching=true
-# suppress inspection "UnusedProperty"
ide.goto.middle.matching.description=Suggest items in goto actions that contain the entered string somewhere in the middle.
ide.goto.rebuild.delay=0
@@ -275,21 +259,17 @@
ide.enable.toolwindow.stack=false
change.signature.awesome.mode=true
-# suppress inspection "UnusedProperty"
change.signature.awesome.mode.description=Enables list view for change signature.
enable.groovy.hotswap=true
-# suppress inspection "UnusedProperty"
enable.groovy.hotswap.description=Whether IDEA should add a special java agent to the debugged process\
which allows to hot-swap Groovy changes in some cases
dump.threads.on.empty.lookup=false
-# suppress inspection "UnusedProperty"
dump.threads.on.empty.lookup.description=Whether IDEA should issue a thread dump when an empty completion lookup appears.
file.structure.tree.mode=true
disable.toolwindow.overlay=true
-# suppress inspection "UnusedProperty"
disable.toolwindow.overlay.description=Disable transparent toolwindow stripes.
core.pooled.threads=20
@@ -300,7 +280,6 @@
fast.tree.expand.in.structure.view=false
ide.goto.implementation.show.interfaces=true
-# suppress inspection "UnusedProperty"
ide.goto.implementation.show.interfaces.description=Whether to show sub-interfaces when invoking\
'Go to Implementation' action (Ctrl+Alt+B) on an interface.
@@ -340,20 +319,15 @@
completion.enable.relevant.method.chain.suggestions=false
ide.mac.message.sheets.java.emulation=false
-# suppress inspection "UnusedProperty"
ide.mac.message.sheets.java.emulation.description=Use Java message sheets instead of native ones
ide.mac.message.sheets.java.emulation.dialogs=true
-# suppress inspection "UnusedProperty"
ide.mac.message.sheets.java.emulation.dialogs.description=Use Java message sheets based on awt dialogs instead of native sheets
linux.native.menu=false
linux.native.menu.description=Enables native menu on Ubuntu
windows.jumplist=true
-# suppress inspection "UnusedProperty"
windows.jumplist.description=Enables JumpLists on Windows
-# suppress inspection "UnusedProperty"
GRADLE.system.in.process=true
-# suppress inspection "UnusedProperty"
GRADLE.system.in.process.description=Whether IDEA should use 'in-process' mode for interaction with gradle api
grails.advanced.mode=false
@@ -363,7 +337,6 @@
darcula.use.native.fonts.on.linux.description=If false, uses DejaVu Sans 13pt
idea.4.5.laf.enabled=false
ide.libnotify.enabled=true
-# suppress inspection "UnusedProperty"
ide.libnotify.enabled.description=Enables notifications via LibNotify
cvs.roots.refresh.uses.vfs=true
cvs.roots.refresh.uses.vfs.description=Should CVS roots refresh after update use VFS
@@ -378,6 +351,7 @@
dsm.retina.darcula.legend.description=Experimental DSM legend component
ide.scratch.enabled=false
+ide.show.progress.without.status.bar=false
editor.injected.highlighting.enabled=true
editor.injected.highlighting.enabled.description=Disables injected fragments highlighting (requires project reopening)
@@ -398,15 +372,24 @@
ide.inertial.mouse.fix=false
ide.inertial.mouse.fix.description=See IDEA-71508
+ide.log.focuses=false
+ide.log.focuses.description=Enables logging of focuses (Time consuming)
+
emmet.segments.limit=50
+emmet.template.length.limit.kilobytes=15
command.line.execution.timeout=30
console.too.much.text.buffer.ratio=10
console.too.much.text.buffer.ratio.description=Used for disabling of console processing(console filters for highlights, foldings...),\n\
when there is too much of text to process.\n\
The ratio is used against the console cycle buffer size (idea.cycle.buffer.size/theRatio=maxTextLength).
+ide.file.settings.order.new=false
ide.new.project.settings=false
ide.new.project.settings.description=Temporary key for new project settings dialog UI
commonjs.complete.required.filename.with.extension=false
commonjs.complete.required.filename.with.extension.description=If checked, required filenames are completed with extension
+
+
+fix.jdk7.alt.shortcuts=true
+fix.jdk7.alt.shortcuts.description=Allow to use alt for shortcuts on MacOSX with jdk7+
\ No newline at end of file
diff --git a/platform/platform-resources-en/src/tips/QuickEvaluateExpression.html b/platform/platform-resources-en/src/tips/QuickEvaluateExpression.html
new file mode 100644
index 0000000..f625c3e
--- /dev/null
+++ b/platform/platform-resources-en/src/tips/QuickEvaluateExpression.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+ <p>To quickly evaluate the value of any expression while debugging the program,
+ hold Alt and click this expression to see its value and calculate it, call a method, etc. </p>
+
+ <p class="image">
+ <img src="images/quick_evaluate.png">
+ </p>
+
+</body>
+</html>
diff --git a/platform/platform-resources-en/src/tips/images/quick_evaluate.png b/platform/platform-resources-en/src/tips/images/quick_evaluate.png
new file mode 100644
index 0000000..13c6c4a
--- /dev/null
+++ b/platform/platform-resources-en/src/tips/images/quick_evaluate.png
Binary files differ
diff --git a/platform/platform-resources/src/META-INF/LangExtensions.xml b/platform/platform-resources/src/META-INF/LangExtensions.xml
index 0e66803..aaae5dd 100644
--- a/platform/platform-resources/src/META-INF/LangExtensions.xml
+++ b/platform/platform-resources/src/META-INF/LangExtensions.xml
@@ -361,25 +361,25 @@
serviceImplementation="com.intellij.codeInspection.ex.ProjectInspectionProfilesVisibleTreeState"/>
<!-- Editor -->
- <applicationConfigurable instance="com.intellij.application.options.editor.EditorOptions" id="editor" key="title.editor"
+ <applicationConfigurable groupId="editor" instance="com.intellij.application.options.editor.EditorOptions" id="editor" key="title.editor"
bundle="messages.ApplicationBundle" order="after appearance"
childrenEPName="com.intellij.editorOptionsProvider"/>
<projectService serviceInterface="com.intellij.semantic.SemService" serviceImplementation="com.intellij.semantic.SemServiceImpl"/>
<!-- Global Code Style -->
- <projectConfigurable instance="com.intellij.application.options.CodeStyleSchemesConfigurable" order="after colors"/>
+ <projectConfigurable groupId="editor" dynamic="true" displayName="Code Style" instance="com.intellij.application.options.CodeStyleSchemesConfigurable" order="after colors"/>
<applicationService serviceInterface="com.intellij.application.options.codeStyle.CodeStyleSchemesUIConfiguration"
serviceImplementation="com.intellij.application.options.codeStyle.CodeStyleSchemesUIConfiguration"/>
<!-- File Types -->
- <applicationConfigurable instance="com.intellij.openapi.fileTypes.impl.FileTypeConfigurable" id="preferences.fileTypes"
+ <applicationConfigurable groupId="editor" instance="com.intellij.openapi.fileTypes.impl.FileTypeConfigurable" id="preferences.fileTypes"
key="filetype.settings.title" bundle="messages.FileTypesBundle"/>
- <applicationConfigurable instance="com.intellij.codeInsight.intention.impl.config.IntentionSettingsConfigurable" id="intentions"/>
+ <applicationConfigurable groupId="editor" key="intention.settings" bundle="messages.CodeInsightBundle" instance="com.intellij.codeInsight.intention.impl.config.IntentionSettingsConfigurable" id="intentions"/>
<!-- Live Templates -->
- <applicationConfigurable instance="com.intellij.codeInsight.template.impl.LiveTemplatesConfigurable" id="editing.templates"
+ <applicationConfigurable groupId="editor" instance="com.intellij.codeInsight.template.impl.LiveTemplatesConfigurable" id="editing.templates"
key="templates.settings.page.title" bundle="messages.CodeInsightBundle"/>
<lookup.actionProvider implementation="com.intellij.codeInsight.template.impl.LiveTemplateLookupActionProvider"/>
<documentationProvider implementation="com.intellij.codeInsight.template.impl.LiveTemplateDocumentationProvider"/>
@@ -387,15 +387,15 @@
serviceImplementation="com.intellij.codeInsight.template.impl.TemplateManagerImpl"/>
<!-- File Templates-->
- <applicationConfigurable instance="com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable" id="fileTemplates"
+ <applicationConfigurable groupId="editor" instance="com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable" id="fileTemplates"
key="title.file.templates" bundle="messages.IdeBundle"/>
<!-- T.O.D.O -->
- <applicationConfigurable instance="com.intellij.ide.todo.configurable.TodoConfigurable" id="preferences.toDoOptions" key="title.todo"
+ <applicationConfigurable groupId="editor" instance="com.intellij.ide.todo.configurable.TodoConfigurable" id="preferences.toDoOptions" key="title.todo"
bundle="messages.IdeBundle"/>
<!-- External Tools -->
- <applicationConfigurable instance="com.intellij.tools.ToolConfigurable" id="preferences.externalTools" key="tools.settings.title"
+ <applicationConfigurable groupId="tools" instance="com.intellij.tools.ToolConfigurable" id="preferences.externalTools" key="tools.settings.title"
bundle="messages.ToolsBundle"/>
<stepsBeforeRunProvider implementation="com.intellij.tools.ToolBeforeRunTaskProvider"/>
<checkinHandlerFactory implementation="com.intellij.tools.ExternalToolsCheckinHandlerFactory"/>
@@ -551,6 +551,8 @@
<customPasteProvider implementation="com.intellij.ide.actions.PasteReferenceProvider"/>
+ <referenceInjector implementation="com.intellij.codeInsight.daemon.impl.analysis.encoding.EncodingReferenceInjector"/>
+
<usageFilteringRuleProvider implementation="com.intellij.usages.impl.UsageFilteringRuleProviderImpl"/>
<usageGroupingRuleProvider implementation="com.intellij.usages.impl.UsageGroupingRuleProviderImpl"/>
@@ -751,8 +753,8 @@
<psi.fileReferenceHelper implementation="com.intellij.psi.impl.source.resolve.reference.impl.providers.HttpFileReferenceHelper"/>
<psi.fileReferenceHelper implementation="com.intellij.psi.impl.source.resolve.reference.impl.providers.NullFileReferenceHelper" order="last"/>
- <projectConfigurable instance="com.intellij.openapi.vfs.encoding.FileEncodingConfigurable"/>
- <projectConfigurable instance="com.intellij.ui.tabs.FileColorsConfigurable" id="fileColors" displayName="File Colors"/>
+ <projectConfigurable groupId="editor" key="file.encodings.configurable" bundle="messages.IdeBundle" instance="com.intellij.openapi.vfs.encoding.FileEncodingConfigurable"/>
+ <projectConfigurable groupId="appearance" instance="com.intellij.ui.tabs.FileColorsConfigurable" id="fileColors" displayName="File Colors"/>
<uiDebuggerExtension implementation="com.intellij.ui.debugger.extensions.PlaybackDebugger"/>
<uiDebuggerExtension implementation="com.intellij.ui.debugger.extensions.ActionTracer"/>
diff --git a/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml b/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml
index 61ee24e..e8a45ed 100644
--- a/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml
+++ b/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml
@@ -12,6 +12,9 @@
<extensionPoint name="errorHandler"
interface="com.intellij.openapi.diagnostic.ErrorReportSubmitter"/>
+ <extensionPoint name="jps.plugin"
+ beanClass="com.intellij.jps.impl.JpsPluginBean"/>
+
<extensionPoint name="codeInsight.containerProvider"
interface="com.intellij.codeInsight.ContainerProvider"/>
diff --git a/platform/platform-resources/src/META-INF/PlatformExtensions.xml b/platform/platform-resources/src/META-INF/PlatformExtensions.xml
index 851a91d..1f40bac 100644
--- a/platform/platform-resources/src/META-INF/PlatformExtensions.xml
+++ b/platform/platform-resources/src/META-INF/PlatformExtensions.xml
@@ -124,7 +124,7 @@
serviceImplementation="com.intellij.ide.passwordSafe.config.PasswordSafeSettings"/>
<applicationService serviceInterface="com.intellij.ide.passwordSafe.PasswordSafe"
serviceImplementation="com.intellij.ide.passwordSafe.impl.PasswordSafeImpl"/>
- <applicationConfigurable instance="com.intellij.ide.passwordSafe.config.PasswordSafeConfigurable" id="application.passwordSafe"
+ <applicationConfigurable parentId="preferences.general" instance="com.intellij.ide.passwordSafe.config.PasswordSafeConfigurable" id="application.passwordSafe"
displayName="Passwords"/>
<applicationService serviceInterface="com.intellij.execution.process.ColoredOutputTypeRegistry"
serviceImplementation="com.intellij.execution.process.ColoredOutputTypeRegistry"/>
@@ -193,32 +193,32 @@
<projectService serviceImplementation="com.intellij.openapi.editor.LazyRangeMarkerFactory"/>
<!-- General -->
- <applicationConfigurable instance="com.intellij.ide.GeneralSettingsConfigurable"/>
+ <applicationConfigurable groupId="appearance" key="title.general" bundle="messages.IdeBundle" id="preferences.general" instance="com.intellij.ide.GeneralSettingsConfigurable"/>
<!-- Appearance -->
- <applicationConfigurable instance="com.intellij.ide.ui.AppearanceConfigurable" id="appearance" key="title.appearance"
+ <applicationConfigurable groupId="appearance" instance="com.intellij.ide.ui.AppearanceConfigurable" id="appearance" key="title.appearance"
bundle="messages.IdeBundle"/>
<!-- Keymap -->
- <applicationConfigurable instance="com.intellij.openapi.keymap.impl.ui.KeymapPanel" id="preferences.keymap" key="keymap.display.name"
+ <applicationConfigurable groupId="appearance" instance="com.intellij.openapi.keymap.impl.ui.KeymapPanel" id="preferences.keymap" key="keymap.display.name"
bundle="messages.KeyMapBundle"/>
- <applicationConfigurable instance="com.intellij.openapi.keymap.impl.ui.QuickListsPanel" id="reference.idesettings.quicklists"
+ <applicationConfigurable parentId="appearance" instance="com.intellij.openapi.keymap.impl.ui.QuickListsPanel" id="reference.idesettings.quicklists"
displayName="Quick Lists"/>
<!-- Customizations -->
- <applicationConfigurable instance="com.intellij.ide.ui.customization.CustomizationConfigurable" id="preferences.customizations"
+ <applicationConfigurable parentId="appearance" instance="com.intellij.ide.ui.customization.CustomizationConfigurable" id="preferences.customizations"
key="title.customizations" bundle="messages.IdeBundle"/>
<!-- Notifications -->
- <applicationConfigurable instance="com.intellij.notification.impl.NotificationsConfigurable"/>
+ <applicationConfigurable groupId="appearance" displayName="Notifications" instance="com.intellij.notification.impl.NotificationsConfigurable"/>
<!-- Plugins -->
- <applicationConfigurable instance="com.intellij.ide.plugins.PluginManagerConfigurable" id="preferences.pluginManager"
+ <applicationConfigurable groupId="appearance" instance="com.intellij.ide.plugins.PluginManagerConfigurable" id="preferences.pluginManager"
displayName="Plugins"/>
<actionFromOptionDescriptorProvider implementation="com.intellij.ide.plugins.InstalledPluginsManagerMain$PluginsActionFromOptionDescriptorProvider"/>
- <applicationConfigurable instance="com.intellij.util.net.HTTPProxySettingsPanel" id="http.proxy" displayName="HTTP Proxy" />
- <applicationConfigurable instance="com.intellij.util.net.ssl.CertificateConfigurable"/>
- <applicationConfigurable instance="com.intellij.openapi.diff.impl.external.DiffOptionsForm" id="diff" displayName="External Diff Tools" />
+ <applicationConfigurable parentId="preferences.general" instance="com.intellij.util.net.HTTPProxySettingsPanel" id="http.proxy" displayName="HTTP Proxy" />
+ <applicationConfigurable groupId="tools" displayName="Server Certificates" instance="com.intellij.util.net.ssl.CertificateConfigurable"/>
+ <applicationConfigurable groupId="tools" instance="com.intellij.openapi.diff.impl.external.DiffOptionsForm" id="diff" displayName="External Diff Tools" />
<!--<applicationConfigurable instance="com.intellij.ui.switcher.QuickAccessConfigurable"/>-->
<fileTypeFactory implementation="com.intellij.openapi.fileTypes.impl.PlatformFileTypeFactory"/>
@@ -226,7 +226,7 @@
<applicationService serviceInterface="com.intellij.openapi.options.colors.ColorSettingsPages"
serviceImplementation="com.intellij.openapi.options.colors.pages.ColorSettingsPagesImpl"/>
- <applicationConfigurable instance="com.intellij.openapi.updateSettings.impl.UpdateSettingsConfigurable" id="preferences.updates"
+ <applicationConfigurable parentId="preferences.general" instance="com.intellij.openapi.updateSettings.impl.UpdateSettingsConfigurable" id="preferences.updates"
key="updates.settings.title" bundle="messages.IdeBundle"/>
<applicationService serviceInterface="com.intellij.psi.search.scope.packageSet.PackageSetFactory"
@@ -242,7 +242,7 @@
<componentConfigurationMerger implementation="com.intellij.openapi.vcs.changes.shelf.ShelfManagerConfigurationMerger"/>
<editorActionHandler action="EditorEscape" implementationClass="com.intellij.codeInsight.hint.EscapeHandler" id="hide-hints"/>
- <projectConfigurable instance="com.intellij.javaee.ExternalResourceConfigurable" key="display.name.edit.external.resource"
+ <projectConfigurable groupId="language" instance="com.intellij.javaee.ExternalResourceConfigurable" key="display.name.edit.external.resource"
bundle="messages.XmlBundle" id="preferences.externalResources">
<configurable instance="com.intellij.javaee.XMLCatalogConfigurable" displayName="XML Catalog" id="xml.catalog"/>
</projectConfigurable>
@@ -262,7 +262,7 @@
<statistics.usagesCollector implementation="com.intellij.internal.statistic.UiInfoUsageCollector"/>
<statistics.usagesCollector implementation="com.intellij.internal.statistic.JdkInfoUsageCollector"/>
- <applicationConfigurable instance="com.intellij.internal.statistic.configurable.StatisticsConfigurable" id="usage.statistics"
+ <applicationConfigurable parentId="preferences.general" instance="com.intellij.internal.statistic.configurable.StatisticsConfigurable" id="usage.statistics"
displayName="Usage Statistics"/>
<virtualFileSystem key="dummy" implementationClass="com.intellij.openapi.vfs.ex.dummy.DummyFileSystem"/>
diff --git a/platform/platform-resources/src/META-INF/PlatformLangPlugin.xml b/platform/platform-resources/src/META-INF/PlatformLangPlugin.xml
index baee8ad..b7a11c3 100644
--- a/platform/platform-resources/src/META-INF/PlatformLangPlugin.xml
+++ b/platform/platform-resources/src/META-INF/PlatformLangPlugin.xml
@@ -81,8 +81,8 @@
<programRunner implementation="com.intellij.execution.runners.BasicProgramRunner" order="last"/>
- <projectConfigurable provider="com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurableProvider" order="before intentions"/>
- <projectConfigurable instance="com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable" id="project.scopes" key="scopes.display.name" bundle="messages.IdeBundle" />
+ <projectConfigurable groupId="editor" displayName="Inspections" provider="com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurableProvider" order="before intentions"/>
+ <projectConfigurable groupId="project" instance="com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable" id="project.scopes" key="scopes.display.name" bundle="messages.IdeBundle" />
<checkoutCompletedListener implementation="com.intellij.openapi.vcs.checkout.PlatformProjectCheckoutListener" id="PlatformProjectCheckoutListener"/>
diff --git a/platform/platform-resources/src/META-INF/VcsExtensions.xml b/platform/platform-resources/src/META-INF/VcsExtensions.xml
index 9d40b35..a05f281 100644
--- a/platform/platform-resources/src/META-INF/VcsExtensions.xml
+++ b/platform/platform-resources/src/META-INF/VcsExtensions.xml
@@ -25,7 +25,7 @@
<selectInTarget implementation="com.intellij.openapi.vcs.changes.SelectInChangesViewTarget"/>
- <projectConfigurable instance="com.intellij.openapi.vcs.configurable.VcsManagerConfigurable" id="vcs"/>
+ <projectConfigurable groupId="project" dynamic="true" key="version.control.main.configurable.name" bundle="messages.VcsBundle" instance="com.intellij.openapi.vcs.configurable.VcsManagerConfigurable" id="vcs"/>
<changesViewContent tabName="Repository" className="com.intellij.openapi.vcs.changes.committed.CommittedChangesViewManager"
predicateClassName="com.intellij.openapi.vcs.changes.committed.CommittedChangesVisibilityPredicate"/>
diff --git a/platform/platform-resources/src/META-INF/XmlPlugin.xml b/platform/platform-resources/src/META-INF/XmlPlugin.xml
index 9da1e33..9a737df 100644
--- a/platform/platform-resources/src/META-INF/XmlPlugin.xml
+++ b/platform/platform-resources/src/META-INF/XmlPlugin.xml
@@ -182,7 +182,7 @@
serviceImplementation="com.intellij.application.options.editor.WebEditorOptions"/>
<exportable serviceInterface="com.intellij.application.options.editor.WebEditorOptions"/>
- <applicationConfigurable provider="com.intellij.application.options.emmet.EmmetConfigurableProvider"/>
+ <applicationConfigurable groupId="editor" key="emmet.configuration.title" bundle="messages.XmlBundle" provider="com.intellij.application.options.emmet.EmmetConfigurableProvider"/>
<applicationService serviceInterface="com.intellij.application.options.emmet.EmmetOptions"
serviceImplementation="com.intellij.application.options.emmet.EmmetOptions"/>
<exportable serviceInterface="com.intellij.application.options.emmet.EmmetOptions"/>
@@ -527,7 +527,7 @@
<selectInTarget implementation="com.intellij.ide.browsers.actions.SelectInDefaultBrowserTarget"/>
<xml.xmlExtension implementation="com.intellij.xml.HtmlXmlExtension"/>
- <applicationConfigurable instance="com.intellij.ide.browsers.BrowserSettings" id="reference.settings.ide.settings.web.browsers"
+ <applicationConfigurable groupId="tools" instance="com.intellij.ide.browsers.BrowserSettings" id="reference.settings.ide.settings.web.browsers"
key="browsers.settings" bundle="messages.IdeBundle"/>
<lang.inspectionSuppressor language="XML" implementationClass="com.intellij.codeInspection.XmlInspectionSuppressor"/>
</extensions>
diff --git a/platform/platform-resources/src/META-INF/xdebugger.xml b/platform/platform-resources/src/META-INF/xdebugger.xml
index 013a4d8..68111b8 100644
--- a/platform/platform-resources/src/META-INF/xdebugger.xml
+++ b/platform/platform-resources/src/META-INF/xdebugger.xml
@@ -15,7 +15,7 @@
<extensions defaultExtensionNs="com.intellij">
<colorSettingsPage implementation="com.intellij.xdebugger.impl.ui.DebuggerColorsPage"/>
- <applicationService serviceInterface="com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager"
+ <applicationService serviceInterface="com.intellij.xdebugger.settings.XDebuggerSettingsManager"
serviceImplementation="com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager"/>
<applicationService serviceInterface="com.intellij.xdebugger.XDebuggerUtil"
@@ -29,7 +29,7 @@
<projectService serviceInterface="com.intellij.xdebugger.impl.XDebuggerHistoryManager"
serviceImplementation="com.intellij.xdebugger.impl.XDebuggerHistoryManager"/>
- <applicationConfigurable provider="com.intellij.xdebugger.impl.settings.DebuggerConfigurableProvider"/>
+ <applicationConfigurable groupId="build" dynamic="true" key="debugger.configurable.display.name" bundle="messages.XDebuggerBundle" provider="com.intellij.xdebugger.impl.settings.DebuggerConfigurableProvider"/>
<customizableActionGroupProvider implementation="com.intellij.xdebugger.impl.ui.XDebugTabCustomizableActionGroupProvider"/>
diff --git a/platform/platform-resources/src/brokenPlugins.txt b/platform/platform-resources/src/brokenPlugins.txt
index d5678fd..438c23f 100644
--- a/platform/platform-resources/src/brokenPlugins.txt
+++ b/platform/platform-resources/src/brokenPlugins.txt
@@ -15,4 +15,5 @@
SBT 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.4.0 1.5.0
"JSTestDriver Plugin" 138.21 136.1141 134.1163 134.686 134.31 134.307 134.1039
AngularJS 134.1094 0.1.8 0.1.9
-org.jetbrains.plugins.vagrant 0.1 0.2
\ No newline at end of file
+org.jetbrains.plugins.vagrant 0.1 0.2
+org.intellij.clojure 0.2.1.178
\ No newline at end of file
diff --git a/platform/platform-resources/src/componentSets/Lang.xml b/platform/platform-resources/src/componentSets/Lang.xml
index bd3879e..89a9b36 100644
--- a/platform/platform-resources/src/componentSets/Lang.xml
+++ b/platform/platform-resources/src/componentSets/Lang.xml
@@ -37,6 +37,7 @@
<component>
<implementation-class>com.intellij.codeInsight.preview.ImageOrColorPreviewManager</implementation-class>
</component>
+
</application-components>
<project-components>
@@ -203,7 +204,8 @@
</component>
<component>
- <implementation-class>com.intellij.openapi.roots.impl.PushedFilePropertiesUpdater</implementation-class>
+ <interface-class>com.intellij.openapi.roots.impl.PushedFilePropertiesUpdater</interface-class>
+ <implementation-class>com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl</implementation-class>
</component>
<component>
@@ -225,6 +227,7 @@
<interface-class>com.intellij.ide.GeneratedSourceFileChangeTracker</interface-class>
<implementation-class>com.intellij.ide.GeneratedSourceFileChangeTrackerImpl</implementation-class>
</component>
+
</project-components>
<module-components>
diff --git a/platform/platform-resources/src/idea/PlatformLangActionManager.xml b/platform/platform-resources/src/idea/PlatformLangActionManager.xml
index c5d83d7..a5431fe 100644
--- a/platform/platform-resources/src/idea/PlatformLangActionManager.xml
+++ b/platform/platform-resources/src/idea/PlatformLangActionManager.xml
@@ -42,7 +42,7 @@
<group id="InspectCodeGroup">
<separator/>
<action id="InspectCode" class="com.intellij.codeInspection.actions.CodeInspectionAction"/>
- <action id="CodeCleanup" class="com.intellij.codeInspection.actions.CodeCleanupAction" internal="true"/>
+ <action id="CodeCleanup" class="com.intellij.codeInspection.actions.CodeCleanupAction"/>
<action id="RunInspection" class="com.intellij.codeInspection.actions.RunInspectionAction" />
<action id="PopupHector" class="com.intellij.codeInsight.daemon.impl.PopupHectorAction"/>
<action id="ViewOfflineInspection" class="com.intellij.codeInspection.actions.ViewOfflineResultsAction"/>
diff --git a/platform/platform-resources/src/idea/VcsActions.xml b/platform/platform-resources/src/idea/VcsActions.xml
index 935bcc7..dc15f19 100644
--- a/platform/platform-resources/src/idea/VcsActions.xml
+++ b/platform/platform-resources/src/idea/VcsActions.xml
@@ -265,6 +265,9 @@
<add-to-group group-id="CloseEditorsGroup" anchor="before" relative-to-action="CloseAllUnpinnedEditors"/>
</action>
+ <action id="RollbackLineStatusChanges" class="com.intellij.openapi.vcs.ex.RollbackLineStatusAction">
+ </action>
+
<action id="WelcomeScreen.GetFromVcs" class="com.intellij.openapi.wm.impl.welcomeScreen.GetFromVcsAction"
icon="AllIcons.General.GetProjectfromVCS">
<add-to-group group-id="WelcomeScreen.QuickStart" anchor="first"/>
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java
index 26be81d2..fdaf7c6 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java
@@ -245,6 +245,38 @@
"seven<caret>");
}
+ public void testCopyMultilineFromOneCaretPasteIntoTwo() throws Exception {
+ init("<selection>one\n" +
+ "two<caret></selection>\n" +
+ "three\n" +
+ "four",
+ TestFileType.TEXT);
+ executeAction("EditorCopy");
+ executeAction("EditorTextStart");
+ executeAction("EditorCloneCaretBelow");
+ executeAction("EditorPaste");
+ checkResultByText("one\n" +
+ "two<caret>one\n" +
+ "one\n" +
+ "two<caret>two\n" +
+ "three\n" +
+ "four");
+ }
+
+ public void testCopyPasteDoesNothingWithUnevenSelection() throws Exception {
+ init("<selection>one\n" +
+ "two<caret></selection>\n" +
+ "<selection>three<caret></selection>\n" +
+ "four",
+ TestFileType.TEXT);
+ executeAction("EditorCopy");
+ executeAction("EditorPaste");
+ checkResultByText("one\n" +
+ "two<caret>\n" +
+ "three<caret>\n" +
+ "four");
+ }
+
public void testEscapeAfterDragDown() throws Exception {
init("line1\n" +
"line2",
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/EditorActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/EditorActionTest.java
index deb63c1..20bfdac 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/EditorActionTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/EditorActionTest.java
@@ -102,4 +102,15 @@
deleteLine();
checkResultByText("");
}
+
+ public void testDeleteLineHonorSelection() throws Exception {
+ init("xxxx\n" +
+ "bla <selection><caret>bla\n" +
+ "bla</selection> bla\n" +
+ "yyy",
+ TestFileType.TEXT);
+ deleteLine();
+ checkResultByText("xxxx\n" +
+ "yyy<caret>");
+ }
}
\ No newline at end of file
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectUnselectOccurrenceActionsTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectUnselectOccurrenceActionsTest.java
index 34a08c0..c1cc857 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectUnselectOccurrenceActionsTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectUnselectOccurrenceActionsTest.java
@@ -194,6 +194,63 @@
"another line");
}
+ public void testSelectingAdjacentFragments() throws Exception {
+ init("fragment<selection>fragment<caret></selection>");
+ executeAction();
+ executeAction();
+ checkResult("<selection>fragment<caret></selection><selection>fragment<caret></selection>");
+ }
+
+ public void testSkippingOccurrence() throws Exception {
+ init("fr<caret>uit\n" +
+ "fruits\n" +
+ "fruit\n" +
+ "fruits\n" +
+ "fruit");
+ executeAction();
+ executeAction();
+ executeFindNext();
+ checkResult("<selection>fr<caret>uit</selection>\n" +
+ "fruits\n" +
+ "fruit\n" +
+ "fruits\n" +
+ "<selection>fr<caret>uit</selection>");
+ }
+
+ public void testMovingSelectionBackAndForth() throws Exception {
+ init("fr<caret>uit\n" +
+ "fruits\n" +
+ "fruit\n" +
+ "fruits\n" +
+ "fruit");
+ executeAction();
+ executeAction();
+ executeFindNext();
+ executeFindPrevious();
+ executeAction();
+ checkResult("<selection>fr<caret>uit</selection>\n" +
+ "fruits\n" +
+ "<selection>fr<caret>uit</selection>\n" +
+ "fruits\n" +
+ "<selection>fr<caret>uit</selection>");
+ }
+
+ public void testSkipDoesNotRemovePreviousSelections() throws Exception {
+ init("<caret>fruit\n" +
+ "fruit\n" +
+ "fruit");
+ executeAction();
+ executeAction();
+ executeFindNext();
+ executeFindNext();
+ assertEquals(1, hintCount);
+ executeFindNext();
+ assertEquals(1, hintCount);
+ checkResult("<selection><caret>fruit</selection>\n" +
+ "fruit\n" +
+ "<selection><caret>fruit</selection>");
+ }
+
private void init(String text) {
myFixture.configureByText(FileTypes.PLAIN_TEXT, text);
}
@@ -206,6 +263,14 @@
myFixture.performEditorAction(IdeActions.ACTION_SELECT_NEXT_OCCURENCE);
}
+ private void executeFindNext() {
+ myFixture.performEditorAction(IdeActions.ACTION_FIND_NEXT);
+ }
+
+ private void executeFindPrevious() {
+ myFixture.performEditorAction(IdeActions.ACTION_FIND_PREVIOUS);
+ }
+
private void executeReverseAction() {
myFixture.performEditorAction(IdeActions.ACTION_UNSELECT_PREVIOUS_OCCURENCE);
}
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapperTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapperTest.java
index 6589fb3..7448c6c 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapperTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapperTest.java
@@ -122,6 +122,8 @@
final Project project = myMockery.mock(Project.class);
final SoftWrapPainter painter = myMockery.mock(SoftWrapPainter.class);
+ myRepresentationHelper = new MockEditorTextRepresentationHelper(SPACE_SIZE, TAB_SIZE);
+
myMockery.checking(new Expectations() {{
// Document
allowing(myEditor).getDocument();will(returnValue(myDocument));
@@ -165,6 +167,7 @@
return getSoftWrap((Integer)invocation.getParameter(0));
}
});
+ allowing(mySoftWrapModel).getEditorTextRepresentationHelper(); will(returnValue(myRepresentationHelper));
// Folding.
allowing(myEditor).getFoldingModel();will(returnValue(myFoldingModel));
@@ -220,9 +223,7 @@
allowing(painter).getMinDrawingWidth(SoftWrapDrawingType.AFTER_SOFT_WRAP); will(returnValue(SOFT_WRAP_DRAWING_WIDTH));
}});
- myRepresentationHelper = new MockEditorTextRepresentationHelper(SPACE_SIZE, TAB_SIZE);
-
- myMapper = new CachingSoftWrapDataMapper(myEditor, myStorage, myRepresentationHelper);
+ myMapper = new CachingSoftWrapDataMapper(myEditor, myStorage);
}
@After
@@ -699,7 +700,7 @@
int foldingStartVisualColumn;
TestEditorPosition() {
- super(myEditor, myRepresentationHelper);
+ super(myEditor);
lineStartPosition = clone();
}
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java
index db9cebf..9695bf8 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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 @@
import com.intellij.ide.ui.UISettings;
import com.intellij.mock.Mock;
+import com.intellij.openapi.fileEditor.impl.EditorWindow;
import com.intellij.openapi.fileEditor.impl.EditorWithProviderComposite;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
@@ -101,6 +102,20 @@
assertEquals("mockEditor", myManager.getSelectedEditor(file).getName());
}
+ public void testWindowClosingRetainsOtherWindows() throws Exception {
+ VirtualFile file = getFile("/src/1.txt");
+ assertNotNull(file);
+ myManager.openFile(file, false);
+ EditorWindow primaryWindow = myManager.getCurrentWindow();
+ assertNotNull(primaryWindow);
+ myManager.createSplitter(SwingConstants.VERTICAL, primaryWindow);
+ EditorWindow secondaryWindow = myManager.getNextWindow(primaryWindow);
+ assertNotNull(secondaryWindow);
+ myManager.createSplitter(SwingConstants.VERTICAL, secondaryWindow);
+ myManager.closeFile(file, primaryWindow);
+ assertEquals(2, myManager.getWindows().length);
+ }
+
private static final String STRING = "<component name=\"FileEditorManager\">\n" +
" <leaf>\n" +
" <file leaf-file-name=\"1.txt\" pinned=\"false\" current=\"false\" current-in-tab=\"false\">\n" +
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandlerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandlerTest.java
new file mode 100644
index 0000000..490aa29
--- /dev/null
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandlerTest.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2000-2014 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.keymap.impl;
+
+import com.intellij.ide.IdeEventQueue;
+import com.intellij.openapi.actionSystem.ActionManager;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.KeyboardShortcut;
+import com.intellij.openapi.keymap.KeymapManager;
+import com.intellij.openapi.util.Clock;
+import com.intellij.testFramework.LightPlatformTestCase;
+
+import javax.swing.*;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+
+public class ModifierKeyDoubleClickHandlerTest extends LightPlatformTestCase {
+ private static final String MY_SHIFT_SHIFT_ACTION = "ModifierKeyDoubleClickHandlerTest.action1";
+ private static final String MY_SHIFT_KEY_ACTION = "ModifierKeyDoubleClickHandlerTest.action2";
+ private static final String MY_SHIFT_SHIFT_KEY_ACTION = "ModifierKeyDoubleClickHandlerTest.action3";
+
+ public static final KeyboardShortcut SHIFT_KEY_SHORTCUT = new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE,
+ InputEvent.SHIFT_MASK),
+ null);
+
+ private final JComponent myComponent = new JPanel();
+
+ private long myCurrentTime;
+ private int myShiftShiftActionInvocationCount;
+ private int myShiftKeyActionInvocationCount;
+ private int myShiftShiftKeyActionInvocationCount;
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ Clock.setTime(0);
+ ActionManager.getInstance().registerAction(MY_SHIFT_SHIFT_ACTION, new AnAction() {
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ myShiftShiftActionInvocationCount++;
+ }
+ });
+ ActionManager.getInstance().registerAction(MY_SHIFT_KEY_ACTION, new AnAction() {
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ myShiftKeyActionInvocationCount++;
+ }
+ });
+ ActionManager.getInstance().registerAction(MY_SHIFT_SHIFT_KEY_ACTION, new AnAction() {
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ myShiftShiftKeyActionInvocationCount++;
+ }
+ });
+ KeymapManager.getInstance().getActiveKeymap().addShortcut(MY_SHIFT_KEY_ACTION, SHIFT_KEY_SHORTCUT);
+ ModifierKeyDoubleClickHandler.getInstance().registerAction(MY_SHIFT_SHIFT_ACTION, KeyEvent.VK_SHIFT, -1);
+ ModifierKeyDoubleClickHandler.getInstance().registerAction(MY_SHIFT_SHIFT_KEY_ACTION, KeyEvent.VK_SHIFT, KeyEvent.VK_BACK_SPACE);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ ModifierKeyDoubleClickHandler.getInstance().unregisterAction(MY_SHIFT_SHIFT_KEY_ACTION);
+ ModifierKeyDoubleClickHandler.getInstance().unregisterAction(MY_SHIFT_SHIFT_ACTION);
+ KeymapManager.getInstance().getActiveKeymap().removeShortcut(MY_SHIFT_KEY_ACTION, SHIFT_KEY_SHORTCUT);
+ ActionManager.getInstance().unregisterAction(MY_SHIFT_SHIFT_KEY_ACTION);
+ ActionManager.getInstance().unregisterAction(MY_SHIFT_KEY_ACTION);
+ ActionManager.getInstance().unregisterAction(MY_SHIFT_SHIFT_ACTION);
+ Clock.reset();
+ super.tearDown();
+ }
+
+ public void testShiftShiftSuccessfulCase() {
+ press();
+ release();
+ press();
+ assertInvocationCounts(0, 0, 0);
+ release();
+ assertInvocationCounts(0, 1, 0);
+ }
+
+ public void testLongSecondClick() {
+ press();
+ release();
+ press();
+ timeStep(400);
+ release();
+ assertInvocationCounts(0, 0, 0);
+ }
+
+ public void testShiftShiftKeySuccessfulCase() {
+ press();
+ release();
+ press();
+ key();
+ assertInvocationCounts(0, 0, 1);
+ release();
+ assertInvocationCounts(0, 0, 1);
+ }
+
+ public void testShiftKey() {
+ press();
+ key();
+ assertInvocationCounts(1, 0, 0);
+ release();
+ }
+
+ public void assertInvocationCounts(int shiftKeyCount, int shiftShiftCount, int shiftShiftKeyCount) {
+ assertEquals(shiftKeyCount, myShiftKeyActionInvocationCount);
+ assertEquals(shiftShiftCount, myShiftShiftActionInvocationCount);
+ assertEquals(shiftShiftKeyCount, myShiftShiftKeyActionInvocationCount);
+ }
+
+ private void press() {
+ IdeEventQueue.getInstance().dispatchEvent(new KeyEvent(myComponent,
+ KeyEvent.KEY_PRESSED,
+ Clock.getTime(),
+ InputEvent.SHIFT_MASK,
+ KeyEvent.VK_SHIFT,
+ KeyEvent.CHAR_UNDEFINED));
+ }
+
+ private void release() {
+ IdeEventQueue.getInstance().dispatchEvent(new KeyEvent(myComponent,
+ KeyEvent.KEY_RELEASED,
+ Clock.getTime(),
+ 0,
+ KeyEvent.VK_SHIFT,
+ KeyEvent.CHAR_UNDEFINED));
+ }
+
+ private void key() {
+ IdeEventQueue.getInstance().dispatchEvent(new KeyEvent(myComponent,
+ KeyEvent.KEY_PRESSED,
+ Clock.getTime(),
+ InputEvent.SHIFT_MASK,
+ KeyEvent.VK_BACK_SPACE,
+ '\b'));
+ IdeEventQueue.getInstance().dispatchEvent(new KeyEvent(myComponent,
+ KeyEvent.KEY_TYPED,
+ Clock.getTime(),
+ InputEvent.SHIFT_MASK,
+ 0,
+ '\b'));
+ IdeEventQueue.getInstance().dispatchEvent(new KeyEvent(myComponent,
+ KeyEvent.KEY_RELEASED,
+ Clock.getTime(),
+ InputEvent.SHIFT_MASK,
+ KeyEvent.VK_BACK_SPACE,
+ '\b'));
+ }
+
+ private void timeStep(long step) {
+ Clock.setTime(myCurrentTime += step);
+ }
+}
diff --git a/platform/platform-tests/testSrc/com/intellij/patterns/StandardPatternsTest.java b/platform/platform-tests/testSrc/com/intellij/patterns/StandardPatternsTest.java
index 1e05add..1db3f31 100644
--- a/platform/platform-tests/testSrc/com/intellij/patterns/StandardPatternsTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/patterns/StandardPatternsTest.java
@@ -1,11 +1,23 @@
/*
- * Copyright (c) 2000-2007 JetBrains s.r.o. All Rights Reserved.
+ * Copyright 2000-2014 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.patterns;
import com.intellij.openapi.util.Key;
-import com.intellij.testFramework.UsefulTestCase;
import com.intellij.util.ProcessingContext;
+import junit.framework.TestCase;
import java.util.Arrays;
@@ -14,37 +26,15 @@
/**
* @author peter
*/
-public class StandardPatternsTest extends UsefulTestCase {
+public class StandardPatternsTest extends TestCase {
- public void testNull() throws Throwable {
+ public void testNull() {
assertTrue(object().isNull().accepts(null));
assertFalse(object().isNull().accepts(""));
assertFalse(string().isNull().accepts(""));
assertTrue(string().isNull().accepts(null));
}
- public void testString() throws Throwable {
- final ElementPattern pattern = string();
- assertFalse(string().accepts(new Object()));
- assertTrue(pattern.accepts(""));
- }
-
- public void testStartsWith() throws Throwable {
- final ElementPattern pattern = string().startsWith("abc");
- assertFalse(pattern.accepts(""));
- assertTrue(pattern.accepts("abcd"));
- assertTrue(pattern.accepts("abc"));
-
- assertFalse(string().startsWith("abc").accepts(new Object()));
- }
-
- public void testEndsWith() throws Throwable {
- final ElementPattern pattern = string().endsWith("abc");
- assertFalse(pattern.accepts(""));
- assertFalse(pattern.accepts("abcd"));
- assertTrue(pattern.accepts("abc"));
- }
-
private static void checkPrefixSuffix(final ElementPattern pattern) {
assertFalse(pattern.accepts(""));
assertFalse(pattern.accepts("abcd"));
@@ -53,23 +43,23 @@
assertFalse(pattern.accepts("abcdab"));
}
- public void testPrefixSuffix() throws Throwable {
+ public void testPrefixSuffix() {
checkPrefixSuffix(string().endsWith("abc").startsWith("abc"));
}
- public void testAnd1() throws Throwable {
+ public void testAnd1() {
checkPrefixSuffix(and(string().endsWith("abc"), string().startsWith("abc")));
}
- public void testAnd2() throws Throwable {
+ public void testAnd2() {
checkPrefixSuffix(string().endsWith("abc").and(string().startsWith("abc")));
}
- public void testOr1() throws Throwable {
+ public void testOr1() {
checkOr(or(string().endsWith("abc"), string().startsWith("abc")));
}
- public void testNot1() throws Throwable {
+ public void testNot1() {
final ElementPattern pattern = not(or(string().endsWith("abc"), string().startsWith("abc")));
assertTrue(pattern.accepts(""));
assertTrue(pattern.accepts("xxx"));
@@ -90,7 +80,7 @@
assertTrue(filterFactory.accepts("abcdab"));
}
- public void testEquals() throws Throwable {
+ public void testEquals() {
final Object foo = new Object();
final Object bar = new Object();
ElementPattern objectPattern = object().equalTo(foo);
@@ -103,15 +93,14 @@
}
-
- public void testAll() throws Throwable {
+ public void testAll() {
ElementPattern pattern = collection(String.class).all(string().startsWith("abc"));
assertTrue(pattern.accepts(Arrays.asList("abc")));
assertTrue(pattern.accepts(Arrays.asList("abc", "abcd")));
assertFalse(pattern.accepts(Arrays.asList("abc", "bcd")));
}
- public void testAtLeastOne() throws Throwable {
+ public void testAtLeastOne() {
ElementPattern pattern = collection(String.class).atLeastOne(string().startsWith("abc"));
assertTrue(pattern.accepts(Arrays.asList("abc")));
assertTrue(pattern.accepts(Arrays.asList("abc", "abcd")));
@@ -120,15 +109,16 @@
assertTrue(pattern.accepts(Arrays.asList("bc", "abc")));
}
- public void testFilter() throws Throwable {
- ElementPattern pattern = collection(String.class).filter(string().endsWith("x"), collection(String.class).all(string().startsWith("abc")));
+ public void testFilter() {
+ ElementPattern pattern =
+ collection(String.class).filter(string().endsWith("x"), collection(String.class).all(string().startsWith("abc")));
assertTrue(pattern.accepts(Arrays.asList("abc")));
assertTrue(pattern.accepts(Arrays.asList("abc", "abcd")));
assertFalse(pattern.accepts(Arrays.asList("bcx", "bcd")));
assertTrue(pattern.accepts(Arrays.asList("abcx", "abc")));
}
- public void testFirst() throws Throwable {
+ public void testFirst() {
ElementPattern pattern = collection(String.class).first(string().startsWith("abc"));
assertFalse(pattern.accepts(Arrays.<String>asList()));
assertTrue(pattern.accepts(Arrays.asList("abc")));
@@ -138,7 +128,7 @@
assertFalse(pattern.accepts(Arrays.asList("bc", "abc")));
}
- public void testLast() throws Throwable {
+ public void testLast() {
//collection(String.class)
ElementPattern pattern = collection(String.class).last(string().startsWith("abc"));
@@ -150,7 +140,7 @@
assertTrue(pattern.accepts(Arrays.asList("bc", "abc")));
}
- public void testSize() throws Throwable {
+ public void testSize() {
final CollectionPattern<String> filter = collection(String.class);
assertTrue(filter.size(0).accepts(Arrays.<String>asList()));
assertFalse(filter.size(0).accepts(Arrays.asList("abc")));
@@ -165,7 +155,7 @@
assertTrue(filter.size(2).accepts(Arrays.asList("abc", "abc")));
}
- public void testEmpty() throws Throwable {
+ public void testEmpty() {
final CollectionPattern<String> filter = collection(String.class);
assertTrue(filter.empty().accepts(Arrays.<String>asList()));
assertFalse(filter.empty().accepts(Arrays.asList("abc")));
@@ -176,7 +166,7 @@
assertTrue(not(filter.empty()).accepts(Arrays.asList("abc", "abc")));
}
- public void testSave() throws Throwable {
+ public void testSave() {
Key<String> key = Key.create("abc");
final ProcessingContext context = new ProcessingContext();
assertFalse(string().contains("abc").save(key).accepts(null));
@@ -189,6 +179,4 @@
assertTrue(string().contains("abc").save(key).accepts(s, context));
assertSame(s, context.get(key));
}
-
-
}
diff --git a/platform/platform-tests/testSrc/com/intellij/patterns/StringPatternTest.java b/platform/platform-tests/testSrc/com/intellij/patterns/StringPatternTest.java
new file mode 100644
index 0000000..11a6eac
--- /dev/null
+++ b/platform/platform-tests/testSrc/com/intellij/patterns/StringPatternTest.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2000-2014 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.patterns;
+
+import junit.framework.TestCase;
+
+import static com.intellij.patterns.StandardPatterns.string;
+
+public class StringPatternTest extends TestCase {
+
+ public void testString() {
+ final ElementPattern pattern = string();
+ assertFalse(string().accepts(new Object()));
+ assertTrue(pattern.accepts(""));
+ }
+
+ public void testStartsWith() {
+ final ElementPattern pattern = string().startsWith("abc");
+ assertFalse(pattern.accepts(""));
+ assertTrue(pattern.accepts("abcd"));
+ assertTrue(pattern.accepts("abc"));
+
+ assertFalse(string().startsWith("abc").accepts(new Object()));
+ }
+
+ public void testEndsWith() {
+ final ElementPattern pattern = string().endsWith("abc");
+ assertFalse(pattern.accepts(""));
+ assertFalse(pattern.accepts("abcd"));
+ assertTrue(pattern.accepts("abc"));
+ }
+
+ public void testLongerThan() {
+ final ElementPattern pattern = string().longerThan(2);
+ assertFalse(pattern.accepts(""));
+ assertFalse(pattern.accepts("01"));
+ assertTrue(pattern.accepts("012"));
+ }
+
+ public void testShorterThan() {
+ final ElementPattern pattern = string().shorterThan(2);
+ assertTrue(pattern.accepts(""));
+ assertTrue(pattern.accepts("1"));
+ assertFalse(pattern.accepts("12"));
+ }
+
+ public void testWithLength() {
+ final ElementPattern pattern = string().withLength(2);
+ assertFalse(pattern.accepts(""));
+ assertFalse(pattern.accepts("1"));
+ assertTrue(pattern.accepts("12"));
+ }
+
+ public void testContains() {
+ final ElementPattern pattern = string().contains("abc");
+ assertFalse(pattern.accepts(""));
+ assertFalse(pattern.accepts("acb"));
+ assertFalse(pattern.accepts("ABC"));
+ assertTrue(pattern.accepts("01abcd"));
+ }
+
+ public void testContainsChars() {
+ final ElementPattern pattern = string().containsChars("abc");
+ assertFalse(pattern.accepts(""));
+ assertFalse(pattern.accepts("ABC"));
+ assertTrue(pattern.accepts("01a"));
+ assertTrue(pattern.accepts("01c"));
+ assertTrue(pattern.accepts("01b"));
+ }
+
+ public void testOneOfIgnoreCase() {
+ final ElementPattern pattern = string().oneOfIgnoreCase("a", "B");
+ assertFalse(pattern.accepts(""));
+ assertFalse(pattern.accepts("ab"));
+ assertFalse(pattern.accepts("d01x"));
+ assertTrue(pattern.accepts("A"));
+ assertTrue(pattern.accepts("b"));
+ }
+}
diff --git a/platform/platform-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java b/platform/platform-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java
index 718ee8e..2ab0446 100644
--- a/platform/platform-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java
@@ -75,7 +75,7 @@
}
public void testDocumentGced() throws Exception {
- VirtualFile vFile = createFile();
+ VirtualFile vFile = getVirtualFile(createTempFile("txt", "abc"));
PsiDocumentManagerImpl documentManager = getPsiDocumentManager();
long id = System.identityHashCode(documentManager.getDocument(getPsiManager().findFile(vFile)));
@@ -93,7 +93,7 @@
});
//Class.forName("com.intellij.util.ProfilingUtil").getDeclaredMethod("forceCaptureMemorySnapshot").invoke(null);
- for (int i=0;i<1000;i++) {
+ for (int i = 0; i < 1000; i++) {
PlatformTestUtil.tryGcSoftlyReachableObjects();
UIUtil.dispatchAllInvocationEvents();
if (documentManager.getCachedDocument(getPsiManager().findFile(vFile)) == null) break;
diff --git a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java
index 085afbf..3fcc42b 100644
--- a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java
@@ -26,7 +26,7 @@
import com.intellij.psi.PsiFile;
import com.intellij.psi.impl.source.PsiFileImpl;
import com.intellij.testFramework.LeakHunter;
-import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
+import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
import com.intellij.usageView.UsageInfo;
import com.intellij.usages.*;
import com.intellij.util.ui.UIUtil;
@@ -34,9 +34,9 @@
/**
* User: cdr
*/
-public class UsageViewTest extends LightPlatformCodeInsightTestCase{
+public class UsageViewTest extends LightPlatformCodeInsightFixtureTestCase {
public void testUsageViewDoesNotHoldPsiFilesOrDocuments() throws Exception {
- PsiFile psiFile = createFile("X.java", "public class X{} //iuggjhfg");
+ PsiFile psiFile = myFixture.addFileToProject("X.java", "public class X{} //iuggjhfg");
Usage[] usages = new Usage[100];
for (int i = 0; i < usages.length; i++) {
usages[i] = createUsage(psiFile,i);
@@ -55,7 +55,7 @@
}
public void testUsageViewHandlesDocumentChange() throws Exception {
- PsiFile psiFile = createFile("X.java", "public class X{ int xxx; } //comment");
+ PsiFile psiFile = myFixture.addFileToProject("X.java", "public class X{ int xxx; } //comment");
Usage usage = createUsage(psiFile, psiFile.getText().indexOf("xxx"));
UsageView usageView = UsageViewManager.getInstance(getProject()).createUsageView(UsageTarget.EMPTY_ARRAY, new Usage[]{usage}, new UsageViewPresentation(), null);
@@ -69,7 +69,7 @@
assertEquals(psiFile.getText().indexOf("xxx"), navigationOffset);
}
public void testTextUsageInfoHandlesDocumentChange() throws Exception {
- PsiFile psiFile = createFile("X.java", "public class X{ int xxx; } //comment");
+ PsiFile psiFile = myFixture.addFileToProject("X.java", "public class X{ int xxx; } //comment");
Usage usage = new UsageInfo2UsageAdapter(new UsageInfo(psiFile, psiFile.getText().indexOf("xxx"), StringUtil.indexOfSubstringEnd(psiFile.getText(),"xxx")));
UsageView usageView = UsageViewManager.getInstance(getProject()).createUsageView(UsageTarget.EMPTY_ARRAY, new Usage[]{usage}, new UsageViewPresentation(), null);
diff --git a/platform/projectModel-api/src/com/intellij/openapi/roots/ProjectFileIndex.java b/platform/projectModel-api/src/com/intellij/openapi/roots/ProjectFileIndex.java
index 8ada839..b06cf06 100644
--- a/platform/projectModel-api/src/com/intellij/openapi/roots/ProjectFileIndex.java
+++ b/platform/projectModel-api/src/com/intellij/openapi/roots/ProjectFileIndex.java
@@ -129,11 +129,18 @@
boolean isInLibrarySource(@NotNull VirtualFile fileOrDir);
/**
- * Checks if the specified file or directory is ignored (either excluded by exclude roots
- * or ignored by {@link com.intellij.openapi.fileTypes.FileTypeManager#isFileIgnored(String)}).
+ * @deprecated name of this method may be confusing. If you want to check if the file is excluded or ignored use {@link #isExcluded(com.intellij.openapi.vfs.VirtualFile)}.
+ * If you want to check if the file is ignored use {@link com.intellij.openapi.fileTypes.FileTypeRegistry#isFileIgnored(com.intellij.openapi.vfs.VirtualFile)}.
+ */
+ @Deprecated
+ boolean isIgnored(@NotNull VirtualFile file);
+
+ /**
+ * Checks if the specified file or directory is located under project roots but the file itself or one of its parent directories is
+ * either excluded from the project or ignored by {@link com.intellij.openapi.fileTypes.FileTypeRegistry#isFileIgnored(com.intellij.openapi.vfs.VirtualFile)}).
*
* @param file the file to check.
- * @return true if <code>file</code> is ignored, false otherwise.
+ * @return true if <code>file</code> is excluded or ignored, false otherwise.
*/
- boolean isIgnored(@NotNull VirtualFile file);
+ boolean isExcluded(@NotNull VirtualFile file);
}
diff --git a/platform/projectModel-impl/src/com/intellij/ide/projectView/impl/ProjectRootsUtil.java b/platform/projectModel-impl/src/com/intellij/ide/projectView/impl/ProjectRootsUtil.java
index c0c4c49..7acb0fb 100644
--- a/platform/projectModel-impl/src/com/intellij/ide/projectView/impl/ProjectRootsUtil.java
+++ b/platform/projectModel-impl/src/com/intellij/ide/projectView/impl/ProjectRootsUtil.java
@@ -109,4 +109,16 @@
}
return null;
}
+
+ @Nullable
+ public static ExcludeFolder findExcludeFolder(@NotNull Module module, @NotNull VirtualFile root) {
+ for (ContentEntry entry : ModuleRootManager.getInstance(module).getContentEntries()) {
+ for (ExcludeFolder folder : entry.getExcludeFolders()) {
+ if (root.equals(folder.getFile())) {
+ return folder;
+ }
+ }
+ }
+ return null;
+ }
}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/lang/LanguagePerFileMappings.java b/platform/projectModel-impl/src/com/intellij/lang/LanguagePerFileMappings.java
similarity index 100%
rename from platform/lang-impl/src/com/intellij/lang/LanguagePerFileMappings.java
rename to platform/projectModel-impl/src/com/intellij/lang/LanguagePerFileMappings.java
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/ModuleRootModificationUtil.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/ModuleRootModificationUtil.java
index 3bf16fc..0b4f135 100644
--- a/platform/projectModel-impl/src/com/intellij/openapi/roots/ModuleRootModificationUtil.java
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/ModuleRootModificationUtil.java
@@ -22,10 +22,12 @@
import com.intellij.openapi.roots.impl.libraries.LibraryEx;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.util.Computable;
+import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Consumer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -167,6 +169,28 @@
}
}
+ public static void updateExcludedFolders(final Module module,
+ @NotNull final VirtualFile contentRoot,
+ final Collection<String> urlsToUnExclude,
+ final Collection<String> urlsToExclude) {
+ updateModel(module, new Consumer<ModifiableRootModel>() {
+ @Override
+ public void consume(ModifiableRootModel modifiableModel) {
+ for (final ContentEntry contentEntry : modifiableModel.getContentEntries()) {
+ if (contentRoot.equals(contentEntry.getFile())) {
+ for (String url : urlsToUnExclude) {
+ contentEntry.removeExcludeFolder(url);
+ }
+ for (String url : urlsToExclude) {
+ contentEntry.addExcludeFolder(url);
+ }
+ break;
+ }
+ }
+ }
+ });
+ }
+
private static void doWriteAction(final Runnable action) {
final Application application = ApplicationManager.getApplication();
application.invokeAndWait(new Runnable() {
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndex.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndex.java
index 635a6f1..9fdd8e0 100644
--- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndex.java
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndex.java
@@ -34,14 +34,20 @@
@TestOnly
public abstract void checkConsistency();
+ /**
+ * The same as {@link #getInfoForFile} but works only for directories or file roots and returns {@code null} for directories
+ * which aren't included in project content or libraries
+ * @deprecated use {@link #getInfoForFile(com.intellij.openapi.vfs.VirtualFile)} instead
+ */
+ @Deprecated
public abstract DirectoryInfo getInfoForDirectory(@NotNull VirtualFile dir);
+ @NotNull
+ public abstract DirectoryInfo getInfoForFile(@NotNull VirtualFile file);
+
@Nullable
public abstract JpsModuleSourceRootType<?> getSourceRootType(@NotNull DirectoryInfo info);
- public abstract boolean isProjectExcludeRoot(@NotNull VirtualFile dir);
- public abstract boolean isModuleExcludeRoot(@NotNull VirtualFile dir);
-
@NotNull
public abstract
Query<VirtualFile> getDirectoriesByPackageName(@NotNull String packageName, boolean includeLibrarySources);
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryInfo.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryInfo.java
index dfff497..87448a5 100644
--- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryInfo.java
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryInfo.java
@@ -18,229 +18,59 @@
import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.OrderEntry;
-import com.intellij.openapi.roots.OrderRootType;
-import com.intellij.openapi.roots.RootPolicy;
-import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.util.BitUtil;
-import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
import java.util.List;
public abstract class DirectoryInfo {
- public static final int MAX_ROOT_TYPE_ID = (1 << (Byte.SIZE - 2)) - 1;
- private final Module module; // module to which content it belongs or null
- private final VirtualFile libraryClassRoot; // class root in library
- private final VirtualFile contentRoot;
- private final VirtualFile sourceRoot;
+ /**
+ * @return {@code true} if located under project content or library roots and not excluded or ignored
+ */
+ public abstract boolean isInProject();
- private static final byte MODULE_SOURCE_FLAG = 1; // set if files in this directory belongs to sources of the module (if field 'module' is not null)
- private static final byte LIBRARY_SOURCE_FLAG = 2; // set if it's a directory with sources of some library
- private final byte sourceRootTypeData;//two least significant bits are used for MODULE_SOURCE_FLAG and LIBRARY_SOURCE_FLAG, the remaining bits store module root type id (source/tests/resources/...)
+ /**
+ * @return {@code true} if located under ignored directory
+ */
+ public abstract boolean isIgnored();
- DirectoryInfo(Module module,
- VirtualFile contentRoot,
- VirtualFile sourceRoot,
- VirtualFile libraryClassRoot,
- byte sourceRootTypeData) {
- this.module = module;
- this.libraryClassRoot = libraryClassRoot;
- this.contentRoot = contentRoot;
- this.sourceRoot = sourceRoot;
- this.sourceRootTypeData = sourceRootTypeData;
- }
+ /**
+ * @return {@code true} if located project content, output or library root but excluded from the project
+ */
+ public abstract boolean isExcluded();
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ public abstract boolean isInModuleSource();
- DirectoryInfo info = (DirectoryInfo)o;
-
- return sourceRootTypeData == info.sourceRootTypeData &&
- Comparing.equal(contentRoot, info.contentRoot) &&
- Comparing.equal(libraryClassRoot, info.libraryClassRoot) &&
- Comparing.equal(module, info.module) &&
- Arrays.equals(getOrderEntries(), info.getOrderEntries()) &&
- Comparing.equal(sourceRoot, info.sourceRoot);
- }
-
- @Override
- public int hashCode() {
- int result = module != null ? module.hashCode() : 0;
- result = 31 * result + (libraryClassRoot != null ? libraryClassRoot.hashCode() : 0);
- result = 31 * result + (contentRoot != null ? contentRoot.hashCode() : 0);
- result = 31 * result + (sourceRoot != null ? sourceRoot.hashCode() : 0);
- result = 31 * result + (int)sourceRootTypeData;
- return result;
- }
-
- @SuppressWarnings({"HardCodedStringLiteral"})
- public String toString() {
- return "DirectoryInfo{" +
- "module=" + getModule() +
- ", isInModuleSource=" + isInModuleSource() +
- ", rootTypeId=" + getSourceRootTypeId() +
- ", isInLibrarySource=" + isInLibrarySource() +
- ", libraryClassRoot=" + getLibraryClassRoot() +
- ", contentRoot=" + getContentRoot() +
- ", sourceRoot=" + getSourceRoot() +
- ", orderEntries=" + Arrays.toString(getOrderEntries()) +
- "}";
- }
-
- @NotNull
- public abstract OrderEntry[] getOrderEntries();
+ public abstract boolean isInLibrarySource();
@Nullable
- OrderEntry findOrderEntryWithOwnerModule(@NotNull Module ownerModule) {
- OrderEntry[] entries = getOrderEntries();
- if (entries.length < 10) {
- for (OrderEntry entry : entries) {
- if (entry.getOwnerModule() == ownerModule) return entry;
- }
- return null;
- }
- int index = Arrays.binarySearch(entries, createFakeOrderEntry(ownerModule), BY_OWNER_MODULE);
- return index < 0 ? null : entries[index];
- }
+ public abstract VirtualFile getSourceRoot();
- @NotNull
- List<OrderEntry> findAllOrderEntriesWithOwnerModule(@NotNull Module ownerModule) {
- OrderEntry[] entries = getOrderEntries();
- if (entries.length == 1) {
- OrderEntry entry = entries[0];
- return entry.getOwnerModule() == ownerModule ? Arrays.asList(entries) : Collections.<OrderEntry>emptyList();
- }
- int index = Arrays.binarySearch(entries, createFakeOrderEntry(ownerModule), BY_OWNER_MODULE);
- if (index < 0) {
- return Collections.emptyList();
- }
- int firstIndex = index;
- while (firstIndex-1 >= 0 && entries[firstIndex-1].getOwnerModule() == ownerModule) {
- firstIndex--;
- }
- int lastIndex = index+1;
- while (lastIndex < entries.length && entries[lastIndex].getOwnerModule() == ownerModule) {
- lastIndex++;
- }
-
- OrderEntry[] subArray = new OrderEntry[lastIndex - firstIndex];
- System.arraycopy(entries, firstIndex, subArray, 0, lastIndex - firstIndex);
-
- return Arrays.asList(subArray);
- }
-
- @NotNull
- private static OrderEntry createFakeOrderEntry(@NotNull final Module ownerModule) {
- return new OrderEntry() {
- @NotNull
- @Override
- public VirtualFile[] getFiles(OrderRootType type) {
- throw new IncorrectOperationException();
- }
-
- @NotNull
- @Override
- public String[] getUrls(OrderRootType rootType) {
- throw new IncorrectOperationException();
- }
-
- @NotNull
- @Override
- public String getPresentableName() {
- throw new IncorrectOperationException();
- }
-
- @Override
- public boolean isValid() {
- throw new IncorrectOperationException();
- }
-
- @NotNull
- @Override
- public Module getOwnerModule() {
- return ownerModule;
- }
-
- @Override
- public <R> R accept(RootPolicy<R> policy, @Nullable R initialValue) {
- throw new IncorrectOperationException();
- }
-
- @Override
- public int compareTo(@NotNull OrderEntry o) {
- throw new IncorrectOperationException();
- }
-
- @Override
- public boolean isSynthetic() {
- throw new IncorrectOperationException();
- }
- };
- }
-
- public static final Comparator<OrderEntry> BY_OWNER_MODULE = new Comparator<OrderEntry>() {
- @Override
- public int compare(OrderEntry o1, OrderEntry o2) {
- String name1 = o1.getOwnerModule().getName();
- String name2 = o2.getOwnerModule().getName();
- return name1.compareTo(name2);
- }
- };
-
- @Nullable
- public VirtualFile getSourceRoot() {
- return sourceRoot;
- }
-
- public VirtualFile getLibraryClassRoot() {
- return libraryClassRoot;
- }
+ public abstract int getSourceRootTypeId();
public boolean hasLibraryClassRoot() {
return getLibraryClassRoot() != null;
}
+ public abstract VirtualFile getLibraryClassRoot();
+
@Nullable
- public VirtualFile getContentRoot() {
- return contentRoot;
- }
+ public abstract VirtualFile getContentRoot();
- public boolean isInModuleSource() {
- return BitUtil.isSet(sourceRootTypeData, MODULE_SOURCE_FLAG);
- }
+ @Nullable
+ public abstract Module getModule();
- public boolean isInLibrarySource() {
- return BitUtil.isSet(sourceRootTypeData, LIBRARY_SOURCE_FLAG);
- }
+ @NotNull
+ public abstract OrderEntry[] getOrderEntries();
- public Module getModule() {
- return module;
- }
+ @Nullable
+ abstract OrderEntry findOrderEntryWithOwnerModule(@NotNull Module ownerModule);
+
+ @NotNull
+ abstract List<OrderEntry> findAllOrderEntriesWithOwnerModule(@NotNull Module ownerModule);
@TestOnly
- void assertConsistency() {
- OrderEntry[] entries = getOrderEntries();
- for (int i=1; i<entries.length; i++) {
- assert BY_OWNER_MODULE.compare(entries[i-1], entries[i]) <= 0;
- }
- }
-
- public int getSourceRootTypeId() {
- return sourceRootTypeData >> 2;
- }
-
- public static int createSourceRootTypeData(boolean isInModuleSources, boolean isInLibrarySource, int moduleSourceRootTypeId) {
- if (moduleSourceRootTypeId > MAX_ROOT_TYPE_ID) {
- throw new IllegalArgumentException("Module source root type id " + moduleSourceRootTypeId + " exceeds the maximum allowable value (" + MAX_ROOT_TYPE_ID + ")");
- }
- return (isInModuleSources ? MODULE_SOURCE_FLAG : 0) | (isInLibrarySource ? LIBRARY_SOURCE_FLAG : 0) | moduleSourceRootTypeId << 2;
- }
+ abstract void assertConsistency();
}
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryInfoImpl.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryInfoImpl.java
new file mode 100644
index 0000000..0be339b
--- /dev/null
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryInfoImpl.java
@@ -0,0 +1,255 @@
+/*
+ * Copyright 2000-2014 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.roots.impl;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.roots.OrderEntry;
+import com.intellij.openapi.roots.OrderRootType;
+import com.intellij.openapi.roots.RootPolicy;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.TestOnly;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * @author nik
+ */
+public abstract class DirectoryInfoImpl extends DirectoryInfo {
+ public static final Comparator<OrderEntry> BY_OWNER_MODULE = new Comparator<OrderEntry>() {
+ @Override
+ public int compare(OrderEntry o1, OrderEntry o2) {
+ String name1 = o1.getOwnerModule().getName();
+ String name2 = o2.getOwnerModule().getName();
+ return name1.compareTo(name2);
+ }
+ };
+ public static final int MAX_ROOT_TYPE_ID = Byte.MAX_VALUE;
+ private final Module module; // module to which content it belongs or null
+ private final VirtualFile libraryClassRoot; // class root in library
+ private final VirtualFile contentRoot;
+ private final VirtualFile sourceRoot;
+ private final boolean myInModuleSource;
+ private final boolean myInLibrarySource;
+ private final boolean myExcluded;
+ private final byte mySourceRootTypeId;
+
+ DirectoryInfoImpl(Module module, VirtualFile contentRoot, VirtualFile sourceRoot, VirtualFile libraryClassRoot,
+ boolean inModuleSource, boolean inLibrarySource, boolean isExcluded, int sourceRootTypeId) {
+ this.module = module;
+ this.libraryClassRoot = libraryClassRoot;
+ this.contentRoot = contentRoot;
+ this.sourceRoot = sourceRoot;
+ myInModuleSource = inModuleSource;
+ myInLibrarySource = inLibrarySource;
+ myExcluded = isExcluded;
+ if (sourceRootTypeId > MAX_ROOT_TYPE_ID) {
+ throw new IllegalArgumentException(
+ "Module source root type id " + sourceRootTypeId + " exceeds the maximum allowable value (" + MAX_ROOT_TYPE_ID + ")");
+ }
+ mySourceRootTypeId = (byte)sourceRootTypeId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ DirectoryInfoImpl info = (DirectoryInfoImpl)o;
+
+ return mySourceRootTypeId == info.mySourceRootTypeId &&
+ myInModuleSource == info.myInModuleSource &&
+ myInLibrarySource == info.myInLibrarySource &&
+ myExcluded == info.myExcluded &&
+ Comparing.equal(contentRoot, info.contentRoot) &&
+ Comparing.equal(libraryClassRoot, info.libraryClassRoot) &&
+ Comparing.equal(module, info.module) &&
+ Arrays.equals(getOrderEntries(), info.getOrderEntries()) &&
+ Comparing.equal(sourceRoot, info.sourceRoot);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = module != null ? module.hashCode() : 0;
+ result = 31 * result + (libraryClassRoot != null ? libraryClassRoot.hashCode() : 0);
+ result = 31 * result + (contentRoot != null ? contentRoot.hashCode() : 0);
+ result = 31 * result + (sourceRoot != null ? sourceRoot.hashCode() : 0);
+ result = 31 * result + (myInModuleSource ? 1 : 0);
+ result = 31 * result + (myInLibrarySource ? 1 : 0);
+ result = 31 * result + (myExcluded ? 1 : 0);
+ result = 31 * result + (int)mySourceRootTypeId;
+ return result;
+ }
+
+ @SuppressWarnings({"HardCodedStringLiteral"})
+ public String toString() {
+ return "DirectoryInfo{" +
+ "module=" + getModule() +
+ ", isInModuleSource=" + isInModuleSource() +
+ ", rootTypeId=" + getSourceRootTypeId() +
+ ", isInLibrarySource=" + isInLibrarySource() +
+ ", isExcludedFromModule=" + isExcluded() +
+ ", libraryClassRoot=" + getLibraryClassRoot() +
+ ", contentRoot=" + getContentRoot() +
+ ", sourceRoot=" + getSourceRoot() +
+ ", orderEntries=" + Arrays.toString(getOrderEntries()) +
+ "}";
+ }
+
+ @NotNull
+ private static OrderEntry createFakeOrderEntry(@NotNull final Module ownerModule) {
+ return new OrderEntry() {
+ @NotNull
+ @Override
+ public VirtualFile[] getFiles(OrderRootType type) {
+ throw new IncorrectOperationException();
+ }
+
+ @NotNull
+ @Override
+ public String[] getUrls(OrderRootType rootType) {
+ throw new IncorrectOperationException();
+ }
+
+ @NotNull
+ @Override
+ public String getPresentableName() {
+ throw new IncorrectOperationException();
+ }
+
+ @Override
+ public boolean isValid() {
+ throw new IncorrectOperationException();
+ }
+
+ @NotNull
+ @Override
+ public Module getOwnerModule() {
+ return ownerModule;
+ }
+
+ @Override
+ public <R> R accept(RootPolicy<R> policy, @Nullable R initialValue) {
+ throw new IncorrectOperationException();
+ }
+
+ @Override
+ public int compareTo(@NotNull OrderEntry o) {
+ throw new IncorrectOperationException();
+ }
+
+ @Override
+ public boolean isSynthetic() {
+ throw new IncorrectOperationException();
+ }
+ };
+ }
+
+ @Nullable
+ OrderEntry findOrderEntryWithOwnerModule(@NotNull Module ownerModule) {
+ OrderEntry[] entries = getOrderEntries();
+ if (entries.length < 10) {
+ for (OrderEntry entry : entries) {
+ if (entry.getOwnerModule() == ownerModule) return entry;
+ }
+ return null;
+ }
+ int index = Arrays.binarySearch(entries, createFakeOrderEntry(ownerModule), BY_OWNER_MODULE);
+ return index < 0 ? null : entries[index];
+ }
+
+ @NotNull
+ List<OrderEntry> findAllOrderEntriesWithOwnerModule(@NotNull Module ownerModule) {
+ OrderEntry[] entries = getOrderEntries();
+ if (entries.length == 1) {
+ OrderEntry entry = entries[0];
+ return entry.getOwnerModule() == ownerModule ? Arrays.asList(entries) : Collections.<OrderEntry>emptyList();
+ }
+ int index = Arrays.binarySearch(entries, createFakeOrderEntry(ownerModule), BY_OWNER_MODULE);
+ if (index < 0) {
+ return Collections.emptyList();
+ }
+ int firstIndex = index;
+ while (firstIndex-1 >= 0 && entries[firstIndex-1].getOwnerModule() == ownerModule) {
+ firstIndex--;
+ }
+ int lastIndex = index+1;
+ while (lastIndex < entries.length && entries[lastIndex].getOwnerModule() == ownerModule) {
+ lastIndex++;
+ }
+
+ OrderEntry[] subArray = new OrderEntry[lastIndex - firstIndex];
+ System.arraycopy(entries, firstIndex, subArray, 0, lastIndex - firstIndex);
+
+ return Arrays.asList(subArray);
+ }
+
+ public boolean isInProject() {
+ return !isExcluded();
+ }
+
+ public boolean isIgnored() {
+ return false;
+ }
+
+ @Nullable
+ public VirtualFile getSourceRoot() {
+ return sourceRoot;
+ }
+
+ public VirtualFile getLibraryClassRoot() {
+ return libraryClassRoot;
+ }
+
+ @Nullable
+ public VirtualFile getContentRoot() {
+ return contentRoot;
+ }
+
+ public boolean isInModuleSource() {
+ return myInModuleSource;
+ }
+
+ public boolean isInLibrarySource() {
+ return myInLibrarySource;
+ }
+
+ public boolean isExcluded() {
+ return myExcluded;
+ }
+
+ public Module getModule() {
+ return module;
+ }
+
+ @TestOnly
+ void assertConsistency() {
+ OrderEntry[] entries = getOrderEntries();
+ for (int i=1; i<entries.length; i++) {
+ assert BY_OWNER_MODULE.compare(entries[i-1], entries[i]) <= 0;
+ }
+ }
+
+ public int getSourceRootTypeId() {
+ return mySourceRootTypeId;
+ }
+}
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/FileIndexBase.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/FileIndexBase.java
index 565bb43..746e227 100644
--- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/FileIndexBase.java
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/FileIndexBase.java
@@ -5,7 +5,6 @@
import com.intellij.openapi.roots.FileIndex;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/**
* @author nik
@@ -19,21 +18,9 @@
myFileTypeRegistry = fileTypeManager;
}
- @Nullable
+ @NotNull
protected DirectoryInfo getInfoForFileOrDirectory(@NotNull VirtualFile file) {
- if (!file.isDirectory() && file.getParent() == null) return null; // e.g. LightVirtualFile in test
- DirectoryInfo info = myDirectoryIndex.getInfoForDirectory(file);
- if (info != null) {
- return info;
- }
-
- if (!file.isDirectory() && !myDirectoryIndex.isModuleExcludeRoot(file)) {
- VirtualFile dir = file.getParent();
- if (dir != null) {
- return myDirectoryIndex.getInfoForDirectory(dir);
- }
- }
- return null;
+ return myDirectoryIndex.getInfoForFile(file);
}
@Override
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/FilePropertyPusher.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/FilePropertyPusher.java
index 7a22aef..b8af317 100644
--- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/FilePropertyPusher.java
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/FilePropertyPusher.java
@@ -50,7 +50,7 @@
boolean acceptsFile(@NotNull VirtualFile file);
boolean acceptsDirectory(@NotNull VirtualFile file, @NotNull Project project);
- void persistAttribute(@NotNull VirtualFile fileOrDir, @NotNull T value) throws IOException;
+ void persistAttribute(@NotNull Project project, @NotNull VirtualFile fileOrDir, @NotNull T value) throws IOException;
interface Engine {
void pushAll();
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ModuleFileIndexImpl.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ModuleFileIndexImpl.java
index 1e009d1..3b5ea4f 100644
--- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ModuleFileIndexImpl.java
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ModuleFileIndexImpl.java
@@ -29,7 +29,6 @@
import org.jetbrains.jps.model.java.JavaModuleSourceRootTypes;
import org.jetbrains.jps.model.module.JpsModuleSourceRootType;
-import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -49,8 +48,8 @@
for (VirtualFile contentRoot : contentRoots) {
VirtualFile parent = contentRoot.getParent();
if (parent != null) {
- DirectoryInfo parentInfo = myDirectoryIndex.getInfoForDirectory(parent);
- if (parentInfo != null && myModule.equals(parentInfo.getModule())) continue; // inner content - skip it
+ DirectoryInfo parentInfo = myDirectoryIndex.getInfoForFile(parent);
+ if (parentInfo.isInProject() && myModule.equals(parentInfo.getModule())) continue; // inner content - skip it
}
boolean finished = VfsUtilCore.iterateChildrenRecursively(contentRoot, myContentFilter, iterator);
@@ -68,50 +67,45 @@
@Override
public boolean isInContent(@NotNull VirtualFile fileOrDir) {
DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- return info != null && myModule.equals(info.getModule());
+ return info.isInProject() && myModule.equals(info.getModule());
}
@Override
public boolean isInSourceContent(@NotNull VirtualFile fileOrDir) {
DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- return info != null && info.isInModuleSource() && myModule.equals(info.getModule());
+ return info.isInModuleSource() && myModule.equals(info.getModule());
}
@Override
@NotNull
public List<OrderEntry> getOrderEntriesForFile(@NotNull VirtualFile fileOrDir) {
- DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- if (info == null) return Collections.emptyList();
- return info.findAllOrderEntriesWithOwnerModule(myModule);
+ return getInfoForFileOrDirectory(fileOrDir).findAllOrderEntriesWithOwnerModule(myModule);
}
@Override
public OrderEntry getOrderEntryForFile(@NotNull VirtualFile fileOrDir) {
- DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- if (info == null) return null;
- return info.findOrderEntryWithOwnerModule(myModule);
+ return getInfoForFileOrDirectory(fileOrDir).findOrderEntryWithOwnerModule(myModule);
}
@Override
public boolean isInTestSourceContent(@NotNull VirtualFile fileOrDir) {
DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- return info != null && info.isInModuleSource() && myModule.equals(info.getModule())
+ return info.isInModuleSource() && myModule.equals(info.getModule())
&& JavaModuleSourceRootTypes.isTestSourceOrResource(myDirectoryIndex.getSourceRootType(info));
}
@Override
public boolean isUnderSourceRootOfType(@NotNull VirtualFile fileOrDir, @NotNull Set<? extends JpsModuleSourceRootType<?>> rootTypes) {
DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- return info != null && info.isInModuleSource() && myModule.equals(info.getModule())
- && rootTypes.contains(myDirectoryIndex.getSourceRootType(info));
+ return info.isInModuleSource() && myModule.equals(info.getModule()) && rootTypes.contains(myDirectoryIndex.getSourceRootType(info));
}
private class ContentFilter implements VirtualFileFilter {
@Override
public boolean accept(@NotNull VirtualFile file) {
if (file.isDirectory()) {
- DirectoryInfo info = myDirectoryIndex.getInfoForDirectory(file);
- return info != null && myModule.equals(info.getModule());
+ DirectoryInfo info = myDirectoryIndex.getInfoForFile(file);
+ return info.isInProject() && myModule.equals(info.getModule());
}
else {
return !myFileTypeRegistry.isFileIgnored(file);
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/NonProjectDirectoryInfo.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/NonProjectDirectoryInfo.java
new file mode 100644
index 0000000..7937f08
--- /dev/null
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/NonProjectDirectoryInfo.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2000-2014 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.roots.impl;
+
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.roots.OrderEntry;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author nik
+ */
+class NonProjectDirectoryInfo extends DirectoryInfo {
+ public static final NonProjectDirectoryInfo IGNORED = new NonProjectDirectoryInfo("ignored") {
+ @Override
+ public boolean isIgnored() {
+ return true;
+ }
+ };
+ public static final NonProjectDirectoryInfo EXCLUDED = new NonProjectDirectoryInfo("excluded from project") {
+ @Override
+ public boolean isExcluded() {
+ return true;
+ }
+ };
+ public static final NonProjectDirectoryInfo NOT_UNDER_PROJECT_ROOTS = new NonProjectDirectoryInfo("not under project roots");
+ public static final NonProjectDirectoryInfo INVALID = new NonProjectDirectoryInfo("invalid");
+ public static final NonProjectDirectoryInfo NOT_SUPPORTED_VIRTUAL_FILE_IMPLEMENTATION = new NonProjectDirectoryInfo("not supported VirtualFile implementation");
+ private final String myDebugName;
+
+ private NonProjectDirectoryInfo(String debugName) {
+ myDebugName = debugName;
+ }
+
+ public boolean isInProject() {
+ return false;
+ }
+
+ @NotNull
+ @Override
+ public OrderEntry[] getOrderEntries() {
+ return OrderEntry.EMPTY_ARRAY;
+ }
+
+ @Nullable
+ OrderEntry findOrderEntryWithOwnerModule(@NotNull Module ownerModule) {
+ return null;
+ }
+
+ @NotNull
+ List<OrderEntry> findAllOrderEntriesWithOwnerModule(@NotNull Module ownerModule) {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public String toString() {
+ return "DirectoryInfo: " + myDebugName;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return this == o;
+ }
+
+ @Override
+ public int hashCode() {
+ return System.identityHashCode(this);
+ }
+
+ public boolean isIgnored() {
+ return false;
+ }
+
+ @Nullable
+ public VirtualFile getSourceRoot() {
+ return null;
+ }
+
+ public VirtualFile getLibraryClassRoot() {
+ return null;
+ }
+
+ @Nullable
+ public VirtualFile getContentRoot() {
+ return null;
+ }
+
+ public boolean isInModuleSource() {
+ return false;
+ }
+
+ public boolean isInLibrarySource() {
+ return false;
+ }
+
+ public boolean isExcluded() {
+ return false;
+ }
+
+ public Module getModule() {
+ return null;
+ }
+
+ void assertConsistency() {
+ }
+
+ public int getSourceRootTypeId() {
+ return 0;
+ }
+}
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectFileIndexFacade.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectFileIndexFacade.java
index 057f6b0..0bb65c6 100644
--- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectFileIndexFacade.java
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectFileIndexFacade.java
@@ -66,7 +66,7 @@
@Override
public boolean isExcludedFile(@NotNull final VirtualFile file) {
- return myFileIndex.isIgnored(file);
+ return myFileIndex.isExcluded(file);
}
@Nullable
@@ -83,7 +83,7 @@
while (true) {
if (childDir == null) return false;
if (childDir.equals(baseDir)) return true;
- if (myDirectoryIndex.getInfoForDirectory(childDir) == null) return false;
+ if (!myDirectoryIndex.getInfoForFile(childDir).isInProject()) return false;
childDir = childDir.getParent();
}
}
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectFileIndexImpl.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectFileIndexImpl.java
index d3fd782..acb6598 100644
--- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectFileIndexImpl.java
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectFileIndexImpl.java
@@ -34,7 +34,6 @@
import org.jetbrains.jps.model.module.JpsModuleSourceRootType;
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -57,13 +56,13 @@
VirtualFile[] contentRoots = ModuleRootManager.getInstance(module).getContentRoots();
for (VirtualFile contentRoot : contentRoots) {
DirectoryInfo info = getInfoForFileOrDirectory(contentRoot);
- if (info == null) continue; // is excluded or ignored
+ if (!info.isInProject()) continue; // is excluded or ignored
if (!module.equals(info.getModule())) continue; // maybe 2 modules have the same content root?
VirtualFile parent = contentRoot.getParent();
if (parent != null) {
DirectoryInfo parentInfo = getInfoForFileOrDirectory(parent);
- if (parentInfo != null && parentInfo.getModule() != null) continue; // inner content - skip it
+ if (parentInfo.isInProject() && parentInfo.getModule() != null) continue; // inner content - skip it
}
boolean finished = VfsUtilCore.iterateChildrenRecursively(contentRoot, myContentFilter, iterator);
@@ -80,61 +79,43 @@
}
@Override
- public boolean isIgnored(@NotNull VirtualFile file) {
- if (myFileTypeRegistry.isFileIgnored(file)) return true;
- VirtualFile dir = file.isDirectory() ? file : file.getParent();
- if (dir == null) return false;
-
- DirectoryInfo info = getInfoForFileOrDirectory(dir);
- if (info != null) return false;
- if (myDirectoryIndex.isProjectExcludeRoot(dir)) return true;
-
- VirtualFile parent = dir.getParent();
- while (true) {
- if (parent == null) return false;
- DirectoryInfo parentInfo = getInfoForFileOrDirectory(parent);
- if (parentInfo != null) return true;
- if (myDirectoryIndex.isProjectExcludeRoot(parent)) return true;
- parent = parent.getParent();
- }
+ public boolean isExcluded(@NotNull VirtualFile file) {
+ DirectoryInfo info = getInfoForFileOrDirectory(file);
+ return info.isIgnored() || info.isExcluded();
}
@Override
public Module getModuleForFile(@NotNull VirtualFile file) {
if (file instanceof VirtualFileWindow) file = ((VirtualFileWindow)file).getDelegate();
- VirtualFile dir = file.isDirectory() ? file : file.getParent();
- if (dir == null) return null;
- DirectoryInfo info = getInfoForFileOrDirectory(dir);
- if (info == null) return null;
+ DirectoryInfo info = getInfoForFileOrDirectory(file);
+ if (!info.isInProject()) return null;
return info.getModule();
}
@Override
@NotNull
public List<OrderEntry> getOrderEntriesForFile(@NotNull VirtualFile file) {
- DirectoryInfo info = getInfoForFileOrDirectory(file);
- if (info == null) return Collections.emptyList();
- return Arrays.asList(info.getOrderEntries());
+ return Arrays.asList(getInfoForFileOrDirectory(file).getOrderEntries());
}
@Override
public VirtualFile getClassRootForFile(@NotNull VirtualFile file) {
final DirectoryInfo info = getInfoForFileOrDirectory(file);
- if (info == null) return null;
+ if (!info.isInProject()) return null;
return info.getLibraryClassRoot();
}
@Override
public VirtualFile getSourceRootForFile(@NotNull VirtualFile file) {
final DirectoryInfo info = getInfoForFileOrDirectory(file);
- if (info == null) return null;
+ if (!info.isInProject()) return null;
return info.getSourceRoot();
}
@Override
public VirtualFile getContentRootForFile(@NotNull VirtualFile file) {
final DirectoryInfo info = getInfoForFileOrDirectory(file);
- if (info == null) return null;
+ if (!info.isInProject()) return null;
return info.getContentRoot();
}
@@ -147,58 +128,60 @@
@Override
public boolean isLibraryClassFile(@NotNull VirtualFile file) {
if (file.isDirectory()) return false;
- if (myFileTypeRegistry.isFileIgnored(file)) return false;
DirectoryInfo parentInfo = getInfoForFileOrDirectory(file);
- return parentInfo != null && parentInfo.hasLibraryClassRoot();
+ return parentInfo.isInProject() && parentInfo.hasLibraryClassRoot();
}
@Override
public boolean isInSource(@NotNull VirtualFile fileOrDir) {
DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- return info != null && (info.isInModuleSource() || info.isInLibrarySource());
+ return info.isInModuleSource() || info.isInLibrarySource();
}
@Override
public boolean isInLibraryClasses(@NotNull VirtualFile fileOrDir) {
DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- return info != null && info.hasLibraryClassRoot();
+ return info.isInProject() && info.hasLibraryClassRoot();
}
@Override
public boolean isInLibrarySource(@NotNull VirtualFile fileOrDir) {
- DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- return info != null && info.isInLibrarySource();
+ return getInfoForFileOrDirectory(fileOrDir).isInLibrarySource();
+ }
+
+ @Override
+ public boolean isIgnored(@NotNull VirtualFile file) {
+ return isExcluded(file);
}
@Override
public boolean isInContent(@NotNull VirtualFile fileOrDir) {
DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- return info != null && info.getModule() != null;
+ return info.isInProject() && info.getModule() != null;
}
@Override
public boolean isInSourceContent(@NotNull VirtualFile fileOrDir) {
- DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- return info != null && info.isInModuleSource();
+ return getInfoForFileOrDirectory(fileOrDir).isInModuleSource();
}
@Override
public boolean isInTestSourceContent(@NotNull VirtualFile fileOrDir) {
DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- return info != null && info.isInModuleSource() && JavaModuleSourceRootTypes.isTestSourceOrResource(myDirectoryIndex.getSourceRootType(info));
+ return info.isInModuleSource() && JavaModuleSourceRootTypes.isTestSourceOrResource(myDirectoryIndex.getSourceRootType(info));
}
@Override
public boolean isUnderSourceRootOfType(@NotNull VirtualFile fileOrDir, @NotNull Set<? extends JpsModuleSourceRootType<?>> rootTypes) {
DirectoryInfo info = getInfoForFileOrDirectory(fileOrDir);
- return info != null && info.isInModuleSource() && rootTypes.contains(myDirectoryIndex.getSourceRootType(info));
+ return info.isInModuleSource() && rootTypes.contains(myDirectoryIndex.getSourceRootType(info));
}
private class ContentFilter implements VirtualFileFilter {
@Override
public boolean accept(@NotNull VirtualFile file) {
DirectoryInfo info = getInfoForFileOrDirectory(file);
- if (info == null || info.getModule() == null) return false;
+ if (!info.isInProject() || info.getModule() == null) return false;
if (file.isDirectory()) {
return true;
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdater.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdater.java
new file mode 100644
index 0000000..63fcc111
--- /dev/null
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdater.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2014 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.roots.impl;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NotNull;
+
+public abstract class PushedFilePropertiesUpdater {
+ @NotNull
+ public static PushedFilePropertiesUpdater getInstance(Project project) {
+ return project.getComponent(PushedFilePropertiesUpdater.class);
+ }
+
+ public abstract void initializeProperties();
+ public abstract void pushAll(final FilePropertyPusher... pushers);
+ public abstract void filePropertiesChanged(@NotNull final VirtualFile file);
+ public abstract void processPendingEvents();
+ public abstract void pushAllPropertiesNow();
+ public abstract <T> void findAndUpdateValue(final VirtualFile fileOrDir, final FilePropertyPusher<T> pusher, final T moduleValue);
+}
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java
index ad3b851..ca68cee 100644
--- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java
+++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java
@@ -43,16 +43,8 @@
public class RootIndex extends DirectoryIndex {
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.roots.impl.RootIndex");
- private static final DirectoryInfo NULL_INFO = new DirectoryInfo(null, null, null, null, (byte)0) {
- @NotNull
- @Override
- public OrderEntry[] getOrderEntries() {
- throw new UnsupportedOperationException("Not implemented");
- }
- };
private final Set<VirtualFile> myProjectExcludedRoots = ContainerUtil.newHashSet();
- private final Set<VirtualFile> myModuleExcludedRoots;
private final MultiMap<String, VirtualFile> myPackagePrefixRoots = new MultiMap<String, VirtualFile>() {
@NotNull
@Override
@@ -77,15 +69,15 @@
Set<VirtualFile> allRoots = info.getAllRoots();
for (VirtualFile root : allRoots) {
List<VirtualFile> hierarchy = getHierarchy(root, allRoots, info);
- Pair<DirectoryInfo, String> pair = hierarchy == null ? new Pair<DirectoryInfo, String>(null, null) : calcDirectoryInfo(root, hierarchy, info);
+ Pair<DirectoryInfo, String> pair = hierarchy != null
+ ? calcDirectoryInfo(root, hierarchy, info)
+ : new Pair<DirectoryInfo, String>(NonProjectDirectoryInfo.IGNORED, null);
cacheInfos(root, root, pair.first);
myPackagePrefixRoots.putValue(pair.second, root);
if (info.shouldMarkAsProjectExcluded(root, hierarchy)) {
myProjectExcludedRoots.add(root);
}
}
-
- myModuleExcludedRoots = info.excludedFromModule.keySet();
}
@NotNull
@@ -232,7 +224,7 @@
}
OrderEntry[] array = orderEntries.toArray(new OrderEntry[orderEntries.size()]);
- Arrays.sort(array, DirectoryInfo.BY_OWNER_MODULE);
+ Arrays.sort(array, DirectoryInfoImpl.BY_OWNER_MODULE);
return array;
}
@@ -254,7 +246,7 @@
}
int id = myRootTypes.size();
- if (id > DirectoryInfo.MAX_ROOT_TYPE_ID) {
+ if (id > DirectoryInfoImpl.MAX_ROOT_TYPE_ID) {
LOG.error("Too many different types of module source roots (" + id + ") registered: " + myRootTypes);
}
myRootTypes.add(rootType);
@@ -263,14 +255,30 @@
}
@Override
- @Nullable
- public DirectoryInfo getInfoForDirectory(@NotNull final VirtualFile dir) {
- if (!dir.isValid()) {
- return null;
+ public DirectoryInfo getInfoForDirectory(@NotNull VirtualFile dir) {
+ DirectoryInfo info = getInfoForFile(dir);
+ return info.isInProject() ? info : null;
+ }
+
+ @NotNull
+ @Override
+ public DirectoryInfo getInfoForFile(@NotNull VirtualFile file) {
+ if (!file.isValid()) {
+ return NonProjectDirectoryInfo.INVALID;
}
- if (!dir.isDirectory()) {
- DirectoryInfo info = myInfoCache.getCachedInfo(dir);
- return info == NULL_INFO ? null : info;
+ VirtualFile dir;
+ if (!file.isDirectory()) {
+ DirectoryInfo info = myInfoCache.getCachedInfo(file);
+ if (info != null) {
+ return info;
+ }
+ if (isIgnored(file)) {
+ return NonProjectDirectoryInfo.IGNORED;
+ }
+ dir = file.getParent();
+ }
+ else {
+ dir = file;
}
int count = 0;
@@ -283,21 +291,21 @@
if (!dir.equals(root)) {
cacheInfos(dir, root, info);
}
- return info == NULL_INFO ? null : info;
+ return info;
}
if (isIgnored(root)) {
- return cacheInfos(dir, root, null);
+ return cacheInfos(dir, root, NonProjectDirectoryInfo.IGNORED);
}
}
- return cacheInfos(dir, null, null);
+ return cacheInfos(dir, null, NonProjectDirectoryInfo.NOT_UNDER_PROJECT_ROOTS);
}
- @Nullable
- private DirectoryInfo cacheInfos(VirtualFile dir, @Nullable VirtualFile stopAt, @Nullable DirectoryInfo info) {
+ @NotNull
+ private DirectoryInfo cacheInfos(VirtualFile dir, @Nullable VirtualFile stopAt, @NotNull DirectoryInfo info) {
while (dir != null) {
- myInfoCache.cacheInfo(dir, info == null ? NULL_INFO : info);
+ myInfoCache.cacheInfo(dir, info);
if (dir.equals(stopAt)) {
break;
}
@@ -307,16 +315,6 @@
}
@Override
- public boolean isProjectExcludeRoot(@NotNull final VirtualFile dir) {
- return myProjectExcludedRoots.contains(dir);
- }
-
- @Override
- public boolean isModuleExcludeRoot(@NotNull final VirtualFile dir) {
- return myModuleExcludedRoots.contains(dir);
- }
-
- @Override
@NotNull
public Query<VirtualFile> getDirectoriesByPackageName(@NotNull final String packageName, final boolean includeLibrarySources) {
List<VirtualFile> result = myDirectoriesByPackageNameCache.get(packageName);
@@ -327,7 +325,8 @@
String shortName = StringUtil.getShortName(packageName);
for (VirtualFile parentDir : getDirectoriesByPackageName(StringUtil.getPackageName(packageName), true)) {
VirtualFile child = parentDir.findChild(shortName);
- if (child != null && child.isDirectory() && getInfoForDirectory(child) != null && packageName.equals(getPackageName(child))) {
+ if (child != null && child.isDirectory() && getInfoForFile(child).isInProject()
+ && packageName.equals(getPackageName(child))) {
result.add(child);
}
}
@@ -344,8 +343,8 @@
result = ContainerUtil.filter(result, new Condition<VirtualFile>() {
@Override
public boolean value(VirtualFile file) {
- DirectoryInfo info = getInfoForDirectory(file);
- return info != null && (!info.isInLibrarySource() || info.isInModuleSource() || info.hasLibraryClassRoot());
+ DirectoryInfo info = getInfoForFile(file);
+ return info.isInProject() && (!info.isInLibrarySource() || info.isInModuleSource() || info.hasLibraryClassRoot());
}
});
}
@@ -397,7 +396,7 @@
return false;
}
- @Nullable
+ @Nullable("returns null only if dir is under ignored folder")
private static List<VirtualFile> getHierarchy(VirtualFile dir, @NotNull Set<VirtualFile> allRoots, @NotNull RootInfo info) {
List<VirtualFile> hierarchy = ContainerUtil.newArrayList();
boolean hasContentRoots = false;
@@ -472,6 +471,15 @@
}
@Nullable
+ private Module findParentModuleForExcluded(@NotNull List<VirtualFile> hierarchy) {
+ for (VirtualFile root : hierarchy) {
+ Module module = contentRootOf.get(root);
+ if (module != null) return module;
+ }
+ return null;
+ }
+
+ @Nullable
private VirtualFile findLibraryRootInfo(@NotNull List<VirtualFile> hierarchy, boolean source) {
Set<Library> librariesToIgnore = ContainerUtil.newHashSet();
for (VirtualFile root : hierarchy) {
@@ -566,8 +574,12 @@
VirtualFile moduleContentRoot = info.findModuleRootInfo(hierarchy);
VirtualFile libraryClassRoot = info.findLibraryRootInfo(hierarchy, false);
VirtualFile librarySourceRoot = info.findLibraryRootInfo(hierarchy, true);
+ Module parentModuleForExcluded = null;
if (moduleContentRoot == null && libraryClassRoot == null && librarySourceRoot == null) {
- return new Pair<DirectoryInfo, String>(null, null);
+ parentModuleForExcluded = info.findParentModuleForExcluded(hierarchy);
+ if (parentModuleForExcluded == null) {
+ return new Pair<DirectoryInfo, String>(NonProjectDirectoryInfo.EXCLUDED, null);
+ }
}
VirtualFile sourceRoot = info.findPackageRootInfo(hierarchy, moduleContentRoot, null, librarySourceRoot);
@@ -577,11 +589,9 @@
boolean inLibrarySource = librarySourceRoot != null;
int typeId = moduleSourceRoot != null ? info.rootTypeId.get(moduleSourceRoot) : 0;
- DirectoryInfo directoryInfo = new DirectoryInfo(info.contentRootOf.get(moduleContentRoot),
- moduleContentRoot,
- sourceRoot,
- libraryClassRoot,
- (byte)DirectoryInfo.createSourceRootTypeData(inModuleSources, inLibrarySource, typeId)) {
+ Module module = parentModuleForExcluded != null ? parentModuleForExcluded : info.contentRootOf.get(moduleContentRoot);
+ DirectoryInfo directoryInfo = new DirectoryInfoImpl(module, moduleContentRoot, sourceRoot, libraryClassRoot, inModuleSources, inLibrarySource,
+ parentModuleForExcluded != null, typeId) {
@NotNull
@Override
public OrderEntry[] getOrderEntries() {
diff --git a/platform/remote-servers/impl/resources/resources/cloud.properties b/platform/remote-servers/impl/resources/resources/cloud.properties
index 82c23fe..38329f1 100644
--- a/platform/remote-servers/impl/resources/resources/cloud.properties
+++ b/platform/remote-servers/impl/resources/resources/cloud.properties
@@ -9,3 +9,6 @@
choose.account.title=Choose {0} account\:
git.cloud.app.detected=<b>{0} application detected</b> at\: {1}.<br/>You may <a href\="\#">setup deployment run configuration</a> for the application
choose.account.wizzard.title={0} deployment run configuration
+cloud.support={0} Support
+cloud.support.added=Finished adding {0} support\!
+detect.module.structure=Detecting {0} module structure
diff --git a/platform/remote-servers/impl/src/META-INF/RemoteServers.xml b/platform/remote-servers/impl/src/META-INF/RemoteServers.xml
index c18f18d..41067b0 100644
--- a/platform/remote-servers/impl/src/META-INF/RemoteServers.xml
+++ b/platform/remote-servers/impl/src/META-INF/RemoteServers.xml
@@ -17,7 +17,7 @@
serviceImplementation="com.intellij.remoteServer.agent.impl.RemoteAgentManagerImpl"/>
<applicationService serviceInterface="com.intellij.remoteServer.runtime.clientLibrary.ClientLibraryManager"
serviceImplementation="com.intellij.remoteServer.impl.runtime.clientLibrary.ClientLibraryManagerImpl"/>
- <applicationConfigurable instance="com.intellij.remoteServer.impl.configuration.RemoteServerListConfigurable"/>
+ <applicationConfigurable groupId="build" displayName="Clouds" instance="com.intellij.remoteServer.impl.configuration.RemoteServerListConfigurable"/>
<programRunner implementation="com.intellij.remoteServer.impl.runtime.DeployToServerRunner"/>
<projectService serviceInterface="com.intellij.remoteServer.runtime.ui.RemoteServersView"
serviceImplementation="com.intellij.remoteServer.impl.runtime.ui.RemoteServersViewImpl"/>
diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/RemoteServerConfigurable.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/RemoteServerConfigurable.java
index a614c4e..7e68ca4 100644
--- a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/RemoteServerConfigurable.java
+++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/RemoteServerConfigurable.java
@@ -7,6 +7,7 @@
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.ui.NamedConfigurable;
import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.util.text.StringUtil;
import com.intellij.remoteServer.configuration.RemoteServer;
import com.intellij.remoteServer.configuration.ServerConfiguration;
import com.intellij.remoteServer.runtime.ServerConnection;
@@ -79,7 +80,7 @@
if (result) {
myUncheckedApply = false;
- setConnectionStatus("");
+ setConnectionStatus(false, false, "");
myConnectionTester = null;
if (modified) {
@@ -88,7 +89,7 @@
myInnerApplied = true;
}
catch (ConfigurationException e) {
- setConnectionStatus(e.getMessage());
+ setConnectionStatus(true, false, e.getMessage());
}
}
}
@@ -97,7 +98,7 @@
@Override
protected void run() {
- setConnectionStatus("Connecting...");
+ setConnectionStatus(false, false, "Connecting...");
myConnectionTester = new ConnectionTester();
myConnectionTester.testConnection();
@@ -105,19 +106,20 @@
};
}
- private void setConnectionStatus(String text) {
- setConnectionStatus(false, text);
- }
-
- private void setConnectionStatus(boolean connected, String text) {
+ private void setConnectionStatus(boolean error, boolean connected, String text) {
boolean changed = myConnected != connected;
myConnected = connected;
- myConnectionStatusLabel.setText(UIUtil.toHtml(text));
+ setConnectionStatusText(error, text);
if (changed) {
notifyDataLoader();
}
}
+ protected void setConnectionStatusText(boolean error, String text) {
+ myConnectionStatusLabel.setText(UIUtil.toHtml(text));
+ myConnectionStatusLabel.setVisible(StringUtil.isNotEmpty(text));
+ }
+
public void setDataLoader(CloudDataLoader dataLoader) {
myDataLoader = dataLoader;
notifyDataLoader();
@@ -238,7 +240,7 @@
@Override
public void run() {
if (myConnectionTester == ConnectionTester.this) {
- setConnectionStatus(connected, connected ? "Connection successful" : "Cannot connect: " + connection.getStatusText());
+ setConnectionStatus(!connected, connected, connected ? "Connection successful" : "Cannot connect: " + connection.getStatusText());
}
}
});
diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/ServersToolWindowContent.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/ServersToolWindowContent.java
index f860d6d..7a1f27f 100644
--- a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/ServersToolWindowContent.java
+++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/ServersToolWindowContent.java
@@ -146,6 +146,9 @@
}
myPropertiesPanelLayout.show(myPropertiesPanel, cardName);
}
+ else {
+ showMessageLabel("");
+ }
}
else if (node instanceof ServersTreeStructure.RemoteServerNode) {
updateServerDetails((ServersTreeStructure.RemoteServerNode)node);
diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeStructure.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeStructure.java
index 4cb1c019..5895be2 100644
--- a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeStructure.java
+++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeStructure.java
@@ -287,16 +287,6 @@
myParentNode = parentNode;
}
- @Override
- public boolean equals(Object object) {
- return object instanceof DeploymentNodeImpl && getValue().getName().equals(((DeploymentNodeImpl)object).getValue().getName());
- }
-
- @Override
- public int hashCode() {
- return getValue().getName().hashCode();
- }
-
@NotNull
@Override
public ServerNode getServerNode() {
@@ -377,10 +367,14 @@
return (DeploymentLogManagerImpl)myConnection.getLogManager(getValue());
}
+ public String getId() {
+ return myParentNode.getName() + ";deployment" + getValue().getName();
+ }
+
@NotNull
@Override
public String getLogId() {
- return "deployment:" + getValue().getName();
+ return getId() + ";main-log";
}
@NotNull
@@ -451,7 +445,7 @@
@NotNull
@Override
public String getLogId() {
- return "deployment:" + myDeploymentNode.getValue().getName() + ";log:" + getLogName();
+ return myDeploymentNode.getId() + ";log:" + getLogName();
}
}
}
diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudAccountSelectionEditor.form b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudAccountSelectionEditor.form
index bbfd6da..3e8f941 100644
--- a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudAccountSelectionEditor.form
+++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudAccountSelectionEditor.form
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.remoteServer.util.CloudAccountSelectionEditor">
- <grid id="27dc6" binding="myMainPanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <grid id="27dc6" binding="myMainPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
@@ -8,26 +8,27 @@
<properties/>
<border type="none"/>
<children>
- <component id="82588" class="javax.swing.JComboBox" binding="myServerComboBox">
+ <vspacer id="e6946">
<constraints>
- <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="5" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+ </constraints>
+ </vspacer>
+ <component id="a54bb" class="javax.swing.JButton" binding="myNewButton">
+ <constraints>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="New..."/>
+ </properties>
+ </component>
+ <component id="54cd4" class="com.intellij.openapi.ui.ComboBox" binding="myAccountComboBox">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="0" fill="1" indent="0" use-parent-layout="false">
+ <preferred-size width="200" height="-1"/>
+ </grid>
</constraints>
<properties/>
</component>
- <grid id="27f9c" binding="myServerConfigurablePanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
- <margin top="0" left="0" bottom="0" right="0"/>
- <constraints>
- <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
- </constraints>
- <properties/>
- <border type="none"/>
- <children/>
- </grid>
- <vspacer id="dcc88">
- <constraints>
- <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
- </constraints>
- </vspacer>
</children>
</grid>
</form>
diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudAccountSelectionEditor.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudAccountSelectionEditor.java
index 7bd38b4..fa4355e 100644
--- a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudAccountSelectionEditor.java
+++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudAccountSelectionEditor.java
@@ -18,133 +18,164 @@
import com.intellij.execution.RunManagerEx;
import com.intellij.execution.RunnerAndConfigurationSettings;
import com.intellij.execution.configurations.ConfigurationType;
-import com.intellij.openapi.Disposable;
-import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.ide.DataManager;
+import com.intellij.ide.actions.ShowSettingsUtilImpl;
+import com.intellij.ide.util.projectWizard.WizardContext;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModulePointer;
import com.intellij.openapi.module.ModulePointerManager;
import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.options.ex.SingleConfigurableEditor;
import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.ComboBox;
+import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.util.Condition;
-import com.intellij.openapi.util.Disposer;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.Ref;
import com.intellij.remoteServer.ServerType;
import com.intellij.remoteServer.configuration.RemoteServer;
import com.intellij.remoteServer.configuration.RemoteServersManager;
+import com.intellij.remoteServer.configuration.ServerConfiguration;
+import com.intellij.remoteServer.configuration.deployment.DeploymentConfiguration;
import com.intellij.remoteServer.impl.configuration.RemoteServerConfigurable;
import com.intellij.remoteServer.impl.configuration.deployment.DeployToServerConfigurationType;
import com.intellij.remoteServer.impl.configuration.deployment.DeployToServerRunConfiguration;
import com.intellij.remoteServer.impl.configuration.deployment.ModuleDeploymentSourceImpl;
+import com.intellij.util.Consumer;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.hash.HashMap;
import com.intellij.util.text.UniqueNameGenerator;
+import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.util.List;
+import java.util.Map;
-/**
- * @author michael.golubev
- */
-public class CloudAccountSelectionEditor<SC extends CloudConfigurationBase,
- DC extends CloudDeploymentNameConfiguration,
- ST extends ServerType<SC>> implements Disposable {
- private static final Logger LOG = Logger.getInstance("#" + CloudAccountSelectionEditor.class.getName());
+public class CloudAccountSelectionEditor {
- private JComboBox myServerComboBox;
- private JPanel myServerConfigurablePanel;
+ private static final Map<ServerType<?>, Key<RemoteServer<?>>> ourCloudType2AccountKey
+ = new HashMap<ServerType<?>, Key<RemoteServer<?>>>();
+
+
+ private JButton myNewButton;
+ private ComboBox myAccountComboBox;
private JPanel myMainPanel;
- private final ST myCloudType;
+ private final List<ServerType<?>> myCloudTypes;
- private RemoteServer<SC> myNewServer;
- private RemoteServerConfigurable myServerConfigurable;
+ private Runnable myServerSelectionListener;
+ public CloudAccountSelectionEditor(List<ServerType<?>> cloudTypes) {
+ myCloudTypes = cloudTypes;
- private DelayedRunner myRunner;
+ for (ServerType<?> cloudType : cloudTypes) {
+ for (RemoteServer<?> account : RemoteServersManager.getInstance().getServers(cloudType)) {
+ myAccountComboBox.addItem(new AccountItem(account));
+ }
+ }
- private CloudDataLoader myDataLoader = CloudDataLoader.NULL;
-
- public CloudAccountSelectionEditor(ST cloudType) {
- myCloudType = cloudType;
- }
-
- private void createUIComponents() {
- myServerConfigurablePanel = createServerConfigurablePanel();
- myServerConfigurablePanel.setVisible(false);
- }
-
- public void initUI() {
- myServerComboBox.addActionListener(new ActionListener() {
+ myNewButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
- onAccountSelectionChanged();
+ onNewButton();
}
});
- for (RemoteServer<SC> server : RemoteServersManager.getInstance().getServers(myCloudType)) {
- myServerComboBox.addItem(new ServerItem(server));
- }
- myServerComboBox.addItem(new ServerItem(myNewServer));
-
- myRunner= new DelayedRunner(myMainPanel) {
-
- private ServerItem myPreviousServerItem;
+ myAccountComboBox.addActionListener(new ActionListener() {
@Override
- protected boolean wasChanged() {
- ServerItem currentServerItem = getSelectedServerItem();
- boolean result = myPreviousServerItem != currentServerItem;
- if (result) {
- myPreviousServerItem = currentServerItem;
- myDataLoader.clearCloudData();
+ public void actionPerformed(ActionEvent e) {
+ if (myServerSelectionListener != null) {
+ myServerSelectionListener.run();
}
- return result;
}
+ });
+ }
+
+ public void setAccountSelectionListener(Runnable listener) {
+ myServerSelectionListener = listener;
+ }
+
+ private void onNewButton() {
+ if (myCloudTypes.size() == 1) {
+ createAccount(ContainerUtil.getFirstItem(myCloudTypes));
+ return;
+ }
+
+ DefaultActionGroup group = new DefaultActionGroup();
+ for (final ServerType<?> cloudType : myCloudTypes) {
+ group.add(new AnAction(cloudType.getPresentableName(), cloudType.getPresentableName(), cloudType.getIcon()) {
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ createAccount(cloudType);
+ }
+ });
+ }
+ JBPopupFactory.getInstance().createActionGroupPopup("New Account", group, DataManager.getInstance().getDataContext(myMainPanel),
+ JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false)
+ .showUnderneathOf(myNewButton);
+ }
+
+ private void createAccount(ServerType<?> cloudType) {
+ RemoteServer<?> newAccount = RemoteServersManager.getInstance().createServer(cloudType, generateServerName(cloudType));
+
+ final Ref<Consumer<String>> errorConsumerRef = new Ref<Consumer<String>>();
+
+ RemoteServerConfigurable configurable = new RemoteServerConfigurable(newAccount, null, true) {
@Override
- protected void run() {
- if (getSelectedServerItem().isNew()) {
- myServerConfigurable.setDataLoader(new CloudDataLoader() {
-
- @Override
- public void clearCloudData() {
- if (getSelectedServerItem().isNew()) {
- myDataLoader.clearCloudData();
- }
- }
-
- @Override
- public void loadCloudData() {
- if (getSelectedServerItem().isNew()) {
- myDataLoader.loadCloudData();
- }
- }
- });
- }
- else {
- myDataLoader.loadCloudData();
- }
+ protected void setConnectionStatusText(boolean error, String text) {
+ super.setConnectionStatusText(error, error ? "" : text);
+ errorConsumerRef.get().consume(error ? text : null);
}
};
+
+ final SingleConfigurableEditor configurableEditor
+ = new SingleConfigurableEditor(myMainPanel, configurable, ShowSettingsUtilImpl.createDimensionKey(configurable), false) {
+
+ {
+ errorConsumerRef.set(new Consumer<String>() {
+
+ @Override
+ public void consume(String s) {
+ setErrorText(s);
+ }
+ });
+ }
+ };
+
+ if (!configurableEditor.showAndGet()) {
+ return;
+ }
+
+ newAccount.setName(configurable.getDisplayName());
+
+ RemoteServersManager.getInstance().addServer(newAccount);
+ AccountItem newAccountItem = new AccountItem(newAccount);
+ myAccountComboBox.addItem(newAccountItem);
+ myAccountComboBox.setSelectedItem(newAccountItem);
}
- public void setDataLoader(CloudDataLoader dataLoader) {
- myDataLoader = dataLoader;
+ public JComponent getMainPanel() {
+ return myMainPanel;
}
- private void onAccountSelectionChanged() {
- myServerConfigurablePanel.setVisible(getSelectedServerItem().isNew());
+ @Nullable
+ public RemoteServer<?> getSelectedAccount() {
+ AccountItem selectedItem = (AccountItem)myAccountComboBox.getSelectedItem();
+ return selectedItem == null ? null : selectedItem.getAccount();
}
- protected JPanel createServerConfigurablePanel() {
- myNewServer = RemoteServersManager.getInstance().createServer(myCloudType, generateServerName());
- myServerConfigurable = new RemoteServerConfigurable(myNewServer, null, true);
- myServerConfigurablePanel = (JPanel)myServerConfigurable.createComponent();
- return myServerConfigurablePanel;
- }
-
- private String generateServerName() {
- return UniqueNameGenerator.generateUniqueName(myCloudType.getPresentableName(), new Condition<String>() {
+ private static String generateServerName(ServerType<?> cloudType) {
+ return UniqueNameGenerator.generateUniqueName(cloudType.getPresentableName(), new Condition<String>() {
@Override
public boolean value(String s) {
@@ -158,30 +189,60 @@
});
}
- public DeployToServerRunConfiguration<SC, DC> createRunConfiguration(Module module, DC deploymentConfiguration) {
+ public void validate() throws ConfigurationException {
+ if (getSelectedAccount() == null) {
+ throw new ConfigurationException("Account required");
+ }
+ }
+
+ public void setAccountOnContext(WizardContext context) {
+ RemoteServer<?> account = getSelectedAccount();
+ if (account == null) {
+ return;
+ }
+ context.putUserData(getKey(account.getType()), account);
+ }
+
+ public static void unsetAccountOnContext(WizardContext context, ServerType<?> cloudType) {
+ context.putUserData(getKey(cloudType), null);
+ }
+
+ private static Key<RemoteServer<?>> getKey(ServerType<?> cloudType) {
+ Key<RemoteServer<?>> result = ourCloudType2AccountKey.get(cloudType);
+ if (result == null) {
+ result = new Key<RemoteServer<?>>("cloud-account-" + cloudType.getId());
+ ourCloudType2AccountKey.put(cloudType, result);
+ }
+ return result;
+ }
+
+ public static void createRunConfiguration(WizardContext context,
+ ServerType<?> cloudType,
+ Module module,
+ CloudDeploymentNameConfiguration configuration) {
+ RemoteServer<?> account = context.getUserData(getKey(cloudType));
+ if (account == null) {
+ return;
+ }
+ createRunConfiguration(account, module, configuration);
+ }
+
+ public static <SC extends ServerConfiguration, DC extends DeploymentConfiguration>
+ DeployToServerRunConfiguration<SC, DC> createRunConfiguration(RemoteServer<SC> account, Module module, DC deploymentConfiguration) {
+
Project project = module.getProject();
- RemoteServer<SC> server = getServer();
- if (server == null) {
- return null;
- }
+ String accountName = account.getName();
- if (getSelectedServerItem().isNew()) {
- RemoteServersManager.getInstance().addServer(server);
- myNewServer = null;
- }
-
- String serverName = server.getName();
-
- String name = generateRunConfigurationName(serverName, module.getName());
+ String name = generateRunConfigurationName(accountName, module.getName());
final RunManagerEx runManager = RunManagerEx.getInstanceEx(project);
final RunnerAndConfigurationSettings runSettings
- = runManager.createRunConfiguration(name, getRunConfigurationType().getConfigurationFactories()[0]);
+ = runManager.createRunConfiguration(name, getRunConfigurationType(account.getType()).getConfigurationFactories()[0]);
final DeployToServerRunConfiguration<SC, DC> result = (DeployToServerRunConfiguration<SC, DC>)runSettings.getConfiguration();
- result.setServerName(serverName);
+ result.setServerName(accountName);
final ModulePointer modulePointer = ModulePointerManager.getInstance(project).create(module);
result.setDeploymentSource(new ModuleDeploymentSourceImpl(modulePointer));
@@ -194,43 +255,8 @@
return result;
}
- protected String generateRunConfigurationName(String serverName, String moduleName) {
- return CloudBundle.getText("run.configuration.name", serverName, moduleName);
- }
-
- protected void handleError(ConfigurationException e) {
- LOG.info(e);
- }
-
- public RemoteServer<SC> getServer() {
- try {
- return doGetServer();
- }
- catch (ConfigurationException e) {
- handleError(e);
- return null;
- }
- }
-
- private RemoteServer<SC> doGetServer() throws ConfigurationException {
- ServerItem serverItem = getSelectedServerItem();
- if (serverItem.isNew()) {
- myServerConfigurable.apply();
- myNewServer.setName(myServerConfigurable.getDisplayName());
- }
- return serverItem.getServer();
- }
-
- public void validate() throws ConfigurationException {
- doGetServer();
- }
-
- private ServerItem getSelectedServerItem() {
- return (ServerItem)myServerComboBox.getSelectedItem();
- }
-
- private DeployToServerConfigurationType getRunConfigurationType() {
- String id = DeployToServerConfigurationType.getId(myCloudType);
+ private static DeployToServerConfigurationType getRunConfigurationType(ServerType<?> cloudType) {
+ String id = DeployToServerConfigurationType.getId(cloudType);
for (ConfigurationType configurationType : ConfigurationType.CONFIGURATION_TYPE_EP.getExtensions()) {
if (configurationType instanceof DeployToServerConfigurationType) {
DeployToServerConfigurationType deployConfigurationType = (DeployToServerConfigurationType)configurationType;
@@ -242,35 +268,25 @@
return null;
}
- public JPanel getMainPanel() {
- return myMainPanel;
+ private static String generateRunConfigurationName(String serverName, String moduleName) {
+ return CloudBundle.getText("run.configuration.name", serverName, moduleName);
}
- @Override
- public void dispose() {
- myServerConfigurable.disposeUIResources();
- Disposer.dispose(myRunner);
- }
+ private static class AccountItem {
- private class ServerItem {
+ private final RemoteServer<?> myAccount;
- private final RemoteServer<SC> myServer;
-
- public ServerItem(RemoteServer<SC> server) {
- myServer = server;
+ public AccountItem(RemoteServer<?> account) {
+ myAccount = account;
}
- public boolean isNew() {
- return myServer == myNewServer;
- }
-
- public RemoteServer<SC> getServer() {
- return myServer;
+ public RemoteServer<?> getAccount() {
+ return myAccount;
}
@Override
public String toString() {
- return isNew() ? "New account..." : myServer.getName();
+ return myAccount.getName();
}
}
}
diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudRuntimeTask.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudRuntimeTask.java
index 1e03264..c8109dc 100644
--- a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudRuntimeTask.java
+++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudRuntimeTask.java
@@ -109,6 +109,11 @@
public void run(@NotNull ProgressIndicator indicator) {
progressive.run(indicator);
}
+
+ @Override
+ public boolean shouldStartInBackground() {
+ return CloudRuntimeTask.this.shouldStartInBackground();
+ }
};
}
@@ -122,6 +127,10 @@
return result.get();
}
+ protected boolean shouldStartInBackground() {
+ return true;
+ }
+
protected void postPerform(T result) {
}
diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudSupportConfigurableBase.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudSupportConfigurableBase.java
deleted file mode 100644
index 421e75d..0000000
--- a/platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudSupportConfigurableBase.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package com.intellij.remoteServer.util;
-
-import com.intellij.ProjectTopics;
-import com.intellij.ide.util.frameworkSupport.FrameworkSupportConfigurable;
-import com.intellij.ide.util.frameworkSupport.FrameworkSupportModel;
-import com.intellij.openapi.module.Module;
-import com.intellij.openapi.options.ConfigurationException;
-import com.intellij.openapi.project.ModuleAdapter;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.startup.StartupManager;
-import com.intellij.openapi.ui.MessageType;
-import com.intellij.openapi.util.Disposer;
-import com.intellij.remoteServer.ServerType;
-import com.intellij.remoteServer.configuration.RemoteServer;
-import com.intellij.remoteServer.runtime.Deployment;
-import com.intellij.remoteServer.runtime.ServerConnection;
-import com.intellij.remoteServer.runtime.ServerConnector;
-import com.intellij.remoteServer.runtime.deployment.ServerRuntimeInstance;
-import com.intellij.util.concurrency.Semaphore;
-import com.intellij.util.messages.MessageBusConnection;
-import com.intellij.util.ui.UIUtil;
-import org.jetbrains.annotations.NotNull;
-
-import javax.swing.*;
-import java.util.Collection;
-import java.util.concurrent.atomic.AtomicReference;
-
-/**
- * @author michael.golubev
- */
-public abstract class CloudSupportConfigurableBase<
- SC extends CloudConfigurationBase,
- DC extends CloudDeploymentNameConfiguration,
- SR extends CloudMultiSourceServerRuntimeInstance<DC, ?, ?, ?>,
- ST extends ServerType<SC>>
- extends FrameworkSupportConfigurable implements CloudDataLoader {
-
- private final ST myCloudType;
- private final Project myModelProject;
-
- private final CloudNotifier myNotifier;
-
- private boolean myInitialized = false;
-
- private CloudAccountSelectionEditor<SC, DC, ST> myAccountSelectionEditor;
-
- public CloudSupportConfigurableBase(ST cloudType, FrameworkSupportModel frameworkSupportModel) {
- myCloudType = cloudType;
- myModelProject = frameworkSupportModel.getProject();
- myNotifier = new CloudNotifier(cloudType.getPresentableName());
- }
-
- @Override
- public void dispose() {
- Disposer.dispose(getAccountSelectionEditor());
- }
-
- protected void initUI() {
- getAccountSelectionEditor().initUI();
- }
-
- @Override
- public void clearCloudData() {
- getExistingComboBox().removeAllItems();
- }
-
- @Override
- public void loadCloudData() {
- new ConnectionTask<Collection<Deployment>>("Loading existing applications list") {
-
- @Override
- protected void run(final ServerConnection<DC> connection,
- final Semaphore semaphore,
- final AtomicReference<Collection<Deployment>> result) {
- connection.connectIfNeeded(new ServerConnector.ConnectionCallback<DC>() {
-
- @Override
- public void connected(@NotNull ServerRuntimeInstance<DC> serverRuntimeInstance) {
- connection.computeDeployments(new Runnable() {
-
- @Override
- public void run() {
- result.set(connection.getDeployments());
- semaphore.up();
- UIUtil.invokeLaterIfNeeded(new Runnable() {
- @Override
- public void run() {
- if (!Disposer.isDisposed(CloudSupportConfigurableBase.this)) {
- setupExistingApplications(result.get());
- }
- }
- });
- }
- });
- }
-
- @Override
- public void errorOccurred(@NotNull String errorMessage) {
- runtimeErrorOccurred(errorMessage);
- semaphore.up();
- }
- });
- }
-
- @Override
- protected Collection<Deployment> run(SR serverRuntimeInstance) throws ServerRuntimeException {
- return null;
- }
- }.performAsync();
- }
-
- private void setupExistingApplications(Collection<Deployment> deployments) {
- JComboBox existingComboBox = getExistingComboBox();
- existingComboBox.removeAllItems();
- for (Deployment deployment : deployments) {
- existingComboBox.addItem(deployment.getName());
- }
- }
-
- @Override
- public void onFrameworkSelectionChanged(boolean selected) {
- if (selected && !myInitialized) {
- myInitialized = true;
- initUI();
- updateApplicationUI();
- }
- }
-
- protected void showMessage(String message, MessageType messageType) {
- getNotifier().showMessage(message, messageType);
- }
-
- protected Project getProject() {
- return myModelProject;
- }
-
- protected RemoteServer<SC> getServer() {
- return getAccountSelectionEditor().getServer();
- }
-
- protected void runOnModuleAdded(final Module module, final Runnable runnable) {
- if (myModelProject == null) {
- StartupManager.getInstance(module.getProject()).runWhenProjectIsInitialized(runnable);
- }
- else {
- MessageBusConnection connection = myModelProject.getMessageBus().connect(myModelProject);
- connection.subscribe(ProjectTopics.MODULES, new ModuleAdapter() {
-
- public void moduleAdded(Project project, Module addedModule) {
- if (addedModule == module) {
- runnable.run();
- }
- }
- });
- }
- }
-
- protected CloudAccountSelectionEditor<SC, DC, ST> getAccountSelectionEditor() {
- if (myAccountSelectionEditor == null) {
- myAccountSelectionEditor = new CloudAccountSelectionEditor<SC, DC, ST>(myCloudType) {
-
- @Override
- protected void handleError(ConfigurationException e) {
- getNotifier().showMessage(e.getMessage(), MessageType.ERROR);
- }
- };
- myAccountSelectionEditor.setDataLoader(this);
- }
- return myAccountSelectionEditor;
- }
-
- protected CloudNotifier getNotifier() {
- return myNotifier;
- }
-
- protected abstract JComboBox getExistingComboBox();
-
- protected abstract void updateApplicationUI();
-
- protected abstract class ConnectionTask<T> extends CloudConnectionTask<T, SC, DC, SR> {
-
- public ConnectionTask(String title) {
- super(myModelProject, title, CloudSupportConfigurableBase.this.getServer());
- }
-
- public ConnectionTask(Module module, String title) {
- super(module.getProject(), title, CloudSupportConfigurableBase.this.getServer());
- }
- }
-}
diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/BasicDebuggerViewSupport.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/BasicDebuggerViewSupport.java
index 53fa54a..a5cf778d 100644
--- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/BasicDebuggerViewSupport.java
+++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/BasicDebuggerViewSupport.java
@@ -106,4 +106,9 @@
public Value transformErrorOnGetUsedReferenceValue(@Nullable Value value, @Nullable String error) {
return value;
}
+
+ @Override
+ public boolean isInLibraryContent(@NotNull SourceInfo sourceInfo, @Nullable Script script) {
+ return false;
+ }
}
\ No newline at end of file
diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.java
index cf24d06..d341dda 100644
--- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.java
+++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.java
@@ -56,4 +56,6 @@
@Nullable
Value transformErrorOnGetUsedReferenceValue(@Nullable Value value, @Nullable String error);
+
+ boolean isInLibraryContent(@NotNull SourceInfo sourceInfo, @Nullable Script script);
}
\ No newline at end of file
diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.java
index 352b673..ada850d 100644
--- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.java
+++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.java
@@ -164,7 +164,7 @@
if (!node.isObsolete()) {
value = getViewSupport().transformErrorOnGetUsedReferenceValue(value, error);
if (value == null) {
- node.setPresentation(getIcon(), null, error, false);
+ node.setPresentation(AllIcons.Debugger.Db_primitive, null, error, false);
}
else {
VariableView.this.value = value;
diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java
index eb698e6..3cb993a 100644
--- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java
+++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java
@@ -16,6 +16,8 @@
private final Script script;
+ private final boolean inLibraryContent;
+
public CallFrameView(@NotNull CallFrame callFrame, @NotNull DebuggerViewSupport debugProcess, @Nullable Script script) {
this(callFrame, debugProcess.getSourceInfo(script, callFrame), debugProcess, script);
}
@@ -29,6 +31,9 @@
this.debugProcess = debugProcess;
this.callFrame = callFrame;
this.script = script;
+
+ // isInLibraryContent call could be costly, so we compute it only once (our customizePresentation called on each repaint)
+ inLibraryContent = sourceInfo != null && debugProcess.isInLibraryContent(sourceInfo, script);
}
@Override
@@ -48,6 +53,11 @@
}
@Override
+ protected boolean isInLibraryContent() {
+ return inLibraryContent;
+ }
+
+ @Override
protected void customizeInvalidFramePresentation(ColoredTextContainer component) {
assert sourceInfo == null;
diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/StackFrameImplBase.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/StackFrameImplBase.java
index adc67ba..fb4e877 100644
--- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/StackFrameImplBase.java
+++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/StackFrameImplBase.java
@@ -38,6 +38,10 @@
return false;
}
+ protected boolean isInLibraryContent() {
+ return false;
+ }
+
@Override
public final void customizePresentation(@NotNull ColoredTextContainer component) {
if (sourceInfo == null) {
@@ -48,18 +52,21 @@
String fileName = sourceInfo.getFile().getName();
int line = sourceInfo.getLine() + 1;
+ boolean isInLibraryContent = isInLibraryContent();
+ SimpleTextAttributes textAttributes = isInLibraryContent ? SimpleTextAttributes.GRAYED_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES;
+
String functionName = sourceInfo.getFunctionName();
if (functionName == null || (functionName.isEmpty() && isInFileScope())) {
- component.append(fileName + ":" + line, SimpleTextAttributes.REGULAR_ATTRIBUTES);
+ component.append(fileName + ":" + line, textAttributes);
}
else {
if (functionName.isEmpty()) {
- component.append("anonymous", SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES);
+ component.append("anonymous", isInLibraryContent ? SimpleTextAttributes.GRAYED_ITALIC_ATTRIBUTES : SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES);
}
else {
- component.append(functionName, SimpleTextAttributes.REGULAR_ATTRIBUTES);
+ component.append(functionName, textAttributes);
}
- component.append("(), " + fileName + ":" + line, SimpleTextAttributes.REGULAR_ATTRIBUTES);
+ component.append("(), " + fileName + ":" + line, textAttributes);
}
component.setIcon(AllIcons.Debugger.StackFrame);
}
diff --git a/plugins/structuralsearch/build.xml b/platform/structuralsearch/build.xml
similarity index 99%
rename from plugins/structuralsearch/build.xml
rename to platform/structuralsearch/build.xml
index 942281d..4472cf7 100644
--- a/plugins/structuralsearch/build.xml
+++ b/platform/structuralsearch/build.xml
@@ -1,4 +1,4 @@
-<project name="StructuralSearchPlugin" default="jar_plugin" basedir=".">
+<project name="StructuralSearchPlugin" default="jar_plugin" basedir="">
<property name="plugname" value="StructuralSearchPlugin"/>
<property name="releasePlugname" value="SS"/>
<property name="build.path" value="${project.path}/build_out"/>
diff --git a/plugins/structuralsearch/structuralsearch-java/src/META-INF/plugin.xml b/platform/structuralsearch/source/META-INF/structuralsearch.xml
similarity index 83%
rename from plugins/structuralsearch/structuralsearch-java/src/META-INF/plugin.xml
rename to platform/structuralsearch/source/META-INF/structuralsearch.xml
index c95376c0..d42c61a 100644
--- a/plugins/structuralsearch/structuralsearch-java/src/META-INF/plugin.xml
+++ b/platform/structuralsearch/source/META-INF/structuralsearch.xml
@@ -1,12 +1,4 @@
<idea-plugin>
- <name>Structural Search</name>
- <description>Searching / replacing source code in terms of syntax (query / replace code by example :-).
- </description>
- <version>9.0</version>
- <vendor>JetBrains</vendor>
- <depends>com.intellij.modules.lang</depends>
- <depends optional="true" config-file="java.xml">com.intellij.java-i18n</depends>
-
<extensionPoints>
<extensionPoint qualifiedName="com.intellij.structuralsearch.profile"
interface="com.intellij.structuralsearch.StructuralSearchProfile"/>
@@ -26,7 +18,6 @@
<structuralsearch.profile implementation="com.intellij.structuralsearch.XmlStructuralSearchProfile"/>
</extensions>
- <resource-bundle>messages.SSRBundle</resource-bundle>
<project-components>
<component>
<implementation-class>com.intellij.structuralsearch.plugin.StructuralSearchPlugin</implementation-class>
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/DocumentBasedReplaceHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/DocumentBasedReplaceHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/DocumentBasedReplaceHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/DocumentBasedReplaceHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/MalformedPatternException.java b/platform/structuralsearch/source/com/intellij/structuralsearch/MalformedPatternException.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/MalformedPatternException.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/MalformedPatternException.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/MatchOptions.java b/platform/structuralsearch/source/com/intellij/structuralsearch/MatchOptions.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/MatchOptions.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/MatchOptions.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/MatchResult.java b/platform/structuralsearch/source/com/intellij/structuralsearch/MatchResult.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/MatchResult.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/MatchResult.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/MatchResultSink.java b/platform/structuralsearch/source/com/intellij/structuralsearch/MatchResultSink.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/MatchResultSink.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/MatchResultSink.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/MatchVariableConstraint.java b/platform/structuralsearch/source/com/intellij/structuralsearch/MatchVariableConstraint.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/MatchVariableConstraint.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/MatchVariableConstraint.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/Matcher.java b/platform/structuralsearch/source/com/intellij/structuralsearch/Matcher.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/Matcher.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/Matcher.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/MatchingProcess.java b/platform/structuralsearch/source/com/intellij/structuralsearch/MatchingProcess.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/MatchingProcess.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/MatchingProcess.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/NamedScriptableDefinition.java b/platform/structuralsearch/source/com/intellij/structuralsearch/NamedScriptableDefinition.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/NamedScriptableDefinition.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/NamedScriptableDefinition.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/PredefinedConfigurationUtil.java b/platform/structuralsearch/source/com/intellij/structuralsearch/PredefinedConfigurationUtil.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/PredefinedConfigurationUtil.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/PredefinedConfigurationUtil.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/ReplacementVariableDefinition.java b/platform/structuralsearch/source/com/intellij/structuralsearch/ReplacementVariableDefinition.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/ReplacementVariableDefinition.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/ReplacementVariableDefinition.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/SSRBundle.java b/platform/structuralsearch/source/com/intellij/structuralsearch/SSRBundle.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/SSRBundle.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/SSRBundle.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralReplaceHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/StructuralReplaceHandler.java
similarity index 68%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralReplaceHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/StructuralReplaceHandler.java
index 063f272..2a9bf21 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralReplaceHandler.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/StructuralReplaceHandler.java
@@ -1,5 +1,6 @@
package com.intellij.structuralsearch;
+import com.intellij.psi.PsiElement;
import com.intellij.structuralsearch.plugin.replace.ReplaceOptions;
import com.intellij.structuralsearch.plugin.replace.ReplacementInfo;
@@ -9,7 +10,7 @@
public abstract class StructuralReplaceHandler {
public abstract void replace(final ReplacementInfo info, ReplaceOptions options);
- public void prepare
- (ReplacementInfo info) {
- }
+ public void prepare(ReplacementInfo info) {}
+
+ public void postProcess(PsiElement affectedElement, ReplaceOptions options) {}
}
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchException.java b/platform/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchException.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchException.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchException.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchProfile.java b/platform/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchProfile.java
similarity index 99%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchProfile.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchProfile.java
index ff7b379..e40683d 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchProfile.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchProfile.java
@@ -237,7 +237,7 @@
final PsiElement currentElement = matchResult.getMatch();
if (buf.length() > 0) {
- if (info.isParameterContext()) {
+ if (info.isArgumentContext()) {
buf.append(',');
} else {
buf.append(' ');
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchProfileBase.java b/platform/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchProfileBase.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchProfileBase.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchProfileBase.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchUtil.java b/platform/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchUtil.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchUtil.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/StructuralSearchUtil.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/UnsupportedPatternException.java b/platform/structuralsearch/source/com/intellij/structuralsearch/UnsupportedPatternException.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/UnsupportedPatternException.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/UnsupportedPatternException.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/XmlStructuralSearchProfile.java b/platform/structuralsearch/source/com/intellij/structuralsearch/XmlStructuralSearchProfile.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/XmlStructuralSearchProfile.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/XmlStructuralSearchProfile.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/CompiledPattern.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/CompiledPattern.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/CompiledPattern.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/CompiledPattern.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/DataProvider.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/DataProvider.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/DataProvider.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/DataProvider.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/GlobalMatchingVisitor.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/GlobalMatchingVisitor.java
similarity index 98%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/GlobalMatchingVisitor.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/GlobalMatchingVisitor.java
index bfbe065..5577db0 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/GlobalMatchingVisitor.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/GlobalMatchingVisitor.java
@@ -51,10 +51,6 @@
return myResult;
}
- public void setElement(PsiElement element) {
- this.myElement = element;
- }
-
public void setResult(boolean result) {
this.myResult = result;
}
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchConstraintsSink.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchConstraintsSink.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchConstraintsSink.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchConstraintsSink.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchContext.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchContext.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchContext.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchContext.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchPredicateProvider.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchPredicateProvider.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchPredicateProvider.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchPredicateProvider.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchResultImpl.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchResultImpl.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchResultImpl.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchResultImpl.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchUtils.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchUtils.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchUtils.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatchUtils.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImpl.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImpl.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImpl.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImpl.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImplUtil.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImplUtil.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImplUtil.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImplUtil.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/PatternTreeContext.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/PatternTreeContext.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/PatternTreeContext.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/PatternTreeContext.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/XmlCompiledPattern.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/XmlCompiledPattern.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/XmlCompiledPattern.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/XmlCompiledPattern.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/XmlMatchingVisitor.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/XmlMatchingVisitor.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/XmlMatchingVisitor.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/XmlMatchingVisitor.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/CompileContext.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/CompileContext.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/CompileContext.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/CompileContext.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/DeleteNodesAction.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/DeleteNodesAction.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/DeleteNodesAction.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/DeleteNodesAction.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/FindInFilesOptimizingSearchHelper.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/FindInFilesOptimizingSearchHelper.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/FindInFilesOptimizingSearchHelper.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/FindInFilesOptimizingSearchHelper.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/GlobalCompilingVisitor.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/GlobalCompilingVisitor.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/GlobalCompilingVisitor.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/GlobalCompilingVisitor.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/OptimizingSearchHelper.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/OptimizingSearchHelper.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/OptimizingSearchHelper.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/OptimizingSearchHelper.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/OptimizingSearchHelperBase.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/OptimizingSearchHelperBase.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/OptimizingSearchHelperBase.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/OptimizingSearchHelperBase.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/PatternCompiler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/PatternCompiler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/PatternCompiler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/PatternCompiler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformer.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformer.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformer.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformer.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/TestModeOptimizingSearchHelper.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/TestModeOptimizingSearchHelper.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/TestModeOptimizingSearchHelper.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/TestModeOptimizingSearchHelper.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/XmlCompilingVisitor.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/XmlCompilingVisitor.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/XmlCompilingVisitor.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/XmlCompilingVisitor.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/CompositeFilter.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/CompositeFilter.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/CompositeFilter.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/CompositeFilter.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/DefaultFilter.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/DefaultFilter.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/DefaultFilter.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/DefaultFilter.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/LexicalNodesFilter.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/LexicalNodesFilter.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/LexicalNodesFilter.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/LexicalNodesFilter.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/TagValueFilter.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/TagValueFilter.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/TagValueFilter.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/TagValueFilter.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/XmlLexicalNodesFilter.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/XmlLexicalNodesFilter.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/XmlLexicalNodesFilter.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/filters/XmlLexicalNodesFilter.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/DelegatingHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/DelegatingHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/DelegatingHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/DelegatingHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/LightTopLevelMatchingHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/LightTopLevelMatchingHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/LightTopLevelMatchingHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/LightTopLevelMatchingHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/LiteralWithSubstitutionHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/LiteralWithSubstitutionHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/LiteralWithSubstitutionHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/LiteralWithSubstitutionHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/MatchPredicate.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/MatchPredicate.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/MatchPredicate.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/MatchPredicate.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/MatchingHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/MatchingHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/MatchingHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/MatchingHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SimpleHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SimpleHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SimpleHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SimpleHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SkippingHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SkippingHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SkippingHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SkippingHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SubstitutionHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SubstitutionHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SubstitutionHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SubstitutionHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SymbolHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SymbolHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SymbolHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/SymbolHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/TopLevelMatchingHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/TopLevelMatchingHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/TopLevelMatchingHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/TopLevelMatchingHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/TypedSymbolHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/TypedSymbolHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/TypedSymbolHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/TypedSymbolHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/XmlTextHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/XmlTextHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/XmlTextHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/handlers/XmlTextHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/iterators/SsrFilteringNodeIterator.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/iterators/SsrFilteringNodeIterator.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/iterators/SsrFilteringNodeIterator.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/iterators/SsrFilteringNodeIterator.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/AbstractStringBasedPredicate.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/AbstractStringBasedPredicate.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/AbstractStringBasedPredicate.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/AbstractStringBasedPredicate.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/BinaryPredicate.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/BinaryPredicate.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/BinaryPredicate.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/BinaryPredicate.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ContainsPredicate.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ContainsPredicate.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ContainsPredicate.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ContainsPredicate.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/NotPredicate.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/NotPredicate.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/NotPredicate.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/NotPredicate.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ReferencePredicate.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ReferencePredicate.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ReferencePredicate.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ReferencePredicate.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/RegExpPredicate.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/RegExpPredicate.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/RegExpPredicate.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/RegExpPredicate.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ScriptPredicate.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ScriptPredicate.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ScriptPredicate.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ScriptPredicate.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ScriptSupport.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ScriptSupport.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ScriptSupport.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/ScriptSupport.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/WithinPredicate.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/WithinPredicate.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/WithinPredicate.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/WithinPredicate.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/strategies/MatchingStrategy.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/strategies/MatchingStrategy.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/strategies/MatchingStrategy.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/strategies/MatchingStrategy.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/strategies/XmlMatchingStrategy.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/strategies/XmlMatchingStrategy.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/strategies/XmlMatchingStrategy.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/strategies/XmlMatchingStrategy.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspection.java b/platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspection.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspection.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspection.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionCompiledPatternsCache.java b/platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionCompiledPatternsCache.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionCompiledPatternsCache.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionCompiledPatternsCache.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionOptions.java b/platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionOptions.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionOptions.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionOptions.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralReplaceAction.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralReplaceAction.java
similarity index 91%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralReplaceAction.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralReplaceAction.java
index 33e7ac5..974d04a 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralReplaceAction.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralReplaceAction.java
@@ -2,7 +2,6 @@
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.project.Project;
-import com.intellij.structuralsearch.SSRBundle;
import com.intellij.structuralsearch.plugin.replace.ui.ReplaceDialog;
import com.intellij.structuralsearch.plugin.ui.Configuration;
import com.intellij.structuralsearch.plugin.ui.SearchContext;
@@ -12,10 +11,6 @@
*/
public class StructuralReplaceAction extends AnAction {
- public StructuralReplaceAction() {
- super(SSRBundle.message("structuralreplace.action"));
- }
-
/** Handles IDEA action event
* @param event the event of action
*/
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchAction.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchAction.java
similarity index 91%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchAction.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchAction.java
index 116f885..fdfccb9 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchAction.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchAction.java
@@ -2,17 +2,12 @@
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.project.Project;
-import com.intellij.structuralsearch.SSRBundle;
import com.intellij.structuralsearch.plugin.ui.Configuration;
import com.intellij.structuralsearch.plugin.ui.SearchContext;
import com.intellij.structuralsearch.plugin.ui.SearchDialog;
public class StructuralSearchAction extends AnAction {
- public StructuralSearchAction() {
- super(SSRBundle.message("structuralsearch.action"));
- }
-
/** Handles IDEA action event
* @param event the event of action
*/
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchPlugin.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchPlugin.java
similarity index 95%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchPlugin.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchPlugin.java
index 23de5ef..9acc1db 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchPlugin.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/StructuralSearchPlugin.java
@@ -6,6 +6,7 @@
import com.intellij.openapi.util.JDOMExternalizable;
import com.intellij.structuralsearch.plugin.ui.ConfigurationManager;
import com.intellij.structuralsearch.plugin.ui.ExistingTemplatesComponent;
+import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
/**
@@ -78,11 +79,11 @@
LoggerHolder.logger.info(str);
}
- public void readExternal(org.jdom.Element element) {
+ public void readExternal(Element element) {
myConfigurationManager.loadConfigurations(element);
}
- public void writeExternal(org.jdom.Element element) {
+ public void writeExternal(Element element) {
myConfigurationManager.saveConfigurations(element);
}
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ReplaceOptions.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ReplaceOptions.java
similarity index 86%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ReplaceOptions.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ReplaceOptions.java
index d18d51a..31642aa 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ReplaceOptions.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ReplaceOptions.java
@@ -1,16 +1,12 @@
package com.intellij.structuralsearch.plugin.replace;
import com.intellij.openapi.util.JDOMExternalizable;
-import com.intellij.openapi.util.Key;
-import com.intellij.openapi.util.UserDataHolder;
import com.intellij.structuralsearch.MatchOptions;
import com.intellij.structuralsearch.ReplacementVariableDefinition;
-import gnu.trove.THashMap;
import org.jdom.Attribute;
import org.jdom.DataConversionException;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
-import org.jetbrains.annotations.NotNull;
import java.util.*;
@@ -19,18 +15,19 @@
* Date: Mar 5, 2004
* Time: 7:51:38 PM
*/
-public class ReplaceOptions implements JDOMExternalizable, Cloneable, UserDataHolder {
+public class ReplaceOptions implements JDOMExternalizable, Cloneable {
private Map<String, ReplacementVariableDefinition> variableDefs;
private String replacement = "";
private boolean toShortenFQN;
private boolean myToReformatAccordingToStyle;
+ private boolean myToUseStaticImport = false;
private MatchOptions matchOptions = new MatchOptions();
@NonNls private static final String REFORMAT_ATTR_NAME = "reformatAccordingToStyle";
@NonNls private static final String REPLACEMENT_ATTR_NAME = "replacement";
@NonNls private static final String SHORTEN_FQN_ATTR_NAME = "shortenFQN";
+ @NonNls private static final String USE_STATIC_IMPORT_ATTR_NAME = "useStaticImport";
- private THashMap myUserMap = null;
@NonNls private static final String VARIABLE_DEFINITION_TAG_NAME = "variableDefinition";
public String getReplacement() {
@@ -65,6 +62,14 @@
myToReformatAccordingToStyle = reformatAccordingToStyle;
}
+ public boolean isToUseStaticImport() {
+ return myToUseStaticImport;
+ }
+
+ public void setToUseStaticImport(boolean useStaticImport) {
+ myToUseStaticImport = useStaticImport;
+ }
+
public void readExternal(Element element) {
matchOptions.readExternal(element);
@@ -78,7 +83,15 @@
try {
toShortenFQN = attribute.getBooleanValue();
} catch(DataConversionException ex) {}
-
+
+ attribute = element.getAttribute(USE_STATIC_IMPORT_ATTR_NAME);
+ if (attribute != null) { // old saved configurations without this attribute present
+ try {
+ myToUseStaticImport = attribute.getBooleanValue();
+ }
+ catch (DataConversionException ignore) {}
+ }
+
replacement = element.getAttributeValue(REPLACEMENT_ATTR_NAME);
List<Element> elements = element.getChildren(VARIABLE_DEFINITION_TAG_NAME);
@@ -97,6 +110,9 @@
element.setAttribute(REFORMAT_ATTR_NAME,String.valueOf(myToReformatAccordingToStyle));
element.setAttribute(SHORTEN_FQN_ATTR_NAME,String.valueOf(toShortenFQN));
+ if (isToUseStaticImport()) {
+ element.setAttribute(USE_STATIC_IMPORT_ATTR_NAME, String.valueOf(isToUseStaticImport()));
+ }
element.setAttribute(REPLACEMENT_ATTR_NAME,replacement);
if (variableDefs!=null) {
@@ -116,6 +132,7 @@
if (myToReformatAccordingToStyle != replaceOptions.myToReformatAccordingToStyle) return false;
if (toShortenFQN != replaceOptions.toShortenFQN) return false;
+ if (myToUseStaticImport != replaceOptions.myToUseStaticImport) return false;
if (matchOptions != null ? !matchOptions.equals(replaceOptions.matchOptions) : replaceOptions.matchOptions != null) return false;
if (replacement != null ? !replacement.equals(replaceOptions.replacement) : replaceOptions.replacement != null) return false;
if (variableDefs != null ? !variableDefs.equals(replaceOptions.variableDefs) : replaceOptions.variableDefs != null) {
@@ -130,6 +147,7 @@
result = (replacement != null ? replacement.hashCode() : 0);
result = 29 * result + (toShortenFQN ? 1 : 0);
result = 29 * result + (myToReformatAccordingToStyle ? 1 : 0);
+ result = 29 * result + (myToUseStaticImport ? 1 : 0);
result = 29 * result + (matchOptions != null ? matchOptions.hashCode() : 0);
result = 29 * result + (variableDefs != null ? variableDefs.hashCode() : 0);
return result;
@@ -146,16 +164,6 @@
}
}
- public <T> T getUserData(@NotNull Key<T> key) {
- if (myUserMap==null) return null;
- return (T)myUserMap.get(key);
- }
-
- public <T> void putUserData(@NotNull Key<T> key, T value) {
- if (myUserMap==null) myUserMap = new THashMap(1);
- myUserMap.put(key,value);
- }
-
public ReplacementVariableDefinition getVariableDefinition(String name) {
return variableDefs != null ? variableDefs.get(name): null;
}
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ReplacementInfo.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ReplacementInfo.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ReplacementInfo.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ReplacementInfo.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ParameterInfo.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ParameterInfo.java
similarity index 75%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ParameterInfo.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ParameterInfo.java
index 43ce859..3e23273 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ParameterInfo.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ParameterInfo.java
@@ -5,15 +5,14 @@
public final class ParameterInfo {
private String name;
private int startIndex;
- private boolean parameterContext;
+ private boolean argumentContext;
private boolean methodParameterContext;
private boolean statementContext;
- private boolean variableInitialContext;
+ private boolean variableInitializerContext;
private int afterDelimiterPos;
private boolean hasCommaBefore;
private int beforeDelimiterPos;
private boolean hasCommaAfter;
- private boolean scopeParameterization;
private boolean replacementVariable;
private PsiElement myElement;
@@ -33,12 +32,12 @@
this.startIndex = startIndex;
}
- public boolean isParameterContext() {
- return parameterContext;
+ public boolean isArgumentContext() {
+ return argumentContext;
}
- public void setParameterContext(boolean parameterContext) {
- this.parameterContext = parameterContext;
+ public void setArgumentContext(boolean argumentContext) {
+ this.argumentContext = argumentContext;
}
public boolean isMethodParameterContext() {
@@ -57,12 +56,12 @@
this.statementContext = statementContext;
}
- public boolean isVariableInitialContext() {
- return variableInitialContext;
+ public boolean isVariableInitializerContext() {
+ return variableInitializerContext;
}
- public void setVariableInitialContext(boolean variableInitialContext) {
- this.variableInitialContext = variableInitialContext;
+ public void setVariableInitializerContext(boolean variableInitializerContext) {
+ this.variableInitializerContext = variableInitializerContext;
}
public int getAfterDelimiterPos() {
@@ -97,14 +96,6 @@
this.hasCommaAfter = hasCommaAfter;
}
- public boolean isScopeParameterization() {
- return scopeParameterization;
- }
-
- public void setScopeParameterization(boolean scopeParameterization) {
- this.scopeParameterization = scopeParameterization;
- }
-
public boolean isReplacementVariable() {
return replacementVariable;
}
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementBuilder.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementBuilder.java
similarity index 95%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementBuilder.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementBuilder.java
index 81933d9..e72fd55 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementBuilder.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementBuilder.java
@@ -16,6 +16,8 @@
import com.intellij.structuralsearch.impl.matcher.predicates.ScriptSupport;
import com.intellij.structuralsearch.plugin.replace.ReplaceOptions;
import com.intellij.util.IncorrectOperationException;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.*;
@@ -27,10 +29,8 @@
public final class ReplacementBuilder {
private String replacement;
private List<ParameterInfo> parameterizations;
- private HashMap<String,MatchResult> matchMap;
private final Map<String, ScriptSupport> replacementVarsMap;
private final ReplaceOptions options;
- //private Map<TextRange,ParameterInfo> scopedParameterizations;
ReplacementBuilder(final Project project,final ReplaceOptions options) {
replacementVarsMap = new HashMap<String, ScriptSupport>();
@@ -76,7 +76,7 @@
info.setStatementContext(true);
}
else if (ch == ',' || ch == ')') {
- info.setParameterContext(true);
+ info.setArgumentContext(true);
info.setHasCommaAfter(ch == ',');
}
info.setAfterDelimiterPos(pos);
@@ -136,7 +136,7 @@
}
final StringBuilder result = new StringBuilder(replacement);
- matchMap = new HashMap<String,MatchResult>();
+ HashMap<String, MatchResult> matchMap = new HashMap<String, MatchResult>();
fill(match, matchMap);
int offset = 0;
@@ -160,7 +160,7 @@
result.delete(info.getAfterDelimiterPos() + offset, info.getAfterDelimiterPos() + 1 + offset);
--offset;
}
- else if (info.isVariableInitialContext()) {
+ else if (info.isVariableInitializerContext()) {
//if (info.afterDelimiterPos > 0) {
result.delete(info.getBeforeDelimiterPos() + offset, info.getAfterDelimiterPos() + offset - 1);
offset -= (info.getAfterDelimiterPos() - info.getBeforeDelimiterPos() - 1);
@@ -188,6 +188,7 @@
return scriptSupport.evaluate((MatchResultImpl)match, null);
}
+ @Nullable
public ParameterInfo findParameterization(String name) {
if (parameterizations==null) return null;
@@ -210,7 +211,7 @@
}
}
- public void addParametrization(ParameterInfo e) {
+ public void addParametrization(@NotNull ParameterInfo e) {
assert parameterizations != null;
parameterizations.add(e);
}
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementContext.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementContext.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementContext.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementContext.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementInfoImpl.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementInfoImpl.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementInfoImpl.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementInfoImpl.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/Replacer.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/Replacer.java
similarity index 96%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/Replacer.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/Replacer.java
index 9980e95..32cb2f8 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/Replacer.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/Replacer.java
@@ -158,12 +158,12 @@
currentAffectedElement = doReplace(aResultPtrList);
if (currentAffectedElement != lastAffectedElement) {
- if (lastAffectedElement != null) reformatAndShortenRefs(lastAffectedElement);
+ if (lastAffectedElement != null) reformatAndPostProcess(lastAffectedElement);
lastAffectedElement = currentAffectedElement;
}
}
- reformatAndShortenRefs(lastAffectedElement);
+ reformatAndPostProcess(lastAffectedElement);
}
public void replace(ReplacementInfo info) {
@@ -173,7 +173,7 @@
if (replaceHandler != null) {
replaceHandler.prepare(info);
}
- reformatAndShortenRefs(doReplace(info));
+ reformatAndPostProcess(doReplace(info));
}
@Nullable
@@ -211,11 +211,10 @@
return elementParent;
}
- private void reformatAndShortenRefs(final PsiElement elementParent) {
+ private void reformatAndPostProcess(final PsiElement elementParent) {
if (elementParent == null) return;
final Runnable action = new Runnable() {
public void run() {
- CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(PsiManager.getInstance(project).getProject());
final PsiFile containingFile = elementParent.getContainingFile();
if (containingFile != null && options.isToReformatAccordingToStyle()) {
@@ -225,8 +224,11 @@
}
final int parentOffset = elementParent.getTextRange().getStartOffset();
-
- codeStyleManager.reformatRange(containingFile, parentOffset, parentOffset + elementParent.getTextLength(), true);
+ CodeStyleManager.getInstance(project)
+ .reformatRange(containingFile, parentOffset, parentOffset + elementParent.getTextLength(), true);
+ }
+ if (replaceHandler != null) {
+ replaceHandler.postProcess(elementParent, options);
}
}
};
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacerUtil.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacerUtil.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacerUtil.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacerUtil.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceCommand.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceCommand.java
similarity index 83%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceCommand.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceCommand.java
index 32b99d7..1b704f7 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceCommand.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceCommand.java
@@ -1,10 +1,9 @@
package com.intellij.structuralsearch.plugin.replace.ui;
-import com.intellij.structuralsearch.plugin.ui.SearchCommand;
-import com.intellij.structuralsearch.plugin.StructuralSearchPlugin;
-import com.intellij.structuralsearch.plugin.replace.ReplaceOptions;
-import com.intellij.structuralsearch.MatchResult;
import com.intellij.openapi.project.Project;
+import com.intellij.structuralsearch.MatchResult;
+import com.intellij.structuralsearch.plugin.StructuralSearchPlugin;
+import com.intellij.structuralsearch.plugin.ui.SearchCommand;
import com.intellij.usages.Usage;
/**
@@ -15,12 +14,9 @@
* To change this template use File | Settings | File Templates.
*/
public class ReplaceCommand extends SearchCommand {
- private final ReplaceOptions options;
public ReplaceCommand(Project project, ReplaceUsageViewContext context) {
super( project, context );
- options = ((ReplaceConfiguration)context.getConfiguration()).getOptions();
-
}
protected void findStarted() {
@@ -41,8 +37,4 @@
final ReplaceUsageViewContext replaceUsageViewContext = ((ReplaceUsageViewContext)context);
replaceUsageViewContext.addReplaceUsage(usage,replaceUsageViewContext.getReplacer().buildReplacement(result));
}
-
- public ReplaceOptions getOptions() {
- return options;
- }
}
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceConfiguration.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceConfiguration.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceConfiguration.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceConfiguration.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceDialog.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceDialog.java
similarity index 89%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceDialog.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceDialog.java
index 2ae0b18..b02fada 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceDialog.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceDialog.java
@@ -1,5 +1,6 @@
package com.intellij.structuralsearch.plugin.replace.ui;
+import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.template.impl.Variable;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorFactory;
@@ -26,6 +27,7 @@
private Editor replaceCriteriaEdit;
private JCheckBox shortenFQN;
private JCheckBox formatAccordingToStyle;
+ private JCheckBox useStaticImport;
private String mySavedEditorText;
@@ -33,23 +35,6 @@
return SSRBundle.message("structural.replace.title");
}
- protected boolean isChanged(Configuration configuration) {
- if (super.isChanged(configuration)) return true;
-
- String replacement;
-
- if (configuration instanceof ReplaceConfiguration) {
- replacement = ((ReplaceConfiguration)configuration).getOptions().getReplacement();
- }
- else {
- replacement = configuration.getMatchOptions().getSearchPattern();
- }
-
- if (replacement == null) return false;
-
- return !replaceCriteriaEdit.getDocument().getText().equals(replacement);
- }
-
protected JComponent createEditorContent() {
JPanel result = new JPanel(new BorderLayout());
Splitter p;
@@ -78,12 +63,14 @@
protected void buildOptions(JPanel searchOptions) {
super.buildOptions(searchOptions);
- searchOptions
- .add(UIUtil.createOptionLine(shortenFQN = new JCheckBox(SSRBundle.message("shorten.fully.qualified.names.checkbox"), true)));
+ searchOptions.add(UIUtil.createOptionLine(shortenFQN = new JCheckBox(
+ SSRBundle.message("shorten.fully.qualified.names.checkbox"), true)));
- searchOptions
- .add(UIUtil.createOptionLine(formatAccordingToStyle = new JCheckBox(SSRBundle.message("format.according.to.style.checkbox"), true)));
+ searchOptions.add(UIUtil.createOptionLine(formatAccordingToStyle = new JCheckBox(
+ CodeInsightBundle.message("dialog.edit.template.checkbox.reformat.according.to.style"), true)));
+ searchOptions.add(UIUtil.createOptionLine(useStaticImport = new JCheckBox(
+ CodeInsightBundle.message("dialog.edit.template.checkbox.use.static.import"), true)));
}
protected UsageViewContext createUsageViewContext(Configuration configuration) {
@@ -124,6 +111,7 @@
shortenFQN.setSelected(options.isToShortenFQN());
formatAccordingToStyle.setSelected(options.isToReformatAccordingToStyle());
+ useStaticImport.setSelected(options.isToUseStaticImport());
ReplaceOptions newReplaceOptions = ((ReplaceConfiguration)model.getConfig()).getOptions();
newReplaceOptions.clearVariableDefinitions();
@@ -150,6 +138,7 @@
options.setReplacement(replaceCriteriaEdit.getDocument().getText());
options.setToShortenFQN(shortenFQN.isSelected());
options.setToReformatAccordingToStyle(formatAccordingToStyle.isSelected());
+ options.setToUseStaticImport(useStaticImport.isSelected());
}
protected boolean isRecursiveSearchEnabled() {
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceUsageViewContext.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceUsageViewContext.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceUsageViewContext.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceUsageViewContext.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplacementPreviewDialog.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplacementPreviewDialog.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplacementPreviewDialog.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplacementPreviewDialog.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/Configuration.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/Configuration.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/Configuration.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/Configuration.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ConfigurationCreator.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ConfigurationCreator.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ConfigurationCreator.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ConfigurationCreator.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ConfigurationManager.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ConfigurationManager.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ConfigurationManager.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ConfigurationManager.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/DialogBase.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/DialogBase.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/DialogBase.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/DialogBase.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/EditVarConstraintsDialog.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/EditVarConstraintsDialog.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/EditVarConstraintsDialog.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/EditVarConstraintsDialog.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ExistingTemplatesComponent.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ExistingTemplatesComponent.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ExistingTemplatesComponent.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ExistingTemplatesComponent.java
diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java
new file mode 100644
index 0000000..8cb7e55
--- /dev/null
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java
@@ -0,0 +1,142 @@
+package com.intellij.structuralsearch.plugin.ui;
+
+import com.intellij.notification.NotificationGroup;
+import com.intellij.openapi.application.ModalityState;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.MessageType;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.wm.ToolWindowId;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiNameIdentifierOwner;
+import com.intellij.structuralsearch.*;
+import com.intellij.structuralsearch.impl.matcher.MatchResultImpl;
+import com.intellij.structuralsearch.plugin.StructuralSearchPlugin;
+import com.intellij.usageView.UsageInfo;
+import com.intellij.usages.Usage;
+import com.intellij.usages.UsageInfo2UsageAdapter;
+import com.intellij.util.Alarm;
+import com.intellij.util.ObjectUtils;
+import com.intellij.util.Processor;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Maxim.Mossienko
+ * Date: Mar 15, 2004
+ * Time: 4:49:07 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class SearchCommand {
+ protected UsageViewContext context;
+ private MatchingProcess process;
+ protected Project project;
+
+ public SearchCommand(Project _project, UsageViewContext _context) {
+ project = _project;
+ context = _context;
+ }
+
+ public void findUsages(final Processor<Usage> processor) {
+ final ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
+
+ final MatchResultSink sink = new MatchResultSink() {
+ int count;
+
+ public void setMatchingProcess(MatchingProcess _process) {
+ process = _process;
+ findStarted();
+ }
+
+ public void processFile(PsiFile element) {
+ final VirtualFile virtualFile = element.getVirtualFile();
+ if (virtualFile != null)
+ progress.setText(SSRBundle.message("looking.in.progress.message", virtualFile.getPresentableName()));
+ }
+
+ public void matchingFinished() {
+ findEnded();
+ progress.setText(SSRBundle.message("found.progress.message", count));
+ }
+
+ public ProgressIndicator getProgressIndicator() {
+ return progress;
+ }
+
+ public void newMatch(MatchResult result) {
+ UsageInfo info;
+
+ if (MatchResult.MULTI_LINE_MATCH.equals(result.getName())) {
+ int start = -1;
+ int end = -1;
+ PsiElement parent = result.getMatchRef().getElement().getParent();
+
+ for (final MatchResult matchResult : ((MatchResultImpl)result).getMatches()) {
+ PsiElement el = matchResult.getMatchRef().getElement();
+ final int elementStart = el.getTextRange().getStartOffset();
+
+ if (start == -1 || start > elementStart) {
+ start = elementStart;
+ }
+ final int newend = elementStart + el.getTextLength();
+
+ if (newend > end) {
+ end = newend;
+ }
+ }
+
+ final int parentStart = parent.getTextRange().getStartOffset();
+ int startOffset = start - parentStart;
+ info = new UsageInfo(parent, startOffset, end - parentStart);
+ }
+ else {
+ PsiElement element = result.getMatch();
+ if (element instanceof PsiNameIdentifierOwner) {
+ element = ObjectUtils.notNull(((PsiNameIdentifierOwner)element).getNameIdentifier(), element);
+ }
+ info = new UsageInfo(element, result.getStart(), result.getEnd() == -1 ? element.getTextLength() : result.getEnd());
+ }
+
+ Usage usage = new UsageInfo2UsageAdapter(info);
+ processor.process(usage);
+ foundUsage(result, usage);
+ ++count;
+ }
+ };
+
+ try {
+ new Matcher(project).findMatches(sink, context.getConfiguration().getMatchOptions());
+ }
+ catch (final StructuralSearchException e) {
+ final Alarm alarm = new Alarm();
+ alarm.addRequest(
+ new Runnable() {
+ @Override
+ public void run() {
+ NotificationGroup.toolWindowGroup("Structural Search", ToolWindowId.FIND, true)
+ .createNotification(SSRBundle.message("problem", e.getMessage()), MessageType.ERROR).notify(project);
+ }
+ },
+ 100, ModalityState.NON_MODAL
+ );
+ }
+ }
+
+ public void stopAsyncSearch() {
+ if (process!=null) process.stop();
+ }
+
+ protected void findStarted() {
+ StructuralSearchPlugin.getInstance(project).setSearchInProgress(true);
+ }
+
+ protected void findEnded() {
+ if (!project.isDisposed()) {
+ StructuralSearchPlugin.getInstance(project).setSearchInProgress(false);
+ }
+ }
+
+ protected void foundUsage(MatchResult result, Usage usage) {
+ }
+}
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchConfiguration.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchConfiguration.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchConfiguration.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchConfiguration.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchContext.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchContext.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchContext.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchContext.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchDialog.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchDialog.java
similarity index 98%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchDialog.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchDialog.java
index 5255472..a3bee70 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchDialog.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchDialog.java
@@ -135,11 +135,6 @@
this.useLastConfiguration = useLastConfiguration;
}
- protected boolean isChanged(Configuration configuration) {
- return configuration.getMatchOptions().getSearchPattern() != null &&
- !searchCriteriaEdit.getDocument().getText().equals(configuration.getMatchOptions().getSearchPattern());
- }
-
public void setSearchPattern(final Configuration config) {
model.setShadowConfig(config);
setValuesFromConfig(config);
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchModel.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchModel.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchModel.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchModel.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SelectTemplateDialog.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SelectTemplateDialog.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SelectTemplateDialog.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SelectTemplateDialog.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SubstitutionShortInfoHandler.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SubstitutionShortInfoHandler.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SubstitutionShortInfoHandler.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SubstitutionShortInfoHandler.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/UIUtil.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/UIUtil.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/UIUtil.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/UIUtil.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/UsageViewContext.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/UsageViewContext.java
similarity index 92%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/UsageViewContext.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/UsageViewContext.java
index a55a16d..afd2ae1 100644
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/UsageViewContext.java
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/UsageViewContext.java
@@ -1,13 +1,13 @@
package com.intellij.structuralsearch.plugin.ui;
import com.intellij.navigation.ItemPresentation;
-import com.intellij.openapi.actionSystem.ActionManager;
-import com.intellij.openapi.actionSystem.KeyboardShortcut;
+import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
+import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.structuralsearch.SSRBundle;
import com.intellij.structuralsearch.plugin.replace.ui.ReplaceCommand;
import com.intellij.usages.*;
@@ -81,7 +81,7 @@
protected void configureActions() {}
- private class MyUsageTarget implements ConfigurableUsageTarget,ItemPresentation {
+ private class MyUsageTarget implements ConfigurableUsageTarget,ItemPresentation, TypeSafeDataProvider {
private final String myPresentableText;
MyUsageTarget(String str) {
@@ -179,5 +179,12 @@
public String getLongDescriptiveName() {
return _getPresentableText();
}
+
+ @Override
+ public void calcData(DataKey key, DataSink sink) {
+ if (key == UsageView.USAGE_SCOPE) {
+ sink.put(UsageView.USAGE_SCOPE, GlobalSearchScope.allScope(mySearchContext.getProject()));
+ }
+ }
}
}
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/VarConstraints.form b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/VarConstraints.form
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/VarConstraints.form
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/VarConstraints.form
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/util/CollectingMatchResultSink.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/util/CollectingMatchResultSink.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/util/CollectingMatchResultSink.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/util/CollectingMatchResultSink.java
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/util/SmartPsiPointer.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/util/SmartPsiPointer.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/util/SmartPsiPointer.java
rename to platform/structuralsearch/source/com/intellij/structuralsearch/plugin/util/SmartPsiPointer.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/AnonymToken.java b/platform/structuralsearch/source/com/intellij/tokenindex/AnonymToken.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/AnonymToken.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/AnonymToken.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/IndentToken.java b/platform/structuralsearch/source/com/intellij/tokenindex/IndentToken.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/IndentToken.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/IndentToken.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/LanguageTokenizer.java b/platform/structuralsearch/source/com/intellij/tokenindex/LanguageTokenizer.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/LanguageTokenizer.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/LanguageTokenizer.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/PathMarkerToken.java b/platform/structuralsearch/source/com/intellij/tokenindex/PathMarkerToken.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/PathMarkerToken.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/PathMarkerToken.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/PsiMarkerToken.java b/platform/structuralsearch/source/com/intellij/tokenindex/PsiMarkerToken.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/PsiMarkerToken.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/PsiMarkerToken.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/RecursiveTokenizingVisitor.java b/platform/structuralsearch/source/com/intellij/tokenindex/RecursiveTokenizingVisitor.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/RecursiveTokenizingVisitor.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/RecursiveTokenizingVisitor.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/TextToken.java b/platform/structuralsearch/source/com/intellij/tokenindex/TextToken.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/TextToken.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/TextToken.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/Token.java b/platform/structuralsearch/source/com/intellij/tokenindex/Token.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/Token.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/Token.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/TokenIndex.java b/platform/structuralsearch/source/com/intellij/tokenindex/TokenIndex.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/TokenIndex.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/TokenIndex.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/TokenIndexKey.java b/platform/structuralsearch/source/com/intellij/tokenindex/TokenIndexKey.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/TokenIndexKey.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/TokenIndexKey.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/TokenIndexKeyDescriptor.java b/platform/structuralsearch/source/com/intellij/tokenindex/TokenIndexKeyDescriptor.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/TokenIndexKeyDescriptor.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/TokenIndexKeyDescriptor.java
diff --git a/plugins/structuralsearch/source/com/intellij/tokenindex/Tokenizer.java b/platform/structuralsearch/source/com/intellij/tokenindex/Tokenizer.java
similarity index 100%
rename from plugins/structuralsearch/source/com/intellij/tokenindex/Tokenizer.java
rename to platform/structuralsearch/source/com/intellij/tokenindex/Tokenizer.java
diff --git a/plugins/structuralsearch/source/inspectionDescriptions/SSBasedInspection.html b/platform/structuralsearch/source/inspectionDescriptions/SSBasedInspection.html
similarity index 100%
rename from plugins/structuralsearch/source/inspectionDescriptions/SSBasedInspection.html
rename to platform/structuralsearch/source/inspectionDescriptions/SSBasedInspection.html
diff --git a/plugins/structuralsearch/source/messages/SSRBundle.properties b/platform/structuralsearch/source/messages/SSRBundle.properties
similarity index 96%
rename from plugins/structuralsearch/source/messages/SSRBundle.properties
rename to platform/structuralsearch/source/messages/SSRBundle.properties
index 488c96e..bfd1289 100644
--- a/plugins/structuralsearch/source/messages/SSRBundle.properties
+++ b/platform/structuralsearch/source/messages/SSRBundle.properties
@@ -1,8 +1,5 @@
search.produced.too.many.results.message=Search produced too many results, stopping the search process
-structuralreplace.action=StructuralReplaceAction
-structuralsearch.action=StructuralSearchAction
-
#replacement dialog preview
structural.replace.preview.dialog.title=Structural Replace Preview
replace.preview.oktext=&Replace
@@ -231,10 +228,6 @@
complete.match.variable.name=Complete Match
predefined.configuration.sample.method.invokation.with.constant.argument=sample method invocation with constant parameter
predefined.configuration.interfaces.having.no.descendants=interface that is not implemented or extended
-action.StructuralSearchPlugin.StructuralSearchAction.text=Search S_tructurally...
-action.StructuralSearchPlugin.StructuralSearchAction.description=Structural Search
-action.StructuralSearchPlugin.StructuralReplaceAction.text=Repla_ce Structurally...
-action.StructuralSearchPlugin.StructuralReplaceAction.description=Structural Replace
predefined.configuration.enums=enums
regular.expression.help.label=Regular Expressions Help
edit.groovy.script.constraint.title=Edit Groovy Script Constraint
diff --git a/plugins/structuralsearch/structuralsearch-tests.iml b/platform/structuralsearch/structuralsearch-tests.iml
similarity index 100%
rename from plugins/structuralsearch/structuralsearch-tests.iml
rename to platform/structuralsearch/structuralsearch-tests.iml
diff --git a/plugins/structuralsearch/structuralsearch.iml b/platform/structuralsearch/structuralsearch.iml
similarity index 100%
rename from plugins/structuralsearch/structuralsearch.iml
rename to platform/structuralsearch/structuralsearch.iml
diff --git a/plugins/structuralsearch/testData/java/DoNotFindReturn.java b/platform/structuralsearch/testData/java/DoNotFindReturn.java
similarity index 100%
rename from plugins/structuralsearch/testData/java/DoNotFindReturn.java
rename to platform/structuralsearch/testData/java/DoNotFindReturn.java
diff --git a/plugins/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_pattern.java b/platform/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_pattern.java
similarity index 100%
rename from plugins/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_pattern.java
rename to platform/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_pattern.java
diff --git a/plugins/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_replacement.java b/platform/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_replacement.java
similarity index 100%
rename from plugins/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_replacement.java
rename to platform/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_replacement.java
diff --git a/plugins/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_result.java b/platform/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_result.java
similarity index 100%
rename from plugins/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_result.java
rename to platform/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_result.java
diff --git a/plugins/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_source.java b/platform/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_source.java
similarity index 100%
rename from plugins/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_source.java
rename to platform/structuralsearch/testData/java/ReformatAndShortenClassRefPerformance_source.java
diff --git a/plugins/structuralsearch/testData/java/after1.java b/platform/structuralsearch/testData/java/after1.java
similarity index 100%
rename from plugins/structuralsearch/testData/java/after1.java
rename to platform/structuralsearch/testData/java/after1.java
diff --git a/plugins/structuralsearch/testData/java/after2.java b/platform/structuralsearch/testData/java/after2.java
similarity index 100%
rename from plugins/structuralsearch/testData/java/after2.java
rename to platform/structuralsearch/testData/java/after2.java
diff --git a/plugins/structuralsearch/testData/java/before1.java b/platform/structuralsearch/testData/java/before1.java
similarity index 100%
rename from plugins/structuralsearch/testData/java/before1.java
rename to platform/structuralsearch/testData/java/before1.java
diff --git a/plugins/structuralsearch/testData/java/before2.java b/platform/structuralsearch/testData/java/before2.java
similarity index 100%
rename from plugins/structuralsearch/testData/java/before2.java
rename to platform/structuralsearch/testData/java/before2.java
diff --git a/plugins/structuralsearch/testData/ssBased/ExpressionStatement.java b/platform/structuralsearch/testData/ssBased/ExpressionStatement.java
similarity index 100%
rename from plugins/structuralsearch/testData/ssBased/ExpressionStatement.java
rename to platform/structuralsearch/testData/ssBased/ExpressionStatement.java
diff --git a/plugins/structuralsearch/testData/ssBased/TwoStatementPattern.java b/platform/structuralsearch/testData/ssBased/TwoStatementPattern.java
similarity index 100%
rename from plugins/structuralsearch/testData/ssBased/TwoStatementPattern.java
rename to platform/structuralsearch/testData/ssBased/TwoStatementPattern.java
diff --git a/plugins/structuralsearch/testData/ssBased/simple/expected.xml b/platform/structuralsearch/testData/ssBased/simple/expected.xml
similarity index 100%
rename from plugins/structuralsearch/testData/ssBased/simple/expected.xml
rename to platform/structuralsearch/testData/ssBased/simple/expected.xml
diff --git a/plugins/structuralsearch/testData/ssBased/simple/src/x/X.java b/platform/structuralsearch/testData/ssBased/simple/src/x/X.java
similarity index 100%
rename from plugins/structuralsearch/testData/ssBased/simple/src/x/X.java
rename to platform/structuralsearch/testData/ssBased/simple/src/x/X.java
diff --git a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/OptimizedSearchScanTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/OptimizedSearchScanTest.java
similarity index 100%
rename from plugins/structuralsearch/testSource/com/intellij/structuralsearch/OptimizedSearchScanTest.java
rename to platform/structuralsearch/testSource/com/intellij/structuralsearch/OptimizedSearchScanTest.java
diff --git a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/SSBasedInspectionTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSBasedInspectionTest.java
similarity index 91%
rename from plugins/structuralsearch/testSource/com/intellij/structuralsearch/SSBasedInspectionTest.java
rename to platform/structuralsearch/testSource/com/intellij/structuralsearch/SSBasedInspectionTest.java
index 7971c10..ff2083e 100644
--- a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/SSBasedInspectionTest.java
+++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSBasedInspectionTest.java
@@ -1,11 +1,11 @@
package com.intellij.structuralsearch;
import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
-import com.intellij.openapi.application.PluginPathManager;
import com.intellij.structuralsearch.inspection.highlightTemplate.SSBasedInspection;
import com.intellij.structuralsearch.plugin.ui.Configuration;
import com.intellij.structuralsearch.plugin.ui.SearchConfiguration;
import com.intellij.testFramework.InspectionTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
import java.util.ArrayList;
import java.util.List;
@@ -42,6 +42,6 @@
}
protected String getTestDataPath() {
- return PluginPathManager.getPluginHomePath("structuralsearch") + "/testData";
+ return PlatformTestUtil.getCommunityPath() + "/platform/structuralsearch/testData/";
}
}
diff --git a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/SSRCodeInsightTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSRCodeInsightTest.java
similarity index 94%
rename from plugins/structuralsearch/testSource/com/intellij/structuralsearch/SSRCodeInsightTest.java
rename to platform/structuralsearch/testSource/com/intellij/structuralsearch/SSRCodeInsightTest.java
index 5031f82..95cd33b 100644
--- a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/SSRCodeInsightTest.java
+++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSRCodeInsightTest.java
@@ -1,10 +1,10 @@
package com.intellij.structuralsearch;
-import com.intellij.openapi.application.PluginPathManager;
import com.intellij.structuralsearch.inspection.highlightTemplate.SSBasedInspection;
import com.intellij.structuralsearch.plugin.ui.Configuration;
import com.intellij.structuralsearch.plugin.ui.SearchConfiguration;
import com.intellij.testFramework.IdeaTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.UsefulTestCase;
import com.intellij.testFramework.fixtures.*;
import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl;
@@ -70,6 +70,6 @@
}
protected String getTestDataPath() {
- return PluginPathManager.getPluginHomePath("structuralsearch") + "/testData/ssBased";
+ return PlatformTestUtil.getCommunityPath() + "/platform/structuralsearch/testData/ssBased";
}
}
diff --git a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java
similarity index 99%
rename from plugins/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java
rename to platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java
index d5848b6..de9b668 100644
--- a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java
+++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java
@@ -1,6 +1,5 @@
package com.intellij.structuralsearch;
-import com.intellij.openapi.application.PluginPathManager;
import com.intellij.psi.CommonClassNames;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.util.ThrowableRunnable;
@@ -1457,7 +1456,7 @@
@NotNull
@Override
protected String getTestDataPath() {
- return PluginPathManager.getPluginHomePath("structuralsearch") + "/testData/";
+ return PlatformTestUtil.getCommunityPath() + "/platform/structuralsearch/testData/";
}
public void testClassReplacement9() throws IOException {
diff --git a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTestCase.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTestCase.java
similarity index 100%
rename from plugins/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTestCase.java
rename to platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTestCase.java
diff --git a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java
similarity index 99%
rename from plugins/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java
rename to platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java
index a3fecba..da479a7 100644
--- a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java
+++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java
@@ -5,6 +5,7 @@
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.psi.*;
import com.intellij.structuralsearch.impl.matcher.MatcherImplUtil;
+import com.intellij.testFramework.PlatformTestUtil;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
@@ -2287,14 +2288,19 @@
"@MyBean2(\"\")\n" +
"public class TestBean {}\n" +
"@MyBean2(\"\")\n" +
- "@MyBean(\"\")\n" +
+ "@MyBean(value=\"\")\n" +
"public class TestBean2 {}\n" +
- "public class TestBean3 {}\n";
+ "public class TestBean3 {}\n" +
+ "@MyBean(\"a\")\n" +
+ "@MyBean2(\"a\")\n" +
+ "public class TestBean4";
String s2 = "@MyBean(\"\")\n" +
"@MyBean2(\"\")\n" +
"public class $a$ {}\n";
assertEquals("Simple find annotated class",2,findMatchesCount(s1,s2,false));
+ assertEquals("Match value of anonymous name value pair 1", 1, findMatchesCount(s1, "@MyBean(\"a\") class $a$ {}"));
+ assertEquals("Match value of anonymous name value pair 2", 2, findMatchesCount(s1, "@MyBean(\"\") class $a$ {}"));
String s3 = "@VisualBean(\"????????? ?????????? ? ??\")\n" +
"public class TestBean\n" +
@@ -2384,6 +2390,7 @@
String s12_4 = "@Foo('value:value2 = 'baz3:baz3 ) int 'a;)";
String s12_5 = "@Foo('value:value2 = 'baz3:baz ) int 'a;)";
String s12_6 = "@Foo('value:value2 = 'baz3 ) int 'a;)";
+ String s12_7 = "@Foo('value:value2 = ) int 'a;";
assertEquals("Find anno parameter value",1,findMatchesCount(s11,s12));
assertEquals("Find anno parameter value",2,findMatchesCount(s11,s12_2));
@@ -2391,6 +2398,7 @@
assertEquals("Find anno parameter value",3,findMatchesCount(s11,s12_4));
assertEquals("Find anno parameter value",0,findMatchesCount(s11,s12_5));
assertEquals("Find anno parameter value",4,findMatchesCount(s11,s12_6));
+ assertEquals("Find anno parameter value",4,findMatchesCount(s11,s12_7));
}
public void testBoxingAndUnboxing() {
@@ -2583,7 +2591,7 @@
@NotNull
@Override
protected String getTestDataPath() {
- return PluginPathManager.getPluginHomePath("structuralsearch") + "/testData/java/";
+ return PlatformTestUtil.getCommunityPath() + "/platform/structuralsearch/testData/java/";
}
public void testDoNotFindReturn() throws IOException {
diff --git a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTestCase.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTestCase.java
similarity index 100%
rename from plugins/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTestCase.java
rename to platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTestCase.java
diff --git a/plugins/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java
similarity index 100%
rename from plugins/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java
rename to platform/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java
diff --git a/platform/testFramework/src/com/intellij/GroupBasedTestClassFilter.java b/platform/testFramework/src/com/intellij/GroupBasedTestClassFilter.java
index b381175..3fa50de 100644
--- a/platform/testFramework/src/com/intellij/GroupBasedTestClassFilter.java
+++ b/platform/testFramework/src/com/intellij/GroupBasedTestClassFilter.java
@@ -15,7 +15,7 @@
*/
package com.intellij;
-import com.intellij.openapi.util.text.StringUtil;
+import org.jetbrains.annotations.NotNull;
import java.io.BufferedReader;
import java.io.IOException;
@@ -39,7 +39,7 @@
* {@link PatternListTestClassFilter#PatternListTestClassFilter(List) PatternListTestClassFilter};
* </li>
* <li>
- * Read class name filters (at regexp format) from the given stream - see {@link #createOn(Reader, String)};
+ * Read class name filters (at regexp format) from the given stream - see {@link #createOn(java.io.Reader, java.util.List)};
* </li>
* </ul>
*/
@@ -54,18 +54,18 @@
private final Map<String, List<Pattern>> myPatterns = new HashMap<String, List<Pattern>>();
private final List<Pattern> myAllPatterns = new ArrayList<Pattern>();
private final List<Pattern> myTestGroupPatterns;
- private boolean myAllExcludeDefinedGroup;
+ private boolean myContainsAllExcludeDefinedGroup;
- private GroupBasedTestClassFilter(Map<String, List<String>> filters, String testGroupName) {
+ private GroupBasedTestClassFilter(Map<String, List<String>> filters, List<String> testGroupNames) {
//empty group means all patterns from each defined group should be excluded
- myAllExcludeDefinedGroup = isAllExcludeDefinedGroup(testGroupName);
+ myContainsAllExcludeDefinedGroup = containsAllExcludeDefinedGroup(testGroupNames);
for (String groupName : filters.keySet()) {
List<String> filterList = filters.get(groupName);
addPatterns(groupName, filterList);
}
- myTestGroupPatterns = collectPatternsFor(testGroupName);
+ myTestGroupPatterns = collectPatternsFor(testGroupNames);
}
private void addPatterns(String groupName, List<String> filterList) {
@@ -114,11 +114,12 @@
*
*
* @param reader reader that points to the target test groups config
- * @param testGroupName
+ * @param testGroupNames
* @return newly created {@link GroupBasedTestClassFilter} object with the data contained at the given reader
* @see #matches(String)
*/
- public static TestClassesFilter createOn(Reader reader, String testGroupName) throws IOException {
+ @NotNull
+ public static TestClassesFilter createOn(@NotNull Reader reader, @NotNull List<String> testGroupNames) throws IOException {
Map<String, List<String>> groupNameToPatternsMap = new HashMap<String, List<String>>();
String currentGroupName = "";
@@ -137,7 +138,7 @@
}
}
- return new GroupBasedTestClassFilter(groupNameToPatternsMap, testGroupName);
+ return new GroupBasedTestClassFilter(groupNameToPatternsMap, testGroupNames);
}
/**
@@ -157,28 +158,26 @@
*/
@Override
public boolean matches(String className) {
- boolean result = matchesAnyPattern(myTestGroupPatterns, className);
- if (myAllExcludeDefinedGroup) {
- return !result;
+ if (matchesAnyPattern(myTestGroupPatterns, className)) {
+ return true;
}
- else {
- return result;
+ if (myContainsAllExcludeDefinedGroup && !matchesAnyPattern(myAllPatterns, className)) {
+ return true;
}
+ return false;
}
- private static boolean isAllExcludeDefinedGroup(String groupName) {
- return StringUtil.isEmpty(groupName) || ALL_EXCLUDE_DEFINED.equalsIgnoreCase(groupName.trim());
+ private static boolean containsAllExcludeDefinedGroup(List<String> groupNames) {
+ return groupNames.isEmpty() || groupNames.contains(ALL_EXCLUDE_DEFINED);
}
- private List<Pattern> collectPatternsFor(String groupName) {
- if (isAllExcludeDefinedGroup(groupName)) {
- return myAllPatterns;
+ private List<Pattern> collectPatternsFor(List<String> groupNames) {
+ List<Pattern> patterns = new ArrayList<Pattern>();
+ for (String groupName : groupNames) {
+ if (myPatterns.containsKey(groupName)) {
+ patterns.addAll(myPatterns.get(groupName));
+ }
}
- else if (myPatterns.containsKey(groupName)) {
- return myPatterns.get(groupName);
- }
- else {
- return Collections.emptyList();
- }
+ return patterns;
}
}
diff --git a/platform/testFramework/src/com/intellij/TestCaseLoader.java b/platform/testFramework/src/com/intellij/TestCaseLoader.java
index a81a2d2..5d11e48 100644
--- a/platform/testFramework/src/com/intellij/TestCaseLoader.java
+++ b/platform/testFramework/src/com/intellij/TestCaseLoader.java
@@ -66,11 +66,11 @@
if (excludedStream != null) {
TestClassesFilter filter;
try {
- String testGroupName = System.getProperty(TARGET_TEST_GROUP, "").trim();
+ List<String> testGroupNames = StringUtil.split(System.getProperty(TARGET_TEST_GROUP, "").trim(), ";");
InputStreamReader reader = new InputStreamReader(excludedStream.openStream());
try {
- filter = GroupBasedTestClassFilter.createOn(reader, testGroupName);
- System.out.println("Using test group: [" + testGroupName +"]");
+ filter = GroupBasedTestClassFilter.createOn(reader, testGroupNames);
+ System.out.println("Using test groups: " + testGroupNames);
}
finally {
reader.close();
diff --git a/platform/testFramework/src/com/intellij/openapi/application/ex/PathManagerEx.java b/platform/testFramework/src/com/intellij/openapi/application/ex/PathManagerEx.java
index 4844851..4616c4f 100644
--- a/platform/testFramework/src/com/intellij/openapi/application/ex/PathManagerEx.java
+++ b/platform/testFramework/src/com/intellij/openapi/application/ex/PathManagerEx.java
@@ -424,7 +424,7 @@
* @return project type implied by its file system location
*/
private static FileSystemLocation parseProjectLocation() {
- return new File(PathManager.getHomePath(), "community").isDirectory() ? FileSystemLocation.ULTIMATE : FileSystemLocation.COMMUNITY;
+ return new File(PathManager.getHomePath(), "community/.idea").isDirectory() ? FileSystemLocation.ULTIMATE : FileSystemLocation.COMMUNITY;
}
/**
diff --git a/platform/testFramework/src/com/intellij/testFramework/EditorTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/EditorTestUtil.java
index d42e639..870d6d5 100644
--- a/platform/testFramework/src/com/intellij/testFramework/EditorTestUtil.java
+++ b/platform/testFramework/src/com/intellij/testFramework/EditorTestUtil.java
@@ -208,7 +208,7 @@
return visibleWidth;
}
});
- applianceManager.setRepresentationHelper(new DefaultEditorTextRepresentationHelper(editor) {
+ model.setEditorTextRepresentationHelper(new DefaultEditorTextRepresentationHelper(editor) {
@Override
public int charWidth(char c, int fontType) {
return charWidthInPixels;
diff --git a/platform/testFramework/src/com/intellij/testFramework/FileEditorManagerTestCase.java b/platform/testFramework/src/com/intellij/testFramework/FileEditorManagerTestCase.java
index 77b93ac..e3f0d07 100644
--- a/platform/testFramework/src/com/intellij/testFramework/FileEditorManagerTestCase.java
+++ b/platform/testFramework/src/com/intellij/testFramework/FileEditorManagerTestCase.java
@@ -54,6 +54,7 @@
super.setUp();
myManager = new FileEditorManagerImpl(getProject(), DockManager.getInstance(getProject()), EditorHistoryManager.getInstance(getProject()));
myOldManager = ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myManager);
+ ((FileEditorProviderManagerImpl)FileEditorProviderManager.getInstance()).clearSelectedProviders();
}
@Override
diff --git a/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java b/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java
index 90c2ca1..24e4074 100644
--- a/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java
+++ b/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java
@@ -15,7 +15,7 @@
*/
package com.intellij.testFramework;
-import com.intellij.codeInsight.generation.CommentByLineCommentHandler;
+import com.intellij.codeInsight.generation.actions.CommentByLineCommentAction;
import com.intellij.ide.DataManager;
import com.intellij.injected.editor.DocumentWindow;
import com.intellij.injected.editor.EditorWindow;
@@ -501,7 +501,7 @@
}
protected static void lineComment() {
- new CommentByLineCommentHandler().invoke(getProject(), getEditor(), getFile());
+ new CommentByLineCommentAction().actionPerformedImpl(getProject(), getEditor());
}
protected static void executeAction(@NonNls @NotNull final String actionId) {
diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java
index 37fd23d..0c46f14 100644
--- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java
+++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java
@@ -762,7 +762,7 @@
public static String getCommunityPath() {
final String homePath = PathManager.getHomePath();
- if (new File(homePath, "community").exists()) {
+ if (new File(homePath, "community/.idea").isDirectory()) {
return homePath + File.separatorChar + "community";
}
return homePath;
diff --git a/platform/testFramework/src/com/intellij/testFramework/TestDataProvider.java b/platform/testFramework/src/com/intellij/testFramework/TestDataProvider.java
index b5f84d33..cc83768 100644
--- a/platform/testFramework/src/com/intellij/testFramework/TestDataProvider.java
+++ b/platform/testFramework/src/com/intellij/testFramework/TestDataProvider.java
@@ -17,11 +17,13 @@
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataProvider;
+import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.impl.EditorComponentImpl;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
+import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -51,6 +53,10 @@
else if (CommonDataKeys.EDITOR.is(dataId) || OpenFileDescriptor.NAVIGATE_IN_EDITOR.is(dataId)) {
return FileEditorManager.getInstance(myProject).getSelectedTextEditor();
}
+ else if (PlatformDataKeys.FILE_EDITOR.is(dataId)) {
+ Editor editor = FileEditorManager.getInstance(myProject).getSelectedTextEditor();
+ return editor == null ? null : TextEditorProvider.getInstance().getTextEditor(editor);
+ }
else {
Editor editor = (Editor)getData(CommonDataKeys.EDITOR.getName());
if (editor != null) {
diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java
index ce58f30..4857acd2 100644
--- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java
+++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java
@@ -1061,19 +1061,19 @@
final CaretModel caretModel = myEditor.getCaretModel();
final List<Caret> carets = caretModel.getAllCarets();
- final Collection<Integer> originalOffsets = new ArrayList<Integer>(carets.size());
+ final List<Integer> originalOffsets = new ArrayList<Integer>(carets.size());
for (final Caret caret : carets) {
originalOffsets.add(caret.getOffset());
}
caretModel.removeSecondaryCarets();
- int newOffset = 0; // To be incremented each time we complete something
+ // We do it in reverse order because completions would affect offsets
+ // i.e.: when you complete "spa" to "spam", next caret offset increased by 1
+ Collections.reverse(originalOffsets);
for (final int originalOffset : originalOffsets) {
- final int realOffsetBeforeCompletion = originalOffset + newOffset;
- caretModel.moveToOffset(realOffsetBeforeCompletion);
+ caretModel.moveToOffset(originalOffset);
completeBasic();
- newOffset += (getCaretOffset() - realOffsetBeforeCompletion);
}
}
diff --git a/platform/testRunner/src/com/intellij/execution/testframework/TestsUIUtil.java b/platform/testRunner/src/com/intellij/execution/testframework/TestsUIUtil.java
index 01a6921..836635a 100644
--- a/platform/testRunner/src/com/intellij/execution/testframework/TestsUIUtil.java
+++ b/platform/testRunner/src/com/intellij/execution/testframework/TestsUIUtil.java
@@ -21,7 +21,6 @@
import com.intellij.notification.NotificationGroup;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
-import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.project.Project;
@@ -234,7 +233,7 @@
else if (notStartedCount > 0) {
myTitle = !notStarted.isEmpty() ? ExecutionBundle.message("junit.runing.info.failed.to.start.error.message") : "Tests Ignored";
myText = passedCount + " passed, " + notStartedCount + (!notStarted.isEmpty() ? " not started" : " ignored");
- myType = MessageType.ERROR;
+ myType = notStarted.isEmpty() ? MessageType.WARNING : MessageType.ERROR;
}
else {
myTitle = ExecutionBundle.message("junit.runing.info.tests.passed.label");
diff --git a/platform/util-rt/src/com/intellij/execution/rmi/RemoteServer.java b/platform/util-rt/src/com/intellij/execution/rmi/RemoteServer.java
index 46e7b25..908f40a3 100644
--- a/platform/util-rt/src/com/intellij/execution/rmi/RemoteServer.java
+++ b/platform/util-rt/src/com/intellij/execution/rmi/RemoteServer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,11 +16,15 @@
package com.intellij.execution.rmi;
import com.intellij.execution.rmi.ssl.SslSocketFactory;
+import com.intellij.openapi.util.io.FileUtilRt;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;
+import java.io.*;
+import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
@@ -39,6 +43,8 @@
System.setProperty("apple.awt.UIElement", "true");
}
+ public static final String DOMAIN_AUTH_LIBRARY_PATH = "domain.auth.library";
+
private static Remote ourRemote;
@SuppressWarnings("UseOfSystemOutOrSystemErr")
@@ -46,6 +52,7 @@
setupRMI();
banJNDI();
setupSSL();
+ setupDomainAuth();
if (ourRemote != null) throw new AssertionError("Already started");
ourRemote = remote;
@@ -104,7 +111,7 @@
}
}
- public static void setupSSL() {
+ private static void setupSSL() {
boolean caCert = System.getProperty(SslSocketFactory.SSL_CA_CERT_PATH) != null;
boolean clientCert = System.getProperty(SslSocketFactory.SSL_CLIENT_CERT_PATH) != null;
boolean clientKey = System.getProperty(SslSocketFactory.SSL_CLIENT_KEY_PATH) != null;
@@ -113,18 +120,71 @@
}
}
+ private static void setupDomainAuth() {
+ String property = System.getProperty(DOMAIN_AUTH_LIBRARY_PATH);
+ if (property != null) {
+ try {
+ File extracted = extractLibraryFromJar(property);
+ setLibraryPath(extracted.getParentFile().getAbsolutePath());
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
@SuppressWarnings("UnusedDeclaration")
public static class Jndi implements InitialContextFactory, InvocationHandler {
+ @NotNull
public Context getInitialContext(final Hashtable<?, ?> environment) throws NamingException {
return (Context)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Context.class}, this);
}
@Nullable
- public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
+ public Object invoke(final Object proxy, @NotNull final Method method, final Object[] args) throws Throwable {
if (Object.class.equals(method.getDeclaringClass())) {
return method.invoke(this, args);
}
throw new NamingException("JNDI service is disabled");
}
}
+
+ @NotNull
+ public static File extractLibraryFromJar(@NotNull String path) throws Exception {
+ if (!path.startsWith("/")) throw new IllegalArgumentException("The path to be absolute (start with '/').");
+
+ String[] parts = path.split("/");
+ String filename = parts.length > 1 ? parts[parts.length - 1] : null;
+
+ if (filename == null) throw new IllegalArgumentException("The filename extracted from the path: '" + path + "' is null");
+
+ File auth = FileUtilRt.createTempDirectory("win_auth", null, true);
+ File temp = new File(auth, filename);
+ temp.deleteOnExit();
+ if (!temp.createNewFile() || !temp.exists()) throw new FileNotFoundException("File " + temp.getAbsolutePath() + " does not exist.");
+
+ byte[] buffer = new byte[5 * 1024];
+ int readBytes;
+
+ //noinspection IOResourceOpenedButNotSafelyClosed
+ InputStream is = RemoteServer.class.getResourceAsStream(path);
+ if (is == null) throw new FileNotFoundException("File " + path + " was not found inside JAR.");
+
+ OutputStream os = new FileOutputStream(temp);
+ try {
+ while ((readBytes = is.read(buffer)) != -1) os.write(buffer, 0, readBytes);
+ }
+ finally {
+ os.close();
+ is.close();
+ }
+ return temp;
+ }
+
+ private static void setLibraryPath(@NotNull String path) throws NoSuchFieldException, IllegalAccessException {
+ System.setProperty("java.library.path", path);
+ Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths");
+ fieldSysPath.setAccessible(true);
+ fieldSysPath.set(null, null);
+ }
}
diff --git a/platform/util-rt/src/com/intellij/execution/rmi/ssl/SslSocketFactory.java b/platform/util-rt/src/com/intellij/execution/rmi/ssl/SslSocketFactory.java
index 3ce4efe5..dfbdf74 100644
--- a/platform/util-rt/src/com/intellij/execution/rmi/ssl/SslSocketFactory.java
+++ b/platform/util-rt/src/com/intellij/execution/rmi/ssl/SslSocketFactory.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2000-2014 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.execution.rmi.ssl;
import com.intellij.openapi.util.text.StringUtilRt;
@@ -47,18 +62,22 @@
myFactory = ctx.getSocketFactory();
}
+ @NotNull
public Socket createSocket(InetAddress host, int port) throws IOException {
return myFactory.createSocket(host, port);
}
+ @NotNull
public Socket createSocket(String host, int port) throws IOException {
return myFactory.createSocket(host, port);
}
+ @NotNull
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {
return myFactory.createSocket(host, port, localHost, localPort);
}
+ @NotNull
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
return myFactory.createSocket(address, port, localAddress, localPort);
}
@@ -67,10 +86,12 @@
return myFactory.createSocket(socket, host, port, autoClose);
}
+ @NotNull
public String[] getDefaultCipherSuites() {
return myFactory.getDefaultCipherSuites();
}
+ @NotNull
public String[] getSupportedCipherSuites() {
return myFactory.getSupportedCipherSuites();
}
diff --git a/platform/util/src/com/intellij/icons/AllIcons.java b/platform/util/src/com/intellij/icons/AllIcons.java
index 9d10f41..db897fd 100644
--- a/platform/util/src/com/intellij/icons/AllIcons.java
+++ b/platform/util/src/com/intellij/icons/AllIcons.java
@@ -458,6 +458,7 @@
public static final Icon Pin_tab = IconLoader.getIcon("/general/pin_tab.png"); // 16x16
public static final Icon PluginManager = IconLoader.getIcon("/general/pluginManager.png"); // 32x32
public static final Icon Progress = IconLoader.getIcon("/general/progress.png"); // 8x10
+ public static final Icon ProjectConfigurable = IconLoader.getIcon("/general/projectConfigurable.png"); // 9x9
public static final Icon ProjectSettings = IconLoader.getIcon("/general/projectSettings.png"); // 16x16
public static final Icon ProjectStructure = IconLoader.getIcon("/general/projectStructure.png"); // 16x16
public static final Icon ProjectTab = IconLoader.getIcon("/general/projectTab.png"); // 16x16
diff --git a/platform/util/src/com/intellij/openapi/ui/VerticalFlowLayout.java b/platform/util/src/com/intellij/openapi/ui/VerticalFlowLayout.java
index 884a117..43aa9b3 100644
--- a/platform/util/src/com/intellij/openapi/ui/VerticalFlowLayout.java
+++ b/platform/util/src/com/intellij/openapi/ui/VerticalFlowLayout.java
@@ -48,6 +48,10 @@
this(alignment, 5, 5, fillHorizontally, fillVertically);
}
+ public VerticalFlowLayout(int hGap, int vGap) {
+ this(TOP, hGap, vGap, true, false);
+ }
+
public VerticalFlowLayout(@VerticalFlowAlignment int alignment, int hGap, int vGap, boolean fillHorizontally, boolean fillVertically) {
setAlignment(alignment);
this.hGap = hGap;
diff --git a/platform/util/src/com/intellij/openapi/util/BuildNumber.java b/platform/util/src/com/intellij/openapi/util/BuildNumber.java
index a888db7..22cf775 100644
--- a/platform/util/src/com/intellij/openapi/util/BuildNumber.java
+++ b/platform/util/src/com/intellij/openapi/util/BuildNumber.java
@@ -38,22 +38,28 @@
private final String myProductCode;
private final int myBaselineVersion;
private final int myBuildNumber;
+ private final String myAttemptInfo;
public BuildNumber(String productCode, int baselineVersion, int buildNumber) {
+ this(productCode, baselineVersion, buildNumber, null);
+ }
+
+ public BuildNumber(String productCode, int baselineVersion, int buildNumber, String attemptInfo) {
myProductCode = productCode;
myBaselineVersion = baselineVersion;
myBuildNumber = buildNumber;
+ myAttemptInfo = StringUtil.isEmpty(attemptInfo) ? null : attemptInfo;
}
public String asString() {
- return asString(true);
+ return asString(true, false);
}
public String asStringWithoutProductCode() {
- return asString(false);
+ return asString(false, false);
}
- private String asString(boolean includeProductCode) {
+ private String asString(boolean includeProductCode, boolean withBuildAttempt) {
StringBuilder builder = new StringBuilder();
if (includeProductCode && !StringUtil.isEmpty(myProductCode)) {
@@ -69,6 +75,10 @@
builder.append(SNAPSHOT);
}
+ if (withBuildAttempt && myAttemptInfo != null) {
+ builder.append('.').append(myAttemptInfo);
+ }
+
return builder.toString();
}
@@ -98,9 +108,11 @@
int baselineVersionSeparator = code.indexOf('.');
int baselineVersion;
int buildNumber;
+ String attemptInfo = null;
+
if (baselineVersionSeparator > 0) {
try {
- final String baselineVersionString = code.substring(0, baselineVersionSeparator);
+ String baselineVersionString = code.substring(0, baselineVersionSeparator);
if (baselineVersionString.trim().isEmpty()) return null;
baselineVersion = Integer.parseInt(baselineVersionString);
code = code.substring(baselineVersionSeparator + 1);
@@ -109,6 +121,11 @@
throw new RuntimeException("Invalid version number: " + version + "; plugin name: " + name);
}
+ int minorBuildSeparator = code.indexOf('.'); // allow <BuildNumber>.<BuildAttemptNumber> skipping BuildAttemptNumber
+ if (minorBuildSeparator > 0) {
+ attemptInfo = code.substring(minorBuildSeparator + 1);
+ code = code.substring(0, minorBuildSeparator);
+ }
buildNumber = parseBuildNumber(version, code, name);
}
else {
@@ -116,13 +133,13 @@
if (buildNumber <= 2000) {
// it's probably a baseline, not a build number
- return new BuildNumber(productCode, buildNumber, 0);
+ return new BuildNumber(productCode, buildNumber, 0, null);
}
baselineVersion = getBaseLineForHistoricBuilds(buildNumber);
}
- return new BuildNumber(productCode, baselineVersion, buildNumber);
+ return new BuildNumber(productCode, baselineVersion, buildNumber, attemptInfo);
}
private static int parseBuildNumber(String version, String code, String name) {
@@ -188,6 +205,7 @@
if (myBaselineVersion != that.myBaselineVersion) return false;
if (myBuildNumber != that.myBuildNumber) return false;
if (!myProductCode.equals(that.myProductCode)) return false;
+ if (!Comparing.equal(myAttemptInfo, that.myAttemptInfo)) return false;
return true;
}
@@ -197,6 +215,7 @@
int result = myProductCode.hashCode();
result = 31 * result + myBaselineVersion;
result = 31 * result + myBuildNumber;
+ if (myAttemptInfo != null) result = 31 * result + myAttemptInfo.hashCode();
return result;
}
@@ -256,4 +275,8 @@
public boolean isSnapshot() {
return myBuildNumber == Integer.MAX_VALUE;
}
+
+ public String asStringWithAllDetails() {
+ return asString(true, true);
+ }
}
diff --git a/platform/util/src/com/intellij/openapi/util/IconLoader.java b/platform/util/src/com/intellij/openapi/util/IconLoader.java
index 37948df..cc87d0d 100644
--- a/platform/util/src/com/intellij/openapi/util/IconLoader.java
+++ b/platform/util/src/com/intellij/openapi/util/IconLoader.java
@@ -159,10 +159,6 @@
ourIsActivated = true;
}
- public static void deactivate() {
- ourIsActivated = false;
- }
-
private static boolean isLoaderDisabled() {
return !ourIsActivated;
}
diff --git a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java
index fa67b74..0f95577 100644
--- a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java
+++ b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java
@@ -415,6 +415,17 @@
}
public static boolean delete(@NotNull File file) {
+ if (SystemInfo.isWindows) {
+ File tempFile = findSequentNonexistentFile(file.getParentFile(), file.getName(), "");
+ if (file.renameTo(tempFile)) {
+ file = tempFile;
+ }
+ }
+
+ return doDelete(file);
+ }
+
+ private static boolean doDelete(File file) {
FileAttributes attributes = FileSystemUtil.getAttributes(file);
if (attributes == null) return true;
@@ -422,7 +433,7 @@
File[] files = file.listFiles();
if (files != null) {
for (File child : files) {
- if (!delete(child)) return false;
+ if (!doDelete(child)) return false;
}
}
}
diff --git a/platform/util/src/com/intellij/openapi/util/registry/ui/RegistryCheckBox.java b/platform/util/src/com/intellij/openapi/util/registry/ui/RegistryCheckBox.java
index 657f8dd..ffc664e 100644
--- a/platform/util/src/com/intellij/openapi/util/registry/ui/RegistryCheckBox.java
+++ b/platform/util/src/com/intellij/openapi/util/registry/ui/RegistryCheckBox.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -22,8 +22,7 @@
import javax.swing.*;
public class RegistryCheckBox extends CheckBoxWithDescription {
-
- private RegistryValue myValue;
+ private final RegistryValue myValue;
public RegistryCheckBox(RegistryValue value) {
this(value, value.getDescription(), null);
@@ -31,6 +30,7 @@
public RegistryCheckBox(RegistryValue value, String text, @Nullable String longDescription) {
super(new JCheckBox(text), longDescription);
+
myValue = value;
getCheckBox().setSelected(myValue.asBoolean());
}
@@ -42,5 +42,4 @@
public void save() {
myValue.setValue(Boolean.valueOf(getCheckBox().isSelected()).toString());
}
-
}
\ No newline at end of file
diff --git a/platform/util/src/com/intellij/psi/codeStyle/MinusculeMatcher.java b/platform/util/src/com/intellij/psi/codeStyle/MinusculeMatcher.java
index 23afc18..559b6d0 100644
--- a/platform/util/src/com/intellij/psi/codeStyle/MinusculeMatcher.java
+++ b/platform/util/src/com/intellij/psi/codeStyle/MinusculeMatcher.java
@@ -15,7 +15,6 @@
*/
package com.intellij.psi.codeStyle;
-import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.containers.FList;
@@ -32,7 +31,6 @@
* @author peter
*/
public class MinusculeMatcher implements Matcher {
- private static final Logger LOG = Logger.getInstance("#com.intellij.psi.codeStyle.MinusculeMatcher");
/**
* Lowercase humps don't work for parts separated by these characters
* Need either an explicit uppercase letter or the same separator character in prefix
@@ -220,7 +218,7 @@
}
@Nullable
- private FList<TextRange> calcMatchingFragments(@NotNull String name) {
+ public FList<TextRange> matchingFragments(@NotNull String name) {
MatchingState state = myMatchingState.get();
state.initializeState(name);
try {
@@ -231,22 +229,6 @@
}
}
- @Nullable
- public FList<TextRange> matchingFragments(@NotNull String name) {
- long start = System.currentTimeMillis();
- FList<TextRange> result = calcMatchingFragments(name);
- if (System.currentTimeMillis() - start > 1000 &&
- // if there's little free memory, it might have been the gc affecting the performance
- Runtime.getRuntime().freeMemory() > Runtime.getRuntime().totalMemory() * 3 / 10) {
- start = System.currentTimeMillis();
- calcMatchingFragments(name);
- if (System.currentTimeMillis() - start > 1000) {
- LOG.error("Too long name matching: name=" + name + "; prefix=" + new String(myPattern));
- }
- }
- return result;
- }
-
/**
* After a wildcard (* or space), search for the first non-wildcard pattern character in the name starting from nameIndex
* and try to {@link #matchFragment(String, int, int, com.intellij.psi.codeStyle.MinusculeMatcher.MatchingState)} for it.
diff --git a/platform/util/src/com/intellij/ui/Graphics2DDelegate.java b/platform/util/src/com/intellij/ui/Graphics2DDelegate.java
index 0bc765e..1d13b77 100644
--- a/platform/util/src/com/intellij/ui/Graphics2DDelegate.java
+++ b/platform/util/src/com/intellij/ui/Graphics2DDelegate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,6 +16,7 @@
package com.intellij.ui;
import com.intellij.util.ui.UIUtil;
+import org.jetbrains.annotations.NotNull;
import java.awt.*;
import java.awt.font.FontRenderContext;
@@ -61,6 +62,7 @@
myDelegate.copyArea(x, y, width, height, dx, dy);
}
+ @NotNull
@Override
public Graphics create() {
return new Graphics2DDelegate((Graphics2D)myDelegate.create());
diff --git a/platform/util/src/com/intellij/util/containers/ContainerUtil.java b/platform/util/src/com/intellij/util/containers/ContainerUtil.java
index 4a9c7bd..6052df2 100644
--- a/platform/util/src/com/intellij/util/containers/ContainerUtil.java
+++ b/platform/util/src/com/intellij/util/containers/ContainerUtil.java
@@ -1417,6 +1417,13 @@
}
}
+ @NotNull
+ public static <T> List<T> sorted(@NotNull Collection<T> list, @NotNull Comparator<T> comparator) {
+ List<T> sorted = newArrayList(list);
+ sort(sorted, comparator);
+ return sorted;
+ }
+
public static <T> void sort(@NotNull T[] a, @NotNull Comparator<T> comparator) {
int size = a.length;
@@ -2065,6 +2072,17 @@
return collection == null || collection.isEmpty();
}
+ @NotNull
+ public static <T, C extends Collection<T>> C notNullize(@Nullable C collection) {
+ //noinspection unchecked
+ return collection == null ? (C)ContainerUtilRt.emptyList() : collection;
+ }
+
+ @Nullable
+ public static <T, C extends Collection<T>> C nullize(@Nullable C collection) {
+ return isEmpty(collection) ? null : collection;
+ }
+
private interface ConcurrentMapFactory {
@NotNull <T, V> ConcurrentMap<T, V> createMap();
@NotNull <T, V> ConcurrentMap<T, V> createMap(int initialCapacity);
diff --git a/platform/util/src/com/intellij/util/containers/OrderedSet.java b/platform/util/src/com/intellij/util/containers/OrderedSet.java
index 9900eb9..0ff04ac 100644
--- a/platform/util/src/com/intellij/util/containers/OrderedSet.java
+++ b/platform/util/src/com/intellij/util/containers/OrderedSet.java
@@ -104,19 +104,19 @@
}
@Override
- public boolean addAll(final int index, final Collection<? extends T> c) {
+ public boolean addAll(final int index, @NotNull final Collection<? extends T> c) {
throw new UnsupportedOperationException();
}
@Override
- public T set(final int index, final T element) {
+ public T set(final int index, @NotNull final T element) {
final T removed = remove(index);
add(index, element);
return removed;
}
@Override
- public void add(final int index, final T element) {
+ public void add(final int index, @NotNull final T element) {
if (myHashSet.add(element)){
super.add(index, element);
}
diff --git a/platform/util/src/com/intellij/util/io/AbstractStringEnumerator.java b/platform/util/src/com/intellij/util/io/AbstractStringEnumerator.java
index 589fa0a..a8145d53 100644
--- a/platform/util/src/com/intellij/util/io/AbstractStringEnumerator.java
+++ b/platform/util/src/com/intellij/util/io/AbstractStringEnumerator.java
@@ -16,19 +16,13 @@
package com.intellij.util.io;
import com.intellij.openapi.Forceable;
-import org.jetbrains.annotations.Nullable;
import java.io.Closeable;
-import java.io.IOException;
/**
* Author: dmitrylomov
*/
-public interface AbstractStringEnumerator extends Closeable, Forceable {
- int enumerate(@Nullable String value) throws IOException;
-
- @Nullable
- String valueOf(int idx) throws IOException;
+public interface AbstractStringEnumerator extends Closeable, Forceable, DataEnumerator<String> {
void markCorrupted();
}
diff --git a/platform/util/src/com/intellij/util/io/AppendableStorageBackedByResizableMappedFile.java b/platform/util/src/com/intellij/util/io/AppendableStorageBackedByResizableMappedFile.java
index 6f936d7..c4381da 100644
--- a/platform/util/src/com/intellij/util/io/AppendableStorageBackedByResizableMappedFile.java
+++ b/platform/util/src/com/intellij/util/io/AppendableStorageBackedByResizableMappedFile.java
@@ -158,7 +158,7 @@
int base = addr;
int address = storage.getOffsetInPage(addr);
boolean same = true;
- ByteBuffer buffer = storage.getByteBuffer(addr, false);
+ ByteBuffer buffer = storage.getByteBuffer(addr, false).getCachedBuffer();
final int myPageSize = storage.myPageSize;
@Override
@@ -166,7 +166,7 @@
if (same) {
if (myPageSize == address && address < myFileLength) { // reached end of current byte buffer
base += address;
- buffer = storage.getByteBuffer(base, false);
+ buffer = storage.getByteBuffer(base, false).getCachedBuffer();
address = 0;
}
same = address < myFileLength && buffer.get(address++) == (byte)b;
diff --git a/platform/util/src/com/intellij/util/io/CachingEnumerator.java b/platform/util/src/com/intellij/util/io/CachingEnumerator.java
new file mode 100644
index 0000000..94ce68c
--- /dev/null
+++ b/platform/util/src/com/intellij/util/io/CachingEnumerator.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2000-2014 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.io;
+
+import com.intellij.util.containers.SLRUMap;
+import jsr166e.extra.SequenceLock;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.IOException;
+import java.util.concurrent.locks.Lock;
+
+/**
+ * @author peter
+ */
+public class CachingEnumerator<Data> implements DataEnumerator<Data> {
+ private static final int STRIPE_POWER = 4;
+ private static final int STRIPE_COUNT = 1 << STRIPE_POWER;
+ private static final int STRIPE_MASK = STRIPE_COUNT - 1;
+ @SuppressWarnings("unchecked") private final SLRUMap<Integer, Integer>[] myHashcodeToIdCache = new SLRUMap[STRIPE_COUNT];
+ @SuppressWarnings("unchecked") private final SLRUMap<Integer, Data>[] myIdToStringCache = new SLRUMap[STRIPE_COUNT];
+ private final Lock[] myStripeLocks = new Lock[STRIPE_COUNT];
+ private final DataEnumerator<Data> myBase;
+ private final KeyDescriptor<Data> myDataDescriptor;
+
+ public CachingEnumerator(DataEnumerator<Data> base, KeyDescriptor<Data> dataDescriptor) {
+ myBase = base;
+ myDataDescriptor = dataDescriptor;
+ int protectedSize = 8192;
+ int probationalSize = 8192;
+
+ for(int i = 0; i < STRIPE_COUNT; ++i) {
+ myHashcodeToIdCache[i] = new SLRUMap<Integer, Integer>(protectedSize / STRIPE_COUNT, probationalSize / STRIPE_COUNT);
+ myIdToStringCache[i] = new SLRUMap<Integer, Data>(protectedSize / STRIPE_COUNT, probationalSize / STRIPE_COUNT);
+ myStripeLocks[i] = new SequenceLock();
+ }
+
+ }
+
+ public int enumerate(@Nullable Data value) throws IOException {
+ int valueHashCode =-1;
+ int stripe = -1;
+
+ if (myHashcodeToIdCache != null && value != null) {
+ valueHashCode = myDataDescriptor.getHashCode(value);
+ stripe = Math.abs(valueHashCode) & STRIPE_MASK;
+
+ Integer cachedId;
+
+ myStripeLocks[stripe].lock();
+ try {
+ cachedId = myHashcodeToIdCache[stripe].get(valueHashCode);
+ }
+ finally {
+ myStripeLocks[stripe].unlock();
+ }
+
+ if (cachedId != null) {
+ int stripe2 = idStripe(cachedId.intValue());
+ myStripeLocks[stripe2].lock();
+ try {
+ Data s = myIdToStringCache[stripe2].get(cachedId);
+ if (s != null && myDataDescriptor.isEqual(value, s)) return cachedId.intValue();
+ }
+ finally {
+ myStripeLocks[stripe2].unlock();
+ }
+ }
+ }
+
+ int enumerate = myBase.enumerate(value);
+
+ if (stripe != -1) {
+ Integer enumeratedInteger;
+
+ myStripeLocks[stripe].lock();
+ try {
+ enumeratedInteger = enumerate;
+ myHashcodeToIdCache[stripe].put(valueHashCode, enumeratedInteger);
+ } finally {
+ myStripeLocks[stripe].unlock();
+ }
+
+ int stripe2 = idStripe(enumerate);
+ myStripeLocks[stripe2].lock();
+ try {
+ myIdToStringCache[stripe2].put(enumeratedInteger, value);
+ } finally {
+ myStripeLocks[stripe2].unlock();
+ }
+ }
+
+ return enumerate;
+ }
+
+ private static int idStripe(int h) {
+ h ^= (h >>> 20) ^ (h >>> 12);
+ return Math.abs(h ^ (h >>> 7) ^ (h >>> 4)) & STRIPE_MASK;
+ }
+
+ @Nullable
+ public Data valueOf(int idx) throws IOException {
+ int stripe = -1;
+ if (myIdToStringCache != null) {
+ stripe = idStripe(idx);
+ myStripeLocks[stripe].lock();
+ try {
+ Data s = myIdToStringCache[stripe].get(idx);
+ if (s != null) return s;
+ }
+ finally {
+ myStripeLocks[stripe].unlock();
+ }
+ }
+ Data s = myBase.valueOf(idx);
+
+ if (stripe != -1 && s != null) {
+ myStripeLocks[stripe].lock();
+ try {
+ myIdToStringCache[stripe].put(idx, s);
+ }
+ finally {
+ myStripeLocks[stripe].unlock();
+ }
+ }
+ return s;
+ }
+
+ public void close() throws IOException {
+ for(int i = 0; i < myIdToStringCache.length; ++i) {
+ myStripeLocks[i].lock();
+ myIdToStringCache[i].clear();
+ myHashcodeToIdCache[i].clear();
+ myStripeLocks[i].unlock();
+ }
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java b/platform/util/src/com/intellij/util/io/DataEnumerator.java
similarity index 68%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
copy to platform/util/src/com/intellij/util/io/DataEnumerator.java
index 2a24920..3a7a113 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
+++ b/platform/util/src/com/intellij/util/io/DataEnumerator.java
@@ -13,15 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package com.intellij.util.io;
+
+import org.jetbrains.annotations.Nullable;
+
+import java.io.IOException;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author peter
*/
-public class RemoteCancelledException extends com.intellij.remote.RemoteCancelledException {
- public RemoteCancelledException(String s) {
- super(s);
- }
+public interface DataEnumerator<Data> {
+ int enumerate(@Nullable Data value) throws IOException;
+
+ @Nullable
+ Data valueOf(int idx) throws IOException;
}
diff --git a/platform/util/src/com/intellij/util/io/EnumeratorStringDescriptor.java b/platform/util/src/com/intellij/util/io/EnumeratorStringDescriptor.java
index dce1d49..9227015 100644
--- a/platform/util/src/com/intellij/util/io/EnumeratorStringDescriptor.java
+++ b/platform/util/src/com/intellij/util/io/EnumeratorStringDescriptor.java
@@ -26,6 +26,7 @@
* Date: Dec 18, 2007
*/
public class EnumeratorStringDescriptor implements KeyDescriptor<String> {
+ public static final EnumeratorStringDescriptor INSTANCE = new EnumeratorStringDescriptor();
@Override
public int getHashCode(final String value) {
return value.hashCode();
diff --git a/platform/util/src/com/intellij/util/io/IntToIntBtree.java b/platform/util/src/com/intellij/util/io/IntToIntBtree.java
index 8cddbce..b17fc6c 100644
--- a/platform/util/src/com/intellij/util/io/IntToIntBtree.java
+++ b/platform/util/src/com/intellij/util/io/IntToIntBtree.java
@@ -203,7 +203,7 @@
boolean canUseLastKey = myCanUseLastKey;
if (canUseLastKey) {
myCanUseLastKey = false;
- if (key == myLastGetKey && !myAccessNodeView.myHasFullPagesAlongPath) {
+ if (key == myLastGetKey && !myAccessNodeView.myHasFullPagesAlongPath && myAccessNodeView.isValid()) {
++myOptimizedInserts;
++count;
myAccessNodeView.insert(key, value);
@@ -284,6 +284,7 @@
private short myChildrenCount;
protected int myAddressInBuffer;
protected ByteBuffer myBuffer;
+ protected ByteBufferWrapper myBufferWrapper;
protected boolean myHasFullPagesAlongPath;
protected boolean myIsDirty;
@@ -302,7 +303,8 @@
protected void syncWithStore() {
PagedFileStorage pagedFileStorage = btree.storage.getPagedFileStorage();
myAddressInBuffer = pagedFileStorage.getOffsetInPage(address);
- myBuffer = pagedFileStorage.getByteBuffer(address, false);
+ myBufferWrapper = pagedFileStorage.getByteBuffer(address, false);
+ myBuffer = myBufferWrapper.getCachedBuffer();
myIsDirty = false; // we will mark dirty on child count change, attrs change or existing key put
doInitFlags(myBuffer.getInt(myAddressInBuffer));
}
@@ -541,6 +543,10 @@
setAddress(address);
}
+ public boolean isValid() {
+ return myBufferWrapper.getCachedBuffer() == myBuffer;
+ }
+
private static class HashLeafData {
final BtreeIndexNodeView nodeView;
final int[] keys;
diff --git a/platform/util/src/com/intellij/util/io/PagedFileStorage.java b/platform/util/src/com/intellij/util/io/PagedFileStorage.java
index 1d5e9d7..69315f1 100644
--- a/platform/util/src/com/intellij/util/io/PagedFileStorage.java
+++ b/platform/util/src/com/intellij/util/io/PagedFileStorage.java
@@ -151,7 +151,7 @@
if (myValuesAreBufferAligned) {
long page = addr / myPageSize;
int page_offset = (int) (addr % myPageSize);
- return getBuffer(page, false).getInt(page_offset);
+ return getReadOnlyBuffer(page).getInt(page_offset);
} else {
get(addr, myTypedIOBuffer, 0, 4);
return Bits.getInt(myTypedIOBuffer, 0);
@@ -173,15 +173,15 @@
return (int)(addr % myPageSize);
}
- ByteBuffer getByteBuffer(long address, boolean modify) {
- return getBuffer(address / myPageSize, modify);
+ ByteBufferWrapper getByteBuffer(long address, boolean modify) {
+ return getBufferWrapper(address / myPageSize, modify);
}
public final short getShort(long addr) {
if (myValuesAreBufferAligned) {
long page = addr / myPageSize;
int page_offset = (int)(addr % myPageSize);
- return getBuffer(page, false).getShort(page_offset);
+ return getReadOnlyBuffer(page).getShort(page_offset);
} else {
get(addr, myTypedIOBuffer, 0, 2);
return Bits.getShort(myTypedIOBuffer, 0);
@@ -212,7 +212,7 @@
if (myValuesAreBufferAligned) {
long page = addr / myPageSize;
int page_offset = (int)(addr % myPageSize);
- return getBuffer(page, false).getLong(page_offset);
+ return getReadOnlyBuffer(page).getLong(page_offset);
} else {
get(addr, myTypedIOBuffer, 0, 8);
return Bits.getLong(myTypedIOBuffer, 0);
@@ -223,7 +223,7 @@
long page = index / myPageSize;
int offset = (int)(index % myPageSize);
- return getBuffer(page, false).get(offset);
+ return getReadOnlyBuffer(page).get(offset);
}
public void put(long index, byte value) {
@@ -243,7 +243,7 @@
int page_offset = (int) (i % myPageSize);
int page_len = Math.min(l, myPageSize - page_offset);
- final ByteBuffer buffer = getBuffer(page, false);
+ final ByteBuffer buffer = getReadOnlyBuffer(page);
try {
buffer.position(page_offset);
}
@@ -369,28 +369,32 @@
}
private ByteBuffer getBuffer(long page) {
- return getBuffer(page, true);
+ return getBufferWrapper(page, true).getCachedBuffer();
}
- private ByteBuffer getBuffer(long page, boolean modify) {
+ private ByteBuffer getReadOnlyBuffer(long page) {
+ return getBufferWrapper(page, false).getCachedBuffer();
+ }
+
+ private ByteBufferWrapper getBufferWrapper(long page, boolean modify) {
synchronized (myLastAccessedBufferCacheLock) {
if (myLastPage == page) {
ByteBuffer buf = myLastBuffer.getCachedBuffer();
if (buf != null && myLastChangeCount == myStorageLockContext.myStorageLock.myMappingChangeCount) {
if (modify) markDirty(myLastBuffer);
- return buf;
+ return myLastBuffer;
}
} else if (myLastPage2 == page) {
ByteBuffer buf = myLastBuffer2.getCachedBuffer();
if (buf != null && myLastChangeCount2 == myStorageLockContext.myStorageLock.myMappingChangeCount) {
if (modify) markDirty(myLastBuffer2);
- return buf;
+ return myLastBuffer2;
}
} else if (myLastPage3 == page) {
ByteBuffer buf = myLastBuffer3.getCachedBuffer();
if (buf != null && myLastChangeCount3 == myStorageLockContext.myStorageLock.myMappingChangeCount) {
if (modify) markDirty(myLastBuffer3);
- return buf;
+ return myLastBuffer3;
}
}
}
@@ -427,7 +431,7 @@
myLastChangeCount = myStorageLockContext.myStorageLock.myMappingChangeCount;
}
- return buf;
+ return byteBufferWrapper;
}
catch (IOException e) {
throw new MappingFailedException("Cannot map buffer", e);
diff --git a/platform/util/src/com/intellij/util/io/PersistentHashMap.java b/platform/util/src/com/intellij/util/io/PersistentHashMap.java
index de43fbd..dde187d 100644
--- a/platform/util/src/com/intellij/util/io/PersistentHashMap.java
+++ b/platform/util/src/com/intellij/util/io/PersistentHashMap.java
@@ -80,7 +80,7 @@
private final boolean myCanReEnumerate;
private int myLargeIndexWatermarkId; // starting with this id we store offset in adjacent file in long format
private boolean myIntAddressForNewRecord;
- private static final boolean doHardConsistencyChecks = true;
+ private static final boolean doHardConsistencyChecks = false;
private volatile boolean myBusyReading;
private static class AppendStream extends DataOutputStream {
diff --git a/platform/util/src/com/intellij/util/io/PersistentStringEnumerator.java b/platform/util/src/com/intellij/util/io/PersistentStringEnumerator.java
index 1975577..9967987 100644
--- a/platform/util/src/com/intellij/util/io/PersistentStringEnumerator.java
+++ b/platform/util/src/com/intellij/util/io/PersistentStringEnumerator.java
@@ -15,22 +15,14 @@
*/
package com.intellij.util.io;
-import com.intellij.util.containers.SLRUMap;
-import jsr166e.extra.SequenceLock;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
-import java.util.concurrent.locks.Lock;
public class PersistentStringEnumerator extends PersistentEnumeratorDelegate<String> implements AbstractStringEnumerator {
- private static final int STRIPE_POWER = 4;
- private static final int STRIPE_COUNT = 1 << STRIPE_POWER;
- private static final int STRIPE_MASK = STRIPE_COUNT - 1;
- @Nullable private final SLRUMap<Integer, Integer>[] myHashcodeToIdCache;
- @Nullable private final SLRUMap<Integer, String>[] myIdToStringCache;
- @Nullable private final Lock[] myStripeLocks;
+ @Nullable private final CachingEnumerator<String> myCache;
public PersistentStringEnumerator(@NotNull final File file) throws IOException {
this(file, null);
@@ -58,129 +50,36 @@
final int initialSize,
boolean cacheLastMappings,
@Nullable PagedFileStorage.StorageLockContext lockContext) throws IOException {
- super(file, new EnumeratorStringDescriptor(), initialSize, lockContext);
- if (cacheLastMappings) {
- myIdToStringCache = new SLRUMap[STRIPE_COUNT];
- myHashcodeToIdCache = new SLRUMap[STRIPE_COUNT];
- myStripeLocks = new Lock[STRIPE_COUNT];
- int protectedSize = 8192;
- int probationalSize = 8192;
-
- for(int i = 0; i < STRIPE_COUNT; ++i) {
- myHashcodeToIdCache[i] = new SLRUMap<Integer, Integer>(protectedSize / STRIPE_COUNT, probationalSize / STRIPE_COUNT);
- myIdToStringCache[i] = new SLRUMap<Integer, String>(protectedSize / STRIPE_COUNT, probationalSize / STRIPE_COUNT);
- myStripeLocks[i] = new SequenceLock();
+ super(file, EnumeratorStringDescriptor.INSTANCE, initialSize, lockContext);
+ myCache = cacheLastMappings ? new CachingEnumerator<String>(new DataEnumerator<String>() {
+ @Override
+ public int enumerate(@Nullable String value) throws IOException {
+ return PersistentStringEnumerator.super.enumerate(value);
}
- } else {
- myIdToStringCache = null;
- myHashcodeToIdCache = null;
- myStripeLocks = null;
- }
+
+ @Nullable
+ @Override
+ public String valueOf(int idx) throws IOException {
+ return PersistentStringEnumerator.super.valueOf(idx);
+ }
+ }, EnumeratorStringDescriptor.INSTANCE) : null;
}
@Override
public int enumerate(@Nullable String value) throws IOException {
- int valueHashCode =-1;
- int stripe = -1;
-
- if (myHashcodeToIdCache != null && value != null) {
- valueHashCode = value.hashCode();
- stripe = Math.abs(valueHashCode) & STRIPE_MASK;
-
- Integer cachedId;
-
- myStripeLocks[stripe].lock();
- try {
- cachedId = myHashcodeToIdCache[stripe].get(valueHashCode);
- }
- finally {
- myStripeLocks[stripe].unlock();
- }
-
- if (cachedId != null) {
- int stripe2 = idStripe(cachedId.intValue());
- myStripeLocks[stripe2].lock();
- try {
- String s = myIdToStringCache[stripe2].get(cachedId);
- if (s != null && value.equals(s)) return cachedId.intValue();
- }
- finally {
- myStripeLocks[stripe2].unlock();
- }
- }
- }
-
- int enumerate = super.enumerate(value);
-
- if (stripe != -1) {
- Integer enumeratedInteger;
-
- myStripeLocks[stripe].lock();
- try {
- enumeratedInteger = enumerate;
- myHashcodeToIdCache[stripe].put(valueHashCode, enumeratedInteger);
- } finally {
- myStripeLocks[stripe].unlock();
- }
-
- int stripe2 = idStripe(enumerate);
- myStripeLocks[stripe2].lock();
- try {
- myIdToStringCache[stripe2].put(enumeratedInteger, value);
- } finally {
- myStripeLocks[stripe2].unlock();
- }
- }
-
- return enumerate;
- }
-
- private int idStripe(int h) {
- h ^= (h >>> 20) ^ (h >>> 12);
- return Math.abs(h ^ (h >>> 7) ^ (h >>> 4)) & STRIPE_MASK;
+ return myCache != null ? myCache.enumerate(value) : super.enumerate(value);
}
@Nullable
@Override
public String valueOf(int idx) throws IOException {
- int stripe = -1;
- if (myIdToStringCache != null) {
- stripe = idStripe(idx);
- myStripeLocks[stripe].lock();
- try {
- String s = myIdToStringCache[stripe].get(idx);
- if (s != null) return s;
- }
- finally {
- myStripeLocks[stripe].unlock();
- }
- }
- String s = super.valueOf(idx);
-
- if (stripe != -1 && s != null) {
- myStripeLocks[stripe].lock();
- try {
- myIdToStringCache[stripe].put(idx, s);
- }
- finally {
- myStripeLocks[stripe].unlock();
- }
- }
- return s;
+ return myCache != null ? myCache.valueOf(idx) : super.valueOf(idx);
}
@Override
public void close() throws IOException {
super.close();
-
- if (myIdToStringCache != null) {
- for(int i = 0; i < myIdToStringCache.length; ++i) {
- myStripeLocks[i].lock();
- myIdToStringCache[i].clear();
- myHashcodeToIdCache[i].clear();
- myStripeLocks[i].unlock();
- }
- }
+ if (myCache != null) myCache.close();
}
@Override
diff --git a/platform/util/src/com/intellij/util/ui/ColumnInfo.java b/platform/util/src/com/intellij/util/ui/ColumnInfo.java
index 8289633..2ad54e6 100644
--- a/platform/util/src/com/intellij/util/ui/ColumnInfo.java
+++ b/platform/util/src/com/intellij/util/ui/ColumnInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -23,18 +23,6 @@
import java.util.Comparator;
public abstract class ColumnInfo <Item, Aspect> {
-
- public static class StringColumn extends ColumnInfo<String, String> {
- public StringColumn(final String name) {
- super(name);
- }
-
- @Override
- public String valueOf(final String item) {
- return item;
- }
- }
-
private String myName;
public static final ColumnInfo[] EMPTY_ARRAY = new ColumnInfo[0];
diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java
index cc6d5a3..7ed8021 100644
--- a/platform/util/src/com/intellij/util/ui/UIUtil.java
+++ b/platform/util/src/com/intellij/util/ui/UIUtil.java
@@ -48,7 +48,9 @@
import javax.swing.plaf.basic.BasicRadioButtonUI;
import javax.swing.plaf.basic.ComboPopup;
import javax.swing.text.DefaultEditorKit;
+import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.JTextComponent;
+import javax.swing.text.NumberFormatter;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.StyleSheet;
import javax.swing.undo.UndoManager;
@@ -70,6 +72,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
+import java.text.NumberFormat;
import java.util.*;
import java.util.List;
import java.util.concurrent.BlockingQueue;
@@ -2982,4 +2985,23 @@
}
return new EmptyBorder(0, leftGap, 0, 0);
}
+
+ public static Color getSidePanelColor() {
+ return new JBColor(new Color(0xD2D6DD), new Color(60, 68, 71));
+ }
+
+ /**
+ * It is your responsibility to set correct horizontal align (left in case of UI Designer)
+ */
+ public static void configureNumericFormattedTextField(@NotNull JFormattedTextField textField) {
+ NumberFormat format = NumberFormat.getIntegerInstance();
+ format.setParseIntegerOnly(true);
+ format.setGroupingUsed(false);
+ NumberFormatter numberFormatter = new NumberFormatter(format);
+ numberFormatter.setMinimum(0);
+ textField.setFormatterFactory(new DefaultFormatterFactory(numberFormatter));
+ textField.setHorizontalAlignment(SwingConstants.TRAILING);
+
+ textField.setColumns(4);
+ }
}
diff --git a/platform/util/testSrc/com/intellij/util/containers/ConcurrentMapsTest.java b/platform/util/testSrc/com/intellij/util/containers/ConcurrentMapsTest.java
index 2972091..c85b8d3 100644
--- a/platform/util/testSrc/com/intellij/util/containers/ConcurrentMapsTest.java
+++ b/platform/util/testSrc/com/intellij/util/containers/ConcurrentMapsTest.java
@@ -98,7 +98,7 @@
List<Object> list = ContainerUtil.newArrayList();
while (reference.get() != null) {
int chunk = (int)Math.min(Runtime.getRuntime().freeMemory() / 2, Integer.MAX_VALUE);
- list.add(new SoftReference<byte[]>(new byte[chunk / 2]));
+ list.add(new SoftReference<byte[]>(new byte[chunk]));
}
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java
index 3008138..2912898 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java
@@ -169,6 +169,7 @@
if (vcs == null) return;
final AnnotationProvider annotationProvider = vcs.getCachingAnnotationProvider();
+ assert annotationProvider != null;
final Ref<FileAnnotation> fileAnnotationRef = new Ref<FileAnnotation>();
final Ref<VcsException> exceptionRef = new Ref<VcsException>();
@@ -190,7 +191,7 @@
exceptionRef.set(e);
}
catch (Throwable t) {
- handler.completed(file.getPath());
+ exceptionRef.set(new VcsException(t));
}
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/MapIgnoredFilesHolder.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/MapIgnoredFilesHolder.java
index 297e464..5ba7ce8 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/MapIgnoredFilesHolder.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/MapIgnoredFilesHolder.java
@@ -20,7 +20,7 @@
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.ContainerUtil;
-import com.intellij.util.containers.hash.HashSet;
+import gnu.trove.THashSet;
import java.util.Collection;
import java.util.Set;
@@ -40,8 +40,8 @@
public MapIgnoredFilesHolder(Project project) {
super(project);
myProject = project;
- mySet = new HashSet<VirtualFile>();
- myVcsIgnoredSet = new HashSet<VirtualFile>(); //collect ignored files from VcsChangeProvider -> processIgnored
+ mySet = new THashSet<VirtualFile>();
+ myVcsIgnoredSet = new THashSet<VirtualFile>(); //collect ignored files from VcsChangeProvider -> processIgnored
}
@Override
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsCache.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsCache.java
index 0ff134e..7870b7d 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsCache.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsCache.java
@@ -16,13 +16,11 @@
package com.intellij.openapi.vcs.changes;
import com.intellij.lifecycle.PeriodicalTasksCloser;
-import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Couple;
-import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Getter;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.vcs.*;
@@ -57,12 +55,12 @@
private final Object myLock;
private final Map<String, RemoteDifferenceStrategy> myKinds;
private final ControlledCycle myControlledCycle;
- private final MessageBusConnection myConnection;
public static RemoteRevisionsCache getInstance(final Project project) {
return PeriodicalTasksCloser.getInstance().safeGetService(project, RemoteRevisionsCache.class);
}
+ @SuppressWarnings("UnusedDeclaration") // initialized as a Service
private RemoteRevisionsCache(final Project project) {
myProject = project;
myLock = new Object();
@@ -73,15 +71,11 @@
myChangeDecorator = new RemoteStatusChangeNodeDecorator(this);
myVcsManager = ProjectLevelVcsManager.getInstance(project);
- myConnection = myProject.getMessageBus().connect();
- myConnection.subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, this);
- myConnection.subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED_IN_PLUGIN, this);
+ MessageBusConnection connection = myProject.getMessageBus().connect();
+ connection.subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, this);
+ connection.subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED_IN_PLUGIN, this);
myKinds = new HashMap<String, RemoteDifferenceStrategy>();
- Disposer.register(project, new Disposable() {
- public void dispose() {
- myConnection.disconnect();
- }
- });
+
final VcsConfiguration vcsConfiguration = VcsConfiguration.getInstance(myProject);
myControlledCycle = new ControlledCycle(project, new Getter<Boolean>() {
@Override
@@ -92,7 +86,14 @@
boolean somethingChanged = myRemoteRevisionsNumbersCache.updateStep();
somethingChanged |= myRemoteRevisionsStateCache.updateStep();
if (somethingChanged) {
- myProject.getMessageBus().syncPublisher(REMOTE_VERSION_CHANGED).run();
+ ApplicationManager.getApplication().runReadAction(new Runnable() {
+ @Override
+ public void run() {
+ if (!myProject.isDisposed()) {
+ myProject.getMessageBus().syncPublisher(REMOTE_VERSION_CHANGED).run();
+ }
+ }
+ });
}
}
return shouldBeDone;
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdatingChangeListBuilder.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdatingChangeListBuilder.java
index 93919fc..fdc0796 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdatingChangeListBuilder.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdatingChangeListBuilder.java
@@ -66,14 +66,14 @@
}
public void processChange(final Change change, VcsKey vcsKey) {
- processChangeInList( change, (ChangeList) null, vcsKey);
+ processChangeInList(change, (ChangeList)null, vcsKey);
}
public void processChangeInList(final Change change, @Nullable final ChangeList changeList, final VcsKey vcsKey) {
checkIfDisposed();
LOG.debug("[processChangeInList-1] entering, cl name: " + ((changeList == null) ? null: changeList.getName()) +
- " change: " + ChangesUtil.getFilePath(change).getPath());
+ " change: " + ChangesUtil.getFilePath(change).getPath());
final String fileName = ChangesUtil.getFilePath(change).getName();
if (FileTypeManager.getInstance().isFileIgnored(fileName)) {
LOG.debug("[processChangeInList-1] file type ignored");
@@ -86,11 +86,13 @@
if (changeList != null) {
LOG.debug("[processChangeInList-1] to add change to cl");
myChangeListWorker.addChangeToList(changeList.getName(), change, vcsKey);
- } else {
+ }
+ else {
LOG.debug("[processChangeInList-1] to add to corresponding list");
myChangeListWorker.addChangeToCorrespondingList(change, vcsKey);
}
- } else {
+ }
+ else {
LOG.debug("[processChangeInList-1] not under scope");
}
}
@@ -203,7 +205,7 @@
if (file == null) return;
checkIfDisposed();
if (myScope.belongsTo(new FilePathImpl(file))) {
- ((LogicallyLockedHolder) myComposite.get(FileHolder.HolderType.LOGICALLY_LOCKED)).add(file, logicalLock);
+ ((LogicallyLockedHolder)myComposite.get(FileHolder.HolderType.LOGICALLY_LOCKED)).add(file, logicalLock);
}
}
@@ -220,7 +222,7 @@
if (file == null) return;
checkIfDisposed();
if (myScope.belongsTo(new FilePathImpl(file))) {
- ((SwitchedFileHolder) myComposite.get(FileHolder.HolderType.ROOT_SWITCH)).addFile(file, branch, false);
+ ((SwitchedFileHolder)myComposite.get(FileHolder.HolderType.ROOT_SWITCH)).addFile(file, branch, false);
}
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsGuess.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsGuess.java
index f5abcf0..00ca9f2 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsGuess.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsGuess.java
@@ -22,6 +22,7 @@
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.FilePath;
+import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
@@ -34,7 +35,7 @@
VcsGuess(final Project project) {
myProject = project;
- myVcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManagerImpl.getInstance(myProject);
+ myVcsManager = (ProjectLevelVcsManagerImpl)ProjectLevelVcsManager.getInstance(myProject);
myExcludedFileIndex = PeriodicalTasksCloser.getInstance().safeGetService(myProject, FileIndexFacade.class);
}
@@ -72,14 +73,14 @@
final boolean inContent = myVcsManager.isFileInContent(validParent);
if (inContent) return true;
if (filePath != null) {
- return isFileInBaseDir(filePath, myProject.getBaseDir()) && ! myExcludedFileIndex.isExcludedFile(validParent);
+ return isFileInBaseDir(filePath, myProject.getBaseDir()) && !myExcludedFileIndex.isExcludedFile(validParent);
}
return false;
}
});
}
- private boolean isFileInBaseDir(final FilePath filePath, final VirtualFile baseDir) {
+ private static boolean isFileInBaseDir(final FilePath filePath, final VirtualFile baseDir) {
final VirtualFile parent = filePath.getVirtualFileParent();
return !filePath.isDirectory() && parent != null && parent.equals(baseDir);
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java
index 21ee420..2b4ea99 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java
@@ -27,6 +27,7 @@
import com.intellij.openapi.util.EmptyRunnable;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.FilePath;
@@ -445,7 +446,7 @@
ContentRevision afterRevision = change.getAfterRevision();
if (afterRevision == null) return false;
FilePath file = afterRevision.getFile();
- return file.getName().equals(toSelect.getName());
+ return FileUtil.pathsEqual(file.getPath(), toSelect.getPath());
}
protected abstract DefaultTreeModel buildTreeModel(final List<T> changes, final ChangeNodeDecorator changeNodeDecorator);
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/CopyLineStatusRangeAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/CopyLineStatusRangeAction.java
index 83dc7eb..aaa512c 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/CopyLineStatusRangeAction.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/CopyLineStatusRangeAction.java
@@ -35,7 +35,7 @@
}
public void actionPerformed(final AnActionEvent e) {
- final String content = myLineStatusTracker.getUpToDateContent(myRange);
+ final String content = myLineStatusTracker.getUpToDateContent(myRange).toString();
CopyPasteManager.getInstance().setContents(new StringSelection(content));
}
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/DocumentWrapper.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/DocumentWrapper.java
index d6362ff..1674b55 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/DocumentWrapper.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/DocumentWrapper.java
@@ -38,21 +38,14 @@
@NotNull
public List<String> getLines() {
- return getLines(0, myDocument.getLineCount() - 1);
+ return getLines(0, getLineCount(myDocument) - 1);
}
@NotNull
public List<String> getLines(int from, int to) {
ArrayList<String> result = new ArrayList<String>();
for (int i = from; i <= to; i++) {
- if (i >= myDocument.getLineCount()) break;
- final String line = getLine(i);
- /*
- if (line.length() > 0 || i < to) {
- result.add(line);
- }
- */
- result.add(line);
+ result.add(getLine(i));
}
return result;
}
@@ -65,5 +58,9 @@
}
return myDocument.getText(range);
}
+
+ private static int getLineCount(@NotNull Document document) {
+ return Math.max(document.getLineCount(), 1);
+ }
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java
index ac0bc86..44a56e7 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java
@@ -175,10 +175,10 @@
LOG.assertTrue(!myReleased, "Already released");
int first =
- range.getOffset1() >= myDocument.getLineCount() ? myDocument.getTextLength() : myDocument.getLineStartOffset(range.getOffset1());
+ range.getOffset1() >= getLineCount(myDocument) ? myDocument.getTextLength() : myDocument.getLineStartOffset(range.getOffset1());
int second =
- range.getOffset2() >= myDocument.getLineCount() ? myDocument.getTextLength() : myDocument.getLineStartOffset(range.getOffset2());
+ range.getOffset2() >= getLineCount(myDocument) ? myDocument.getTextLength() : myDocument.getLineStartOffset(range.getOffset2());
final RangeHighlighter highlighter = DocumentMarkupModel.forDocument(myDocument, myProject, true)
.addRangeHighlighter(first, second, HighlighterLayer.FIRST - 1, null, HighlighterTargetArea.LINES_IN_RANGE);
@@ -259,6 +259,7 @@
if (range.getHighlighter() != null) {
range.getHighlighter().dispose();
}
+ range.invalidate();
}
myRanges.clear();
}
@@ -316,10 +317,10 @@
if (myBulkUpdate || myAnathemaThrown || BaseLoadState.LOADED != myBaseLoaded) return;
try {
myFirstChangedLine = myDocument.getLineNumber(e.getOffset());
- myLastChangedLine = myDocument.getLineNumber(e.getOffset() + e.getOldLength());
- myChangedLines = myLastChangedLine - myFirstChangedLine;
+ myLastChangedLine = e.getOldLength() == 0 ? myFirstChangedLine : myDocument.getLineNumber(e.getOffset() + e.getOldLength() - 1);
if (StringUtil.endsWithChar(e.getOldFragment(), '\n')) myLastChangedLine++;
- myTotalLines = e.getDocument().getLineCount();
+ myChangedLines = myLastChangedLine - myFirstChangedLine;
+ myTotalLines = getLineCount(e.getDocument());
}
catch (ProcessCanceledException ignore) {
}
@@ -334,9 +335,14 @@
if (myReleased) return;
if (myBulkUpdate || myAnathemaThrown || BaseLoadState.LOADED != myBaseLoaded) return;
try {
- int currentChangedLines = myDocument.getLineNumber(e.getOffset() + e.getNewLength()) - myDocument.getLineNumber(e.getOffset());
+ int currentFirstChangedLine = myFirstChangedLine;
+ int currentLastChangedLine =
+ e.getNewLength() == 0 ? currentFirstChangedLine : myDocument.getLineNumber(e.getOffset() + e.getNewLength() - 1);
+ if (StringUtil.endsWithChar(e.getNewFragment(), '\n')) currentLastChangedLine++;
+ int currentChangedLines = currentLastChangedLine - currentFirstChangedLine;
+ int upToDateTotalLine = getLineCount(myUpToDateDocument);
+
int linesShift = currentChangedLines - myChangedLines;
- int upToDateTotalLine = myUpToDateDocument.getLineCount();
List<Range> rangesBeforeChange = new ArrayList<Range>();
List<Range> rangesAfterChange = new ArrayList<Range>();
@@ -355,13 +361,14 @@
myLastChangedLine = lastChangedRange.getOffset2() - 1;
}
- int currentFirstLine = myFirstChangedLine;
- int currentLastLine = myLastChangedLine + linesShift;
+ currentFirstChangedLine = myFirstChangedLine;
+ currentLastChangedLine = myLastChangedLine + linesShift;
int upToDateFirstLine = getUpToDateLine1(lastRangeBefore, myFirstChangedLine);
int upToDateLastLine = getUpToDateLine2(firstRangeAfter, myLastChangedLine, myTotalLines, upToDateTotalLine);
- List<Range> newChangedRanges = getNewChangedRanges(currentFirstLine, currentLastLine, upToDateFirstLine, upToDateLastLine);
+ List<Range> newChangedRanges =
+ getNewChangedRanges(currentFirstChangedLine, currentLastChangedLine, upToDateFirstLine, upToDateLastLine);
shiftRanges(rangesAfterChange, linesShift);
@@ -426,6 +433,7 @@
range.getHighlighter().dispose();
}
range.setHighlighter(null);
+ range.invalidate();
}
for (Range range : newRangesInChange) {
range.setHighlighter(createHighlighter(range));
@@ -531,98 +539,207 @@
}
}
- public void rollbackChanges(final Range range) {
+ public void rollbackChanges(@NotNull Range range) {
myApplication.assertWriteAccessAllowed();
synchronized (myLock) {
- TextRange currentTextRange = getCurrentTextRangeWithMagic(range);
+ if (!range.isValid()) {
+ LOG.warn("Rollback of invalid range");
+ return;
+ }
- int offset1 = currentTextRange.getStartOffset();
- int offset2 = Math.min(currentTextRange.getEndOffset() + 1, myDocument.getTextLength());
- if (range.getType() == Range.INSERTED) {
- myDocument.replaceString(offset1, offset2, "");
- }
- else if (range.getType() == Range.DELETED) {
- String upToDateContent = getUpToDateContentWithMagic(range);
- myDocument.insertString(offset1, upToDateContent);
- }
- else {
- String upToDateContent = getUpToDateContentWithMagic(range);
+ if (range.getType() == Range.MODIFIED) {
+ TextRange currentTextRange = getCurrentTextRange(range);
+ int offset1 = currentTextRange.getStartOffset();
+ int offset2 = currentTextRange.getEndOffset();
+
+ CharSequence upToDateContent = getUpToDateContent(range);
myDocument.replaceString(offset1, offset2, upToDateContent);
}
+ else if (range.getType() == Range.INSERTED) {
+ TextRange currentTextRange = getCurrentTextRange(range);
+ int offset1 = currentTextRange.getStartOffset();
+ int offset2 = currentTextRange.getEndOffset();
+
+ if (offset1 > 0) {
+ offset1--;
+ }
+ else if (offset2 < myDocument.getTextLength()) {
+ offset2++;
+ }
+ myDocument.deleteString(offset1, offset2);
+ }
+ else if (range.getType() == Range.DELETED) {
+ CharSequence content = getUpToDateContent(range);
+ if (range.getOffset2() == getLineCount(myDocument)) {
+ myDocument.insertString(myDocument.getTextLength(), "\n" + content);
+ }
+ else {
+ myDocument.insertString(myDocument.getLineStartOffset(range.getOffset2()), content + "\n");
+ }
+ }
+ else {
+ throw new IllegalArgumentException("Unknown range type: " + range.getType());
+ }
}
}
- public String getUpToDateContentWithMagic(Range range) {
+ public void rollbackChanges(@NotNull SegmentTree lines) {
+ myApplication.assertWriteAccessAllowed();
+
synchronized (myLock) {
- TextRange textRange = getUpToDateRangeWithMagic(range);
- final int startOffset = textRange.getStartOffset();
- final int endOffset = Math.min(textRange.getEndOffset() + 1, myUpToDateDocument.getTextLength());
- return myUpToDateDocument.getCharsSequence().subSequence(startOffset, endOffset).toString();
+ List<Range> affectedRanges = new ArrayList<Range>();
+
+ boolean wasEnd = false;
+ boolean simple = true;
+ for (Range range : myRanges) {
+ if (!range.isValid()) {
+ LOG.warn("Rollback of invalid range");
+ return;
+ }
+
+ boolean check;
+ if (range.getOffset1() == range.getOffset2()) {
+ check = lines.check(range.getOffset1());
+ }
+ else {
+ check = lines.check(range.getOffset1(), range.getOffset2());
+ }
+ if (check) {
+ if (wasEnd) simple = false;
+ affectedRanges.add(range);
+ }
+ else {
+ if (!affectedRanges.isEmpty()) wasEnd = true;
+ }
+ }
+
+ if (simple) {
+ rollbackChangesSimple(affectedRanges);
+ }
+ else {
+ rollbackChangesComplex(affectedRanges);
+ }
}
}
- public String getUpToDateContent(Range range) {
+ private void rollbackChangesSimple(@NotNull List<Range> ranges) {
+ if (ranges.isEmpty()) return;
+
+ Range first = ranges.get(0);
+ Range last = ranges.get(ranges.size() - 1);
+
+ byte type = first == last ? first.getType() : Range.MODIFIED;
+ final Range merged = new Range(first.getOffset1(), last.getOffset2(), first.getUOffset1(), last.getUOffset2(), type);
+
+ // We don't expect complex Insertion/Deletion operation - they shouldn't exist
+ assert type != Range.MODIFIED || (first.getOffset1() != last.getOffset2() && first.getUOffset1() != last.getUOffset2());
+
+ rollbackChanges(merged);
+ }
+
+ private void rollbackChangesComplex(@NotNull List<Range> ranges) {
+ // We can't relay on assumption, that revert of a single change will not affect any other.
+ // This, among the others, is because of 'magic' ranges for revert, that will affect nearby lines implicitly.
+ // So it's dangerous to apply ranges ony-by-one and we have to create single atomic modification.
+ // Usage of Bulk mode will lead to full rebuild of tracker, and therefore will be slow..
+
+ if (ranges.isEmpty()) return;
+ if (ranges.size() == 1) {
+ rollbackChanges(ranges.get(0));
+ return;
+ }
+
+ Range first = ranges.get(0);
+ Range last = ranges.get(ranges.size() - 1);
+
+ // We don't expect complex Insertion/Deletion operation - they shouldn't exist.
+ assert first != last && first.getOffset1() != last.getOffset2() && first.getUOffset1() != last.getUOffset2();
+
+ final int start = getCurrentTextRange(first).getStartOffset();
+ final int end = getCurrentTextRange(last).getEndOffset();
+
+ StringBuilder builder = new StringBuilder();
+
+ int lastOffset = start;
+ for (Range range : ranges) {
+ TextRange textRange = getCurrentTextRange(range);
+
+ builder.append(myDocument.getText(new TextRange(lastOffset, textRange.getStartOffset())));
+ lastOffset = textRange.getEndOffset();
+
+ if (range.getType() == Range.MODIFIED) {
+ builder.append(getUpToDateContent(range));
+ }
+ else if (range.getType() == Range.INSERTED) {
+ if (builder.length() > 0) {
+ builder.deleteCharAt(builder.length() - 1);
+ }
+ else {
+ lastOffset++;
+ }
+ }
+ else if (range.getType() == Range.DELETED) {
+ CharSequence content = getUpToDateContent(range);
+ if (range.getOffset2() == getLineCount(myDocument)) {
+ builder.append('\n').append(content);
+ }
+ else {
+ builder.append(content).append('\n');
+ }
+ }
+ else {
+ throw new IllegalArgumentException("Unknown range type: " + range.getType());
+ }
+ }
+ builder.append(myDocument.getText(new TextRange(lastOffset, end)));
+
+ final String s = builder.toString();
+
+ myDocument.replaceString(start, end, s);
+ }
+
+ public CharSequence getUpToDateContent(@NotNull Range range) {
synchronized (myLock) {
TextRange textRange = getUpToDateRange(range);
final int startOffset = textRange.getStartOffset();
- final int endOffset = Math.min(textRange.getEndOffset() + 1, myUpToDateDocument.getTextLength());
- return myUpToDateDocument.getCharsSequence().subSequence(startOffset, endOffset).toString();
+ final int endOffset = textRange.getEndOffset();
+ return myUpToDateDocument.getCharsSequence().subSequence(startOffset, endOffset);
}
}
- Project getProject() {
- return myProject;
- }
-
- @NotNull
- TextRange getCurrentTextRangeWithMagic(@NotNull Range range) {
- return getRangeWithMagic(range.getType(), range.getOffset1(), range.getOffset2(), Range.DELETED, myDocument);
- }
-
- @NotNull
- TextRange getUpToDateRangeWithMagic(@NotNull Range range) {
- return getRangeWithMagic(range.getType(), range.getUOffset1(), range.getUOffset2(), Range.INSERTED, myUpToDateDocument);
- }
-
@NotNull
TextRange getCurrentTextRange(@NotNull Range range) {
- return getRange(range.getType(), range.getOffset1(), range.getOffset2(), Range.DELETED, myDocument);
+ synchronized (myLock) {
+ if (!range.isValid()) {
+ LOG.warn("Current TextRange of invalid range");
+ }
+
+ return getRange(range.getOffset1(), range.getOffset2(), myDocument);
+ }
}
@NotNull
TextRange getUpToDateRange(@NotNull Range range) {
- return getRange(range.getType(), range.getUOffset1(), range.getUOffset2(), Range.INSERTED, myUpToDateDocument);
- }
+ synchronized (myLock) {
+ if (!range.isValid()) {
+ LOG.warn("UpToDate TextRange of invalid range");
+ }
- @NotNull
- private static TextRange getRangeWithMagic(byte rangeType, int offset1, int offset2, byte emptyRangeCondition, Document document) {
- if (rangeType == emptyRangeCondition) {
- int lineStartOffset;
- if (offset1 == 0) {
- lineStartOffset = 0;
- }
- else {
- lineStartOffset = document.getLineEndOffset(offset1 - 1);
- }
- //if (lineStartOffset > 0) lineStartOffset--;
- return new TextRange(lineStartOffset, lineStartOffset);
- }
- else {
- int startOffset = document.getLineStartOffset(offset1);
- int endOffset = document.getLineEndOffset(offset2 - 1);
- if (startOffset > 0) {
- --startOffset;
- --endOffset;
- }
- return new TextRange(startOffset, endOffset);
+ return getRange(range.getUOffset1(), range.getUOffset2(), myUpToDateDocument);
}
}
+ /**
+ * Return affected range, without non-internal '\n'
+ * so if last line is not empty, the last symbol will be not '\n'
+ * <p/>
+ * So we consider '\n' not as a part of line, but a separator between lines
+ */
@NotNull
- private static TextRange getRange(byte rangeType, int offset1, int offset2, byte emptyRangeCondition, Document document) {
- if (rangeType == emptyRangeCondition) {
- int lineStartOffset = offset1 < document.getLineCount() ? document.getLineStartOffset(offset1) : document.getTextLength();
+ private static TextRange getRange(int offset1, int offset2, @NotNull Document document) {
+ if (offset1 == offset2) {
+ int lineStartOffset = offset1 < getLineCount(document) ? document.getLineStartOffset(offset1) : document.getTextLength();
return new TextRange(lineStartOffset, lineStartOffset);
}
else {
@@ -643,7 +760,11 @@
}
}
- public static enum BaseLoadState {
+ Project getProject() {
+ return myProject;
+ }
+
+ public enum BaseLoadState {
LOADING,
FAILED,
LOADED
@@ -705,4 +826,8 @@
myLabel.setText("Can not highlight changed lines. File is too big and there are too many changes.");
}
}
+
+ private static int getLineCount(@NotNull Document document) {
+ return Math.max(document.getLineCount(), 1);
+ }
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java
index 24884b4..6f1cd15 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java
@@ -160,7 +160,7 @@
localShowPrevAction.copyFrom(globalShowPrevAction);
final RollbackLineStatusRangeAction rollback = new RollbackLineStatusRangeAction(tracker, range, editor);
- EmptyAction.setupAction(rollback, IdeActions.CHANGES_VIEW_ROLLBACK, editorComponent);
+ EmptyAction.setupAction(rollback, IdeActions.SELECTED_CHANGES_ROLLBACK, editorComponent);
group.add(rollback);
group.add(new ShowLineStatusRangeDiffAction(tracker, range, editor));
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/Range.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/Range.java
index 5727c62..e166acd 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/Range.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/Range.java
@@ -42,6 +42,8 @@
private final byte myType;
@Nullable private RangeHighlighter myRangeHighlighter;
+ private boolean myValid = true;
+
public static Range createOn(@NotNull Diff.Change change, int shift, int upToDateShift) {
byte type = getChangeTypeFrom(change);
@@ -158,4 +160,12 @@
public RangeHighlighter getHighlighter() {
return myRangeHighlighter;
}
+
+ public boolean isValid() {
+ return myValid;
+ }
+
+ public void invalidate() {
+ myValid = false;
+ }
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/RollbackLineStatusAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/RollbackLineStatusAction.java
new file mode 100644
index 0000000..59697f1
--- /dev/null
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/RollbackLineStatusAction.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2000-2010 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.vcs.ex;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.command.CommandProcessor;
+import com.intellij.openapi.editor.Caret;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.DumbAwareAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vcs.VcsBundle;
+import com.intellij.openapi.vcs.impl.LineStatusTrackerManager;
+import com.intellij.openapi.vfs.ReadonlyStatusHandler;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+public class RollbackLineStatusAction extends DumbAwareAction {
+ public RollbackLineStatusAction() {
+ super("Rollback", "Rollback selected changes", AllIcons.Actions.Reset);
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ Project project = e.getProject();
+ if (project == null) {
+ e.getPresentation().setEnabled(false);
+ return;
+ }
+ Editor editor = CommonDataKeys.EDITOR.getData(e.getDataContext());
+ if (editor == null) {
+ e.getPresentation().setEnabled(false);
+ return;
+ }
+ LineStatusTracker tracker = LineStatusTrackerManager.getInstance(project).getLineStatusTracker(editor.getDocument());
+ if (tracker == null) {
+ e.getPresentation().setEnabled(false);
+ return;
+ }
+ e.getPresentation().setEnabled(true);
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ Project project = e.getProject();
+ Editor editor = CommonDataKeys.EDITOR.getData(e.getDataContext());
+ LineStatusTracker tracker = LineStatusTrackerManager.getInstance(project).getLineStatusTracker(editor.getDocument());
+ if (tracker == null) return;
+
+ rollback(tracker, editor, null);
+ }
+
+ protected static void rollback(@NotNull LineStatusTracker tracker, @Nullable Editor editor, @Nullable Range range) {
+ if (range != null) {
+ doRollback(tracker, range);
+ return;
+ }
+
+ if (editor == null) return;
+ Document document = editor.getDocument();
+ int totalLines = getLineCount(document);
+
+ SegmentTree lines = new SegmentTree(totalLines + 1);
+
+ List<Caret> carets = editor.getCaretModel().getAllCarets();
+ for (Caret caret : carets) {
+ if (caret.hasSelection()) {
+ int line1 = editor.offsetToLogicalPosition(caret.getSelectionStart()).line;
+ int line2 = editor.offsetToLogicalPosition(caret.getSelectionEnd()).line;
+ lines.mark(line1, line2 + 1);
+ if (caret.getSelectionEnd() == document.getTextLength()) lines.mark(totalLines);
+ }
+ else {
+ lines.mark(caret.getLogicalPosition().line);
+ if (caret.getOffset() == document.getTextLength()) lines.mark(totalLines);
+ }
+ }
+
+ doRollback(tracker, lines);
+ }
+
+ private static void doRollback(@NotNull final LineStatusTracker tracker, @NotNull final Range range) {
+ execute(tracker, new Runnable() {
+ @Override
+ public void run() {
+ tracker.rollbackChanges(range);
+ }
+ });
+ }
+
+ private static void doRollback(@NotNull final LineStatusTracker tracker, @NotNull final SegmentTree lines) {
+ execute(tracker, new Runnable() {
+ @Override
+ public void run() {
+ tracker.rollbackChanges(lines);
+ }
+ });
+ }
+
+ private static void execute(@NotNull final LineStatusTracker tracker, @NotNull final Runnable task) {
+ // TODO: is there possible data races?
+ CommandProcessor.getInstance().executeCommand(tracker.getProject(), new Runnable() {
+ public void run() {
+ ApplicationManager.getApplication().runWriteAction(new Runnable() {
+ public void run() {
+ if (!tracker.getDocument().isWritable()) {
+ final ReadonlyStatusHandler.OperationStatus operationStatus = ReadonlyStatusHandler
+ .getInstance(tracker.getProject()).ensureFilesWritable(tracker.getVirtualFile());
+ if (operationStatus.hasReadonlyFiles()) return;
+ }
+ task.run();
+ }
+ });
+ }
+ }, VcsBundle.message("command.name.rollback.change"), null);
+ }
+
+ private static int getLineCount(@NotNull Document document) {
+ return Math.max(document.getLineCount(), 1);
+ }
+}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/RollbackLineStatusRangeAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/RollbackLineStatusRangeAction.java
index ed5846d..f1795b5 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/RollbackLineStatusRangeAction.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/RollbackLineStatusRangeAction.java
@@ -12,41 +12,28 @@
*/
package com.intellij.openapi.vcs.ex;
-import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.application.ApplicationManager;
-import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.editor.Editor;
-import com.intellij.openapi.vcs.VcsBundle;
-import com.intellij.openapi.vfs.ReadonlyStatusHandler;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
-/**
-* @author irengrig
-*/
-public class RollbackLineStatusRangeAction extends BaseLineStatusRangeAction {
- public RollbackLineStatusRangeAction(final LineStatusTracker lineStatusTracker, final Range range, final Editor editor) {
- super(VcsBundle.message("action.name.rollback"), AllIcons.Actions.Reset, lineStatusTracker, range);
+public class RollbackLineStatusRangeAction extends RollbackLineStatusAction {
+ @NotNull private final LineStatusTracker myTracker;
+ @Nullable private final Editor myEditor;
+ @NotNull private final Range myRange;
+
+ public RollbackLineStatusRangeAction(@NotNull LineStatusTracker tracker, @NotNull Range range, @Nullable Editor editor) {
+ myTracker = tracker;
+ myEditor = editor;
+ myRange = range;
}
- public boolean isEnabled() {
- return true;
+ @Override
+ public void update(AnActionEvent e) {
+ e.getPresentation().setEnabled(true);
}
public void actionPerformed(final AnActionEvent e) {
- CommandProcessor.getInstance().executeCommand(myLineStatusTracker.getProject(), new Runnable() {
- public void run() {
- ApplicationManager.getApplication().runWriteAction(new Runnable() {
- public void run() {
- if (!myLineStatusTracker.getDocument().isWritable()) {
- final ReadonlyStatusHandler.OperationStatus operationStatus = ReadonlyStatusHandler
- .getInstance(myLineStatusTracker.getProject()).ensureFilesWritable(myLineStatusTracker.getVirtualFile());
- if (operationStatus.hasReadonlyFiles()) return;
- }
- myLineStatusTracker.rollbackChanges(myRange);
- }
- });
- }
- }, VcsBundle.message("command.name.rollback.change"), null);
-
+ rollback(myTracker, myEditor, myRange);
}
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/SegmentTree.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/SegmentTree.java
new file mode 100644
index 0000000..6830712
--- /dev/null
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/SegmentTree.java
@@ -0,0 +1,116 @@
+package com.intellij.openapi.vcs.ex;
+
+import org.jetbrains.annotations.Nullable;
+
+public class SegmentTree {
+ private final int myActualLength;
+ private final int myLength;
+
+ private final Node myRoot;
+
+ public SegmentTree(int length) {
+ myActualLength = length;
+ myLength = toUpperSquare(length);
+ myRoot = new Node();
+ }
+
+ public void mark(int pos) {
+ mark(pos, pos + 1);
+ }
+
+ public void mark(int start, int end) {
+ start = correct(0, myActualLength, start);
+ end = correct(0, myActualLength, end);
+
+ myRoot.mark(0, myLength, start, end);
+ }
+
+ public boolean check(int pos) {
+ return check(pos, pos + 1);
+ }
+
+ public boolean check(int start, int end) {
+ start = correct(0, myActualLength, start);
+ end = correct(0, myActualLength, end);
+
+ return myRoot.check(0, myLength, start, end);
+ }
+
+ private static int toUpperSquare(int value) {
+ int high = Integer.highestOneBit(value);
+ return high == value ? value : high * 2;
+ }
+
+ private static class Node {
+ @Nullable
+ public Node myLeft;
+
+ @Nullable
+ public Node myRight;
+
+ public boolean myMarked;
+
+ public boolean mark(int thisStart, int thisEnd, int start, int end) {
+ if (myLeft == null && myMarked) return true;
+
+ if (start == end) return false;
+
+ myMarked = true;
+
+ if (thisStart == start && thisEnd == end) {
+ myLeft = null;
+ myRight = null;
+ return true;
+ }
+
+ if (myLeft == null) {
+ myLeft = new Node();
+ myRight = new Node();
+ }
+
+ int mid = thisStart + (thisEnd - thisStart) / 2;
+ int start1 = correct(thisStart, mid, start);
+ int end1 = correct(thisStart, mid, end);
+ int start2 = correct(mid, thisEnd, start);
+ int end2 = correct(mid, thisEnd, end);
+
+ boolean marked = true;
+ marked &= myLeft.mark(thisStart, mid, start1, end1);
+ marked &= myRight.mark(mid, thisEnd, start2, end2);
+
+ if (marked) {
+ myLeft = null;
+ myRight = null;
+ }
+
+ return marked;
+ }
+
+ public boolean check(int thisStart, int thisEnd, int start, int end) {
+ if (start == end) return false;
+
+ if (thisStart == start && thisEnd == end) {
+ return myMarked;
+ }
+
+ if (myLeft == null) return myMarked;
+
+ int mid = thisStart + (thisEnd - thisStart) / 2;
+ int start1 = correct(thisStart, mid, start);
+ int end1 = correct(thisStart, mid, end);
+ int start2 = correct(mid, thisEnd, start);
+ int end2 = correct(mid, thisEnd, end);
+
+ if (myLeft.check(thisStart, mid, start1, end1)) return true;
+ if (myRight.check(mid, thisEnd, start2, end2)) return true;
+
+ return false;
+ }
+ }
+
+ private static int correct(int start, int end, int value) {
+ if (value < start) return start;
+ if (value > end) return end;
+ return value;
+ }
+}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/ShowLineStatusRangeDiffAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/ShowLineStatusRangeDiffAction.java
index c5dba0ca..38f6544 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/ShowLineStatusRangeDiffAction.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/ShowLineStatusRangeDiffAction.java
@@ -25,27 +25,22 @@
import com.intellij.openapi.vcs.VcsBundle;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* @author irengrig
*/
public class ShowLineStatusRangeDiffAction extends BaseLineStatusRangeAction {
- public ShowLineStatusRangeDiffAction(final LineStatusTracker lineStatusTracker, final Range range, final Editor editor) {
+ public ShowLineStatusRangeDiffAction(@NotNull LineStatusTracker lineStatusTracker, @NotNull Range range, @Nullable Editor editor) {
super(VcsBundle.message("action.name.show.difference"), AllIcons.Actions.Diff, lineStatusTracker, range);
}
+ @Override
public boolean isEnabled() {
- return isModifiedRange() || isDeletedRange();
+ return true;
}
- private boolean isDeletedRange() {
- return Range.DELETED == myRange.getType();
- }
-
- private boolean isModifiedRange() {
- return Range.MODIFIED == myRange.getType();
- }
-
+ @Override
public void actionPerformed(final AnActionEvent e) {
DiffManager.getInstance().getDiffTool().show(createDiffData());
}
@@ -54,12 +49,13 @@
return new DiffRequest(myLineStatusTracker.getProject()) {
@NotNull
public DiffContent[] getContents() {
+ Range range = expand(myRange, myLineStatusTracker.getDocument(), myLineStatusTracker.getUpToDateDocument());
return new DiffContent[]{
createDiffContent(myLineStatusTracker.getUpToDateDocument(),
- myLineStatusTracker.getUpToDateRange(myRange),
+ myLineStatusTracker.getUpToDateRange(range),
null),
createDiffContent(myLineStatusTracker.getDocument(),
- myLineStatusTracker.getCurrentTextRange(myRange),
+ myLineStatusTracker.getCurrentTextRange(range),
myLineStatusTracker.getVirtualFile())};
}
@@ -74,9 +70,25 @@
};
}
- private DiffContent createDiffContent(final Document uDocument, final TextRange textRange, final VirtualFile file) {
+ @NotNull
+ private DiffContent createDiffContent(@NotNull Document uDocument, @NotNull TextRange textRange, @Nullable VirtualFile file) {
final Project project = myLineStatusTracker.getProject();
final DiffContent diffContent = new DocumentContent(project, uDocument);
return new FragmentContent(diffContent, textRange, project, file);
}
+
+ @NotNull
+ private static Range expand(@NotNull Range range, @NotNull Document document, @NotNull Document uDocument) {
+ if (range.getType() == Range.MODIFIED) return range;
+ if (range.getType() == Range.INSERTED || range.getType() == Range.DELETED) {
+ boolean canExpandBefore = range.getOffset1() != 0 && range.getUOffset1() != 0;
+ boolean canExpandAfter = range.getOffset2() < document.getLineCount() && range.getUOffset2() < uDocument.getLineCount();
+ int offset1 = range.getOffset1() - (canExpandBefore ? 1 : 0);
+ int uOffset1 = range.getUOffset1() - (canExpandBefore ? 1 : 0);
+ int offset2 = range.getOffset2() + (canExpandAfter ? 1 : 0);
+ int uOffset2 = range.getUOffset2() + (canExpandAfter ? 1 : 0);
+ return new Range(offset1, offset2, uOffset1, uOffset2, range.getType());
+ }
+ throw new IllegalArgumentException("Unknown range type: " + range.getType());
+ }
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java
index a1fa2ba..172edc7 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java
@@ -56,6 +56,7 @@
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
import com.intellij.openapi.vcs.vfs.VcsFileSystem;
import com.intellij.openapi.vcs.vfs.VcsVirtualFile;
+import com.intellij.openapi.vcs.vfs.VcsVirtualFolder;
import com.intellij.openapi.vfs.ReadonlyStatusHandler;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.*;
@@ -1123,8 +1124,9 @@
VcsFileRevision revision = e.getData( VcsDataKeys.VCS_FILE_REVISION );
final Boolean nonLocal = e.getData(VcsDataKeys.VCS_NON_LOCAL_HISTORY_SESSION);
- FileType fileType = revVFile == null ? null : revVFile.getFileType();
- boolean enabled = revision != null && revVFile != null && !fileType.isBinary() && ! Boolean.TRUE.equals(nonLocal);
+ boolean isFile = revVFile != null && !revVFile.isDirectory();
+ FileType fileType = isFile ? revVFile.getFileType() : null;
+ boolean enabled = revision != null && isFile && !fileType.isBinary() && !Boolean.TRUE.equals(nonLocal);
if (enabled) {
final ProjectLevelVcsManager plVcsManager = ProjectLevelVcsManager.getInstance(myVcs.getProject());
@@ -1309,7 +1311,9 @@
private VirtualFile createVirtualFileForRevision(VcsFileRevision revision) {
if (!myRevisionToVirtualFile.containsKey(revision)) {
FilePath filePath = (revision instanceof VcsFileRevisionEx ? ((VcsFileRevisionEx)revision).getPath() : myFilePath);
- myRevisionToVirtualFile.put(revision, new VcsVirtualFile(filePath.getPath(), revision, VcsFileSystem.getInstance()));
+ myRevisionToVirtualFile.put(revision, filePath.isDirectory()
+ ? new VcsVirtualFolder(filePath.getPath(), null, VcsFileSystem.getInstance())
+ : new VcsVirtualFile(filePath.getPath(), revision, VcsFileSystem.getInstance()));
}
return myRevisionToVirtualFile.get(revision);
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ModuleDefaultVcsRootPolicy.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ModuleDefaultVcsRootPolicy.java
index 4f4efe5..4b057f4 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ModuleDefaultVcsRootPolicy.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ModuleDefaultVcsRootPolicy.java
@@ -21,7 +21,6 @@
import com.intellij.openapi.components.StorageScheme;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
-import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ex.ProjectEx;
@@ -35,7 +34,6 @@
import com.intellij.openapi.vcs.changes.VcsGuess;
import com.intellij.openapi.vcs.ex.ProjectLevelVcsManagerEx;
import com.intellij.openapi.vcs.impl.projectlevelman.NewMappings;
-import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
@@ -102,10 +100,7 @@
if (matchContext != null) {
return true;
}
- if (myBaseDir != null && VfsUtilCore.isAncestor(myBaseDir, file, false)) {
- return !ProjectRootManager.getInstance(myProject).getFileIndex().isIgnored(file);
- }
- return false;
+ return myBaseDir != null && VfsUtilCore.isAncestor(myBaseDir, file, false);
}
@Override
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java
index cbf9d2b..5cc3a8a 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java
@@ -135,7 +135,7 @@
myMappings = new NewMappings(myProject, myMessageBus, this, manager, excludedFileIndex);
myMappingsToRoots = new MappingsToRoots(myMappings, myProject);
- if (! myProject.isDefault()) {
+ if (!myProject.isDefault()) {
myVcsEventListenerManager = new VcsEventsListenerManagerImpl();
}
@@ -203,7 +203,7 @@
}
public boolean haveVcses() {
- return ! AllVcses.getInstance(myProject).isEmpty();
+ return !AllVcses.getInstance(myProject).isEmpty();
}
@Override
@@ -356,7 +356,7 @@
}
public void unregisterVcs(AbstractVcs vcs) {
- if (! ApplicationManager.getApplication().isUnitTestMode() && myMappings.haveActiveVcs(vcs.getName())) {
+ if (!ApplicationManager.getApplication().isUnitTestMode() && myMappings.haveActiveVcs(vcs.getName())) {
// unlikely
LOG.warn("Active vcs '" + vcs.getName() + "' is being unregistered. Remove from mappings first.");
}
@@ -391,7 +391,7 @@
@Override
public boolean hasAnyMappings() {
- return ! myMappings.isEmpty();
+ return !myMappings.isEmpty();
}
@Override
@@ -452,7 +452,7 @@
private void releaseEditor() {
if (myEditorAdapter != null) {
final Editor editor = myEditorAdapter.getEditor();
- if (! editor.isDisposed()) {
+ if (!editor.isDisposed()) {
EditorFactory.getInstance().releaseEditor(editor);
}
}
@@ -472,7 +472,7 @@
@Override
@NotNull
public VcsShowSettingOption getStandardOption(@NotNull VcsConfiguration.StandardOption option, @NotNull AbstractVcs vcs) {
- final VcsShowOptionsSettingImpl options = (VcsShowOptionsSettingImpl) getOptions(option);
+ final VcsShowOptionsSettingImpl options = (VcsShowOptionsSettingImpl)getOptions(option);
options.addApplicableVcs(vcs);
return options;
}
@@ -490,7 +490,7 @@
@Override
public UpdateInfoTree showUpdateProjectInfo(UpdatedFiles updatedFiles, String displayActionName, ActionInfo actionInfo, boolean canceled) {
- if (! myProject.isOpen() || myProject.isDisposed()) return null;
+ if (!myProject.isOpen() || myProject.isDisposed()) return null;
ContentManager contentManager = getContentManager();
if (contentManager == null) {
return null; // content manager is made null during dispose; flag is set later
@@ -537,7 +537,7 @@
public boolean hasExplicitMapping(final VirtualFile vFile) {
final VcsDirectoryMapping mapping = myMappings.getMappingFor(vFile);
- return mapping != null && ! mapping.isDefaultMapping();
+ return mapping != null && !mapping.isDefaultMapping();
}
@Override
@@ -687,7 +687,7 @@
final AbstractVcs[] vcses = myMappings.getActiveVcses();
for (AbstractVcs vcs : vcses) {
final VirtualFile[] roots = getRootsUnderVcs(vcs);
- for(VirtualFile root: roots) {
+ for (VirtualFile root : roots) {
vcsRoots.add(new VcsRoot(vcs, root));
}
}
@@ -708,10 +708,8 @@
myMappings.clear();
final List<VcsDirectoryMapping> mappingsList = new ArrayList<VcsDirectoryMapping>();
- final List list = element.getChildren(ELEMENT_MAPPING);
boolean haveNonEmptyMappings = false;
- for(Object childObj: list) {
- Element child = (Element) childObj;
+ for (Element child : element.getChildren(ELEMENT_MAPPING)) {
final String vcs = child.getAttributeValue(ATTRIBUTE_VCS);
if (vcs != null && !vcs.isEmpty()) {
haveNonEmptyMappings = true;
@@ -729,8 +727,9 @@
try {
rootSettings.readExternal(rootSettingsElement);
mapping.setRootSettings(rootSettings);
- } catch (InvalidDataException e) {
- LOG.error("Failed to load VCS root settings class "+ className + " for VCS " + vcsInstance.getClass().getName(), e);
+ }
+ catch (InvalidDataException e) {
+ LOG.error("Failed to load VCS root settings class " + className + " for VCS " + vcsInstance.getClass().getName(), e);
}
}
}
@@ -748,7 +747,7 @@
if (myProject.isDefault()) {
element.setAttribute(ATTRIBUTE_DEFAULT_PROJECT, Boolean.TRUE.toString());
}
- for(VcsDirectoryMapping mapping: getDirectoryMappings()) {
+ for (VcsDirectoryMapping mapping : getDirectoryMappings()) {
Element child = new Element(ELEMENT_MAPPING);
child.setAttribute(ATTRIBUTE_DIRECTORY, mapping.getDirectory());
child.setAttribute(ATTRIBUTE_VCS, mapping.getVcs());
@@ -803,7 +802,7 @@
@Override
public void fireDirectoryMappingsChanged() {
- if (myProject.isOpen() && ! myProject.isDisposed()) {
+ if (myProject.isOpen() && !myProject.isDisposed()) {
myMappings.mappingsChanged();
}
}
@@ -844,7 +843,7 @@
@Override
public Boolean compute() {
return vf != null && (myExcludedIndex.isInContent(vf) || isFileInBaseDir(vf) || vf.equals(myProject.getBaseDir()) ||
- hasExplicitMapping(vf) || isInDirectoryBasedRoot(vf)) && ! myExcludedIndex.isExcludedFile(vf);
+ hasExplicitMapping(vf) || isInDirectoryBasedRoot(vf)) && !myExcludedIndex.isExcludedFile(vf);
}
});
}
@@ -862,7 +861,7 @@
private boolean isInDirectoryBasedRoot(final VirtualFile file) {
if (file == null) return false;
- final StorageScheme storageScheme = ((ProjectEx) myProject).getStateStore().getStorageScheme();
+ final StorageScheme storageScheme = ((ProjectEx)myProject).getStateStore().getStorageScheme();
if (StorageScheme.DIRECTORY_BASED.equals(storageScheme)) {
final VirtualFile baseDir = myProject.getBaseDir();
if (baseDir == null) return false;
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/VcsRootIterator.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/VcsRootIterator.java
index 8caa6f2..1229888 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/VcsRootIterator.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/VcsRootIterator.java
@@ -54,12 +54,10 @@
public boolean acceptFolderUnderVcs(final VirtualFile vcsRoot, final VirtualFile file) {
final String vcsUrl = vcsRoot.getUrl();
final MyRootFilter rootFilter = myOtherVcsFolders.get(vcsUrl);
- if ((rootFilter != null) && (! rootFilter.accept(file))) {
+ if ((rootFilter != null) && (!rootFilter.accept(file))) {
return false;
}
- final Boolean excluded = isExcluded(myExcludedFileIndex, file);
- if (excluded) return false;
- return true;
+ return !isExcluded(myExcludedFileIndex, file);
}
private static boolean isExcluded(final FileIndexFacade indexFacade, final VirtualFile file) {
@@ -128,9 +126,9 @@
}
public static void iterateVcsRoot(final Project project,
- final VirtualFile root,
- final Processor<FilePath> processor,
- @Nullable VirtualFileFilter directoryFilter) {
+ final VirtualFile root,
+ final Processor<FilePath> processor,
+ @Nullable VirtualFileFilter directoryFilter) {
final MyRootIterator rootIterator = new MyRootIterator(project, root, processor, null, directoryFilter);
rootIterator.iterate();
}
@@ -177,9 +175,9 @@
@Override
public Result visitFileEx(@NotNull VirtualFile file) {
if (isExcluded(myExcludedFileIndex, file)) return SKIP_CHILDREN;
- if (myRootPresentFilter != null && ! myRootPresentFilter.accept(file)) return SKIP_CHILDREN;
- if (myProject.isDisposed() || ! process(file)) return skipTo(myRoot);
- if (myDirectoryFilter != null && file.isDirectory() && ! myDirectoryFilter.shouldGoIntoDirectory(file)) return SKIP_CHILDREN;
+ if (myRootPresentFilter != null && !myRootPresentFilter.accept(file)) return SKIP_CHILDREN;
+ if (myProject.isDisposed() || !process(file)) return skipTo(myRoot);
+ if (myDirectoryFilter != null && file.isDirectory() && !myDirectoryFilter.shouldGoIntoDirectory(file)) return SKIP_CHILDREN;
return CONTINUE;
}
});
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java
index de1a40d..32fe920 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java
@@ -53,30 +53,31 @@
private final DefaultVcsRootPolicy myDefaultVcsRootPolicy;
private final MessageBus myMessageBus;
private final FileStatusManager myFileStatusManager;
- private final FileIndexFacade myExcludedFileIndex;
+ private final FileIndexFacade myFileIndexFacade;
private final Project myProject;
private boolean myActivated;
public NewMappings(final Project project, final MessageBus messageBus,
- final ProjectLevelVcsManagerImpl vcsManager, FileStatusManager fileStatusManager, FileIndexFacade excludedFileIndex) {
+ final ProjectLevelVcsManagerImpl vcsManager, FileStatusManager fileStatusManager, FileIndexFacade fileIndexFacade) {
myProject = project;
myMessageBus = messageBus;
myFileStatusManager = fileStatusManager;
- myExcludedFileIndex = excludedFileIndex;
+ myFileIndexFacade = fileIndexFacade;
myLock = new Object();
myVcsToPaths = new HashMap<String, List<VcsDirectoryMapping>>();
myFileWatchRequestsManager = new FileWatchRequestsManager(myProject, this, LocalFileSystem.getInstance());
myDefaultVcsRootPolicy = DefaultVcsRootPolicy.getInstance(project);
myActiveVcses = new AbstractVcs[0];
- if (! myProject.isDefault()) {
+ if (!myProject.isDefault()) {
final ArrayList<VcsDirectoryMapping> listStr = new ArrayList<VcsDirectoryMapping>();
final VcsDirectoryMapping mapping = new VcsDirectoryMapping("", "");
listStr.add(mapping);
myVcsToPaths.put("", listStr);
- mySortedMappings = new VcsDirectoryMapping[] {mapping};
- } else {
+ mySortedMappings = new VcsDirectoryMapping[]{mapping};
+ }
+ else {
mySortedMappings = VcsDirectoryMapping.EMPTY_ARRAY;
}
myActivated = false;
@@ -131,7 +132,6 @@
return;
}
}
-
}
final Ref<Boolean> switched = new Ref<Boolean>(Boolean.FALSE);
@@ -139,7 +139,7 @@
public void run() {
// sorted -> map. sorted mappings are NOT changed;
switched.set(trySwitchVcs(path, activeVcsName));
- if (! switched.get().booleanValue()) {
+ if (!switched.get().booleanValue()) {
final List<VcsDirectoryMapping> newList = listForVcsFromMap(newMapping.getVcs());
newList.add(newMapping);
sortedMappingsByMap();
@@ -153,7 +153,7 @@
private void keepActiveVcs(@NotNull Runnable runnable) {
final MyVcsActivator activator;
synchronized (myLock) {
- if (! myActivated) {
+ if (!myActivated) {
runnable.run();
return;
}
@@ -204,7 +204,8 @@
final List<VcsDirectoryMapping> itemsCopy;
if (items.isEmpty()) {
itemsCopy = Collections.singletonList(new VcsDirectoryMapping("", ""));
- } else {
+ }
+ else {
itemsCopy = items;
}
@@ -224,7 +225,7 @@
@Nullable
public VcsDirectoryMapping getMappingFor(@Nullable VirtualFile file) {
if (file == null) return null;
- if (! file.isInLocalFileSystem()) {
+ if (!file.isInLocalFileSystem()) {
return null;
}
@@ -232,17 +233,22 @@
}
@Nullable
- public VcsDirectoryMapping getMappingFor(final VirtualFile file, final Object matchContext) {
+ public VcsDirectoryMapping getMappingFor(final VirtualFile file, final Object parentModule) {
+ // if parentModule is not null it means that file belongs to the module so it isn't excluded
+ if (parentModule == null && myFileIndexFacade.isExcludedFile(file)) {
+ return null;
+ }
+
// performance: calculate file path just once, rather than once per mapping
String path = file.getPath();
- final String systemIndependentPath = FileUtil.toSystemIndependentName((file.isDirectory() && (! path.endsWith("/"))) ? (path + "/") : path);
+ final String systemIndependentPath = FileUtil.toSystemIndependentName((file.isDirectory() && (!path.endsWith("/"))) ? (path + "/") : path);
final VcsDirectoryMapping[] mappings;
synchronized (myLock) {
mappings = mySortedMappings;
}
- for (int i = mappings.length - 1; i >= 0; -- i) {
+ for (int i = mappings.length - 1; i >= 0; --i) {
final VcsDirectoryMapping mapping = mappings[i];
- if (fileMatchesMapping(file, matchContext, systemIndependentPath, mapping)) {
+ if (fileMatchesMapping(file, parentModule, systemIndependentPath, mapping)) {
return mapping;
}
}
@@ -258,12 +264,14 @@
return mapping.getVcs();
}
- private boolean fileMatchesMapping(final VirtualFile file, final Object matchContext, final String systemIndependentPath, final VcsDirectoryMapping mapping) {
+ private boolean fileMatchesMapping(final VirtualFile file,
+ final Object matchContext,
+ final String systemIndependentPath,
+ final VcsDirectoryMapping mapping) {
if (mapping.getDirectory().length() == 0) {
return myDefaultVcsRootPolicy.matchesDefaultMapping(file, matchContext);
}
- return FileUtil.startsWith(systemIndependentPath, mapping.systemIndependentPath()) &&
- ! myExcludedFileIndex.isExcludedFile(file);
+ return FileUtil.startsWith(systemIndependentPath, mapping.systemIndependentPath());
}
public List<VirtualFile> getMappingsAsFilesUnderVcs(final AbstractVcs vcs) {
@@ -281,7 +289,8 @@
if (mapping.isDefaultMapping()) {
// todo callback here; don't like it
myDefaultVcsRootPolicy.addDefaultVcsRoots(this, vcsName, result);
- } else {
+ }
+ else {
final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(mapping.getDirectory());
if (file != null) {
result.add(file);
@@ -307,7 +316,7 @@
private void clearImpl() {
// if vcses were not mapped, there's nothing to clear
- if ((myActiveVcses == null) || (myActiveVcses.length == 0)) return;
+ if ((myActiveVcses == null) || (myActiveVcses.length == 0)) return;
keepActiveVcs(new Runnable() {
public void run() {
@@ -374,7 +383,7 @@
final LocalFileSystem lfs = LocalFileSystem.getInstance();
final AllVcsesI allVcses = AllVcses.getInstance(myProject);
- for (Iterator<String> iterator = myVcsToPaths.keySet().iterator(); iterator.hasNext();) {
+ for (Iterator<String> iterator = myVcsToPaths.keySet().iterator(); iterator.hasNext(); ) {
final String vcsName = iterator.next();
final List<VcsDirectoryMapping> mappings = myVcsToPaths.get(vcsName);
@@ -399,8 +408,9 @@
};
if (StringUtil.isEmptyOrSpaces(vcsName)) {
filteredFiles = AbstractVcs.filterUniqueRootsDefault(objects, fileConvertor);
- } else {
- final AbstractVcs vcs = allVcses.getByName(vcsName);
+ }
+ else {
+ final AbstractVcs<?> vcs = allVcses.getByName(vcsName);
if (vcs == null) {
VcsBalloonProblemNotifier.showOverChangesView(myProject, "VCS plugin not found for mapping to : '" + vcsName + "'", MessageType.ERROR);
continue;
@@ -420,7 +430,8 @@
if (filteredMappings.isEmpty()) {
iterator.remove();
- } else {
+ }
+ else {
mappings.clear();
mappings.addAll(filteredMappings);
}
@@ -434,7 +445,7 @@
for (VcsDirectoryMapping mapping : mySortedMappings) {
if (mapping.systemIndependentPath().equals(fixedPath)) {
final String oldVcs = mapping.getVcs();
- if (! oldVcs.equals(activeVcsName)) {
+ if (!oldVcs.equals(activeVcsName)) {
migrateVcs(activeVcsName, mapping, oldVcs);
}
return true;
@@ -489,7 +500,7 @@
return ourInstance;
}
- public int compare(VcsDirectoryMapping m1, VcsDirectoryMapping m2) {
+ public int compare(@NotNull VcsDirectoryMapping m1, @NotNull VcsDirectoryMapping m2) {
return m1.getDirectory().compareTo(m2.getDirectory());
}
}
@@ -514,7 +525,8 @@
catch (VcsException e) {
// actually is not thrown (AbstractVcs#actualActivate())
}
- } else {
+ }
+ else {
LOG.info("Error: activating non existing vcs: " + s);
}
}
@@ -529,7 +541,8 @@
catch (VcsException e) {
// actually is not thrown (AbstractVcs#actualDeactivate())
}
- } else {
+ }
+ else {
LOG.info("Error: removing non existing vcs: " + s);
}
}
@@ -543,7 +556,7 @@
// omit empty vcs: not a vcs
if (topItem.trim().length() == 0) continue;
- if (! bottom.contains(topItem)) {
+ if (!bottom.contains(topItem)) {
if (notInBottom == null) {
notInBottom = new HashSet<String>();
}
@@ -589,7 +602,8 @@
public void invoke() {
if (myItems.isEmpty()) {
myItemsCopy = Collections.singletonList(new VcsDirectoryMapping("", ""));
- } else {
+ }
+ else {
myItemsCopy = myItems;
}
}
@@ -606,8 +620,9 @@
myDefaultVcsRootPolicy.addDefaultVcsRoots(this, defaultVcs, list);
if (StringUtil.isEmptyOrSpaces(defaultVcs)) {
return AbstractVcs.filterUniqueRootsDefault(list, Convertor.SELF);
- } else {
- final AbstractVcs vcs = AllVcses.getInstance(myProject).getByName(defaultVcs);
+ }
+ else {
+ final AbstractVcs<?> vcs = AllVcses.getInstance(myProject).getByName(defaultVcs);
if (vcs == null) {
return AbstractVcs.filterUniqueRootsDefault(list, Convertor.SELF);
}
diff --git a/platform/vcs-log/api/src/com/intellij/vcs/log/VcsLogRefManager.java b/platform/vcs-log/api/src/com/intellij/vcs/log/VcsLogRefManager.java
index 735ad006..39b001f 100644
--- a/platform/vcs-log/api/src/com/intellij/vcs/log/VcsLogRefManager.java
+++ b/platform/vcs-log/api/src/com/intellij/vcs/log/VcsLogRefManager.java
@@ -3,6 +3,7 @@
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
+import java.util.Comparator;
import java.util.List;
/**
@@ -16,11 +17,16 @@
public interface VcsLogRefManager {
/**
- * Sorts the given references.
- * TODO better provide compareTo
+ * Return the comparator which compares two given references in terms of their "importance",
+ * which is later is used in the log to order branches and branch labels.
+ * <p><ul>
+ * <li>Negative value is returned if first reference is <b>more</b> important than the second (i.e. it will be at the left in the log).
+ * <li>Positive value is returned if first reference is <b>less</b> important than the second (i.e. it will be at the right in the log).
+ * <li>Zero is returned if referenced are considered equally important.
+ * </ul>
*/
@NotNull
- List<VcsRef> sort(Collection<VcsRef> refs);
+ Comparator<VcsRef> getComparator();
/**
* <p>Groups VCS references to show them on the branches panel.</p>
diff --git a/platform/vcs-log/api/src/com/intellij/vcs/log/graph/GraphColorManager.java b/platform/vcs-log/api/src/com/intellij/vcs/log/graph/GraphColorManager.java
index e4e9b87..496329e 100644
--- a/platform/vcs-log/api/src/com/intellij/vcs/log/graph/GraphColorManager.java
+++ b/platform/vcs-log/api/src/com/intellij/vcs/log/graph/GraphColorManager.java
@@ -36,11 +36,20 @@
int getColorOfFragment(CommitId headCommit, int magicIndex);
/**
- * Returns 1, 0 or -1 if branch identified by commit {@code head1} is "more powerful", "equally powerful" or "less powerful"
- * than the branch identified by commit {@code head2}.
- * <p/>
- * If branch1 is more powerful than branch2, it means that its color will be reused by the subgraph below the point when these branches
+ * Compares two head commits in terms of "importance" of reference labels pointing to these commits.
+ * It is used to order branches, branch labels, and for branch coloring. <br/>
+ * E.g. if branch1 is more important than branch2, its color will be reused by the subgraph below the point when these branches
* were diverged.
+ * <p/>
+ * Then head1 is more important than head2, if its most important reference is more important than head2's most important reference
+ * (if they are the same, next are compared).
+ * <p/>
+ * References are compared by the following logic (see {@link com.intellij.vcs.log.VcsLogRefManager}: <ul>
+ * <li>Negative value is returned if first reference is <b>more</b> important than the second (i.e. it will be at the left in the log).
+ * <li>Positive value is returned if first reference is <b>less</b> important than the second (i.e. it will be at the right in the log).
+ * <li>Zero is returned if referenced are considered equally important.
+ * </ul>
+ * <p>
*/
int compareHeads(CommitId head1, CommitId head2); // todo drop this
diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/graph/GraphColorManagerImpl.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/graph/GraphColorManagerImpl.java
index c14ee20..ec74038 100644
--- a/platform/vcs-log/impl/src/com/intellij/vcs/log/graph/GraphColorManagerImpl.java
+++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/graph/GraphColorManagerImpl.java
@@ -26,8 +26,7 @@
import com.intellij.vcs.log.data.RefsModel;
import org.jetbrains.annotations.NotNull;
-import java.util.Collection;
-import java.util.Map;
+import java.util.*;
public class GraphColorManagerImpl implements GraphColorManager<Integer> {
@@ -59,7 +58,7 @@
if (isEmptyRefs(refs, headCommit)) {
return DEFAULT_COLOR;
}
- VcsRef firstRef = getRefManager(refs).sort(refs).get(0);
+ VcsRef firstRef = ContainerUtil.sorted(refs, getRefManager(refs).getComparator()).get(0);
// TODO dark variant
return firstRef.getName().hashCode();
}
@@ -94,28 +93,36 @@
return 0;
}
if (firstEmpty) {
- return -1;
+ return 1;
}
if (secondEmpty) {
- return 1;
+ return -1;
}
VcsLogRefManager refManager1 = getRefManager(refs1);
VcsLogRefManager refManager2 = getRefManager(refs2);
- if (!refManager1.equals(refManager2)) {
+ if (!refManager1.equals(refManager2)) { // heads from different VCSs are not comparable => are considered equal for now
return 0;
}
- Map<VcsRef, Boolean> positions = ContainerUtil.newHashMap();
- for (VcsRef ref : refs1) {
- positions.put(ref, true);
+ Comparator<VcsRef> comparator = refManager1.getComparator();
+ Iterator<VcsRef> it1 = ContainerUtil.sorted(refs1, comparator).iterator();
+ Iterator<VcsRef> it2 = ContainerUtil.sorted(refs2, comparator).iterator();
+ while (it1.hasNext() && it2.hasNext()) {
+ VcsRef ref1 = it1.next();
+ VcsRef ref2 = it2.next();
+ int compare = comparator.compare(ref1, ref2);
+ if (compare != 0) {
+ return compare;
+ }
}
- for (VcsRef ref : refs2) {
- positions.put(ref, false);
+ if (it1.hasNext()) {
+ return -1;
}
-
- VcsRef firstRef = refManager1.sort(positions.keySet()).get(0);
- return positions.get(firstRef) ? 1 : -1;
+ if (it2.hasNext()) {
+ return 1;
+ }
+ return 0;
}
@NotNull
diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/StructureFilterPopupComponent.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/StructureFilterPopupComponent.java
index 3ac9464..c134b1a 100644
--- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/StructureFilterPopupComponent.java
+++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/StructureFilterPopupComponent.java
@@ -32,7 +32,6 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
class StructureFilterPopupComponent extends FilterPopupComponent<VcsLogStructureFilter> {
@@ -89,13 +88,7 @@
return tooltip;
}
- @NotNull
- private static <T> Collection<T> notNullize(@Nullable Collection<T> items) {
- return items != null ? items : Collections.<T>emptyList();
- }
-
private class SelectAction extends DumbAwareAction {
-
SelectAction() {
super("Select...");
}
@@ -108,7 +101,7 @@
new ArrayList<VirtualFile>(myRoots));
if (chooser.showAndGet()) {
myFiles.clear();
- myFiles.addAll(notNullize(chooser.getSelectedFiles()));
+ myFiles.addAll(ContainerUtil.notNullize(chooser.getSelectedFiles()));
setValue(myFiles);
applyFilters();
}
diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/DetailsPanel.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/DetailsPanel.java
index d963bb3..dc87665 100644
--- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/DetailsPanel.java
+++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/DetailsPanel.java
@@ -11,6 +11,7 @@
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.components.JBLoadingPanel;
import com.intellij.ui.components.JBTextField;
+import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.text.DateFormatUtil;
import com.intellij.util.ui.AsyncProcessIcon;
import com.intellij.util.ui.UIUtil;
@@ -146,7 +147,7 @@
@NotNull
private List<VcsRef> sortRefs(@NotNull Hash hash, @NotNull VirtualFile root) {
Collection<VcsRef> refs = myDataPack.getRefsModel().refsToCommit(hash);
- return myLogDataHolder.getLogProvider(root).getReferenceManager().sort(refs);
+ return ContainerUtil.sorted(refs, myLogDataHolder.getLogProvider(root).getReferenceManager().getComparator());
}
private static class DataPanel extends JEditorPane {
diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java
index 11e9c84..f033f75 100644
--- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java
+++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2000-2014 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.vcs.log.ui.frame;
import com.intellij.ide.CopyProvider;
@@ -175,7 +190,7 @@
}
@Override
- protected void paintComponent(Graphics g) {
+ protected void paintComponent(@NotNull Graphics g) {
if (myRepaintFreezedCounter.get() > 0) {
return;
}
diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/AbstractPaddingCellRender.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/AbstractPaddingCellRender.java
index 973252d..23c736b 100644
--- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/AbstractPaddingCellRender.java
+++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/AbstractPaddingCellRender.java
@@ -107,7 +107,7 @@
return Collections.emptyMap();
}
VirtualFile root = refs.iterator().next().getRoot(); // all refs are from the same commit => they have the same root
- refs = myDataHolder.getLogProvider(root).getReferenceManager().sort(refs);
+ refs = ContainerUtil.sorted(refs, myDataHolder.getLogProvider(root).getReferenceManager().getComparator());
List<VcsRef> branches = getBranches(refs);
Collection<VcsRef> tags = ContainerUtil.subtract(refs, branches);
return getLabelsForRefs(branches, tags);
diff --git a/platform/vcs-log/impl/test/com/intellij/vcs/log/impl/TestVcsLogProvider.java b/platform/vcs-log/impl/test/com/intellij/vcs/log/impl/TestVcsLogProvider.java
index 08fae0c..d3709b2 100644
--- a/platform/vcs-log/impl/test/com/intellij/vcs/log/impl/TestVcsLogProvider.java
+++ b/platform/vcs-log/impl/test/com/intellij/vcs/log/impl/TestVcsLogProvider.java
@@ -27,6 +27,7 @@
import java.awt.*;
import java.util.Collection;
+import java.util.Comparator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Semaphore;
@@ -200,8 +201,13 @@
private static class MockRefManager implements VcsLogRefManager {
@NotNull
@Override
- public List<VcsRef> sort(Collection<VcsRef> refs) {
- return ContainerUtil.newArrayList(refs);
+ public Comparator<VcsRef> getComparator() {
+ return new Comparator<VcsRef>() {
+ @Override
+ public int compare(VcsRef o1, VcsRef o2) {
+ return 0;
+ }
+ };
}
@NotNull
diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerBundle.java b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerBundle.java
index a9594ca..23a262c 100644
--- a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerBundle.java
+++ b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerBundle.java
@@ -29,7 +29,6 @@
* @author nik
*/
public class XDebuggerBundle {
-
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
}
diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointType.java b/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointType.java
index a6857c6..4f9ff38 100644
--- a/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointType.java
+++ b/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointType.java
@@ -103,6 +103,16 @@
return AllIcons.Debugger.Db_disabled_breakpoint;
}
+ @NotNull
+ public Icon getMutedEnabledIcon() {
+ return AllIcons.Debugger.Db_muted_breakpoint;
+ }
+
+ @NotNull
+ public Icon getMutedDisabledIcon() {
+ return AllIcons.Debugger.Db_muted_disabled_breakpoint;
+ }
+
/**
* @return the icon which is shown for a dependent breakpoint until its master breakpoint is reached
*/
diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/evaluation/XDebuggerEvaluator.java b/platform/xdebugger-api/src/com/intellij/xdebugger/evaluation/XDebuggerEvaluator.java
index 3065a2e..098501a 100644
--- a/platform/xdebugger-api/src/com/intellij/xdebugger/evaluation/XDebuggerEvaluator.java
+++ b/platform/xdebugger-api/src/com/intellij/xdebugger/evaluation/XDebuggerEvaluator.java
@@ -26,6 +26,7 @@
import com.intellij.xdebugger.frame.XSuspendContext;
import com.intellij.xdebugger.frame.XValue;
import com.intellij.xdebugger.frame.XValueCallback;
+import com.intellij.xdebugger.settings.XDebuggerSettingsManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -167,7 +168,7 @@
* @return delay before showing value tooltip (in ms)
*/
public int getValuePopupDelay() {
- return 700;
+ return XDebuggerSettingsManager.getInstance().getDataViewSettings().getValueLookupDelay();
}
public interface XEvaluationCallback extends XValueCallback {
diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/settings/XDebuggerSettings.java b/platform/xdebugger-api/src/com/intellij/xdebugger/settings/XDebuggerSettings.java
index e3b101d..52049f7 100644
--- a/platform/xdebugger-api/src/com/intellij/xdebugger/settings/XDebuggerSettings.java
+++ b/platform/xdebugger-api/src/com/intellij/xdebugger/settings/XDebuggerSettings.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -19,8 +19,9 @@
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.options.Configurable;
import com.intellij.xdebugger.XDebuggerUtil;
-import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Implement this class to provide settings page for debugger. Settings page will be placed under 'Debugger' node in the 'Settings' dialog.
@@ -29,11 +30,16 @@
* <extensions defaultExtensionNs="com.intellij"><br>
* <xdebugger.settings implementation="qualified-class-name"/><br>
* </extensions>
- *
+ *
* @author nik
*/
public abstract class XDebuggerSettings<T> implements PersistentStateComponent<T> {
+ public enum Category {
+ ROOT, DATA_VIEWS, STEPPING
+ }
+
public static final ExtensionPointName<XDebuggerSettings> EXTENSION_POINT = ExtensionPointName.create("com.intellij.xdebugger.settings");
+
private final String myId;
protected XDebuggerSettings(final @NotNull @NonNls String id) {
@@ -48,6 +54,16 @@
return myId;
}
- @NotNull
- public abstract Configurable createConfigurable();
+ @Nullable
+ public Configurable createConfigurable() {
+ return null;
+ }
+
+ @Nullable
+ public Configurable createConfigurable(@NotNull Category category) {
+ return null;
+ }
+
+ public void generalApplied(@NotNull Category category) {
+ }
}
diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/settings/XDebuggerSettingsManager.java b/platform/xdebugger-api/src/com/intellij/xdebugger/settings/XDebuggerSettingsManager.java
new file mode 100644
index 0000000..2fa473d
--- /dev/null
+++ b/platform/xdebugger-api/src/com/intellij/xdebugger/settings/XDebuggerSettingsManager.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2014 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.settings;
+
+import com.intellij.openapi.components.ServiceManager;
+import org.jetbrains.annotations.NotNull;
+
+public abstract class XDebuggerSettingsManager {
+ public static XDebuggerSettingsManager getInstance() {
+ return ServiceManager.getService(XDebuggerSettingsManager.class);
+ }
+
+ public interface DataViewSettings {
+ boolean isSortValues();
+
+ boolean isAutoExpressions();
+
+ int getValueLookupDelay();
+ }
+
+ @NotNull
+ public abstract DataViewSettings getDataViewSettings();
+}
\ No newline at end of file
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/DebuggerSupport.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/DebuggerSupport.java
index 82c0522..840163b 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/DebuggerSupport.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/DebuggerSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -36,6 +36,9 @@
public abstract class DebuggerSupport {
private static final ExtensionPointName<DebuggerSupport> EXTENSION_POINT = ExtensionPointName.create("com.intellij.xdebugger.debuggerSupport");
+ private static final DebuggerSettingsPanelProvider EMPTY_SETTINGS_PANEL_PROVIDER = new DebuggerSettingsPanelProvider() {
+ };
+
protected static final class DisabledActionHandler extends DebuggerActionHandler {
public static final DisabledActionHandler INSTANCE = new DisabledActionHandler();
@@ -58,7 +61,9 @@
public abstract BreakpointPanelProvider<?> getBreakpointPanelProvider();
@NotNull
- public abstract DebuggerSettingsPanelProvider getSettingsPanelProvider();
+ public DebuggerSettingsPanelProvider getSettingsPanelProvider() {
+ return EMPTY_SETTINGS_PANEL_PROVIDER;
+ }
@NotNull
public abstract DebuggerActionHandler getStepOverHandler();
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java
index bdedcc2..9ab13ba 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java
@@ -865,7 +865,7 @@
if (myValueMarkers != null) {
myValueMarkers.clear();
}
- if (XDebuggerSettingsManager.getInstance().getGeneralSettings().isUnmuteOnStop()) {
+ if (XDebuggerSettingsManager.getInstanceImpl().getGeneralSettings().isUnmuteOnStop()) {
mySessionData.setBreakpointsMuted(false);
}
myStopped = true;
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java
index eee1f28..b974150 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java
@@ -17,6 +17,7 @@
import com.intellij.AppTopics;
import com.intellij.execution.ExecutionException;
+import com.intellij.execution.ExecutionManager;
import com.intellij.execution.Executor;
import com.intellij.execution.executors.DefaultDebugExecutor;
import com.intellij.execution.process.ProcessHandler;
@@ -27,6 +28,7 @@
import com.intellij.execution.ui.RunContentManagerImpl;
import com.intellij.execution.ui.RunContentWithExecutorListener;
import com.intellij.openapi.Disposable;
+import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.*;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.markup.GutterIconRenderer;
@@ -45,6 +47,7 @@
import com.intellij.xdebugger.breakpoints.XLineBreakpoint;
import com.intellij.xdebugger.impl.breakpoints.XBreakpointBase;
import com.intellij.xdebugger.impl.breakpoints.XBreakpointManagerImpl;
+import com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager;
import com.intellij.xdebugger.impl.ui.ExecutionPointHighlighter;
import com.intellij.xdebugger.impl.ui.XDebugSessionData;
import com.intellij.xdebugger.impl.ui.XDebugSessionTab;
@@ -245,6 +248,10 @@
mySessions.remove(session.getDebugProcess().getProcessHandler());
}
});
+
+ if (!myProject.isDisposed() && !ApplicationManager.getApplication().isUnitTestMode() && XDebuggerSettingsManager.getInstanceImpl().getGeneralSettings().isHideDebuggerOnProcessTermination()) {
+ ExecutionManager.getInstance(myProject).getContentManager().hideRunContent(DefaultDebugExecutor.getDebugExecutorInstance(), descriptor);
+ }
}
if (myActiveSession == session) {
myActiveSession = null;
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java
index 6db46f5..8e51cef 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java
@@ -156,7 +156,7 @@
@Override
public <T extends XDebuggerSettings<?>> T getDebuggerSettings(Class<T> aClass) {
- return XDebuggerSettingsManager.getInstance().getSettings(aClass);
+ return XDebuggerSettingsManager.getInstanceImpl().getSettings(aClass);
}
@Override
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/UnmuteOnStopAction.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/UnmuteOnStopAction.java
index 79cef65..e9f3699 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/UnmuteOnStopAction.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/UnmuteOnStopAction.java
@@ -26,11 +26,11 @@
public class UnmuteOnStopAction extends ToggleAction implements DumbAware {
@Override
public boolean isSelected(AnActionEvent e) {
- return XDebuggerSettingsManager.getInstance().getGeneralSettings().isUnmuteOnStop();
+ return XDebuggerSettingsManager.getInstanceImpl().getGeneralSettings().isUnmuteOnStop();
}
@Override
public void setSelected(AnActionEvent e, boolean state) {
- XDebuggerSettingsManager.getInstance().getGeneralSettings().setUnmuteOnStop(state);
+ XDebuggerSettingsManager.getInstanceImpl().getGeneralSettings().setUnmuteOnStop(state);
}
}
\ No newline at end of file
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/BreakpointState.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/BreakpointState.java
index 8631b8f..364353c 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/BreakpointState.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/BreakpointState.java
@@ -156,11 +156,11 @@
}
public boolean isLogExpressionEnabled() {
- return myLogExpression == null || !myLogExpression.myDisabled;
+ return myLogExpression != null && !myLogExpression.myDisabled;
}
public boolean isConditionEnabled() {
- return myCondition == null || !myCondition.myDisabled;
+ return myCondition != null && !myCondition.myDisabled;
}
@Property(surroundWithTag = false)
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointBase.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointBase.java
index 6184ad9..ddf673f 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointBase.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointBase.java
@@ -192,6 +192,7 @@
@Override
public void setLogExpression(@Nullable final String expression) {
+ setLogExpressionEnabled(true);
if (!Comparing.equal(getLogExpression(), expression)) {
myLogExpression = XExpressionImpl.fromText(expression);
fireBreakpointChanged();
@@ -210,6 +211,7 @@
@Override
public void setLogExpressionObject(@Nullable XExpression expression) {
+ setLogExpressionEnabled(true);
if (!Comparing.equal(myLogExpression, expression)) {
myLogExpression = expression;
fireBreakpointChanged();
@@ -224,6 +226,7 @@
@Override
public void setCondition(@Nullable final String condition) {
+ setConditionEnabled(true);
if (!Comparing.equal(condition, getCondition())) {
myCondition = XExpressionImpl.fromText(condition);
fireBreakpointChanged();
@@ -242,6 +245,7 @@
@Override
public void setConditionExpression(@Nullable XExpression condition) {
+ setConditionEnabled(true);
if (!Comparing.equal(condition, myCondition)) {
myCondition = condition;
fireBreakpointChanged();
@@ -387,13 +391,18 @@
@Nullable
protected final Icon calculateSpecialIcon() {
+ XDebugSessionImpl session = getBreakpointManager().getDebuggerManager().getCurrentSession();
if (!isEnabled()) {
// disabled icon takes precedence to other to visually distinguish it and provide feedback then it is enabled/disabled
// (e.g. in case of mute-mode we would like to differentiate muted but enabled breakpoints from simply disabled ones)
- return getType().getDisabledIcon();
+ if (session == null || !session.areBreakpointsMuted()) {
+ return getType().getDisabledIcon();
+ }
+ else {
+ return getType().getMutedDisabledIcon();
+ }
}
- XDebugSessionImpl session = getBreakpointManager().getDebuggerManager().getCurrentSession();
if (session == null) {
if (getBreakpointManager().getDependentBreakpointManager().getMasterBreakpoint(this) != null) {
return getType().getInactiveDependentIcon();
@@ -401,7 +410,7 @@
}
else {
if (session.areBreakpointsMuted()) {
- return AllIcons.Debugger.Db_muted_breakpoint;
+ return getType().getMutedEnabledIcon();
}
if (session.isInactiveSlaveBreakpoint(this)) {
return getType().getInactiveDependentIcon();
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java
index d86970b..e2ce9ca 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java
@@ -90,8 +90,9 @@
RangeHighlighterEx highlighter = myHighlighter;
if (highlighter != null &&
- (!highlighter.isValid() ||
- highlighter.getStartOffset() >= document.getTextLength()
+ (!highlighter.isValid()
+ || highlighter.getStartOffset() >= document.getTextLength()
+ || !Comparing.equal(highlighter.getTextAttributes(), attributes)
// it seems that this check is not needed - we always update line number from the highlighter
// and highlighter is removed on line and file change anyway
/*|| document.getLineNumber(highlighter.getStartOffset()) != getLine()*/)) {
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointManager.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointManager.java
index e2252ea..098b640 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointManager.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointManager.java
@@ -118,14 +118,7 @@
// Update breakpoints colors if global color schema was changed
final EditorColorsManager colorsManager = EditorColorsManager.getInstance();
if (colorsManager != null) { // in some debugger tests EditorColorsManager component isn't loaded
- final MyEditorColorsListener myColorsSchemeListener = new MyEditorColorsListener();
- Disposer.register(project, new Disposable() {
- @Override
- public void dispose() {
- colorsManager.removeEditorColorsListener(myColorsSchemeListener);
- }
- });
- colorsManager.addEditorColorsListener(myColorsSchemeListener);
+ colorsManager.addEditorColorsListener(new MyEditorColorsListener(), project);
}
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XBreakpointActionsPanel.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XBreakpointActionsPanel.java
index 0f98bce..6ee8ead 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XBreakpointActionsPanel.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XBreakpointActionsPanel.java
@@ -114,9 +114,10 @@
}
if (myLogExpressionComboBox != null) {
- myBreakpoint.setLogExpressionEnabled(myLogExpressionCheckBox.isSelected());
XExpression expression = myLogExpressionComboBox.getExpression();
- myBreakpoint.setLogExpressionObject(!XDebuggerUtilImpl.isEmptyExpression(expression) ? expression : null);
+ XExpression logExpression = !XDebuggerUtilImpl.isEmptyExpression(expression) ? expression : null;
+ myBreakpoint.setLogExpressionEnabled(myLogExpressionCheckBox.isSelected() && logExpression != null);
+ myBreakpoint.setLogExpressionObject(logExpression);
myLogExpressionComboBox.saveTextInHistory();
}
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XLightBreakpointPropertiesPanel.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XLightBreakpointPropertiesPanel.java
index 9f869ac..0e847d7 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XLightBreakpointPropertiesPanel.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XLightBreakpointPropertiesPanel.java
@@ -206,9 +206,10 @@
}
if (myConditionComboBox != null) {
- myBreakpoint.setConditionEnabled(myConditionEnabledCheckbox.isSelected());
XExpression expression = myConditionComboBox.getExpression();
- myBreakpoint.setConditionExpression(!XDebuggerUtilImpl.isEmptyExpression(expression) ? expression : null);
+ XExpression condition = !XDebuggerUtilImpl.isEmptyExpression(expression) ? expression : null;
+ myBreakpoint.setConditionEnabled(myConditionEnabledCheckbox.isSelected() && condition != null);
+ myBreakpoint.setConditionExpression(condition);
myConditionComboBox.saveTextInHistory();
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/ExpressionInputComponent.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/ExpressionInputComponent.java
index a272cb3..15a8bf6 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/ExpressionInputComponent.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/ExpressionInputComponent.java
@@ -16,6 +16,9 @@
package com.intellij.xdebugger.impl.evaluate;
import com.intellij.openapi.project.Project;
+import com.intellij.ui.IdeBorderFactory;
+import com.intellij.ui.components.JBLabel;
+import com.intellij.util.ui.UIUtil;
import com.intellij.xdebugger.XDebuggerBundle;
import com.intellij.xdebugger.XExpression;
import com.intellij.xdebugger.XSourcePosition;
@@ -53,6 +56,11 @@
public void addComponent(JPanel contentPanel, JPanel resultPanel) {
contentPanel.add(resultPanel, BorderLayout.CENTER);
contentPanel.add(myMainPanel, BorderLayout.NORTH);
+ final JBLabel hint = new JBLabel(XDebuggerBundle.message("xdebugger.evaluate.addtowatches.hint"), SwingConstants.RIGHT);
+ hint.setBorder(IdeBorderFactory.createEmptyBorder(2, 0, 6, 0));
+ hint.setComponentStyle(UIUtil.ComponentStyle.SMALL);
+ hint.setFontColor(UIUtil.FontColor.BRIGHTER);
+ contentPanel.add(hint, BorderLayout.SOUTH);
}
protected XDebuggerEditorBase getInputEditor() {
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/XDebuggerEvaluationDialog.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/XDebuggerEvaluationDialog.java
index 2ad50e1..2273ab69 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/XDebuggerEvaluationDialog.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/XDebuggerEvaluationDialog.java
@@ -21,6 +21,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.text.StringUtil;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.xdebugger.*;
@@ -28,26 +29,23 @@
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider;
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator;
import com.intellij.xdebugger.impl.XDebugSessionImpl;
+import com.intellij.xdebugger.impl.XDebuggerUtilImpl;
import com.intellij.xdebugger.impl.actions.XDebuggerActions;
import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl;
import com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager;
import com.intellij.xdebugger.impl.ui.XDebuggerEditorBase;
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
-import com.intellij.xdebugger.impl.ui.tree.XDebuggerTreeListener;
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTreePanel;
import com.intellij.xdebugger.impl.ui.tree.nodes.EvaluatingExpressionRootNode;
-import com.intellij.xdebugger.impl.ui.tree.nodes.RestorableStateNode;
-import com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode;
-import com.intellij.xdebugger.impl.ui.tree.nodes.XValueContainerNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
+import javax.swing.tree.TreeNode;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
-import java.util.List;
/**
* @author nik
@@ -98,12 +96,6 @@
mySwitchModeAction = new SwitchModeAction();
- new AnAction(){
- @Override
- public void actionPerformed(AnActionEvent e) {
- doOKAction();
- }
- }.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_DOWN_MASK)), getRootPane(), myDisposable);
new AnAction() {
@Override
public void actionPerformed(AnActionEvent e) {
@@ -112,9 +104,14 @@
}.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.ALT_DOWN_MASK)), getRootPane(),
myDisposable);
- myTreePanel.getTree().addTreeListener(new MyTreeListener());
+ myTreePanel.getTree().expandNodesOnLoad(new Condition<TreeNode>() {
+ @Override
+ public boolean value(TreeNode node) {
+ return node.getParent() instanceof EvaluatingExpressionRootNode;
+ }
+ });
- EvaluationMode mode = XDebuggerSettingsManager.getInstance().getGeneralSettings().getEvaluationDialogMode();
+ EvaluationMode mode = XDebuggerSettingsManager.getInstanceImpl().getGeneralSettings().getEvaluationDialogMode();
myIsCodeFragmentEvaluationSupported = evaluator.isCodeFragmentEvaluationSupported();
if (mode == EvaluationMode.CODE_FRAGMENT && !myIsCodeFragmentEvaluationSupported) {
mode = EvaluationMode.EXPRESSION;
@@ -131,6 +128,23 @@
evaluate();
}
+ protected void createDefaultActions() {
+ super.createDefaultActions();
+ myOKAction = new OkAction(){
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ super.actionPerformed(e);
+ if (myMode == EvaluationMode.EXPRESSION && ((e.getModifiers() & InputEvent.CTRL_MASK) != 0)) {
+ // add to watches
+ XExpression expression = myInputComponent.getInputEditor().getExpression();
+ if (!XDebuggerUtilImpl.isEmptyExpression(expression)) {
+ ((XDebugSessionImpl)mySession).getSessionTab().getWatchesView().addWatchExpression(expression, -1, false);
+ }
+ }
+ }
+ };
+ }
+
@NotNull
@Override
protected Action[] createActions() {
@@ -171,7 +185,7 @@
private void switchToMode(EvaluationMode mode, XExpression text) {
if (myMode == mode) return;
- XDebuggerSettingsManager.getInstance().getGeneralSettings().setEvaluationDialogMode(mode);
+ XDebuggerSettingsManager.getInstanceImpl().getGeneralSettings().setEvaluationDialogMode(mode);
myMode = mode;
@@ -227,25 +241,6 @@
}
}
- private class MyTreeListener implements XDebuggerTreeListener {
- @Override
- public void nodeLoaded(@NotNull RestorableStateNode node, String name) {
- if (node.getParent() instanceof EvaluatingExpressionRootNode) {
- if (!node.isLeaf()) {
- // cause children computing
- node.getChildCount();
- }
- }
- }
-
- @Override
- public void childrenLoaded(@NotNull XDebuggerTreeNode node, @NotNull List<XValueContainerNode<?>> children, boolean last) {
- if (node.getParent() instanceof EvaluatingExpressionRootNode) {
- myTreePanel.getTree().expandPath(node.getPath());
- }
- }
- }
-
@Override
protected String getDimensionServiceKey() {
return "#xdebugger.evaluate";
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XDebuggerTreeCreator.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XDebuggerTreeCreator.java
index 8f53dba..c07b140 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XDebuggerTreeCreator.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XDebuggerTreeCreator.java
@@ -17,6 +17,7 @@
import com.intellij.concurrency.ResultConsumer;
import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Pair;
import com.intellij.ui.treeStructure.Tree;
import com.intellij.xdebugger.XSourcePosition;
@@ -26,14 +27,10 @@
import com.intellij.xdebugger.impl.evaluate.quick.common.DebuggerTreeCreator;
import com.intellij.xdebugger.impl.frame.XValueMarkers;
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
-import com.intellij.xdebugger.impl.ui.tree.XDebuggerTreeListener;
-import com.intellij.xdebugger.impl.ui.tree.nodes.RestorableStateNode;
-import com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode;
-import com.intellij.xdebugger.impl.ui.tree.nodes.XValueContainerNode;
import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl;
import org.jetbrains.annotations.NotNull;
-import java.util.List;
+import javax.swing.tree.TreeNode;
public class XDebuggerTreeCreator implements DebuggerTreeCreator<Pair<XValue,String>> {
@NotNull private final Project myProject;
@@ -56,19 +53,10 @@
final XValueNodeImpl root = new XValueNodeImpl(tree, null, descriptor.getSecond(), descriptor.getFirst());
tree.setRoot(root, true);
// expand root on load
- tree.addTreeListener(new XDebuggerTreeListener() {
+ tree.expandNodesOnLoad(new Condition<TreeNode>() {
@Override
- public void nodeLoaded(@NotNull RestorableStateNode node, String name) {
- if (node == root && !node.isLeaf()) {
- node.getChildCount();
- }
- }
-
- @Override
- public void childrenLoaded(@NotNull XDebuggerTreeNode node, @NotNull List<XValueContainerNode<?>> children, boolean last) {
- if (node == root) {
- tree.expandPath(node.getPath());
- }
+ public boolean value(TreeNode node) {
+ return node == root;
}
});
return tree;
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XQuickEvaluateHandler.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XQuickEvaluateHandler.java
index 1669e10..bf3e001 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XQuickEvaluateHandler.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XQuickEvaluateHandler.java
@@ -29,6 +29,7 @@
import com.intellij.xdebugger.impl.evaluate.quick.common.AbstractValueHint;
import com.intellij.xdebugger.impl.evaluate.quick.common.QuickEvaluateHandler;
import com.intellij.xdebugger.impl.evaluate.quick.common.ValueHintType;
+import com.intellij.xdebugger.settings.XDebuggerSettingsManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -107,6 +108,6 @@
return evaluator.getValuePopupDelay();
}
}
- return 700;
+ return XDebuggerSettingsManager.getInstance().getDataViewSettings().getValueLookupDelay();
}
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DataViewsConfigurable.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DataViewsConfigurable.java
new file mode 100644
index 0000000..d140a74
--- /dev/null
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DataViewsConfigurable.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2014 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.settings;
+
+import com.intellij.openapi.options.Configurable;
+import com.intellij.xdebugger.XDebuggerBundle;
+import com.intellij.xdebugger.settings.XDebuggerSettings;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+
+class DataViewsConfigurable extends SubCompositeConfigurable implements Configurable.NoScroll {
+ @NotNull
+ @Override
+ public String getId() {
+ return "debugger.dataViews";
+ }
+
+ @Nls
+ @Override
+ public String getDisplayName() {
+ return XDebuggerBundle.message("debugger.dataViews.display.name");
+ }
+
+ @Override
+ protected DataViewsConfigurableUi createRootUi() {
+ return new DataViewsConfigurableUi();
+ }
+
+ @NotNull
+ @Override
+ protected XDebuggerSettings.Category getCategory() {
+ return XDebuggerSettings.Category.DATA_VIEWS;
+ }
+
+ @NotNull
+ @Override
+ protected XDebuggerDataViewSettings getSettings() {
+ return XDebuggerSettingsManager.getInstanceImpl().getDataViewSettings();
+ }
+}
\ No newline at end of file
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DataViewsConfigurableUi.form b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DataViewsConfigurableUi.form
new file mode 100644
index 0000000..a6e3f94
--- /dev/null
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DataViewsConfigurableUi.form
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.xdebugger.impl.settings.DataViewsConfigurableUi">
+ <grid id="27dc6" binding="panel" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <xy x="20" y="20" width="500" height="400"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <vspacer id="4eb98">
+ <constraints>
+ <grid row="3" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+ </constraints>
+ </vspacer>
+ <component id="9a000" class="javax.swing.JLabel">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text resource-bundle="messages/XDebuggerBundle" key="setting.value.tooltip.delay.label"/>
+ </properties>
+ </component>
+ <component id="fdcd5" class="javax.swing.JFormattedTextField" binding="valueTooltipDelayTextField">
+ <constraints>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <columns value="4"/>
+ </properties>
+ </component>
+ <component id="98130" class="javax.swing.JCheckBox" binding="enableAutoExpressionsCheckBox">
+ <constraints>
+ <grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text resource-bundle="messages/XDebuggerBundle" key="setting.enable.auto.expressions.label"/>
+ </properties>
+ </component>
+ <component id="a57b4" class="javax.swing.JCheckBox" binding="sortAlphabeticallyCheckBox" default-binding="true">
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text resource-bundle="messages/XDebuggerBundle" key="setting.sort.alphabetically.label"/>
+ </properties>
+ </component>
+ </children>
+ </grid>
+</form>
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DataViewsConfigurableUi.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DataViewsConfigurableUi.java
new file mode 100644
index 0000000..76645db
--- /dev/null
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DataViewsConfigurableUi.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2000-2014 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.settings;
+
+import com.intellij.openapi.util.text.StringUtilRt;
+import com.intellij.util.ui.UIUtil;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+public class DataViewsConfigurableUi {
+ private JCheckBox enableAutoExpressionsCheckBox;
+ private JFormattedTextField valueTooltipDelayTextField;
+ private JPanel panel;
+ private JCheckBox sortAlphabeticallyCheckBox;
+
+ public DataViewsConfigurableUi() {
+ UIUtil.configureNumericFormattedTextField(valueTooltipDelayTextField);
+ }
+
+ private int getValueTooltipDelay() {
+ Object value = valueTooltipDelayTextField.getValue();
+ return value instanceof Number ? ((Number)value).intValue() : StringUtilRt.parseInt((String)value, XDebuggerDataViewSettings.DEFAULT_VALUE_TOOLTIP_DELAY);
+ }
+
+ @NotNull
+ public JComponent getComponent() {
+ return panel;
+ }
+
+ public boolean isModified(@NotNull XDebuggerDataViewSettings settings) {
+ return getValueTooltipDelay() != settings.getValueLookupDelay() ||
+ sortAlphabeticallyCheckBox.isSelected() != settings.isSortValues() ||
+ enableAutoExpressionsCheckBox.isSelected() != settings.isAutoExpressions();
+ }
+
+ public void reset(@NotNull XDebuggerDataViewSettings settings) {
+ valueTooltipDelayTextField.setValue(settings.getValueLookupDelay());
+ sortAlphabeticallyCheckBox.setSelected(settings.isSortValues());
+ enableAutoExpressionsCheckBox.setSelected(settings.isAutoExpressions());
+ }
+
+ public void apply(@NotNull XDebuggerDataViewSettings settings) {
+ settings.setValueLookupDelay(getValueTooltipDelay());
+ settings.setSortValues(sortAlphabeticallyCheckBox.isSelected());
+ settings.setAutoExpressions(enableAutoExpressionsCheckBox.isSelected());
+ }
+}
\ No newline at end of file
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurable.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurable.java
index ae0b71e..a3f4e84 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurable.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurable.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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,12 +18,19 @@
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SearchableConfigurable;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.SmartList;
import com.intellij.xdebugger.XDebuggerBundle;
import com.intellij.xdebugger.impl.DebuggerSupport;
+import com.intellij.xdebugger.settings.XDebuggerSettings;
+import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import javax.swing.*;
+import java.util.Arrays;
+import java.util.Comparator;
import java.util.List;
/**
@@ -31,26 +38,118 @@
*/
public class DebuggerConfigurable implements SearchableConfigurable.Parent {
public static final String DISPLAY_NAME = XDebuggerBundle.message("debugger.configurable.display.name");
+
+ static final Configurable[] EMPTY_CONFIGURABLES = new Configurable[0];
+
private Configurable myRootConfigurable;
private Configurable[] myChildren;
- public DebuggerConfigurable(Configurable rootConfigurable, List<Configurable> children) {
- myRootConfigurable = rootConfigurable;
- myChildren = children.toArray(new Configurable[children.size()]);
- }
-
+ @Override
public String getDisplayName() {
return DISPLAY_NAME;
}
+ @Override
public String getHelpTopic() {
- return myRootConfigurable != null? myRootConfigurable.getHelpTopic() : null;
+ return myRootConfigurable != null ? myRootConfigurable.getHelpTopic() : null;
}
+ @Override
public Configurable[] getConfigurables() {
- return myChildren;
+ compute();
+
+ if (myChildren.length == 0 && myRootConfigurable instanceof SearchableConfigurable.Parent) {
+ return ((Parent)myRootConfigurable).getConfigurables();
+ }
+ else {
+ return myChildren;
+ }
}
+ private void compute() {
+ if (myChildren != null) {
+ return;
+ }
+
+ List<DebuggerSettingsPanelProvider> providers = DebuggerConfigurableProvider.getSortedProviders();
+
+ List<Configurable> configurables = new SmartList<Configurable>();
+ configurables.add(new DataViewsConfigurable());
+
+ List<Configurable> steppingConfigurables = DebuggerConfigurableProvider.getConfigurables(XDebuggerSettings.Category.STEPPING, providers);
+ if (!steppingConfigurables.isEmpty()) {
+ configurables.add(new SteppingConfigurable(steppingConfigurables));
+ }
+
+ Configurable rootConfigurable = computeRootConfigurable(providers, configurables);
+
+ if (configurables.isEmpty() && rootConfigurable == null) {
+ myChildren = EMPTY_CONFIGURABLES;
+ }
+ else if (rootConfigurable == null && configurables.size() == 1) {
+ myRootConfigurable = configurables.get(0);
+ myChildren = EMPTY_CONFIGURABLES;
+ }
+ else {
+ myChildren = configurables.toArray(new Configurable[configurables.size()]);
+ myRootConfigurable = rootConfigurable;
+ }
+ }
+
+ @Nullable
+ private static Configurable computeRootConfigurable(@NotNull List<DebuggerSettingsPanelProvider> providers, @NotNull List<Configurable> configurables) {
+ Configurable deprecatedRootConfigurable = null;
+ for (DebuggerSettingsPanelProvider provider : providers) {
+ configurables.addAll(provider.getConfigurables());
+ @SuppressWarnings("deprecation")
+ Configurable providerRootConfigurable = provider.getRootConfigurable();
+ if (providerRootConfigurable != null) {
+ if (deprecatedRootConfigurable == null) {
+ deprecatedRootConfigurable = providerRootConfigurable;
+ }
+ else {
+ configurables.add(providerRootConfigurable);
+ }
+ }
+ }
+
+ List<Configurable> rootConfigurables = DebuggerConfigurableProvider.getConfigurables(XDebuggerSettings.Category.ROOT, providers);
+ if (rootConfigurables.isEmpty()) {
+ return deprecatedRootConfigurable;
+ }
+ else {
+ Configurable[] mergedRootConfigurables = new Configurable[rootConfigurables.size() + (deprecatedRootConfigurable == null ? 0 : 1)];
+ rootConfigurables.toArray(mergedRootConfigurables);
+ if (deprecatedRootConfigurable != null) {
+ mergedRootConfigurables[rootConfigurables.size()] = deprecatedRootConfigurable;
+ }
+
+ // move unnamed to top
+ Arrays.sort(mergedRootConfigurables, new Comparator<Configurable>() {
+ @Override
+ public int compare(Configurable o1, Configurable o2) {
+ boolean c1e = StringUtil.isEmpty(o1.getDisplayName());
+ return c1e == StringUtil.isEmpty(o2.getDisplayName()) ? 0 : (c1e ? -1 : 1);
+ }
+ });
+
+ return new MergedCompositeConfigurable(mergedRootConfigurables) {
+ @NotNull
+ @Override
+ public String getId() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Nls
+ @Override
+ public String getDisplayName() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+ }
+
+ @Override
public void apply() throws ConfigurationException {
for (DebuggerSupport support : DebuggerSupport.getDebuggerSupports()) {
support.getSettingsPanelProvider().apply();
@@ -60,38 +159,48 @@
}
}
+ @Override
public boolean hasOwnContent() {
+ compute();
return myRootConfigurable != null;
}
+ @Override
public boolean isVisible() {
return true;
}
+ @Override
public Runnable enableSearch(final String option) {
return null;
}
+ @Override
public JComponent createComponent() {
+ compute();
return myRootConfigurable != null ? myRootConfigurable.createComponent() : null;
}
+ @Override
public boolean isModified() {
return myRootConfigurable != null && myRootConfigurable.isModified();
}
+ @Override
public void reset() {
if (myRootConfigurable != null) {
myRootConfigurable.reset();
}
}
+ @Override
public void disposeUIResources() {
if (myRootConfigurable != null) {
myRootConfigurable.disposeUIResources();
}
}
+ @Override
@NotNull
@NonNls
public String getId() {
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurableProvider.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurableProvider.java
index 49e2e4a..80651ca 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurableProvider.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerConfigurableProvider.java
@@ -17,10 +17,13 @@
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurableProvider;
-import com.intellij.util.PlatformUtils;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
import com.intellij.xdebugger.impl.DebuggerSupport;
+import com.intellij.xdebugger.settings.XDebuggerSettings;
+import org.jetbrains.annotations.NotNull;
-import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@@ -29,46 +32,55 @@
* @author nik
*/
public class DebuggerConfigurableProvider extends ConfigurableProvider {
+ @NotNull
+ static List<DebuggerSettingsPanelProvider> getSortedProviders() {
+ List<DebuggerSettingsPanelProvider> providers = null;
+ for (DebuggerSupport support : DebuggerSupport.getDebuggerSupports()) {
+ DebuggerSettingsPanelProvider provider = support.getSettingsPanelProvider();
+ if (providers == null) {
+ providers = new SmartList<DebuggerSettingsPanelProvider>();
+ }
+ providers.add(provider);
+ }
+
+ if (ContainerUtil.isEmpty(providers)) {
+ return Collections.emptyList();
+ }
+
+ if (providers.size() > 1) {
+ Collections.sort(providers, new Comparator<DebuggerSettingsPanelProvider>() {
+ @Override
+ public int compare(DebuggerSettingsPanelProvider o1, DebuggerSettingsPanelProvider o2) {
+ return o2.getPriority() - o1.getPriority();
+ }
+ });
+ }
+ return providers;
+ }
+
@Override
public Configurable createConfigurable() {
- final List<DebuggerSettingsPanelProvider> providers = new ArrayList<DebuggerSettingsPanelProvider>();
- final DebuggerSupport[] supports = DebuggerSupport.getDebuggerSupports();
- for (DebuggerSupport support : supports) {
- providers.add(support.getSettingsPanelProvider());
- }
+ return new DebuggerConfigurable();
+ }
- List<Configurable> configurables = new ArrayList<Configurable>();
- Collections.sort(providers, new Comparator<DebuggerSettingsPanelProvider>() {
- public int compare(final DebuggerSettingsPanelProvider o1, final DebuggerSettingsPanelProvider o2) {
- return o2.getPriority() - o1.getPriority();
- }
- });
+ @NotNull
+ static List<Configurable> getConfigurables(@NotNull XDebuggerSettings.Category category) {
+ List<DebuggerSettingsPanelProvider> providers = getSortedProviders();
+ return providers.isEmpty() ? Collections.<Configurable>emptyList() : getConfigurables(category, providers);
+ }
- Configurable rootConfigurable = null;
+ @NotNull
+ static List<Configurable> getConfigurables(@NotNull XDebuggerSettings.Category category, @NotNull List<DebuggerSettingsPanelProvider> providers) {
+ List<Configurable> configurables = null;
for (DebuggerSettingsPanelProvider provider : providers) {
- configurables.addAll(provider.getConfigurables());
- final Configurable aRootConfigurable = provider.getRootConfigurable();
- if (aRootConfigurable != null) {
- if (rootConfigurable != null) {
- configurables.add(aRootConfigurable);
+ Collection<? extends Configurable> providerConfigurables = provider.getConfigurable(category);
+ if (!providerConfigurables.isEmpty()) {
+ if (configurables == null) {
+ configurables = new SmartList<Configurable>();
}
- else {
- rootConfigurable = aRootConfigurable;
- }
+ configurables.addAll(providerConfigurables);
}
}
- if (configurables.isEmpty() && rootConfigurable == null) {
- return null;
- }
-
- //Perhaps we always should have a root node 'Debugger' with separate nodes for language-specific settings under it.
- //However for AppCode there is only one language which is clearly associated with the product
- //This code should removed when we extract the common debugger settings to the root node.
- if (PlatformUtils.isCidr() && rootConfigurable == null && configurables.size() == 1) {
- rootConfigurable = configurables.get(0);
- configurables = Collections.emptyList();
- }
-
- return new DebuggerConfigurable(rootConfigurable, configurables);
+ return ContainerUtil.notNullize(configurables);
}
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerSettingsPanelProvider.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerSettingsPanelProvider.java
index ba0bb43..68e6de0 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerSettingsPanelProvider.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DebuggerSettingsPanelProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,24 +16,43 @@
package com.intellij.xdebugger.impl.settings;
import com.intellij.openapi.options.Configurable;
+import com.intellij.xdebugger.settings.XDebuggerSettings;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
+import java.util.Collections;
/**
* @author nik
*/
public abstract class DebuggerSettingsPanelProvider {
+ public int getPriority() {
+ return 0;
+ }
- public abstract int getPriority();
-
- public abstract Collection<? extends Configurable> getConfigurables();
+ @NotNull
+ public Collection<? extends Configurable> getConfigurables() {
+ return Collections.emptyList();
+ }
public void apply() {
}
@Nullable
+ @Deprecated
public Configurable getRootConfigurable() {
return null;
}
+
+ @NotNull
+ public Collection<? extends Configurable> getConfigurable(@NotNull XDebuggerSettings.Category category) {
+ return Collections.emptyList();
+ }
+
+ /**
+ * General settings of category were applied
+ */
+ public void generalApplied(@NotNull XDebuggerSettings.Category category) {
+ }
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/GeneralConfigurable.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/GeneralConfigurable.java
new file mode 100644
index 0000000..466279b
--- /dev/null
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/GeneralConfigurable.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2014 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.settings;
+
+import com.intellij.openapi.options.ConfigurableBase;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+class GeneralConfigurable extends ConfigurableBase<GeneralConfigurableUi, XDebuggerGeneralSettings> {
+ @Override
+ protected XDebuggerGeneralSettings getSettings() {
+ return XDebuggerSettingsManager.getInstanceImpl().getGeneralSettings();
+ }
+
+ @Override
+ protected GeneralConfigurableUi createUi() {
+ return new GeneralConfigurableUi();
+ }
+
+ @NotNull
+ @Override
+ public String getId() {
+ return "debugger.general";
+ }
+
+ @Nls
+ @Override
+ public String getDisplayName() {
+ return "";
+ }
+
+ @Nullable
+ @Override
+ public String getHelpTopic() {
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/GeneralConfigurableUi.form b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/GeneralConfigurableUi.form
new file mode 100644
index 0000000..4d1f8e5
--- /dev/null
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/GeneralConfigurableUi.form
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.xdebugger.impl.settings.GeneralConfigurableUi">
+ <grid id="27dc6" binding="rootPanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <xy x="20" y="20" width="500" height="400"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="4b50" class="javax.swing.JCheckBox" binding="hideDebugWindowCheckBox">
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text resource-bundle="messages/XDebuggerBundle" key="setting.hide.window.label"/>
+ </properties>
+ </component>
+ <vspacer id="8e2ed">
+ <constraints>
+ <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+ </constraints>
+ </vspacer>
+ <component id="fc652" class="javax.swing.JCheckBox" binding="focusApplicationOnBreakpointCheckBox" default-binding="true">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text resource-bundle="messages/XDebuggerBundle" key="setting.focus.app.on.breakpoint.label"/>
+ </properties>
+ </component>
+ </children>
+ </grid>
+</form>
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/GeneralConfigurableUi.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/GeneralConfigurableUi.java
new file mode 100644
index 0000000..273c549
--- /dev/null
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/GeneralConfigurableUi.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2000-2014 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.settings;
+
+import com.intellij.openapi.options.ConfigurableUi;
+import com.intellij.openapi.util.registry.Registry;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+class GeneralConfigurableUi implements ConfigurableUi<XDebuggerGeneralSettings> {
+ private JPanel rootPanel;
+ private JCheckBox hideDebugWindowCheckBox;
+ private JCheckBox focusApplicationOnBreakpointCheckBox;
+
+ @Override
+ public void reset(@NotNull XDebuggerGeneralSettings settings) {
+ focusApplicationOnBreakpointCheckBox.setSelected(Registry.is("debugger.mayBringFrameToFrontOnBreakpoint"));
+ hideDebugWindowCheckBox.setSelected(settings.isHideDebuggerOnProcessTermination());
+ }
+
+ @Override
+ public boolean isModified(@NotNull XDebuggerGeneralSettings settings) {
+ return focusApplicationOnBreakpointCheckBox.isSelected() != Registry.is("debugger.mayBringFrameToFrontOnBreakpoint") ||
+ hideDebugWindowCheckBox.isSelected() != settings.isHideDebuggerOnProcessTermination();
+ }
+
+ @Override
+ public void apply(@NotNull XDebuggerGeneralSettings settings) {
+ Registry.get("debugger.mayBringFrameToFrontOnBreakpoint").setValue(focusApplicationOnBreakpointCheckBox.isSelected());
+ settings.setHideDebuggerOnProcessTermination(hideDebugWindowCheckBox.isSelected());
+ }
+
+ @NotNull
+ @Override
+ public JComponent getComponent() {
+ return rootPanel;
+ }
+}
\ No newline at end of file
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/MergedCompositeConfigurable.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/MergedCompositeConfigurable.java
new file mode 100644
index 0000000..be0bdbf
--- /dev/null
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/MergedCompositeConfigurable.java
@@ -0,0 +1,118 @@
+package com.intellij.xdebugger.impl.settings;
+
+import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.options.SearchableConfigurable;
+import com.intellij.openapi.ui.VerticalFlowLayout;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.ui.IdeBorderFactory;
+import com.intellij.ui.TitledSeparator;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.border.EmptyBorder;
+import java.awt.*;
+
+abstract class MergedCompositeConfigurable implements SearchableConfigurable {
+ static final EmptyBorder BOTTOM_INSETS = new EmptyBorder(0, 0, IdeBorderFactory.TITLED_BORDER_BOTTOM_INSET, 0);
+
+ protected final Configurable[] children;
+ protected JComponent rootComponent;
+
+ protected MergedCompositeConfigurable(@NotNull Configurable[] children) {
+ this.children = children;
+ }
+
+ protected boolean isUseTitledBorder() {
+ return true;
+ }
+
+ @Nullable
+ @Override
+ public Runnable enableSearch(String option) {
+ return null;
+ }
+
+ @Nullable
+ @Override
+ public String getHelpTopic() {
+ return children.length == 1 ? children[0].getHelpTopic() : null;
+ }
+
+ @Nullable
+ @Override
+ public JComponent createComponent() {
+ if (rootComponent == null) {
+ if (children.length == 1) {
+ rootComponent = children[0].createComponent();
+ }
+ else {
+ JPanel panel = createPanel(isUseTitledBorder());
+ for (Configurable child : children) {
+ JComponent component = child.createComponent();
+ assert component != null;
+ if (isUseTitledBorder()) {
+ String displayName = child.getDisplayName();
+ if (StringUtil.isEmpty(displayName)) {
+ component.setBorder(BOTTOM_INSETS);
+ }
+ else {
+ Insets insets = new Insets(children[0] == child ? 0 : IdeBorderFactory.TITLED_BORDER_TOP_INSET, 0, IdeBorderFactory.TITLED_BORDER_BOTTOM_INSET, 0);
+ component.setBorder(IdeBorderFactory.createTitledBorder(displayName, false, insets));
+ }
+ }
+ panel.add(component);
+ }
+ rootComponent = panel;
+ }
+ }
+ return rootComponent;
+ }
+
+ @NotNull
+ static JPanel createPanel(boolean isUseTitledBorder) {
+ int verticalGap = TitledSeparator.TOP_INSET;
+ JPanel panel = new JPanel(new VerticalFlowLayout(0, isUseTitledBorder ? 0 : verticalGap));
+ // VerticalFlowLayout incorrectly use vertical gap as top inset
+ if (!isUseTitledBorder) {
+ panel.setBorder(new EmptyBorder(-verticalGap, 0, 0, 0));
+ }
+ return panel;
+ }
+
+ @Override
+ public boolean isModified() {
+ for (Configurable child : children) {
+ if (child.isModified()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void apply() throws ConfigurationException {
+ for (Configurable child : children) {
+ if (child.isModified()) {
+ child.apply();
+ }
+ }
+ }
+
+ @Override
+ public void reset() {
+ for (Configurable child : children) {
+ child.reset();
+ }
+ }
+
+ @Override
+ public void disposeUIResources() {
+ rootComponent = null;
+
+ for (Configurable child : children) {
+ child.disposeUIResources();
+ }
+ }
+}
\ No newline at end of file
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/SteppingConfigurable.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/SteppingConfigurable.java
new file mode 100644
index 0000000..5f16424
--- /dev/null
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/SteppingConfigurable.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2014 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.settings;
+
+import com.intellij.openapi.options.Configurable;
+import com.intellij.xdebugger.XDebuggerBundle;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+class SteppingConfigurable extends MergedCompositeConfigurable {
+ public SteppingConfigurable(@NotNull List<Configurable> configurables) {
+ super(configurables.toArray(new Configurable[configurables.size()]));
+ }
+
+ @NotNull
+ @Override
+ public String getId() {
+ return "debugger.stepping";
+ }
+
+ @Nls
+ @Override
+ public String getDisplayName() {
+ return XDebuggerBundle.message("debugger.stepping.display.name");
+ }
+}
\ No newline at end of file
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/SubCompositeConfigurable.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/SubCompositeConfigurable.java
new file mode 100644
index 0000000..489e4bd
--- /dev/null
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/SubCompositeConfigurable.java
@@ -0,0 +1,180 @@
+/*
+ * Copyright 2000-2014 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.settings;
+
+import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.options.SearchableConfigurable;
+import com.intellij.openapi.ui.VerticalFlowLayout;
+import com.intellij.ui.IdeBorderFactory;
+import com.intellij.xdebugger.impl.DebuggerSupport;
+import com.intellij.xdebugger.settings.XDebuggerSettings;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.util.List;
+
+abstract class SubCompositeConfigurable implements SearchableConfigurable.Parent {
+ protected DataViewsConfigurableUi root;
+ protected Configurable[] children;
+ protected JComponent rootComponent;
+
+ @Override
+ public boolean hasOwnContent() {
+ return true;
+ }
+
+ @Override
+ public boolean isVisible() {
+ return true;
+ }
+
+ @Nullable
+ @Override
+ public Runnable enableSearch(String option) {
+ return null;
+ }
+
+ @Nullable
+ @Override
+ public String getHelpTopic() {
+ getConfigurables();
+ return children != null && children.length == 1 ? children[0].getHelpTopic() : null;
+ }
+
+ @Override
+ public final void disposeUIResources() {
+ root = null;
+ rootComponent = null;
+
+ if (isChildrenMerged()) {
+ for (Configurable child : children) {
+ child.disposeUIResources();
+ }
+ }
+ children = null;
+ }
+
+ protected XDebuggerDataViewSettings getSettings() {
+ return null;
+ }
+
+ @Nullable
+ protected abstract DataViewsConfigurableUi createRootUi();
+
+ @NotNull
+ protected abstract XDebuggerSettings.Category getCategory();
+
+ private boolean isChildrenMerged() {
+ return children != null && children.length == 1;
+ }
+
+ @Override
+ public final Configurable[] getConfigurables() {
+ if (children == null) {
+ List<Configurable> configurables = DebuggerConfigurableProvider.getConfigurables(getCategory());
+ children = configurables.toArray(new Configurable[configurables.size()]);
+ }
+ return isChildrenMerged() ? DebuggerConfigurable.EMPTY_CONFIGURABLES : children;
+ }
+
+ @Nullable
+ @Override
+ public final JComponent createComponent() {
+ if (rootComponent == null) {
+ if (root == null) {
+ root = createRootUi();
+ }
+
+ getConfigurables();
+ if (isChildrenMerged()) {
+ if (children.length == 0) {
+ rootComponent = root == null ? null : root.getComponent();
+ }
+ else if (root == null && children.length == 1) {
+ rootComponent = children[0].createComponent();
+ }
+ else {
+ JPanel panel = new JPanel(new VerticalFlowLayout(0, 0));
+ if (root != null) {
+ JComponent c = root.getComponent();
+ c.setBorder(MergedCompositeConfigurable.BOTTOM_INSETS);
+ panel.add(c);
+ }
+ for (Configurable child : children) {
+ JComponent component = child.createComponent();
+ if (component != null) {
+ component.setBorder(IdeBorderFactory.createTitledBorder(child.getDisplayName(), false));
+ panel.add(component);
+ }
+ }
+ rootComponent = panel;
+ }
+ }
+ else {
+ rootComponent = root == null ? null : root.getComponent();
+ }
+ }
+ return rootComponent;
+ }
+
+ @Override
+ public final void reset() {
+ if (root != null) {
+ root.reset(getSettings());
+ }
+
+ if (isChildrenMerged()) {
+ for (Configurable child : children) {
+ child.reset();
+ }
+ }
+ }
+
+ @Override
+ public final boolean isModified() {
+ if (root != null && root.isModified(getSettings())) {
+ return true;
+ }
+ else if (isChildrenMerged()) {
+ for (Configurable child : children) {
+ if (child.isModified()) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public final void apply() throws ConfigurationException {
+ if (root != null) {
+ root.apply(getSettings());
+ for (DebuggerSupport support : DebuggerSupport.getDebuggerSupports()) {
+ support.getSettingsPanelProvider().generalApplied(getCategory());
+ }
+ }
+
+ if (isChildrenMerged()) {
+ for (Configurable child : children) {
+ if (child.isModified()) {
+ child.apply();
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerDataViewSettings.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerDataViewSettings.java
index bff7c53..3dd8024 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerDataViewSettings.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerDataViewSettings.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,15 +16,21 @@
package com.intellij.xdebugger.impl.settings;
import com.intellij.util.xmlb.annotations.Tag;
-import com.intellij.xdebugger.evaluation.EvaluationMode;
+import com.intellij.xdebugger.settings.XDebuggerSettingsManager;
/**
* @author nik
*/
@Tag("data-views")
-public class XDebuggerDataViewSettings {
+public class XDebuggerDataViewSettings implements XDebuggerSettingsManager.DataViewSettings {
+ static final int DEFAULT_VALUE_TOOLTIP_DELAY = 700;
+
private boolean mySortValues;
+ private boolean autoExpressions = true;
+ private int valueLookupDelay = DEFAULT_VALUE_TOOLTIP_DELAY;
+
+ @Override
@Tag("sort-values")
public boolean isSortValues() {
return mySortValues;
@@ -33,4 +39,22 @@
public void setSortValues(boolean sortValues) {
mySortValues = sortValues;
}
+
+ @Override
+ public int getValueLookupDelay() {
+ return valueLookupDelay;
+ }
+
+ public void setValueLookupDelay(int value) {
+ valueLookupDelay = value;
+ }
+
+ @Override
+ public boolean isAutoExpressions() {
+ return autoExpressions;
+ }
+
+ public void setAutoExpressions(boolean autoExpressions) {
+ this.autoExpressions = autoExpressions;
+ }
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerGeneralSettings.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerGeneralSettings.java
index 1f89b14..9720d95 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerGeneralSettings.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerGeneralSettings.java
@@ -26,6 +26,8 @@
private EvaluationMode myEvaluationDialogMode = EvaluationMode.EXPRESSION;
private boolean myUnmuteOnStop = false;
+ private boolean hideDebuggerOnProcessTermination;
+
@Tag("evaluation-dialog-mode")
public EvaluationMode getEvaluationDialogMode() {
return myEvaluationDialogMode;
@@ -43,4 +45,12 @@
public void setUnmuteOnStop(boolean unmuteOnStop) {
myUnmuteOnStop = unmuteOnStop;
}
+
+ public boolean isHideDebuggerOnProcessTermination() {
+ return hideDebuggerOnProcessTermination;
+ }
+
+ public void setHideDebuggerOnProcessTermination(boolean hideDebuggerOnProcessTermination) {
+ this.hideDebuggerOnProcessTermination = hideDebuggerOnProcessTermination;
+ }
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerSettingsManager.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerSettingsManager.java
index ae2dcbc..ad025df 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerSettingsManager.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerSettingsManager.java
@@ -16,7 +16,6 @@
package com.intellij.xdebugger.impl.settings;
import com.intellij.openapi.components.*;
-import com.intellij.openapi.extensions.Extensions;
import com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters;
import com.intellij.util.xmlb.XmlSerializer;
import com.intellij.util.xmlb.annotations.AbstractCollection;
@@ -26,12 +25,15 @@
import com.intellij.xdebugger.settings.XDebuggerSettings;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
import java.util.*;
/**
* @author nik
+ * todo rename to XDebuggerSettingsManagerImpl
*/
+@SuppressWarnings("ClassNameSameAsAncestorName")
@State(
name = XDebuggerSettingsManager.COMPONENT_NAME,
storages = {
@@ -40,26 +42,30 @@
)
}
)
-public class XDebuggerSettingsManager implements PersistentStateComponent<XDebuggerSettingsManager.SettingsState>{
+public class XDebuggerSettingsManager extends com.intellij.xdebugger.settings.XDebuggerSettingsManager implements PersistentStateComponent<XDebuggerSettingsManager.SettingsState> {
@NonNls public static final String COMPONENT_NAME = "XDebuggerSettings";
private Map<String, XDebuggerSettings<?>> mySettingsById;
private Map<Class<? extends XDebuggerSettings>, XDebuggerSettings<?>> mySettingsByClass;
private XDebuggerDataViewSettings myDataViewSettings = new XDebuggerDataViewSettings();
private XDebuggerGeneralSettings myGeneralSettings = new XDebuggerGeneralSettings();
- public static XDebuggerSettingsManager getInstance() {
- return ServiceManager.getService(XDebuggerSettingsManager.class);
+ public static XDebuggerSettingsManager getInstanceImpl() {
+ return (XDebuggerSettingsManager)com.intellij.xdebugger.settings.XDebuggerSettingsManager.getInstance();
}
+ @Override
public SettingsState getState() {
SettingsState settingsState = new SettingsState();
settingsState.setDataViewSettings(myDataViewSettings);
settingsState.setGeneralSettings(myGeneralSettings);
for (XDebuggerSettings<?> settings : getSettingsList()) {
- SpecificSettingsState state = new SpecificSettingsState();
- state.setId(settings.getId());
- state.setSettingsElement(XmlSerializer.serialize(settings.getState(), new SkipDefaultValuesSerializationFilters()));
- settingsState.getSpecificStates().add(state);
+ Object subState = settings.getState();
+ if (subState != null) {
+ SpecificSettingsState state = new SpecificSettingsState();
+ state.setId(settings.getId());
+ state.setSettingsElement(XmlSerializer.serialize(subState, new SkipDefaultValuesSerializationFilters()));
+ settingsState.getSpecificStates().add(state);
+ }
}
return settingsState;
}
@@ -69,6 +75,8 @@
return Collections.unmodifiableCollection(mySettingsById.values());
}
+ @Override
+ @NotNull
public XDebuggerDataViewSettings getDataViewSettings() {
return myDataViewSettings;
}
@@ -77,6 +85,7 @@
return myGeneralSettings;
}
+ @Override
public void loadState(final SettingsState state) {
myDataViewSettings = state.getDataViewSettings();
myGeneralSettings = state.getGeneralSettings();
@@ -95,9 +104,10 @@
private void initSettings() {
if (mySettingsById == null) {
- mySettingsById = new HashMap<String, XDebuggerSettings<?>>();
- mySettingsByClass = new HashMap<Class<? extends XDebuggerSettings>, XDebuggerSettings<?>>();
- for (XDebuggerSettings settings : Extensions.getExtensions(XDebuggerSettings.EXTENSION_POINT)) {
+ XDebuggerSettings[] extensions = XDebuggerSettings.EXTENSION_POINT.getExtensions();
+ mySettingsById = new LinkedHashMap<String, XDebuggerSettings<?>>(extensions.length);
+ mySettingsByClass = new LinkedHashMap<Class<? extends XDebuggerSettings>, XDebuggerSettings<?>>(extensions.length);
+ for (XDebuggerSettings settings : extensions) {
mySettingsById.put(settings.getId(), settings);
mySettingsByClass.put(settings.getClass(), settings);
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerSettingsPanelProviderImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerSettingsPanelProviderImpl.java
index 6dc0a5b..2e20230 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerSettingsPanelProviderImpl.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/XDebuggerSettingsPanelProviderImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,26 +16,55 @@
package com.intellij.xdebugger.impl.settings;
import com.intellij.openapi.options.Configurable;
-import com.intellij.openapi.project.Project;
+import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
import com.intellij.xdebugger.settings.XDebuggerSettings;
+import org.jetbrains.annotations.NotNull;
-import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
/**
* @author nik
*/
public class XDebuggerSettingsPanelProviderImpl extends DebuggerSettingsPanelProvider {
- public int getPriority() {
- return 0;
- }
-
+ @NotNull
+ @Override
public Collection<? extends Configurable> getConfigurables() {
- ArrayList<Configurable> list = new ArrayList<Configurable>();
- for (XDebuggerSettings settings : XDebuggerSettingsManager.getInstance().getSettingsList()) {
- list.add(settings.createConfigurable());
+ List<Configurable> list = new SmartList<Configurable>();
+ for (XDebuggerSettings settings : XDebuggerSettingsManager.getInstanceImpl().getSettingsList()) {
+ ContainerUtil.addIfNotNull(list, settings.createConfigurable());
}
return list;
}
+ @NotNull
+ @Override
+ public Collection<? extends Configurable> getConfigurable(@NotNull XDebuggerSettings.Category category) {
+ List<Configurable> list;
+ if (category == XDebuggerSettings.Category.ROOT) {
+ list = new SmartList<Configurable>(new GeneralConfigurable());
+ }
+ else {
+ list = null;
+ }
+
+ for (XDebuggerSettings settings : XDebuggerSettingsManager.getInstanceImpl().getSettingsList()) {
+ Configurable configurable = settings.createConfigurable(category);
+ if (configurable != null) {
+ if (list == null) {
+ list = new SmartList<Configurable>();
+ }
+ list.add(configurable);
+ }
+ }
+ return ContainerUtil.notNullize(list);
+ }
+
+ @Override
+ public void generalApplied(@NotNull XDebuggerSettings.Category category) {
+ for (XDebuggerSettings settings : XDebuggerSettingsManager.getInstanceImpl().getSettingsList()) {
+ settings.generalApplied(category);
+ }
+ }
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/ExecutionPointHighlighter.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/ExecutionPointHighlighter.java
index 0065a28..853611b 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/ExecutionPointHighlighter.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/ExecutionPointHighlighter.java
@@ -18,6 +18,7 @@
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.colors.EditorColorsListener;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.markup.GutterIconRenderer;
@@ -53,6 +54,17 @@
public ExecutionPointHighlighter(final Project project) {
myProject = project;
+
+ // Update highlighter colors if global color schema was changed
+ final EditorColorsManager colorsManager = EditorColorsManager.getInstance();
+ if (colorsManager != null) { // in some debugger tests EditorColorsManager component isn't loaded
+ colorsManager.addEditorColorsListener(new EditorColorsListener() {
+ @Override
+ public void globalSchemeChange(EditorColorsScheme scheme) {
+ update();
+ }
+ }, project);
+ }
}
public void show(final @NotNull XSourcePosition position, final boolean useSelection,
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTree.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTree.java
index afb2260..d097b09 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTree.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTree.java
@@ -20,6 +20,7 @@
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.keymap.KeymapManager;
import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.changes.issueLinks.TreeLinkMouseListener;
import com.intellij.ui.DoubleClickListener;
@@ -331,4 +332,23 @@
public TransferToEDTQueue<Runnable> getLaterInvocator() {
return myLaterInvocator;
}
+
+ public void expandNodesOnLoad(final Condition<TreeNode> nodeFilter) {
+ addTreeListener(new XDebuggerTreeListener() {
+ @Override
+ public void nodeLoaded(@NotNull RestorableStateNode node, String name) {
+ if (nodeFilter.value(node) && !node.isLeaf()) {
+ // cause children computing
+ node.getChildCount();
+ }
+ }
+
+ @Override
+ public void childrenLoaded(@NotNull XDebuggerTreeNode node, @NotNull List<XValueContainerNode<?>> children, boolean last) {
+ if (nodeFilter.value(node)) {
+ expandPath(node.getPath());
+ }
+ }
+ });
+ }
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/actions/SortValuesToggleAction.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/actions/SortValuesToggleAction.java
index 00d803d6..e399dbd 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/actions/SortValuesToggleAction.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/actions/SortValuesToggleAction.java
@@ -27,12 +27,12 @@
public class SortValuesToggleAction extends ToggleAction implements DumbAware {
@Override
public boolean isSelected(AnActionEvent e) {
- return XDebuggerSettingsManager.getInstance().getDataViewSettings().isSortValues();
+ return XDebuggerSettingsManager.getInstanceImpl().getDataViewSettings().isSortValues();
}
@Override
public void setSelected(AnActionEvent e, boolean state) {
- XDebuggerSettingsManager.getInstance().getDataViewSettings().setSortValues(state);
+ XDebuggerSettingsManager.getInstanceImpl().getDataViewSettings().setSortValues(state);
XDebuggerUtilImpl.rebuildAllSessionsViews(e.getProject());
}
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueContainerNode.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueContainerNode.java
index 38d2547..b9f90fe 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueContainerNode.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueContainerNode.java
@@ -21,9 +21,9 @@
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.SortedList;
import com.intellij.xdebugger.frame.*;
-import com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager;
import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants;
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
+import com.intellij.xdebugger.settings.XDebuggerSettingsManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
diff --git a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerSettingsTest.java b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerSettingsTest.java
index ff4b0d2..a4b7431 100644
--- a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerSettingsTest.java
+++ b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerSettingsTest.java
@@ -36,11 +36,11 @@
registerExtensionPoint(XDebuggerSettings.EXTENSION_POINT, XDebuggerSettings.class);
registerExtension(XDebuggerSettings.EXTENSION_POINT, new MyDebuggerSettings());
getApplication().registerService(XDebuggerUtil.class, XDebuggerUtilImpl.class);
- getApplication().registerService(XDebuggerSettingsManager.class, XDebuggerSettingsManager.class);
+ getApplication().registerService(com.intellij.xdebugger.settings.XDebuggerSettingsManager.class, XDebuggerSettingsManager.class);
}
public void testSerialize() throws Exception {
- XDebuggerSettingsManager settingsManager = XDebuggerSettingsManager.getInstance();
+ XDebuggerSettingsManager settingsManager = XDebuggerSettingsManager.getInstanceImpl();
MyDebuggerSettings settings = MyDebuggerSettings.getInstance();
assertNotNull(settings);
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/META-INF/InspectionGadgets.xml b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/META-INF/InspectionGadgets.xml
index 890da15..164c690 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/META-INF/InspectionGadgets.xml
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/META-INF/InspectionGadgets.xml
@@ -408,6 +408,10 @@
key="class.name.differs.from.file.name.display.name" groupBundle="messages.InspectionsBundle"
groupKey="group.names.class.structure" enabledByDefault="false" level="WARNING"
implementationClass="com.siyeh.ig.classlayout.ClassNameDiffersFromFileNameInspection"/>
+ <localInspection language="JAVA" shortName="ClassWithOnlyPrivateConstructors" bundle="com.siyeh.InspectionGadgetsBundle"
+ key="class.with.only.private.constructors.display.name" groupBundle="messages.InspectionsBundle"
+ groupKey="group.names.class.structure" enabledByDefault="false" level="WARNING"
+ implementationClass="com.siyeh.ig.classlayout.ClassWithOnlyPrivateConstructorsInspection"/>
<localInspection language="JAVA" shortName="ConstantDeclaredInAbstractClass" bundle="com.siyeh.InspectionGadgetsBundle"
key="constant.declared.in.abstract.class.display.name" groupBundle="messages.InspectionsBundle"
groupKey="group.names.class.structure" enabledByDefault="false" level="WARNING"
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties
index efeb658..f92925b 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties
@@ -2096,3 +2096,5 @@
serializable.anonymous.class.stores.non.serializable.problem.descriptor=Serializable anonymous class implicitly stores non-Serializable object of type ''{0}''
assignment.to.lambda.parameter.display.name=Assignment to lambda parameter
assignment.to.lambda.parameter.problem.descriptor=Assignment to lambda parameter <code>#ref</code> #loc
+class.with.only.private.constructors.display.name=Class with only 'private' constructors should be declared 'final'
+class.with.only.private.constructors.problem.descriptor=Class <code>#ref</code> with only 'private' constructors should be declared 'final'
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/BaseGlobalInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/BaseGlobalInspection.java
index b0f4a36..8d2e504 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/BaseGlobalInspection.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/BaseGlobalInspection.java
@@ -16,6 +16,7 @@
package com.siyeh.ig;
import com.intellij.codeInspection.GlobalJavaBatchInspectionTool;
+import com.intellij.codeInspection.InspectionProfileEntry;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -34,8 +35,7 @@
assert name.endsWith(INSPECTION) :
"class name must end with 'Inspection' to correctly" +
" calculate the short name: " + name;
- shortName = name.substring(name.lastIndexOf((int)'.') + 1,
- name.length() - INSPECTION.length());
+ shortName = InspectionProfileEntry.getShortName(getClass().getSimpleName());
}
return shortName;
}
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/assignment/AssignmentToMethodParameterInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/assignment/AssignmentToMethodParameterInspection.java
index 56dbecc..5fb2f2b 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/assignment/AssignmentToMethodParameterInspection.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/assignment/AssignmentToMethodParameterInspection.java
@@ -26,9 +26,6 @@
public class AssignmentToMethodParameterInspection extends BaseAssignmentToParameterInspection {
- @SuppressWarnings({"PublicField"})
- public boolean ignoreTransformationOfOriginalParameter = false;
-
@Override
@NotNull
public String getDisplayName() {
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/classlayout/ClassWithOnlyPrivateConstructorsInspectionBase.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/classlayout/ClassWithOnlyPrivateConstructorsInspectionBase.java
new file mode 100644
index 0000000..6d09169
--- /dev/null
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/classlayout/ClassWithOnlyPrivateConstructorsInspectionBase.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2000-2014 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.siyeh.ig.classlayout;
+
+import com.intellij.psi.PsiClass;
+import com.intellij.psi.PsiMethod;
+import com.intellij.psi.PsiModifier;
+import com.siyeh.InspectionGadgetsBundle;
+import com.siyeh.ig.BaseInspection;
+import com.siyeh.ig.BaseInspectionVisitor;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Bas Leijdekkers
+ */
+public class ClassWithOnlyPrivateConstructorsInspectionBase extends BaseInspection {
+ @Nls
+ @NotNull
+ @Override
+ public String getDisplayName() {
+ return InspectionGadgetsBundle.message("class.with.only.private.constructors.display.name");
+ }
+
+ @NotNull
+ @Override
+ protected String buildErrorString(Object... infos) {
+ return InspectionGadgetsBundle.message("class.with.only.private.constructors.problem.descriptor");
+ }
+
+ @Override
+ public BaseInspectionVisitor buildVisitor() {
+ return new ClassWithOnlyPrivateConstructorsVisitor();
+ }
+
+ private static class ClassWithOnlyPrivateConstructorsVisitor extends BaseInspectionVisitor {
+
+ @Override
+ public void visitClass(PsiClass aClass) {
+ super.visitClass(aClass);
+ final PsiMethod[] constructors = aClass.getConstructors();
+ if (constructors.length == 0) {
+ return;
+ }
+ for (PsiMethod constructor : constructors) {
+ if (constructor.hasModifierProperty(PsiModifier.FINAL)) {
+ return;
+ }
+ }
+ final PsiClass[] innerClasses = aClass.getInnerClasses();
+ for (PsiClass innerClass : innerClasses) {
+ if (isExtendedByInnerClass(innerClass, aClass, new HashSet<PsiClass>())) {
+ return;
+ }
+ }
+ registerClassError(aClass, aClass);
+ }
+
+ private static boolean isExtendedByInnerClass(PsiClass innerClass, PsiClass superClass, Set<PsiClass> visited) {
+ if (!visited.add(innerClass)) {
+ return false;
+ }
+ if (innerClass.isInheritor(superClass, false)) {
+ return true;
+ }
+ final PsiClass[] innerClasses = innerClass.getInnerClasses();
+ for (PsiClass aClass : innerClasses) {
+ if (isExtendedByInnerClass(aClass, superClass, visited)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+}
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspection.java
index 755a4c3..0b7524d 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspection.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspection.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2011 Dave Griffith, Bas Leijdekkers
+ * Copyright 2003-2014 Dave Griffith, Bas Leijdekkers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,12 +17,15 @@
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Ref;
import com.intellij.psi.*;
import com.intellij.psi.search.LocalSearchScope;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.refactoring.extractMethod.InputVariables;
+import com.intellij.refactoring.util.duplicates.ConditionalReturnStatementValue;
import com.intellij.refactoring.util.duplicates.DuplicatesFinder;
import com.intellij.refactoring.util.duplicates.Match;
+import com.intellij.refactoring.util.duplicates.ReturnValue;
import com.intellij.util.IncorrectOperationException;
import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.BaseInspection;
@@ -158,12 +161,10 @@
return new IfStatementWithIdenticalBranchesVisitor();
}
- private static class IfStatementWithIdenticalBranchesVisitor
- extends BaseInspectionVisitor {
+ private static class IfStatementWithIdenticalBranchesVisitor extends BaseInspectionVisitor {
@Override
- public void visitIfStatement(
- @NotNull PsiIfStatement ifStatement) {
+ public void visitIfStatement(@NotNull PsiIfStatement ifStatement) {
super.visitIfStatement(ifStatement);
final PsiStatement elseBranch = ifStatement.getElseBranch();
final PsiStatement thenBranch = ifStatement.getThenBranch();
@@ -179,14 +180,18 @@
inputVariables, null,
Collections.<PsiVariable>emptyList());
if (elseBranch instanceof PsiIfStatement) {
- final PsiIfStatement statement =
- (PsiIfStatement)elseBranch;
+ final PsiIfStatement statement = (PsiIfStatement)elseBranch;
final PsiStatement branch = statement.getThenBranch();
if (branch == null) {
return;
}
final Match match = finder.isDuplicate(branch, true);
- if (match != null && match.getReturnValue() == null) {
+ if (match != null) {
+ final ReturnValue matchReturnValue = match.getReturnValue();
+ if (matchReturnValue instanceof ConditionalReturnStatementValue &&
+ !matchReturnValue.isEquivalent(buildReturnValue(thenBranch))) {
+ return;
+ }
registerStatementError(ifStatement, statement);
return;
}
@@ -197,11 +202,37 @@
else {
final Match match = finder.isDuplicate(elseBranch, true);
if (match != null) {
+ final ReturnValue matchReturnValue = match.getReturnValue();
+ if (matchReturnValue instanceof ConditionalReturnStatementValue &&
+ !matchReturnValue.isEquivalent(buildReturnValue(thenBranch))) {
+ return;
+ }
registerStatementError(ifStatement);
}
}
}
+ @Nullable
+ private ReturnValue buildReturnValue(PsiElement element) {
+ final Ref<PsiReturnStatement> result = Ref.create(null);
+ element.accept(new JavaRecursiveElementWalkingVisitor() {
+ @Override
+ public void visitReturnStatement(PsiReturnStatement statement) {
+ super.visitReturnStatement(statement);
+ result.set(statement);
+ }
+ });
+ final PsiReturnStatement returnStatement = result.get();
+ if (returnStatement == null) {
+ return null;
+ }
+ final PsiExpression expression = returnStatement.getReturnValue();
+ if (expression == null) {
+ return null;
+ }
+ return new ConditionalReturnStatementValue(expression);
+ }
+
private void checkIfStatementWithoutElseBranch(
PsiIfStatement ifStatement) {
final PsiStatement thenBranch = ifStatement.getThenBranch();
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/UnnecessaryLocalVariableInspectionBase.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/UnnecessaryLocalVariableInspectionBase.java
index ad427315..0bc8716 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/UnnecessaryLocalVariableInspectionBase.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/UnnecessaryLocalVariableInspectionBase.java
@@ -97,11 +97,6 @@
}
@Override
- protected boolean buildQuickFixesOnlyForOnTheFlyErrors() {
- return true;
- }
-
- @Override
public BaseInspectionVisitor buildVisitor() {
return new UnnecessaryLocalVariableVisitor();
}
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/PointlessArithmeticExpressionInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/PointlessArithmeticExpressionInspection.java
index bebf5a5..023b4bc 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/PointlessArithmeticExpressionInspection.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/PointlessArithmeticExpressionInspection.java
@@ -105,7 +105,7 @@
fromTarget = (i == length - 1) ? polyadicExpression.getTokenBeforeOperand(operand) : operand;
break;
}
- else if ((tokenType.equals(JavaTokenType.MINUS) || tokenType.equals(JavaTokenType.DIV)) &&
+ else if ((tokenType.equals(JavaTokenType.MINUS) && i == 1 || tokenType.equals(JavaTokenType.DIV)) &&
EquivalenceChecker.expressionsAreEquivalent(previousOperand, operand)) {
fromTarget = previousOperand;
untilTarget = operand;
@@ -229,9 +229,10 @@
private boolean subtractionExpressionIsPointless(PsiExpression[] expressions) {
PsiExpression previousExpression = null;
- for (PsiExpression expression : expressions) {
+ for (int i = 0; i < expressions.length; i++) {
+ PsiExpression expression = expressions[i];
if (previousExpression != null &&
- (isZero(expression) || EquivalenceChecker.expressionsAreEquivalent(previousExpression, expression))) {
+ (isZero(expression) || i == 1 && EquivalenceChecker.expressionsAreEquivalent(previousExpression, expression))) {
return true;
}
previousExpression = expression;
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleGetterInClassInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleGetterInClassInspection.java
deleted file mode 100644
index 997e57b..0000000
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleGetterInClassInspection.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright 2003-2011 Dave Griffith, Bas Leijdekkers
- *
- * 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.siyeh.ig.performance;
-
-import com.intellij.codeInspection.ProblemDescriptor;
-import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel;
-import com.intellij.openapi.project.Project;
-import com.intellij.psi.*;
-import com.intellij.psi.search.searches.OverridingMethodsSearch;
-import com.intellij.psi.util.PropertyUtil;
-import com.intellij.util.IncorrectOperationException;
-import com.intellij.util.Query;
-import com.siyeh.InspectionGadgetsBundle;
-import com.siyeh.ig.BaseInspection;
-import com.siyeh.ig.BaseInspectionVisitor;
-import com.siyeh.ig.InspectionGadgetsFix;
-import com.siyeh.ig.PsiReplacementUtil;
-import com.siyeh.ig.psiutils.ClassUtils;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import javax.swing.*;
-
-public class CallToSimpleGetterInClassInspection extends BaseInspection {
-
- @SuppressWarnings("UnusedDeclaration")
- public boolean ignoreGetterCallsOnOtherObjects = false;
-
- @SuppressWarnings("UnusedDeclaration")
- public boolean onlyReportPrivateGetter = false;
-
- @Override
- @NotNull
- public String getID() {
- return "CallToSimpleGetterFromWithinClass";
- }
-
- @Override
- @NotNull
- public String getDisplayName() {
- return InspectionGadgetsBundle.message("call.to.simple.getter.in.class.display.name");
- }
-
- @Override
- @NotNull
- public String buildErrorString(Object... infos) {
- return InspectionGadgetsBundle.message("call.to.simple.getter.in.class.problem.descriptor");
- }
-
- @Override
- @Nullable
- public JComponent createOptionsPanel() {
- final MultipleCheckboxOptionsPanel optionsPanel = new MultipleCheckboxOptionsPanel(this);
- optionsPanel.addCheckbox(InspectionGadgetsBundle.message("call.to.simple.getter.in.class.ignore.option"),
- "ignoreGetterCallsOnOtherObjects");
- optionsPanel.addCheckbox(InspectionGadgetsBundle.message("call.to.private.simple.getter.in.class.option"),
- "onlyReportPrivateGetter");
- return optionsPanel;
- }
-
- @Override
- public InspectionGadgetsFix buildFix(Object... infos) {
- return new InlineCallFix();
- }
-
- private static class InlineCallFix extends InspectionGadgetsFix {
- @NotNull
- @Override
- public String getFamilyName() {
- return getName();
- }
-
- @Override
- @NotNull
- public String getName() {
- return InspectionGadgetsBundle.message("call.to.simple.getter.in.class.inline.quickfix");
- }
-
- @Override
- public void doFix(Project project, ProblemDescriptor descriptor) throws IncorrectOperationException {
- final PsiElement methodIdentifier = descriptor.getPsiElement();
- final PsiReferenceExpression methodExpression = (PsiReferenceExpression)methodIdentifier.getParent();
- if (methodExpression == null) {
- return;
- }
- final PsiMethodCallExpression call = (PsiMethodCallExpression)methodExpression.getParent();
- if (call == null) {
- return;
- }
- final PsiMethod method = call.resolveMethod();
- if (method == null) {
- return;
- }
- final PsiCodeBlock body = method.getBody();
- if (body == null) {
- return;
- }
- final PsiStatement[] statements = body.getStatements();
- final PsiReturnStatement returnStatement = (PsiReturnStatement)statements[0];
- final PsiExpression returnValue = returnStatement.getReturnValue();
- if (!(returnValue instanceof PsiReferenceExpression)) {
- return;
- }
- final PsiReferenceExpression referenceExpression = (PsiReferenceExpression)returnValue;
- final PsiField field = (PsiField)referenceExpression.resolve();
- if (field == null) {
- return;
- }
- final String fieldName = field.getName();
- if (fieldName == null) {
- return;
- }
- final PsiExpression qualifier = methodExpression.getQualifierExpression();
- if (qualifier == null) {
- final JavaPsiFacade facade = JavaPsiFacade.getInstance(call.getProject());
- final PsiResolveHelper resolveHelper = facade.getResolveHelper();
- final PsiVariable variable = resolveHelper.resolveReferencedVariable(fieldName, call);
- if (variable == null) {
- return;
- }
- if (variable.equals(field)) {
- PsiReplacementUtil.replaceExpression(call, fieldName);
- }
- else {
- PsiReplacementUtil.replaceExpression(call, "this." + fieldName);
- }
- }
- else {
- PsiReplacementUtil.replaceExpression(call, qualifier.getText() + '.' + fieldName);
- }
- }
- }
-
- @Override
- public BaseInspectionVisitor buildVisitor() {
- return new CallToSimpleGetterInClassVisitor();
- }
-
- private class CallToSimpleGetterInClassVisitor extends BaseInspectionVisitor {
-
- @Override
- public void visitMethodCallExpression(@NotNull PsiMethodCallExpression call) {
- super.visitMethodCallExpression(call);
- final PsiClass containingClass = ClassUtils.getContainingClass(call);
- if (containingClass == null) {
- return;
- }
- final PsiMethod method = call.resolveMethod();
- if (method == null) {
- return;
- }
- if (!containingClass.equals(method.getContainingClass())) {
- return;
- }
- final PsiReferenceExpression methodExpression = call.getMethodExpression();
- final PsiExpression qualifier = methodExpression.getQualifierExpression();
- if (qualifier != null && !(qualifier instanceof PsiThisExpression)) {
- if (ignoreGetterCallsOnOtherObjects) {
- return;
- }
- final PsiType type = qualifier.getType();
- if (!(type instanceof PsiClassType)) {
- return;
- }
- final PsiClassType classType = (PsiClassType)type;
- final PsiClass qualifierClass = classType.resolve();
- if (!containingClass.equals(qualifierClass)) {
- return;
- }
- }
- if (!PropertyUtil.isSimpleGetter(method)) {
- return;
- }
- if (onlyReportPrivateGetter && !method.hasModifierProperty(PsiModifier.PRIVATE)) {
- return;
- }
- final Query<PsiMethod> query = OverridingMethodsSearch.search(method, true);
- final PsiMethod overridingMethod = query.findFirst();
- if (overridingMethod != null) {
- return;
- }
- registerMethodCallError(call);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleGetterInClassInspectionBase.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleGetterInClassInspectionBase.java
new file mode 100644
index 0000000..f21fd509
--- /dev/null
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleGetterInClassInspectionBase.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2000-2014 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.siyeh.ig.performance;
+
+import com.intellij.psi.*;
+import com.intellij.psi.search.searches.OverridingMethodsSearch;
+import com.intellij.psi.util.PropertyUtil;
+import com.intellij.util.Query;
+import com.siyeh.InspectionGadgetsBundle;
+import com.siyeh.ig.BaseInspection;
+import com.siyeh.ig.BaseInspectionVisitor;
+import com.siyeh.ig.psiutils.ClassUtils;
+import org.jetbrains.annotations.NotNull;
+
+public class CallToSimpleGetterInClassInspectionBase extends BaseInspection {
+ @SuppressWarnings("UnusedDeclaration")
+ public boolean ignoreGetterCallsOnOtherObjects = false;
+ @SuppressWarnings("UnusedDeclaration")
+ public boolean onlyReportPrivateGetter = false;
+
+ @Override
+ @NotNull
+ public String getID() {
+ return "CallToSimpleGetterFromWithinClass";
+ }
+
+ @Override
+ @NotNull
+ public String getDisplayName() {
+ return InspectionGadgetsBundle.message("call.to.simple.getter.in.class.display.name");
+ }
+
+ @Override
+ @NotNull
+ public String buildErrorString(Object... infos) {
+ return InspectionGadgetsBundle.message("call.to.simple.getter.in.class.problem.descriptor");
+ }
+
+ @Override
+ public BaseInspectionVisitor buildVisitor() {
+ return new CallToSimpleGetterInClassVisitor();
+ }
+
+ private class CallToSimpleGetterInClassVisitor extends BaseInspectionVisitor {
+
+ @Override
+ public void visitMethodCallExpression(@NotNull PsiMethodCallExpression call) {
+ super.visitMethodCallExpression(call);
+ final PsiClass containingClass = ClassUtils.getContainingClass(call);
+ if (containingClass == null) {
+ return;
+ }
+ final PsiMethod method = call.resolveMethod();
+ if (method == null) {
+ return;
+ }
+ if (!containingClass.equals(method.getContainingClass())) {
+ return;
+ }
+ final PsiReferenceExpression methodExpression = call.getMethodExpression();
+ final PsiExpression qualifier = methodExpression.getQualifierExpression();
+ if (qualifier != null && !(qualifier instanceof PsiThisExpression)) {
+ if (ignoreGetterCallsOnOtherObjects) {
+ return;
+ }
+ final PsiType type = qualifier.getType();
+ if (!(type instanceof PsiClassType)) {
+ return;
+ }
+ final PsiClassType classType = (PsiClassType)type;
+ final PsiClass qualifierClass = classType.resolve();
+ if (!containingClass.equals(qualifierClass)) {
+ return;
+ }
+ }
+ if (!PropertyUtil.isSimpleGetter(method)) {
+ return;
+ }
+ if (onlyReportPrivateGetter && !method.hasModifierProperty(PsiModifier.PRIVATE)) {
+ return;
+ }
+ final Query<PsiMethod> query = OverridingMethodsSearch.search(method, true);
+ final PsiMethod overridingMethod = query.findFirst();
+ if (overridingMethod != null) {
+ return;
+ }
+ registerMethodCallError(call);
+ }
+ }
+}
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleSetterInClassInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleSetterInClassInspection.java
deleted file mode 100644
index bfcf47cd..0000000
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleSetterInClassInspection.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright 2003-2011 Dave Griffith, Bas Leijdekkers
- *
- * 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.siyeh.ig.performance;
-
-import com.intellij.codeInspection.ProblemDescriptor;
-import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel;
-import com.intellij.openapi.project.Project;
-import com.intellij.psi.*;
-import com.intellij.psi.search.searches.OverridingMethodsSearch;
-import com.intellij.psi.util.PropertyUtil;
-import com.intellij.util.IncorrectOperationException;
-import com.intellij.util.Query;
-import com.siyeh.InspectionGadgetsBundle;
-import com.siyeh.ig.BaseInspection;
-import com.siyeh.ig.BaseInspectionVisitor;
-import com.siyeh.ig.InspectionGadgetsFix;
-import com.siyeh.ig.PsiReplacementUtil;
-import com.siyeh.ig.psiutils.ClassUtils;
-import org.jetbrains.annotations.NonNls;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import javax.swing.*;
-
-public class CallToSimpleSetterInClassInspection extends BaseInspection {
-
- @SuppressWarnings("UnusedDeclaration")
- public boolean ignoreSetterCallsOnOtherObjects = false;
-
- @SuppressWarnings("UnusedDeclaration")
- public boolean onlyReportPrivateSetter = false;
-
- @Override
- @NotNull
- public String getID() {
- return "CallToSimpleSetterFromWithinClass";
- }
-
- @Override
- @NotNull
- public String getDisplayName() {
- return InspectionGadgetsBundle.message("call.to.simple.setter.in.class.display.name");
- }
-
- @Override
- @NotNull
- public String buildErrorString(Object... infos) {
- return InspectionGadgetsBundle.message("call.to.simple.setter.in.class.problem.descriptor");
- }
-
- @Override
- @Nullable
- public JComponent createOptionsPanel() {
- final MultipleCheckboxOptionsPanel optionsPanel = new MultipleCheckboxOptionsPanel(this);
- optionsPanel.addCheckbox(InspectionGadgetsBundle.message("call.to.simple.setter.in.class.ignore.option"),
- "ignoreSetterCallsOnOtherObjects");
- optionsPanel.addCheckbox(InspectionGadgetsBundle.message("call.to.private.setter.in.class.option"),
- "onlyReportPrivateSetter");
- return optionsPanel;
- }
-
- @Override
- public InspectionGadgetsFix buildFix(Object... infos) {
- return new InlineCallFix();
- }
-
- private static class InlineCallFix extends InspectionGadgetsFix {
-
- @Override
- @NotNull
- public String getName() {
- return InspectionGadgetsBundle.message("call.to.simple.setter.in.class.inline.quickfix");
- }
-
- @NotNull
- @Override
- public String getFamilyName() {
- return getName();
- }
-
- @Override
- public void doFix(Project project, ProblemDescriptor descriptor)
- throws IncorrectOperationException {
- final PsiElement methodIdentifier = descriptor.getPsiElement();
- final PsiReferenceExpression methodExpression = (PsiReferenceExpression)methodIdentifier.getParent();
- if (methodExpression == null) {
- return;
- }
- final PsiMethodCallExpression call = (PsiMethodCallExpression)methodExpression.getParent();
- if (call == null) {
- return;
- }
- final PsiExpressionList argumentList = call.getArgumentList();
- final PsiExpression[] arguments = argumentList.getExpressions();
- final PsiExpression argument = arguments[0];
- final PsiMethod method = call.resolveMethod();
- if (method == null) {
- return;
- }
- final PsiCodeBlock body = method.getBody();
- if (body == null) {
- return;
- }
- final PsiStatement[] statements = body.getStatements();
- final PsiExpressionStatement assignmentStatement = (PsiExpressionStatement)statements[0];
- final PsiAssignmentExpression assignment = (PsiAssignmentExpression)assignmentStatement.getExpression();
- final PsiExpression qualifier = methodExpression.getQualifierExpression();
- final PsiReferenceExpression lhs = (PsiReferenceExpression)assignment.getLExpression();
- final PsiField field = (PsiField)lhs.resolve();
- if (field == null) {
- return;
- }
- final String fieldName = field.getName();
- if (qualifier == null) {
- final JavaPsiFacade manager = JavaPsiFacade.getInstance(call.getProject());
- final PsiResolveHelper resolveHelper = manager.getResolveHelper();
- final PsiVariable variable = resolveHelper.resolveReferencedVariable(fieldName, call);
- if (variable == null) {
- return;
- }
- @NonNls final String newExpression;
- if (variable.equals(field)) {
- newExpression = fieldName + " = " + argument.getText();
- }
- else {
- newExpression = "this." + fieldName + " = " + argument.getText();
- }
- PsiReplacementUtil.replaceExpression(call, newExpression);
- }
- else {
- final String newExpression = qualifier.getText() + '.' + fieldName + " = " + argument.getText();
- PsiReplacementUtil.replaceExpression(call, newExpression);
- }
- }
- }
-
- @Override
- public BaseInspectionVisitor buildVisitor() {
- return new CallToSimpleSetterInClassVisitor();
- }
-
- private class CallToSimpleSetterInClassVisitor extends BaseInspectionVisitor {
-
- @Override
- public void visitMethodCallExpression(@NotNull PsiMethodCallExpression call) {
- super.visitMethodCallExpression(call);
- final PsiClass containingClass = ClassUtils.getContainingClass(call);
- if (containingClass == null) {
- return;
- }
- final PsiMethod method = call.resolveMethod();
- if (method == null) {
- return;
- }
- if (!containingClass.equals(method.getContainingClass())) {
- return;
- }
- final PsiReferenceExpression methodExpression = call.getMethodExpression();
- final PsiExpression qualifier = methodExpression.getQualifierExpression();
- if (qualifier != null && !(qualifier instanceof PsiThisExpression)) {
- if (ignoreSetterCallsOnOtherObjects) {
- return;
- }
- final PsiType type = qualifier.getType();
- if (!(type instanceof PsiClassType)) {
- return;
- }
- final PsiClassType classType = (PsiClassType)type;
- final PsiClass qualifierClass = classType.resolve();
- if (!containingClass.equals(qualifierClass)) {
- return;
- }
- }
- if (!PropertyUtil.isSimpleSetter(method)) {
- return;
- }
- if (onlyReportPrivateSetter && !method.hasModifierProperty(PsiModifier.PRIVATE)) {
- return;
- }
- final Query<PsiMethod> query = OverridingMethodsSearch.search(method, true);
- final PsiMethod overridingMethod = query.findFirst();
- if (overridingMethod != null) {
- return;
- }
- registerMethodCallError(call);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleSetterInClassInspectionBase.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleSetterInClassInspectionBase.java
new file mode 100644
index 0000000..6e6512a
--- /dev/null
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/CallToSimpleSetterInClassInspectionBase.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2000-2014 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.siyeh.ig.performance;
+
+import com.intellij.psi.*;
+import com.intellij.psi.search.searches.OverridingMethodsSearch;
+import com.intellij.psi.util.PropertyUtil;
+import com.intellij.util.Query;
+import com.siyeh.InspectionGadgetsBundle;
+import com.siyeh.ig.BaseInspection;
+import com.siyeh.ig.BaseInspectionVisitor;
+import com.siyeh.ig.psiutils.ClassUtils;
+import org.jetbrains.annotations.NotNull;
+
+public class CallToSimpleSetterInClassInspectionBase extends BaseInspection {
+ @SuppressWarnings("UnusedDeclaration")
+ public boolean ignoreSetterCallsOnOtherObjects = false;
+ @SuppressWarnings("UnusedDeclaration")
+ public boolean onlyReportPrivateSetter = false;
+
+ @Override
+ @NotNull
+ public String getID() {
+ return "CallToSimpleSetterFromWithinClass";
+ }
+
+ @Override
+ @NotNull
+ public String getDisplayName() {
+ return InspectionGadgetsBundle.message("call.to.simple.setter.in.class.display.name");
+ }
+
+ @Override
+ @NotNull
+ public String buildErrorString(Object... infos) {
+ return InspectionGadgetsBundle.message("call.to.simple.setter.in.class.problem.descriptor");
+ }
+
+ @Override
+ public BaseInspectionVisitor buildVisitor() {
+ return new CallToSimpleSetterInClassVisitor();
+ }
+
+ private class CallToSimpleSetterInClassVisitor extends BaseInspectionVisitor {
+
+ @Override
+ public void visitMethodCallExpression(@NotNull PsiMethodCallExpression call) {
+ super.visitMethodCallExpression(call);
+ final PsiClass containingClass = ClassUtils.getContainingClass(call);
+ if (containingClass == null) {
+ return;
+ }
+ final PsiMethod method = call.resolveMethod();
+ if (method == null) {
+ return;
+ }
+ if (!containingClass.equals(method.getContainingClass())) {
+ return;
+ }
+ final PsiReferenceExpression methodExpression = call.getMethodExpression();
+ final PsiExpression qualifier = methodExpression.getQualifierExpression();
+ if (qualifier != null && !(qualifier instanceof PsiThisExpression)) {
+ if (ignoreSetterCallsOnOtherObjects) {
+ return;
+ }
+ final PsiType type = qualifier.getType();
+ if (!(type instanceof PsiClassType)) {
+ return;
+ }
+ final PsiClassType classType = (PsiClassType)type;
+ final PsiClass qualifierClass = classType.resolve();
+ if (!containingClass.equals(qualifierClass)) {
+ return;
+ }
+ }
+ if (!PropertyUtil.isSimpleSetter(method)) {
+ return;
+ }
+ if (onlyReportPrivateSetter && !method.hasModifierProperty(PsiModifier.PRIVATE)) {
+ return;
+ }
+ final Query<PsiMethod> query = OverridingMethodsSearch.search(method, true);
+ final PsiMethod overridingMethod = query.findFirst();
+ if (overridingMethod != null) {
+ return;
+ }
+ registerMethodCallError(call);
+ }
+ }
+}
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ImportUtils.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ImportUtils.java
index 7124496..375e0f6 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ImportUtils.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ImportUtils.java
@@ -388,6 +388,14 @@
}
final PsiImportStatementBase existingImportStatement = importList.findSingleImportStatement(memberName);
if (existingImportStatement != null) {
+ if (existingImportStatement instanceof PsiImportStaticStatement) {
+ final PsiImportStaticStatement importStaticStatement = (PsiImportStaticStatement)existingImportStatement;
+ if (!memberName.equals(importStaticStatement.getReferenceName())) {
+ return false;
+ }
+ final PsiClass targetClass = importStaticStatement.resolveTargetClass();
+ return targetClass != null && qualifierClass.equals(targetClass.getQualifiedName());
+ }
return false;
}
final PsiImportStaticStatement onDemandImportStatement = findOnDemandImportStaticStatement(importList, qualifierClass);
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessaryInterfaceModifierInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessaryInterfaceModifierInspection.java
index 0a4b57e..310cc20 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessaryInterfaceModifierInspection.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessaryInterfaceModifierInspection.java
@@ -19,6 +19,7 @@
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
+import com.intellij.psi.util.PsiUtil;
import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.BaseInspection;
import com.siyeh.ig.BaseInspectionVisitor;
@@ -121,8 +122,10 @@
}
modifierList = (PsiModifierList)parent;
}
- modifierList.setModifierProperty(PsiModifier.STATIC, false);
final PsiElement modifierOwner = modifierList.getParent();
+ if (!(modifierOwner instanceof PsiMethod && PsiUtil.isLanguageLevel8OrHigher(modifierList))) {
+ modifierList.setModifierProperty(PsiModifier.STATIC, false);
+ }
assert modifierOwner != null;
if (modifierOwner instanceof PsiClass) {
final PsiClass aClass = (PsiClass)modifierOwner;
diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/classlayout/ClassWithOnlyPrivateConstructorsInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/classlayout/ClassWithOnlyPrivateConstructorsInspection.java
new file mode 100644
index 0000000..3aeebcd
--- /dev/null
+++ b/plugins/InspectionGadgets/src/com/siyeh/ig/classlayout/ClassWithOnlyPrivateConstructorsInspection.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2014 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.siyeh.ig.classlayout;
+
+import com.intellij.psi.PsiClass;
+import com.siyeh.ig.InspectionGadgetsFix;
+import com.siyeh.ig.fixes.MakeClassFinalFix;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Bas Leijdekkers
+ */
+public class ClassWithOnlyPrivateConstructorsInspection extends ClassWithOnlyPrivateConstructorsInspectionBase {
+
+ @Nullable
+ @Override
+ protected InspectionGadgetsFix buildFix(Object... infos) {
+ return new MakeClassFinalFix((PsiClass)infos[0]);
+ }
+}
diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/fixes/InlineCallFix.java b/plugins/InspectionGadgets/src/com/siyeh/ig/fixes/InlineCallFix.java
index 43e5774..b9503e2 100644
--- a/plugins/InspectionGadgets/src/com/siyeh/ig/fixes/InlineCallFix.java
+++ b/plugins/InspectionGadgets/src/com/siyeh/ig/fixes/InlineCallFix.java
@@ -16,52 +16,54 @@
package com.siyeh.ig.fixes;
import com.intellij.codeInspection.ProblemDescriptor;
-import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiMethodCallExpression;
import com.intellij.psi.PsiReferenceExpression;
-import com.intellij.refactoring.JavaRefactoringActionHandlerFactory;
-import com.intellij.refactoring.RefactoringActionHandler;
+import com.intellij.refactoring.JavaRefactoringSettings;
+import com.intellij.refactoring.inline.InlineMethodProcessor;
import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.InspectionGadgetsFix;
import org.jetbrains.annotations.NotNull;
public class InlineCallFix extends InspectionGadgetsFix {
- @Override
- @NotNull
- public String getFamilyName() {
- return getName();
- }
+ private String myName;
+
+ public InlineCallFix(String name) {
+ myName = name;
+ }
+
+ public InlineCallFix() {
+ this(InspectionGadgetsBundle.message("inline.call.quickfix"));
+ }
+
+ @Override
+ @NotNull
+ public String getFamilyName() {
+ return myName;
+ }
@Override
@NotNull
public String getName() {
- return InspectionGadgetsBundle.message("inline.call.quickfix");
+ return getFamilyName();
}
@Override
public void doFix(final Project project, ProblemDescriptor descriptor) {
final PsiElement nameElement = descriptor.getPsiElement();
- final PsiReferenceExpression methodExpression =
- (PsiReferenceExpression)nameElement.getParent();
- assert methodExpression != null;
- final PsiMethodCallExpression methodCallExpression =
- (PsiMethodCallExpression)methodExpression.getParent();
- final JavaRefactoringActionHandlerFactory factory =
- JavaRefactoringActionHandlerFactory.getInstance();
- final RefactoringActionHandler inlineHandler = factory.createInlineHandler();
- final Runnable runnable = new Runnable() {
- @Override
- public void run() {
- inlineHandler.invoke(project, new PsiElement[]{methodCallExpression}, null);
- }
- };
- if (ApplicationManager.getApplication().isUnitTestMode()) {
- runnable.run();
- }
- else {
- ApplicationManager.getApplication().invokeLater(runnable, project.getDisposed());
- }
+ final PsiReferenceExpression methodExpression = (PsiReferenceExpression)nameElement.getParent();
+ if (methodExpression == null) return;
+ final PsiMethodCallExpression methodCallExpression = (PsiMethodCallExpression)methodExpression.getParent();
+ final PsiMethod method = methodCallExpression.resolveMethod();
+ if (method == null) return;
+ inline(project, methodExpression, method);
+ }
+
+ protected void inline(Project project, PsiReferenceExpression methodExpression, PsiMethod method) {
+ new InlineMethodProcessor(project, method, methodExpression, null, true,
+ JavaRefactoringSettings.getInstance().RENAME_SEARCH_IN_COMMENTS_FOR_METHOD,
+ JavaRefactoringSettings.getInstance().RENAME_SEARCH_FOR_TEXT_FOR_METHOD).inlineMethodCall(methodExpression);
}
}
diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/performance/CallToSimpleGetterInClassInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/performance/CallToSimpleGetterInClassInspection.java
new file mode 100644
index 0000000..c550093
--- /dev/null
+++ b/plugins/InspectionGadgets/src/com/siyeh/ig/performance/CallToSimpleGetterInClassInspection.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2003-2011 Dave Griffith, Bas Leijdekkers
+ *
+ * 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.siyeh.ig.performance;
+
+import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiExpressionStatement;
+import com.intellij.psi.PsiMethod;
+import com.intellij.psi.PsiReferenceExpression;
+import com.siyeh.InspectionGadgetsBundle;
+import com.siyeh.ig.InspectionGadgetsFix;
+import com.siyeh.ig.fixes.InlineCallFix;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+public class CallToSimpleGetterInClassInspection extends CallToSimpleGetterInClassInspectionBase {
+ @Override
+ @Nullable
+ public JComponent createOptionsPanel() {
+ final MultipleCheckboxOptionsPanel optionsPanel = new MultipleCheckboxOptionsPanel(this);
+ optionsPanel.addCheckbox(InspectionGadgetsBundle.message("call.to.simple.getter.in.class.ignore.option"),
+ "ignoreGetterCallsOnOtherObjects");
+ optionsPanel.addCheckbox(InspectionGadgetsBundle.message("call.to.private.simple.getter.in.class.option"),
+ "onlyReportPrivateGetter");
+ return optionsPanel;
+ }
+
+ @Override
+ public InspectionGadgetsFix buildFix(Object... infos) {
+ return new InlineOrDeleteCallFix(InspectionGadgetsBundle.message("call.to.simple.getter.in.class.inline.quickfix"));
+ }
+
+ private static class InlineOrDeleteCallFix extends InlineCallFix {
+ public InlineOrDeleteCallFix(String name) {
+ super(name);
+ }
+
+ @Override
+ protected void inline(Project project, PsiReferenceExpression methodExpression, PsiMethod method) {
+ final PsiElement statement = methodExpression.getParent().getParent();
+ if (statement instanceof PsiExpressionStatement) {
+ statement.delete();
+ } else {
+ super.inline(project, methodExpression, method);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/performance/CallToSimpleSetterInClassInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/performance/CallToSimpleSetterInClassInspection.java
new file mode 100644
index 0000000..652a8e89
--- /dev/null
+++ b/plugins/InspectionGadgets/src/com/siyeh/ig/performance/CallToSimpleSetterInClassInspection.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2003-2011 Dave Griffith, Bas Leijdekkers
+ *
+ * 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.siyeh.ig.performance;
+
+import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel;
+import com.siyeh.InspectionGadgetsBundle;
+import com.siyeh.ig.InspectionGadgetsFix;
+import com.siyeh.ig.fixes.InlineCallFix;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+public class CallToSimpleSetterInClassInspection extends CallToSimpleSetterInClassInspectionBase {
+
+ @Override
+ @Nullable
+ public JComponent createOptionsPanel() {
+ final MultipleCheckboxOptionsPanel optionsPanel = new MultipleCheckboxOptionsPanel(this);
+ optionsPanel.addCheckbox(InspectionGadgetsBundle.message("call.to.simple.setter.in.class.ignore.option"),
+ "ignoreSetterCallsOnOtherObjects");
+ optionsPanel.addCheckbox(InspectionGadgetsBundle.message("call.to.private.setter.in.class.option"),
+ "onlyReportPrivateSetter");
+ return optionsPanel;
+ }
+
+ @Override
+ public InspectionGadgetsFix buildFix(Object... infos) {
+ return new InlineCallFix(InspectionGadgetsBundle.message("call.to.simple.setter.in.class.inline.quickfix"));
+ }
+}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithOnlyPrivateConstructors.html b/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithOnlyPrivateConstructors.html
new file mode 100644
index 0000000..8712281
--- /dev/null
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithOnlyPrivateConstructors.html
@@ -0,0 +1,9 @@
+<html>
+<body>
+Reports classes with only <b>private</b> constructors that are not extended by any nested class.
+Such classes can not be extended and should be declared <b>final</b>.
+<!-- tooltip end -->
+<p>
+<small>New in 14</small>
+</body>
+</html>
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutConstructor.html b/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutConstructor.html
index 24229c1..184a994 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutConstructor.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutConstructor.html
@@ -1,6 +1,6 @@
<html>
<body>
-Reports a classes without constructors. Some coding standards prohibit such classes.
+Reports classes without constructors. Some coding standards prohibit such classes.
<!-- tooltip end -->
<p>
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutNoArgConstructor.html b/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutNoArgConstructor.html
index fbc102e..0ce4bbb 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutNoArgConstructor.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutNoArgConstructor.html
@@ -1,6 +1,6 @@
<html>
<body>
-Reports a classes without a no-argument constructor.
+Reports classes without a no-argument constructor.
Such constructors are necessary in some contexts if a class is to be created reflexively.
<!-- tooltip end -->
<p>
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/if_statement_with_identical_branches/IfStatementWithIdenticalBranches.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/if_statement_with_identical_branches/IfStatementWithIdenticalBranches.java
index 377e50f..666651d 100644
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/if_statement_with_identical_branches/IfStatementWithIdenticalBranches.java
+++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/if_statement_with_identical_branches/IfStatementWithIdenticalBranches.java
@@ -7,20 +7,20 @@
public class IfStatementWithIdenticalBranches {
void one() {
- if (true) {
+ <warning descr="'if' statement with identical branches">if</warning> (true) {
} else {
}
- if (false) {
+ <warning descr="'if' statement with identical branches">if</warning> (false) {
System.out.println();
return;
}
System.out.println();
}
- int two() {
- if (true) {
+ int two() {
+ <warning descr="'if' statement with identical branches">if</warning> (true) {
int i = 2;
return i;
} else {
@@ -41,7 +41,7 @@
void four() {
if (true) {
- if (false) {
+ <warning descr="'if' statement with identical branches">if</warning> (false) {
System.out.println();
return;
}
@@ -61,7 +61,7 @@
void six() {
if (true) {
- if (false) {
+ <warning descr="'if' statement with identical branches">if</warning> (false) {
System.out.println();
System.out.println();
return;
@@ -93,11 +93,11 @@
}
void nine() {
- if (true) {
+ <warning descr="'if' statement with identical branches">if</warning> (true) {
- } else if (true) {
+ } else <warning descr="'if' statement with identical branches">if</warning> (true) {
- } else if (true) {
+ } else <warning descr="'if' statement with identical branches">if</warning> (true) {
} else {
@@ -105,7 +105,7 @@
}
void blocks() {
- if (true) {
+ <warning descr="'if' statement with identical branches">if</warning> (true) {
System.out.println();
return;
}
@@ -135,4 +135,31 @@
return null;
}
+ public static String calculate(int someNumber) {
+ if (someNumber == 0 ) {
+ try {
+ return placeOrder(3, null);
+ }
+ catch( Exception e ) {
+ System.out.println("e = " + e);
+ }
+ }
+ else if (someNumber == 1) {
+ try {
+ return placeOrder(3, someNumber, null);
+ }
+ catch(Exception e ) {
+ System.out.println("e = " + e);
+ }
+ }
+ return null;
+ }
+
+ private static String placeOrder(int i, int someNumber, Object o) {
+ return null;
+ }
+
+ private static String placeOrder(int i, Object o) {
+ return null;
+ }
}
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/if_statement_with_identical_branches/expected.xml b/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/if_statement_with_identical_branches/expected.xml
deleted file mode 100644
index c85bba1..0000000
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/if_statement_with_identical_branches/expected.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<problems>
- <problem>
- <file>IfStatementWithIdenticalBranches.java</file>
- <line>10</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'if' statement with identical branches</problem_class>
- <description><code>if</code> statement with identical branches #loc</description>
- </problem>
-
- <problem>
- <file>IfStatementWithIdenticalBranches.java</file>
- <line>15</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'if' statement with identical branches</problem_class>
- <description><code>if</code> statement with identical branches #loc</description>
- </problem>
-
- <problem>
- <file>IfStatementWithIdenticalBranches.java</file>
- <line>23</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'if' statement with identical branches</problem_class>
- <description><code>if</code> statement with identical branches #loc</description>
- </problem>
-
- <problem>
- <file>IfStatementWithIdenticalBranches.java</file>
- <line>44</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'if' statement with identical branches</problem_class>
- <description><code>if</code> statement with identical branches #loc</description>
- </problem>
-
- <problem>
- <file>IfStatementWithIdenticalBranches.java</file>
- <line>64</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'if' statement with identical branches</problem_class>
- <description><code>if</code> statement with identical branches #loc</description>
- </problem>
-
- <problem>
- <file>IfStatementWithIdenticalBranches.java</file>
- <line>96</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'if' statement with identical branches</problem_class>
- <description><code>if</code> statement with identical branches #loc</description>
- </problem>
-
- <problem>
- <file>IfStatementWithIdenticalBranches.java</file>
- <line>98</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'if' statement with identical branches</problem_class>
- <description><code>if</code> statement with identical branches #loc</description>
- </problem>
-
- <problem>
- <file>IfStatementWithIdenticalBranches.java</file>
- <line>100</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'if' statement with identical branches</problem_class>
- <description><code>if</code> statement with identical branches #loc</description>
- </problem>
-
- <problem>
- <file>IfStatementWithIdenticalBranches.java</file>
- <line>108</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'if' statement with identical branches</problem_class>
- <description><code>if</code> statement with identical branches #loc</description>
- </problem>
-</problems>
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/PointlessArithmeticExpression.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/PointlessArithmeticExpression.java
index 019805a..4ba7a97 100644
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/PointlessArithmeticExpression.java
+++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/PointlessArithmeticExpression.java
@@ -124,4 +124,5 @@
long g = 8L / 8L;
long h = 9L * 0L;
int a = 8 * 0 * 8 * ; // don't warn
+ int minus = 2 - 1 - 1;
}}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/classlayout/ClassWithOnlyPrivateConstructorsInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/classlayout/ClassWithOnlyPrivateConstructorsInspectionTest.java
new file mode 100644
index 0000000..a177242
--- /dev/null
+++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/classlayout/ClassWithOnlyPrivateConstructorsInspectionTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2014 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.siyeh.ig.classlayout;
+
+import com.intellij.codeInspection.InspectionProfileEntry;
+import com.siyeh.ig.LightInspectionTestCase;
+import org.jetbrains.annotations.Nullable;
+
+public class ClassWithOnlyPrivateConstructorsInspectionTest extends LightInspectionTestCase {
+
+ public void testSimple() {
+ doTest("class /*Class 'X' with only 'private' constructors should be declared 'final'*/X/**/ {" +
+ " private X() {}" +
+ " private X(int i) {}" +
+ "}");
+ }
+
+ public void testExtendingInnerClass() {
+ doTest("class X {\n" +
+ " private X() {}\n" +
+ " class Y {\n" +
+ " class Z extends X{}\n" +
+ " }\n" +
+ "}");
+ }
+
+ public void testNoConstructors() {
+ doTest("class X {}");
+ }
+
+ @Nullable
+ @Override
+ protected InspectionProfileEntry getInspection() {
+ return new ClassWithOnlyPrivateConstructorsInspection();
+ }
+}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspectionTest.java
index 1562b8c..e3e2f9c 100644
--- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspectionTest.java
+++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspectionTest.java
@@ -1,12 +1,18 @@
package com.siyeh.ig.controlflow;
-import com.siyeh.ig.IGInspectionTestCase;
+import com.intellij.codeInspection.InspectionProfileEntry;
+import com.siyeh.ig.LightInspectionTestCase;
+import org.jetbrains.annotations.Nullable;
-public class IfStatementWithIdenticalBranchesInspectionTest
- extends IGInspectionTestCase {
+public class IfStatementWithIdenticalBranchesInspectionTest extends LightInspectionTestCase {
- public void test() throws Exception {
- doTest("com/siyeh/igtest/controlflow/if_statement_with_identical_branches",
- new IfStatementWithIdenticalBranchesInspection());
+ public void testIfStatementWithIdenticalBranches() throws Exception {
+ doTest();
+ }
+
+ @Nullable
+ @Override
+ protected InspectionProfileEntry getInspection() {
+ return new IfStatementWithIdenticalBranchesInspection();
}
}
\ No newline at end of file
diff --git a/plugins/IntelliLang/java-support/resources/javaInjections.xml b/plugins/IntelliLang/java-support/resources/javaInjections.xml
index 7bbd374..4b66c8b 100644
--- a/plugins/IntelliLang/java-support/resources/javaInjections.xml
+++ b/plugins/IntelliLang/java-support/resources/javaInjections.xml
@@ -115,5 +115,21 @@
<place><![CDATA[psiParameter().ofMethod(1, psiMethod().withName("selectNodes").withParameters("java.lang.Object", "java.lang.String").definedInClass("org.jdom.xpath.XPath"))]]></place>
<place><![CDATA[psiParameter().ofMethod(1, psiMethod().withName("selectSingleNode").withParameters("java.lang.Object", "java.lang.String").definedInClass("org.jdom.xpath.XPath"))]]></place>
</injection>
+ <injection language="encoding-reference" injector-id="java">
+ <display-name>Charset Name</display-name>
+ <place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("forName").withParameters("java.lang.String").definedInClass("java.nio.charset.Charset"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("isSupported").withParameters("java.lang.String").definedInClass("java.nio.charset.Charset"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("getBytes").withParameters("java.lang.String").definedInClass("java.lang.String"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(3, psiMethod().withName("String").withParameters("byte[]", "int", "int", "java.lang.String").definedInClass("java.lang.String"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(1, psiMethod().withName("String").withParameters("byte[]", "java.lang.String").definedInClass("java.lang.String"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(1, psiMethod().withName("InputStreamReader").withParameters("java.io.InputStream", "java.lang.String").definedInClass("java.io.InputStreamReader"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(1, psiMethod().withName("OutputStreamWriter").withParameters("java.io.OutputStream", "java.lang.String").definedInClass("java.io.OutputStreamWriter"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("toString").withParameters("java.lang.String").definedInClass("java.io.ByteArrayOutputStream"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(1, psiMethod().withName("PrintStream").withParameters("java.io.File", "java.lang.String").definedInClass("java.io.PrintStream"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(2, psiMethod().withName("PrintStream").withParameters("java.io.OutputStream", "boolean", "java.lang.String").definedInClass("java.io.PrintStream"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(1, psiMethod().withName("PrintStream").withParameters("java.lang.String", "java.lang.String").definedInClass("java.io.PrintStream"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(1, psiMethod().withName("encode").withParameters("java.lang.String", "java.lang.String").definedInClass("java.net.URLEncoder"))]]></place>
+ <place><![CDATA[psiParameter().ofMethod(1, psiMethod().withName("decode").withParameters("java.lang.String", "java.lang.String").definedInClass("java.net.URLDecoder"))]]></place>
+ </injection>
</component>
diff --git a/plugins/IntelliLang/src/META-INF/plugin.xml b/plugins/IntelliLang/src/META-INF/plugin.xml
index a7f6009..8f8806a 100644
--- a/plugins/IntelliLang/src/META-INF/plugin.xml
+++ b/plugins/IntelliLang/src/META-INF/plugin.xml
@@ -45,7 +45,7 @@
<highlightErrorFilter implementation="org.intellij.plugins.intelliLang.inject.FrankensteinErrorFilter"/>
<daemon.highlightInfoFilter implementation="org.intellij.plugins.intelliLang.inject.FrankensteinErrorFilter"/>
- <projectConfigurable displayName="Language Injections" dynamic="true" instance="org.intellij.plugins.intelliLang.InjectionsSettingsUI" nonDefaultProject="true"/>
+ <projectConfigurable groupId="editor" displayName="Language Injections" dynamic="true" instance="org.intellij.plugins.intelliLang.InjectionsSettingsUI" nonDefaultProject="true"/>
<multiHostInjector implementation="org.intellij.plugins.intelliLang.inject.CommentLanguageInjector"/>
<multiHostInjector implementation="org.intellij.plugins.intelliLang.inject.TemporaryPlacesInjector"/>
diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectorUtils.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectorUtils.java
index 4211fdf..48ee3b5 100644
--- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectorUtils.java
+++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectorUtils.java
@@ -16,6 +16,7 @@
package org.intellij.plugins.intelliLang.inject;
+import com.intellij.codeInsight.completion.CompletionUtil;
import com.intellij.lang.Language;
import com.intellij.lang.injection.MultiHostRegistrar;
import com.intellij.openapi.extensions.Extensions;
@@ -25,12 +26,16 @@
import com.intellij.psi.*;
import com.intellij.psi.impl.source.tree.injected.MultiHostRegistrarImpl;
import com.intellij.psi.impl.source.tree.injected.Place;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.ArrayUtil;
-import com.intellij.util.NullableFunction;
import com.intellij.util.ObjectUtils;
-import com.intellij.util.SmartList;
+import com.intellij.util.Producer;
import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.text.CharArrayUtil;
+import com.intellij.util.text.StringSearcher;
+import gnu.trove.TIntArrayList;
import org.intellij.plugins.intelliLang.Configuration;
import org.intellij.plugins.intelliLang.inject.config.BaseInjection;
import org.jetbrains.annotations.NotNull;
@@ -220,18 +225,117 @@
return true;
}
+ @Nullable
public static BaseInjection findCommentInjection(PsiElement context, final String supportId, final Ref<PsiElement> causeRef) {
- return findNearestComment(context, new NullableFunction<PsiComment, BaseInjection>() {
+ PsiElement target = CompletionUtil.getOriginalOrSelf(context);
+ PsiFile file = target.getContainingFile();
+ TreeMap<TextRange, BaseInjection> map = getInjectionMap(file);
+ Map.Entry<TextRange, BaseInjection> entry = map == null ? null : map.lowerEntry(target.getTextRange());
+ if (entry == null) return null;
+
+ PsiComment psiComment = PsiTreeUtil.findElementOfClassAtOffset(file, entry.getKey().getStartOffset(), PsiComment.class, false);
+ if (psiComment == null) return null;
+ TextRange r0 = psiComment.getTextRange();
+
+ // calulate topmost siblings & heights
+ PsiElement commonParent = PsiTreeUtil.findCommonParent(psiComment, target);
+ int h1 = 0, h2 = 0;
+ PsiElement e1 = psiComment, e2 = target;
+ for (PsiElement e = e1; e != commonParent; e1 = e, e = e.getParent(), h1++);
+ for (PsiElement e = e2; e != commonParent; e2 = e, e = e.getParent(), h2++);
+
+ // make sure comment is close enough and ...
+ int off1 = r0.getEndOffset();
+ int off2 = e2.getTextRange().getStartOffset();
+ if (off2 - off1 > 120) return null;
+ if (off2 - off1 > 2) {
+ // ... there's nothing in between on the top level and ...
+ for (PsiElement e = e1; e != e2; e = e.getNextSibling()) {
+ if (!isWhitespaceCommentOrBlank(e)) return null;
+ }
+ // ... there's no non-empty host in the left (comment) subtree
+ Producer<PsiElement> producer = prevWalker(PsiTreeUtil.getDeepestLast(e1), e1);
+ PsiElement e;
+ while ( (e = producer.produce()) != null && e != psiComment) {
+ if (e instanceof PsiLanguageInjectionHost && !StringUtil.isEmptyOrSpaces(e.getText())) {
+ return null;
+ }
+ }
+ }
+ if (causeRef != null) {
+ causeRef.set(psiComment);
+ }
+ return new BaseInjection(supportId).copyFrom(entry.getValue());
+ }
+
+ protected static boolean isWhitespaceCommentOrBlank(PsiElement e) {
+ return e instanceof PsiWhiteSpace || e instanceof PsiComment ||
+ e instanceof PsiLanguageInjectionHost && StringUtil.isEmptyOrSpaces(e.getText());
+ }
+
+ protected static TreeMap<TextRange, BaseInjection> getInjectionMap(final PsiFile file) {
+ return CachedValuesManager.getCachedValue(file, new CachedValueProvider<TreeMap<TextRange, BaseInjection>>() {
@Nullable
@Override
- public BaseInjection fun(PsiComment comment) {
- if (causeRef != null) causeRef.set(comment);
- String text = ElementManipulators.getValueText(comment).trim();
- return detectInjectionFromText(supportId, text);
+ public Result<TreeMap<TextRange, BaseInjection>> compute() {
+ TreeMap<TextRange, BaseInjection> map = calcInjections(file);
+ return Result.create(map.isEmpty() ? null : map, file);
}
});
}
+ @NotNull
+ protected static TreeMap<TextRange, BaseInjection> calcInjections(PsiFile file) {
+ final TreeMap<TextRange, BaseInjection> injectionMap = new TreeMap<TextRange, BaseInjection>(RANGE_COMPARATOR);
+
+ TIntArrayList ints = new TIntArrayList();
+ StringSearcher searcher = new StringSearcher("language=", true, true, false);
+ CharSequence contents = file.getViewProvider().getContents();
+ final char[] contentsArray = CharArrayUtil.fromSequenceWithoutCopying(contents);
+
+ //long time = System.currentTimeMillis();
+
+ int s0 = 0, s1 = contents.length();
+ for (int idx = searcher.scan(contents, contentsArray, s0, s1);
+ idx != -1;
+ idx = searcher.scan(contents, contentsArray, idx + 1, s1)) {
+ ints.add(idx);
+ PsiComment element = PsiTreeUtil.findElementOfClassAtOffset(file, idx, PsiComment.class, false);
+ if (element != null) {
+ String str = ElementManipulators.getValueText(element).trim();
+ BaseInjection injection = detectInjectionFromText("", str);
+ if (injection != null) {
+ injectionMap.put(element.getTextRange(), injection);
+ }
+ }
+ }
+
+ //VirtualFile virtualFile = file.getVirtualFile();
+ //Document document = FileDocumentManager.getInstance().getDocument(virtualFile);
+ //EditorHighlighter highlighter = EditorHighlighterCache.getEditorHighlighterForCachesBuilding(document);
+ //
+ //ParserDefinition definition = LanguageParserDefinitions.INSTANCE.forLanguage(file.getLanguage());
+ //TokenSet commentTokens = definition.getCommentTokens();
+ //HighlighterIterator it = highlighter != null && PlatformIdTableBuilding.checkCanUseCachedEditorHighlighter(contents, highlighter) ?
+ // highlighter.createIterator(0) : null;
+ //
+ //do {
+ // if (it != null) {
+ // while (!it.atEnd() && !commentTokens.contains(it.getTokenType())) it.advance();
+ // if (it.atEnd()) break;
+ // }
+ // int s0 = it == null ? 0 : it.getStart();
+ // int s1 = it == null ? contents.length() : it.getEnd();
+ //
+ // for () { .. }
+ //
+ // if (it != null && !it.atEnd()) it.advance();
+ //} while (it != null && !it.atEnd());
+
+ //System.out.println(Thread.currentThread().getName() + ": " + file.getName() + "@" + file.hashCode() + " indexed: " + (System.currentTimeMillis() - time));
+ return injectionMap;
+ }
+
private static final Pattern MAP_ENTRY_PATTERN = Pattern.compile("([\\S&&[^=]]+)=(\"(?:[^\"]|\\\\\")*\"|\\S*)");
public static Map<String, String> decodeMap(CharSequence charSequence) {
if (StringUtil.isEmpty(charSequence)) return Collections.emptyMap();
@@ -259,68 +363,30 @@
return injection;
}
- @Nullable
- public static <T> T findNearestComment(PsiElement element, NullableFunction<PsiComment, T> processor) {
- if (element instanceof PsiComment) return null;
- PsiFile containingFile = element.getContainingFile();
+ private static Producer<PsiElement> prevWalker(final PsiElement element, final PsiElement scope) {
+ return new Producer<PsiElement>() {
+ PsiElement e = element;
- List<PsiLanguageInjectionHost> otherHosts = new SmartList<PsiLanguageInjectionHost>();
-
- boolean commentOrSpaces = false;
-
- PsiElement prev = element, e = prevOrParent(element, containingFile);
- for (int counter = 0; e != null && counter < 100; prev = e, e = prevOrParent(e, containingFile), counter ++) {
- if (e instanceof PsiComment) {
- commentOrSpaces = true;
- PsiComment comment = (PsiComment)e;
- if (!checkDepth(otherHosts, element, comment)) continue;
- T value = processor.fun(comment);
- if (value != null) return value;
- }
- else if (e instanceof PsiWhiteSpace) {
- commentOrSpaces = true;
- }
- else if (e instanceof PsiLanguageInjectionHost) {
- commentOrSpaces = StringUtil.isEmptyOrSpaces(e.getText()); // check getText only for hosts (XmlText)
- if (!commentOrSpaces) otherHosts.add((PsiLanguageInjectionHost)e);
- }
- else {
- commentOrSpaces = false;
- }
- }
- if (commentOrSpaces) { // allow several comments
- for (e = prevOrParent(prev, containingFile); e != null; e = e.getPrevSibling()) {
- if (e instanceof PsiComment) {
- PsiComment comment = (PsiComment)e;
- if (!checkDepth(otherHosts, element, comment)) continue;
- T value = processor.fun(comment);
- if (value != null) return value;
+ @Nullable
+ @Override
+ public PsiElement produce() {
+ if (e == null || e == scope) return null;
+ PsiElement prev = e.getPrevSibling();
+ if (prev != null) {
+ e = prev;
+ while (true) {
+ PsiElement lastChild = e.getLastChild();
+ if (lastChild == null) break;
+ e = lastChild;
+ }
+ return e;
}
- else if (!(e instanceof PsiWhiteSpace)) {
- break;
+ else {
+ PsiElement parent = e.getParent();
+ e = parent == scope || parent instanceof PsiFile ? null : parent;
+ return e;
}
}
- }
- return null;
- }
-
- // allow java-like multi variable commenting: String s = "s", t = "t"
- // a comment should cover all hosts in a subtree
- private static boolean checkDepth(List<PsiLanguageInjectionHost> hosts, PsiElement element, PsiComment comment) {
- if (hosts.isEmpty()) return true;
- PsiElement parent = PsiTreeUtil.findCommonParent(comment, element);
- for (PsiLanguageInjectionHost host : hosts) {
- if (!PsiTreeUtil.isAncestor(parent, PsiTreeUtil.findCommonParent(host, element), true)) return false;
- }
- return true;
- }
-
- @Nullable
- public static PsiElement prevOrParent(PsiElement e, PsiElement scope) {
- if (e == null || e == scope) return null;
- PsiElement prev = e.getPrevSibling();
- if (prev != null) return PsiTreeUtil.getDeepestLast(prev);
- PsiElement parent = e.getParent();
- return parent == scope || parent instanceof PsiFile ? null : parent;
+ };
}
}
diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/FlipAssertLiteralIntention.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/FlipAssertLiteralIntention.java
index d3a8d4c..d331042 100644
--- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/FlipAssertLiteralIntention.java
+++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/FlipAssertLiteralIntention.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2013 Dave Griffith, Bas Leijdekkers
+ * Copyright 2003-2014 Dave Griffith, Bas Leijdekkers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
*/
package com.siyeh.ipp.junit;
-import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.psi.*;
+import com.intellij.psi.util.InheritanceUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.siyeh.IntentionPowerPackBundle;
import com.siyeh.ig.PsiReplacementUtil;
@@ -67,11 +67,10 @@
@NonNls final StringBuilder newCall = new StringBuilder();
final PsiElement qualifier = methodExpression.getQualifier();
if (qualifier == null) {
- final PsiMethod containingMethod = PsiTreeUtil.getParentOfType(call, PsiMethod.class);
- if (containingMethod != null && AnnotationUtil.isAnnotated(containingMethod, "org.junit.Test", true)) {
- if (!ImportUtils.addStaticImport("org.junit.Assert", toMethodName, element)) {
- newCall.append("org.junit.Assert.");
- }
+ final PsiClass containingClass = PsiTreeUtil.getParentOfType(element, PsiClass.class);
+ if (!InheritanceUtil.isInheritor(containingClass, "junit.framework.Assert") &&
+ !ImportUtils.addStaticImport("org.junit.Assert", toMethodName, element)) {
+ newCall.append("org.junit.Assert.");
}
}
else {
@@ -88,6 +87,6 @@
newCall.append(BoolUtils.getNegatedExpressionText(arguments[1]));
}
newCall.append(')');
- PsiReplacementUtil.replaceExpression(call, newCall.toString());
+ PsiReplacementUtil.replaceExpressionAndShorten(call, newCall.toString());
}
}
\ No newline at end of file
diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/ReplaceAssertEqualsWithAssertLiteralIntention.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/ReplaceAssertEqualsWithAssertLiteralIntention.java
index cb27659..e972b18 100644
--- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/ReplaceAssertEqualsWithAssertLiteralIntention.java
+++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/ReplaceAssertEqualsWithAssertLiteralIntention.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2013 Dave Griffith, Bas Leijdekkers
+ * Copyright 2003-2014 Dave Griffith, Bas Leijdekkers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
*/
package com.siyeh.ipp.junit;
-import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.psi.*;
+import com.intellij.psi.util.InheritanceUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.siyeh.IntentionPowerPackBundle;
import com.siyeh.ig.PsiReplacementUtil;
@@ -86,11 +86,10 @@
final PsiElement qualifier = expression.getQualifier();
@NonNls final StringBuilder newExpression = new StringBuilder();
if (qualifier == null) {
- final PsiMethod containingMethod = PsiTreeUtil.getParentOfType(call, PsiMethod.class);
- if (containingMethod != null && AnnotationUtil.isAnnotated(containingMethod, "org.junit.Test", true)) {
- if (!ImportUtils.addStaticImport("org.junit.Assert", assertString, element)) {
- newExpression.append("org.junit.Assert.");
- }
+ final PsiClass containingClass = PsiTreeUtil.getParentOfType(element, PsiClass.class);
+ if (!InheritanceUtil.isInheritor(containingClass, "junit.framework.Assert") &&
+ !ImportUtils.addStaticImport("org.junit.Assert", assertString, element)) {
+ newExpression.append("org.junit.Assert.");
}
}
else {
diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/ReplaceAssertLiteralWithAssertEqualsIntention.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/ReplaceAssertLiteralWithAssertEqualsIntention.java
index 7bc8b2b..a3e318e 100644
--- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/ReplaceAssertLiteralWithAssertEqualsIntention.java
+++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/junit/ReplaceAssertLiteralWithAssertEqualsIntention.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2013 Dave Griffith, Bas Leijdekkers
+ * Copyright 2003-2014 Dave Griffith, Bas Leijdekkers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,9 +15,9 @@
*/
package com.siyeh.ipp.junit;
-import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.psi.*;
import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.InheritanceUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.siyeh.IntentionPowerPackBundle;
import com.siyeh.ig.PsiReplacementUtil;
@@ -73,11 +73,10 @@
@NonNls final StringBuilder newExpression = new StringBuilder();
final PsiElement qualifier = methodExpression.getQualifier();
if (qualifier == null) {
- final PsiMethod containingMethod = PsiTreeUtil.getParentOfType(call, PsiMethod.class);
- if (containingMethod != null && AnnotationUtil.isAnnotated(containingMethod, "org.junit.Test", true)) {
- if (!ImportUtils.addStaticImport("org.junit.Assert", "assertEquals", element)) {
- newExpression.append("org.junit.Assert.");
- }
+ final PsiClass containingClass = PsiTreeUtil.getParentOfType(element, PsiClass.class);
+ if (!InheritanceUtil.isInheritor(containingClass, "junit.framework.Assert") &&
+ !ImportUtils.addStaticImport("org.junit.Assert", "assertEquals", element)) {
+ newExpression.append("org.junit.Assert.");
}
}
else {
diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/types/ReplaceMethodRefWithLambdaIntention.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/types/ReplaceMethodRefWithLambdaIntention.java
index 8ffc5ee..f26a417 100644
--- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/types/ReplaceMethodRefWithLambdaIntention.java
+++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/types/ReplaceMethodRefWithLambdaIntention.java
@@ -19,6 +19,7 @@
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
+import com.intellij.psi.codeStyle.SuggestedNameInfo;
import com.intellij.psi.codeStyle.VariableKind;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
@@ -45,24 +46,38 @@
protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
final PsiMethodReferenceExpression referenceExpression = PsiTreeUtil.getParentOfType(element, PsiMethodReferenceExpression.class);
LOG.assertTrue(referenceExpression != null);
+ final PsiElement resolve = referenceExpression.resolve();
+ final boolean isReceiver = resolve instanceof PsiMethod && PsiMethodReferenceUtil.hasReceiver(referenceExpression, (PsiMethod)resolve);
+ final PsiParameter[] psiParameters = resolve instanceof PsiMethod ? ((PsiMethod)resolve).getParameterList().getParameters() : null;
final PsiType functionalInterfaceType = referenceExpression.getFunctionalInterfaceType();
final PsiClassType.ClassResolveResult functionalInterfaceResolveResult = PsiUtil.resolveGenericsClassInType(functionalInterfaceType);
final PsiMethod interfaceMethod = LambdaUtil.getFunctionalInterfaceMethod(functionalInterfaceType);
+ LOG.assertTrue(interfaceMethod != null);
+ final PsiSubstitutor psiSubstitutor = LambdaUtil.getSubstitutor(interfaceMethod, functionalInterfaceResolveResult);
final StringBuilder buf = new StringBuilder("(");
LOG.assertTrue(functionalInterfaceType != null);
buf.append(functionalInterfaceType.getCanonicalText()).append(")(");
- LOG.assertTrue(interfaceMethod != null);
- final PsiParameter[] parameters = interfaceMethod.getParameterList().getParameters();
+ final PsiParameterList parameterList = interfaceMethod.getParameterList();
+ final PsiParameter[] parameters = parameterList.getParameters();
final Map<PsiParameter, String> map = new HashMap<PsiParameter, String>();
final JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(element.getProject());
final String paramsString = StringUtil.join(parameters, new Function<PsiParameter, String>() {
@Override
public String fun(PsiParameter parameter) {
- String parameterName = parameter.getName();
- if (parameterName != null) {
- final String baseName = codeStyleManager.variableNameToPropertyName(parameterName, VariableKind.PARAMETER);
- parameterName = codeStyleManager.suggestUniqueVariableName(baseName, referenceExpression, true);
+ final int parameterIndex = parameterList.getParameterIndex(parameter);
+ String baseName;
+ if (isReceiver && parameterIndex == 0) {
+ final SuggestedNameInfo nameInfo = codeStyleManager.suggestVariableName(VariableKind.PARAMETER, null, null, psiSubstitutor.substitute(parameter.getType()));
+ baseName = nameInfo.names.length > 0 ? nameInfo.names[0] : parameter.getName();
+ }
+ else {
+ final String initialName = psiParameters != null ? psiParameters[parameterIndex - (isReceiver ? 1 : 0)].getName() : parameter.getName();
+ baseName = codeStyleManager.variableNameToPropertyName(initialName, VariableKind.PARAMETER);
+ }
+
+ if (baseName != null) {
+ String parameterName = codeStyleManager.suggestUniqueVariableName(baseName, referenceExpression, true);
map.put(parameter, parameterName);
return parameterName;
}
@@ -92,11 +107,10 @@
final boolean onArrayRef =
JavaPsiFacade.getElementFactory(element.getProject()).getArrayClass(PsiUtil.getLanguageLevel(element)) == containingClass;
- boolean isReceiver = PsiMethodReferenceUtil.isReceiverType(functionalInterfaceType, containingClass, resolveElement instanceof PsiMethod ? (PsiMethod)resolveElement : null);
final PsiElement referenceNameElement = referenceExpression.getReferenceNameElement();
if (isReceiver){
- buf.append(parameters[0].getName()).append(".");
+ buf.append(map.get(parameters[0])).append(".");
} else {
if (!(referenceNameElement instanceof PsiKeyword)) {
if (qualifier instanceof PsiTypeElement) {
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/ExistingStaticImport.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/ExistingStaticImport.java
new file mode 100644
index 0000000..96be19e
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/ExistingStaticImport.java
@@ -0,0 +1,11 @@
+import org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+
+class X {
+ @Test
+ void t() {
+ <caret>assertTrue(true);
+ }
+}
\ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/ExistingStaticImport_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/ExistingStaticImport_after.java
new file mode 100644
index 0000000..8eccf08
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/ExistingStaticImport_after.java
@@ -0,0 +1,11 @@
+import org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+
+class X {
+ @Test
+ void t() {
+ assertFalse(!true);
+ }
+}
\ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/StaticImportWithoutTestMethod.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/StaticImportWithoutTestMethod.java
new file mode 100644
index 0000000..369c92e
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/StaticImportWithoutTestMethod.java
@@ -0,0 +1,8 @@
+import static org.junit.Assert.assertTrue;
+
+class StaticImportWithoutTestMethod {
+
+ void t() {
+ <caret>assertTrue(false);
+ }
+}
\ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/StaticImportWithoutTestMethod_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/StaticImportWithoutTestMethod_after.java
new file mode 100644
index 0000000..5bf7c4d
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/flip_assert_literal/StaticImportWithoutTestMethod_after.java
@@ -0,0 +1,9 @@
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+class StaticImportWithoutTestMethod {
+
+ void t() {
+ assertFalse(!false);
+ }
+}
\ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_equals_with_assert_literal/OutsideTestMethod.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_equals_with_assert_literal/OutsideTestMethod.java
new file mode 100644
index 0000000..5af128b
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_equals_with_assert_literal/OutsideTestMethod.java
@@ -0,0 +1,8 @@
+import static org.junit.Assert.assertEquals;
+
+class OutsideTestMethod {
+
+ void m() {
+ <caret>assertEquals("asdf", null);
+ }
+}
\ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_equals_with_assert_literal/OutsideTestMethod_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_equals_with_assert_literal/OutsideTestMethod_after.java
new file mode 100644
index 0000000..e3291d9
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_equals_with_assert_literal/OutsideTestMethod_after.java
@@ -0,0 +1,9 @@
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+class OutsideTestMethod {
+
+ void m() {
+ assertNull("asdf");
+ }
+}
\ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_literal_with_assert_equals/OutsideTestMethod.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_literal_with_assert_equals/OutsideTestMethod.java
new file mode 100644
index 0000000..34c9850
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_literal_with_assert_equals/OutsideTestMethod.java
@@ -0,0 +1,8 @@
+import static org.junit.Assert.assertNull;
+
+class OutsideTestMethod {
+
+ void m() {
+ <caret>assertNull("asdf");
+ }
+}
\ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_literal_with_assert_equals/OutsideTestMethod_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_literal_with_assert_equals/OutsideTestMethod_after.java
new file mode 100644
index 0000000..0d6315f
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/replace_assert_literal_with_assert_equals/OutsideTestMethod_after.java
@@ -0,0 +1,9 @@
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+class OutsideTestMethod {
+
+ void m() {
+ assertEquals(null, "asdf");
+ }
+}
\ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Ambiguity_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Ambiguity_after.java
index b0e14f1..2d27aef 100644
--- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Ambiguity_after.java
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Ambiguity_after.java
@@ -14,6 +14,6 @@
static void call(int i, I2 s) {}
public static void main(String[] args) {
- call(1, (x) -> MyTest.m(x));
+ call(1, (i) -> MyTest.m(i));
}
}
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayMethodRef_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayMethodRef_after.java
index 65a55a5..94c8d2f 100644
--- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayMethodRef_after.java
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayMethodRef_after.java
@@ -1,6 +1,6 @@
public class Foo {
static void foo() {
- Cln j = (p) -> p.clone();
+ Cln j = (ints) -> ints.clone();
}
interface Cln {
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInference1_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInference1_after.java
index b61947e4..bd87439 100644
--- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInference1_after.java
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInference1_after.java
@@ -10,8 +10,8 @@
static void m(I s) {}
static {
- m((s) -> {
- new Foo<Integer>(s);
+ m((x) -> {
+ new Foo<Integer>(x);
});
}
}
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInference_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInference_after.java
index 22e5bef..cd93789 100644
--- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInference_after.java
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInference_after.java
@@ -11,6 +11,6 @@
}
static {
- I<String> s = (z) -> new MyTest<String>(z);
+ I<String> s = (x) -> new MyTest<String>(x);
}
}
\ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInnerClass_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInnerClass_after.java
index 600af26..0d1106d 100644
--- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInnerClass_after.java
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsInnerClass_after.java
@@ -8,6 +8,6 @@
}
static {
- I i1 = (receiver) -> new Inner(receiver);
+ I i1 = (mt) -> new Inner(mt);
}
}
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsStaticInnerClass_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsStaticInnerClass_after.java
index fdce482..c26cd8a 100644
--- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsStaticInnerClass_after.java
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/NewRefsStaticInnerClass_after.java
@@ -10,6 +10,6 @@
static {
- I i1 = (receiver) -> new Inner(receiver);
+ I i1 = (outer) -> new Inner(outer);
}
}
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Receiver_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Receiver_after.java
index 9f5bcaf..5b3eaf8 100644
--- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Receiver_after.java
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Receiver_after.java
@@ -11,6 +11,6 @@
}
static {
- I i = (I) (receiver) -> receiver.m();
+ I i = (I) (myTest) -> myTest.m();
}
}
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Subst_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Subst_after.java
index c719cce..2ff6fee 100644
--- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Subst_after.java
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/Subst_after.java
@@ -5,5 +5,5 @@
}
class Test {
- Comparator<Bar> comparator = (o1, o2) -> o1.xxx(o2);
+ Comparator<Bar> comparator = (bar, p) -> bar.xxx(p);
}
\ No newline at end of file
diff --git a/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/junit/FlipAssertLiteralIntentionTest.java b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/junit/FlipAssertLiteralIntentionTest.java
index 9837187..4bd28a4 100644
--- a/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/junit/FlipAssertLiteralIntentionTest.java
+++ b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/junit/FlipAssertLiteralIntentionTest.java
@@ -10,6 +10,8 @@
public class FlipAssertLiteralIntentionTest extends IPPTestCase {
public void testMessage() { doTest(); }
+ public void testExistingStaticImport() { doTest(); }
+ public void testStaticImportWithoutTestMethod() { doTest(); }
@Override
protected void setUp() throws Exception {
@@ -18,6 +20,10 @@
"class Assert {" +
" public static void assertTrue(java.lang.String message, boolean condition) {}" +
"}");
+ myFixture.addClass("package org.junit;" +
+ "@Retention(RetentionPolicy.RUNTIME)" +
+ "@Target({ElementType.METHOD})" +
+ "public @interface Test {}");
}
@Override
diff --git a/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/junit/ReplaceAssertEqualsWithAssertLiteralIntentionTest.java b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/junit/ReplaceAssertEqualsWithAssertLiteralIntentionTest.java
new file mode 100644
index 0000000..529beaa
--- /dev/null
+++ b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/junit/ReplaceAssertEqualsWithAssertLiteralIntentionTest.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2014 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.siyeh.ipp.junit;
+
+import com.siyeh.IntentionPowerPackBundle;
+import com.siyeh.ipp.IPPTestCase;
+
+/**
+ * @see ReplaceAssertEqualsWithAssertLiteralIntention
+ * @author Bas Leijdekkers
+ */
+public class ReplaceAssertEqualsWithAssertLiteralIntentionTest extends IPPTestCase {
+
+ public void testOutsideTestMethod() { doTest(); }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ myFixture.addClass("package org.junit;" +
+ "class Assert {" +
+ " static public void assertEquals(Object expected, Object actual) {}" +
+ "}");
+ }
+
+ @Override
+ protected String getRelativePath() {
+ return "junit/replace_assert_equals_with_assert_literal";
+ }
+
+ @Override
+ protected String getIntentionName() {
+ return IntentionPowerPackBundle.message("replace.assert.equals.with.assert.literal.intention.name", "assertNull");
+ }
+}
diff --git a/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/junit/ReplaceAssertLiteralWithAssertEqualsIntentionTest.java b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/junit/ReplaceAssertLiteralWithAssertEqualsIntentionTest.java
new file mode 100644
index 0000000..00be3ec
--- /dev/null
+++ b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/junit/ReplaceAssertLiteralWithAssertEqualsIntentionTest.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2014 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.siyeh.ipp.junit;
+
+import com.siyeh.IntentionPowerPackBundle;
+import com.siyeh.ipp.IPPTestCase;
+
+/**
+ * @see com.siyeh.ipp.junit.ReplaceAssertLiteralWithAssertEqualsIntention
+ * @author Bas Leijdekkers
+ */
+public class ReplaceAssertLiteralWithAssertEqualsIntentionTest extends IPPTestCase {
+
+ public void testOutsideTestMethod() { doTest(); }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ myFixture.addClass("package org.junit;" +
+ "class Assert {" +
+ " static public void assertNull(Object actual) {}" +
+ "}");
+ }
+
+ @Override
+ protected String getRelativePath() {
+ return "junit/replace_assert_literal_with_assert_equals";
+ }
+
+ @Override
+ protected String getIntentionName() {
+ return IntentionPowerPackBundle.message("replace.assert.literal.with.assert.equals.intention.name", "assertNull", "null");
+ }
+}
diff --git a/plugins/copyright/src/META-INF/plugin.xml b/plugins/copyright/src/META-INF/plugin.xml
index ea66761..8d0c4b0 100644
--- a/plugins/copyright/src/META-INF/plugin.xml
+++ b/plugins/copyright/src/META-INF/plugin.xml
@@ -11,7 +11,7 @@
<depends optional="true" config-file="java.xml">com.intellij.modules.java</depends>
<extensions defaultExtensionNs="com.intellij">
- <projectConfigurable instance="com.maddyhome.idea.copyright.ui.CopyrightProjectConfigurable"/>
+ <projectConfigurable groupId="editor" dynamic="true" displayName="Copyright" instance="com.maddyhome.idea.copyright.ui.CopyrightProjectConfigurable"/>
<errorHandler implementation="com.intellij.diagnostic.ITNReporter"/>
<checkinHandlerFactory implementation="com.maddyhome.idea.copyright.actions.UpdateCopyrightCheckinHandlerFactory"/>
<applicationService serviceInterface="com.maddyhome.idea.copyright.util.FileTypeUtil"
diff --git a/plugins/coverage-common/src/META-INF/coverage-common-plugin.xml b/plugins/coverage-common/src/META-INF/coverage-common-plugin.xml
index dcc83ce..028b043 100644
--- a/plugins/coverage-common/src/META-INF/coverage-common-plugin.xml
+++ b/plugins/coverage-common/src/META-INF/coverage-common-plugin.xml
@@ -8,7 +8,7 @@
<extensions defaultExtensionNs="com.intellij">
<testActionProvider implementation="com.intellij.coverage.actions.TrackCoverageActionProvider"/>
<projectViewNodeDecorator implementation="com.intellij.coverage.CoverageProjectViewDirectoryNodeDecorator"/>
- <projectConfigurable instance="com.intellij.coverage.CoverageOptionsConfigurable" id="coverage" displayName="Coverage" />
+ <projectConfigurable groupId="build" instance="com.intellij.coverage.CoverageOptionsConfigurable" id="coverage" displayName="Coverage" />
<projectService serviceImplementation="com.intellij.coverage.CoverageOptionsProvider"/>
<projectService serviceImplementation="com.intellij.coverage.view.CoverageViewManager"/>
<executor implementation="com.intellij.coverage.CoverageExecutor" />
diff --git a/plugins/coverage/src/com/intellij/execution/configurations/coverage/JavaCoverageEnabledConfiguration.java b/plugins/coverage/src/com/intellij/execution/configurations/coverage/JavaCoverageEnabledConfiguration.java
index f8d3c14..6a2ca1ff 100644
--- a/plugins/coverage/src/com/intellij/execution/configurations/coverage/JavaCoverageEnabledConfiguration.java
+++ b/plugins/coverage/src/com/intellij/execution/configurations/coverage/JavaCoverageEnabledConfiguration.java
@@ -23,6 +23,7 @@
import com.intellij.execution.configurations.RunConfigurationBase;
import com.intellij.execution.configurations.SimpleJavaParameters;
import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.DefaultJDOMExternalizer;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.ui.classFilter.ClassFilter;
@@ -116,6 +117,7 @@
myCoveragePatterns = coveragePatterns;
}
+ @Override
public void readExternal(Element element) throws InvalidDataException {
super.readExternal(element);
@@ -126,14 +128,13 @@
mySuiteToMergeWith = element.getAttributeValue(COVERAGE_MERGE_SUITE_ATT_NAME);
// coverage patters
- final List children = element.getChildren(COVERAGE_PATTERN_ELEMENT_NAME);
+ List<Element> children = element.getChildren(COVERAGE_PATTERN_ELEMENT_NAME);
if (children.size() > 0) {
myCoveragePatterns = new ClassFilter[children.size()];
for (int i = 0; i < children.size(); i++) {
- myCoveragePatterns[i] = new ClassFilter();
- @NonNls final Element e = (Element)children.get(i);
- myCoveragePatterns[i].readExternal(e);
- final String val = e.getAttributeValue("value");
+ Element e = children.get(i);
+ myCoveragePatterns[i] = createClassFilter(e);
+ String val = e.getAttributeValue("value");
if (val != null) {
myCoveragePatterns[i].setPattern(val);
}
@@ -141,6 +142,13 @@
}
}
+ public static ClassFilter createClassFilter(Element element) throws InvalidDataException {
+ ClassFilter filter = new ClassFilter();
+ DefaultJDOMExternalizer.readExternal(filter, element);
+ return filter;
+ }
+
+ @Override
public void writeExternal(Element element) throws WriteExternalException {
// just for backward compatibility with settings format before "Huge Coverage Refactoring"
// see [IDEA-56800] ProjectRunConfigurationManager component: "coverage" extension: "merge" attribute is misplaced
@@ -187,12 +195,13 @@
if (myCoveragePatterns != null) {
for (ClassFilter pattern : myCoveragePatterns) {
@NonNls final Element patternElement = new Element(COVERAGE_PATTERN_ELEMENT_NAME);
- pattern.writeExternal(patternElement);
+ DefaultJDOMExternalizer.writeExternal(pattern, patternElement);
element.addContent(patternElement);
}
}
}
+ @Override
@Nullable
public String getCoverageFilePath() {
if (myCoverageFilePath != null ) {
diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsstatuses/CvsChangeProvider.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsstatuses/CvsChangeProvider.java
index ee82d08..a2e055b 100644
--- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsstatuses/CvsChangeProvider.java
+++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsstatuses/CvsChangeProvider.java
@@ -169,7 +169,7 @@
for (VirtualFile file : children) {
progress.checkCanceled();
if (file.isDirectory()) {
- final boolean isIgnored = myFileIndex.isIgnored(file);
+ final boolean isIgnored = myFileIndex.isExcluded(file);
if (!isIgnored) {
processEntriesIn(file, scope, builder, true, progress);
}
diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/importToCvs/ImportTree.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/importToCvs/ImportTree.java
index 99f0384..3877a78 100644
--- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/importToCvs/ImportTree.java
+++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/importToCvs/ImportTree.java
@@ -151,11 +151,11 @@
return;
}
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
- if (!fileIndex.isIgnored(selectedFile)) {
+ if (!fileIndex.isExcluded(selectedFile)) {
return;
}
final VirtualFile parent = selectedFile.getParent();
- if (parent != null && fileIndex.isIgnored(parent)) {
+ if (parent != null && fileIndex.isExcluded(parent)) {
return;
}
for (final VirtualFile excludedFile : myExcludedFiles) {
@@ -183,11 +183,11 @@
continue;
}
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
- if (!fileIndex.isIgnored(selectedFile)) {
+ if (!fileIndex.isExcluded(selectedFile)) {
continue;
}
final VirtualFile parent = selectedFile.getParent();
- if (parent == null || fileIndex.isIgnored(parent) || myExcludedFiles.contains(parent)) {
+ if (parent == null || fileIndex.isExcluded(parent) || myExcludedFiles.contains(parent)) {
continue;
}
if (!myIncludedFiles.contains(selectedFile)) {
@@ -211,7 +211,7 @@
return true;
}
}
- if (myProject == null || !ProjectRootManager.getInstance(myProject).getFileIndex().isIgnored(file)) {
+ if (myProject == null || !ProjectRootManager.getInstance(myProject).getFileIndex().isExcluded(file)) {
return false;
}
for (VirtualFile includedFile : myIncludedFiles) {
@@ -242,7 +242,7 @@
if (FileTypeManager.getInstance().isFileIgnored(abstractFileObject.getName())) return true;
if (myProject != null && !includedFiles.contains(file)) {
final VirtualFile vFile = LocalFileSystem.getInstance().findFileByIoFile(file);
- if (vFile != null && ProjectRootManager.getInstance(myProject).getFileIndex().isIgnored(vFile)) {
+ if (vFile != null && ProjectRootManager.getInstance(myProject).getFileIndex().isExcluded(vFile)) {
return true;
}
}
diff --git a/plugins/devkit/resources/META-INF/plugin.xml b/plugins/devkit/resources/META-INF/plugin.xml
index d92839c..9bb838c 100644
--- a/plugins/devkit/resources/META-INF/plugin.xml
+++ b/plugins/devkit/resources/META-INF/plugin.xml
@@ -27,7 +27,6 @@
<junitPatcher implementation="org.jetbrains.idea.devkit.run.JUnitDevKitPatcher"/>
<antBuildGen implementation="org.jetbrains.idea.devkit.build.ant.ChunkBuildPluginExtension"/>
- <compiler.buildParticipantProvider implementation="org.jetbrains.idea.devkit.build.PluginBuildParticipantProvider"/>
<compiler.buildTargetScopeProvider implementation="org.jetbrains.idea.devkit.build.PluginModuleBuildScopeProvider"/>
<dom.fileDescription implementation="org.jetbrains.idea.devkit.dom.impl.PluginXmlDomFileDescription"/>
@@ -46,6 +45,7 @@
<dom.implementation interfaceClass="org.jetbrains.idea.devkit.dom.Extensions"
implementationClass="org.jetbrains.idea.devkit.dom.impl.ExtensionsImpl"/>
<useScopeEnlarger implementation="org.jetbrains.idea.devkit.DevKitUseScopeEnlarger"/>
+ <properties.implicitPropertyUsageProvider implementation="org.jetbrains.idea.devkit.references.RegistryImplicitPropertyUsageProvider"/>
<configurationType implementation="org.jetbrains.idea.devkit.run.PluginConfigurationType"/>
<moduleType id="PLUGIN_MODULE" implementationClass="org.jetbrains.idea.devkit.module.PluginModuleType" classpathProvider="true"/>
diff --git a/plugins/devkit/src/build/PluginBuildConfiguration.java b/plugins/devkit/src/build/PluginBuildConfiguration.java
index 3604b0f..1155402 100644
--- a/plugins/devkit/src/build/PluginBuildConfiguration.java
+++ b/plugins/devkit/src/build/PluginBuildConfiguration.java
@@ -54,13 +54,11 @@
@NonNls private static final String MANIFEST_ATTR = "manifest";
@NonNls private static final String META_INF = "META-INF";
@NonNls private static final String PLUGIN_XML = "plugin.xml";
- private final PluginBuildParticipant myBuildParticipant;
public PluginBuildConfiguration(Module module) {
myModule = module;
myPluginXmlContainer = ConfigFileFactory.getInstance().createSingleFileContainer(myModule.getProject(), PluginDescriptorConstants.META_DATA);
Disposer.register(module, myPluginXmlContainer);
- myBuildParticipant = new PluginBuildParticipant(module, this);
}
@Nullable
@@ -203,8 +201,4 @@
public void setUseUserManifest(final boolean useUserManifest) {
myUseUserManifest = useUserManifest;
}
-
- public PluginBuildParticipant getBuildParticipant() {
- return myBuildParticipant;
- }
}
diff --git a/plugins/devkit/src/build/PluginBuildParticipant.java b/plugins/devkit/src/build/PluginBuildParticipant.java
deleted file mode 100644
index 75f6c7c..0000000
--- a/plugins/devkit/src/build/PluginBuildParticipant.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright 2000-2012 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 org.jetbrains.idea.devkit.build;
-
-import com.intellij.openapi.compiler.CompileContext;
-import com.intellij.openapi.compiler.CompilerMessageCategory;
-import com.intellij.openapi.compiler.make.BuildParticipant;
-import com.intellij.openapi.deployment.DeploymentUtil;
-import com.intellij.openapi.module.Module;
-import com.intellij.openapi.projectRoots.Sdk;
-import com.intellij.openapi.roots.ModuleRootManager;
-import com.intellij.openapi.roots.OrderRootType;
-import com.intellij.openapi.roots.libraries.Library;
-import com.intellij.openapi.util.io.FileUtil;
-import com.intellij.openapi.vfs.JarFileSystem;
-import com.intellij.openapi.vfs.VfsUtil;
-import com.intellij.openapi.vfs.VfsUtilCore;
-import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.packaging.artifacts.Artifact;
-import com.intellij.packaging.elements.ArtifactRootElement;
-import com.intellij.packaging.elements.CompositePackagingElement;
-import com.intellij.packaging.elements.PackagingElement;
-import com.intellij.packaging.elements.PackagingElementFactory;
-import com.intellij.packaging.impl.artifacts.ArtifactImpl;
-import com.intellij.packaging.impl.artifacts.PlainArtifactType;
-import com.intellij.psi.xml.XmlDocument;
-import com.intellij.psi.xml.XmlFile;
-import com.intellij.psi.xml.XmlTag;
-import com.intellij.util.descriptors.ConfigFile;
-import com.intellij.util.xml.DomElement;
-import com.intellij.util.xml.DomManager;
-import org.jetbrains.annotations.NonNls;
-import org.jetbrains.idea.devkit.DevKitBundle;
-import org.jetbrains.idea.devkit.dom.Dependency;
-import org.jetbrains.idea.devkit.dom.IdeaPlugin;
-import org.jetbrains.idea.devkit.module.PluginModuleType;
-import org.jetbrains.idea.devkit.projectRoots.IdeaJdk;
-import org.jetbrains.idea.devkit.util.DescriptorUtil;
-
-import java.util.HashSet;
-import java.util.List;
-
-/**
- * @author peter
-*/
-public class PluginBuildParticipant extends BuildParticipant {
- @NonNls private static final String CLASSES = "/classes";
- @NonNls private static final String LIB = "/lib/";
- @NonNls private static final String LIB_DIRECTORY = "lib";
- private final Module myModule;
- private final PluginBuildConfiguration myPluginBuildConfiguration;
-
- public PluginBuildParticipant(final Module module, final PluginBuildConfiguration pluginBuildConfiguration) {
- super();
- myModule = module;
- myPluginBuildConfiguration = pluginBuildConfiguration;
- }
-
- @Override
- public Artifact createArtifact(CompileContext context) {
- Sdk sdk = IdeaJdk.findIdeaJdk(ModuleRootManager.getInstance(myModule).getSdk());
- if (sdk != null && IdeaJdk.isFromIDEAProject(sdk.getHomePath())) {
- return null;
- }
-
- if (sdk == null) {
- context.addMessage(CompilerMessageCategory.ERROR, DevKitBundle.message("sdk.type.incorrect", myModule.getName()), null, -1, -1);
- return null;
- }
-
- final String outputPath = PluginBuildUtil.getPluginExPath(myModule);
- if (outputPath == null) {
- return null;
- }
-
- if (!checkDependencies(context)) {
- return null;
- }
-
-
- final PackagingElementFactory factory = PackagingElementFactory.getInstance();
- final ArtifactRootElement<?> root = factory.createArtifactRootElement();
-
- ConfigFile configFile = myPluginBuildConfiguration.getPluginXML();
- if (configFile != null) {
- DeploymentUtil.getInstance().checkConfigFile(configFile, context, myModule);
- factory.addFileCopy(root, "META-INF/", VfsUtil.urlToPath(configFile.getUrl()));
-
- final XmlFile xmlFile = configFile.getXmlFile();
- if (xmlFile != null) {
- final XmlDocument document = xmlFile.getDocument();
- if (document != null) {
- final DomElement domElement = DomManager.getDomManager(xmlFile.getProject()).getDomElement(document.getRootTag());
- if (domElement instanceof IdeaPlugin) {
- for(Dependency dependency: ((IdeaPlugin)domElement).getDependencies()) {
- final String file = dependency.getConfigFile().getStringValue();
- if (file != null) {
- final VirtualFile virtualFile = configFile.getVirtualFile();
- assert virtualFile != null;
- final VirtualFile parent = virtualFile.getParent();
- assert parent != null;
- final String url = parent.getUrl();
- factory.addFileCopy(root, "META-INF/", VfsUtil.urlToPath(url) + "/" + file);
- }
- }
- }
- }
- }
- }
-
- HashSet<Module> modules = new HashSet<Module>();
- PluginBuildUtil.getDependencies(myModule, modules);
-
- final CompositePackagingElement<?> classesDir = factory.getOrCreateDirectory(root, CLASSES);
- for (Module dep : modules) {
- classesDir.addOrFindChild(factory.createModuleOutput(dep));
- }
- classesDir.addOrFindChild(factory.createModuleOutput(myModule));
-
- HashSet<Library> libs = new HashSet<Library>();
- PluginBuildUtil.getLibraries(myModule, libs);
- for (Module dependentModule : modules) {
- PluginBuildUtil.getLibraries(dependentModule, libs);
- }
-
-
- // libraries
- final VirtualFile libDir = sdk.getHomeDirectory().findFileByRelativePath(LIB_DIRECTORY);
- for (Library library : libs) {
- boolean hasDirsOnly = true;
- VirtualFile[] files = library.getFiles(OrderRootType.CLASSES);
- for (VirtualFile file : files) {
- if (file.getFileSystem() instanceof JarFileSystem) {
- hasDirsOnly = false;
- file = ((JarFileSystem)file.getFileSystem()).getVirtualFileForJar(file);
- }
- if (libDir != null && file != null && VfsUtilCore.isAncestor(libDir, file, false)) {
- context.addMessage(CompilerMessageCategory.ERROR, DevKitBundle.message("dont.add.idea.libs.to.classpath", file.getName()), null,
- -1, -1);
- }
- }
-
- final List<? extends PackagingElement<?>> elements = factory.createLibraryElements(library);
- if (hasDirsOnly) {
- //todo split one lib into 2 separate libs if there are jars and dirs
- classesDir.addOrFindChildren(elements);
- }
- else {
- factory.getOrCreateDirectory(root, LIB).addOrFindChildren(elements);
- }
- }
-
- return new ArtifactImpl(getArtifactName(), PlainArtifactType.getInstance(), false, root, FileUtil.toSystemIndependentName(outputPath));
- }
-
- private String getArtifactName() {
- return myModule.getName() + ":plugin";
- }
-
- private boolean checkDependencies(CompileContext context) {
- final Module[] wrongSetDependencies = PluginBuildUtil.getWrongSetDependencies(myModule);
- if (wrongSetDependencies.length != 0) {
- boolean realProblems = false;
- final String pluginId = DescriptorUtil.getPluginId(myModule);
-
- for (Module dependency : wrongSetDependencies) {
- if (!PluginModuleType.isOfType(dependency)) {
- realProblems = true;
- context.addMessage(CompilerMessageCategory.ERROR,
- DevKitBundle.message("incorrect.dependency.non-plugin-module", dependency.getName(), myModule.getName()), null,
- -1, -1);
- }
- else {
- final XmlFile pluginXml = PluginModuleType.getPluginXml(dependency);
- boolean isDeclared = false;
- if (pluginXml != null) {
- final XmlTag rootTag = pluginXml.getDocument().getRootTag();
- final XmlTag[] dependencies = rootTag != null ? rootTag.findSubTags("depends") : XmlTag.EMPTY;
- for (XmlTag dep : dependencies) {
- if (dep.getValue().getTrimmedText().equals(pluginId)) {
- isDeclared = true;
- break;
- }
- }
- }
- if (!isDeclared) {
- // make this a warning instead?
- realProblems = true;
- context.addMessage(CompilerMessageCategory.ERROR,
- DevKitBundle.message("incorrect.dependency.not-declared", dependency.getName(), myModule.getName()), null, -1,
- -1);
- }
- }
- }
- if (realProblems) return false;
- }
- return true;
- }
-
-}
diff --git a/plugins/devkit/src/build/PluginBuildParticipantProvider.java b/plugins/devkit/src/build/PluginBuildParticipantProvider.java
deleted file mode 100644
index b8a35d3..0000000
--- a/plugins/devkit/src/build/PluginBuildParticipantProvider.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 org.jetbrains.idea.devkit.build;
-
-import com.intellij.openapi.compiler.make.BuildParticipantProvider;
-import com.intellij.openapi.module.Module;
-import com.intellij.openapi.module.ModuleType;
-import org.jetbrains.idea.devkit.module.PluginModuleType;
-
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * @author nik
- */
-public class PluginBuildParticipantProvider extends BuildParticipantProvider {
- public Collection<PluginBuildParticipant> getParticipants(final Module module) {
- if (ModuleType.get(module) != PluginModuleType.getInstance()) {
- return Collections.emptyList();
- }
-
- final PluginBuildConfiguration configuration = PluginBuildConfiguration.getInstance(module);
- return configuration != null ? Collections.singletonList(configuration.getBuildParticipant())
- : Collections.<PluginBuildParticipant>emptyList();
- }
-}
diff --git a/plugins/devkit/src/references/RegistryImplicitPropertyUsageProvider.java b/plugins/devkit/src/references/RegistryImplicitPropertyUsageProvider.java
new file mode 100644
index 0000000..d40f100
--- /dev/null
+++ b/plugins/devkit/src/references/RegistryImplicitPropertyUsageProvider.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.devkit.references;
+
+import com.intellij.codeInspection.unused.ImplicitPropertyUsageProvider;
+import com.intellij.lang.properties.psi.Property;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.idea.devkit.util.PsiUtil;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class RegistryImplicitPropertyUsageProvider extends ImplicitPropertyUsageProvider {
+ @Override
+ protected boolean isUsed(Property property) {
+ if (PsiUtil.isIdeaProject(property.getProject())) {
+ final PsiFile file = property.getContainingFile();
+ if (file != null && file.getName().equals("registry.properties")) {
+ final String name = property.getName();
+ return name.endsWith(".description") || name.endsWith(".restartRequired");
+ }
+ }
+ return false;
+ }
+}
diff --git a/plugins/devkit/src/testAssistant/TestDataGuessByExistingFilesUtil.java b/plugins/devkit/src/testAssistant/TestDataGuessByExistingFilesUtil.java
index e37fb72..b5763cc 100644
--- a/plugins/devkit/src/testAssistant/TestDataGuessByExistingFilesUtil.java
+++ b/plugins/devkit/src/testAssistant/TestDataGuessByExistingFilesUtil.java
@@ -34,6 +34,7 @@
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.testIntegration.TestFramework;
import com.intellij.util.PathUtil;
+import com.intellij.util.Processor;
import com.intellij.util.containers.ConcurrentHashMap;
import com.intellij.util.containers.HashSet;
import com.intellij.util.containers.LinkedMultiMap;
@@ -389,17 +390,21 @@
return new TestDataDescriptor(descriptors);
}
- private static synchronized MultiMap<String, Trinity<Matcher, String, String>> getAllFileNames(List<Trinity<Matcher, String, String>> input,
+ private static MultiMap<String, Trinity<Matcher, String, String>> getAllFileNames(final List<Trinity<Matcher, String, String>> input,
final GotoFileModel model) {
- LinkedMultiMap<String, Trinity<Matcher, String, String>> map = new LinkedMultiMap<String, Trinity<Matcher, String, String>>();
- for (String name : model.getNames(false)) {
- ProgressManager.checkCanceled();
- for (Trinity<Matcher, String, String> trinity : input) {
- if (trinity.first.matches(name)) {
- map.putValue(name, trinity);
+ final LinkedMultiMap<String, Trinity<Matcher, String, String>> map = new LinkedMultiMap<String, Trinity<Matcher, String, String>>();
+ model.processNames(new Processor<String>() {
+ @Override
+ public boolean process(String name) {
+ ProgressManager.checkCanceled();
+ for (Trinity<Matcher, String, String> trinity : input) {
+ if (trinity.first.matches(name)) {
+ map.putValue(name, trinity);
+ }
}
+ return true;
}
- }
+ }, false);
return map;
}
diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EPathUtil.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EPathUtil.java
index c5a23e1..a296720 100644
--- a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EPathUtil.java
+++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EPathUtil.java
@@ -149,7 +149,7 @@
return collapse2eclipsePathRelative2Module(file, module);
} else { //should check all modules then
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
- if (fileIndex.isIgnored(file) || fileIndex.isInLibraryClasses(file)) {
+ if (fileIndex.isExcluded(file) || fileIndex.isInLibraryClasses(file)) {
for (Module aModule : ModuleManager.getInstance(project).getModules()) {
final String path = collapse2eclipsePathRelative2Module(file, aModule);
if (path != null) {
diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/IdeaSpecificSettings.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/IdeaSpecificSettings.java
index ffd71fd..4541cf5 100644
--- a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/IdeaSpecificSettings.java
+++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/IdeaSpecificSettings.java
@@ -451,7 +451,7 @@
final Module module = ModuleUtilCore.findModuleForFile(file, project);
if (module != null) {
return appendRelatedToModule(element, classesUrl, rootName, file, module);
- } else if (ProjectRootManager.getInstance(project).getFileIndex().isIgnored(file)) {
+ } else if (ProjectRootManager.getInstance(project).getFileIndex().isExcluded(file)) {
for (Module aModule : ModuleManager.getInstance(project).getModules()) {
if (appendRelatedToModule(element, classesUrl, rootName, file, aModule)) return true;
}
diff --git a/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitChooseAccountStepBase.java b/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitChooseAccountStepBase.java
index 20fe160..1f8f93a 100644
--- a/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitChooseAccountStepBase.java
+++ b/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitChooseAccountStepBase.java
@@ -16,6 +16,7 @@
package com.intellij.remoteServer.util.importProject;
import com.intellij.ide.util.projectWizard.ModuleWizardStep;
+import com.intellij.ide.util.projectWizard.WizardContext;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.remoteServer.ServerType;
@@ -25,11 +26,12 @@
import com.intellij.remoteServer.util.CloudGitDeploymentDetector;
import javax.swing.*;
+import java.util.Collections;
/**
* @author michael.golubev
*/
-public abstract class CloudGitChooseAccountStepBase extends ModuleWizardStep {
+public class CloudGitChooseAccountStepBase extends ModuleWizardStep {
private JPanel myAccountSelectionPanelPlaceHolder;
private JPanel myMainPanel;
@@ -38,14 +40,15 @@
private CloudAccountSelectionEditor myEditor;
private final CloudGitDeploymentDetector myDeploymentDetector;
+ private final WizardContext myContext;
- public CloudGitChooseAccountStepBase(CloudGitDeploymentDetector deploymentDetector) {
+ public CloudGitChooseAccountStepBase(CloudGitDeploymentDetector deploymentDetector, WizardContext context) {
myDeploymentDetector = deploymentDetector;
+ myContext = context;
ServerType cloudType = deploymentDetector.getCloudType();
myTitleLabel.setText(CloudBundle.getText("choose.account.title", cloudType.getPresentableName()));
- myEditor = new CloudAccountSelectionEditor(cloudType);
+ myEditor = new CloudAccountSelectionEditor(Collections.<ServerType<?>>singletonList(cloudType));
myAccountSelectionPanelPlaceHolder.add(myEditor.getMainPanel());
- myEditor.initUI();
}
protected CloudGitDeploymentDetector getDeploymentDetector() {
@@ -63,6 +66,11 @@
return super.validate();
}
+ @Override
+ public void updateDataModel() {
+ myEditor.setAccountOnContext(myContext);
+ }
+
public void createRunConfiguration(Module module, String applicationName) {
CloudDeploymentNameConfiguration deploymentConfiguration = myDeploymentDetector.createDeploymentConfiguration();
@@ -72,6 +80,6 @@
deploymentConfiguration.setDeploymentName(applicationName);
}
- myEditor.createRunConfiguration(module, deploymentConfiguration);
+ CloudAccountSelectionEditor.createRunConfiguration(myContext, myDeploymentDetector.getCloudType(), module, deploymentConfiguration);
}
}
diff --git a/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitChooseAccountStepImpl.java b/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitChooseAccountStepImpl.java
index 74f4d22..1de4eff 100644
--- a/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitChooseAccountStepImpl.java
+++ b/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitChooseAccountStepImpl.java
@@ -55,7 +55,7 @@
CloudGitProjectStructureDetector structureDetector,
ProjectFromSourcesBuilder builder,
ProjectDescriptor projectDescriptor) {
- super(deploymentDetector);
+ super(deploymentDetector, builder.getContext());
myBuilder = builder;
myProjectDescriptor = projectDescriptor;
@@ -82,6 +82,7 @@
@Override
public void updateDataModel() {
+ super.updateDataModel();
final MultiMap<CloudGitProjectRoot, DetectedSourceRoot> project2sourceRoots = new MultiMap<CloudGitProjectRoot, DetectedSourceRoot>();
new RootIterator() {
diff --git a/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitRemoteDetector.java b/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitRemoteDetector.java
index f253a3d..704ced7 100644
--- a/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitRemoteDetector.java
+++ b/plugins/git4idea/remote-servers-git/src/com/intellij/remoteServer/util/importProject/CloudGitRemoteDetector.java
@@ -34,6 +34,7 @@
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.MessageType;
+import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.remoteServer.ServerType;
@@ -258,20 +259,14 @@
ImportModuleAction.createFromWizard(myProject, wizard);
}
else {
- final CloudGitChooseAccountStepBase chooseAccountStep
- = new CloudGitChooseAccountStepBase(myDeploymentDetector) {
-
- @Override
- public void updateDataModel() {
-
- }
- };
-
+ final Ref<CloudGitChooseAccountStepBase> chooseAccountStepRef = new Ref<CloudGitChooseAccountStepBase>();
if (!new AbstractProjectWizard(CloudBundle.getText("choose.account.wizzard.title", myCloudName), myProject, (String)null) {
final StepSequence myStepSequence;
{
+ CloudGitChooseAccountStepBase chooseAccountStep = new CloudGitChooseAccountStepBase(myDeploymentDetector, myWizardContext);
+ chooseAccountStepRef.set(chooseAccountStep);
myStepSequence = new StepSequence(chooseAccountStep);
addStep(chooseAccountStep);
init();
@@ -284,7 +279,7 @@
}.showAndGet()) {
return;
}
- chooseAccountStep.createRunConfiguration(targetModule, myApplicationName);
+ chooseAccountStepRef.get().createRunConfiguration(targetModule, myApplicationName);
}
}
}
diff --git a/plugins/git4idea/src/git4idea/GitUtil.java b/plugins/git4idea/src/git4idea/GitUtil.java
index 4286aee..5f56de5 100644
--- a/plugins/git4idea/src/git4idea/GitUtil.java
+++ b/plugins/git4idea/src/git4idea/GitUtil.java
@@ -18,6 +18,8 @@
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.Collections2;
+import com.intellij.ide.file.BatchFileChangeListener;
+import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProgressIndicator;
@@ -43,6 +45,7 @@
import com.intellij.util.Consumer;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.io.storage.HeavyProcessLatch;
import com.intellij.util.ui.UIUtil;
import com.intellij.vcsUtil.VcsFileUtil;
import com.intellij.vcsUtil.VcsUtil;
@@ -1010,4 +1013,15 @@
builder.setTitle(title);
builder.show();
}
+
+ public static void workingTreeChangeStarted(@NotNull Project project) {
+ HeavyProcessLatch.INSTANCE.processStarted();
+ ApplicationManager.getApplication().getMessageBus().syncPublisher(BatchFileChangeListener.TOPIC).batchChangeStarted(project);
+ }
+
+ public static void workingTreeChangeFinished(@NotNull Project project) {
+ HeavyProcessLatch.INSTANCE.processFinished();
+ ApplicationManager.getApplication().getMessageBus().syncPublisher(BatchFileChangeListener.TOPIC).batchChangeCompleted(project);
+ }
+
}
diff --git a/plugins/git4idea/src/git4idea/actions/GitMergeAction.java b/plugins/git4idea/src/git4idea/actions/GitMergeAction.java
index 1d46335..e8bc379 100644
--- a/plugins/git4idea/src/git4idea/actions/GitMergeAction.java
+++ b/plugins/git4idea/src/git4idea/actions/GitMergeAction.java
@@ -81,27 +81,34 @@
final Git git = ServiceManager.getService(Git.class);
final GitLocalChangesWouldBeOverwrittenDetector localChangesDetector =
new GitLocalChangesWouldBeOverwrittenDetector(selectedRoot, MERGE);
- final GitUntrackedFilesOverwrittenByOperationDetector untrackedFilesDetector =
+ final GitUntrackedFilesOverwrittenByOperationDetector untrackedFilesDetector =
new GitUntrackedFilesOverwrittenByOperationDetector(selectedRoot);
- GitCommandResult result = git.runCommand(new Computable<GitLineHandler>() {
- @Override
- public GitLineHandler compute() {
- GitLineHandler handler = handlerProvider.compute();
- handler.addLineListener(localChangesDetector);
- handler.addLineListener(untrackedFilesDetector);
- return handler;
- }
- });
- affectedRoots.add(selectedRoot);
- GitRepository repository = repositoryManager.getRepositoryForRoot(selectedRoot);
- assert repository != null : "Repository can't be null for root " + selectedRoot;
- String revision = repository.getCurrentRevision();
- if (revision == null) {
- return;
+ GitUtil.workingTreeChangeStarted(project);
+ try {
+ GitCommandResult result = git.runCommand(new Computable<GitLineHandler>() {
+ @Override
+ public GitLineHandler compute() {
+ GitLineHandler handler = handlerProvider.compute();
+ handler.addLineListener(localChangesDetector);
+ handler.addLineListener(untrackedFilesDetector);
+ return handler;
+ }
+ });
+ affectedRoots.add(selectedRoot);
+
+ GitRepository repository = repositoryManager.getRepositoryForRoot(selectedRoot);
+ assert repository != null : "Repository can't be null for root " + selectedRoot;
+ String revision = repository.getCurrentRevision();
+ if (revision == null) {
+ return;
+ }
+ final GitRevisionNumber currentRev = new GitRevisionNumber(revision);
+ handleResult(result, project, localChangesDetector, untrackedFilesDetector, repository, currentRev, affectedRoots, beforeLabel);
}
- final GitRevisionNumber currentRev = new GitRevisionNumber(revision);
- handleResult(result, project, localChangesDetector, untrackedFilesDetector, repository, currentRev, affectedRoots, beforeLabel);
+ finally {
+ GitUtil.workingTreeChangeFinished(project);
+ }
}
}.queue();
diff --git a/plugins/git4idea/src/git4idea/actions/GitRebaseAbort.java b/plugins/git4idea/src/git4idea/actions/GitRebaseAbort.java
index 5b56884..a3c4497 100644
--- a/plugins/git4idea/src/git4idea/actions/GitRebaseAbort.java
+++ b/plugins/git4idea/src/git4idea/actions/GitRebaseAbort.java
@@ -20,6 +20,7 @@
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.VirtualFile;
+import git4idea.GitUtil;
import git4idea.commands.GitCommand;
import git4idea.commands.GitHandlerUtil;
import git4idea.commands.GitSimpleHandler;
@@ -74,7 +75,13 @@
GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.REBASE);
h.setStdoutSuppressed(false);
h.addParameters("--abort");
- GitHandlerUtil.doSynchronously(h, getActionName(), h.printableCommandLine());
+ GitUtil.workingTreeChangeStarted(project);
+ try {
+ GitHandlerUtil.doSynchronously(h, getActionName(), h.printableCommandLine());
+ }
+ finally {
+ GitUtil.workingTreeChangeFinished(project);
+ }
}
/**
diff --git a/plugins/git4idea/src/git4idea/actions/GitRebaseActionBase.java b/plugins/git4idea/src/git4idea/actions/GitRebaseActionBase.java
index c69bfb6..912dd0b 100644
--- a/plugins/git4idea/src/git4idea/actions/GitRebaseActionBase.java
+++ b/plugins/git4idea/src/git4idea/actions/GitRebaseActionBase.java
@@ -64,11 +64,17 @@
task.executeInBackground(false, new GitTaskResultHandlerAdapter() {
@Override
protected void run(GitTaskResult taskResult) {
- editor.close();
- GitRepositoryManager manager = GitUtil.getRepositoryManager(project);
- manager.updateRepository(root);
- root.refresh(false, true);
- notifyAboutErrorResult(taskResult, resultListener, exceptions, project);
+ GitUtil.workingTreeChangeStarted(project);
+ try {
+ editor.close();
+ GitRepositoryManager manager = GitUtil.getRepositoryManager(project);
+ manager.updateRepository(root);
+ root.refresh(false, true);
+ notifyAboutErrorResult(taskResult, resultListener, exceptions, project);
+ }
+ finally {
+ GitUtil.workingTreeChangeFinished(project);
+ }
}
});
}
diff --git a/plugins/git4idea/src/git4idea/actions/GitResetHead.java b/plugins/git4idea/src/git4idea/actions/GitResetHead.java
index d2278a2..fd186b8 100644
--- a/plugins/git4idea/src/git4idea/actions/GitResetHead.java
+++ b/plugins/git4idea/src/git4idea/actions/GitResetHead.java
@@ -56,7 +56,13 @@
}
GitLineHandler h = d.handler();
affectedRoots.add(d.getGitRoot());
- GitHandlerUtil.doSynchronously(h, GitBundle.getString("resetting.title"), h.printableCommandLine());
+ GitUtil.workingTreeChangeStarted(project);
+ try {
+ GitHandlerUtil.doSynchronously(h, GitBundle.getString("resetting.title"), h.printableCommandLine());
+ }
+ finally {
+ GitUtil.workingTreeChangeFinished(project);
+ }
GitRepositoryManager manager = GitUtil.getRepositoryManager(project);
manager.updateRepository(d.getGitRoot());
}
diff --git a/plugins/git4idea/src/git4idea/actions/GitStash.java b/plugins/git4idea/src/git4idea/actions/GitStash.java
index f231697..b16c948 100644
--- a/plugins/git4idea/src/git4idea/actions/GitStash.java
+++ b/plugins/git4idea/src/git4idea/actions/GitStash.java
@@ -21,6 +21,7 @@
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vfs.VirtualFile;
import git4idea.GitPlatformFacade;
+import git4idea.GitUtil;
import git4idea.commands.GitHandlerUtil;
import git4idea.commands.GitLineHandler;
import git4idea.i18n.GitBundle;
@@ -53,7 +54,13 @@
VirtualFile root = d.getGitRoot();
affectedRoots.add(root);
final GitLineHandler h = d.handler();
- GitHandlerUtil.doSynchronously(h, GitBundle.getString("stashing.title"), h.printableCommandLine());
+ GitUtil.workingTreeChangeStarted(project);
+ try {
+ GitHandlerUtil.doSynchronously(h, GitBundle.getString("stashing.title"), h.printableCommandLine());
+ }
+ finally {
+ GitUtil.workingTreeChangeFinished(project);
+ }
ServiceManager.getService(project, GitPlatformFacade.class).hardRefresh(root);
}
diff --git a/plugins/git4idea/src/git4idea/branch/GitCheckoutOperation.java b/plugins/git4idea/src/git4idea/branch/GitCheckoutOperation.java
index d49dc15..2441bf7 100644
--- a/plugins/git4idea/src/git4idea/branch/GitCheckoutOperation.java
+++ b/plugins/git4idea/src/git4idea/branch/GitCheckoutOperation.java
@@ -64,40 +64,46 @@
protected void execute() {
saveAllDocuments();
boolean fatalErrorHappened = false;
- while (hasMoreRepositories() && !fatalErrorHappened) {
- final GitRepository repository = next();
+ GitUtil.workingTreeChangeStarted(myProject);
+ try {
+ while (hasMoreRepositories() && !fatalErrorHappened) {
+ final GitRepository repository = next();
- VirtualFile root = repository.getRoot();
- GitLocalChangesWouldBeOverwrittenDetector localChangesDetector =
- new GitLocalChangesWouldBeOverwrittenDetector(root, GitLocalChangesWouldBeOverwrittenDetector.Operation.CHECKOUT);
- GitSimpleEventDetector unmergedFiles = new GitSimpleEventDetector(GitSimpleEventDetector.Event.UNMERGED_PREVENTING_CHECKOUT);
- GitUntrackedFilesOverwrittenByOperationDetector untrackedOverwrittenByCheckout =
- new GitUntrackedFilesOverwrittenByOperationDetector(root);
+ VirtualFile root = repository.getRoot();
+ GitLocalChangesWouldBeOverwrittenDetector localChangesDetector =
+ new GitLocalChangesWouldBeOverwrittenDetector(root, GitLocalChangesWouldBeOverwrittenDetector.Operation.CHECKOUT);
+ GitSimpleEventDetector unmergedFiles = new GitSimpleEventDetector(GitSimpleEventDetector.Event.UNMERGED_PREVENTING_CHECKOUT);
+ GitUntrackedFilesOverwrittenByOperationDetector untrackedOverwrittenByCheckout =
+ new GitUntrackedFilesOverwrittenByOperationDetector(root);
- GitCommandResult result = myGit.checkout(repository, myStartPointReference, myNewBranch, false,
- localChangesDetector, unmergedFiles, untrackedOverwrittenByCheckout);
- if (result.success()) {
- refresh(repository);
- markSuccessful(repository);
- }
- else if (unmergedFiles.hasHappened()) {
- fatalUnmergedFilesError();
- fatalErrorHappened = true;
- }
- else if (localChangesDetector.wasMessageDetected()) {
- boolean smartCheckoutSucceeded = smartCheckoutOrNotify(repository, localChangesDetector);
- if (!smartCheckoutSucceeded) {
+ GitCommandResult result = myGit.checkout(repository, myStartPointReference, myNewBranch, false,
+ localChangesDetector, unmergedFiles, untrackedOverwrittenByCheckout);
+ if (result.success()) {
+ refresh(repository);
+ markSuccessful(repository);
+ }
+ else if (unmergedFiles.hasHappened()) {
+ fatalUnmergedFilesError();
+ fatalErrorHappened = true;
+ }
+ else if (localChangesDetector.wasMessageDetected()) {
+ boolean smartCheckoutSucceeded = smartCheckoutOrNotify(repository, localChangesDetector);
+ if (!smartCheckoutSucceeded) {
+ fatalErrorHappened = true;
+ }
+ }
+ else if (untrackedOverwrittenByCheckout.wasMessageDetected()) {
+ fatalUntrackedFilesError(repository.getRoot(), untrackedOverwrittenByCheckout.getRelativeFilePaths());
+ fatalErrorHappened = true;
+ }
+ else {
+ fatalError(getCommonErrorTitle(), result.getErrorOutputAsJoinedString());
fatalErrorHappened = true;
}
}
- else if (untrackedOverwrittenByCheckout.wasMessageDetected()) {
- fatalUntrackedFilesError(repository.getRoot(), untrackedOverwrittenByCheckout.getRelativeFilePaths());
- fatalErrorHappened = true;
- }
- else {
- fatalError(getCommonErrorTitle(), result.getErrorOutputAsJoinedString());
- fatalErrorHappened = true;
- }
+ }
+ finally {
+ GitUtil.workingTreeChangeFinished(myProject);
}
if (!fatalErrorHappened) {
diff --git a/plugins/git4idea/src/git4idea/branch/GitMergeOperation.java b/plugins/git4idea/src/git4idea/branch/GitMergeOperation.java
index e90d1eb..89a50cf 100644
--- a/plugins/git4idea/src/git4idea/branch/GitMergeOperation.java
+++ b/plugins/git4idea/src/git4idea/branch/GitMergeOperation.java
@@ -72,76 +72,82 @@
saveAllDocuments();
boolean fatalErrorHappened = false;
int alreadyUpToDateRepositories = 0;
- while (hasMoreRepositories() && !fatalErrorHappened) {
- final GitRepository repository = next();
- LOG.info("next repository: " + repository);
+ GitUtil.workingTreeChangeStarted(myProject);
+ try {
+ while (hasMoreRepositories() && !fatalErrorHappened) {
+ final GitRepository repository = next();
+ LOG.info("next repository: " + repository);
- VirtualFile root = repository.getRoot();
- GitLocalChangesWouldBeOverwrittenDetector localChangesDetector =
- new GitLocalChangesWouldBeOverwrittenDetector(root, GitLocalChangesWouldBeOverwrittenDetector.Operation.MERGE);
- GitSimpleEventDetector unmergedFiles = new GitSimpleEventDetector(GitSimpleEventDetector.Event.UNMERGED_PREVENTING_MERGE);
- GitUntrackedFilesOverwrittenByOperationDetector untrackedOverwrittenByMerge =
- new GitUntrackedFilesOverwrittenByOperationDetector(root);
- GitSimpleEventDetector mergeConflict = new GitSimpleEventDetector(GitSimpleEventDetector.Event.MERGE_CONFLICT);
- GitSimpleEventDetector alreadyUpToDateDetector = new GitSimpleEventDetector(GitSimpleEventDetector.Event.ALREADY_UP_TO_DATE);
+ VirtualFile root = repository.getRoot();
+ GitLocalChangesWouldBeOverwrittenDetector localChangesDetector =
+ new GitLocalChangesWouldBeOverwrittenDetector(root, GitLocalChangesWouldBeOverwrittenDetector.Operation.MERGE);
+ GitSimpleEventDetector unmergedFiles = new GitSimpleEventDetector(GitSimpleEventDetector.Event.UNMERGED_PREVENTING_MERGE);
+ GitUntrackedFilesOverwrittenByOperationDetector untrackedOverwrittenByMerge =
+ new GitUntrackedFilesOverwrittenByOperationDetector(root);
+ GitSimpleEventDetector mergeConflict = new GitSimpleEventDetector(GitSimpleEventDetector.Event.MERGE_CONFLICT);
+ GitSimpleEventDetector alreadyUpToDateDetector = new GitSimpleEventDetector(GitSimpleEventDetector.Event.ALREADY_UP_TO_DATE);
- GitCommandResult result = myGit.merge(repository, myBranchToMerge, Collections.<String>emptyList(),
- localChangesDetector, unmergedFiles, untrackedOverwrittenByMerge, mergeConflict,
- alreadyUpToDateDetector);
- if (result.success()) {
- LOG.info("Merged successfully");
- refresh(repository);
- markSuccessful(repository);
- if (alreadyUpToDateDetector.hasHappened()) {
- alreadyUpToDateRepositories += 1;
+ GitCommandResult result = myGit.merge(repository, myBranchToMerge, Collections.<String>emptyList(),
+ localChangesDetector, unmergedFiles, untrackedOverwrittenByMerge, mergeConflict,
+ alreadyUpToDateDetector);
+ if (result.success()) {
+ LOG.info("Merged successfully");
+ refresh(repository);
+ markSuccessful(repository);
+ if (alreadyUpToDateDetector.hasHappened()) {
+ alreadyUpToDateRepositories += 1;
+ }
}
- }
- else if (unmergedFiles.hasHappened()) {
- LOG.info("Unmerged files error!");
- fatalUnmergedFilesError();
- fatalErrorHappened = true;
- }
- else if (localChangesDetector.wasMessageDetected()) {
- LOG.info("Local changes would be overwritten by merge!");
- boolean smartMergeSucceeded = proposeSmartMergePerformAndNotify(repository, localChangesDetector);
- if (!smartMergeSucceeded) {
+ else if (unmergedFiles.hasHappened()) {
+ LOG.info("Unmerged files error!");
+ fatalUnmergedFilesError();
+ fatalErrorHappened = true;
+ }
+ else if (localChangesDetector.wasMessageDetected()) {
+ LOG.info("Local changes would be overwritten by merge!");
+ boolean smartMergeSucceeded = proposeSmartMergePerformAndNotify(repository, localChangesDetector);
+ if (!smartMergeSucceeded) {
+ fatalErrorHappened = true;
+ }
+ }
+ else if (mergeConflict.hasHappened()) {
+ LOG.info("Merge conflict");
+ myConflictedRepositories.put(repository, Boolean.FALSE);
+ refresh(repository);
+ markSuccessful(repository);
+ }
+ else if (untrackedOverwrittenByMerge.wasMessageDetected()) {
+ LOG.info("Untracked files would be overwritten by merge!");
+ fatalUntrackedFilesError(repository.getRoot(), untrackedOverwrittenByMerge.getRelativeFilePaths());
+ fatalErrorHappened = true;
+ }
+ else {
+ LOG.info("Unknown error. " + result);
+ fatalError(getCommonErrorTitle(), result.getErrorOutputAsJoinedString());
fatalErrorHappened = true;
}
}
- else if (mergeConflict.hasHappened()) {
- LOG.info("Merge conflict");
- myConflictedRepositories.put(repository, Boolean.FALSE);
- refresh(repository);
- markSuccessful(repository);
- }
- else if (untrackedOverwrittenByMerge.wasMessageDetected()) {
- LOG.info("Untracked files would be overwritten by merge!");
- fatalUntrackedFilesError(repository.getRoot(), untrackedOverwrittenByMerge.getRelativeFilePaths());
- fatalErrorHappened = true;
+
+ if (fatalErrorHappened) {
+ notifyAboutRemainingConflicts();
}
else {
- LOG.info("Unknown error. " + result);
- fatalError(getCommonErrorTitle(), result.getErrorOutputAsJoinedString());
- fatalErrorHappened = true;
- }
- }
-
- if (fatalErrorHappened) {
- notifyAboutRemainingConflicts();
- }
- else {
- boolean allConflictsResolved = resolveConflicts();
- if (allConflictsResolved) {
- if (alreadyUpToDateRepositories < getRepositories().size()) {
- notifySuccess();
- }
- else {
- notifySuccess("Already up-to-date");
+ boolean allConflictsResolved = resolveConflicts();
+ if (allConflictsResolved) {
+ if (alreadyUpToDateRepositories < getRepositories().size()) {
+ notifySuccess();
+ }
+ else {
+ notifySuccess("Already up-to-date");
+ }
}
}
- }
- restoreLocalChanges();
+ restoreLocalChanges();
+ }
+ finally {
+ GitUtil.workingTreeChangeFinished(myProject);
+ }
}
private void notifyAboutRemainingConflicts() {
diff --git a/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java b/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java
index 2eb0219..3bb008a 100644
--- a/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java
+++ b/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java
@@ -601,8 +601,8 @@
c.gridy = 0;
c.weightx = 1;
c.fill = GridBagConstraints.HORIZONTAL;
- final List<String> usersList = getUsersList(project);
- final Set<String> authors = new HashSet<String>(usersList);
+
+ Set<String> authors = new HashSet<String>(getUsersList(project));
ContainerUtil.addAll(authors, mySettings.getCommitAuthors());
List<String> list = new ArrayList<String>(authors);
Collections.sort(list);
diff --git a/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java b/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java
index 831f833..40865a0 100644
--- a/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java
+++ b/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java
@@ -21,37 +21,25 @@
import com.intellij.openapi.project.Project;
import git4idea.GitUtil;
import git4idea.GitVcs;
-import git4idea.commands.GitCommand;
-import git4idea.commands.GitLineHandlerPasswordRequestAware;
-import git4idea.commands.GitTask;
-import git4idea.commands.GitTaskResult;
+import git4idea.commands.*;
import git4idea.remote.GitRememberedInputs;
import org.jetbrains.annotations.NotNull;
import java.io.File;
-/**
- * @author Nadya Zabrodina
- */
public class GitCloneDialog extends CloneDvcsDialog {
public GitCloneDialog(@NotNull Project project) {
super(project, GitVcs.NAME, GitUtil.DOT_GIT);
}
- /*
- * We have a hack here: if http response asked for a password, then the url is at least valid and existent, and we consider
- * that the test passed.
- */
protected boolean test(@NotNull String url) {
- final GitLineHandlerPasswordRequestAware handler =
- new GitLineHandlerPasswordRequestAware(myProject, new File("."), GitCommand.LS_REMOTE);
+ final GitLineHandler handler = new GitLineHandler(myProject, new File("."), GitCommand.LS_REMOTE);
handler.setUrl(url);
handler.addParameters(url, "master");
GitTask task = new GitTask(myProject, handler, DvcsBundle.message("clone.testing", url));
GitTaskResult result = task.executeModal();
- boolean authFailed = handler.hadAuthRequest();
- return result.isOK() || authFailed;
+ return result.isOK();
}
@NotNull
diff --git a/plugins/git4idea/src/git4idea/cherrypick/GitCherryPicker.java b/plugins/git4idea/src/git4idea/cherrypick/GitCherryPicker.java
index bd8635d..033b1fd 100644
--- a/plugins/git4idea/src/git4idea/cherrypick/GitCherryPicker.java
+++ b/plugins/git4idea/src/git4idea/cherrypick/GitCherryPicker.java
@@ -33,6 +33,7 @@
import com.intellij.util.containers.ContainerUtil;
import com.intellij.vcs.log.VcsFullCommitDetails;
import git4idea.GitPlatformFacade;
+import git4idea.GitUtil;
import git4idea.commands.Git;
import git4idea.commands.GitCommandResult;
import git4idea.commands.GitSimpleEventDetector;
@@ -80,15 +81,21 @@
public void cherryPick(@NotNull Map<GitRepository, List<VcsFullCommitDetails>> commitsInRoots) {
List<GitCommitWrapper> successfulCommits = new ArrayList<GitCommitWrapper>();
- for (Map.Entry<GitRepository, List<VcsFullCommitDetails>> entry : commitsInRoots.entrySet()) {
- GitRepository repository = entry.getKey();
- boolean result = cherryPick(repository, entry.getValue(), successfulCommits);
- repository.update();
- if (!result) {
- return;
+ GitUtil.workingTreeChangeStarted(myProject);
+ try {
+ for (Map.Entry<GitRepository, List<VcsFullCommitDetails>> entry : commitsInRoots.entrySet()) {
+ GitRepository repository = entry.getKey();
+ boolean result = cherryPick(repository, entry.getValue(), successfulCommits);
+ repository.update();
+ if (!result) {
+ return;
+ }
}
+ notifySuccess(successfulCommits);
}
- notifySuccess(successfulCommits);
+ finally {
+ GitUtil.workingTreeChangeFinished(myProject);
+ }
}
// return true to continue with other roots, false to break execution
diff --git a/plugins/git4idea/src/git4idea/commands/GitHttpGuiAuthenticator.java b/plugins/git4idea/src/git4idea/commands/GitHttpGuiAuthenticator.java
index 5b3a242..e0312e5 100644
--- a/plugins/git4idea/src/git4idea/commands/GitHttpGuiAuthenticator.java
+++ b/plugins/git4idea/src/git4idea/commands/GitHttpGuiAuthenticator.java
@@ -87,7 +87,7 @@
return "";
}
url = adjustUrl(url);
- Pair<GitHttpAuthDataProvider, AuthData> authData = findBestAuthData(url);
+ Pair<GitHttpAuthDataProvider, AuthData> authData = findBestAuthData(url, myModalityState);
if (authData != null && authData.second.getPassword() != null) {
String password = authData.second.getPassword();
myDataProvider = authData.first;
@@ -114,7 +114,7 @@
@NotNull
public String askUsername(@NotNull String url) {
url = adjustUrl(url);
- Pair<GitHttpAuthDataProvider, AuthData> authData = findBestAuthData(url);
+ Pair<GitHttpAuthDataProvider, AuthData> authData = findBestAuthData(url, myModalityState);
String login = null;
String password = null;
if (authData != null) {
@@ -223,10 +223,10 @@
// return the first that knows username + password; otherwise return the first that knows just the username
@Nullable
- private Pair<GitHttpAuthDataProvider, AuthData> findBestAuthData(@NotNull String url) {
+ private Pair<GitHttpAuthDataProvider, AuthData> findBestAuthData(@NotNull String url, @Nullable ModalityState modalityState) {
Pair<GitHttpAuthDataProvider, AuthData> candidate = null;
for (GitHttpAuthDataProvider provider : getProviders()) {
- AuthData data = provider.getAuthData(url);
+ AuthData data = provider.getAuthData(url, modalityState);
if (data != null) {
Pair<GitHttpAuthDataProvider, AuthData> pair = Pair.create(provider, data);
if (data.getPassword() != null) {
@@ -268,12 +268,12 @@
@Nullable
@Override
- public AuthData getAuthData(@NotNull String url) {
+ public AuthData getAuthData(@NotNull String url, @Nullable ModalityState modalityState) {
String userName = getUsername(url);
String key = makeKey(url, userName);
final PasswordSafe passwordSafe = PasswordSafe.getInstance();
try {
- String password = passwordSafe.getPassword(myProject, PASS_REQUESTER, key);
+ String password = passwordSafe.getPassword(myProject, PASS_REQUESTER, key, modalityState);
return new AuthData(StringUtil.notNullize(userName), password);
}
catch (PasswordSafeException e) {
diff --git a/plugins/git4idea/src/git4idea/commands/GitImpl.java b/plugins/git4idea/src/git4idea/commands/GitImpl.java
index 3e14a64..c873e71 100644
--- a/plugins/git4idea/src/git4idea/commands/GitImpl.java
+++ b/plugins/git4idea/src/git4idea/commands/GitImpl.java
@@ -138,7 +138,7 @@
return run(new Computable<GitLineHandler>() {
@Override
public GitLineHandler compute() {
- GitLineHandlerPasswordRequestAware handler = new GitLineHandlerPasswordRequestAware(project, parentDirectory, GitCommand.CLONE);
+ GitLineHandler handler = new GitLineHandler(project, parentDirectory, GitCommand.CLONE);
handler.setStdoutSuppressed(false);
handler.setUrl(url);
handler.addParameters("--progress");
@@ -376,8 +376,7 @@
return runCommand(new Computable<GitLineHandler>() {
@Override
public GitLineHandler compute() {
- final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(),
- GitCommand.PUSH);
+ final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.PUSH);
h.setUrl(url);
h.setSilent(false);
h.setStdoutSuppressed(false);
@@ -454,8 +453,7 @@
return runCommand(new Computable<GitLineHandler>() {
@Override
public GitLineHandler compute() {
- final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(),
- GitCommand.FETCH);
+ final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.FETCH);
h.setUrl(url);
h.addParameters(remote);
h.addParameters(params);
@@ -520,13 +518,7 @@
});
handler.runInCurrentThread(null);
-
authFailed = handler.hasHttpAuthFailed();
-
- if (handler instanceof GitLineHandlerPasswordRequestAware && ((GitLineHandlerPasswordRequestAware)handler).hadAuthRequest()) {
- errorOutput.add("Authentication failed");
- }
-
success = !startFailed.get() && errorOutput.isEmpty() && (handler.isIgnoredErrorCode(exitCode.get()) || exitCode.get() == 0);
}
while (authFailed && authAttempt++ < 2);
diff --git a/plugins/git4idea/src/git4idea/commands/GitLineHandlerPasswordRequestAware.java b/plugins/git4idea/src/git4idea/commands/GitLineHandlerPasswordRequestAware.java
deleted file mode 100644
index b117b20..0000000
--- a/plugins/git4idea/src/git4idea/commands/GitLineHandlerPasswordRequestAware.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2000-2011 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 git4idea.commands;
-
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Key;
-import com.intellij.openapi.vfs.VirtualFile;
-import org.jetbrains.annotations.NotNull;
-
-import java.io.File;
-
-/**
- * {@link GitLineHandler} that listens to Git output and kills itself if "username" or "password" is queried throughout the prompt.
- * We can't pass the data to the prompt anyway, so better to kill the process and show an error message, than to hang the task.
- *
- * @author Kirill Likhodedov
- */
-public class GitLineHandlerPasswordRequestAware extends GitLineHandler {
-
- private boolean myAuthRequest;
-
- public GitLineHandlerPasswordRequestAware(@NotNull Project project, @NotNull VirtualFile vcsRoot, @NotNull GitCommand command) {
- super(project, vcsRoot, command);
- }
-
- public GitLineHandlerPasswordRequestAware(@NotNull Project project, @NotNull File directory, @NotNull GitCommand clone) {
- super(project, directory, clone);
- }
-
- @Override
- protected void onTextAvailable(String text, Key outputType) {
- super.onTextAvailable(text, outputType);
- if (text.toLowerCase().startsWith("password") || text.toLowerCase().startsWith("username")) {
- myAuthRequest = true;
- destroyProcess();
- }
- }
-
- public boolean hadAuthRequest() {
- return myAuthRequest;
- }
-}
diff --git a/plugins/git4idea/src/git4idea/log/GitRefManager.java b/plugins/git4idea/src/git4idea/log/GitRefManager.java
index 5b60076..eb9e79c 100644
--- a/plugins/git4idea/src/git4idea/log/GitRefManager.java
+++ b/plugins/git4idea/src/git4idea/log/GitRefManager.java
@@ -69,23 +69,31 @@
return typeComparison;
}
+
//noinspection UnnecessaryLocalVariable
VcsRefType type = type1; // common type
+
+ String name1 = ref1.getName();
+ String name2 = ref2.getName();
+ if (name1.equals(name2)) {
+ return 0;
+ }
+
if (type == LOCAL_BRANCH) {
- if (ref1.getName().equals(MASTER)) {
+ if (name1.equals(MASTER)) {
return -1;
}
- if (ref2.getName().equals(MASTER)) {
+ if (name2.equals(MASTER)) {
return 1;
}
- return ref1.getName().compareTo(ref2.getName());
+ return name1.compareTo(name2);
}
if (type == REMOTE_BRANCH) {
- if (ref1.getName().equals(ORIGIN_MASTER)) {
+ if (name1.equals(ORIGIN_MASTER)) {
return -1;
}
- if (ref2.getName().equals(ORIGIN_MASTER)) {
+ if (name2.equals(ORIGIN_MASTER)) {
return 1;
}
if (hasTrackingBranch(ref1) && !hasTrackingBranch(ref2)) {
@@ -94,10 +102,10 @@
if (!hasTrackingBranch(ref1) && hasTrackingBranch(ref2)) {
return 1;
}
- return ref1.getName().compareTo(ref2.getName());
+ return name1.compareTo(name2);
}
- return ref1.getName().compareTo(ref2.getName());
+ return name1.compareTo(name2);
}
};
@@ -121,10 +129,8 @@
@NotNull
@Override
- public List<VcsRef> sort(Collection<VcsRef> refs) {
- ArrayList<VcsRef> list = new ArrayList<VcsRef>(refs);
- Collections.sort(list, REF_COMPARATOR);
- return list;
+ public Comparator<VcsRef> getComparator() {
+ return REF_COMPARATOR;
}
@NotNull
@@ -314,7 +320,7 @@
@NotNull
@Override
public List<VcsRef> getRefs() {
- return sort(myBranches);
+ return ContainerUtil.sorted(myBranches, getComparator());
}
@NotNull
diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaser.java b/plugins/git4idea/src/git4idea/rebase/GitRebaser.java
index a85a328..aabf913f 100644
--- a/plugins/git4idea/src/git4idea/rebase/GitRebaser.java
+++ b/plugins/git4idea/src/git4idea/rebase/GitRebaser.java
@@ -63,10 +63,6 @@
mySkippedCommits = new ArrayList<GitRebaseUtils.CommitInfo>();
}
- public void setProgressIndicator(@Nullable ProgressIndicator progressIndicator) {
- myProgressIndicator = progressIndicator;
- }
-
public GitUpdateResult rebase(@NotNull VirtualFile root,
@NotNull List<String> parameters,
@Nullable final Runnable onCancel,
@@ -89,28 +85,34 @@
rebaseTask.setProgressAnalyzer(new GitStandardProgressAnalyzer());
final AtomicReference<GitUpdateResult> updateResult = new AtomicReference<GitUpdateResult>();
final AtomicBoolean failure = new AtomicBoolean();
- rebaseTask.executeInBackground(true, new GitTaskResultHandlerAdapter() {
- @Override
- protected void onSuccess() {
- updateResult.set(GitUpdateResult.SUCCESS);
- }
-
- @Override
- protected void onCancel() {
- if (onCancel != null) {
- onCancel.run();
+ try {
+ GitUtil.workingTreeChangeStarted(myProject);
+ rebaseTask.executeInBackground(true, new GitTaskResultHandlerAdapter() {
+ @Override
+ protected void onSuccess() {
+ updateResult.set(GitUpdateResult.SUCCESS);
}
- updateResult.set(GitUpdateResult.CANCEL);
- }
- @Override
- protected void onFailure() {
- failure.set(true);
- }
- });
+ @Override
+ protected void onCancel() {
+ if (onCancel != null) {
+ onCancel.run();
+ }
+ updateResult.set(GitUpdateResult.CANCEL);
+ }
- if (failure.get()) {
- updateResult.set(handleRebaseFailure(root, rebaseHandler, rebaseConflictDetector, untrackedFilesDetector));
+ @Override
+ protected void onFailure() {
+ failure.set(true);
+ }
+ });
+
+ if (failure.get()) {
+ updateResult.set(handleRebaseFailure(rebaseHandler, root, rebaseConflictDetector, untrackedFilesDetector));
+ }
+ }
+ finally {
+ GitUtil.workingTreeChangeFinished(myProject);
}
return updateResult.get();
}
@@ -119,26 +121,6 @@
return new GitLineHandler(myProject, root, GitCommand.REBASE);
}
- public GitUpdateResult handleRebaseFailure(VirtualFile root, GitLineHandler pullHandler,
- GitRebaseProblemDetector rebaseConflictDetector,
- GitMessageWithFilesDetector untrackedWouldBeOverwrittenDetector) {
- if (rebaseConflictDetector.isMergeConflict()) {
- LOG.info("handleRebaseFailure merge conflict");
- final boolean allMerged = new MyConflictResolver(myProject, myGit, root, this).merge();
- return allMerged ? GitUpdateResult.SUCCESS_WITH_RESOLVED_CONFLICTS : GitUpdateResult.INCOMPLETE;
- } else if (untrackedWouldBeOverwrittenDetector.wasMessageDetected()) {
- LOG.info("handleRebaseFailure: untracked files would be overwritten by checkout");
- UntrackedFilesNotifier.notifyUntrackedFilesOverwrittenBy(myProject, root,
- untrackedWouldBeOverwrittenDetector.getRelativeFilePaths(), "rebase", null);
- return GitUpdateResult.ERROR;
- } else {
- LOG.info("handleRebaseFailure error " + pullHandler.errors());
- GitUIUtil.notifyImportantError(myProject, "Rebase error", GitUIUtil.stringifyErrors(pullHandler.errors()));
- return GitUpdateResult.ERROR;
- }
- }
-
-
public void abortRebase(@NotNull VirtualFile root) {
LOG.info("abortRebase " + root);
final GitLineHandler rh = new GitLineHandler(myProject, root, GitCommand.REBASE);
@@ -158,11 +140,17 @@
* @return true if rebase successfully finished.
*/
public boolean continueRebase(@NotNull Collection<VirtualFile> rebasingRoots) {
- boolean success = true;
- for (VirtualFile root : rebasingRoots) {
- success &= continueRebase(root);
+ GitUtil.workingTreeChangeStarted(myProject);
+ try {
+ boolean success = true;
+ for (VirtualFile root : rebasingRoots) {
+ success &= continueRebase(root);
+ }
+ return success;
}
- return success;
+ finally {
+ GitUtil.workingTreeChangeFinished(myProject);
+ }
}
// start operation may be "--continue" or "--skip" depending on the situation.
@@ -330,34 +318,6 @@
"You also may <b>abort rebase</b> to restore the original branch and stop rebasing.");
}
- private static class MyConflictResolver extends GitConflictResolver {
- private final GitRebaser myRebaser;
- private final VirtualFile myRoot;
-
- public MyConflictResolver(Project project, @NotNull Git git, VirtualFile root, GitRebaser rebaser) {
- super(project, git, ServiceManager.getService(GitPlatformFacade.class), Collections.singleton(root), makeParams());
- myRebaser = rebaser;
- myRoot = root;
- }
-
- private static Params makeParams() {
- Params params = new Params();
- params.setReverse(true);
- params.setMergeDescription("Merge conflicts detected. Resolve them before continuing rebase.");
- params.setErrorNotificationTitle("Can't continue rebase");
- params.setErrorNotificationAdditionalDescription("Then you may <b>continue rebase</b>. <br/> You also may <b>abort rebase</b> to restore the original branch and stop rebasing.");
- return params;
- }
-
- @Override protected boolean proceedIfNothingToMerge() throws VcsException {
- return myRebaser.continueRebase(myRoot);
- }
-
- @Override protected boolean proceedAfterAllMerged() throws VcsException {
- return myRebaser.continueRebase(myRoot);
- }
- }
-
public static class TrivialEditor extends GitInteractiveRebaseEditorHandler{
public TrivialEditor(@NotNull GitRebaseEditorService service,
@NotNull Project project,
diff --git a/plugins/git4idea/src/git4idea/remote/GitHttpAuthDataProvider.java b/plugins/git4idea/src/git4idea/remote/GitHttpAuthDataProvider.java
index 6c0860c..281d69b 100644
--- a/plugins/git4idea/src/git4idea/remote/GitHttpAuthDataProvider.java
+++ b/plugins/git4idea/src/git4idea/remote/GitHttpAuthDataProvider.java
@@ -15,6 +15,7 @@
*/
package git4idea.remote;
+import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.util.AuthData;
import org.jetbrains.annotations.NotNull;
@@ -31,7 +32,7 @@
ExtensionPointName<GitHttpAuthDataProvider> EP_NAME = ExtensionPointName.create("Git4Idea.GitHttpAuthDataProvider");
@Nullable
- AuthData getAuthData(@NotNull String url);
+ AuthData getAuthData(@NotNull String url, @Nullable ModalityState modalityState);
void forgetPassword(@NotNull String url);
diff --git a/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java b/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java
index 5109d06..576f326 100644
--- a/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java
+++ b/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java
@@ -416,7 +416,7 @@
LOG.info(".git/HEAD has not standard format: [" + headContent + "]. We've parsed branch [" + matcher.group(1) + "]");
return new Head(true, matcher.group(1));
}
- throw new RepoStateException("Invalid format of the .git/HEAD file: \n" + headContent);
+ throw new RepoStateException("Invalid format of the .git/HEAD file: [" + headContent + "]");
}
/**
diff --git a/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java b/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java
index 00f1830..e255598 100644
--- a/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java
+++ b/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java
@@ -141,14 +141,20 @@
}
}
// revert files from HEAD
- for (Map.Entry<VirtualFile, List<FilePath>> entry : toRevert.entrySet()) {
- listener.accept(entry.getValue());
- try {
- revert(entry.getKey(), entry.getValue());
+ GitUtil.workingTreeChangeStarted(myProject);
+ try {
+ for (Map.Entry<VirtualFile, List<FilePath>> entry : toRevert.entrySet()) {
+ listener.accept(entry.getValue());
+ try {
+ revert(entry.getKey(), entry.getValue());
+ }
+ catch (VcsException e) {
+ exceptions.add(e);
+ }
}
- catch (VcsException e) {
- exceptions.add(e);
- }
+ }
+ finally {
+ GitUtil.workingTreeChangeFinished(myProject);
}
LocalFileSystem lfs = LocalFileSystem.getInstance();
HashSet<File> filesToRefresh = new HashSet<File>();
diff --git a/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java b/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java
index 3c8d710..9b13bb6 100644
--- a/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java
+++ b/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java
@@ -413,25 +413,31 @@
GitUntrackedFilesOverwrittenByOperationDetector untrackedFilesDetector = new GitUntrackedFilesOverwrittenByOperationDetector(root);
h.addLineListener(untrackedFilesDetector);
- final Ref<GitCommandResult> result = Ref.create();
- ProgressManager.getInstance().run(new Task.Modal(h.project(), GitBundle.getString("unstash.unstashing"), false) {
- public void run(@NotNull final ProgressIndicator indicator) {
- h.addLineListener(new GitHandlerUtil.GitLineHandlerListenerProgress(indicator, h, "stash", false));
- Git git = ServiceManager.getService(Git.class);
- result.set(git.runCommand(new Computable.PredefinedValueComputable<GitLineHandler>(h)));
- }
- });
+ GitUtil.workingTreeChangeStarted(myProject);
+ try {
+ final Ref<GitCommandResult> result = Ref.create();
+ ProgressManager.getInstance().run(new Task.Modal(h.project(), GitBundle.getString("unstash.unstashing"), false) {
+ public void run(@NotNull final ProgressIndicator indicator) {
+ h.addLineListener(new GitHandlerUtil.GitLineHandlerListenerProgress(indicator, h, "stash", false));
+ Git git = ServiceManager.getService(Git.class);
+ result.set(git.runCommand(new Computable.PredefinedValueComputable<GitLineHandler>(h)));
+ }
+ });
- ServiceManager.getService(myProject, GitPlatformFacade.class).hardRefresh(root);
- GitCommandResult res = result.get();
- if (conflict.get()) {
- boolean conflictsResolved = new UnstashConflictResolver(myProject, root, getSelectedStash()).merge();
- LOG.info("loadRoot " + root + ", conflictsResolved: " + conflictsResolved);
- } else if (untrackedFilesDetector.wasMessageDetected()) {
- UntrackedFilesNotifier.notifyUntrackedFilesOverwrittenBy(myProject, root, untrackedFilesDetector.getRelativeFilePaths(),
- "unstash", null);
- } else if (!res.success()) {
- GitUIUtil.showOperationErrors(myProject, h.errors(), h.printableCommandLine());
+ ServiceManager.getService(myProject, GitPlatformFacade.class).hardRefresh(root);
+ GitCommandResult res = result.get();
+ if (conflict.get()) {
+ boolean conflictsResolved = new UnstashConflictResolver(myProject, root, getSelectedStash()).merge();
+ LOG.info("loadRoot " + root + ", conflictsResolved: " + conflictsResolved);
+ } else if (untrackedFilesDetector.wasMessageDetected()) {
+ UntrackedFilesNotifier.notifyUntrackedFilesOverwrittenBy(myProject, root, untrackedFilesDetector.getRelativeFilePaths(),
+ "unstash", null);
+ } else if (!res.success()) {
+ GitUIUtil.showOperationErrors(myProject, h.errors(), h.printableCommandLine());
+ }
+ }
+ finally {
+ GitUtil.workingTreeChangeFinished(myProject);
}
super.doOKAction();
}
diff --git a/plugins/git4idea/src/git4idea/update/GitUpdateProcess.java b/plugins/git4idea/src/git4idea/update/GitUpdateProcess.java
index bc13ab8..e78039e 100644
--- a/plugins/git4idea/src/git4idea/update/GitUpdateProcess.java
+++ b/plugins/git4idea/src/git4idea/update/GitUpdateProcess.java
@@ -132,7 +132,13 @@
GitComplexProcess.Operation updateOperation = new GitComplexProcess.Operation() {
@Override public void run(ContinuationContext continuationContext) {
- myResult = updateImpl(updateMethod, continuationContext);
+ GitUtil.workingTreeChangeStarted(myProject);
+ try {
+ myResult = updateImpl(updateMethod, continuationContext);
+ }
+ finally {
+ GitUtil.workingTreeChangeFinished(myProject);
+ }
}
};
GitComplexProcess.execute(myProject, "update", updateOperation);
diff --git a/plugins/git4idea/test-stepdefs/git4idea/GitCucumberWorld.java b/plugins/git4idea/test-stepdefs/git4idea/GitCucumberWorld.java
index 9625505..2db213c 100644
--- a/plugins/git4idea/test-stepdefs/git4idea/GitCucumberWorld.java
+++ b/plugins/git4idea/test-stepdefs/git4idea/GitCucumberWorld.java
@@ -65,7 +65,6 @@
import static com.intellij.openapi.vcs.Executor.cd;
import static com.intellij.openapi.vcs.Executor.mkdir;
-import static org.junit.Assume.assumeTrue;
/**
* <p>The container of test environment variables which should be visible from any step definition script.</p>
@@ -149,7 +148,7 @@
AbstractVcs vcs = vcsManager.findVcsByName("Git");
Assert.assertEquals(1, vcsManager.getRootsUnderVcs(vcs).length);
- assumeSupportedGitVersion();
+ GitTestUtil.assumeSupportedGitVersion(myVcs);
LOG.info(getStartTestMarker());
}
@@ -157,10 +156,6 @@
return "Starting " + myTestName;
}
- private static void assumeSupportedGitVersion() {
- assumeTrue(myVcs.getVersion().isSupported());
- }
-
// TODO should take actual feature name once we migrate to more recent cucumber lib
private String createTestName() {
return getClass().getName() + "-" + new Random().nextInt();
diff --git a/plugins/git4idea/tests/git4idea/log/GitLogRefSorterTest.java b/plugins/git4idea/tests/git4idea/log/GitRefManagerTest.java
similarity index 96%
rename from plugins/git4idea/tests/git4idea/log/GitLogRefSorterTest.java
rename to plugins/git4idea/tests/git4idea/log/GitRefManagerTest.java
index 7346852..707e972 100644
--- a/plugins/git4idea/tests/git4idea/log/GitLogRefSorterTest.java
+++ b/plugins/git4idea/tests/git4idea/log/GitRefManagerTest.java
@@ -21,10 +21,7 @@
import java.util.*;
-/**
- * @author Kirill Likhodedov
- */
-public class GitLogRefSorterTest extends UsefulTestCase {
+public class GitRefManagerTest extends UsefulTestCase {
public static final MockVirtualFile MOCK_VIRTUAL_FILE = new MockVirtualFile("mockFile");
@@ -77,10 +74,10 @@
expect("HEAD", "master", "release", "origin/master", "origin/great_feature", "tag/v1"));
}
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
+ // may happen e.g. in multi-repo case
+ public void testTwoMasters() {
+ check(given("master", "master"),
+ expect("master", "master"));
}
private static Collection<VcsRef> given(String... refs) {
@@ -205,7 +202,7 @@
return infos;
}
});
- return new GitRefManager(manager).sort(refs);
+ return ContainerUtil.sorted(refs, new GitRefManager(manager).getComparator());
}
// TODO either use the real GitRepository, or move upwards and make more generic implementation
diff --git a/plugins/git4idea/tests/git4idea/test/GitPlatformTest.java b/plugins/git4idea/tests/git4idea/test/GitPlatformTest.java
index ecef2b2..ef3f963 100644
--- a/plugins/git4idea/tests/git4idea/test/GitPlatformTest.java
+++ b/plugins/git4idea/tests/git4idea/test/GitPlatformTest.java
@@ -29,6 +29,7 @@
import com.intellij.testFramework.fixtures.IdeaProjectTestFixture;
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory;
import com.intellij.testFramework.vcs.AbstractVcsTestCase;
+import com.intellij.util.ObjectUtils;
import git4idea.DialogManager;
import git4idea.GitPlatformFacade;
import git4idea.GitUtil;
@@ -57,6 +58,7 @@
@NotNull protected GitVcsSettings myGitSettings;
@NotNull protected GitPlatformFacade myPlatformFacade;
@NotNull protected Git myGit;
+ @NotNull protected GitVcs myVcs;
@NotNull protected TestDialogManager myDialogManager;
@NotNull protected TestVcsNotifier myVcsNotifier;
@@ -97,7 +99,10 @@
myGitRepositoryManager = GitUtil.getRepositoryManager(myProject);
myPlatformFacade = ServiceManager.getService(myProject, GitPlatformFacade.class);
myGit = ServiceManager.getService(myProject, Git.class);
+ myVcs = ObjectUtils.assertNotNull(GitVcs.getInstance(myProject));
+ myVcs.doActivate();
+ GitTestUtil.assumeSupportedGitVersion(myVcs);
initChangeListManager();
addSilently();
removeSilently();
diff --git a/plugins/git4idea/tests/git4idea/test/GitTestUtil.java b/plugins/git4idea/tests/git4idea/test/GitTestUtil.java
index a6a8f0c..842b1b1 100644
--- a/plugins/git4idea/tests/git4idea/test/GitTestUtil.java
+++ b/plugins/git4idea/tests/git4idea/test/GitTestUtil.java
@@ -31,6 +31,7 @@
import static com.intellij.openapi.vcs.Executor.*;
import static git4idea.test.GitExecutor.git;
import static junit.framework.Assert.assertNotNull;
+import static org.junit.Assume.assumeTrue;
public class GitTestUtil {
@@ -108,4 +109,8 @@
public static void setDefaultBuiltInServerPort() {
System.setProperty(BuiltInServerManagerImpl.PROPERTY_RPC_PORT, "64463");
}
+
+ public static void assumeSupportedGitVersion(@NotNull GitVcs vcs) {
+ assumeTrue(vcs.getVersion().isSupported());
+ }
}
diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java
index a733674..714191d 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java
@@ -43,7 +43,6 @@
import org.jetbrains.plugins.github.api.GithubApiUtil;
import org.jetbrains.plugins.github.api.GithubFullPath;
import org.jetbrains.plugins.github.api.GithubRepoDetailed;
-import org.jetbrains.plugins.github.exceptions.GithubOperationCanceledException;
import org.jetbrains.plugins.github.util.*;
import java.io.IOException;
@@ -196,7 +195,7 @@
}
try {
- return GithubUtil.runTask(project, GithubAuthDataHolder.createFromSettings(), indicator,
+ return GithubUtil.runTask(project, GithubAuthDataHolder.createFromSettings(indicator.getModalityState()), indicator,
new ThrowableConvertor<GithubAuthData, GithubRepoDetailed, IOException>() {
@NotNull
@Override
@@ -227,6 +226,7 @@
@NotNull final ProgressIndicator indicator) {
final Git git = ServiceManager.getService(project, Git.class);
final GitPlatformFacade facade = ServiceManager.getService(project, GitPlatformFacade.class);
+ GitUtil.workingTreeChangeStarted(project);
GitPreservingProcess process =
new GitPreservingProcess(project, facade, git, Collections.singletonList(gitRepository), "Rebasing", "upstream/master", indicator,
new Runnable() {
@@ -237,6 +237,7 @@
}
);
process.execute();
+ GitUtil.workingTreeChangeFinished(project);
}
private static void doRebaseCurrentBranch(@NotNull final Project project,
diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java
index 9431b91..7c18b3b 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java
@@ -125,7 +125,7 @@
externalRemoteDetected = !gitRepository.getRemotes().isEmpty();
}
- final GithubAuthDataHolder authHolder = GithubAuthDataHolder.createFromSettings();
+ final GithubAuthDataHolder authHolder = GithubAuthDataHolder.createFromSettings(null);
// get available GitHub repos with modal progress
final GithubInfo githubInfo = loadGithubInfoWithModal(authHolder, project);
diff --git a/plugins/github/src/org/jetbrains/plugins/github/extensions/GithubCheckoutProvider.java b/plugins/github/src/org/jetbrains/plugins/github/extensions/GithubCheckoutProvider.java
index 6b3f73f..115258d9 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/extensions/GithubCheckoutProvider.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/extensions/GithubCheckoutProvider.java
@@ -61,7 +61,7 @@
@NotNull
@Override
public List<GithubRepo> convert(ProgressIndicator indicator) throws IOException {
- return GithubUtil.runTask(project, GithubAuthDataHolder.createFromSettings(), indicator,
+ return GithubUtil.runTask(project, GithubAuthDataHolder.createFromSettings(indicator.getModalityState()), indicator,
new ThrowableConvertor<GithubAuthData, List<GithubRepo>, IOException>() {
@NotNull
@Override
diff --git a/plugins/github/src/org/jetbrains/plugins/github/extensions/GithubHttpAuthDataProvider.java b/plugins/github/src/org/jetbrains/plugins/github/extensions/GithubHttpAuthDataProvider.java
index 5a7daf9..47d3edc 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/extensions/GithubHttpAuthDataProvider.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/extensions/GithubHttpAuthDataProvider.java
@@ -15,6 +15,7 @@
*/
package org.jetbrains.plugins.github.extensions;
+import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.AuthData;
import git4idea.remote.GitHttpAuthDataProvider;
@@ -31,7 +32,7 @@
@Nullable
@Override
- public AuthData getAuthData(@NotNull String url) {
+ public AuthData getAuthData(@NotNull String url, @Nullable ModalityState modalityState) {
if (!GithubUrlUtil.isGithubUrl(url)) {
return null;
}
@@ -47,7 +48,7 @@
return null;
}
- GithubAuthData auth = settings.getAuthData();
+ GithubAuthData auth = settings.getAuthData(modalityState);
switch (auth.getAuthType()) {
case BASIC:
GithubAuthData.BasicAuth basicAuth = auth.getBasicAuth();
diff --git a/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepositoryEditor.java b/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepositoryEditor.java
index 5333d82..9cf3cdf 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepositoryEditor.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepositoryEditor.java
@@ -125,7 +125,8 @@
@Override
public String convert(ProgressIndicator indicator) throws IOException {
return GithubUtil
- .runTaskWithBasicAuthForHost(myProject, GithubAuthDataHolder.createFromSettings(), indicator, getHost(),
+ .runTaskWithBasicAuthForHost(myProject, GithubAuthDataHolder.createFromSettings(indicator.getModalityState()),
+ indicator, getHost(),
new ThrowableConvertor<GithubAuthData, String, IOException>() {
@NotNull
@Override
diff --git a/plugins/github/src/org/jetbrains/plugins/github/ui/GithubSettingsPanel.java b/plugins/github/src/org/jetbrains/plugins/github/ui/GithubSettingsPanel.java
index 7de0dae..229170e2 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/ui/GithubSettingsPanel.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/ui/GithubSettingsPanel.java
@@ -130,7 +130,8 @@
@NotNull
@Override
public String convert(ProgressIndicator indicator) throws IOException {
- return GithubUtil.runTaskWithBasicAuthForHost(project, GithubAuthDataHolder.createFromSettings(), indicator, getHost(),
+ return GithubUtil.runTaskWithBasicAuthForHost(project, GithubAuthDataHolder.createFromSettings(indicator.getModalityState()),
+ indicator, getHost(),
new ThrowableConvertor<GithubAuthData, String, IOException>() {
@NotNull
@Override
@@ -262,7 +263,7 @@
@NotNull
public GithubAuthData getAuthData() {
if (!myCredentialsModified) {
- return mySettings.getAuthData();
+ return mySettings.getAuthData(null);
}
Object selected = myAuthTypeComboBox.getSelectedItem();
if (AUTH_PASSWORD.equals(selected)) return GithubAuthData.createBasicAuth(getHost(), getLogin(), getPassword());
@@ -290,7 +291,7 @@
public void apply() {
if (myCredentialsModified) {
- mySettings.setAuthData(getAuthData(), true);
+ mySettings.setAuthData(getAuthData(), true, null);
}
mySettings.setConnectionTimeout(getConnectionTimeout());
resetCredentialsModification();
diff --git a/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthData.java b/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthData.java
index f110444..d7981b2 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthData.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthData.java
@@ -15,6 +15,7 @@
*/
package org.jetbrains.plugins.github.util;
+import com.intellij.openapi.application.ModalityState;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.github.api.GithubApiUtil;
@@ -52,8 +53,8 @@
myUseProxy = useProxy;
}
- public static GithubAuthData createFromSettings() {
- return GithubSettings.getInstance().getAuthData();
+ public static GithubAuthData createFromSettings(@Nullable ModalityState state) {
+ return GithubSettings.getInstance().getAuthData(state);
}
public static GithubAuthData createAnonymous() {
diff --git a/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthDataHolder.java b/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthDataHolder.java
index 695dfe7..24303a3 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthDataHolder.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthDataHolder.java
@@ -15,8 +15,10 @@
*/
package org.jetbrains.plugins.github.util;
+import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.util.ThrowableComputable;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
public class GithubAuthDataHolder {
@@ -40,7 +42,7 @@
myAuthData = task.compute();
}
- public static GithubAuthDataHolder createFromSettings() {
- return new GithubAuthDataHolder(GithubSettings.getInstance().getAuthData());
+ public static GithubAuthDataHolder createFromSettings(@Nullable ModalityState state) {
+ return new GithubAuthDataHolder(GithubSettings.getInstance().getAuthData(state));
}
}
diff --git a/plugins/github/src/org/jetbrains/plugins/github/util/GithubSettings.java b/plugins/github/src/org/jetbrains/plugins/github/util/GithubSettings.java
index 3523e41..a2bdca5 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/util/GithubSettings.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/util/GithubSettings.java
@@ -19,6 +19,7 @@
import com.intellij.ide.passwordSafe.PasswordSafeException;
import com.intellij.ide.passwordSafe.config.PasswordSafeSettings;
import com.intellij.ide.passwordSafe.impl.PasswordSafeImpl;
+import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.components.*;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.text.StringUtil;
@@ -151,10 +152,10 @@
}
@NotNull
- private String getPassword() {
+ private String getPassword(@Nullable ModalityState state) {
String password;
try {
- password = PasswordSafe.getInstance().getPassword(null, GithubSettings.class, GITHUB_SETTINGS_PASSWORD_KEY);
+ password = PasswordSafe.getInstance().getPassword(null, GithubSettings.class, GITHUB_SETTINGS_PASSWORD_KEY, state);
}
catch (PasswordSafeException e) {
LOG.info("Couldn't get password for key [" + GITHUB_SETTINGS_PASSWORD_KEY + "]", e);
@@ -164,10 +165,10 @@
return StringUtil.notNullize(password);
}
- private void setPassword(@NotNull String password, boolean rememberPassword) {
+ private void setPassword(@NotNull String password, boolean rememberPassword, @Nullable ModalityState state) {
try {
if (rememberPassword) {
- PasswordSafe.getInstance().storePassword(null, GithubSettings.class, GITHUB_SETTINGS_PASSWORD_KEY, password);
+ PasswordSafe.getInstance().storePassword(null, GithubSettings.class, GITHUB_SETTINGS_PASSWORD_KEY, password, state);
}
else {
final PasswordSafeImpl passwordSafe = (PasswordSafeImpl)PasswordSafe.getInstance();
@@ -196,13 +197,13 @@
}
@NotNull
- public GithubAuthData getAuthData() {
+ public GithubAuthData getAuthData(@Nullable ModalityState state) {
switch (getAuthType()) {
case BASIC:
//noinspection ConstantConditions
- return GithubAuthData.createBasicAuth(getHost(), getLogin(), getPassword());
+ return GithubAuthData.createBasicAuth(getHost(), getLogin(), getPassword(state));
case TOKEN:
- return GithubAuthData.createTokenAuth(getHost(), getPassword());
+ return GithubAuthData.createTokenAuth(getHost(), getPassword(state));
case ANONYMOUS:
return GithubAuthData.createAnonymous();
default:
@@ -210,7 +211,7 @@
}
}
- public void setAuthData(@NotNull GithubAuthData auth, boolean rememberPassword) {
+ public void setAuthData(@NotNull GithubAuthData auth, boolean rememberPassword, @Nullable ModalityState state) {
setValidGitAuth(isValidGitAuth(auth));
setAuthType(auth.getAuthType());
@@ -220,16 +221,16 @@
case BASIC:
assert auth.getBasicAuth() != null;
setLogin(auth.getBasicAuth().getLogin());
- setPassword(auth.getBasicAuth().getPassword(), rememberPassword);
+ setPassword(auth.getBasicAuth().getPassword(), rememberPassword, state);
break;
case TOKEN:
assert auth.getTokenAuth() != null;
setLogin(null);
- setPassword(auth.getTokenAuth().getToken(), rememberPassword);
+ setPassword(auth.getTokenAuth().getToken(), rememberPassword, state);
break;
case ANONYMOUS:
setLogin(null);
- setPassword("", rememberPassword);
+ setPassword("", rememberPassword, state);
break;
default:
throw new IllegalStateException("GithubSettings: setAuthData - wrong AuthType: " + auth.getAuthType());
diff --git a/plugins/github/src/org/jetbrains/plugins/github/util/GithubUtil.java b/plugins/github/src/org/jetbrains/plugins/github/util/GithubUtil.java
index edd12ab..e4af54f 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/util/GithubUtil.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/util/GithubUtil.java
@@ -161,7 +161,7 @@
if (ok[0]) {
authData[0] = dialog.getAuthData();
- GithubSettings.getInstance().setAuthData(authData[0], dialog.isSavePasswordSelected());
+ GithubSettings.getInstance().setAuthData(authData[0], dialog.isSavePasswordSelected(), indicator.getModalityState());
}
}
}, indicator.getModalityState());
@@ -195,7 +195,7 @@
final GithubSettings settings = GithubSettings.getInstance();
if (settings.getAuthType() != GithubAuthData.AuthType.TOKEN) {
- GithubSettings.getInstance().setAuthData(authData[0], dialog.isSavePasswordSelected());
+ GithubSettings.getInstance().setAuthData(authData[0], dialog.isSavePasswordSelected(), indicator.getModalityState());
}
}
}
@@ -247,7 +247,7 @@
@NotNull
public static GithubAuthDataHolder getValidAuthDataHolderFromConfig(@NotNull Project project, @NotNull ProgressIndicator indicator)
throws IOException {
- GithubAuthData auth = GithubAuthData.createFromSettings();
+ GithubAuthData auth = GithubAuthData.createFromSettings(indicator.getModalityState());
GithubAuthDataHolder authHolder = new GithubAuthDataHolder(auth);
try {
checkAuthData(project, authHolder, indicator);
diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java
index b54bd8c..d313398 100644
--- a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java
+++ b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java
@@ -54,12 +54,12 @@
@NotNull
protected GithubAuthDataHolder getAuthDataHolder() {
- return new GithubAuthDataHolder(myGitHubSettings.getAuthData());
+ return new GithubAuthDataHolder(myGitHubSettings.getAuthData(null));
}
protected void deleteGist() throws IOException {
if (GIST_ID != null) {
- GithubApiUtil.deleteGist(myGitHubSettings.getAuthData(), GIST_ID);
+ GithubApiUtil.deleteGist(myGitHubSettings.getAuthData(null), GIST_ID);
GIST = null;
GIST_ID = null;
}
@@ -82,7 +82,7 @@
if (GIST == null) {
try {
- GIST = GithubApiUtil.getGist(myGitHubSettings.getAuthData(), GIST_ID);
+ GIST = GithubApiUtil.getGist(myGitHubSettings.getAuthData(null), GIST_ID);
}
catch (IOException e) {
System.err.println(e.getMessage());
diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubRequestPagingTest.java b/plugins/github/test/org/jetbrains/plugins/github/GithubRequestPagingTest.java
index 4fec0d1c..97b34aa 100644
--- a/plugins/github/test/org/jetbrains/plugins/github/GithubRequestPagingTest.java
+++ b/plugins/github/test/org/jetbrains/plugins/github/GithubRequestPagingTest.java
@@ -36,7 +36,7 @@
public void testAvailableRepos() throws Throwable {
- List<GithubRepo> availableRepos = GithubApiUtil.getUserRepos(myGitHubSettings.getAuthData(), myLogin2);
+ List<GithubRepo> availableRepos = GithubApiUtil.getUserRepos(myGitHubSettings.getAuthData(null), myLogin2);
List<String> realData = new ArrayList<String>();
for (GithubRepo info : availableRepos) {
realData.add(info.getName());
diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTest.java b/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTest.java
index c406362..e6da326 100644
--- a/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTest.java
+++ b/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTest.java
@@ -99,7 +99,7 @@
}
protected void checkGithubExists() throws IOException {
- GithubAuthData auth = myGitHubSettings.getAuthData();
+ GithubAuthData auth = myGitHubSettings.getAuthData(null);
GithubRepoDetailed githubInfo = GithubApiUtil.getDetailedRepoInfo(auth, myLogin1, PROJECT_NAME);
assertNotNull("GitHub repository does not exist", githubInfo);
}
diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTestBase.java b/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTestBase.java
index abfb5ece..f146b37 100644
--- a/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTestBase.java
+++ b/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTestBase.java
@@ -48,7 +48,7 @@
}
protected void deleteGithubRepo() throws IOException {
- GithubApiUtil.deleteGithubRepository(myGitHubSettings.getAuthData(), myLogin1, PROJECT_NAME);
+ GithubApiUtil.deleteGithubRepository(myGitHubSettings.getAuthData(null), myLogin1, PROJECT_NAME);
}
protected void registerDefaultShareDialogHandler() {
diff --git a/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java b/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java
index 3d3d820..b728913 100644
--- a/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java
+++ b/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java
@@ -172,7 +172,7 @@
myAuth = GithubAuthData.createBasicAuth(host, login1, password);
myGitHubSettings = GithubSettings.getInstance();
- myGitHubSettings.setAuthData(myAuth, false);
+ myGitHubSettings.setAuthData(myAuth, false, null);
myHttpAuthService = (GitHttpAuthTestService)ServiceManager.getService(GitHttpAuthService.class);
diff --git a/plugins/gradle/src/META-INF/plugin.xml b/plugins/gradle/src/META-INF/plugin.xml
index 67ca15f..de6937c 100644
--- a/plugins/gradle/src/META-INF/plugin.xml
+++ b/plugins/gradle/src/META-INF/plugin.xml
@@ -83,7 +83,7 @@
<moduleBuilder builderClass="org.jetbrains.plugins.gradle.service.project.wizard.GradleModuleBuilder"/>
<internalFileTemplate name="Gradle Build Script"/>
<internalFileTemplate name="Gradle Build Script with wrapper"/>
- <projectConfigurable id="reference.settingsdialog.project.gradle"
+ <projectConfigurable groupId="build" id="reference.settingsdialog.project.gradle"
instance="org.jetbrains.plugins.gradle.service.settings.GradleConfigurable"
key="gradle.name" bundle="i18n.GradleBundle"/>
<library.presentationProvider implementation="org.jetbrains.plugins.gradle.config.GradleLibraryPresentationProvider" order="last"/>
diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleScriptType.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleScriptType.java
index 61783c1..30fb81a 100644
--- a/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleScriptType.java
+++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleScriptType.java
@@ -261,9 +261,14 @@
final String scriptPath = configuration.getScriptPath();
if (scriptPath == null) {
- throw new CantRunException("Target script is undefined");
+ throw new CantRunException("Target script or gradle project path is undefined");
}
- params.getProgramParametersList().add("--project-dir");
+
+ if(new File(scriptPath).isFile()) {
+ params.getProgramParametersList().add("--build-file");
+ } else {
+ params.getProgramParametersList().add("--project-dir");
+ }
params.getProgramParametersList().add(FileUtil.toSystemDependentName(scriptPath));
params.getProgramParametersList().addParametersString(configuration.getProgramParameters());
params.getProgramParametersList().addParametersString(scriptParameters);
diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/execution/test/runner/TestMethodGradleConfigurationProducer.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/execution/test/runner/TestMethodGradleConfigurationProducer.java
index 5993480..f4dec62 100644
--- a/plugins/gradle/src/org/jetbrains/plugins/gradle/execution/test/runner/TestMethodGradleConfigurationProducer.java
+++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/execution/test/runner/TestMethodGradleConfigurationProducer.java
@@ -107,7 +107,8 @@
if (!configuration.getSettings().getTaskNames().containsAll(TASKS_TO_RUN)) return false;
final String scriptParameters = configuration.getSettings().getScriptParameters() + ' ';
- return scriptParameters.contains(String.format("--tests %s.%s ", containingClass.getQualifiedName(), psiMethod.getName()));
+ final String testFilter = creatTestFilter(containingClass, psiMethod);
+ return scriptParameters.contains(testFilter);
}
@Override
@@ -163,11 +164,16 @@
StringBuilder buf = new StringBuilder();
for (PsiClass aClass : containingClasses) {
- buf.append(String.format("--tests %s.%s ", aClass.getQualifiedName(), psiMethod.getName()));
+ buf.append(creatTestFilter(aClass, psiMethod));
}
- configuration.getSettings().setScriptParameters(buf.toString());
+ configuration.getSettings().setScriptParameters(buf.toString().trim());
configuration.setName(psiMethod.getName());
return true;
}
+
+ private static String creatTestFilter(@NotNull PsiClass aClass, @NotNull PsiMethod psiMethod) {
+ String testFilterPattern = aClass.getQualifiedName() + '.' + psiMethod.getName();
+ return String.format("--tests \"%s\" ", StringUtil.replaceChar(testFilterPattern, '\"', '*'));
+ }
}
diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java
index dd72355..f59ccee 100644
--- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java
+++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java
@@ -62,7 +62,6 @@
private static final int GRADLE_DAEMON_TTL_MS = 10000;
- public static final Pattern TEST_METHOD_NAME_PATTERN = Pattern.compile("(.*)\\[(\\d*: with Gradle-.*)\\]");
@Rule public TestName name = new TestName();
@NotNull
@@ -91,12 +90,7 @@
@Override
public String getName() {
- String methodName = name.getMethodName();
- Matcher m = TEST_METHOD_NAME_PATTERN.matcher(methodName);
- if (m.matches()) {
- methodName = m.group(1);
- }
- return methodName;
+ return name.getMethodName() == null ? super.getName() : FileUtil.sanitizeFileName(name.getMethodName());
}
@Parameterized.Parameters(name = "{index}: with Gradle-{0}")
diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/BaseInspection.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/BaseInspection.java
index be28ee0a..5e6e8ff 100644
--- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/BaseInspection.java
+++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/BaseInspection.java
@@ -16,9 +16,9 @@
package org.jetbrains.plugins.groovy.codeInspection;
import com.intellij.codeInspection.InspectionManager;
+import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.codeInspection.ProblemsHolder;
-import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
@@ -26,8 +26,7 @@
import org.jetbrains.plugins.groovy.lang.psi.GroovyFileBase;
public abstract class BaseInspection extends GroovySuppressableInspectionTool {
-
- private final String m_shortName = StringUtil.trimEnd(getClass().getSimpleName(), "Inspection");
+ private final String m_shortName = InspectionProfileEntry.getShortName(getClass().getSimpleName());
public static final String ASSIGNMENT_ISSUES = "Assignment issues";
public static final String CONFUSING_CODE_CONSTRUCTS = "Potentially confusing code constructs";
diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightMethodBuilder.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightMethodBuilder.java
index 6dcdb2a..309f7f4 100644
--- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightMethodBuilder.java
+++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightMethodBuilder.java
@@ -200,7 +200,11 @@
@Override
public GrTypeElement getReturnTypeElementGroovy() {
- return null;
+ PsiType returnType = getReturnType();
+ if (returnType == null) {
+ return null;
+ }
+ return new GrLightTypeElement(returnType, getManager());
}
@Override
diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightParameterListBuilder.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightParameterListBuilder.java
index 409ab4d..425b4a8 100644
--- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightParameterListBuilder.java
+++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightParameterListBuilder.java
@@ -64,9 +64,9 @@
return myCachedParameters;
}
- public void copyParameters(@NotNull PsiMethod method, PsiSubstitutor substitutor) {
+ public void copyParameters(@NotNull PsiMethod method, PsiSubstitutor substitutor, PsiMethod scope) {
for (PsiParameter parameter : method.getParameterList().getParameters()) {
- GrLightParameter p = new GrLightParameter(StringUtil.notNullize(parameter.getName()), substitutor.substitute(parameter.getType()), this);
+ GrLightParameter p = new GrLightParameter(StringUtil.notNullize(parameter.getName()), substitutor.substitute(parameter.getType()), scope);
if (parameter instanceof GrParameter) {
p.setOptional(((GrParameter)parameter).isOptional());
diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrMethodWrapper.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrMethodWrapper.java
index 44da8f2..9060513 100644
--- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrMethodWrapper.java
+++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrMethodWrapper.java
@@ -43,7 +43,7 @@
getModifierList().copyModifiers(method);
- getParameterList().copyParameters(method, substitutor);
+ getParameterList().copyParameters(method, substitutor, this);
if (method instanceof OriginInfoAwareElement) {
setOriginInfo(((OriginInfoAwareElement)method).getOriginInfo());
diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/stubs/elements/GrStubFileElementType.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/stubs/elements/GrStubFileElementType.java
index cd516c6..8ccfe21 100644
--- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/stubs/elements/GrStubFileElementType.java
+++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/stubs/elements/GrStubFileElementType.java
@@ -44,6 +44,7 @@
@Override
public StubBuilder getBuilder() {
return new DefaultStubBuilder() {
+ @NotNull
@Override
protected StubElement createStubForFile(@NotNull final PsiFile file) {
if (file instanceof GroovyFile) {
diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/stubs/index/GrFullClassNameIndex.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/stubs/index/GrFullClassNameIndex.java
index 797ff3b..b7b27df 100644
--- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/stubs/index/GrFullClassNameIndex.java
+++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/stubs/index/GrFullClassNameIndex.java
@@ -44,7 +44,7 @@
}
@Override
- public Collection<PsiClass> get(final Integer integer, final Project project, final GlobalSearchScope scope) {
+ public Collection<PsiClass> get(@NotNull final Integer integer, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
return StubIndex.getElements(getKey(), integer, project, new GrSourceFilterScope(scope), PsiClass.class);
}
}
diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/typeEnhancers/FromStringHintProcessor.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/typeEnhancers/FromStringHintProcessor.java
index 6ca36c5..1af99c7 100644
--- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/typeEnhancers/FromStringHintProcessor.java
+++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/typeEnhancers/FromStringHintProcessor.java
@@ -15,10 +15,7 @@
*/
package org.jetbrains.plugins.groovy.lang.psi.typeEnhancers;
-import com.intellij.psi.JavaPsiFacade;
-import com.intellij.psi.PsiMethod;
-import com.intellij.psi.PsiSubstitutor;
-import com.intellij.psi.PsiType;
+import com.intellij.psi.*;
import com.intellij.util.Function;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.containers.ContainerUtil;
@@ -49,7 +46,9 @@
@Override
public PsiType fun(String param) {
try {
- PsiType original = JavaPsiFacade.getElementFactory(method.getProject()).createTypeFromText(param, method);
+ PsiTypeParameterList typeParameterList = method.getTypeParameterList();
+ PsiElement context = typeParameterList != null ? typeParameterList : method;
+ PsiType original = JavaPsiFacade.getElementFactory(method.getProject()).createTypeFromText(param, context);
return substitutor.substitute(original);
}
catch (IncorrectOperationException e) {
diff --git a/plugins/groovy/src/META-INF/plugin.xml b/plugins/groovy/src/META-INF/plugin.xml
index f16d2c1..8e3d710 100644
--- a/plugins/groovy/src/META-INF/plugin.xml
+++ b/plugins/groovy/src/META-INF/plugin.xml
@@ -25,7 +25,6 @@
<depends optional="true" config-file="intellilang-groovy-support.xml">org.intellij.intelliLang</depends>
<depends optional="true">AntSupport</depends>
<depends optional="true" config-file="groovy-byte-code-viewer.xml">ByteCodeViewer</depends>
- <depends optional="true" config-file="structuralsearch.xml">Structural Search</depends>
<extensionPoints>
<extensionPoint name="methodComparator" interface="org.jetbrains.plugins.groovy.lang.resolve.GrMethodComparator"/>
@@ -42,7 +41,6 @@
<extensionPoint name="positionManagerDelegate"
interface="org.jetbrains.plugins.groovy.extensions.debugger.ScriptPositionManagerHelper"/>
- <extensionPoint name="compilerExtension" interface="org.jetbrains.plugins.groovy.compiler.GroovyCompilerExtension"/>
<extensionPoint name="scriptTypeDetector" interface="org.jetbrains.plugins.groovy.extensions.GroovyScriptTypeDetector"/>
<extensionPoint name="namedArgumentProvider" interface="org.jetbrains.plugins.groovy.extensions.GroovyNamedArgumentProvider"/>
@@ -275,7 +273,7 @@
<fileTypeFactory implementation="org.jetbrains.plugins.groovy.GroovyFileTypeLoader"/>
<fileTypeFactory implementation="org.jetbrains.plugins.groovy.dgm.DGMFileTypeFactory"/>
- <projectConfigurable instance="org.jetbrains.plugins.groovy.gant.GantConfigurable" id="reference.settingsdialog.project.gant"
+ <projectConfigurable groupId="build" instance="org.jetbrains.plugins.groovy.gant.GantConfigurable" id="reference.settingsdialog.project.gant"
displayName="Gant"/>
<library.presentationProvider implementation="org.jetbrains.plugins.groovy.config.GroovyLibraryPresentationProvider"/>
@@ -404,6 +402,8 @@
<refactoring.helper implementation="org.jetbrains.plugins.groovy.refactoring.GroovyImportOptimizerRefactoringHelper"/>
<codeInsight.lineMarkerProvider language="Groovy"
implementationClass="org.jetbrains.plugins.groovy.codeInsight.GroovyLineMarkerProvider"/>
+ <codeInsight.lineMarkerProvider language="Groovy"
+ implementationClass="com.intellij.codeInsight.ExternalAnnotationsLineMarkerProvider"/>
<codeInsight.gotoSuper language="Groovy"
implementationClass="org.jetbrains.plugins.groovy.codeInsight.navigation.actions.GroovyGotoSuperHandler"/>
<lookup.charFilter implementation="org.jetbrains.plugins.groovy.lang.completion.GroovyReferenceCharFilter"/>
@@ -445,13 +445,13 @@
<weigher key="proximity" implementationClass="org.jetbrains.plugins.groovy.lang.completion.weighers.GrReferenceListWeigher"
id="groovyReferenceListWeigher" order="before openedInEditor"/>
- <debuggerClassFilterProvider implementation="org.jetbrains.plugins.groovy.debugger.filters.GroovyDebuggerClassFilterProvider"/>
+ <debuggerClassFilterProvider implementation="org.jetbrains.plugins.groovy.debugger.GroovyDebuggerClassFilterProvider"/>
<useScopeEnlarger implementation="org.jetbrains.plugins.groovy.lang.psi.impl.search.GrPrivateFieldScopeEnlarger"/>
<debuggerEditorTextProvider language="Groovy" implementationClass="org.jetbrains.plugins.groovy.debugger.GroovyEditorTextProvider"/>
- <xdebugger.settings implementation="org.jetbrains.plugins.groovy.debugger.filters.GroovyDebuggerSettings"/>
+ <xdebugger.settings implementation="org.jetbrains.plugins.groovy.debugger.GroovyDebuggerSettings"/>
<langCodeStyleSettingsProvider implementation="org.jetbrains.plugins.groovy.codeStyle.GroovyLanguageCodeStyleSettingsProvider"/>
<codeStyleSettingsProvider implementation="org.jetbrains.plugins.groovy.codeStyle.GroovyCodeStyleSettingsProvider"/>
@@ -1515,6 +1515,8 @@
implementationClass="org.jetbrains.plugins.groovy.refactoring.memberPullUp.GrPullUpHelperFactory"/>
<classTypePointerFactory implementation="org.jetbrains.plugins.groovy.lang.psi.impl.smartPointers.GrClassReferenceTypePointerFactory"/>
<hierarchy.referenceProcessor implementation="org.jetbrains.plugins.groovy.hierarchy.call.GrCallReferenceProcessor"/>
+ <structuralsearch.profile implementation="com.intellij.structuralsearch.GroovyStructuralSearchProfile"/>
+ <equivalenceDescriptorProvider implementation="com.intellij.structuralsearch.GroovyEquivalenceDescriptorProvider"/>
</extensions>
<extensions defaultExtensionNs="com.intellij.debugger">
diff --git a/plugins/groovy/src/META-INF/structuralsearch.xml b/plugins/groovy/src/META-INF/structuralsearch.xml
deleted file mode 100644
index b3b6193..0000000
--- a/plugins/groovy/src/META-INF/structuralsearch.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<idea-plugin url="http://www.jetbrains.com/idea">
- <extensions defaultExtensionNs="com.intellij">
- <structuralsearch.profile implementation="com.intellij.structuralsearch.GroovyStructuralSearchProfile"/>
- </extensions>
-</idea-plugin>
-
\ No newline at end of file
diff --git a/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/PatternEditorContextMembersProvider.java b/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/PatternEditorContextMembersProvider.java
index e23254d..3fcf1c3 100644
--- a/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/PatternEditorContextMembersProvider.java
+++ b/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/PatternEditorContextMembersProvider.java
@@ -19,7 +19,7 @@
import com.intellij.openapi.progress.EmptyProgressIndicator;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
-import com.intellij.openapi.util.ModificationTracker;
+import com.intellij.openapi.util.text.StringUtil;
import com.intellij.patterns.compiler.PatternClassBean;
import com.intellij.patterns.compiler.PatternCompilerFactory;
import com.intellij.psi.*;
@@ -30,14 +30,13 @@
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.TextOccurenceProcessor;
import com.intellij.psi.search.UsageSearchContext;
-import com.intellij.psi.util.CachedValue;
-import com.intellij.psi.util.CachedValueProvider;
-import com.intellij.psi.util.CachedValuesManager;
-import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.util.*;
import com.intellij.psi.xml.XmlTag;
import com.intellij.psi.xml.XmlText;
+import com.intellij.util.ArrayUtil;
import com.intellij.util.Processor;
import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.SoftFactoryMap;
import com.intellij.util.text.StringSearcher;
import org.intellij.plugins.intelliLang.inject.InjectorUtils;
import org.intellij.plugins.intelliLang.inject.config.BaseInjection;
@@ -46,86 +45,74 @@
import org.jetbrains.plugins.groovy.GroovyFileType;
import org.jetbrains.plugins.groovy.lang.resolve.NonCodeMembersContributor;
-import java.util.Collections;
import java.util.List;
+import java.util.Set;
/**
* @author Gregory.Shrago
*/
public class PatternEditorContextMembersProvider extends NonCodeMembersContributor {
- public static final Key<CachedValue<List<PsiElement>>> INJECTION_PARSED_CONTEXT = Key.create("INJECTION_PARSED_CONTEXT");
+ private static final Key<SoftFactoryMap<Class[], PsiFile>> PATTERN_INJECTION_CONTEXT = Key.create("PATTERN_INJECTION_CONTEXT");
+ private static final Key<CachedValue<Set<String>>> PATTERN_CLASSES = Key.create("PATTERN_CLASSES");
@Override
public void processDynamicElements(@NotNull PsiType qualifierType,
- @NotNull PsiScopeProcessor processor,
- @NotNull PsiElement place,
- @NotNull ResolveState state) {
+ @NotNull final PsiScopeProcessor scopeProcessor,
+ @NotNull final PsiElement place,
+ @NotNull final ResolveState state) {
final PsiFile file = place.getContainingFile().getOriginalFile();
- CachedValue<List<PsiElement>> value = file.getUserData(INJECTION_PARSED_CONTEXT);
- if (value == null) {
- final BaseInjection injection = file.getUserData(BaseInjection.INJECTION_KEY);
- final CachedValueProvider<List<PsiElement>> provider;
- if (injection == null) {
- provider = createDevProvider(file);
- }
- else {
- provider = createPatternProvider(injection, file);
- }
- if (provider == null) return;
- file.putUserData(INJECTION_PARSED_CONTEXT,
- value = CachedValuesManager.getManager(file.getProject()).createCachedValue(provider, false));
- }
- final List<PsiElement> roots = value.getValue();
- for (PsiElement root : roots) {
- if (!root.processDeclarations(processor, state, null, place)) return;
- }
- }
-
- private static CachedValueProvider<List<PsiElement>> createPatternProvider(final BaseInjection injection, final PsiFile file) {
- return new CachedValueProvider<List<PsiElement>>() {
+ final BaseInjection injection = file.getUserData(BaseInjection.INJECTION_KEY);
+ Processor<PsiElement> processor = new Processor<PsiElement>() {
@Override
- public Result<List<PsiElement>> compute() {
- return new Result<List<PsiElement>>(Collections.<PsiElement>singletonList(
- getRootByClasses(InjectorUtils.getPatternClasses(injection.getSupportId()), file.getProject())),
- ModificationTracker.NEVER_CHANGED);
+ public boolean process(PsiElement element) {
+ return element.processDeclarations(scopeProcessor, state, null, place);
}
};
+ if (injection == null) {
+ processDevContext(file, processor);
+ }
+ else {
+ processPatternContext(injection, file, processor);
+ }
}
- private static PsiFile getRootByClasses(Class[] classes, Project project) {
- final String text = PatternCompilerFactory.getFactory().getPatternCompiler(classes).dumpContextDeclarations();
- return PsiFileFactory.getInstance(project).createFileFromText("context.groovy", GroovyFileType.GROOVY_FILE_TYPE, text);
+ private static boolean processPatternContext(@NotNull BaseInjection injection,
+ @NotNull PsiFile file,
+ @NotNull Processor<PsiElement> processor) {
+ return processor.process(getRootByClasses(file, InjectorUtils.getPatternClasses(injection.getSupportId())));
}
- @Nullable
- private static CachedValueProvider<List<PsiElement>> createDevProvider(final PsiFile file) {
+ @NotNull
+ private static PsiFile getRootByClasses(@NotNull PsiFile file, @NotNull Class[] classes) {
+ final Project project = file.getProject();
+ SoftFactoryMap<Class[], PsiFile> map = project.getUserData(PATTERN_INJECTION_CONTEXT);
+ if (map == null) {
+ map = new SoftFactoryMap<Class[], PsiFile>() {
+
+ @Override
+ protected PsiFile create(Class[] key) {
+ String text = PatternCompilerFactory.getFactory().getPatternCompiler(key).dumpContextDeclarations();
+ return PsiFileFactory.getInstance(project).createFileFromText("context.groovy", GroovyFileType.GROOVY_FILE_TYPE, text);
+ }
+ };
+ project.putUserData(PATTERN_INJECTION_CONTEXT, map);
+ }
+ return map.get(classes);
+ }
+
+ private static boolean processDevContext(final PsiFile file, Processor<PsiElement> processor) {
final XmlTag tag = getTagByInjectedFile(file);
final XmlTag parentTag = tag == null ? null : tag.getParentTag();
final String parentTagName = parentTag == null ? null : parentTag.getName();
final String name = tag == null ? null : tag.getName();
- if ("place".equals(name) && "injection".equals(parentTagName) && parentTag != null) {
- return new CachedValueProvider<List<PsiElement>>() {
- @Override
- public Result<List<PsiElement>> compute() {
- final XmlTag tag = getTagByInjectedFile(file);
- final XmlTag parentTag = tag == null ? null : tag.getParentTag();
- if (parentTag == null) return Result.create(Collections.<PsiElement>emptyList(), file);
- return new Result<List<PsiElement>>(getRootsByClassNames(file, parentTag.getAttributeValue("injector-id")), parentTag.getContainingFile());
- }
- };
+ if ("place".equals(name) && "injection".equals(parentTagName)) {
+ return processRootsByClassNames(file, parentTag.getAttributeValue("injector-id"), processor);
}
else if ("pattern".equals(name) && parentTag != null) {
- return new CachedValueProvider<List<PsiElement>>() {
- @Override
- public Result<List<PsiElement>> compute() {
- final XmlTag tag = getTagByInjectedFile(file);
- if (tag == null) return Result.create(Collections.<PsiElement>emptyList(), file);
- return new Result<List<PsiElement>>(getRootsByClassNames(file, tag.getAttributeValue("type")), tag.getContainingFile());
- }
- };
+ return processRootsByClassNames(file, tag.getAttributeValue("type"), processor);
}
- else return null;
+ return true;
}
@Nullable
@@ -135,22 +122,48 @@
return element instanceof XmlText ? ((XmlText)element).getParentTag() : null;
}
- private static List<PsiElement> getRootsByClassNames(PsiFile file, String type) {
- final List<PsiElement> roots = ContainerUtil.createLockFreeCopyOnWriteList();
+ private static boolean processRootsByClassNames(@NotNull PsiFile file, @Nullable String type, @NotNull Processor<PsiElement> processor) {
+ Project project = file.getProject();
+ Set<String> classNames = collectDevPatternClassNames(project);
+ if (!classNames.isEmpty()) {
+ JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
+ for (String className : classNames) {
+ PsiClass patternClass = psiFacade.findClass(className, GlobalSearchScope.allScope(project));
+ if (patternClass != null && !processor.process(patternClass)) return false;
+ }
+ }
+ Class[] classes = StringUtil.isEmpty(type) ? ArrayUtil.EMPTY_CLASS_ARRAY : PatternCompilerFactory.getFactory().getPatternClasses(type);
+ return classes.length == 0 || processor.process(getRootByClasses(file, classes));
+ }
- final Project project = file.getProject();
- final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
- final PsiClass beanClass = psiFacade.findClass(PatternClassBean.class.getName(), GlobalSearchScope.allScope(project));
+ private static Set<String> collectDevPatternClassNames(@NotNull final Project project) {
+ CachedValue<Set<String>> cachedValue = project.getUserData(PATTERN_CLASSES);
+ if (cachedValue == null) {
+ cachedValue = CachedValuesManager.getManager(project).createCachedValue(new CachedValueProvider<Set<String>>() {
+ @Nullable
+ @Override
+ public Result<Set<String>> compute() {
+ return Result.create(calcDevPatternClassNames(project), PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT);
+ }
+ }, false);
+ project.putUserData(PATTERN_CLASSES, cachedValue);
+ }
+ return cachedValue.getValue();
+ }
+
+ private static Set<String> calcDevPatternClassNames(@NotNull final Project project) {
+ final List<String> roots = ContainerUtil.createLockFreeCopyOnWriteList();
+ JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
+ PsiClass beanClass = psiFacade.findClass(PatternClassBean.class.getName(), GlobalSearchScope.allScope(project));
if (beanClass != null) {
- final GlobalSearchScope scope =
- GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(project), StdFileTypes.XML);
+ GlobalSearchScope scope = GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(project), StdFileTypes.XML);
final TextOccurenceProcessor occurenceProcessor = new TextOccurenceProcessor() {
@Override
public boolean execute(@NotNull PsiElement element, int offsetInElement) {
- final XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class);
- final String className = tag == null ? null : tag.getAttributeValue("className");
- if (className != null && tag.getLocalName().endsWith("patternClass")) {
- ContainerUtil.addIfNotNull(psiFacade.findClass(className, GlobalSearchScope.allScope(project)), roots);
+ XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class);
+ String className = tag == null ? null : tag.getAttributeValue("className");
+ if (StringUtil.isNotEmpty(className) && tag.getLocalName().endsWith("patternClass")) {
+ roots.add(className);
}
return true;
}
@@ -159,17 +172,13 @@
CacheManager.SERVICE.getInstance(beanClass.getProject()).processFilesWithWord(new Processor<PsiFile>() {
@Override
public boolean process(PsiFile psiFile) {
- LowLevelSearchUtil
- .processElementsContainingWordInElement(occurenceProcessor, psiFile, searcher, true, new EmptyProgressIndicator());
+ LowLevelSearchUtil.processElementsContainingWordInElement(occurenceProcessor, psiFile, searcher, true,
+ new EmptyProgressIndicator());
return true;
}
}, searcher.getPattern(), UsageSearchContext.IN_FOREIGN_LANGUAGES, scope, searcher.isCaseSensitive());
}
- final Class[] classes = PatternCompilerFactory.getFactory().getPatternClasses(type);
- if (classes.length != 0) {
- roots.add(getRootByClasses(classes, project));
- }
- return roots;
+ return ContainerUtil.newHashSet(roots);
}
}
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerConfigurable.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerConfigurable.java
index f273be1..2db660e 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerConfigurable.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerConfigurable.java
@@ -67,7 +67,7 @@
final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, false, false, false, true) {
@Override
public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
- return super.isFileVisible(file, showHiddenFiles) && !index.isIgnored(file);
+ return super.isFileVisible(file, showHiddenFiles) && !index.isExcluded(file);
}
};
descriptor.setRoots(ContainerUtil.concat(
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerExtension.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerExtension.java
deleted file mode 100644
index 8d84f9f..0000000
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerExtension.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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 org.jetbrains.plugins.groovy.compiler;
-
-import com.intellij.compiler.impl.javaCompiler.ModuleChunk;
-import com.intellij.util.PathsList;
-import com.intellij.openapi.extensions.ExtensionPointName;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.List;
-
-/**
- * @author peter
- */
-public abstract class GroovyCompilerExtension {
- public static final ExtensionPointName<GroovyCompilerExtension> EP_NAME = ExtensionPointName.create("org.intellij.groovy.compilerExtension");
-
- public abstract void enhanceCompilationClassPath(@NotNull ModuleChunk chunk, @NotNull PathsList classPath);
-
- @NotNull public abstract List<String> getCompilationUnitPatchers(@NotNull ModuleChunk chunk);
-
-}
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/generator/TopLevelDependencyValidityState.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/generator/TopLevelDependencyValidityState.java
deleted file mode 100644
index 4c67395..0000000
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/generator/TopLevelDependencyValidityState.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2000-2014 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 org.jetbrains.plugins.groovy.compiler.generator;
-
-import com.intellij.openapi.compiler.ValidityState;
-import com.intellij.openapi.diagnostic.Logger;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * User: Dmitry.Krasilschikov
- * Date: 20.08.2007
- */
-class TopLevelDependencyValidityState implements ValidityState {
- private final long myTimestamp;
- private final List<String> myMembers; //fields
-
- private static final Logger LOG = Logger.getInstance("org.jetbrains.plugins.groovy.compiler.generator.TopLevelDependencyValidityState");
-
- TopLevelDependencyValidityState(long timestamp, List<String> members) {
-// use signature of method and access modifiers
- this.myMembers = members;
- myTimestamp = timestamp;
- }
-
- @Override
- public boolean equalsTo(ValidityState validityState) {
- if (!(validityState instanceof TopLevelDependencyValidityState)) return false;
-
- return ((TopLevelDependencyValidityState) validityState).myTimestamp == this.myTimestamp
- && myMembers.equals(((TopLevelDependencyValidityState) validityState).myMembers);
- }
-
- @Override
- public void save(DataOutput out) throws IOException {
- out.writeLong(myTimestamp);
- out.writeChar('\n');
-
- for (String member : myMembers) {
- out.writeChar('\n');
- out.writeUTF(member);
- }
- }
-
- public static TopLevelDependencyValidityState load(DataInputStream is) throws IOException {
- long timestamp = -1;
-
- Reader reader = new InputStreamReader(is);
- StreamTokenizer tokenizer = new StreamTokenizer(reader);
-// tokenizer.whitespaceChars(' ', ' ');
-// tokenizer.whitespaceChars('\t', '\t');
-// tokenizer.whitespaceChars('\f', '\f');
-// tokenizer.whitespaceChars('\n', '\n');
-// tokenizer.whitespaceChars('\r', '\r');
-
- List<String> members = new ArrayList<String>();
- while (true) {
- int ttype = tokenizer.nextToken();
- switch (ttype) {
- case StreamTokenizer.TT_NUMBER: {
- try {
- timestamp = (long) tokenizer.nval;
- } catch (NumberFormatException e) {
- LOG.error(e);
- }
- break;
- }
- case StreamTokenizer.TT_WORD: {
- members.add(tokenizer.sval);
- break;
- }
- case StreamTokenizer.TT_EOL:
- break;
- case StreamTokenizer.TT_EOF:
- default:
- break;
- }
- if (ttype == StreamTokenizer.TT_EOF)
- break;
- }
- return new TopLevelDependencyValidityState(timestamp, members);
- }
-}
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerClassFilterProvider.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerClassFilterProvider.java
similarity index 95%
rename from plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerClassFilterProvider.java
rename to plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerClassFilterProvider.java
index 34830b9..7b734a4 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerClassFilterProvider.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerClassFilterProvider.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jetbrains.plugins.groovy.debugger.filters;
+package org.jetbrains.plugins.groovy.debugger;
import com.intellij.ui.classFilter.ClassFilter;
import com.intellij.ui.classFilter.DebuggerClassFilterProvider;
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerSettings.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettings.java
similarity index 86%
rename from plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerSettings.java
rename to plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettings.java
index dbadd51..273fd4c 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerSettings.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettings.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jetbrains.plugins.groovy.debugger.filters;
+package org.jetbrains.plugins.groovy.debugger;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
@@ -23,6 +23,7 @@
import com.intellij.util.xmlb.XmlSerializerUtil;
import com.intellij.xdebugger.settings.XDebuggerSettings;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* @author ilyas
@@ -35,7 +36,6 @@
)}
)
public class GroovyDebuggerSettings extends XDebuggerSettings<GroovyDebuggerSettings> {
-
public Boolean DEBUG_DISABLE_SPECIFIC_GROOVY_METHODS = true;
public boolean ENABLE_GROOVY_HOTSWAP = Registry.is("enable.groovy.hotswap");
@@ -49,6 +49,15 @@
return new GroovyDebuggerSettingsConfigurable(this);
}
+ @Nullable
+ @Override
+ public Configurable createConfigurable(@NotNull Category category) {
+ if (category == Category.STEPPING) {
+ return new GroovySteppingConfigurable();
+ }
+ return null;
+ }
+
@Override
public GroovyDebuggerSettings getState() {
return this;
@@ -62,5 +71,4 @@
public static GroovyDebuggerSettings getInstance() {
return getInstance(GroovyDebuggerSettings.class);
}
-
-}
+}
\ No newline at end of file
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerSettingsConfigurable.form b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettingsConfigurable.form
similarity index 76%
rename from plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerSettingsConfigurable.form
rename to plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettingsConfigurable.form
index a91ac8c..171170b 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerSettingsConfigurable.form
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettingsConfigurable.form
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.plugins.groovy.debugger.filters.GroovyDebuggerSettingsConfigurable">
- <grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.plugins.groovy.debugger.GroovyDebuggerSettingsConfigurable">
+ <grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="661" height="400"/>
@@ -8,22 +8,14 @@
<properties/>
<border type="none"/>
<children>
- <component id="84a2f" class="javax.swing.JCheckBox" binding="myIgnoreGroovyMethods">
- <constraints>
- <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
- </constraints>
- <properties>
- <text resource-bundle="org/jetbrains/plugins/groovy/GroovyBundle" key="groovy.debug.disable.specific.methods"/>
- </properties>
- </component>
<vspacer id="30909">
<constraints>
- <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+ <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="908a2" class="com.intellij.ui.components.JBLabel">
<constraints>
- <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="3" use-parent-layout="false"/>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="3" use-parent-layout="false"/>
</constraints>
<properties>
<componentStyle value="SMALL"/>
@@ -33,7 +25,7 @@
<grid id="bd4f0" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="2" left="0" bottom="0" right="0"/>
<constraints>
- <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerSettingsConfigurable.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettingsConfigurable.java
similarity index 71%
rename from plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerSettingsConfigurable.java
rename to plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettingsConfigurable.java
index 4638aca..8f143d9 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerSettingsConfigurable.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettingsConfigurable.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jetbrains.plugins.groovy.debugger.filters;
+package org.jetbrains.plugins.groovy.debugger;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SearchableConfigurable;
@@ -29,7 +29,6 @@
* @author ilyas
*/
public class GroovyDebuggerSettingsConfigurable implements SearchableConfigurable {
- private JCheckBox myIgnoreGroovyMethods;
private JPanel myPanel;
private JCheckBox myEnableHotSwap;
private boolean isModified = false;
@@ -37,19 +36,13 @@
public GroovyDebuggerSettingsConfigurable(final GroovyDebuggerSettings settings) {
mySettings = settings;
- final Boolean flag = settings.DEBUG_DISABLE_SPECIFIC_GROOVY_METHODS;
- myIgnoreGroovyMethods.setSelected(flag == null || flag.booleanValue());
- myIgnoreGroovyMethods.setSelected(mySettings.ENABLE_GROOVY_HOTSWAP);
- ActionListener listener = new ActionListener() {
+ myEnableHotSwap.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
- isModified = mySettings.DEBUG_DISABLE_SPECIFIC_GROOVY_METHODS.booleanValue() != myIgnoreGroovyMethods.isSelected() ||
- mySettings.ENABLE_GROOVY_HOTSWAP != myEnableHotSwap.isSelected();
+ isModified = mySettings.ENABLE_GROOVY_HOTSWAP != myEnableHotSwap.isSelected();
}
- };
- myIgnoreGroovyMethods.addActionListener(listener);
- myEnableHotSwap.addActionListener(listener);
+ });
}
@Override
@@ -59,6 +52,7 @@
}
@Override
+ @NotNull
public String getHelpTopic() {
return "reference.idesettings.debugger.groovy";
}
@@ -87,7 +81,6 @@
@Override
public void apply() throws ConfigurationException {
if (isModified) {
- mySettings.DEBUG_DISABLE_SPECIFIC_GROOVY_METHODS = myIgnoreGroovyMethods.isSelected();
mySettings.ENABLE_GROOVY_HOTSWAP = myEnableHotSwap.isSelected();
}
isModified = false;
@@ -95,8 +88,6 @@
@Override
public void reset() {
- final Boolean flag = mySettings.DEBUG_DISABLE_SPECIFIC_GROOVY_METHODS;
- myIgnoreGroovyMethods.setSelected(flag == null || flag.booleanValue());
myEnableHotSwap.setSelected(mySettings.ENABLE_GROOVY_HOTSWAP);
}
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyHotSwapper.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyHotSwapper.java
index bd0398b..95b9336 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyHotSwapper.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyHotSwapper.java
@@ -41,7 +41,6 @@
import com.intellij.util.PathUtil;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.groovy.GroovyFileType;
-import org.jetbrains.plugins.groovy.debugger.filters.GroovyDebuggerSettings;
import java.io.File;
import java.io.IOException;
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovySteppingConfigurable.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovySteppingConfigurable.java
new file mode 100644
index 0000000..0e5d995
--- /dev/null
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovySteppingConfigurable.java
@@ -0,0 +1,37 @@
+package org.jetbrains.plugins.groovy.debugger;
+
+import com.intellij.openapi.options.ConfigurableBase;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.plugins.groovy.GroovyBundle;
+
+class GroovySteppingConfigurable extends ConfigurableBase<GroovySteppingConfigurableUi, GroovyDebuggerSettings> {
+ @Override
+ protected GroovyDebuggerSettings getSettings() {
+ return GroovyDebuggerSettings.getInstance();
+ }
+
+ @Override
+ protected GroovySteppingConfigurableUi createUi() {
+ return new GroovySteppingConfigurableUi();
+ }
+
+ @NotNull
+ @Override
+ public String getId() {
+ return "debugger.stepping.groovy";
+ }
+
+ @Nls
+ @Override
+ public String getDisplayName() {
+ return GroovyBundle.message("groovy.debug.caption");
+ }
+
+ @Nullable
+ @Override
+ public String getHelpTopic() {
+ return "reference.idesettings.debugger.groovy";
+ }
+}
\ No newline at end of file
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovySteppingConfigurableUi.form b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovySteppingConfigurableUi.form
new file mode 100644
index 0000000..ac93a67
--- /dev/null
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovySteppingConfigurableUi.form
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.plugins.groovy.debugger.GroovySteppingConfigurableUi">
+ <grid id="27dc6" binding="rootPanel" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <xy x="20" y="20" width="500" height="400"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="821e8" class="javax.swing.JCheckBox" binding="ignoreGroovyMethods">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text resource-bundle="org/jetbrains/plugins/groovy/GroovyBundle" key="groovy.debug.disable.specific.methods"/>
+ </properties>
+ </component>
+ <vspacer id="209fe">
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+ </constraints>
+ </vspacer>
+ </children>
+ </grid>
+</form>
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovySteppingConfigurableUi.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovySteppingConfigurableUi.java
new file mode 100644
index 0000000..d0e9e9e
--- /dev/null
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovySteppingConfigurableUi.java
@@ -0,0 +1,33 @@
+package org.jetbrains.plugins.groovy.debugger;
+
+import com.intellij.openapi.options.ConfigurableUi;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+class GroovySteppingConfigurableUi implements ConfigurableUi<GroovyDebuggerSettings> {
+ private JCheckBox ignoreGroovyMethods;
+ private JPanel rootPanel;
+
+ @Override
+ public void reset(@NotNull GroovyDebuggerSettings settings) {
+ Boolean flag = settings.DEBUG_DISABLE_SPECIFIC_GROOVY_METHODS;
+ ignoreGroovyMethods.setSelected(flag == null || flag.booleanValue());
+ }
+
+ @Override
+ public boolean isModified(@NotNull GroovyDebuggerSettings settings) {
+ return settings.DEBUG_DISABLE_SPECIFIC_GROOVY_METHODS.booleanValue() != ignoreGroovyMethods.isSelected();
+ }
+
+ @Override
+ public void apply(@NotNull GroovyDebuggerSettings settings) {
+ settings.DEBUG_DISABLE_SPECIFIC_GROOVY_METHODS = ignoreGroovyMethods.isSelected();
+ }
+
+ @NotNull
+ @Override
+ public JComponent getComponent() {
+ return rootPanel;
+ }
+}
\ No newline at end of file
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GrMethodMergingContributor.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GrMethodMergingContributor.java
index e84361b..2c05dd7 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GrMethodMergingContributor.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GrMethodMergingContributor.java
@@ -21,7 +21,6 @@
import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiParameter;
import com.intellij.psi.PsiType;
-import com.intellij.psi.ResolveResult;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.TypesUtil;
import org.jetbrains.plugins.groovy.lang.psi.util.GroovyCommonClassNames;
@@ -46,13 +45,9 @@
final LookupElement[] items = context.getItems();
if (items.length > 1) {
String commonName = null;
- LookupElement best = null;
final ArrayList<PsiMethod> allMethods = new ArrayList<PsiMethod>();
for (LookupElement item : items) {
- Object o = item.getObject();
- if (o instanceof ResolveResult) {
- o = ((ResolveResult)o).getElement();
- }
+ Object o = item.getPsiElement();
if (item.getUserData(LookupItem.FORCE_SHOW_SIGNATURE_ATTR) != null || !(o instanceof PsiMethod)) {
return AutoCompletionDecision.SHOW_LOOKUP;
}
@@ -76,17 +71,11 @@
return AutoCompletionDecision.SHOW_LOOKUP;
}
- if (best == null && method.getParameterList().getParametersCount() > 0) {
- best = item;
- }
commonName = name;
allMethods.add(method);
item.putUserData(JavaCompletionUtil.ALL_METHODS_ATTRIBUTE, allMethods);
}
- if (best == null) {
- best = items[0];
- }
- return AutoCompletionDecision.insertItem(best);
+ return AutoCompletionDecision.insertItem(JavaMethodMergingContributor.findBestOverload(items));
}
return super.handleAutoCompletionPossibility(context);
diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/providers/GroovyReferenceContributor.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/providers/GroovyReferenceContributor.java
similarity index 99%
rename from plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/providers/GroovyReferenceContributor.java
rename to plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/providers/GroovyReferenceContributor.java
index e25c490..626983a 100644
--- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/providers/GroovyReferenceContributor.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/providers/GroovyReferenceContributor.java
@@ -34,5 +34,6 @@
registrar.registerReferenceProvider(GroovyPatterns.stringLiteral().withParent(GrAnnotationNameValuePair.class),
new SpockUnrollReferenceProvider());
+
}
}
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureUtil.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureUtil.java
index e21a367..2bfa261 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureUtil.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureUtil.java
@@ -143,9 +143,15 @@
}
public static void removeSrcFolderFromRoots(final VirtualFile file,
- List<Consumer<ContentEntry>> actions,
- Map<VirtualFile, JpsModuleSourceRootType<?>> sourceRoots) {
- if (sourceRoots.containsKey(file)) {
+ @NotNull List<Consumer<ContentEntry>> actions,
+ @NotNull Map<VirtualFile, JpsModuleSourceRootType<?>> sourceRoots) {
+ removeSrcFolderFromRoots(file, actions, sourceRoots.keySet());
+ }
+
+ public static void removeSrcFolderFromRoots(final VirtualFile file,
+ @NotNull List<Consumer<ContentEntry>> actions,
+ @NotNull Collection<VirtualFile> sourceRoots) {
+ if (sourceRoots.contains(file)) {
actions.add(new Consumer<ContentEntry>() {
@Override
public void consume(ContentEntry contentEntry) {
@@ -163,7 +169,7 @@
@Nullable
public static Consumer<ModifiableRootModel> addJarDirectory(VirtualFile root, Module module, final String libName) {
final VirtualFile libDir = root.findFileByRelativePath("lib");
- if (libDir == null || !libDir.isDirectory() || ProjectRootManager.getInstance(module.getProject()).getFileIndex().isIgnored(libDir)) {
+ if (libDir == null || !libDir.isDirectory() || ProjectRootManager.getInstance(module.getProject()).getFileIndex().isExcluded(libDir)) {
return null;
}
@@ -350,16 +356,17 @@
private static void removeInvalidSourceRoots(List<Consumer<ModifiableRootModel>> actions, MvcProjectStructure structure) {
final Set<SourceFolder> toRemove = ContainerUtil.newTroveSet();
- final Set<ContentEntry> toRemoveContent = ContainerUtil.newTroveSet();
+ final Set<String> toRemoveContent = ContainerUtil.newTroveSet();
for (ContentEntry entry : ModuleRootManager.getInstance(structure.myModule).getContentEntries()) {
final VirtualFile file = entry.getFile();
if (file == null || !structure.isValidContentRoot(file)) {
- toRemoveContent.add(entry);
+ toRemoveContent.add(entry.getUrl());
}
-
- for (SourceFolder folder : entry.getSourceFolders()) {
- if (folder.getFile() == null) {
- toRemove.add(folder);
+ else {
+ for (SourceFolder folder : entry.getSourceFolders()) {
+ if (folder.getFile() == null) {
+ toRemove.add(folder);
+ }
}
}
}
@@ -368,14 +375,15 @@
actions.add(new Consumer<ModifiableRootModel>() {
@Override
public void consume(ModifiableRootModel model) {
- for (final ContentEntry entry : toRemoveContent) {
- model.removeContentEntry(entry);
- }
-
for (ContentEntry entry : model.getContentEntries()) {
- for (SourceFolder folder : entry.getSourceFolders()) {
- if (toRemove.remove(folder)) {
- entry.removeSourceFolder(folder);
+ if (toRemoveContent.remove(entry.getUrl())) {
+ model.removeContentEntry(entry);
+ }
+ else {
+ for (SourceFolder folder : entry.getSourceFolders()) {
+ if (toRemove.remove(folder)) {
+ entry.removeSourceFolder(folder);
+ }
}
}
}
diff --git a/plugins/groovy/structuralsearch-groovy/src/com/intellij/structuralsearch/GroovyEquivalenceDescriptorProvider.java b/plugins/groovy/structuralsearch-groovy/src/com/intellij/structuralsearch/GroovyEquivalenceDescriptorProvider.java
new file mode 100644
index 0000000..3637b97
--- /dev/null
+++ b/plugins/groovy/structuralsearch-groovy/src/com/intellij/structuralsearch/GroovyEquivalenceDescriptorProvider.java
@@ -0,0 +1,99 @@
+package com.intellij.structuralsearch;
+
+import com.intellij.dupLocator.equivalence.EquivalenceDescriptor;
+import com.intellij.dupLocator.equivalence.EquivalenceDescriptorBuilder;
+import com.intellij.dupLocator.equivalence.EquivalenceDescriptorProvider;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.tree.TokenSet;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.plugins.groovy.GroovyLanguage;
+import org.jetbrains.plugins.groovy.lang.lexer.TokenSets;
+import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable;
+import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariableDeclaration;
+import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrCodeBlock;
+import org.jetbrains.plugins.groovy.lang.psi.api.statements.clauses.GrForInClause;
+import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
+import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrReferenceList;
+import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition;
+import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinitionBody;
+import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod;
+import org.jetbrains.plugins.groovy.lang.psi.api.util.GrStatementOwner;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class GroovyEquivalenceDescriptorProvider extends EquivalenceDescriptorProvider {
+ private static final TokenSet IGNORED_TOKENS = TokenSet.orSet(TokenSets.WHITE_SPACES_OR_COMMENTS, TokenSets.SEPARATORS);
+
+ @Override
+ public boolean isMyContext(@NotNull PsiElement context) {
+ return context.getLanguage().isKindOf(GroovyLanguage.INSTANCE);
+ }
+
+ @Override
+ public EquivalenceDescriptor buildDescriptor(@NotNull PsiElement e) {
+ final EquivalenceDescriptorBuilder builder = new EquivalenceDescriptorBuilder();
+
+ if (e instanceof GrVariableDeclaration) {
+ return builder.elements(((GrVariableDeclaration)e).getVariables());
+ }
+ else if (e instanceof GrParameter) {
+ final GrParameter p = (GrParameter)e;
+ return builder
+ .element(p.getNameIdentifierGroovy())
+ .optionally(p.getTypeElementGroovy())
+ .optionallyInPattern(p.getInitializerGroovy());
+ }
+ else if (e instanceof GrVariable) {
+ final GrVariable v = (GrVariable)e;
+ return builder
+ .element(v.getNameIdentifierGroovy())
+ .optionally(v.getTypeElementGroovy())
+ .optionallyInPattern(v.getInitializerGroovy());
+ }
+ else if (e instanceof GrMethod) {
+ final GrMethod m = (GrMethod)e;
+ return builder
+ .element(m.getNameIdentifierGroovy())
+ .elements(m.getParameters())
+ .optionally(m.getReturnTypeElementGroovy())
+ .optionallyInPattern(m.getBlock());
+ }
+ else if (e instanceof GrTypeDefinitionBody) {
+ final GrTypeDefinitionBody b = (GrTypeDefinitionBody)e;
+ return builder
+ .inAnyOrder(b.getFields())
+ .inAnyOrder(b.getMethods())
+ .inAnyOrder(b.getInitializers())
+ .inAnyOrder(b.getInnerClasses());
+ }
+ else if (e instanceof GrTypeDefinition) {
+ GrTypeDefinition d = (GrTypeDefinition)e;
+ return builder.element(d.getNameIdentifierGroovy())
+ .optionallyInPattern(d.getExtendsClause())
+ .optionallyInPattern(d.getImplementsClause())
+ .optionallyInPattern(d.getBody());
+ }
+ else if (e instanceof GrForInClause) {
+ final GrForInClause f = (GrForInClause)e;
+ return builder
+ .element(f.getDeclaredVariable())
+ .element(f.getIteratedExpression());
+ }
+ else if (e instanceof GrReferenceList) {
+ return builder.inAnyOrder(((GrReferenceList)e).getReferenceElementsGroovy());
+ }
+ else if (e instanceof GrCodeBlock) {
+ return builder.codeBlock(((GrStatementOwner)e).getStatements());
+ }
+
+ // todo: support 'object method()' <-> 'object.method()'
+
+ return null;
+ }
+
+ @Override
+ public TokenSet getIgnoredTokens() {
+ return IGNORED_TOKENS;
+ }
+}
diff --git a/plugins/groovy/structuralsearch-groovy/structuralsearch-groovy.iml b/plugins/groovy/structuralsearch-groovy/structuralsearch-groovy.iml
index dbde388..44183f6 100644
--- a/plugins/groovy/structuralsearch-groovy/structuralsearch-groovy.iml
+++ b/plugins/groovy/structuralsearch-groovy/structuralsearch-groovy.iml
@@ -15,7 +15,7 @@
<orderEntry type="module" module-name="lang-impl" />
<orderEntry type="module" module-name="structuralsearch-tests" scope="TEST" />
<orderEntry type="module" module-name="testFramework-java" scope="TEST" />
- <orderEntry type="module" module-name="duplicates-analysis" scope="TEST" />
+ <orderEntry type="module" module-name="duplicates-analysis" />
</component>
</module>
diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/FastGroovyTestSuite.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/FastGroovyTestSuite.java
index 42404ba..ec2d50c 100644
--- a/plugins/groovy/test/org/jetbrains/plugins/groovy/FastGroovyTestSuite.java
+++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/FastGroovyTestSuite.java
@@ -17,6 +17,7 @@
import com.intellij.TestAll;
import com.intellij.TestCaseLoader;
+import com.intellij.openapi.externalSystem.test.ExternalSystemTestCase;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.jetbrains.plugins.groovy.compiler.GroovyCompilerTest;
@@ -45,7 +46,7 @@
private static boolean isSlow(Class aClass) {
return aClass.equals(GroovyDebuggerTest.class) ||
aClass.equals(GroovyStressPerformanceTest.class) ||
- aClass.getName().startsWith(GroovyCompilerTest.class.getName());
+ aClass.getName().startsWith(GroovyCompilerTest.class.getName()) ||
+ ExternalSystemTestCase.class.isAssignableFrom(aClass);
}
-
}
diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/GrCommentTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/GrCommentTest.groovy
index af16cc4..b6584be 100644
--- a/plugins/groovy/test/org/jetbrains/plugins/groovy/GrCommentTest.groovy
+++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/GrCommentTest.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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,11 +15,11 @@
*/
package org.jetbrains.plugins.groovy
-import com.intellij.codeInsight.actions.CodeInsightAction
import com.intellij.codeInsight.generation.actions.CommentByBlockCommentAction
import com.intellij.codeInsight.generation.actions.CommentByLineCommentAction
import com.intellij.ide.DataManager
import com.intellij.openapi.actionSystem.ActionManager
+import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DataContext
import org.jetbrains.annotations.NotNull
@@ -100,7 +100,7 @@
doTest(before, after, new CommentByBlockCommentAction())
}
- private void doTest(@NotNull String before, @NotNull String after, final CodeInsightAction action) {
+ private void doTest(@NotNull String before, @NotNull String after, final AnAction action) {
myFixture.configureByText(GroovyFileType.GROOVY_FILE_TYPE, before)
final DataContext dataContext = DataManager.instance.dataContextFromFocus.result
action.actionPerformed(new AnActionEvent(null, dataContext, "", action.templatePresentation, ActionManager.instance, 0));
diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy
index d6293f2..061f941 100644
--- a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy
+++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy
@@ -1923,4 +1923,10 @@
''', '', CompletionType.BASIC, CompletionResult.contain, 1, 'A__foo', 'bar')
}
+ void testCharsetName() {
+ myFixture.addClass("package java.nio.charset; public class Charset { public static boolean isSupported(String s) {} }")
+ doVariantableTest('import java.nio.charset.*; Charset.isSupported("<caret>")', '', CompletionType.BASIC, CompletionResult.contain, 1, 'UTF-8')
+ }
+
+
}
\ No newline at end of file
diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/findUsages/FindUsagesTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/findUsages/FindUsagesTest.groovy
index abc454f..6ee91ef 100644
--- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/findUsages/FindUsagesTest.groovy
+++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/findUsages/FindUsagesTest.groovy
@@ -429,7 +429,7 @@
}
void testTraitField() {
- doTest(6, '''
+ doTest(4, '''
trait T {
public int fi<caret>eld = 4
@@ -439,16 +439,16 @@
}
}
-class C extends T {
- def abc {
- print field
+class C implements T {
+ def abc() {
+ print field //unresolved
print T__field
}
}
new C().T__field
-new C().field
+new C().field //unresolved
''')
}
diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/TypeInference2_3Test.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/TypeInference2_3Test.groovy
index 7382469..e6882d7 100644
--- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/TypeInference2_3Test.groovy
+++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/TypeInference2_3Test.groovy
@@ -15,6 +15,7 @@
*/
package org.jetbrains.plugins.groovy.lang.resolve
+import com.intellij.psi.PsiMethod
import com.intellij.testFramework.LightProjectDescriptor
import org.jetbrains.plugins.groovy.GroovyLightProjectDescriptor
@@ -205,4 +206,15 @@
}
+ void testClosureParamsUsingGenerics() {
+ doTest("""\
+ import groovy.transform.CompileStatic
+
+ @CompileStatic
+ class Idea {
+ public static void main(String[] args) {
+ ["bc", "a", ].sort { i<caret>t.size() }
+ }
+ }""", "java.lang.String")
+ }
}
diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandAuthenticator.java b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandAuthenticator.java
index 14f6c981..1d41cdc 100644
--- a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandAuthenticator.java
+++ b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandAuthenticator.java
@@ -35,7 +35,7 @@
class HgCommandAuthenticator {
private static final Logger LOG = Logger.getInstance(HgCommandAuthenticator.class.getName());
-
+
private GetPasswordRunnable myGetPassword;
private final Project myProject;
private boolean myForceAuthorization;
@@ -71,7 +71,7 @@
}
public boolean promptForAuthentication(Project project, String proposedLogin, String uri, String path, @Nullable ModalityState state) {
- GetPasswordRunnable runnable = new GetPasswordRunnable(project, proposedLogin, uri, path, myForceAuthorization);
+ GetPasswordRunnable runnable = new GetPasswordRunnable(project, proposedLogin, uri, path, myForceAuthorization, state);
ApplicationManager.getApplication().invokeAndWait(runnable, state == null ? ModalityState.defaultModalityState() : state);
myGetPassword = runnable;
return runnable.isOk();
@@ -96,14 +96,21 @@
@Nullable private String myURL;
private boolean myRememberPassword;
private boolean myForceAuthorization;
+ @Nullable private ModalityState myState;
- public GetPasswordRunnable(Project project, String proposedLogin, String uri, String path, boolean forceAuthorization) {
+ public GetPasswordRunnable(Project project,
+ String proposedLogin,
+ String uri,
+ String path,
+ boolean forceAuthorization,
+ @Nullable ModalityState state) {
this.myProject = project;
this.myProposedLogin = proposedLogin;
this.myURL = uri + path;
this.myForceAuthorization = forceAuthorization;
+ myState = state;
}
-
+
public void run() {
// find if we've already been here
@@ -128,11 +135,9 @@
final String key = keyForUrlAndLogin(myURL, login);
try {
final PasswordSafeImpl passwordSafe = (PasswordSafeImpl)PasswordSafe.getInstance();
- password = passwordSafe.getMemoryProvider().getPassword(myProject, HgCommandAuthenticator.class, key);
- if (password == null) {
- password = passwordSafe.getPassword(myProject, HgCommandAuthenticator.class, key);
- }
- } catch (PasswordSafeException e) {
+ password = passwordSafe.getPassword(myProject, HgCommandAuthenticator.class, key, myState);
+ }
+ catch (PasswordSafeException e) {
LOG.info("Couldn't get password for key [" + key + "]", e);
}
}
diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/log/HgRefManager.java b/plugins/hg4idea/src/org/zmlx/hg4idea/log/HgRefManager.java
index 9fa266e5..8a59491 100644
--- a/plugins/hg4idea/src/org/zmlx/hg4idea/log/HgRefManager.java
+++ b/plugins/hg4idea/src/org/zmlx/hg4idea/log/HgRefManager.java
@@ -90,17 +90,10 @@
}
};
-/*
- public HgRefManager(@NotNull RepositoryManager<HgRepository> repositoryManager) {
- myRepositoryManager = repositoryManager;
- }*/
-
@NotNull
@Override
- public List<VcsRef> sort(Collection<VcsRef> refs) {
- ArrayList<VcsRef> list = new ArrayList<VcsRef>(refs);
- Collections.sort(list, REF_COMPARATOR);
- return list;
+ public Comparator<VcsRef> getComparator() {
+ return REF_COMPARATOR;
}
@NotNull
@@ -114,6 +107,11 @@
});
}
+ @NotNull
+ private Collection<VcsRef> sort(@NotNull Collection<VcsRef> refs) {
+ return ContainerUtil.sorted(refs, getComparator());
+ }
+
private static class SimpleRefType implements VcsRefType {
private final boolean myIsBranch;
@NotNull private final Color myColor;
diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgUpdateEnvironment.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgUpdateEnvironment.java
index 4052b34..038c1c2 100644
--- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgUpdateEnvironment.java
+++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgUpdateEnvironment.java
@@ -99,7 +99,7 @@
}
public String getHelpTopic() {
- return null;
+ return "reference.VersionControl.Mercurial.UpdateProject";
}
public JComponent createComponent() {
diff --git a/plugins/java-decompiler/lib/fernflower.jar b/plugins/java-decompiler/lib/fernflower.jar
index 85b1c40..d8589af 100644
--- a/plugins/java-decompiler/lib/fernflower.jar
+++ b/plugins/java-decompiler/lib/fernflower.jar
Binary files differ
diff --git a/plugins/java-decompiler/src/org/jetbrains/java/decompiler/IdeaDecompiler.java b/plugins/java-decompiler/src/org/jetbrains/java/decompiler/IdeaDecompiler.java
index bf0454f..f57ea6a 100644
--- a/plugins/java-decompiler/src/org/jetbrains/java/decompiler/IdeaDecompiler.java
+++ b/plugins/java-decompiler/src/org/jetbrains/java/decompiler/IdeaDecompiler.java
@@ -138,7 +138,9 @@
}
}, ClassReader.SKIP_CODE);
}
- catch (IOException ignore) { }
+ catch (Exception e) {
+ throw new RuntimeException("corrupted file: " + file.getUrl(), e);
+ }
if (isGroovy.get()) {
LOG.info("skipped Groovy class: " + file.getUrl());
return false;
diff --git a/plugins/java-decompiler/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.java b/plugins/java-decompiler/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.java
index 9367fc0..060b269 100644
--- a/plugins/java-decompiler/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.java
+++ b/plugins/java-decompiler/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.java
@@ -40,10 +40,7 @@
VirtualFile file = StandardFileSystems.jar().findFileByPath(path);
assertNotNull(path, file);
- CharSequence text = new IdeaDecompiler().getText(file);
- assertNotNull(text);
-
- String decompiled = text.toString();
+ String decompiled = new IdeaDecompiler().getText(file).toString();
assertTrue(decompiled, decompiled.contains("public final class String"));
assertTrue(decompiled, decompiled.contains("@deprecated"));
assertTrue(decompiled, decompiled.contains("private static class CaseInsensitiveComparator"));
@@ -57,6 +54,7 @@
public void testParameters() { doTestDecompiler(); }
public void testConstants() { doTestDecompiler(); }
public void testAnonymous() { doTestDecompiler(); }
+ public void testCodeConstructs() { doTestDecompiler(); }
private void doTestDecompiler() {
String name = PluginPathManager.getPluginHomePath("java-decompiler") + "/testData/" + getName().substring(4);
@@ -103,7 +101,6 @@
VfsUtilCore.visitChildrenRecursively(root, new VirtualFileVisitor() {
@Override
public boolean visitFile(@NotNull VirtualFile file) {
- if (file.getName().equals("Jps.class")) return true; // temp. fix
if (!file.isDirectory() && file.getFileType() == StdFileTypes.CLASS && !file.getName().contains("$")) {
PsiFile clsFile = getPsiManager().findFile(file);
assertNotNull(file.getPath(), clsFile);
diff --git a/plugins/java-decompiler/testData/CodeConstructs.class b/plugins/java-decompiler/testData/CodeConstructs.class
new file mode 100644
index 0000000..bcac668
--- /dev/null
+++ b/plugins/java-decompiler/testData/CodeConstructs.class
Binary files differ
diff --git a/plugins/java-decompiler/testData/CodeConstructs.java b/plugins/java-decompiler/testData/CodeConstructs.java
new file mode 100644
index 0000000..d0c2e35
--- /dev/null
+++ b/plugins/java-decompiler/testData/CodeConstructs.java
@@ -0,0 +1,5 @@
+class CodeConstructs {
+ void expressions() {
+ new String().hashCode();
+ }
+}
\ No newline at end of file
diff --git a/plugins/java-decompiler/testData/CodeConstructs.txt b/plugins/java-decompiler/testData/CodeConstructs.txt
new file mode 100644
index 0000000..59bc718
--- /dev/null
+++ b/plugins/java-decompiler/testData/CodeConstructs.txt
@@ -0,0 +1,15 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+
+class CodeConstructs {
+
+ CodeConstructs() {
+ }
+
+ void expressions() {
+ (new String()).hashCode();
+ }
+}
diff --git a/plugins/java-i18n/src/com/intellij/codeInspection/duplicateStringLiteral/DuplicateStringLiteralInspection.java b/plugins/java-i18n/src/com/intellij/codeInspection/duplicateStringLiteral/DuplicateStringLiteralInspection.java
index ce785c3..4efa063 100644
--- a/plugins/java-i18n/src/com/intellij/codeInspection/duplicateStringLiteral/DuplicateStringLiteralInspection.java
+++ b/plugins/java-i18n/src/com/intellij/codeInspection/duplicateStringLiteral/DuplicateStringLiteralInspection.java
@@ -20,6 +20,7 @@
import com.intellij.codeInspection.*;
import com.intellij.codeInspection.ex.BaseLocalInspectionTool;
import com.intellij.codeInspection.i18n.JavaI18nUtil;
+import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.progress.ProgressIndicator;
@@ -133,13 +134,19 @@
}
if (resultFiles.isEmpty()) return;
}
+
if (resultFiles == null || resultFiles.isEmpty()) return;
final List<PsiExpression> foundExpr = new ArrayList<PsiExpression>();
+
for (PsiFile file : resultFiles) {
progress.checkCanceled();
- CharSequence text = file.getViewProvider().getContents();
+ FileViewProvider viewProvider = file.getViewProvider();
+ // important: skip non-java files with given word in literal (IDEA-126201)
+ if (viewProvider.getPsi(JavaLanguage.INSTANCE) == null) continue;
+ CharSequence text = viewProvider.getContents();
final char[] textArray = CharArrayUtil.fromSequenceWithoutCopying(text);
StringSearcher searcher = new StringSearcher(stringToFind, true, true);
+
for (int offset = LowLevelSearchUtil.searchWord(text, textArray, 0, text.length(), searcher, progress);
offset >= 0;
offset = LowLevelSearchUtil.searchWord(text, textArray, offset + searcher.getPattern().length(), text.length(), searcher, progress)
diff --git a/plugins/javaFX/src/META-INF/common-javaFX-plugin.xml b/plugins/javaFX/src/META-INF/common-javaFX-plugin.xml
index c03a5f4..1256121f 100644
--- a/plugins/javaFX/src/META-INF/common-javaFX-plugin.xml
+++ b/plugins/javaFX/src/META-INF/common-javaFX-plugin.xml
@@ -25,7 +25,7 @@
enabledByDefault="true" level="WARNING" displayName="JavaFX unused imports" groupName="JavaFX"/>
<applicationService serviceInterface="org.jetbrains.plugins.javaFX.JavaFxSettings" serviceImplementation="org.jetbrains.plugins.javaFX.JavaFxSettings"/>
- <applicationConfigurable instance="org.jetbrains.plugins.javaFX.JavaFxSettingsConfigurable"/>
+ <applicationConfigurable groupId="language" displayName="JavaFX" instance="org.jetbrains.plugins.javaFX.JavaFxSettingsConfigurable"/>
<fileBasedIndex implementation="org.jetbrains.plugins.javaFX.JavaFxControllerClassIndex"/>
<fileBasedIndex implementation="org.jetbrains.plugins.javaFX.JavaFxIdsIndex"/>
<fileBasedIndex implementation="org.jetbrains.plugins.javaFX.JavaFxCustomComponentsIndex"/>
diff --git a/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.java b/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.java
index d1ff8d5..07e578b 100644
--- a/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.java
+++ b/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.java
@@ -394,7 +394,7 @@
@Override
public Visibility isDeclarationVisible(PsiElement declaration, PsiElement place) {
try {
- if (declaration instanceof PsiClass && classBrowser.getFilter().isAccepted(((PsiClass)declaration))) {
+ if (declaration instanceof PsiClass && (classBrowser.getFilter().isAccepted(((PsiClass)declaration)) || classBrowser.findClass(((PsiClass)declaration).getQualifiedName()) != null && place.getParent() != null)) {
return Visibility.VISIBLE;
}
}
diff --git a/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurationModel.java b/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurationModel.java
index 38a3ff9..fe5a131 100644
--- a/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurationModel.java
+++ b/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurationModel.java
@@ -172,7 +172,7 @@
final JUnitConfiguration.Data data = configuration.getPersistentData();
setTestType(data.TEST_OBJECT);
setJUnitTextValue(ALL_IN_PACKAGE, data.getPackageName());
- setJUnitTextValue(CLASS, data.getMainClassName());
+ setJUnitTextValue(CLASS, data.getMainClassName().replaceAll("\\$", "\\."));
setJUnitTextValue(METHOD, data.getMethodName());
setJUnitTextValue(PATTERN, data.getPatternPresentation());
setJUnitTextValue(DIR, data.getDirName());
diff --git a/plugins/maven/src/main/resources/META-INF/plugin.xml b/plugins/maven/src/main/resources/META-INF/plugin.xml
index 960cb1c..0261f13 100644
--- a/plugins/maven/src/main/resources/META-INF/plugin.xml
+++ b/plugins/maven/src/main/resources/META-INF/plugin.xml
@@ -46,7 +46,7 @@
<applicationService serviceImplementation="org.jetbrains.idea.maven.indices.MavenIndicesManager"/>
<applicationService serviceImplementation="org.jetbrains.idea.maven.services.MavenRepositoryServicesManager"/>
- <projectConfigurable instance="org.jetbrains.idea.maven.utils.MavenSettings" id="MavenSettings" displayName="Maven" order="last">
+ <projectConfigurable groupId="build" instance="org.jetbrains.idea.maven.utils.MavenSettings" id="MavenSettings" displayName="Maven" order="last">
<configurable instance="org.jetbrains.idea.maven.project.MavenImportingConfigurable" id="reference.settings.project.maven.importing"
key="maven.tab.importing" bundle="ProjectBundle"/>
<configurable instance="org.jetbrains.idea.maven.project.MavenIgnoredFilesConfigurable"
diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/unused/UnusedPropertyInspection.java b/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/unused/UnusedPropertyInspection.java
index 53e241e..6038338 100644
--- a/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/unused/UnusedPropertyInspection.java
+++ b/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/unused/UnusedPropertyInspection.java
@@ -20,9 +20,7 @@
import com.intellij.codeInspection.ProblemHighlightType;
import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.lang.ASTNode;
-import com.intellij.lang.properties.PropertiesBundle;
-import com.intellij.lang.properties.PropertiesQuickFixFactory;
-import com.intellij.lang.properties.PropertySuppressableInspectionBase;
+import com.intellij.lang.properties.*;
import com.intellij.lang.properties.findUsages.PropertySearcher;
import com.intellij.lang.properties.psi.Property;
import com.intellij.openapi.extensions.Extensions;
@@ -30,6 +28,7 @@
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.PsiFile;
@@ -39,6 +38,10 @@
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.FilteringIterator;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Set;
/**
* @author cdr
@@ -56,18 +59,44 @@
return "UnusedProperty";
}
+ @Nullable
+ private static GlobalSearchScope getWidestUseScope(@Nullable String key, @NotNull Project project, @NotNull Module ownModule) {
+ if (key == null) return null;
+
+ Set<Module> modules = ContainerUtil.newLinkedHashSet();
+ for (IProperty property : PropertiesImplUtil.findPropertiesByKey(project, key)) {
+ Module module = ModuleUtilCore.findModuleForPsiElement(property.getPsiElement());
+ if (module == null) {
+ return GlobalSearchScope.allScope(project);
+ }
+ if (module != ownModule) {
+ modules.add(module);
+ }
+ }
+ if (modules.isEmpty()) return null;
+
+ List<Module> list = ContainerUtil.newArrayList(modules);
+ GlobalSearchScope result = GlobalSearchScope.moduleWithDependentsScope(list.get(0));
+ for (int i = 1; i < list.size(); i++) {
+ result = result.uniteWith(GlobalSearchScope.moduleWithDependentsScope(list.get(i)));
+ }
+ return result;
+ }
+
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder,
final boolean isOnTheFly,
@NotNull final LocalInspectionToolSession session) {
final PsiFile file = session.getFile();
- Module module = ModuleUtilCore.findModuleForPsiElement(file);
+ final Module module = ModuleUtilCore.findModuleForPsiElement(file);
if (module == null) return super.buildVisitor(holder, isOnTheFly, session);
+
+ final GlobalSearchScope ownUseScope = GlobalSearchScope.moduleWithDependentsScope(module);
+
Object[] extensions = Extensions.getExtensions("com.intellij.referencesSearch");
final PropertySearcher searcher =
(PropertySearcher)ContainerUtil.find(extensions, new FilteringIterator.InstanceOf<PropertySearcher>(PropertySearcher.class));
- final GlobalSearchScope searchScope = GlobalSearchScope.moduleWithDependentsScope(module);
final PsiSearchHelper searchHelper = PsiSearchHelper.SERVICE.getInstance(file.getProject());
return new PsiElementVisitor() {
@Override
@@ -90,13 +119,10 @@
if (name == null) return;
}
- PsiSearchHelper.SearchCostResult cheapEnough = searchHelper.isCheapEnoughToSearch(name, searchScope, file, original);
- if (cheapEnough == PsiSearchHelper.SearchCostResult.TOO_MANY_OCCURRENCES) return;
+ if (mayHaveUsages(property, original, name, ownUseScope)) return;
- if (cheapEnough != PsiSearchHelper.SearchCostResult.ZERO_OCCURRENCES &&
- ReferencesSearch.search(property, searchScope, false).findFirst() != null) {
- return;
- }
+ final GlobalSearchScope widerScope = getWidestUseScope(property.getKey(), element.getProject(), module);
+ if (widerScope != null && mayHaveUsages(property, original, name, widerScope)) return;
final ASTNode propertyNode = property.getNode();
assert propertyNode != null;
@@ -108,6 +134,17 @@
LocalQuickFix fix = PropertiesQuickFixFactory.getInstance().createRemovePropertyLocalFix();
holder.registerProblem(key, description, ProblemHighlightType.LIKE_UNUSED_SYMBOL, fix);
}
+
+ private boolean mayHaveUsages(Property property, ProgressIndicator original, String name, GlobalSearchScope searchScope) {
+ PsiSearchHelper.SearchCostResult cheapEnough = searchHelper.isCheapEnoughToSearch(name, searchScope, file, original);
+ if (cheapEnough == PsiSearchHelper.SearchCostResult.TOO_MANY_OCCURRENCES) return true;
+
+ if (cheapEnough != PsiSearchHelper.SearchCostResult.ZERO_OCCURRENCES &&
+ ReferencesSearch.search(property, searchScope, false).findFirst() != null) {
+ return true;
+ }
+ return false;
+ }
};
}
}
diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/PropertiesImplUtil.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/PropertiesImplUtil.java
index 5908219..b29fc4f 100644
--- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/PropertiesImplUtil.java
+++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/PropertiesImplUtil.java
@@ -28,13 +28,14 @@
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import com.intellij.psi.search.GlobalSearchScope;
-import com.intellij.util.ArrayUtil;
-import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.indexing.FileBasedIndex;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
/**
* @author Konstantin Bulenkov
@@ -64,7 +65,7 @@
if (baseName.equals(getBaseName(psiFile))) {
final PropertiesFile propertiesFile = getPropertiesFile(psiFile);
if (propertiesFile != null) {
- if (defaultPropertiesFile == null || defaultPropertiesFile.getName().compareTo(propertiesFile.getName()) < 0) {
+ if (defaultPropertiesFile == null || defaultPropertiesFile.getName().compareTo(propertiesFile.getName()) > 0) {
defaultPropertiesFile = propertiesFile;
}
}
@@ -91,7 +92,7 @@
}
@NotNull
- public static List<IProperty> findPropertiesByKey(final Project project, final String key) {
+ public static List<IProperty> findPropertiesByKey(@NotNull final Project project, @NotNull final String key) {
final GlobalSearchScope scope = GlobalSearchScope.allScope(project);
final ArrayList<IProperty> properties =
new ArrayList<IProperty>(PropertyKeyIndex.getInstance().get(key, project, scope));
diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundleEditorViewElement.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundleEditorViewElement.java
index 00c21d8d..58932d1 100644
--- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundleEditorViewElement.java
+++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundleEditorViewElement.java
@@ -25,6 +25,6 @@
*/
public interface ResourceBundleEditorViewElement {
- PsiElement[] getPsiElements(@NotNull Project project);
+ PsiElement[] getPsiElements();
}
diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundleFileStructureViewElement.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundleFileStructureViewElement.java
index 25220d3..ee3e22b 100644
--- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundleFileStructureViewElement.java
+++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundleFileStructureViewElement.java
@@ -25,7 +25,6 @@
import com.intellij.lang.properties.ResourceBundle;
import com.intellij.lang.properties.psi.PropertiesFile;
import com.intellij.navigation.ItemPresentation;
-import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
@@ -88,7 +87,7 @@
}
@Override
- public PsiElement[] getPsiElements(@NotNull Project project) {
+ public PsiElement[] getPsiElements() {
final List<PropertiesFile> propertiesFiles = getValue().getPropertiesFiles();
return ContainerUtil.map2Array(propertiesFiles, new PsiElement[propertiesFiles.size()], new Function<PropertiesFile, PsiElement>() {
@Override
diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundlePropertyStructureViewElement.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundlePropertyStructureViewElement.java
index 8b387e8..ed66053 100644
--- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundlePropertyStructureViewElement.java
+++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundlePropertyStructureViewElement.java
@@ -29,7 +29,6 @@
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.editor.markup.TextAttributes;
-import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.util.PlatformIcons;
import org.jetbrains.annotations.NotNull;
@@ -61,7 +60,7 @@
}
@Override
- public PsiElement[] getPsiElements(final @NotNull Project project) {
+ public PsiElement[] getPsiElements() {
return new PsiElement[] {getProperty().getPsiElement()};
}
diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesFileStructureViewElement.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesFileStructureViewElement.java
index 432739c..2e6c87b 100644
--- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesFileStructureViewElement.java
+++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesFileStructureViewElement.java
@@ -22,7 +22,6 @@
import com.intellij.lang.properties.psi.Property;
import com.intellij.lang.properties.psi.impl.PropertiesFileImpl;
import com.intellij.navigation.ItemPresentation;
-import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
@@ -52,7 +51,7 @@
}
@Override
- public PsiElement[] getPsiElements(@NotNull Project project) {
+ public PsiElement[] getPsiElements() {
return new PsiElement[] {getValue()};
}
diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesPrefixGroup.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesPrefixGroup.java
index 8aedbcb..61b3c02 100644
--- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesPrefixGroup.java
+++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesPrefixGroup.java
@@ -22,11 +22,9 @@
import com.intellij.lang.properties.editor.ResourceBundleEditorViewElement;
import com.intellij.lang.properties.editor.ResourceBundlePropertyStructureViewElement;
import com.intellij.navigation.ItemPresentation;
-import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
-import com.intellij.util.Function;
import com.intellij.util.NullableFunction;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
@@ -137,7 +135,7 @@
}
@Override
- public PsiElement[] getPsiElements(final @NotNull Project project) {
+ public PsiElement[] getPsiElements() {
final List<PsiElement> elements = ContainerUtil.mapNotNull(getChildren(), new NullableFunction<TreeElement, PsiElement>() {
@Nullable
@Override
@@ -148,7 +146,7 @@
return property.getPsiElement();
}
else if (treeElement instanceof ResourceBundlePropertyStructureViewElement) {
- return ((ResourceBundlePropertyStructureViewElement)treeElement).getPsiElements(project)[0];
+ return ((ResourceBundlePropertyStructureViewElement)treeElement).getPsiElements()[0];
}
return null;
}
diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesStructureViewElement.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesStructureViewElement.java
index 2af0337..d73fd37 100644
--- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesStructureViewElement.java
+++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesStructureViewElement.java
@@ -19,7 +19,6 @@
import com.intellij.lang.properties.editor.ResourceBundleEditorViewElement;
import com.intellij.lang.properties.psi.Property;
import com.intellij.navigation.ItemPresentation;
-import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
@@ -58,7 +57,7 @@
}
@Override
- public PsiElement[] getPsiElements(@NotNull Project project) {
+ public PsiElement[] getPsiElements() {
return new PsiElement[] {getValue()};
}
diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java
index 0176aa3..e9eb9e9 100644
--- a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java
+++ b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java
@@ -123,30 +123,40 @@
myStructureViewPanel.add(myStructureViewComponent, BorderLayout.CENTER);
myStructureViewComponent.getTree().getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
- private String selectedPropertyName;
+ private IProperty selectedProperty;
private PropertiesFile selectedPropertiesFile;
@Override
public void valueChanged(TreeSelectionEvent e) {
// filter out temp unselect/select events
- if (getSelectedPropertyName() == null) return;
- if (!Comparing.strEqual(selectedPropertyName, getSelectedPropertyName()) ||
+ if (getSelectedProperty() == null) return;
+ if (!arePropertiesEquivalent(selectedProperty, getSelectedProperty()) ||
!Comparing.equal(selectedPropertiesFile, getSelectedPropertiesFile())) {
if (e.getOldLeadSelectionPath() != null) {
for (Map.Entry<PropertiesFile, Editor> entry : myEditors.entrySet()) {
if (entry.getValue() == mySelectedEditor) {
- writeEditorPropertyValue(mySelectedEditor, entry.getKey(), selectedPropertyName);
+ writeEditorPropertyValue(mySelectedEditor, entry.getKey(), selectedProperty.getName());
break;
}
}
}
- selectedPropertyName = getSelectedPropertyName();
+ selectedProperty = getSelectedProperty();
selectedPropertiesFile = getSelectedPropertiesFile();
selectionChanged();
}
}
+
+ private boolean arePropertiesEquivalent(@Nullable IProperty p1, @Nullable IProperty p2) {
+ if (p1 == p2) {
+ return true;
+ }
+ if (p1 == null || p2 == null) {
+ return false;
+ }
+ return p1.getPsiElement().isEquivalentTo(p2.getPsiElement());
+ }
});
installPropertiesChangeListeners();
@@ -233,7 +243,10 @@
DefaultMutableTreeNode nodeToSelect = null;
while (!toCheck.isEmpty()) {
DefaultMutableTreeNode node = toCheck.pop();
- String value = getNodeValue(node);
+ final ResourceBundleEditorViewElement element = getSelectedElement(node);
+ String value = element instanceof ResourceBundlePropertyStructureViewElement
+ ? ((ResourceBundlePropertyStructureViewElement)element).getValue()
+ : null;
if (propertyName.equals(value)) {
nodeToSelect = node;
break;
@@ -279,13 +292,6 @@
}
@Nullable
- private static String getNodeValue(@NotNull DefaultMutableTreeNode node) {
- final ResourceBundleEditorViewElement element = getSelectedElement(node);
- return element instanceof ResourceBundlePropertyStructureViewElement ? ((ResourceBundlePropertyStructureViewElement)element).getValue()
- : null;
- }
-
- @Nullable
private static ResourceBundleEditorViewElement getSelectedElement(@NotNull DefaultMutableTreeNode node) {
Object userObject = node.getUserObject();
if (!(userObject instanceof AbstractTreeNode)) return null;
@@ -296,8 +302,9 @@
private void writeEditorPropertyValue(final Editor editor, final PropertiesFile propertiesFile, final @Nullable String propertyName) {
final String currentValue = editor.getDocument().getText();
final String currentSelectedProperty = propertyName == null ? getSelectedPropertyName() : propertyName;
-
- assert currentSelectedProperty != null;
+ if (currentSelectedProperty == null) {
+ return;
+ }
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
@@ -564,21 +571,41 @@
}
@Nullable
- public String getSelectedPropertyName() {
+ private DefaultMutableTreeNode getSelectedNode() {
JTree tree = myStructureViewComponent.getTree();
if (tree == null) return null;
TreePath selected = tree.getSelectionModel().getSelectionPath();
if (selected == null) return null;
- return getNodeValue((DefaultMutableTreeNode)selected.getLastPathComponent());
+ return (DefaultMutableTreeNode)selected.getLastPathComponent();
+ }
+
+ @Nullable
+ private String getSelectedPropertyName() {
+ final IProperty selectedProperty = getSelectedProperty();
+ return selectedProperty == null ? null : selectedProperty.getName();
+ }
+
+ @Nullable
+ private IProperty getSelectedProperty() {
+ final DefaultMutableTreeNode selectedNode = getSelectedNode();
+ if (selectedNode == null) {
+ return null;
+ }
+ final ResourceBundleEditorViewElement element = getSelectedElement(selectedNode);
+ return element instanceof ResourceBundlePropertyStructureViewElement ? ((ResourceBundlePropertyStructureViewElement)element).getProperty()
+ : null;
}
@Nullable
public ResourceBundleEditorViewElement getSelectedElement() {
- JTree tree = myStructureViewComponent.getTree();
- if (tree == null) return null;
- TreePath selected = tree.getSelectionModel().getSelectionPath();
- if (selected == null) return null;
- return getSelectedElement((DefaultMutableTreeNode)selected.getLastPathComponent());
+ final DefaultMutableTreeNode selectedNode = getSelectedNode();
+ if (selectedNode == null) {
+ return null;
+ }
+ Object userObject = selectedNode.getUserObject();
+ if (!(userObject instanceof AbstractTreeNode)) return null;
+ Object value = ((AbstractTreeNode)userObject).getValue();
+ return value instanceof ResourceBundleEditorViewElement ? (ResourceBundleEditorViewElement) value : null;
}
@Override
diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java
index ee8e47a..0985f35 100644
--- a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java
+++ b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java
@@ -29,14 +29,11 @@
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiNamedElement;
-import com.intellij.psi.util.PsiUtilBase;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.refactoring.safeDelete.SafeDeleteHandler;
import com.intellij.ui.PopupHandler;
import com.intellij.usages.UsageTarget;
import com.intellij.usages.UsageView;
-import com.intellij.util.Function;
-import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import java.awt.datatransfer.StringSelection;
@@ -79,13 +76,7 @@
} else if (LangDataKeys.PSI_ELEMENT_ARRAY.is(dataId)) {
final ResourceBundleEditorViewElement selectedElement = ((ResourceBundleEditor)getFileEditor()).getSelectedElement();
if (selectedElement != null) {
- final Project project = CommonDataKeys.PROJECT.getData(this);
- if (project != null) {
- final PsiElement[] psiElements = selectedElement.getPsiElements(project);
- if (psiElements != null) {
- return psiElements;
- }
- }
+ return selectedElement.getPsiElements();
}
} else if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId)) {
final PsiElement[] psiElements = LangDataKeys.PSI_ELEMENT_ARRAY.getData(this);
diff --git a/plugins/properties/testSrc/com/intellij/lang/properties/ResourceBundleRenameTest.java b/plugins/properties/testSrc/com/intellij/lang/properties/ResourceBundleTest.java
similarity index 76%
rename from plugins/properties/testSrc/com/intellij/lang/properties/ResourceBundleRenameTest.java
rename to plugins/properties/testSrc/com/intellij/lang/properties/ResourceBundleTest.java
index f8c4358..00d4ada 100644
--- a/plugins/properties/testSrc/com/intellij/lang/properties/ResourceBundleRenameTest.java
+++ b/plugins/properties/testSrc/com/intellij/lang/properties/ResourceBundleTest.java
@@ -15,6 +15,7 @@
*/
package com.intellij.lang.properties;
+import com.intellij.lang.properties.psi.PropertiesFile;
import com.intellij.lang.properties.refactoring.rename.ResourceBundleRenamerFactory;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.psi.PsiFile;
@@ -25,7 +26,16 @@
/**
* @author Dmitry Batkovich
*/
-public class ResourceBundleRenameTest extends LightPlatformCodeInsightFixtureTestCase {
+public class ResourceBundleTest extends LightPlatformCodeInsightFixtureTestCase {
+
+ public void testDefaultPropertyFile() {
+ final PsiFile rawDefault = myFixture.addFileToProject("p.properties", "");
+ myFixture.addFileToProject("p_en.properties", "");
+ final PropertiesFile defaultFile = PropertiesImplUtil.getPropertiesFile(rawDefault);
+ assertNotNull(defaultFile);
+ final PropertiesFile file = defaultFile.getResourceBundle().getDefaultPropertiesFile();
+ assertTrue(file.getContainingFile().isEquivalentTo(defaultFile.getContainingFile()));
+ }
public void testRenameResourceBundleEntryFile() {
final PsiFile toRenameFile = myFixture.addFileToProject("old_p.properties", "");
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java b/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java
deleted file mode 100644
index 7c51fa8..0000000
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java
+++ /dev/null
@@ -1,145 +0,0 @@
-package com.intellij.structuralsearch.plugin.ui;
-
-import com.intellij.notification.NotificationGroup;
-import com.intellij.openapi.application.ModalityState;
-import com.intellij.openapi.progress.ProgressIndicator;
-import com.intellij.openapi.progress.ProgressManager;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.ui.MessageType;
-import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.openapi.wm.ToolWindowId;
-import com.intellij.psi.PsiElement;
-import com.intellij.psi.PsiFile;
-import com.intellij.psi.PsiNameIdentifierOwner;
-import com.intellij.structuralsearch.*;
-import com.intellij.structuralsearch.impl.matcher.MatchResultImpl;
-import com.intellij.structuralsearch.plugin.StructuralSearchPlugin;
-import com.intellij.structuralsearch.plugin.ui.actions.DoSearchAction;
-import com.intellij.usageView.UsageInfo;
-import com.intellij.usages.Usage;
-import com.intellij.usages.UsageInfo2UsageAdapter;
-import com.intellij.util.Alarm;
-import com.intellij.util.ObjectUtils;
-import com.intellij.util.Processor;
-
-/**
- * Created by IntelliJ IDEA.
- * User: Maxim.Mossienko
- * Date: Mar 15, 2004
- * Time: 4:49:07 PM
- * To change this template use File | Settings | File Templates.
- */
-public class SearchCommand {
- protected UsageViewContext context;
- private MatchingProcess process;
- protected Project project;
-
- public SearchCommand(Project _project, UsageViewContext _context) {
- project = _project;
- context = _context;
- }
-
- public void findUsages(final Processor<Usage> processor) {
- final ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
-
- try {
- DoSearchAction.execute(
- project,
- new MatchResultSink() {
- int count;
-
- public void setMatchingProcess(MatchingProcess _process) {
- process = _process;
- findStarted();
- }
-
- public void processFile(PsiFile element) {
- final VirtualFile virtualFile = element.getVirtualFile();
- if (virtualFile != null)
- progress.setText(SSRBundle.message("looking.in.progress.message", virtualFile.getPresentableName()));
- }
-
- public void matchingFinished() {
- findEnded();
- progress.setText(SSRBundle.message("found.progress.message", count));
- }
-
- public ProgressIndicator getProgressIndicator() {
- return progress;
- }
-
- public void newMatch(MatchResult result) {
- UsageInfo info;
-
- if (MatchResult.MULTI_LINE_MATCH.equals(result.getName())) {
- int start = -1;
- int end = -1;
- PsiElement parent = result.getMatchRef().getElement().getParent();
-
- for (final MatchResult matchResult : ((MatchResultImpl)result).getMatches()) {
- PsiElement el = matchResult.getMatchRef().getElement();
- final int elementStart = el.getTextRange().getStartOffset();
-
- if (start == -1 || start > elementStart) {
- start = elementStart;
- }
- final int newend = elementStart + el.getTextLength();
-
- if (newend > end) {
- end = newend;
- }
- }
-
- final int parentStart = parent.getTextRange().getStartOffset();
- int startOffset = start - parentStart;
- info = new UsageInfo(parent, startOffset, end - parentStart);
- }
- else {
- PsiElement element = result.getMatch();
- if (element instanceof PsiNameIdentifierOwner) {
- element = ObjectUtils.notNull(((PsiNameIdentifierOwner)element).getNameIdentifier(), element);
- }
- info = new UsageInfo(element, result.getStart(), result.getEnd() == -1 ? element.getTextLength() : result.getEnd());
- }
-
- Usage usage = new UsageInfo2UsageAdapter(info);
- processor.process(usage);
- foundUsage(result, usage);
- ++count;
- }
- },
- context.getConfiguration()
- );
- }
- catch (final StructuralSearchException e) {
- final Alarm alarm = new Alarm();
- alarm.addRequest(
- new Runnable() {
- @Override
- public void run() {
- NotificationGroup.toolWindowGroup("Structural Search", ToolWindowId.FIND, true)
- .createNotification(SSRBundle.message("problem", e.getMessage()), MessageType.ERROR).notify(project);
- }
- },
- 100, ModalityState.NON_MODAL
- );
- }
- }
-
- public void stopAsyncSearch() {
- if (process!=null) process.stop();
- }
-
- protected void findStarted() {
- StructuralSearchPlugin.getInstance(project).setSearchInProgress(true);
- }
-
- protected void findEnded() {
- if (!project.isDisposed()) {
- StructuralSearchPlugin.getInstance(project).setSearchInProgress(false);
- }
- }
-
- protected void foundUsage(MatchResult result, Usage usage) {
- }
-}
diff --git a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/actions/DoSearchAction.java b/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/actions/DoSearchAction.java
deleted file mode 100644
index ed0da3a..0000000
--- a/plugins/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/actions/DoSearchAction.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.intellij.structuralsearch.plugin.ui.actions;
-
-import com.intellij.structuralsearch.plugin.ui.Configuration;
-import com.intellij.structuralsearch.*;
-import com.intellij.openapi.project.Project;
-
-/**
- * Does the search action
- */
-public class DoSearchAction {
- public static void execute(final Project project, MatchResultSink sink,
- final Configuration configuration) {
- final MatchOptions options = configuration.getMatchOptions();
-
- final Matcher matcher = new Matcher(project);
- try {
- matcher.findMatches(sink, options);
- }
- finally {
- sink.matchingFinished();
- }
- }
-
-}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/ConflictedSvnChange.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/ConflictedSvnChange.java
index 27b1b36..e8361b0 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/ConflictedSvnChange.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/ConflictedSvnChange.java
@@ -19,16 +19,15 @@
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ContentRevision;
-import org.tmatesoft.svn.core.internal.wc.SVNTreeConflictUtil;
-import org.tmatesoft.svn.core.wc.SVNTreeConflictDescription;
+import org.jetbrains.idea.svn.conflict.TreeConflictDescription;
import javax.swing.*;
public class ConflictedSvnChange extends Change {
private final ConflictState myConflictState;
// also used if not move/rename
- private SVNTreeConflictDescription myBeforeDescription;
- private SVNTreeConflictDescription myAfterDescription;
+ private TreeConflictDescription myBeforeDescription;
+ private TreeConflictDescription myAfterDescription;
// +-
private final FilePath myTreeConflictMarkHolder;
private boolean myIsPhantom;
@@ -66,19 +65,19 @@
return myIsPhantom;
}
- public SVNTreeConflictDescription getBeforeDescription() {
+ public TreeConflictDescription getBeforeDescription() {
return myBeforeDescription;
}
- public void setBeforeDescription(SVNTreeConflictDescription beforeDescription) {
+ public void setBeforeDescription(TreeConflictDescription beforeDescription) {
myBeforeDescription = beforeDescription;
}
- public SVNTreeConflictDescription getAfterDescription() {
+ public TreeConflictDescription getAfterDescription() {
return myAfterDescription;
}
- public void setAfterDescription(SVNTreeConflictDescription afterDescription) {
+ public void setAfterDescription(TreeConflictDescription afterDescription) {
myAfterDescription = afterDescription;
}
@@ -97,14 +96,14 @@
if (myAfterDescription != null) {
sb.append("before: ");
}
- sb.append(SVNTreeConflictUtil.getHumanReadableConflictDescription(myBeforeDescription));
+ sb.append(myBeforeDescription.toPresentableString());
}
if (myAfterDescription != null) {
sb.append('\n');
if (myBeforeDescription != null) {
sb.append("after: ");
}
- sb.append(SVNTreeConflictUtil.getHumanReadableConflictDescription(myAfterDescription));
+ sb.append(myAfterDescription.toPresentableString());
}
return sb.toString();
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/DepthCombo.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/DepthCombo.java
index b55b50b..4eea25a 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/DepthCombo.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/DepthCombo.java
@@ -15,50 +15,32 @@
*/
package org.jetbrains.idea.svn;
-import org.tmatesoft.svn.core.SVNDepth;
+import com.intellij.ui.ListCellRendererWrapper;
+import org.jetbrains.idea.svn.api.Depth;
import javax.swing.*;
public class DepthCombo extends JComboBox {
public DepthCombo(final boolean forUpdate) {
super(forUpdate ? ourForUpdate : ourForCheckout);
- setSelectedIndex(forUpdate ? 0 : 3);
+ setRenderer(new DepthRenderer());
+ setSelectedItem(forUpdate ? Depth.UNKNOWN : Depth.INFINITY);
setEditable(false);
setToolTipText(SvnBundle.message("label.depth.description"));
}
- public SVNDepth getDepth() {
- return ((SVNDepthWithName) super.getSelectedItem()).getDepth();
+ public Depth getDepth() {
+ return (Depth)super.getSelectedItem();
}
- private final static SVNDepthWithName [] ourForUpdate = {new SVNDepthWithName(SVNDepth.UNKNOWN, "working copy"),
- new SVNDepthWithName(SVNDepth.EMPTY), new SVNDepthWithName(SVNDepth.FILES), new SVNDepthWithName(SVNDepth.IMMEDIATES),
- new SVNDepthWithName(SVNDepth.INFINITY)};
- private final static SVNDepthWithName [] ourForCheckout = {
- new SVNDepthWithName(SVNDepth.EMPTY), new SVNDepthWithName(SVNDepth.FILES), new SVNDepthWithName(SVNDepth.IMMEDIATES),
- new SVNDepthWithName(SVNDepth.INFINITY)};
+ private final static Depth[] ourForUpdate = {Depth.UNKNOWN, Depth.EMPTY, Depth.FILES, Depth.IMMEDIATES, Depth.INFINITY};
+ private final static Depth[] ourForCheckout = {Depth.EMPTY, Depth.FILES, Depth.IMMEDIATES, Depth.INFINITY};
- private static class SVNDepthWithName {
- private final SVNDepth myDepth;
- private final String myName;
-
- private SVNDepthWithName(SVNDepth depth) {
- myDepth = depth;
- myName = myDepth.toString();
- }
-
- private SVNDepthWithName(SVNDepth depth, String name) {
- myDepth = depth;
- myName = name;
- }
+ private static class DepthRenderer extends ListCellRendererWrapper<Depth> {
@Override
- public String toString() {
- return myName;
- }
-
- public SVNDepth getDepth() {
- return myDepth;
+ public void customize(JList list, Depth value, int index, boolean selected, boolean hasFocus) {
+ setText(Depth.UNKNOWN.equals(value) ? "working copy" : value.getName());
}
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/ForNestedRootChecker.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/ForNestedRootChecker.java
index 333cf9e..e87c55d 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/ForNestedRootChecker.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/ForNestedRootChecker.java
@@ -21,10 +21,10 @@
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.tmatesoft.svn.core.SVNErrorCode;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import java.io.File;
@@ -108,8 +108,8 @@
@NotNull private final SvnVcs myVcs;
@NotNull private final VirtualFile myFile;
@NotNull private final File myIoFile;
- @Nullable private SVNInfo myInfo;
- @Nullable private SVNException myError;
+ @Nullable private Info myInfo;
+ @Nullable private SvnBindException myError;
private VcsFileResolver(@NotNull SvnVcs vcs, @NotNull VirtualFile file) {
myVcs = vcs;
@@ -128,7 +128,7 @@
try {
myInfo = myVcs.getFactory(myIoFile, false).createInfoClient().doInfo(myIoFile, SVNRevision.UNDEFINED);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
myError = e;
}
}
@@ -138,9 +138,7 @@
Node result = null;
if (myError != null) {
- SVNErrorCode errorCode = myError.getErrorMessage().getErrorCode();
-
- if (!SvnUtil.isUnversionedOrNotFound(errorCode)) {
+ if (!SvnUtil.isUnversionedOrNotFound(myError)) {
// error code does not indicate that myFile is unversioned or path is invalid => create result, but indicate error
result = new Node(myFile, getFakeUrl(), getFakeUrl(), myError);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/NestedCopiesBuilder.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/NestedCopiesBuilder.java
index 7934761..d0eafb7 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/NestedCopiesBuilder.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/NestedCopiesBuilder.java
@@ -20,10 +20,10 @@
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNStatus;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import java.io.File;
import java.util.HashSet;
@@ -42,9 +42,9 @@
mySet = new HashSet<NestedCopyInfo>();
}
- public void process(final FilePath path, final SVNStatus status) throws SVNException {
+ public void process(final FilePath path, final Status status) throws SVNException {
VirtualFile file = path.getVirtualFile();
- if (file != null && SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_EXTERNAL)) {
+ if (file != null && status.is(StatusType.STATUS_EXTERNAL)) {
// We do not determine here url, repository url - because url, repository url in status will determine location in the
// repository where folder is located and not where svn:externals property points. We want the later parameters - they'll
// determined while creating RootUrlInfos later. Format will be also determined later.
@@ -55,7 +55,7 @@
}
if (file == null || status.getURL() == null) return;
- if (!SvnVcs.svnStatusIsUnversioned(status) && status.isSwitched()) {
+ if (!status.is(StatusType.STATUS_UNVERSIONED) && status.isSwitched()) {
// this one called when there is switched directory under nested working copy
// TODO: some other cases?
final NestedCopyInfo
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/Node.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/Node.java
index 83290a3..3d1d77e2 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/Node.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/Node.java
@@ -19,7 +19,7 @@
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.tmatesoft.svn.core.SVNException;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNURL;
import java.io.File;
@@ -31,13 +31,13 @@
@NotNull private final VirtualFile myFile;
@NotNull private final SVNURL myUrl;
@NotNull private final SVNURL myRepositoryUrl;
- @Nullable private final SVNException myError;
+ @Nullable private final SvnBindException myError;
public Node(@NotNull VirtualFile file, @NotNull SVNURL url, @NotNull SVNURL repositoryUrl) {
this(file, url, repositoryUrl, null);
}
- public Node(@NotNull VirtualFile file, @NotNull SVNURL url, @NotNull SVNURL repositoryUrl, @Nullable SVNException error) {
+ public Node(@NotNull VirtualFile file, @NotNull SVNURL url, @NotNull SVNURL repositoryUrl, @Nullable SvnBindException error) {
myFile = file;
myUrl = url;
myRepositoryUrl = repositoryUrl;
@@ -65,7 +65,7 @@
}
@Nullable
- public SVNException getError() {
+ public SvnBindException getError() {
return myError;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/RepeatSvnActionThroughBusy.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/RepeatSvnActionThroughBusy.java
index b669f2b..e078c57 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/RepeatSvnActionThroughBusy.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/RepeatSvnActionThroughBusy.java
@@ -15,6 +15,7 @@
*/
package org.jetbrains.idea.svn;
+import com.intellij.openapi.vcs.VcsException;
import com.intellij.util.Processor;
import org.tmatesoft.sqljet.core.SqlJetErrorCode;
import org.tmatesoft.sqljet.core.SqlJetException;
@@ -52,20 +53,23 @@
protected int myCnt = REPEAT;
protected long myTimeout = 50;
- protected abstract void executeImpl() throws SVNException;
+
+ protected abstract void executeImpl() throws VcsException;
+
protected Object myT;
- public <T> T compute() throws SVNException {
+ public <T> T compute() throws VcsException {
execute();
return (T) myT;
}
- public void execute() throws SVNException {
+ public void execute() throws VcsException {
while (true) {
try {
executeImpl();
break;
- } catch (SVNException e) {
+ }
+ catch (VcsException e) {
if (ourBusyExceptionProcessor.process(e)) {
if (myCnt > 0) {
try {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/RootsToWorkingCopies.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/RootsToWorkingCopies.java
index 5ca7f9e..06138b3 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/RootsToWorkingCopies.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/RootsToWorkingCopies.java
@@ -29,14 +29,9 @@
import com.intellij.util.Alarm;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.tmatesoft.svn.core.SVNException;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNURLUtil;
-import org.tmatesoft.svn.core.internal.wc.admin.SVNEntry;
-import org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess;
-import org.tmatesoft.svn.core.wc.SVNInfo;
-import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNWCUtil;
import java.io.File;
import java.util.HashMap;
@@ -127,7 +122,7 @@
WorkingCopy workingCopy = null;
if (workingCopyRoot != null) {
- final SVNInfo svnInfo = myVcs.getInfo(workingCopyRoot);
+ final Info svnInfo = myVcs.getInfo(workingCopyRoot);
if (svnInfo != null && svnInfo.getURL() != null) {
workingCopy = new WorkingCopy(workingCopyRoot, svnInfo.getURL(), true);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/StatusReceiver.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/StatusReceiver.java
index 8524c83..ac165c4 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/StatusReceiver.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/StatusReceiver.java
@@ -17,14 +17,14 @@
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.idea.svn.status.Status;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNStatus;
import java.util.EventListener;
public interface StatusReceiver extends EventListener {
- void process(final FilePath path, final SVNStatus status) throws SVNException;
+ void process(final FilePath path, final Status status) throws SVNException;
void processIgnored(final VirtualFile vFile);
void processUnversioned(final VirtualFile vFile);
void processCopyRoot(VirtualFile file, SVNURL url, WorkingCopyFormat format, SVNURL rootURL);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/StatusWalkerPartner.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/StatusWalkerPartner.java
index 09d7d87..367ae1b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/StatusWalkerPartner.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/StatusWalkerPartner.java
@@ -25,11 +25,11 @@
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.tmatesoft.svn.core.SVNCancelException;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.ISVNStatusFileProvider;
-import org.tmatesoft.svn.core.wc.SVNEvent;
public class StatusWalkerPartner {
private final SvnVcs myVcs;
@@ -50,9 +50,9 @@
}
@NotNull
- public ISVNEventHandler getEventHandler() {
- return new ISVNEventHandler() {
- public void handleEvent(SVNEvent event, double progress) throws SVNException {
+ public ProgressTracker getEventHandler() {
+ return new ProgressTracker() {
+ public void consume(ProgressEvent event) throws SVNException {
//
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.properties b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.properties
index 38418b1..df545b0 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.properties
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.properties
@@ -322,9 +322,9 @@
progress.text.committing.changes.below=Creating commit packets...
status.text.committed.revision=Committed revision {0}.
checkin.operation.name=Comm_it
-checkin.different.formats.involved=Selected changes for {0,choice,0#repository|1#repositories} {1}\nbelong to both before- 1.7 format and 1.7 format \
-Subversion working copies.\nCommit will split into several commits.\n\n\
-You can convert all working copies into 1.7 format in Changes | Subversion Working Copies Information.\nDo you wish to continue with commit?
+checkin.different.formats.involved=Selected changes for {0,choice,0#repository|1#repositories} {1}\nbelong to Subversion working copies of \
+different formats.\nCommit will split into several commits.\n\n\
+You can convert all working copies to the same format in Changes | Subversion Working Copies Information.\nDo you wish to continue with commit?
progress.text.collecting.commitables=Collecting commitables at ''{0}''
progress.text2.fetching.external.location=Fetching external location to ''{0}''
progress.text2.checked.out=Checked out {1} files, checking out {0}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangeProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangeProvider.java
index 3b0195e..073826f 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangeProvider.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangeProvider.java
@@ -34,14 +34,15 @@
import com.intellij.util.EventDispatcher;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.actions.CleanupWorker;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.commandLine.SvnExceptionWrapper;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
import org.tmatesoft.svn.core.wc.ISVNStatusFileProvider;
-import org.tmatesoft.svn.core.wc.SVNStatus;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import java.io.File;
import java.util.*;
@@ -86,12 +87,12 @@
final SvnRecursiveStatusWalker walker = new SvnRecursiveStatusWalker(myVcs, statusReceiver.getMulticaster(), partner);
for (FilePath path : zipper.getRecursiveDirs()) {
- walker.go(path, SVNDepth.INFINITY);
+ walker.go(path, Depth.INFINITY);
}
partner.setFileProvider(fileProvider);
for (SvnScopeZipper.MyDirNonRecursive item : nonRecursiveMap.values()) {
- walker.go(item.getDir(), SVNDepth.IMMEDIATES);
+ walker.go(item.getDir(), Depth.IMMEDIATES);
}
processCopiedAndDeleted(context, dirtyScope);
@@ -111,6 +112,10 @@
}
}
+ /**
+ * TODO: Currently could not find exact case when "file status is not correctly refreshed after external commit" that is covered by this
+ * TODO: code. So for now, checks for formats greater than 1.7 are not added here.
+ */
private static void putAdministrative17UnderVfsListener(Set<NestedCopyInfo> pointInfos) {
if (! SvnVcs.ourListenToWcDb) return;
final LocalFileSystem lfs = LocalFileSystem.getInstance();
@@ -169,11 +174,12 @@
}
}
- public void getChanges(final FilePath path, final boolean recursive, final ChangelistBuilder builder) throws SVNException {
+ public void getChanges(final FilePath path, final boolean recursive, final ChangelistBuilder builder)
+ throws SVNException, SvnBindException {
final SvnChangeProviderContext context = new SvnChangeProviderContext(myVcs, builder, null);
final StatusWalkerPartner partner = new StatusWalkerPartner(myVcs, ProgressManager.getInstance().getProgressIndicator());
final SvnRecursiveStatusWalker walker = new SvnRecursiveStatusWalker(myVcs, context, partner);
- walker.go(path, recursive ? SVNDepth.INFINITY : SVNDepth.IMMEDIATES);
+ walker.go(path, recursive ? Depth.INFINITY : Depth.IMMEDIATES);
processCopiedAndDeleted(context, null);
}
@@ -181,7 +187,7 @@
ChangelistBuilder builder,
SvnChangeProviderContext context, final VcsDirtyScope dirtyScope) throws SVNException {
boolean foundRename = false;
- final SVNStatus copiedStatus = copiedFile.getStatus();
+ final Status copiedStatus = copiedFile.getStatus();
final String copyFromURL = copiedFile.getCopyFromURL();
final FilePath copiedToPath = copiedFile.getFilePath();
@@ -199,7 +205,7 @@
for (Iterator<SvnChangedFile> iterator = context.getDeletedFiles().iterator(); iterator.hasNext();) {
SvnChangedFile deletedFile = iterator.next();
- final SVNStatus deletedStatus = deletedFile.getStatus();
+ final Status deletedStatus = deletedFile.getStatus();
if ((deletedStatus != null) && (deletedStatus.getURL() != null) && Comparing.equal(copyFromURL, deletedStatus.getURL().toString())) {
final String clName = SvnUtil.getChangelistName(copiedFile.getStatus());
final Change newChange = context.createMovedChange(createBeforeRevision(deletedFile, true),
@@ -208,7 +214,7 @@
applyMovedChange(copiedFile.getFilePath(), builder, dirtyScope, deletedToDelete, deletedFile, clName, newChange);
for(Iterator<SvnChangedFile> iterChild = context.getDeletedFiles().iterator(); iterChild.hasNext();) {
SvnChangedFile deletedChild = iterChild.next();
- final SVNStatus childStatus = deletedChild.getStatus();
+ final Status childStatus = deletedChild.getStatus();
if (childStatus == null) {
continue;
}
@@ -243,15 +249,15 @@
// by building a relative url
if (!foundRename && copiedStatus.getURL() != null) {
File wcPath = guessWorkingCopyPath(copiedStatus.getFile(), copiedStatus.getURL(), copyFromURL);
- SVNStatus status;
+ Status status;
try {
status = myVcs.getFactory(wcPath).createStatusClient().doStatus(wcPath, false);
}
- catch(SVNException ex) {
+ catch(SvnBindException ex) {
LOG.info(ex);
status = null;
}
- if (status != null && SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_DELETED)) {
+ if (status != null && status.is(StatusType.STATUS_DELETED)) {
final FilePath filePath = myFactory.createFilePathOnDeleted(wcPath, false);
final SvnContentRevision beforeRevision = SvnContentRevision.createBaseRevision(myVcs, filePath, status.getRevision());
final ContentRevision afterRevision = CurrentContentRevision.create(copiedFile.getFilePath());
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangeProviderContext.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangeProviderContext.java
index f7e5857..716abbe1 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangeProviderContext.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangeProviderContext.java
@@ -26,13 +26,13 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.actions.AbstractShowPropertiesDiffAction;
+import org.jetbrains.idea.svn.info.Info;
+import org.jetbrains.idea.svn.lock.Lock;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNLock;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNStatus;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import java.io.File;
import java.util.*;
@@ -44,7 +44,7 @@
private List<SvnChangedFile> myCopiedFiles = null;
private final List<SvnChangedFile> myDeletedFiles = new ArrayList<SvnChangedFile>();
// for files moved in a subtree, which were the targets of merge (for instance).
- private final Map<String, SVNStatus> myTreeConflicted;
+ private final Map<String, Status> myTreeConflicted;
private Map<FilePath, String> myCopyFromURLs = null;
private final SvnVcs myVcs;
private final SvnBranchConfigurationManager myBranchConfigurationManager;
@@ -55,11 +55,11 @@
myVcs = vcs;
myChangelistBuilder = changelistBuilder;
myProgress = progress;
- myTreeConflicted = new HashMap<String, SVNStatus>();
+ myTreeConflicted = new HashMap<String, Status>();
myBranchConfigurationManager = SvnBranchConfigurationManager.getInstance(myVcs.getProject());
}
- public void process(FilePath path, SVNStatus status) throws SVNException {
+ public void process(FilePath path, Status status) throws SVNException {
processStatusFirstPass(path, status);
}
@@ -83,12 +83,12 @@
return myChangelistBuilder;
}
- public void reportTreeConflict(final SVNStatus status) {
+ public void reportTreeConflict(final Status status) {
myTreeConflicted.put(status.getFile().getAbsolutePath(), status);
}
@Nullable
- public SVNStatus getTreeConflictStatus(final File file) {
+ public Status getTreeConflictStatus(final File file) {
return myTreeConflicted.get(file.getAbsolutePath());
}
@@ -140,7 +140,7 @@
return null;
}
- public void addCopiedFile(final FilePath filePath, final SVNStatus status, final String copyFromURL) {
+ public void addCopiedFile(final FilePath filePath, final Status status, final String copyFromURL) {
if (myCopiedFiles == null) {
myCopiedFiles = new ArrayList<SvnChangedFile>();
}
@@ -160,19 +160,19 @@
//
- void processStatusFirstPass(final FilePath filePath, final SVNStatus status) throws SVNException {
+ void processStatusFirstPass(final FilePath filePath, final Status status) throws SVNException {
if (status == null) {
// external to wc
return;
}
if (status.getRemoteLock() != null) {
- final SVNLock lock = status.getRemoteLock();
+ final Lock lock = status.getRemoteLock();
myChangelistBuilder.processLogicallyLockedFolder(filePath.getVirtualFile(),
new LogicalLock(false, lock.getOwner(), lock.getComment(), lock.getCreationDate(),
lock.getExpirationDate()));
}
if (status.getLocalLock() != null) {
- final SVNLock lock = status.getLocalLock();
+ final Lock lock = status.getLocalLock();
myChangelistBuilder.processLogicallyLockedFolder(filePath.getVirtualFile(),
new LogicalLock(true, lock.getOwner(), lock.getComment(), lock.getCreationDate(),
lock.getExpirationDate()));
@@ -180,11 +180,11 @@
if (filePath.isDirectory() && status.isLocked()) {
myChangelistBuilder.processLockedFolder(filePath.getVirtualFile());
}
- if ((SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_ADDED) || SVNStatusType.STATUS_MODIFIED.equals(status.getNodeStatus())) &&
+ if ((status.is(StatusType.STATUS_ADDED) || StatusType.STATUS_MODIFIED.equals(status.getNodeStatus())) &&
status.getCopyFromURL() != null) {
addCopiedFile(filePath, status, status.getCopyFromURL());
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_DELETED)) {
+ else if (status.is(StatusType.STATUS_DELETED)) {
myDeletedFiles.add(new SvnChangedFile(filePath, status));
}
else {
@@ -198,7 +198,7 @@
}
}
- void processStatus(final FilePath filePath, final SVNStatus status) throws SVNException {
+ void processStatus(final FilePath filePath, final Status status) throws SVNException {
WorkingCopyFormat format = myVcs.getWorkingCopyFormat(filePath.getIOFile());
if (!WorkingCopyFormat.UNKNOWN.equals(format) && format.less(WorkingCopyFormat.ONE_DOT_SEVEN)) {
loadEntriesFile(filePath);
@@ -207,38 +207,36 @@
if (status != null) {
FileStatus fStatus = SvnStatusConvertor.convertStatus(status);
- final SVNStatusType statusType = status.getContentsStatus();
- final SVNStatusType propStatus = status.getPropertiesStatus();
- if (SvnVcs.svnStatusIsUnversioned(status) || SvnVcs.svnStatusIs(status, SVNStatusType.UNKNOWN)) {
+ final StatusType statusType = status.getContentsStatus();
+ final StatusType propStatus = status.getPropertiesStatus();
+ if (status.is(StatusType.STATUS_UNVERSIONED, StatusType.UNKNOWN)) {
final VirtualFile file = filePath.getVirtualFile();
if (file != null) {
myChangelistBuilder.processUnversionedFile(file);
}
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_ADDED)) {
+ else if (status.is(StatusType.STATUS_ADDED)) {
myChangelistBuilder.processChangeInList(createChange(null, CurrentContentRevision.create(filePath), fStatus, status),
SvnUtil.getChangelistName(status), SvnVcs.getKey());
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_CONFLICTED) ||
- SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_MODIFIED) ||
- SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_REPLACED) ||
- propStatus == SVNStatusType.STATUS_MODIFIED ||
- propStatus == SVNStatusType.STATUS_CONFLICTED) {
+ else if (status.is(StatusType.STATUS_CONFLICTED, StatusType.STATUS_MODIFIED, StatusType.STATUS_REPLACED) ||
+ propStatus == StatusType.STATUS_MODIFIED ||
+ propStatus == StatusType.STATUS_CONFLICTED) {
myChangelistBuilder.processChangeInList(
createChange(SvnContentRevision.createBaseRevision(myVcs, filePath, status), CurrentContentRevision.create(filePath), fStatus,
status), SvnUtil.getChangelistName(status), SvnVcs.getKey()
);
checkSwitched(filePath, myChangelistBuilder, status, fStatus);
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_DELETED)) {
+ else if (status.is(StatusType.STATUS_DELETED)) {
myChangelistBuilder.processChangeInList(
createChange(SvnContentRevision.createBaseRevision(myVcs, filePath, status), null, fStatus, status),
SvnUtil.getChangelistName(status), SvnVcs.getKey());
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_MISSING)) {
+ else if (status.is(StatusType.STATUS_MISSING)) {
myChangelistBuilder.processLocallyDeletedFile(createLocallyDeletedChange(filePath, status));
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_IGNORED)) {
+ else if (status.is(StatusType.STATUS_IGNORED)) {
if (!myVcs.isWcRoot(filePath)) {
myChangelistBuilder.processIgnoredFile(filePath.getVirtualFile());
}
@@ -246,7 +244,7 @@
else if (status.isCopied()) {
//
}
- else if ((fStatus == FileStatus.NOT_CHANGED || fStatus == FileStatus.SWITCHED) && statusType != SVNStatusType.STATUS_NONE) {
+ else if ((fStatus == FileStatus.NOT_CHANGED || fStatus == FileStatus.SWITCHED) && statusType != StatusType.STATUS_NONE) {
VirtualFile file = filePath.getVirtualFile();
if (file != null && FileDocumentManager.getInstance().isFileModified(file)) {
myChangelistBuilder.processChangeInList(
@@ -266,10 +264,10 @@
public void addModifiedNotSavedChange(final VirtualFile file) throws SVNException {
final FilePath filePath = new FilePathImpl(file);
- final SVNInfo svnInfo = myVcs.getInfo(file);
+ final Info svnInfo = myVcs.getInfo(file);
if (svnInfo != null) {
- final SVNStatus svnStatus = new SVNStatus();
+ final Status svnStatus = new Status();
svnStatus.setRevision(svnInfo.getRevision());
myChangelistBuilder.processChangeInList(
createChange(SvnContentRevision.createBaseRevision(myVcs, filePath, svnInfo.getRevision()), CurrentContentRevision.create(filePath),
@@ -278,7 +276,7 @@
}
}
- private void checkSwitched(final FilePath filePath, final ChangelistBuilder builder, final SVNStatus status,
+ private void checkSwitched(final FilePath filePath, final ChangelistBuilder builder, final Status status,
final FileStatus convertedStatus) {
if (status.isSwitched() || (convertedStatus == FileStatus.SWITCHED)) {
final VirtualFile virtualFile = filePath.getVirtualFile();
@@ -322,8 +320,8 @@
// seems here we can only have a tree conflict; which can be marked on either path (?)
// .. ok try to merge states
- Change createMovedChange(final ContentRevision before, final ContentRevision after, final SVNStatus copiedStatus,
- final SVNStatus deletedStatus) throws SVNException {
+ Change createMovedChange(final ContentRevision before, final ContentRevision after, final Status copiedStatus,
+ final Status deletedStatus) throws SVNException {
// todo no convertion needed for the contents status?
final ConflictedSvnChange conflictedSvnChange =
new ConflictedSvnChange(before, after, ConflictState.mergeState(getState(copiedStatus), getState(deletedStatus)),
@@ -340,13 +338,13 @@
private Change createChange(final ContentRevision before,
final ContentRevision after,
final FileStatus fStatus,
- final SVNStatus svnStatus)
+ final Status svnStatus)
throws SVNException {
final ConflictedSvnChange conflictedSvnChange = new ConflictedSvnChange(before, after, correctContentsStatus(fStatus, svnStatus),
getState(svnStatus),
after == null ? before.getFile() : after.getFile());
if (svnStatus != null) {
- if (SVNStatusType.STATUS_DELETED.equals(svnStatus.getNodeStatus()) && !svnStatus.getRevision().isValid()) {
+ if (StatusType.STATUS_DELETED.equals(svnStatus.getNodeStatus()) && !svnStatus.getRevision().isValid()) {
conflictedSvnChange.setIsPhantom(true);
}
conflictedSvnChange.setBeforeDescription(svnStatus.getTreeConflict());
@@ -354,31 +352,31 @@
return patchWithPropertyChange(conflictedSvnChange, svnStatus, null);
}
- private FileStatus correctContentsStatus(final FileStatus fs, final SVNStatus svnStatus) throws SVNException {
+ private FileStatus correctContentsStatus(final FileStatus fs, final Status svnStatus) throws SVNException {
//if (svnStatus.isSwitched()) return FileStatus.SWITCHED;
return fs;
//return SvnStatusConvertor.convertContentsStatus(svnStatus);
}
- private LocallyDeletedChange createLocallyDeletedChange(@NotNull FilePath filePath, final SVNStatus status) {
+ private LocallyDeletedChange createLocallyDeletedChange(@NotNull FilePath filePath, final Status status) {
return new SvnLocallyDeletedChange(filePath, getState(status));
}
- private Change patchWithPropertyChange(final Change change, final SVNStatus svnStatus, final SVNStatus deletedStatus)
+ private Change patchWithPropertyChange(final Change change, final Status svnStatus, final Status deletedStatus)
throws SVNException {
if (svnStatus == null) return change;
- final SVNStatusType propertiesStatus = svnStatus.getPropertiesStatus();
- if (SVNStatusType.STATUS_CONFLICTED.equals(propertiesStatus) || SVNStatusType.CHANGED.equals(propertiesStatus) ||
- SVNStatusType.STATUS_ADDED.equals(propertiesStatus) || SVNStatusType.STATUS_DELETED.equals(propertiesStatus) ||
- SVNStatusType.STATUS_MODIFIED.equals(propertiesStatus) || SVNStatusType.STATUS_REPLACED.equals(propertiesStatus) ||
- SVNStatusType.MERGED.equals(propertiesStatus)) {
+ final StatusType propertiesStatus = svnStatus.getPropertiesStatus();
+ if (StatusType.STATUS_CONFLICTED.equals(propertiesStatus) || StatusType.CHANGED.equals(propertiesStatus) ||
+ StatusType.STATUS_ADDED.equals(propertiesStatus) || StatusType.STATUS_DELETED.equals(propertiesStatus) ||
+ StatusType.STATUS_MODIFIED.equals(propertiesStatus) || StatusType.STATUS_REPLACED.equals(propertiesStatus) ||
+ StatusType.MERGED.equals(propertiesStatus)) {
final FilePath path = ChangesUtil.getFilePath(change);
final File ioFile = path.getIOFile();
final File beforeFile = deletedStatus != null ? deletedStatus.getFile() : ioFile;
- final String beforeList = SVNStatusType.STATUS_ADDED.equals(propertiesStatus) && deletedStatus == null ? null :
+ final String beforeList = StatusType.STATUS_ADDED.equals(propertiesStatus) && deletedStatus == null ? null :
AbstractShowPropertiesDiffAction.getPropertyList(myVcs, beforeFile, SVNRevision.BASE);
- final String afterList = SVNStatusType.STATUS_DELETED.equals(propertiesStatus) ? null :
+ final String afterList = StatusType.STATUS_DELETED.equals(propertiesStatus) ? null :
AbstractShowPropertiesDiffAction.getPropertyList(myVcs, ioFile, SVNRevision.WORKING);
// TODO: There are cases when status output is like (on newly added file with some properties that is locally deleted)
@@ -398,16 +396,16 @@
return change;
}
- private ConflictState getState(@Nullable final SVNStatus svnStatus) {
+ private ConflictState getState(@Nullable final Status svnStatus) {
if (svnStatus == null) {
return ConflictState.none;
}
- final SVNStatusType propertiesStatus = svnStatus.getPropertiesStatus();
+ final StatusType propertiesStatus = svnStatus.getPropertiesStatus();
final boolean treeConflict = svnStatus.getTreeConflict() != null;
- final boolean textConflict = SVNStatusType.STATUS_CONFLICTED == svnStatus.getContentsStatus();
- final boolean propertyConflict = SVNStatusType.STATUS_CONFLICTED == propertiesStatus;
+ final boolean textConflict = StatusType.STATUS_CONFLICTED == svnStatus.getContentsStatus();
+ final boolean propertyConflict = StatusType.STATUS_CONFLICTED == propertiesStatus;
if (treeConflict) {
reportTreeConflict(svnStatus);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangedFile.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangedFile.java
index 2bd5ee4..8d4fab4 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangedFile.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangedFile.java
@@ -16,19 +16,19 @@
package org.jetbrains.idea.svn;
import com.intellij.openapi.vcs.FilePath;
-import org.tmatesoft.svn.core.wc.SVNStatus;
+import org.jetbrains.idea.svn.status.Status;
class SvnChangedFile {
private final FilePath myFilePath;
- private final SVNStatus myStatus;
+ private final Status myStatus;
private String myCopyFromURL;
- public SvnChangedFile(final FilePath filePath, final SVNStatus status) {
+ public SvnChangedFile(final FilePath filePath, final Status status) {
myFilePath = filePath;
myStatus = status;
}
- public SvnChangedFile(final FilePath filePath, final SVNStatus status, final String copyFromURL) {
+ public SvnChangedFile(final FilePath filePath, final Status status, final String copyFromURL) {
myFilePath = filePath;
myStatus = status;
myCopyFromURL = copyFromURL;
@@ -38,7 +38,7 @@
return myFilePath;
}
- public SVNStatus getStatus() {
+ public Status getStatus() {
return myStatus;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangelistListener.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangelistListener.java
index 00fa3a1..a66146e 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangelistListener.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnChangelistListener.java
@@ -28,9 +28,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.status.Status;
import org.tmatesoft.svn.core.SVNErrorCode;
-import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.SVNStatus;
import java.io.File;
import java.util.ArrayList;
@@ -136,12 +135,11 @@
@Nullable
public static String getCurrentMapping(final SvnVcs vcs, final File file) {
try {
- final SVNStatus status = vcs.getFactory(file).createStatusClient().doStatus(file, false);
+ final Status status = vcs.getFactory(file).createStatusClient().doStatus(file, false);
return status == null ? null : status.getChangelistName();
}
- catch (SVNException e) {
- final SVNErrorCode errorCode = e.getErrorMessage().getErrorCode();
- if (SVNErrorCode.WC_NOT_DIRECTORY.equals(errorCode) || SVNErrorCode.WC_NOT_FILE.equals(errorCode)) {
+ catch (SvnBindException e) {
+ if (e.contains(SVNErrorCode.WC_NOT_DIRECTORY) || e.contains(SVNErrorCode.WC_NOT_FILE)) {
LOG.debug("Logging only, exception is valid (caught) here", e);
} else {
LOG.info("Logging only, exception is valid (caught) here", e);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfiguration.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfiguration.java
index 790cdae37..6f5013c 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfiguration.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfiguration.java
@@ -26,13 +26,14 @@
import com.intellij.openapi.vcs.changes.VcsAnnotationRefresher;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.auth.SvnAuthenticationManager;
import org.jetbrains.idea.svn.auth.SvnAuthenticationProvider;
import org.jetbrains.idea.svn.auth.SvnInteractiveAuthenticationProvider;
import org.jetbrains.idea.svn.config.SvnServerFileKeys;
+import org.jetbrains.idea.svn.diff.DiffOptions;
import org.jetbrains.idea.svn.update.MergeRootInfo;
import org.jetbrains.idea.svn.update.UpdateRootInfo;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNErrorMessage;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider;
@@ -41,7 +42,6 @@
import org.tmatesoft.svn.core.internal.wc.SVNConfigFile;
import org.tmatesoft.svn.core.internal.wc.SVNFileUtil;
import org.tmatesoft.svn.core.wc.ISVNOptions;
-import org.tmatesoft.svn.core.wc.SVNDiffOptions;
import org.tmatesoft.svn.core.wc.SVNWCUtil;
import java.io.File;
@@ -76,9 +76,6 @@
private SvnAuthenticationManager myInteractiveManager;
public static final AuthStorage RUNTIME_AUTH_CACHE = new AuthStorage();
- // TODO: update depth is not stored in configuration as SVNDepth has wrong type for DefaultJDOMExternalizer
- // TODO: check if it should be stored
- public SVNDepth UPDATE_DEPTH = SVNDepth.UNKNOWN;
private final Map<File, MergeRootInfo> myMergeRootInfos = new HashMap<File, MergeRootInfo>();
private final Map<File, UpdateRootInfo> myUpdateRootInfos = new HashMap<File, UpdateRootInfo>();
@@ -109,8 +106,9 @@
}
}
- public SVNDiffOptions getMergeOptions() {
- return new SVNDiffOptions(isIgnoreSpacesInMerge(), isIgnoreSpacesInMerge(), isIgnoreSpacesInMerge());
+ @NotNull
+ public DiffOptions getMergeOptions() {
+ return new DiffOptions(isIgnoreSpacesInMerge(), isIgnoreSpacesInMerge(), isIgnoreSpacesInMerge());
}
private void initServers() {
@@ -180,12 +178,12 @@
myState.sslProtocols = sslProtocols;
}
- public SVNDepth getUpdateDepth() {
- return UPDATE_DEPTH;
+ public Depth getUpdateDepth() {
+ return myState.UPDATE_DEPTH;
}
- public void setUpdateDepth(SVNDepth updateDepth) {
- this.UPDATE_DEPTH = updateDepth;
+ public void setUpdateDepth(Depth updateDepth) {
+ myState.UPDATE_DEPTH = updateDepth;
}
public UseAcceleration getUseAcceleration() {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurationState.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurationState.java
index 8d15539..5d5585a 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurationState.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurationState.java
@@ -17,6 +17,7 @@
import com.intellij.openapi.util.SystemInfo;
import com.intellij.util.xmlb.annotations.*;
+import org.jetbrains.idea.svn.api.Depth;
/**
* @author Konstantin Kolosovsky.
@@ -70,6 +71,7 @@
public boolean SHOW_MERGE_SOURCES_IN_ANNOTATE = true;
public boolean FORCE_UPDATE;
public boolean IGNORE_EXTERNALS;
+ public Depth UPDATE_DEPTH = Depth.UNKNOWN;
@Tag("configuration")
public static class ConfigurationDirectory {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnContentRevision.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnContentRevision.java
index 6e9693b..d2dbe84 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnContentRevision.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnContentRevision.java
@@ -29,8 +29,8 @@
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.status.Status;
import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNStatus;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -56,7 +56,7 @@
myFile = file;
}
- public static SvnContentRevision createBaseRevision(@NotNull SvnVcs vcs, @NotNull final FilePath file, final SVNStatus status) {
+ public static SvnContentRevision createBaseRevision(@NotNull SvnVcs vcs, @NotNull final FilePath file, final Status status) {
SVNRevision revision = status.getRevision().isValid() ? status.getRevision() : status.getCommittedRevision();
return createBaseRevision(vcs, file, revision);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnDiffProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnDiffProvider.java
index 8aade42..49ea87d 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnDiffProvider.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnDiffProvider.java
@@ -32,7 +32,12 @@
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.history.LatestExistentSearcher;
+import org.jetbrains.idea.svn.info.InfoConsumer;
+import org.jetbrains.idea.svn.info.Info;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNPropertyValue;
import org.tmatesoft.svn.core.SVNURL;
@@ -55,13 +60,13 @@
}
public VcsRevisionNumber getCurrentRevision(VirtualFile file) {
- final SVNInfo svnInfo = myVcs.getInfo(new File(file.getPresentableUrl()));
+ final Info svnInfo = myVcs.getInfo(new File(file.getPresentableUrl()));
return getRevision(svnInfo);
}
@Nullable
- private static VcsRevisionNumber getRevision(@Nullable SVNInfo info) {
+ private static VcsRevisionNumber getRevision(@Nullable Info info) {
VcsRevisionNumber result = null;
if (info != null) {
@@ -106,11 +111,11 @@
}
@NotNull
- private static ISVNInfoHandler createInfoHandler(@NotNull final Map<VirtualFile, VcsRevisionNumber> revisionMap,
+ private static InfoConsumer createInfoHandler(@NotNull final Map<VirtualFile, VcsRevisionNumber> revisionMap,
@NotNull final Map<String, VirtualFile> fileMap) {
- return new ISVNInfoHandler() {
+ return new InfoConsumer() {
@Override
- public void handleInfo(SVNInfo info) throws SVNException {
+ public void consume(Info info) throws SVNException {
if (info != null) {
VirtualFile file = fileMap.get(info.getFile().getAbsolutePath());
@@ -132,7 +137,7 @@
}
private VcsRevisionDescription getCurrentRevisionDescription(File path) {
- final SVNInfo svnInfo = myVcs.getInfo(path);
+ final Info svnInfo = myVcs.getInfo(path);
if (svnInfo == null) {
return null;
}
@@ -187,20 +192,20 @@
}
// not clear why we need it, with remote check..
- SVNStatus svnStatus = getFileStatus(new File(selectedFile.getPresentableUrl()), false);
+ Status svnStatus = getFileStatus(new File(selectedFile.getPresentableUrl()), false);
if (svnStatus != null && svnRevision.equals(svnStatus.getRevision())) {
return SvnContentRevision.createBaseRevision(myVcs, filePath, svnRevision);
}
return SvnContentRevision.createRemote(myVcs, filePath, svnRevision);
}
- private SVNStatus getFileStatus(File file, boolean remote) {
- SVNStatus result = null;
+ private Status getFileStatus(File file, boolean remote) {
+ Status result = null;
try {
- result = myVcs.getFactory(file).createStatusClient().doStatus(file, remote, false);
+ result = myVcs.getFactory(file).createStatusClient().doStatus(file, remote);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
LOG.debug(e);
}
@@ -217,10 +222,10 @@
}
private ItemLatestState getLastRevision(final File file) {
- final SVNStatus svnStatus = getFileStatus(file, true);
+ final Status svnStatus = getFileStatus(file, true);
if (svnStatus == null || itemExists(svnStatus) && SVNRevision.UNDEFINED.equals(svnStatus.getRemoteRevision())) {
// IDEADEV-21785 (no idea why this can happen)
- final SVNInfo info = myVcs.getInfo(file, SVNRevision.HEAD);
+ final Info info = myVcs.getInfo(file, SVNRevision.HEAD);
if (info == null || info.getURL() == null) {
LOG.info("No SVN status returned for " + file.getPath());
return defaultResult();
@@ -232,8 +237,8 @@
WorkingCopyFormat format = myVcs.getWorkingCopyFormat(file);
long revision = -1;
- // skipped for 1.8
- if (!WorkingCopyFormat.ONE_DOT_EIGHT.equals(format)) {
+ // skipped for >= 1.8
+ if (format.less(WorkingCopyFormat.ONE_DOT_EIGHT)) {
// get really latest revision
// TODO: Algorithm seems not to be correct in all cases - for instance, when some subtree was deleted and replaced by other
// TODO: with same names. pegRevision should be used somehow but this complicates the algorithm
@@ -254,8 +259,8 @@
return createResult(svnStatus.getRevision(), exists, false);
}
- private boolean itemExists(SVNStatus svnStatus) {
- return ! SVNStatusType.STATUS_DELETED.equals(svnStatus.getRemoteContentsStatus()) &&
- ! SVNStatusType.STATUS_DELETED.equals(svnStatus.getRemoteNodeStatus());
+ private boolean itemExists(Status svnStatus) {
+ return ! StatusType.STATUS_DELETED.equals(svnStatus.getRemoteContentsStatus()) &&
+ ! StatusType.STATUS_DELETED.equals(svnStatus.getRemoteNodeStatus());
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFileSystemListener.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFileSystemListener.java
index 5c5419d..02185ec 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFileSystemListener.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFileSystemListener.java
@@ -45,13 +45,16 @@
import com.intellij.vcsUtil.ActionWithTempFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.NodeKind;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
-import org.tmatesoft.svn.core.*;
+import org.jetbrains.idea.svn.info.Info;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.status.StatusType;
+import org.tmatesoft.svn.core.SVNErrorCode;
+import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.internal.wc.SVNFileUtil;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNMoveClient;
-import org.tmatesoft.svn.core.wc.SVNStatus;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import java.io.File;
import java.io.IOException;
@@ -153,8 +156,8 @@
return null;
}
- final SVNStatus fileStatus = getFileStatus(vcs, srcFile);
- if (fileStatus != null && SvnVcs.svnStatusIs(fileStatus, SVNStatusType.STATUS_ADDED)) {
+ final Status fileStatus = getFileStatus(vcs, srcFile);
+ if (fileStatus != null && fileStatus.is(StatusType.STATUS_ADDED)) {
myAddedFiles.putValue(vcs.getProject(), new AddedFileInfo(toDir, copyName, null, false));
return null;
}
@@ -189,9 +192,9 @@
@Nullable
public String getRepositoryUUID(final Project project, final VirtualFile dir) {
try {
- final SVNInfo info1 = new RepeatSvnActionThroughBusy() {
+ final Info info1 = new RepeatSvnActionThroughBusy() {
@Override
- protected void executeImpl() throws SVNException {
+ protected void executeImpl() {
myT = myVcs.getInfo(new File(dir.getPath()));
}
}.compute();
@@ -207,7 +210,8 @@
} else {
return info1.getRepositoryUUID();
}
- } catch (SVNException e) {
+ }
+ catch (VcsException e) {
// go to return default
}
return null;
@@ -264,18 +268,18 @@
final String list = isUndo ? null : SvnChangelistListener.getCurrentMapping(vcs, src);
WorkingCopyFormat format = vcs.getWorkingCopyFormat(src);
- final boolean is17OrLater = WorkingCopyFormat.ONE_DOT_EIGHT.equals(format) || WorkingCopyFormat.ONE_DOT_SEVEN.equals(format);
+ final boolean is17OrLater = format.isOrGreater(WorkingCopyFormat.ONE_DOT_SEVEN);
if (is17OrLater) {
- SVNStatus srcStatus = getFileStatus(vcs, src);
+ Status srcStatus = getFileStatus(vcs, src);
final File toDir = dst.getParentFile();
- SVNStatus dstStatus = getFileStatus(vcs, toDir);
- final boolean srcUnversioned = srcStatus == null || SvnVcs.svnStatusIsUnversioned(srcStatus);
- if (srcUnversioned && (dstStatus == null || SvnVcs.svnStatusIsUnversioned(dstStatus))) {
+ Status dstStatus = getFileStatus(vcs, toDir);
+ final boolean srcUnversioned = srcStatus == null || srcStatus.is(StatusType.STATUS_UNVERSIONED);
+ if (srcUnversioned && (dstStatus == null || dstStatus.is(StatusType.STATUS_UNVERSIONED))) {
return false;
}
if (srcUnversioned) {
- SVNStatus dstWasStatus = getFileStatus(vcs, dst);
- if (dstWasStatus == null || SvnVcs.svnStatusIsUnversioned(dstWasStatus)) {
+ Status dstWasStatus = getFileStatus(vcs, dst);
+ if (dstWasStatus == null || dstWasStatus.is(StatusType.STATUS_UNVERSIONED)) {
return false;
}
}
@@ -289,10 +293,6 @@
}
dst.setLastModified(srcTime);
}
- catch (SVNException e) {
- addToMoveExceptions(vcs.getProject(), e);
- return false;
- }
catch(VcsException e) {
addToMoveExceptions(vcs.getProject(), e);
return false;
@@ -300,12 +300,12 @@
return true;
}
- private final static Set<SVNStatusType> ourStatusesForUndoMove = new HashSet<SVNStatusType>();
+ private final static Set<StatusType> ourStatusesForUndoMove = new HashSet<StatusType>();
static {
- ourStatusesForUndoMove.add(SVNStatusType.STATUS_ADDED);
+ ourStatusesForUndoMove.add(StatusType.STATUS_ADDED);
}
- private boolean for17move(final SvnVcs vcs, final File src, final File dst, boolean undo, SVNStatus srcStatus) throws SVNException {
+ private boolean for17move(final SvnVcs vcs, final File src, final File dst, boolean undo, Status srcStatus) throws VcsException {
if (srcStatus != null && srcStatus.getCopyFromURL() == null) {
undo = false;
}
@@ -313,7 +313,7 @@
myUndoingMove = true;
createRevertAction(vcs, dst, true).execute();
copyUnversionedMembersOfDirectory(src, dst);
- if (srcStatus == null || SvnVcs.svnStatusIsUnversioned(srcStatus)) {
+ if (srcStatus == null || srcStatus.is(StatusType.STATUS_UNVERSIONED)) {
FileUtil.delete(src);
} else {
createRevertAction(vcs, src, true).execute();
@@ -322,13 +322,13 @@
} else {
if (doUsualMove(vcs, src)) return true;
// check destination directory
- final SVNStatus dstParentStatus = getFileStatus(vcs, dst.getParentFile());
- if (dstParentStatus == null || SvnVcs.svnStatusIsUnversioned(dstParentStatus)) {
+ final Status dstParentStatus = getFileStatus(vcs, dst.getParentFile());
+ if (dstParentStatus == null || dstParentStatus.is(StatusType.STATUS_UNVERSIONED)) {
try {
copyFileOrDir(src, dst);
}
catch (IOException e) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e), e);
+ throw new SvnBindException(e);
}
createDeleteAction(vcs, src, true).execute();
return false;
@@ -338,23 +338,18 @@
return false;
}
- public static void moveFileWithSvn(final SvnVcs vcs, final File src, final File dst) throws SVNException {
+ public static void moveFileWithSvn(final SvnVcs vcs, final File src, final File dst) throws VcsException {
new RepeatSvnActionThroughBusy() {
@Override
- protected void executeImpl() throws SVNException {
- try {
- vcs.getFactory(src).createCopyMoveClient().copy(src, dst, false, true);
- }
- catch (VcsException e) {
- wrapAndThrow(e);
- }
+ protected void executeImpl() throws VcsException {
+ vcs.getFactory(src).createCopyMoveClient().copy(src, dst, false, true);
}
}.execute();
}
- private void copyUnversionedMembersOfDirectory(final File src, final File dst) throws SVNException {
+ private void copyUnversionedMembersOfDirectory(final File src, final File dst) throws SvnBindException {
if (src.isDirectory()) {
- final SVNException[] exc = new SVNException[1];
+ final SvnBindException[] exc = new SvnBindException[1];
FileUtil.processFilesRecursively(src, new Processor<File>() {
@Override
public boolean process(File file) {
@@ -365,7 +360,7 @@
copyFileOrDir(src, dst);
}
catch (IOException e) {
- exc[0] = new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e), e);
+ exc[0] = new SvnBindException(e);
return false;
}
}
@@ -388,25 +383,25 @@
private boolean doUsualMove(SvnVcs vcs, File src) {
// if src is not under version control, do usual move.
- SVNStatus srcStatus = getFileStatus(vcs, src);
- if (srcStatus == null || SvnVcs.svnStatusIsUnversioned(srcStatus) ||
- SvnVcs.svnStatusIs(srcStatus, SVNStatusType.STATUS_OBSTRUCTED) ||
- SvnVcs.svnStatusIs(srcStatus, SVNStatusType.STATUS_MISSING) ||
- SvnVcs.svnStatusIs(srcStatus, SVNStatusType.STATUS_EXTERNAL)) {
- return true;
- }
- return false;
+ Status srcStatus = getFileStatus(vcs, src);
+ return srcStatus == null ||
+ srcStatus.is(StatusType.STATUS_UNVERSIONED, StatusType.STATUS_OBSTRUCTED, StatusType.STATUS_MISSING, StatusType.STATUS_EXTERNAL);
}
- private boolean for16move(SvnVcs vcs, final File src, final File dst, boolean undo) throws SVNException {
+ private boolean for16move(SvnVcs vcs, final File src, final File dst, boolean undo) throws VcsException {
final SVNMoveClient mover = vcs.getSvnKitManager().createMoveClient();
if (undo) {
myUndoingMove = true;
restoreFromUndoStorage(dst);
new RepeatSvnActionThroughBusy() {
@Override
- protected void executeImpl() throws SVNException {
- mover.undoMove(src, dst);
+ protected void executeImpl() throws VcsException {
+ try {
+ mover.undoMove(src, dst);
+ }
+ catch (SVNException e) {
+ throw new SvnBindException(e);
+ }
}
}.execute();
}
@@ -415,8 +410,13 @@
if (doUsualMove(vcs, src)) return true;
new RepeatSvnActionThroughBusy() {
@Override
- protected void executeImpl() throws SVNException {
- mover.doMove(src, dst);
+ protected void executeImpl() throws VcsException {
+ try {
+ mover.doMove(src, dst);
+ }
+ catch (SVNException e) {
+ throw new SvnBindException(e);
+ }
}
}.execute();
}
@@ -488,16 +488,14 @@
return false;
}
- SVNStatus status = getFileStatus(vcs, ioFile);
+ Status status = getFileStatus(vcs, ioFile);
if (status == null ||
- SvnVcs.svnStatusIsUnversioned(status) ||
- SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_OBSTRUCTED) ||
- SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_MISSING) ||
- SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_EXTERNAL) ||
- SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_IGNORED)) {
+ status.is(StatusType.STATUS_UNVERSIONED, StatusType.STATUS_OBSTRUCTED, StatusType.STATUS_MISSING, StatusType.STATUS_EXTERNAL,
+ StatusType.STATUS_IGNORED)) {
return false;
- } else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_DELETED)) {
+ }
+ else if (status.is(StatusType.STATUS_DELETED)) {
if (isUndo(vcs)) {
moveToUndoStorage(file);
}
@@ -509,11 +507,11 @@
myDeletedFiles.putValue(vcs.getProject(), ioFile);
return true;
}
- if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_ADDED)) {
+ if (status.is(StatusType.STATUS_ADDED)) {
try {
createRevertAction(vcs, ioFile, false).execute();
}
- catch (SVNException e) {
+ catch (VcsException e) {
// ignore
}
}
@@ -531,13 +529,8 @@
private RepeatSvnActionThroughBusy createRevertAction(@NotNull final SvnVcs vcs, @NotNull final File file, final boolean recursive) {
return new RepeatSvnActionThroughBusy() {
@Override
- protected void executeImpl() throws SVNException {
- try {
- vcs.getFactory(file).createRevertClient().revert(new File[]{file}, SVNDepth.fromRecurse(recursive), null);
- }
- catch (VcsException e) {
- wrapAndThrow(e);
- }
+ protected void executeImpl() throws VcsException {
+ vcs.getFactory(file).createRevertClient().revert(new File[]{file}, Depth.allOrFiles(recursive), null);
}
};
}
@@ -546,22 +539,12 @@
private RepeatSvnActionThroughBusy createDeleteAction(@NotNull final SvnVcs vcs, @NotNull final File file, final boolean force) {
return new RepeatSvnActionThroughBusy() {
@Override
- protected void executeImpl() throws SVNException {
- try {
- vcs.getFactory(file).createDeleteClient().delete(file, force, false, null);
- }
- catch (VcsException e) {
- wrapAndThrow(e);
- }
+ protected void executeImpl() throws VcsException {
+ vcs.getFactory(file).createDeleteClient().delete(file, force, false, null);
}
};
}
- private static void wrapAndThrow(VcsException e) throws SVNException {
- // TODO: probably we should wrap into new exception only if e.getCause is not SVNException
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.FS_GENERAL, e), e);
- }
-
private boolean isAboveSourceOfCopyOrMove(final Project p, File ioFile) {
for (MovedFileInfo file : myMovedFiles) {
if (FileUtil.isAncestor(ioFile, file.mySrc, false)) return true;
@@ -617,20 +600,20 @@
return false;
}
final File targetFile = new File(ioDir, name);
- SVNStatus status = getFileStatus(vcs, targetFile);
+ Status status = getFileStatus(vcs, targetFile);
- if (status == null || status.getContentsStatus() == SVNStatusType.STATUS_NONE ||
- status.getContentsStatus() == SVNStatusType.STATUS_UNVERSIONED) {
+ if (status == null || status.getContentsStatus() == StatusType.STATUS_NONE ||
+ status.getContentsStatus() == StatusType.STATUS_UNVERSIONED) {
myAddedFiles.putValue(vcs.getProject(), new AddedFileInfo(dir, name, null, recursive));
return false;
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_MISSING)) {
+ else if (status.is(StatusType.STATUS_MISSING)) {
return false;
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_DELETED)) {
- SVNNodeKind kind = status.getKind();
+ else if (status.is(StatusType.STATUS_DELETED)) {
+ NodeKind kind = status.getKind();
// kind differs.
- if (directory && kind != SVNNodeKind.DIR || !directory && kind != SVNNodeKind.FILE) {
+ if (directory && !kind.isDirectory() || !directory && !kind.isFile()) {
return false;
}
try {
@@ -641,7 +624,7 @@
myAddedFiles.putValue(vcs.getProject(), new AddedFileInfo(dir, name, null, recursive));
return false;
}
- catch (SVNException e) {
+ catch (VcsException e) {
SVNFileUtil.deleteAll(targetFile, true);
return false;
}
@@ -794,23 +777,13 @@
try {
new ActionWithTempFile(ioFile) {
protected void executeInternal() throws VcsException {
- try {
- // not recursive
- new RepeatSvnActionThroughBusy() {
- @Override
- protected void executeImpl() throws SVNException {
- try {
- vcs.getFactory(copyFrom).createCopyMoveClient().copy(copyFrom, ioFile, true, false);
- }
- catch (VcsException e) {
- wrapAndThrow(e);
- }
- }
- }.execute();
- }
- catch (SVNException e) {
- throw new VcsException(e);
- }
+ // not recursive
+ new RepeatSvnActionThroughBusy() {
+ @Override
+ protected void executeImpl() throws VcsException {
+ vcs.getFactory(copyFrom).createCopyMoveClient().copy(copyFrom, ioFile, true, false);
+ }
+ }.execute();
}
}.execute();
}
@@ -821,20 +794,15 @@
else {
new RepeatSvnActionThroughBusy() {
@Override
- protected void executeImpl() throws SVNException {
- try {
- vcs.getFactory(ioFile).createAddClient().add(ioFile, null, false, false, true, null);
- }
- catch (VcsException e) {
- wrapAndThrow(e);
- }
+ protected void executeImpl() throws VcsException {
+ vcs.getFactory(ioFile).createAddClient().add(ioFile, null, false, false, true, null);
}
}.execute();
}
VcsDirtyScopeManager.getInstance(project).fileDirty(file);
}
- catch (SVNException e) {
- exceptions.add(new VcsException(e));
+ catch (VcsException e) {
+ exceptions.add(e);
}
}
}
@@ -880,8 +848,8 @@
addedFile = myLfs.refreshAndFindFileByIoFile(ioFile);
}
if (addedFile != null) {
- final SVNStatus fileStatus = getFileStatus(vcs, ioFile);
- if (fileStatus == null || ! SvnVcs.svnStatusIs(fileStatus, SVNStatusType.STATUS_IGNORED)) {
+ final Status fileStatus = getFileStatus(vcs, ioFile);
+ if (fileStatus == null || !fileStatus.is(StatusType.STATUS_IGNORED)) {
boolean isIgnored = changeListManager.isIgnoredFile(addedFile);
if (!isIgnored) {
addedVFiles.add(addedFile);
@@ -935,8 +903,8 @@
FileUtil.delete(file.getIOFile());
}
}
- } catch (SVNException e) {
- exceptions.add(new VcsException(e));
+ } catch (VcsException e) {
+ exceptions.add(e);
}
if (! exceptions.isEmpty()) {
vcsHelper.showErrors(exceptions, SvnBundle.message("delete.files.errors.title"));
@@ -962,8 +930,8 @@
VcsDirtyScopeManager.getInstance(project).fileDirty(file);
}
}
- catch (SVNException e) {
- exceptions.add(new VcsException(e));
+ catch (VcsException e) {
+ exceptions.add(e);
}
}
}
@@ -988,7 +956,7 @@
final String singleFilePrompt;
if (deletedFiles.size() == 1 && deletedFiles.get(0).getFirst().isDirectory()) {
- singleFilePrompt = WorkingCopyFormat.ONE_DOT_SEVEN.equals(deletedFiles.get(0).getSecond()) ?
+ singleFilePrompt = deletedFiles.get(0).getSecond().isOrGreater(WorkingCopyFormat.ONE_DOT_SEVEN) ?
SvnBundle.getString("confirmation.text.delete.dir.17") :
SvnBundle.getString("confirmation.text.delete.dir");
}
@@ -1004,17 +972,17 @@
}
private void fillDeletedFiles(Project project, List<Pair<FilePath, WorkingCopyFormat>> deletedFiles, Collection<FilePath> deleteAnyway)
- throws SVNException {
+ throws VcsException {
final SvnVcs vcs = SvnVcs.getInstance(project);
final Collection<File> files = myDeletedFiles.remove(project);
for (final File file : files) {
- final SVNStatus status = new RepeatSvnActionThroughBusy() {
+ final Status status = new RepeatSvnActionThroughBusy() {
@Override
- protected void executeImpl() throws SVNException {
+ protected void executeImpl() throws VcsException {
myT = vcs.getFactory(file).createStatusClient().doStatus(file, false);
}
}.compute();
- boolean isAdded = SVNStatusType.STATUS_ADDED.equals(status.getNodeStatus());
+ boolean isAdded = StatusType.STATUS_ADDED.equals(status.getNodeStatus());
final FilePath filePath = VcsContextFactory.SERVICE.getInstance().createFilePathOn(file);
if (isAdded) {
deleteAnyway.add(filePath);
@@ -1059,16 +1027,16 @@
}
@Nullable
- private static SVNStatus getFileStatus(@NotNull final SvnVcs vcs, @NotNull final File file) {
+ private static Status getFileStatus(@NotNull final SvnVcs vcs, @NotNull final File file) {
try {
return new RepeatSvnActionThroughBusy() {
@Override
- protected void executeImpl() throws SVNException {
+ protected void executeImpl() throws VcsException {
myT = vcs.getFactory(file).createStatusClient().doStatus(file, false);
}
}.compute();
}
- catch (SVNException e) {
+ catch (VcsException e) {
return null;
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFileUrlMappingImpl.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFileUrlMappingImpl.java
index f55f877..1183831 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFileUrlMappingImpl.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnFileUrlMappingImpl.java
@@ -33,10 +33,10 @@
import com.intellij.util.messages.MessageBus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import java.io.File;
import java.util.List;
@@ -388,7 +388,7 @@
if (copyRoot == null || vcsRoot == null) continue;
final SvnVcs vcs = SvnVcs.getInstance(myProject);
- final SVNInfo svnInfo = vcs.getInfo(copyRoot);
+ final Info svnInfo = vcs.getInfo(copyRoot);
if ((svnInfo == null) || (svnInfo.getRepositoryRootURL() == null)) continue;
Node node = new Node(copyRoot, svnInfo.getURL(), svnInfo.getRepositoryRootURL());
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnProgressCanceller.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnProgressCanceller.java
index 5163dfa..dbad319 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnProgressCanceller.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnProgressCanceller.java
@@ -17,15 +17,15 @@
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.tmatesoft.svn.core.SVNCancelException;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
/**
* @author yole
*/
-public class SvnProgressCanceller implements ISVNEventHandler {
+public class SvnProgressCanceller implements ProgressTracker {
public void checkCancelled() throws SVNCancelException {
final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null && indicator.isCanceled()) {
@@ -33,6 +33,6 @@
}
}
- public void handleEvent(final SVNEvent event, final double progress) throws SVNException {
+ public void consume(final ProgressEvent event) throws SVNException {
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRecursiveStatusWalker.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRecursiveStatusWalker.java
index 45b28e3..1b1cd00 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRecursiveStatusWalker.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRecursiveStatusWalker.java
@@ -31,16 +31,16 @@
import com.intellij.vcsUtil.VcsUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.status.Status;
import org.jetbrains.idea.svn.status.StatusClient;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.status.StatusConsumer;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.SVNErrorCode;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.internal.wc.SVNFileUtil;
-import org.tmatesoft.svn.core.wc.ISVNStatusHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNStatus;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import java.io.File;
import java.util.LinkedList;
@@ -63,7 +63,7 @@
myHandler = new MyHandler();
}
- public void go(final FilePath rootPath, final SVNDepth depth) throws SVNException {
+ public void go(final FilePath rootPath, final Depth depth) throws SvnBindException {
final MyItem root = createItem(rootPath, depth, false);
myQueue.add(root);
@@ -81,23 +81,26 @@
client.doStatus(ioFile, SVNRevision.WORKING, item.getDepth(), false, false, true, true, myHandler, null);
myHandler.checkIfCopyRootWasReported(null, ioFile);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
handleStatusException(item, path, e);
}
} else {
try {
- final SVNStatus status = item.getClient().doStatus(ioFile, false, false);
+ final Status status = item.getClient().doStatus(ioFile, false);
myReceiver.process(path, status);
- } catch (SVNException e) {
+ }
+ catch (SvnBindException e) {
handleStatusException(item, path, e);
}
+ catch (SVNException e) {
+ handleStatusException(item, path, new SvnBindException(e));
+ }
}
}
}
- private void handleStatusException(MyItem item, FilePath path, SVNException e) throws SVNException {
- final SVNErrorCode errorCode = e.getErrorMessage().getErrorCode();
- if (SVNErrorCode.WC_NOT_DIRECTORY.equals(errorCode) || SVNErrorCode.WC_NOT_FILE.equals(errorCode)) {
+ private void handleStatusException(MyItem item, FilePath path, SvnBindException e) throws SvnBindException {
+ if (e.contains(SVNErrorCode.WC_NOT_DIRECTORY) || e.contains(SVNErrorCode.WC_NOT_FILE)) {
final VirtualFile virtualFile = path.getVirtualFile();
if (virtualFile != null) {
if (! myPartner.isExcluded(virtualFile)) {
@@ -116,11 +119,11 @@
private static class MyItem {
@NotNull private final FilePath myPath;
- @NotNull private final SVNDepth myDepth;
+ @NotNull private final Depth myDepth;
@NotNull private final StatusClient myStatusClient;
private final boolean myIsInnerCopyRoot;
- private MyItem(@NotNull FilePath path, @NotNull SVNDepth depth, boolean isInnerCopyRoot, @NotNull StatusClient statusClient) {
+ private MyItem(@NotNull FilePath path, @NotNull Depth depth, boolean isInnerCopyRoot, @NotNull StatusClient statusClient) {
myPath = path;
myDepth = depth;
myStatusClient = statusClient;
@@ -133,7 +136,7 @@
}
@NotNull
- public SVNDepth getDepth() {
+ public Depth getDepth() {
return myDepth;
}
@@ -147,13 +150,13 @@
}
}
- private void processRecursively(final VirtualFile vFile, final SVNDepth prevDepth) {
- if (SVNDepth.EMPTY.equals(prevDepth)) return;
+ private void processRecursively(final VirtualFile vFile, final Depth prevDepth) {
+ if (Depth.EMPTY.equals(prevDepth)) return;
if (myPartner.isIgnoredIdeaLevel(vFile)) {
myReceiver.processIgnored(vFile);
return;
}
- final SVNDepth newDepth = SVNDepth.INFINITY.equals(prevDepth) ? SVNDepth.INFINITY : SVNDepth.EMPTY;
+ final Depth newDepth = Depth.INFINITY.equals(prevDepth) ? Depth.INFINITY : Depth.EMPTY;
final File ioFile = new File(vFile.getPath());
final Processor<File> processor;
@@ -180,7 +183,7 @@
return true;
}
};
- if (SVNDepth.EMPTY.equals(newDepth)) {
+ if (Depth.EMPTY.equals(newDepth)) {
directoryFilter = Processor.TRUE;
processor = new Processor<File>() {
@Override
@@ -205,14 +208,14 @@
}
@NotNull
- private MyItem createItem(@NotNull FilePath path, @NotNull SVNDepth depth, boolean isInnerCopyRoot) {
+ private MyItem createItem(@NotNull FilePath path, @NotNull Depth depth, boolean isInnerCopyRoot) {
StatusClient statusClient =
myVcs.getFactory(path.getIOFile()).createStatusClient(myPartner.getFileProvider(), myPartner.getEventHandler());
return new MyItem(path, depth, isInnerCopyRoot, statusClient);
}
- private class MyHandler implements ISVNStatusHandler {
+ private class MyHandler implements StatusConsumer {
private MyItem myCurrentItem;
private boolean myMetCurrentItem;
@@ -221,37 +224,36 @@
myMetCurrentItem = false;
}
- public void checkIfCopyRootWasReported(@Nullable final SVNStatus ioFileStatus, final File ioFile) {
+ public void checkIfCopyRootWasReported(@Nullable final Status ioFileStatus, final File ioFile) {
File itemFile = myCurrentItem.getPath().getIOFile();
if (! myMetCurrentItem && FileUtil.filesEqual(ioFile, itemFile)) {
myMetCurrentItem = true;
- SVNStatus statusInner;
+ Status statusInner;
try {
- statusInner = ioFileStatus != null ? ioFileStatus :
- myCurrentItem.getClient().doStatus(itemFile, false);
+ statusInner = ioFileStatus != null ? ioFileStatus : myCurrentItem.getClient().doStatus(itemFile, false);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
LOG.info(e);
statusInner = null;
}
if (statusInner == null) return;
- final SVNStatusType status = statusInner.getNodeStatus();
+ final StatusType status = statusInner.getNodeStatus();
final VirtualFile vf = myCurrentItem.getPath().getVirtualFile();
- if (SVNStatusType.STATUS_IGNORED.equals(status)) {
+ if (StatusType.STATUS_IGNORED.equals(status)) {
if (vf != null) {
myReceiver.processIgnored(vf);
}
return;
}
- if (SVNStatusType.STATUS_UNVERSIONED.equals(status) || SVNStatusType.UNKNOWN.equals(status)) {
+ if (StatusType.STATUS_UNVERSIONED.equals(status) || StatusType.UNKNOWN.equals(status)) {
if (vf != null) {
myReceiver.processUnversioned(vf);
processRecursively(vf, myCurrentItem.getDepth());
}
return;
}
- if (SVNStatusType.OBSTRUCTED.equals(status) || SVNStatusType.STATUS_NONE.equals(status)) {
+ if (StatusType.OBSTRUCTED.equals(status) || StatusType.STATUS_NONE.equals(status)) {
return;
}
if (vf != null) {
@@ -264,7 +266,8 @@
}
}
- public void handleStatus(final SVNStatus status) throws SVNException {
+ @Override
+ public void consume(final Status status) throws SVNException {
myPartner.checkCanceled();
final File ioFile = status.getFile();
checkIfCopyRootWasReported(status, ioFile);
@@ -282,20 +285,20 @@
}
if (myProject.isDisposed()) throw new ProcessCanceledException();
- if ((vFile != null) && (SvnVcs.svnStatusIsUnversioned(status))) {
+ if ((vFile != null) && (status.is(StatusType.STATUS_UNVERSIONED))) {
if (vFile.isDirectory()) {
if (FileUtil.filesEqual(myCurrentItem.getPath().getIOFile(), ioFile)) {
//myReceiver.processUnversioned(vFile);
//processRecursively(vFile, myCurrentItem.getDepth());
} else {
- final MyItem childItem = createItem(new FilePathImpl(vFile), SVNDepth.INFINITY, true);
+ final MyItem childItem = createItem(new FilePathImpl(vFile), Depth.INFINITY, true);
myQueue.add(childItem);
}
} else {
myReceiver.processUnversioned(vFile);
}
} else {
- final FilePath path = VcsUtil.getFilePath(ioFile, status.getKind().equals(SVNNodeKind.DIR));
+ final FilePath path = VcsUtil.getFilePath(ioFile, status.getKind().isDirectory());
myReceiver.process(path, status);
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRootsDetector.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRootsDetector.java
index fd77d80..78a02d2 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRootsDetector.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRootsDetector.java
@@ -29,9 +29,9 @@
import com.intellij.util.containers.Convertor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.status.Status;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNURLUtil;
-import org.tmatesoft.svn.core.wc.SVNStatus;
import java.io.File;
import java.util.ArrayList;
@@ -165,7 +165,7 @@
// TODO: No checked exceptions are thrown - remove catch/LOG.error/rethrow to fix real cause if any
try {
final File infoFile = VfsUtilCore.virtualToIoFile(info.getFile());
- final SVNStatus svnStatus = SvnUtil.getStatus(myVcs, infoFile);
+ final Status svnStatus = SvnUtil.getStatus(myVcs, infoFile);
if (svnStatus != null && svnStatus.getURL() != null) {
info.setUrl(svnStatus.getURL());
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnStatusConvertor.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnStatusConvertor.java
index 84c3166..ced496e 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnStatusConvertor.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnStatusConvertor.java
@@ -19,15 +19,15 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.status.PortableStatus;
-import org.tmatesoft.svn.core.wc.SVNStatus;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.status.StatusType;
public class SvnStatusConvertor {
private SvnStatusConvertor() {
}
@NotNull
- public static FileStatus convertStatus(@Nullable SVNStatusType itemStatus, @Nullable SVNStatusType propertiesStatus) {
+ public static FileStatus convertStatus(@Nullable StatusType itemStatus, @Nullable StatusType propertiesStatus) {
PortableStatus status = new PortableStatus();
status.setContentsStatus(itemStatus);
@@ -37,47 +37,47 @@
}
@NotNull
- public static FileStatus convertStatus(@Nullable final SVNStatus status) {
+ public static FileStatus convertStatus(@Nullable final Status status) {
if (status == null) {
return FileStatus.UNKNOWN;
}
- if (SvnVcs.svnStatusIsUnversioned(status)) {
+ if (status.is(StatusType.STATUS_UNVERSIONED)) {
return FileStatus.UNKNOWN;
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_MISSING)) {
+ else if (status.is(StatusType.STATUS_MISSING)) {
return FileStatus.DELETED_FROM_FS;
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_EXTERNAL)) {
+ else if (status.is(StatusType.STATUS_EXTERNAL)) {
return SvnFileStatus.EXTERNAL;
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_OBSTRUCTED)) {
+ else if (status.is(StatusType.STATUS_OBSTRUCTED)) {
return SvnFileStatus.OBSTRUCTED;
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_IGNORED)) {
+ else if (status.is(StatusType.STATUS_IGNORED)) {
return FileStatus.IGNORED;
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_ADDED)) {
+ else if (status.is(StatusType.STATUS_ADDED)) {
return FileStatus.ADDED;
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_DELETED)) {
+ else if (status.is(StatusType.STATUS_DELETED)) {
return FileStatus.DELETED;
}
- else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_REPLACED)) {
+ else if (status.is(StatusType.STATUS_REPLACED)) {
return SvnFileStatus.REPLACED;
}
- else if (status.getContentsStatus() == SVNStatusType.STATUS_CONFLICTED ||
- status.getPropertiesStatus() == SVNStatusType.STATUS_CONFLICTED) {
- if (status.getContentsStatus() == SVNStatusType.STATUS_CONFLICTED &&
- status.getPropertiesStatus() == SVNStatusType.STATUS_CONFLICTED) {
+ else if (status.getContentsStatus() == StatusType.STATUS_CONFLICTED ||
+ status.getPropertiesStatus() == StatusType.STATUS_CONFLICTED) {
+ if (status.getContentsStatus() == StatusType.STATUS_CONFLICTED &&
+ status.getPropertiesStatus() == StatusType.STATUS_CONFLICTED) {
return FileStatus.MERGED_WITH_BOTH_CONFLICTS;
}
- else if (status.getContentsStatus() == SVNStatusType.STATUS_CONFLICTED) {
+ else if (status.getContentsStatus() == StatusType.STATUS_CONFLICTED) {
return FileStatus.MERGED_WITH_CONFLICTS;
}
return FileStatus.MERGED_WITH_PROPERTY_CONFLICTS;
}
- else if (status.getContentsStatus() == SVNStatusType.STATUS_MODIFIED ||
- status.getPropertiesStatus() == SVNStatusType.STATUS_MODIFIED) {
+ else if (status.getContentsStatus() == StatusType.STATUS_MODIFIED ||
+ status.getPropertiesStatus() == StatusType.STATUS_MODIFIED) {
return FileStatus.MODIFIED;
}
else if (status.isSwitched()) {
@@ -90,38 +90,38 @@
}
@NotNull
- public static FileStatus convertPropertyStatus(final SVNStatusType status) {
+ public static FileStatus convertPropertyStatus(final StatusType status) {
if (status == null) {
return FileStatus.UNKNOWN;
}
- if (SVNStatusType.STATUS_UNVERSIONED.equals(status)) {
+ if (StatusType.STATUS_UNVERSIONED.equals(status)) {
return FileStatus.UNKNOWN;
}
- else if (SVNStatusType.STATUS_MISSING.equals(status)) {
+ else if (StatusType.STATUS_MISSING.equals(status)) {
return FileStatus.DELETED_FROM_FS;
}
- else if (SVNStatusType.STATUS_EXTERNAL.equals(status)) {
+ else if (StatusType.STATUS_EXTERNAL.equals(status)) {
return SvnFileStatus.EXTERNAL;
}
- else if (SVNStatusType.STATUS_OBSTRUCTED.equals(status)) {
+ else if (StatusType.STATUS_OBSTRUCTED.equals(status)) {
return SvnFileStatus.OBSTRUCTED;
}
- else if (SVNStatusType.STATUS_IGNORED.equals(status)) {
+ else if (StatusType.STATUS_IGNORED.equals(status)) {
return FileStatus.IGNORED;
}
- else if (SVNStatusType.STATUS_ADDED.equals(status)) {
+ else if (StatusType.STATUS_ADDED.equals(status)) {
return FileStatus.ADDED;
}
- else if (SVNStatusType.STATUS_DELETED.equals(status)) {
+ else if (StatusType.STATUS_DELETED.equals(status)) {
return FileStatus.DELETED;
}
- else if (SVNStatusType.STATUS_REPLACED.equals(status)) {
+ else if (StatusType.STATUS_REPLACED.equals(status)) {
return SvnFileStatus.REPLACED;
}
- else if (status == SVNStatusType.STATUS_CONFLICTED) {
+ else if (status == StatusType.STATUS_CONFLICTED) {
return FileStatus.MERGED_WITH_PROPERTY_CONFLICTS;
}
- else if (status == SVNStatusType.STATUS_MODIFIED) {
+ else if (status == StatusType.STATUS_MODIFIED) {
return FileStatus.MODIFIED;
}
return FileStatus.NOT_CHANGED;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnUtil.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnUtil.java
index bd28825..43407f4 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnUtil.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnUtil.java
@@ -45,9 +45,17 @@
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.EventAction;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
+import org.jetbrains.idea.svn.browse.DirectoryEntryConsumer;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.dialogs.LockDialog;
+import org.jetbrains.idea.svn.info.Info;
+import org.jetbrains.idea.svn.status.Status;
import org.tmatesoft.sqljet.core.SqlJetException;
import org.tmatesoft.sqljet.core.table.SqlJetDb;
import org.tmatesoft.svn.core.*;
@@ -99,7 +107,7 @@
}
public static boolean isSvnVersioned(final @NotNull SvnVcs vcs, File parent) {
- final SVNInfo info = vcs.getInfo(parent);
+ final Info info = vcs.getInfo(parent);
return info != null;
}
@@ -157,7 +165,7 @@
@Nullable
public static String getExactLocation(final SvnVcs vcs, File path) {
- SVNInfo info = vcs.getInfo(path);
+ Info info = vcs.getInfo(path);
return info != null && info.getURL() != null ? info.getURL().toString() : null;
}
@@ -182,9 +190,9 @@
final VcsException[] exception = new VcsException[1];
final Collection<String> failedLocks = new ArrayList<String>();
final int[] count = new int[]{ioFiles.length};
- final ISVNEventHandler eventHandler = new ISVNEventHandler() {
- public void handleEvent(SVNEvent event, double progress) {
- if (event.getAction() == SVNEventAction.LOCK_FAILED) {
+ final ProgressTracker eventHandler = new ProgressTracker() {
+ public void consume(ProgressEvent event) {
+ if (event.getAction() == EventAction.LOCK_FAILED) {
failedLocks.add(event.getErrorMessage() != null ?
event.getErrorMessage().getFullMessage() :
event.getFile().getAbsolutePath());
@@ -247,9 +255,9 @@
final VcsException[] exception = new VcsException[1];
final Collection<String> failedUnlocks = new ArrayList<String>();
final int[] count = new int[]{ioFiles.length};
- final ISVNEventHandler eventHandler = new ISVNEventHandler() {
- public void handleEvent(SVNEvent event, double progress) {
- if (event.getAction() == SVNEventAction.UNLOCK_FAILED) {
+ final ProgressTracker eventHandler = new ProgressTracker() {
+ public void consume(ProgressEvent event) {
+ if (event.getAction() == EventAction.UNLOCK_FAILED) {
failedUnlocks.add(event.getErrorMessage() != null ?
event.getErrorMessage().getFullMessage() :
event.getFile().getAbsolutePath());
@@ -398,40 +406,41 @@
@Nullable
public static String getRepositoryUUID(final SvnVcs vcs, final File file) {
- final SVNInfo info = vcs.getInfo(file);
+ final Info info = vcs.getInfo(file);
return info != null ? info.getRepositoryUUID() : null;
}
@Nullable
public static String getRepositoryUUID(final SvnVcs vcs, final SVNURL url) {
try {
- final SVNInfo info = vcs.getInfo(url, SVNRevision.UNDEFINED);
+ final Info info = vcs.getInfo(url, SVNRevision.UNDEFINED);
return (info == null) ? null : info.getRepositoryUUID();
- } catch (SVNException e) {
+ }
+ catch (SvnBindException e) {
return null;
}
}
@Nullable
public static SVNURL getRepositoryRoot(final SvnVcs vcs, final File file) {
- final SVNInfo info = vcs.getInfo(file);
+ final Info info = vcs.getInfo(file);
return info != null ? info.getRepositoryRootURL() : null;
}
@Nullable
public static SVNURL getRepositoryRoot(final SvnVcs vcs, final String url) {
try {
- return getRepositoryRoot(vcs, SVNURL.parseURIEncoded(url));
+ return getRepositoryRoot(vcs, createUrl(url));
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
return null;
}
}
@Nullable
- public static SVNURL getRepositoryRoot(final SvnVcs vcs, final SVNURL url) throws SVNException {
- SVNInfo info = vcs.getInfo(url, SVNRevision.HEAD);
+ public static SVNURL getRepositoryRoot(final SvnVcs vcs, final SVNURL url) throws SvnBindException {
+ Info info = vcs.getInfo(url, SVNRevision.HEAD);
return (info == null) ? null : info.getRepositoryRootURL();
}
@@ -496,17 +505,6 @@
}
@Nullable
- public static String getPathForProgress(final SVNEvent event) {
- if (event.getFile() != null) {
- return event.getFile().getName();
- }
- if (event.getURL() != null) {
- return event.getURL().toString();
- }
- return null;
- }
-
- @Nullable
public static VirtualFile correctRoot(final Project project, final VirtualFile file) {
if (file.getPath().length() == 0) {
// project root
@@ -533,19 +531,19 @@
}
@Nullable
- public static SVNStatus getStatus(@NotNull final SvnVcs vcs, @NotNull final File file) {
+ public static Status getStatus(@NotNull final SvnVcs vcs, @NotNull final File file) {
try {
return vcs.getFactory(file).createStatusClient().doStatus(file, false);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
return null;
}
}
- public static SVNDepth getDepth(final SvnVcs vcs, final File file) {
- SVNInfo info = vcs.getInfo(file);
+ public static Depth getDepth(final SvnVcs vcs, final File file) {
+ Info info = vcs.getInfo(file);
- return info != null && info.getDepth() != null ? info.getDepth() : SVNDepth.UNKNOWN;
+ return info != null && info.getDepth() != null ? info.getDepth() : Depth.UNKNOWN;
}
public static boolean seemsLikeVersionedDir(final VirtualFile file) {
@@ -579,7 +577,7 @@
@Nullable
public static SVNURL getUrl(final SvnVcs vcs, final File file) {
// todo for moved items?
- final SVNInfo info = vcs.getInfo(file);
+ final Info info = vcs.getInfo(file);
return info == null ? null : info.getURL();
}
@@ -587,15 +585,17 @@
public static boolean remoteFolderIsEmpty(final SvnVcs vcs, final String url) throws VcsException {
SvnTarget target = SvnTarget.fromURL(createUrl(url));
final Ref<Boolean> result = new Ref<Boolean>(true);
- ISVNDirEntryHandler handler = new ISVNDirEntryHandler() {
- public void handleDirEntry(final SVNDirEntry dirEntry) throws SVNException {
- if (dirEntry != null) {
+ DirectoryEntryConsumer handler = new DirectoryEntryConsumer() {
+
+ @Override
+ public void consume(final DirectoryEntry entry) throws SVNException {
+ if (entry != null) {
result.set(false);
}
}
};
- vcs.getFactory(target).createBrowseClient().list(target, null, SVNDepth.IMMEDIATES, handler);
+ vcs.getFactory(target).createBrowseClient().list(target, null, Depth.IMMEDIATES, handler);
return result.get();
}
@@ -637,9 +637,7 @@
WorkingCopyFormat format = getFormat(current);
- return WorkingCopyFormat.ONE_DOT_EIGHT.equals(format) || WorkingCopyFormat.ONE_DOT_SEVEN.equals(format)
- ? current
- : getWorkingCopyRoot(file);
+ return format.isOrGreater(WorkingCopyFormat.ONE_DOT_SEVEN) ? current : getWorkingCopyRoot(file);
}
private static File getParentWithDb(File file) {
@@ -695,14 +693,19 @@
}
@NotNull
- public static SVNRevision getHeadRevision(@NotNull SvnVcs vcs, @NotNull SVNURL url) throws SVNException {
- SVNInfo info = vcs.getInfo(url, SVNRevision.HEAD);
+ public static SVNURL removePathTail(@NotNull SVNURL url) throws SvnBindException {
+ return createUrl(SVNPathUtil.removeTail(url.toDecodedString()));
+ }
+
+ @NotNull
+ public static SVNRevision getHeadRevision(@NotNull SvnVcs vcs, @NotNull SVNURL url) throws SvnBindException {
+ Info info = vcs.getInfo(url, SVNRevision.HEAD);
if (info == null) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "Could not get info for " + url));
+ throw new SvnBindException("Could not get info for " + url);
}
if (info.getRevision() == null) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "Could not get revision for " + url));
+ throw new SvnBindException("Could not get revision for " + url);
}
return info.getRevision();
@@ -771,18 +774,18 @@
}
@Nullable
- public static String getChangelistName(@NotNull final SVNStatus status) {
+ public static String getChangelistName(@NotNull final Status status) {
// no explicit check on working copy format supports change lists as they are supported from svn 1.5
// and anyway status.getChangelistName() should just return null if change lists are not supported.
- return SVNNodeKind.FILE.equals(status.getKind()) ? status.getChangelistName() : null;
+ return status.getKind().isFile() ? status.getChangelistName() : null;
}
- public static boolean isUnversionedOrNotFound(@NotNull SVNErrorCode code) {
- return SVNErrorCode.WC_PATH_NOT_FOUND.equals(code) ||
- SVNErrorCode.UNVERSIONED_RESOURCE.equals(code) ||
- SVNErrorCode.WC_NOT_WORKING_COPY.equals(code) ||
+ public static boolean isUnversionedOrNotFound(@NotNull SvnBindException e) {
+ return e.contains(SVNErrorCode.WC_PATH_NOT_FOUND) ||
+ e.contains(SVNErrorCode.UNVERSIONED_RESOURCE) ||
+ e.contains(SVNErrorCode.WC_NOT_WORKING_COPY) ||
// thrown when getting info from repository for non-existent item - like HEAD revision for deleted file
- SVNErrorCode.ILLEGAL_TARGET.equals(code);
+ e.contains(SVNErrorCode.ILLEGAL_TARGET);
}
// TODO: Create custom Target class and implement append there
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java
index ee4233fc..5010ac5 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java
@@ -65,10 +65,12 @@
import org.jetbrains.idea.svn.annotate.SvnAnnotationProvider;
import org.jetbrains.idea.svn.api.ClientFactory;
import org.jetbrains.idea.svn.api.CmdClientFactory;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.api.SvnKitClientFactory;
import org.jetbrains.idea.svn.auth.SvnAuthenticationNotifier;
import org.jetbrains.idea.svn.checkin.SvnCheckinEnvironment;
import org.jetbrains.idea.svn.checkout.SvnCheckoutProvider;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.commandLine.SvnExecutableChecker;
import org.jetbrains.idea.svn.dialogs.SvnBranchPointsCalculator;
import org.jetbrains.idea.svn.dialogs.WCInfo;
@@ -76,14 +78,19 @@
import org.jetbrains.idea.svn.history.SvnChangeList;
import org.jetbrains.idea.svn.history.SvnCommittedChangesProvider;
import org.jetbrains.idea.svn.history.SvnHistoryProvider;
+import org.jetbrains.idea.svn.info.Info;
+import org.jetbrains.idea.svn.info.InfoConsumer;
import org.jetbrains.idea.svn.properties.PropertyClient;
import org.jetbrains.idea.svn.rollback.SvnRollbackEnvironment;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.status.StatusType;
import org.jetbrains.idea.svn.svnkit.SvnKitManager;
import org.jetbrains.idea.svn.update.SvnIntegrateEnvironment;
import org.jetbrains.idea.svn.update.SvnUpdateEnvironment;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.internal.wc.SVNAdminUtil;
-import org.tmatesoft.svn.core.wc.*;
+import org.tmatesoft.svn.core.wc.SVNPropertyData;
+import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -213,6 +220,10 @@
myWorkingCopiesContent.activate();
}
+ /**
+ * TODO: This seems to be related to some issues when upgrading from 1.6 to 1.7. So it is not currently required for 1.8 and later
+ * TODO: formats. And should be removed when 1.6 working copies are no longer supported by IDEA.
+ */
private void cleanup17copies() {
final Runnable callCleanupWorker = new Runnable() {
public void run() {
@@ -251,7 +262,7 @@
public boolean checkCommandLineVersion() {
boolean isValid = true;
- if (!isProject16() && (myConfiguration.isCommandLine() || isProject18())) {
+ if (!isProject16() && (myConfiguration.isCommandLine() || isProject18OrGreater())) {
isValid = myChecker.checkExecutableAndNotifyIfNeeded();
}
@@ -588,30 +599,19 @@
public boolean fileExistsInVcs(FilePath path) {
File file = path.getIOFile();
try {
- SVNStatus status = getFactory(file).createStatusClient().doStatus(file, false);
+ Status status = getFactory(file).createStatusClient().doStatus(file, false);
if (status != null) {
- if (svnStatusIs(status, SVNStatusType.STATUS_ADDED)) {
- return status.isCopied();
- }
- return !(svnStatusIsUnversioned(status) ||
- svnStatusIs(status, SVNStatusType.STATUS_IGNORED) ||
- svnStatusIs(status, SVNStatusType.STATUS_OBSTRUCTED));
+ return status.is(StatusType.STATUS_ADDED)
+ ? status.isCopied()
+ : !status.is(StatusType.STATUS_UNVERSIONED, StatusType.STATUS_IGNORED, StatusType.STATUS_OBSTRUCTED);
}
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
LOG.info(e);
}
return false;
}
- public static boolean svnStatusIsUnversioned(final SVNStatus status) {
- return svnStatusIs(status, SVNStatusType.STATUS_UNVERSIONED);
- }
-
- public static boolean svnStatusIs(final SVNStatus status, @NotNull final SVNStatusType value) {
- return value.equals(status.getNodeStatus()) || value.equals(status.getContentsStatus());
- }
-
@Override
public boolean fileIsUnderVcs(FilePath path) {
final ChangeListManager clManager = ChangeListManager.getInstance(myProject);
@@ -623,33 +623,33 @@
}
@Nullable
- public SVNInfo getInfo(@NotNull SVNURL url,
+ public Info getInfo(@NotNull SVNURL url,
SVNRevision pegRevision,
- SVNRevision revision) throws SVNException {
+ SVNRevision revision) throws SvnBindException {
return getFactory().createInfoClient().doInfo(url, pegRevision, revision);
}
@Nullable
- public SVNInfo getInfo(@NotNull SVNURL url, SVNRevision revision) throws SVNException {
+ public Info getInfo(@NotNull SVNURL url, SVNRevision revision) throws SvnBindException {
return getInfo(url, SVNRevision.UNDEFINED, revision);
}
@Nullable
- public SVNInfo getInfo(@NotNull final VirtualFile file) {
+ public Info getInfo(@NotNull final VirtualFile file) {
return getInfo(new File(file.getPath()));
}
@Nullable
- public SVNInfo getInfo(@NotNull String path) {
+ public Info getInfo(@NotNull String path) {
return getInfo(new File(path));
}
@Nullable
- public SVNInfo getInfo(@NotNull File ioFile) {
+ public Info getInfo(@NotNull File ioFile) {
return getInfo(ioFile, SVNRevision.UNDEFINED);
}
- public void collectInfo(@NotNull Collection<File> files, @Nullable ISVNInfoHandler handler) {
+ public void collectInfo(@NotNull Collection<File> files, @Nullable InfoConsumer handler) {
File first = ContainerUtil.getFirstItem(files);
if (first != null) {
@@ -663,41 +663,42 @@
// TODO: Generally this should be moved in SvnKit info client implementation.
// TODO: Currently left here to have exception logic as in handleInfoException to be applied for each file separately.
for (File file : files) {
- SVNInfo info = getInfo(file);
+ Info info = getInfo(file);
if (handler != null) {
- handler.handleInfo(info);
+ handler.consume(info);
}
}
}
}
catch (SVNException e) {
+ handleInfoException(new SvnBindException(e));
+ }
+ catch (SvnBindException e) {
handleInfoException(e);
}
}
}
@Nullable
- public SVNInfo getInfo(@NotNull File ioFile, @NotNull SVNRevision revision) {
- SVNInfo result = null;
+ public Info getInfo(@NotNull File ioFile, @NotNull SVNRevision revision) {
+ Info result = null;
try {
result = getFactory(ioFile).createInfoClient().doInfo(ioFile, revision);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
handleInfoException(e);
}
return result;
}
- private void handleInfoException(SVNException e) {
- final SVNErrorCode errorCode = e.getErrorMessage().getErrorCode();
-
+ private void handleInfoException(@NotNull SvnBindException e) {
if (!myLogExceptions ||
- SvnUtil.isUnversionedOrNotFound(errorCode) ||
+ SvnUtil.isUnversionedOrNotFound(e) ||
// do not log working copy format vs client version inconsistencies as errors
- SVNErrorCode.WC_UNSUPPORTED_FORMAT.equals(errorCode) ||
- SVNErrorCode.WC_UPGRADE_REQUIRED.equals(errorCode)) {
+ e.contains(SVNErrorCode.WC_UNSUPPORTED_FORMAT) ||
+ e.contains(SVNErrorCode.WC_UPGRADE_REQUIRED)) {
LOG.debug(e);
}
else {
@@ -797,7 +798,7 @@
List<WCInfo> result = new ArrayList<WCInfo>(getAllWcInfos());
for (RootUrlInfo info : getSvnFileUrlMapping().getErrorRoots()) {
- result.add(new WCInfo(info, SvnUtil.isWorkingCopyRoot(info.getIoFile()), SVNDepth.UNKNOWN));
+ result.add(new WCInfo(info, SvnUtil.isWorkingCopyRoot(info.getIoFile()), Depth.UNKNOWN));
}
return result;
@@ -948,14 +949,15 @@
return svnKitManager;
}
- public boolean isProject18() {
- return WorkingCopyFormat.ONE_DOT_EIGHT.equals(getProjectRootFormat());
+ public boolean isProject18OrGreater() {
+ return getProjectRootFormat().isOrGreater(WorkingCopyFormat.ONE_DOT_EIGHT);
}
public boolean isProject16() {
return WorkingCopyFormat.ONE_DOT_SIX.equals(getProjectRootFormat());
}
+ @NotNull
private WorkingCopyFormat getProjectRootFormat() {
return !getProject().isDefault() ? getWorkingCopyFormat(new File(getProject().getBaseDir().getPath())) : WorkingCopyFormat.UNKNOWN;
}
@@ -993,11 +995,11 @@
@NotNull
private ClientFactory getFactory(@NotNull WorkingCopyFormat format, boolean useProjectRootForUnknown) {
- boolean is18 = WorkingCopyFormat.ONE_DOT_EIGHT.equals(format);
+ boolean is18OrGreater = format.isOrGreater(WorkingCopyFormat.ONE_DOT_EIGHT);
boolean is16 = WorkingCopyFormat.ONE_DOT_SIX.equals(format);
boolean isUnknown = WorkingCopyFormat.UNKNOWN.equals(format);
- return is18
+ return is18OrGreater
? cmdClientFactory
: (is16 ? svnKitClientFactory : (useProjectRootForUnknown && isUnknown ? getFactory() : getFactoryFromSettings()));
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/AbstractShowPropertiesDiffAction.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/AbstractShowPropertiesDiffAction.java
index 223c69a..97e6a61 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/AbstractShowPropertiesDiffAction.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/AbstractShowPropertiesDiffAction.java
@@ -40,8 +40,8 @@
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnRevisionNumber;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.history.SvnRepositoryContentRevision;
-import org.jetbrains.idea.svn.properties.PropertyClient;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.wc.ISVNPropertyHandler;
import org.tmatesoft.svn.core.wc.SVNPropertyData;
@@ -276,7 +276,7 @@
final List<SVNPropertyData> lines = new ArrayList<SVNPropertyData>();
final ISVNPropertyHandler propertyHandler = createHandler(revision, lines);
- vcs.getFactory(target).createPropertyClient().list(target, revision, SVNDepth.EMPTY, propertyHandler);
+ vcs.getFactory(target).createPropertyClient().list(target, revision, Depth.EMPTY, propertyHandler);
return toSortedStringPresentation(lines);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CleanupWorker.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CleanupWorker.java
index 7623f08..dc6fb8c 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CleanupWorker.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CleanupWorker.java
@@ -30,10 +30,10 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.tmatesoft.svn.core.SVNCancelException;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
import java.io.File;
import java.util.LinkedList;
@@ -69,9 +69,9 @@
final File path = new File(root.getPath());
indicator.setText(SvnBundle.message("action.Subversion.cleanup.progress.text", path));
- ISVNEventHandler handler = new ISVNEventHandler() {
+ ProgressTracker handler = new ProgressTracker() {
@Override
- public void handleEvent(SVNEvent event, double progress) throws SVNException {
+ public void consume(ProgressEvent event) throws SVNException {
}
@Override
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CreateBranchOrTagAction.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CreateBranchOrTagAction.java
index 7655751..c6f6334 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CreateBranchOrTagAction.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CreateBranchOrTagAction.java
@@ -37,6 +37,7 @@
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.checkin.CommitEventHandler;
import org.jetbrains.idea.svn.checkin.IdeaCommitHandler;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.dialogs.CreateBranchOrTagDialog;
import org.jetbrains.idea.svn.update.AutoSvnUpdater;
import org.jetbrains.idea.svn.update.SingleRootSwitcher;
@@ -86,17 +87,17 @@
srcUrl = SVNURL.parseURIEncoded(dialog.getCopyFromUrl());
dstSvnUrl = SVNURL.parseURIEncoded(dstURL);
parentUrl = dstSvnUrl.removePathTail();
-
- if (!dirExists(activeVcs, parentUrl)) {
- int rc = Messages.showYesNoDialog(project, "The repository path '" + parentUrl + "' does not exist. Would you like to create it?",
- "Branch or Tag", Messages.getQuestionIcon());
- if (rc == Messages.NO) {
- return;
- }
- }
}
catch (SVNException e) {
- throw new VcsException(e);
+ throw new SvnBindException(e);
+ }
+
+ if (!dirExists(activeVcs, parentUrl)) {
+ int rc = Messages.showYesNoDialog(project, "The repository path '" + parentUrl + "' does not exist. Would you like to create it?",
+ "Branch or Tag", Messages.getQuestionIcon());
+ if (rc == Messages.NO) {
+ return;
+ }
}
Runnable copyCommand = new Runnable() {
@@ -145,8 +146,8 @@
}
}
- private static boolean dirExists(@NotNull final SvnVcs vcs, @NotNull final SVNURL url) throws SVNException {
- final Ref<SVNException> excRef = new Ref<SVNException>();
+ private static boolean dirExists(@NotNull final SvnVcs vcs, @NotNull final SVNURL url) throws SvnBindException {
+ final Ref<SvnBindException> excRef = new Ref<SvnBindException>();
final Ref<Boolean> resultRef = new Ref<Boolean>(Boolean.TRUE);
final Runnable taskImpl = new Runnable() {
@@ -154,8 +155,8 @@
try {
vcs.getInfo(url, SVNRevision.HEAD);
}
- catch (SVNException e) {
- if (e.getErrorMessage().getErrorCode().equals(SVNErrorCode.RA_ILLEGAL_URL)) {
+ catch (SvnBindException e) {
+ if (e.contains(SVNErrorCode.RA_ILLEGAL_URL)) {
resultRef.set(Boolean.FALSE);
}
else {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CreateExternalAction.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CreateExternalAction.java
index b65332a..31206ee 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CreateExternalAction.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/CreateExternalAction.java
@@ -18,7 +18,6 @@
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
-import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.progress.Task;
@@ -38,11 +37,13 @@
import org.jetbrains.idea.svn.SvnPropertyKeys;
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.api.ClientFactory;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.dialogs.SelectCreateExternalTargetDialog;
import org.jetbrains.idea.svn.update.UpdateClient;
import org.tmatesoft.svn.core.SVNCancelException;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNPropertyValue;
import org.tmatesoft.svn.core.internal.wc.SVNExternal;
@@ -100,9 +101,9 @@
if (checkout) {
// +-
final UpdateClient client = vcs.getFactory(ioFile).createUpdateClient();
- client.setEventHandler(new ISVNEventHandler() {
+ client.setEventHandler(new ProgressTracker() {
@Override
- public void handleEvent(SVNEvent event, double progress) throws SVNException {
+ public void consume(ProgressEvent event) throws SVNException {
}
@Override
@@ -111,7 +112,7 @@
if (pi != null && pi.isCanceled()) throw new SVNCancelException();
}
});
- client.doUpdate(ioFile, SVNRevision.HEAD, SVNDepth.UNKNOWN, false, false);
+ client.doUpdate(ioFile, SVNRevision.HEAD, Depth.UNKNOWN, false, false);
vf.refresh(true, true, new Runnable() {
@Override
public void run() {
@@ -148,7 +149,7 @@
} else {
newValue = createExternalDefinitionString(url, target);
}
- factory.createPropertyClient().setProperty(ioFile, SvnPropertyKeys.SVN_EXTERNALS, SVNPropertyValue.create(newValue), SVNDepth.EMPTY,
+ factory.createPropertyClient().setProperty(ioFile, SvnPropertyKeys.SVN_EXTERNALS, SVNPropertyValue.create(newValue), Depth.EMPTY,
false);
return false;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkLocallyDeletedTreeConflictResolvedAction.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkLocallyDeletedTreeConflictResolvedAction.java
index 1079326..2e400ad 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkLocallyDeletedTreeConflictResolvedAction.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkLocallyDeletedTreeConflictResolvedAction.java
@@ -36,7 +36,7 @@
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnLocallyDeletedChange;
import org.jetbrains.idea.svn.SvnVcs;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
import java.util.Collections;
import java.util.List;
@@ -93,7 +93,7 @@
SvnVcs vcs = SvnVcs.getInstance(project);
try {
- vcs.getFactory(path.getIOFile()).createConflictClient().resolve(path.getIOFile(), SVNDepth.EMPTY, false, false, true);
+ vcs.getFactory(path.getIOFile()).createConflictClient().resolve(path.getIOFile(), Depth.EMPTY, false, false, true);
}
catch (VcsException e) {
exception.set(e);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkResolvedAction.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkResolvedAction.java
index d20b5f1..6d51d9d 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkResolvedAction.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkResolvedAction.java
@@ -33,12 +33,15 @@
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnStatusUtil;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.conflict.ConflictClient;
import org.jetbrains.idea.svn.dialogs.SelectFilesDialog;
+import org.jetbrains.idea.svn.status.Status;
import org.jetbrains.idea.svn.status.StatusClient;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.*;
+import org.jetbrains.idea.svn.status.StatusConsumer;
+import org.jetbrains.idea.svn.status.StatusType;
+import org.tmatesoft.svn.core.wc.SVNRevision;
import java.io.File;
import java.util.Collection;
@@ -98,7 +101,7 @@
ConflictClient client = vcs.getFactory(ioFile).createConflictClient();
// TODO: Probably false should be passed to "resolveTree", but previous logic used true implicitly
- client.resolve(ioFile, SVNDepth.EMPTY, true, true, true);
+ client.resolve(ioFile, Depth.EMPTY, true, true, true);
}
}
finally {
@@ -124,16 +127,17 @@
File path = new File(file.getPath());
StatusClient client = vcs.getFactory(path).createStatusClient();
- client.doStatus(path, true, false, false, false, new ISVNStatusHandler() {
- public void handleStatus(SVNStatus status) {
- if (status.getContentsStatus() == SVNStatusType.STATUS_CONFLICTED ||
- status.getPropertiesStatus() == SVNStatusType.STATUS_CONFLICTED) {
+ client.doStatus(path, SVNRevision.UNDEFINED, Depth.INFINITY, false, false, false, false, new StatusConsumer() {
+ @Override
+ public void consume(Status status) {
+ if (status.getContentsStatus() == StatusType.STATUS_CONFLICTED ||
+ status.getPropertiesStatus() == StatusType.STATUS_CONFLICTED) {
target.add(status.getFile().getAbsolutePath());
}
}
- });
+ }, null);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
LOG.warn(e);
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkTreeConflictResolvedAction.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkTreeConflictResolvedAction.java
index 73d9c28..10330de 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkTreeConflictResolvedAction.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkTreeConflictResolvedAction.java
@@ -37,7 +37,7 @@
import org.jetbrains.idea.svn.ConflictedSvnChange;
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnVcs;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
import java.util.ArrayList;
import java.util.Collection;
@@ -114,7 +114,7 @@
SvnVcs vcs = SvnVcs.getInstance(checker.getProject());
try {
- vcs.getFactory(path.getIOFile()).createConflictClient().resolve(path.getIOFile(), SVNDepth.EMPTY, false, false, true);
+ vcs.getFactory(path.getIOFile()).createConflictClient().resolve(path.getIOFile(), Depth.EMPTY, false, false, true);
}
catch (VcsException e) {
exception.set(e);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/RelocateAction.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/RelocateAction.java
index 87615a0..af601f3 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/RelocateAction.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/RelocateAction.java
@@ -28,7 +28,7 @@
import org.jetbrains.idea.svn.SvnStatusUtil;
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.dialogs.RelocateDialog;
-import org.tmatesoft.svn.core.wc.SVNInfo;
+import org.jetbrains.idea.svn.info.Info;
import java.io.File;
@@ -49,7 +49,7 @@
}
protected void perform(final Project project, final SvnVcs activeVcs, final VirtualFile file, DataContext context) throws VcsException {
- SVNInfo info = activeVcs.getInfo(file);
+ Info info = activeVcs.getInfo(file);
assert info != null;
RelocateDialog dlg = new RelocateDialog(project, info.getURL());
dlg.show();
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SetPropertyAction.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SetPropertyAction.java
index 3f740ba..cdc738c 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SetPropertyAction.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SetPropertyAction.java
@@ -27,9 +27,9 @@
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.dialogs.SetPropertyDialog;
import org.jetbrains.idea.svn.properties.PropertyClient;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNPropertyValue;
import java.io.File;
@@ -79,7 +79,7 @@
// TODO: most likely SVNDepth.getInfinityOrEmptyDepth should be used instead of SVNDepth.fromRecursive - to have either "infinity"
// TODO: or "empty" depth, and not "infinity" or "files" depth. But previous logic used SVNDepth.fromRecursive implicitly
- client.setProperty(ioFile, name, SVNPropertyValue.create(value), SVNDepth.fromRecurse(recursive), false);
+ client.setProperty(ioFile, name, SVNPropertyValue.create(value), Depth.allOrFiles(recursive), false);
}
for(int i = 0; i < file.length; i++) {
if (recursive && file[i].isDirectory()) {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/ShareProjectAction.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/ShareProjectAction.java
index 7f648dc..012a870 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/ShareProjectAction.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/ShareProjectAction.java
@@ -35,9 +35,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.*;
import org.jetbrains.idea.svn.api.ClientFactory;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.checkout.SvnCheckoutProvider;
import org.jetbrains.idea.svn.dialogs.ShareDialog;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNRevision;
@@ -167,7 +167,7 @@
final ClientFactory factory = SvnCheckoutProvider.getFactory(activeVcs, format);
factory.createCheckoutClient()
- .checkout(SvnTarget.fromURL(checkoutUrl), path, revision, SVNDepth.INFINITY, false, false, format, null);
+ .checkout(SvnTarget.fromURL(checkoutUrl), path, revision, Depth.INFINITY, false, false, format, null);
addRecursively(activeVcs, factory, file);
} catch (SVNException e) {
error[0] = e;
@@ -254,9 +254,9 @@
indicator.checkCanceled();
indicator.setText(SvnBundle.message("share.or.import.add.progress.text", virtualFile.getPath()));
}
- factory.createAddClient().add(ioFile, SVNDepth.EMPTY, false, false, true, null);
+ factory.createAddClient().add(ioFile, Depth.EMPTY, false, false, true, null);
}
- }, SVNDepth.INFINITY);
+ }, Depth.INFINITY);
operation.execute(file);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SvnExcludingIgnoredOperation.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SvnExcludingIgnoredOperation.java
index 49fdc02..c206cd3 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SvnExcludingIgnoredOperation.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SvnExcludingIgnoredOperation.java
@@ -26,14 +26,14 @@
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileVisitor;
import org.jetbrains.annotations.NotNull;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
public class SvnExcludingIgnoredOperation {
private final Operation myImportAction;
- private final SVNDepth myDepth;
+ private final Depth myDepth;
private final Filter myFilter;
- public SvnExcludingIgnoredOperation(final Project project, final Operation importAction, final SVNDepth depth) {
+ public SvnExcludingIgnoredOperation(final Project project, final Operation importAction, final Depth depth) {
myImportAction = importAction;
myDepth = depth;
@@ -48,17 +48,18 @@
public Filter(final Project project) {
myProject = project;
- if (! project.isDefault()) {
+ if (!project.isDefault()) {
myIndex = PeriodicalTasksCloser.getInstance().safeGetService(project, FileIndexFacade.class);
myClManager = ChangeListManager.getInstance(project);
- } else {
+ }
+ else {
myIndex = null;
myClManager = null;
}
}
public boolean accept(final VirtualFile file) {
- if (! myProject.isDefault()) {
+ if (!myProject.isDefault()) {
if (isExcluded(file)) {
return false;
}
@@ -80,7 +81,7 @@
}
private boolean operation(final VirtualFile file) throws VcsException {
- if (! myFilter.accept(file)) return false;
+ if (!myFilter.accept(file)) return false;
myImportAction.doOperation(file);
return true;
@@ -101,21 +102,21 @@
}
public void execute(final VirtualFile file) throws VcsException {
- if (SVNDepth.INFINITY.equals(myDepth)) {
+ if (Depth.INFINITY.equals(myDepth)) {
executeDown(file);
return;
}
- if (! operation(file)) {
+ if (!operation(file)) {
return;
}
- if (SVNDepth.EMPTY.equals(myDepth)) {
+ if (Depth.EMPTY.equals(myDepth)) {
return;
}
for (VirtualFile child : file.getChildren()) {
- if (SVNDepth.FILES.equals(myDepth) && child.isDirectory()) {
+ if (Depth.FILES.equals(myDepth) && child.isDirectory()) {
continue;
}
operation(child);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SvnMergeProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SvnMergeProvider.java
index a4d71ce..912bd97 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SvnMergeProvider.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/actions/SvnMergeProvider.java
@@ -29,8 +29,9 @@
import org.jetbrains.idea.svn.SvnRevisionNumber;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.info.Info;
import org.jetbrains.idea.svn.properties.PropertyClient;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNProperty;
import org.tmatesoft.svn.core.SVNPropertyValue;
import org.tmatesoft.svn.core.wc.*;
@@ -64,7 +65,7 @@
File workingFile = null;
boolean mergeCase = false;
SvnVcs vcs = SvnVcs.getInstance(myProject);
- SVNInfo info = vcs.getInfo(file);
+ Info info = vcs.getInfo(file);
if (info != null) {
oldFile = info.getConflictOldFile();
@@ -142,7 +143,7 @@
File path = new File(file.getPath());
try {
// TODO: Probably false should be passed to "resolveTree", but previous logic used true implicitly
- vcs.getFactory(path).createConflictClient().resolve(path, SVNDepth.EMPTY, false, true, true);
+ vcs.getFactory(path).createConflictClient().resolve(path, Depth.EMPTY, false, true, true);
}
catch (VcsException e) {
LOG.warn(e);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/add/AddClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/add/AddClient.java
index 718a56d..872e290 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/add/AddClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/add/AddClient.java
@@ -3,9 +3,9 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import java.io.File;
@@ -15,9 +15,9 @@
public interface AddClient extends SvnClient {
void add(@NotNull File file,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean makeParents,
boolean includeIgnored,
boolean force,
- @Nullable ISVNEventHandler handler) throws VcsException;
+ @Nullable ProgressTracker handler) throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/add/CmdAddClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/add/CmdAddClient.java
index 4811e32..6894800 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/add/CmdAddClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/add/CmdAddClient.java
@@ -4,15 +4,12 @@
import com.intellij.util.containers.Convertor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.jetbrains.idea.svn.api.FileStatusResultParser;
+import org.jetbrains.idea.svn.api.*;
import org.jetbrains.idea.svn.commandLine.CommandExecutor;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -33,11 +30,11 @@
@Override
public void add(@NotNull File file,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean makeParents,
boolean includeIgnored,
boolean force,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable ProgressTracker handler) throws VcsException {
List<String> parameters = prepareParameters(file, depth, makeParents, includeIgnored, force);
// TODO: handler should be called in parallel with command execution, but this will be in other thread
@@ -48,7 +45,7 @@
parser.parse(command.getOutput());
}
- private static List<String> prepareParameters(File file, SVNDepth depth, boolean makeParents, boolean includeIgnored, boolean force) {
+ private static List<String> prepareParameters(File file, Depth depth, boolean makeParents, boolean includeIgnored, boolean force) {
List<String> parameters = new ArrayList<String>();
CommandUtil.put(parameters, file);
@@ -60,14 +57,13 @@
return parameters;
}
- private static class AddStatusConvertor implements Convertor<Matcher, SVNEvent> {
+ private static class AddStatusConvertor implements Convertor<Matcher, ProgressEvent> {
@Override
- public SVNEvent convert(Matcher o) {
- SVNStatusType contentStatus = CommandUtil.getStatusType(o.group(1));
+ public ProgressEvent convert(Matcher o) {
+ StatusType contentStatus = CommandUtil.getStatusType(o.group(1));
String path = o.group(3);
- return new SVNEvent(new File(path), null, null, 0, contentStatus, null, null, null, null, null, null, null,
- null, null, null);
+ return new ProgressEvent(new File(path), 0, contentStatus, null, null, null, null);
}
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/add/SvnKitAddClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/add/SvnKitAddClient.java
index 66e122d..7b05f0b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/add/SvnKitAddClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/add/SvnKitAddClient.java
@@ -4,9 +4,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNWCClient;
import java.io.File;
@@ -22,19 +22,19 @@
*/
@Override
public void add(@NotNull File file,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean makeParents,
boolean includeIgnored,
boolean force,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable ProgressTracker handler) throws VcsException {
try {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
- client.setEventHandler(handler);
+ client.setEventHandler(toEventHandler(handler));
client.doAdd(file, force,
false, // directory should already be created
makeParents, // not used but will be passed as makeParents value
- SVNDepth.recurseFromDepth(depth));
+ Depth.isRecursive(depth));
}
catch (SVNException e) {
throw new VcsException(e);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/AnnotateClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/AnnotateClient.java
index df30cfd..90be057 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/AnnotateClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/AnnotateClient.java
@@ -4,8 +4,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.wc.ISVNAnnotateHandler;
-import org.tmatesoft.svn.core.wc.SVNDiffOptions;
+import org.jetbrains.idea.svn.diff.DiffOptions;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -19,6 +18,6 @@
@NotNull SVNRevision endRevision,
@Nullable SVNRevision pegRevision,
boolean includeMergedRevisions,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable ISVNAnnotateHandler handler) throws VcsException;
+ @Nullable DiffOptions diffOptions,
+ @Nullable AnnotationConsumer handler) throws VcsException;
}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkDataHolder.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/AnnotationConsumer.java
similarity index 63%
rename from platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkDataHolder.java
rename to plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/AnnotationConsumer.java
index b4f837c..8d33be2 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkDataHolder.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/AnnotationConsumer.java
@@ -13,18 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package org.jetbrains.idea.svn.annotate;
-import com.intellij.remote.RemoteSdkCredentialsHolder;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.checkin.CommitInfo;
+import org.tmatesoft.svn.core.SVNException;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author Konstantin Kolosovsky.
*/
-public class RemoteSdkDataHolder extends RemoteSdkCredentialsHolder {
- public RemoteSdkDataHolder(@NotNull String defaultHelpersDirName) {
- super(defaultHelpersDirName);
- }
+public interface AnnotationConsumer {
+
+ void consume(int lineNumber, @NotNull CommitInfo info, @Nullable CommitInfo mergeInfo) throws SVNException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/BaseSvnFileAnnotation.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/BaseSvnFileAnnotation.java
index f4fa9f9..00a529e 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/BaseSvnFileAnnotation.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/BaseSvnFileAnnotation.java
@@ -19,6 +19,7 @@
import com.intellij.openapi.vcs.annotate.*;
import com.intellij.openapi.vcs.history.VcsFileRevision;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
+import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.text.DateFormatUtil;
import com.intellij.xml.util.XmlStringUtil;
import org.jetbrains.annotations.NotNull;
@@ -27,6 +28,7 @@
import org.jetbrains.idea.svn.SvnConfiguration;
import org.jetbrains.idea.svn.SvnRevisionNumber;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.checkin.CommitInfo;
import org.jetbrains.idea.svn.history.SvnFileRevision;
import org.tmatesoft.svn.core.wc.SVNRevision;
@@ -46,27 +48,19 @@
protected final SvnVcs myVcs;
private final Map<Long, SvnFileRevision> myRevisionMap = new HashMap<Long, SvnFileRevision>();
- private final LineAnnotationAspect DATE_ASPECT = new SvnAnnotationAspect(SvnAnnotationAspect.DATE, true) {
- public String getValue(int lineNumber) {
- if (myInfos.size() <= lineNumber || lineNumber < 0) {
- return "";
- }
- else {
- final LineInfo lineInfo = myInfos.get(lineNumber);
- return (lineInfo == null) ? "" : DateFormatUtil.formatPrettyDate(lineInfo.getDate());
- }
+ private final LineAnnotationAspect DATE_ASPECT = new SvnAnnotationAspect(LineAnnotationAspect.DATE, true) {
+
+ @Override
+ public String getValue(@NotNull CommitInfo info) {
+ return DateFormatUtil.formatPrettyDate(info.getDate());
}
};
- private final LineAnnotationAspect REVISION_ASPECT = new SvnAnnotationAspect(SvnAnnotationAspect.REVISION, false) {
- public String getValue(int lineNumber) {
- if (myInfos.size() <= lineNumber || lineNumber < 0) {
- return "";
- }
- else {
- final long revision = getRevision(lineNumber);
- return (revision == -1) ? "" : String.valueOf(revision);
- }
+ private final LineAnnotationAspect REVISION_ASPECT = new SvnAnnotationAspect(LineAnnotationAspect.REVISION, false) {
+
+ @Override
+ public String getValue(@NotNull CommitInfo info) {
+ return String.valueOf(info.getRevision());
}
};
@@ -84,31 +78,25 @@
@Override
public String getTooltipText(int lineNumber) {
- if (myInfos.size() <= lineNumber || lineNumber < 0) {
- return "";
- }
- final LineInfo info = myInfos.get(lineNumber);
+ // TODO: Check what is the difference in returning "" or null
+ if (!myInfos.isValid(lineNumber)) return "";
+
+ CommitInfo info = myInfos.get(lineNumber);
if (info == null) return null;
- SvnFileRevision svnRevision = myRevisionMap.get(info.getRevision());
- if (svnRevision != null) {
- final String tooltip = "Revision " + info.getRevision() + ": " + svnRevision.getCommitMessage();
- return XmlStringUtil.escapeString(tooltip);
- }
- return "";
+
+ SvnFileRevision revision = myRevisionMap.get(info.getRevision());
+ return revision != null ? XmlStringUtil.escapeString("Revision " + info.getRevision() + ": " + revision.getCommitMessage()) : "";
}
};
- private final LineAnnotationAspect AUTHOR_ASPECT = new SvnAnnotationAspect(SvnAnnotationAspect.AUTHOR, true) {
- public String getValue(int lineNumber) {
- if (myInfos.size() <= lineNumber || lineNumber < 0) {
- return "";
- }
- else {
- final LineInfo lineInfo = myInfos.get(lineNumber);
- return (lineInfo == null) ? "" : lineInfo.getAuthor();
- }
+ private final LineAnnotationAspect AUTHOR_ASPECT = new SvnAnnotationAspect(LineAnnotationAspect.AUTHOR, true) {
+
+ @Override
+ public String getValue(@NotNull CommitInfo info) {
+ return info.getAuthor();
}
};
+
private final SvnConfiguration myConfiguration;
private boolean myShowMergeSources;
// null if full annotation
@@ -118,10 +106,6 @@
myRevisionMap.put(revision, svnRevision);
}
- public void clearRevisions() {
- myRevisionMap.clear();
- }
-
public SvnFileRevision getRevision(final long revision) {
return myRevisionMap.get(revision);
}
@@ -134,30 +118,6 @@
return myFirstRevisionNumber;
}
- static class LineInfo {
- private final Date myDate;
- private final long myRevision;
- private final String myAuthor;
-
- public LineInfo(final Date date, final long revision, final String author) {
- myDate = date;
- myRevision = revision;
- myAuthor = author;
- }
-
- public Date getDate() {
- return myDate;
- }
-
- public long getRevision() {
- return myRevision;
- }
-
- public String getAuthor() {
- return myAuthor;
- }
- }
-
public BaseSvnFileAnnotation(final SvnVcs vcs, final String contents, final VcsRevisionNumber baseRevision) {
super(vcs.getProject());
myVcs = vcs;
@@ -174,18 +134,14 @@
}
public String getToolTip(final int lineNumber) {
- if (myInfos.size() <= lineNumber || lineNumber < 0) {
- return "";
- }
- final LineInfo info = myInfos.get(lineNumber);
+ final CommitInfo info = myInfos.getOrNull(lineNumber);
if (info == null) return "";
- SvnFileRevision svnRevision = myRevisionMap.get(info.getRevision());
- if (svnRevision != null) {
- if (myInfos.getAnnotationSource(lineNumber).showMerged()) {
- return "Merge source revision " + info.getRevision() + ": " + svnRevision.getCommitMessage();
- } else {
- return "Revision " + info.getRevision() + ": " + svnRevision.getCommitMessage();
- }
+
+ SvnFileRevision revision = myRevisionMap.get(info.getRevision());
+ if (revision != null) {
+ String prefix = myInfos.getAnnotationSource(lineNumber).showMerged() ? "Merge source revision" : "Revision";
+
+ return prefix + " " + info.getRevision() + ": " + revision.getCommitMessage();
}
return "";
}
@@ -194,53 +150,35 @@
return myContents;
}
- public void setLineInfo(final int lineNumber, final Date date, final long revision, final String author,
- @Nullable final Date mergeDate, final long mergeRevision, @Nullable final String mergeAuthor) {
- myInfos.appendNumberedLineInfo(lineNumber, date, revision, author, mergeDate, mergeRevision, mergeAuthor);
- }
-
- public void appendLineInfo(final Date date, final long revision, final String author,
- @Nullable final Date mergeDate, final long mergeRevision, @Nullable final String mergeAuthor) {
- myInfos.appendNumberedLineInfo(date, revision, author, mergeDate, mergeRevision, mergeAuthor);
+ public void setLineInfo(int lineNumber, @NotNull CommitInfo info, @Nullable CommitInfo mergeInfo) {
+ myInfos.appendNumberedLineInfo(lineNumber, info, mergeInfo);
}
@Nullable
public VcsRevisionNumber originalRevision(final int lineNumber) {
- if (myInfos.size() <= lineNumber || lineNumber < 0) {
- return null;
- }
- final SvnFileRevision revision = myRevisionMap.get(myInfos.originalRevision(lineNumber));
- return revision == null ? null : revision.getRevisionNumber();
+ SvnFileRevision revision = myInfos.isValid(lineNumber) ? myRevisionMap.get(myInfos.originalRevision(lineNumber)) : null;
+
+ return revision != null ? revision.getRevisionNumber() : null;
}
public VcsRevisionNumber getLineRevisionNumber(final int lineNumber) {
- if (myInfos.size() <= lineNumber || lineNumber < 0) {
- return null;
- }
- final LineInfo info = myInfos.get(lineNumber);
- if (info == null) return null;
- final long revision = info.getRevision();
- if (revision >= 0) {
- return new SvnRevisionNumber(SVNRevision.create(revision));
- }
- return null;
+ CommitInfo info = myInfos.getOrNull(lineNumber);
+
+ return info != null && info.getRevision() >= 0 ? new SvnRevisionNumber(SVNRevision.create(info.getRevision())) : null;
}
@Override
public Date getLineDate(int lineNumber) {
- if (myInfos.size() <= lineNumber || lineNumber < 0) {
- return null;
- }
- final LineInfo info = myInfos.get(lineNumber);
- if (info == null) return null;
- return info.getDate();
+ CommitInfo info = myInfos.getOrNull(lineNumber);
+
+ return info != null ? info.getDate() : null;
}
public List<VcsFileRevision> getRevisions() {
final List<VcsFileRevision> result = new ArrayList<VcsFileRevision>(myRevisionMap.values());
Collections.sort(result, new Comparator<VcsFileRevision>() {
public int compare(final VcsFileRevision o1, final VcsFileRevision o2) {
- return -1 * o1.getRevisionNumber().compareTo(o2.getRevisionNumber());
+ return o2.getRevisionNumber().compareTo(o1.getRevisionNumber());
}
});
return result;
@@ -250,10 +188,6 @@
return ! myRevisionMap.isEmpty();
}
- public int getNumLines() {
- return myInfos.size();
- }
-
@Nullable
public AnnotationSourceSwitcher getAnnotationSourceSwitcher() {
if (! myShowMergeSources) return null;
@@ -285,7 +219,7 @@
@Override
public int getLineCount() {
- return getNumLines();
+ return myInfos.size();
}
@Override
@@ -294,44 +228,52 @@
}
private abstract class SvnAnnotationAspect extends LineAnnotationAspectAdapter {
+
public SvnAnnotationAspect(String id, boolean showByDefault) {
super(id, showByDefault);
}
protected long getRevision(final int lineNum) {
- final LineInfo lineInfo = myInfos.get(lineNum);
+ final CommitInfo lineInfo = myInfos.get(lineNum);
return (lineInfo == null) ? -1 : lineInfo.getRevision();
}
@Override
protected void showAffectedPaths(int lineNum) {
- if (lineNum >= 0 && lineNum < myInfos.size()) {
+ if (myInfos.isValid(lineNum)) {
final long revision = getRevision(lineNum);
if (revision >= 0) {
showAllAffectedPaths(new SvnRevisionNumber(SVNRevision.create(revision)));
}
}
}
+
+ @Override
+ public String getValue(int lineNumber) {
+ CommitInfo info = myInfos.getOrNull(lineNumber);
+
+ return info == null ? "" : getValue(info);
+ }
+
+ public String getValue(@NotNull CommitInfo info) {
+ return "";
+ }
}
protected abstract void showAllAffectedPaths(SvnRevisionNumber number);
private static class MyPartiallyCreatedInfos {
private boolean myShowMergeSource;
- private final Map<Integer, LineInfo> myMappedLineInfo;
- private final Map<Integer, LineInfo> myMergeSourceInfos;
+ private final Map<Integer, CommitInfo> myMappedLineInfo;
+ private final Map<Integer, CommitInfo> myMergeSourceInfos;
private int myMaxIdx;
private MyPartiallyCreatedInfos() {
- myMergeSourceInfos = new HashMap<Integer, LineInfo>();
- myMappedLineInfo = new HashMap<Integer, LineInfo>();
+ myMergeSourceInfos = ContainerUtil.newHashMap();
+ myMappedLineInfo = ContainerUtil.newHashMap();
myMaxIdx = 0;
}
- boolean isShowMergeSource() {
- return myShowMergeSource;
- }
-
void setShowMergeSource(boolean showMergeSource) {
myShowMergeSource = showMergeSource;
}
@@ -340,25 +282,18 @@
return myMaxIdx + 1;
}
- void appendNumberedLineInfo(final Date date, final long revision, final String author,
- @Nullable final Date mergeDate, final long mergeRevision, @Nullable final String mergeAuthor) {
- appendNumberedLineInfo(myMaxIdx + 1, date, revision, author, mergeDate, mergeRevision, mergeAuthor);
- }
-
- void appendNumberedLineInfo(final int lineNumber, final Date date, final long revision, final String author,
- @Nullable final Date mergeDate, final long mergeRevision, @Nullable final String mergeAuthor) {
- if (date == null) return;
+ void appendNumberedLineInfo(final int lineNumber, @NotNull CommitInfo info, @Nullable CommitInfo mergeInfo) {
if (myMappedLineInfo.get(lineNumber) != null) return;
myMaxIdx = (myMaxIdx < lineNumber) ? lineNumber : myMaxIdx;
- myMappedLineInfo.put(lineNumber, new LineInfo(date, revision, author));
- if (mergeDate != null) {
- myMergeSourceInfos.put(lineNumber, new LineInfo(mergeDate, mergeRevision, mergeAuthor));
+ myMappedLineInfo.put(lineNumber, info);
+ if (mergeInfo != null) {
+ myMergeSourceInfos.put(lineNumber, mergeInfo);
}
}
- LineInfo get(final int idx) {
+ CommitInfo get(final int idx) {
if (myShowMergeSource) {
- final LineInfo lineInfo = myMergeSourceInfos.get(idx);
+ final CommitInfo lineInfo = myMergeSourceInfos.get(idx);
if (lineInfo != null) {
return lineInfo;
}
@@ -366,14 +301,23 @@
return myMappedLineInfo.get(idx);
}
+ @Nullable
+ CommitInfo getOrNull(int lineNumber) {
+ return isValid(lineNumber) ? get(lineNumber) : null;
+ }
+
+ private boolean isValid(int lineNumber) {
+ return lineNumber >= 0 && lineNumber < size();
+ }
+
AnnotationSource getAnnotationSource(final int line) {
return myShowMergeSource ? AnnotationSource.getInstance(myMergeSourceInfos.containsKey(line)) : AnnotationSource.LOCAL;
}
public long originalRevision(final int line) {
- if (line >= size()) return -1;
- final LineInfo lineInfo = myMappedLineInfo.get(line);
- return lineInfo == null ? -1 : lineInfo.getRevision();
+ CommitInfo info = line < size() ? myMappedLineInfo.get(line) : null;
+
+ return info == null ? -1 : info.getRevision();
}
public boolean mergeSourceAvailable(int lineNumber) {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/CmdAnnotateClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/CmdAnnotateClient.java
index 5cb18a3..b48f14a 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/CmdAnnotateClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/CmdAnnotateClient.java
@@ -4,12 +4,12 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.checkin.CommitInfo;
import org.jetbrains.idea.svn.commandLine.CommandExecutor;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
+import org.jetbrains.idea.svn.diff.DiffOptions;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNAnnotateHandler;
-import org.tmatesoft.svn.core.wc.SVNDiffOptions;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -18,7 +18,6 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
-import java.util.Date;
import java.util.List;
/**
@@ -32,8 +31,8 @@
@NotNull SVNRevision endRevision,
@Nullable SVNRevision pegRevision,
boolean includeMergedRevisions,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable final ISVNAnnotateHandler handler) throws VcsException {
+ @Nullable DiffOptions diffOptions,
+ @Nullable final AnnotationConsumer handler) throws VcsException {
List<String> parameters = new ArrayList<String>();
CommandUtil.put(parameters, target.getPathOrUrlString(), pegRevision);
parameters.add("--revision");
@@ -47,7 +46,7 @@
parseOutput(command.getOutput(), handler);
}
- public void parseOutput(@NotNull String output, @Nullable ISVNAnnotateHandler handler) throws VcsException {
+ public void parseOutput(@NotNull String output, @Nullable AnnotationConsumer handler) throws VcsException {
try {
BlameInfo info = CommandUtil.parse(output, BlameInfo.class);
@@ -65,12 +64,11 @@
}
}
- private static void invokeHandler(ISVNAnnotateHandler handler, LineEntry entry) throws SVNException {
- // line numbers in our api start from 0 - not from 1 like in svn output
- // "line" value is not used in handlers - so null is passed
- handler
- .handleLine(entry.date(), entry.revision(), entry.author(), null, entry.mergedDate(), entry.mergedRevision(), entry.mergedAuthor(),
- entry.mergedPath(), entry.lineNumber - 1);
+ private static void invokeHandler(@NotNull AnnotationConsumer handler, @NotNull LineEntry entry) throws SVNException {
+ if (entry.commit != null) {
+ // line numbers in our api start from 0 - not from 1 like in svn output
+ handler.consume(entry.lineNumber - 1, entry.commit.build(), entry.mergedCommit());
+ }
}
@XmlRootElement(name = "blame")
@@ -91,70 +89,15 @@
@XmlAttribute(name = "line-number")
public int lineNumber;
- @XmlElement(name = "commit")
- public CommitEntry commit;
+ public CommitInfo.Builder commit;
@XmlElement(name = "merged")
public MergedEntry merged;
- public long revision() {
- return revision(commit);
- }
-
@Nullable
- public String author() {
- return author(commit);
+ public CommitInfo mergedCommit() {
+ return merged != null && merged.commit != null ? merged.commit.build() : null;
}
-
- @Nullable
- public Date date() {
- return date(commit);
- }
-
- @Nullable
- public String mergedPath() {
- return merged != null ? merged.path : null;
- }
-
- public long mergedRevision() {
- return merged != null ? revision(merged.commit) : 0;
- }
-
- @Nullable
- public String mergedAuthor() {
- return merged != null ? author(merged.commit) : null;
- }
-
- @Nullable
- public Date mergedDate() {
- return merged != null ? date(merged.commit) : null;
- }
-
- private static long revision(@Nullable CommitEntry commit) {
- return commit != null ? commit.revision : 0;
- }
-
- @Nullable
- private static String author(@Nullable CommitEntry commit) {
- return commit != null ? commit.author : null;
- }
-
- @Nullable
- private static Date date(@Nullable CommitEntry commit) {
- return commit != null ? commit.date : null;
- }
- }
-
- public static class CommitEntry {
-
- @XmlAttribute(name = "revision")
- public long revision;
-
- @XmlElement(name = "author")
- public String author;
-
- @XmlElement(name = "date")
- public Date date;
}
public static class MergedEntry {
@@ -162,7 +105,6 @@
@XmlAttribute(name = "path")
public String path;
- @XmlElement(name = "commit")
- public CommitEntry commit;
+ public CommitInfo.Builder commit;
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnAnnotationProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnAnnotationProvider.java
index c51f4db..a615fd4 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnAnnotationProvider.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnAnnotationProvider.java
@@ -35,11 +35,15 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.*;
-import org.jetbrains.idea.svn.history.HistoryClient;
-import org.jetbrains.idea.svn.history.SvnChangeList;
-import org.jetbrains.idea.svn.history.SvnFileRevision;
-import org.tmatesoft.svn.core.*;
-import org.tmatesoft.svn.core.wc.*;
+import org.jetbrains.idea.svn.checkin.CommitInfo;
+import org.jetbrains.idea.svn.diff.DiffOptions;
+import org.jetbrains.idea.svn.history.*;
+import org.jetbrains.idea.svn.info.Info;
+import org.tmatesoft.svn.core.SVNErrorCode;
+import org.tmatesoft.svn.core.SVNErrorMessage;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -86,7 +90,7 @@
public void run() {
final ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
final File ioFile = new File(file.getPath()).getAbsoluteFile();
- SVNInfo info = null;
+ Info info = null;
try {
final String contents;
@@ -116,7 +120,7 @@
}
// ignore mime type=true : IDEA-19562
- final ISVNAnnotateHandler annotateHandler = createAnnotationHandler(progress, result);
+ final AnnotationConsumer annotateHandler = createAnnotationHandler(progress, result);
final boolean calculateMergeinfo = SvnConfiguration.getInstance(myVcs.getProject()).isShowMergeSourcesInAnnotate() &&
SvnUtil.checkRepositoryVersion15(myVcs, url);
@@ -166,7 +170,7 @@
}
private void handleSvnException(File ioFile,
- SVNInfo info,
+ Info info,
SVNException e,
VirtualFile file,
VcsFileRevision revision,
@@ -221,7 +225,7 @@
private SvnRemoteFileAnnotation annotateNonExisting(Pair<SvnChangeList, FilePath> pair,
VcsFileRevision revision,
- SVNInfo info,
+ Info info,
Charset charset, final VirtualFile current) throws VcsException, SVNException, IOException {
final File wasFile = pair.getSecond().getIOFile();
final File root = getCommonAncestor(wasFile, info.getFile());
@@ -231,7 +235,7 @@
final String relativePath = FileUtil.getRelativePath(root.getPath(), wasFile.getPath(), File.separatorChar);
if (relativePath == null) throw new VcsException("Can not find relative path for " + wasFile.getPath() + "@" + revision.getRevisionNumber().asString());
- SVNInfo wcRootInfo = myVcs.getInfo(root);
+ Info wcRootInfo = myVcs.getInfo(root);
if (wcRootInfo == null || wcRootInfo.getURL() == null) {
throw new VcsException("Can not find relative path for " + wasFile.getPath() + "@" + revision.getRevisionNumber().asString());
}
@@ -244,9 +248,8 @@
final SVNRevision svnRevision = ((SvnRevisionNumber)revision.getRevisionNumber()).getRevision();
byte[] data = SvnUtil.getFileContents(myVcs, SvnTarget.fromURL(wasUrl), svnRevision, svnRevision);
final String contents = LoadTextUtil.getTextByBinaryPresentation(data, charset == null ? CharsetToolkit.UTF8_CHARSET : charset).toString();
- final SvnRemoteFileAnnotation result = new SvnRemoteFileAnnotation(myVcs, contents, revision.getRevisionNumber(), pair.getFirst(),
- pair.getSecond().getPath(), current);
- final ISVNAnnotateHandler annotateHandler = createAnnotationHandler(ProgressManager.getInstance().getProgressIndicator(), result);
+ final SvnRemoteFileAnnotation result = new SvnRemoteFileAnnotation(myVcs, contents, revision.getRevisionNumber(), current);
+ final AnnotationConsumer annotateHandler = createAnnotationHandler(ProgressManager.getInstance().getProgressIndicator(), result);
final boolean calculateMergeinfo = SvnConfiguration.getInstance(myVcs.getProject()).isShowMergeSourcesInAnnotate() &&
SvnUtil.checkRepositoryVersion15(myVcs, wasUrl.toString());
@@ -256,45 +259,18 @@
return result;
}
- private ISVNAnnotateHandler createAnnotationHandler(final ProgressIndicator progress, final BaseSvnFileAnnotation result) {
- return new ISVNAnnotateHandler() {
- public void handleLine(Date date, long revision, String author, String line) {
+ @NotNull
+ private static AnnotationConsumer createAnnotationHandler(@Nullable final ProgressIndicator progress,
+ @NotNull final BaseSvnFileAnnotation result) {
+ return new AnnotationConsumer() {
+
+ @Override
+ public void consume(int lineNumber, @NotNull CommitInfo info, @Nullable CommitInfo mergeInfo) throws SVNException {
if (progress != null) {
progress.checkCanceled();
}
- result.appendLineInfo(date, revision, author, null, -1, null);
- }
- public void handleLine(final Date date,
- final long revision,
- final String author,
- final String line,
- final Date mergedDate,
- final long mergedRevision,
- final String mergedAuthor,
- final String mergedPath,
- final int lineNumber) throws SVNException {
- if (progress != null) {
- progress.checkCanceled();
- }
- if (revision == -1) return;
- if ((mergedDate != null) && (revision > mergedRevision)) {
- // !!! merged date = date of merge, i.e. date -> date of original change etc.
- result.setLineInfo(lineNumber, date, revision, author, mergedDate, mergedRevision, mergedAuthor);
- } else {
- result.setLineInfo(lineNumber, date, revision, author, null, -1, null);
- }
- }
-
- public boolean handleRevision(final Date date, final long revision, final String author, final File contents)
- throws SVNException {
- if (progress != null) {
- progress.checkCanceled();
- }
- return false;
- }
-
- public void handleEOF() {
+ result.setLineInfo(lineNumber, info, mergeInfo != null && info.getRevision() > mergeInfo.getRevision() ? mergeInfo : null);
}
};
}
@@ -307,7 +283,7 @@
if (annotationSourceSwitcher != null) {
annotationSourceSwitcher.switchTo(AnnotationSource.LOCAL);
}
- final int size = svnFileAnnotation.getNumLines();
+ final int size = svnFileAnnotation.getLineCount();
final VcsUsualLineAnnotationData lineAnnotationData = new VcsUsualLineAnnotationData(size);
for (int i = 0; i < size; i++) {
@@ -356,17 +332,15 @@
for (int i = 0; i < basicAnnotation.getNumLines(); i++) {
final VcsRevisionNumber revision = basicAnnotation.getRevision(i);
final VcsRevisionNumber mergedData = data == null ? null : data.getRevision(i);
- final VcsFileRevision fileRevision = historyAsMap.get(revision);
+ final SvnFileRevision fileRevision = (SvnFileRevision)historyAsMap.get(revision);
if (fileRevision == null) return null;
+
if (mergedData == null) {
- annotation.setLineInfo(i, fileRevision.getRevisionDate(), ((SvnRevisionNumber) revision).getRevision().getNumber(),
- fileRevision.getAuthor(), null, -1, null);
+ annotation.setLineInfo(i, fileRevision.getCommitInfo(), null);
} else {
- final VcsFileRevision mergedRevision = cachedOtherRevisions.get(mergedData);
+ final SvnFileRevision mergedRevision = (SvnFileRevision)cachedOtherRevisions.get(mergedData);
if (mergedRevision == null) return null;
- annotation.setLineInfo(i, fileRevision.getRevisionDate(), ((SvnRevisionNumber) revision).getRevision().getNumber(),
- fileRevision.getAuthor(), mergedRevision.getRevisionDate(),
- ((SvnRevisionNumber) mergedRevision.getRevisionNumber()).getRevision().getNumber(), mergedRevision.getAuthor());
+ annotation.setLineInfo(i, fileRevision.getCommitInfo(), mergedRevision.getCommitInfo());
}
}
if (vcsAnnotation.getFirstRevision() != null) {
@@ -453,8 +427,9 @@
private void doLog(final boolean includeMerged, final SVNRevision truncateTo, final int max) throws VcsException {
myClient.doLog(SvnTarget.fromFile(myIoFile), myEndRevision, truncateTo == null ? SVNRevision.create(1L) : truncateTo,
false, false, includeMerged, max, null,
- new ISVNLogEntryHandler() {
- public void handleLogEntry(SVNLogEntry logEntry) {
+ new LogEntryConsumer() {
+ @Override
+ public void consume(LogEntry logEntry) {
if (SVNRevision.UNDEFINED.getNumber() == logEntry.getRevision()) {
return;
}
@@ -477,7 +452,8 @@
return true;
}
- private static SVNDiffOptions getLogClientOptions(@NotNull SvnVcs vcs) {
- return SvnConfiguration.getInstance(vcs.getProject()).isIgnoreSpacesInAnnotate() ? new SVNDiffOptions(true, true, true) : null;
+ @Nullable
+ private static DiffOptions getLogClientOptions(@NotNull SvnVcs vcs) {
+ return SvnConfiguration.getInstance(vcs.getProject()).isIgnoreSpacesInAnnotate() ? new DiffOptions(true, true, true) : null;
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnKitAnnotateClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnKitAnnotateClient.java
index 191bd90..c2423de 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnKitAnnotateClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnKitAnnotateClient.java
@@ -4,13 +4,17 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.checkin.CommitInfo;
+import org.jetbrains.idea.svn.diff.DiffOptions;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.wc.ISVNAnnotateHandler;
-import org.tmatesoft.svn.core.wc.SVNDiffOptions;
import org.tmatesoft.svn.core.wc.SVNLogClient;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
+import java.io.File;
+import java.util.Date;
+
/**
* @author Konstantin Kolosovsky.
*/
@@ -22,21 +26,68 @@
@NotNull SVNRevision endRevision,
@Nullable SVNRevision pegRevision,
boolean includeMergedRevisions,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable ISVNAnnotateHandler handler) throws VcsException {
+ @Nullable DiffOptions diffOptions,
+ @Nullable AnnotationConsumer handler) throws VcsException {
try {
SVNLogClient client = myVcs.getSvnKitManager().createLogClient();
- client.setDiffOptions(diffOptions);
+ client.setDiffOptions(toDiffOptions(diffOptions));
if (target.isFile()) {
- client.doAnnotate(target.getFile(), pegRevision, startRevision, endRevision, true, includeMergedRevisions, handler, null);
+ client
+ .doAnnotate(target.getFile(), pegRevision, startRevision, endRevision, true, includeMergedRevisions, toAnnotateHandler(handler),
+ null);
}
else {
- client.doAnnotate(target.getURL(), pegRevision, startRevision, endRevision, true, includeMergedRevisions, handler, null);
+ client
+ .doAnnotate(target.getURL(), pegRevision, startRevision, endRevision, true, includeMergedRevisions, toAnnotateHandler(handler),
+ null);
}
}
catch (SVNException e) {
throw new VcsException(e);
}
}
+
+ @Nullable
+ private static ISVNAnnotateHandler toAnnotateHandler(@Nullable final AnnotationConsumer handler) {
+ ISVNAnnotateHandler result = null;
+
+ if (handler != null) {
+ result = new ISVNAnnotateHandler() {
+ @Override
+ public void handleLine(Date date, long revision, String author, String line) throws SVNException {
+ // deprecated - not called
+ }
+
+ @Override
+ public void handleLine(Date date,
+ long revision,
+ String author,
+ String line,
+ Date mergedDate,
+ long mergedRevision,
+ String mergedAuthor,
+ String mergedPath,
+ int lineNumber) throws SVNException {
+ if (revision > 0) {
+ CommitInfo info = new CommitInfo.Builder(revision, date, author).build();
+ CommitInfo mergeInfo = mergedDate != null ? new CommitInfo.Builder(mergedRevision, mergedDate, mergedAuthor).build() : null;
+
+ handler.consume(lineNumber, info, mergeInfo);
+ }
+ }
+
+ @Override
+ public boolean handleRevision(Date date, long revision, String author, File contents) throws SVNException {
+ return false;
+ }
+
+ @Override
+ public void handleEOF() throws SVNException {
+ }
+ };
+ }
+
+ return result;
+ }
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnRemoteFileAnnotation.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnRemoteFileAnnotation.java
index f00bc7b9..3f09246 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnRemoteFileAnnotation.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnRemoteFileAnnotation.java
@@ -29,15 +29,10 @@
* Time: 12:10 PM
*/
public class SvnRemoteFileAnnotation extends BaseSvnFileAnnotation {
- private final SvnChangeList mySvnChangeList;
- private final String myPathToSelect;
private final VirtualFile myCurrentFile;
- public SvnRemoteFileAnnotation(SvnVcs vcs, String contents, VcsRevisionNumber baseRevision, SvnChangeList svnChangeList,
- final String pathToSelect, final VirtualFile currentFile) {
+ public SvnRemoteFileAnnotation(SvnVcs vcs, String contents, VcsRevisionNumber baseRevision, final VirtualFile currentFile) {
super(vcs, contents, baseRevision);
- mySvnChangeList = svnChangeList;
- myPathToSelect = pathToSelect;
myCurrentFile = currentFile;
}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkDataHolder.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/BaseNodeDescription.java
similarity index 60%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkDataHolder.java
copy to plugins/svn4idea/src/org/jetbrains/idea/svn/api/BaseNodeDescription.java
index b4f837c..03e2e07 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkDataHolder.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/BaseNodeDescription.java
@@ -13,18 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package org.jetbrains.idea.svn.api;
-import com.intellij.remote.RemoteSdkCredentialsHolder;
import org.jetbrains.annotations.NotNull;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author Konstantin Kolosovsky.
*/
-public class RemoteSdkDataHolder extends RemoteSdkCredentialsHolder {
- public RemoteSdkDataHolder(@NotNull String defaultHelpersDirName) {
- super(defaultHelpersDirName);
+public abstract class BaseNodeDescription {
+
+ @NotNull protected final NodeKind myKind;
+
+ protected BaseNodeDescription(@NotNull NodeKind kind) {
+ myKind = kind;
+ }
+
+ public boolean isFile() {
+ return myKind.isFile();
+ }
+
+ public boolean isDirectory() {
+ return myKind.isDirectory();
+ }
+
+ public boolean isNone() {
+ return myKind.isNone();
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/BaseSvnClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/BaseSvnClient.java
index bb8c613..0d58355 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/BaseSvnClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/BaseSvnClient.java
@@ -8,10 +8,11 @@
import org.jetbrains.idea.svn.WorkingCopyFormat;
import org.jetbrains.idea.svn.auth.IdeaSvnkitBasedAuthenticationCallback;
import org.jetbrains.idea.svn.commandLine.*;
+import org.jetbrains.idea.svn.diff.DiffOptions;
+import org.tmatesoft.svn.core.SVNCancelException;
+import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNEventAction;
+import org.tmatesoft.svn.core.wc.*;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -109,10 +110,10 @@
return runtime.runWithAuthenticationAttempt(command);
}
- protected static void callHandler(@Nullable ISVNEventHandler handler, @NotNull SVNEvent event) throws VcsException {
+ protected static void callHandler(@Nullable ProgressTracker handler, @NotNull ProgressEvent event) throws VcsException {
if (handler != null) {
try {
- handler.handleEvent(event, 0);
+ handler.consume(event);
}
catch (SVNException e) {
throw new SvnBindException(e);
@@ -121,7 +122,44 @@
}
@NotNull
- protected static SVNEvent createEvent(@NotNull File path, @Nullable SVNEventAction action) {
- return new SVNEvent(path, null, null, 0, null, null, null, null, action, null, null, null, null, null, null);
+ protected static ProgressEvent createEvent(@NotNull File path, @Nullable EventAction action) {
+ return new ProgressEvent(path, 0, null, null, action, null, null);
+ }
+
+ @Nullable
+ protected static ISVNEventHandler toEventHandler(@Nullable final ProgressTracker handler) {
+ ISVNEventHandler result = null;
+
+ if (handler != null) {
+ result = new ISVNEventHandler() {
+ @Override
+ public void handleEvent(SVNEvent event, double progress) throws SVNException {
+ handler.consume(ProgressEvent.create(event));
+ }
+
+ @Override
+ public void checkCancelled() throws SVNCancelException {
+ handler.checkCancelled();
+ }
+ };
+ }
+
+ return result;
+ }
+
+ @Nullable
+ protected static SVNDiffOptions toDiffOptions(@Nullable DiffOptions options) {
+ return options != null ? new SVNDiffOptions(options.isIgnoreAllWhitespace(), options.isIgnoreAmountOfWhitespace(),
+ options.isIgnoreEOLStyle()) : null;
+ }
+
+ @Nullable
+ protected static SVNDepth toDepth(@Nullable Depth depth) {
+ return depth != null ? SVNDepth.fromString(depth.getName()) : null;
+ }
+
+ @NotNull
+ protected static SVNRevision notNullize(@Nullable SVNRevision revision) {
+ return revision != null ? revision : SVNRevision.UNDEFINED;
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ClientFactory.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ClientFactory.java
index 99e00a3..ba3e56d 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ClientFactory.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ClientFactory.java
@@ -27,7 +27,6 @@
import org.jetbrains.idea.svn.update.RelocateClient;
import org.jetbrains.idea.svn.update.UpdateClient;
import org.jetbrains.idea.svn.upgrade.UpgradeClient;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.ISVNStatusFileProvider;
/**
@@ -102,7 +101,7 @@
}
@NotNull
- public StatusClient createStatusClient(@Nullable ISVNStatusFileProvider provider, @NotNull ISVNEventHandler handler) {
+ public StatusClient createStatusClient(@Nullable ISVNStatusFileProvider provider, @NotNull ProgressTracker handler) {
return createStatusClient();
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/Depth.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/Depth.java
new file mode 100644
index 0000000..9ccc96e
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/Depth.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.api;
+
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.tmatesoft.svn.core.SVNDepth;
+
+import java.util.Map;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public enum Depth {
+
+ UNKNOWN("unknown"),
+ INFINITY("infinity"),
+ IMMEDIATES("immediates"),
+ FILES("files"),
+ EMPTY("empty");
+
+ @NotNull private static final Map<String, Depth> ourAllDepths = ContainerUtil.newHashMap();
+
+ static {
+ for (Depth action : Depth.values()) {
+ register(action);
+ }
+ }
+
+ @NotNull private final String myName;
+
+ Depth(@NotNull String name) {
+ myName = name;
+ }
+
+ @NotNull
+ public String getName() {
+ return myName;
+ }
+
+ @Override
+ public String toString() {
+ return myName;
+ }
+
+ private static void register(@NotNull Depth depth) {
+ ourAllDepths.put(depth.myName, depth);
+ }
+
+ @NotNull
+ public static Depth from(@NotNull String depthName) {
+ Depth result = ourAllDepths.get(depthName);
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unknown depth " + depthName);
+ }
+
+ return result;
+ }
+
+ @NotNull
+ public static Depth from(@Nullable SVNDepth depth) {
+ return depth != null ? from(depth.getName()) : UNKNOWN;
+ }
+
+ @NotNull
+ public static Depth allOrFiles(boolean recursive) {
+ return recursive ? INFINITY : FILES;
+ }
+
+ @NotNull
+ public static Depth allOrEmpty(boolean recursive) {
+ return recursive ? INFINITY : EMPTY;
+ }
+
+ public static boolean isRecursive(@Nullable Depth depth) {
+ return depth == null || depth == INFINITY || depth == UNKNOWN;
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/EventAction.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/EventAction.java
new file mode 100644
index 0000000..3a1d3fc
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/EventAction.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.api;
+
+import com.intellij.util.ObjectUtils;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.tmatesoft.svn.core.wc.SVNEventAction;
+
+import java.util.Map;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public enum EventAction {
+
+ // currently used to represent some not used event action from SVNKit
+ UNKNOWN("unknown"),
+
+ ADD("add"),
+ DELETE("delete"),
+ RESTORE("restore"),
+ REVERT("revert"),
+ FAILED_REVERT("failed_revert"),
+ SKIP("skip"),
+
+ UPDATE_DELETE("update_delete"),
+ UPDATE_ADD("update_add"),
+ UPDATE_UPDATE("update_update"),
+ UPDATE_NONE("update_none"),
+ UPDATE_COMPLETED("update_completed"),
+ UPDATE_EXTERNAL("update_external"),
+ UPDATE_SKIP_OBSTRUCTION("update_skip_obstruction"),
+ UPDATE_STARTED("update_started"),
+
+ COMMIT_MODIFIED("commit_modified"),
+ COMMIT_ADDED("commit_added"),
+ COMMIT_DELETED("commit_deleted"),
+ COMMIT_REPLACED("commit_replaced"),
+ COMMIT_DELTA_SENT("commit_delta_sent"),
+ FAILED_OUT_OF_DATE("failed_out_of_date"),
+
+ LOCKED("locked"),
+ UNLOCKED("unlocked"),
+ LOCK_FAILED("lock_failed"),
+ UNLOCK_FAILED("unlock_failed"),
+
+ UPGRADED_PATH("upgraded_path"),
+
+ TREE_CONFLICT("tree_conflict");
+
+ @NotNull private static final Map<String, EventAction> ourAllActions = ContainerUtil.newHashMap();
+
+ static {
+ for (EventAction action : EventAction.values()) {
+ register(action);
+ }
+ }
+
+ private String myKey;
+
+ EventAction(String key) {
+ myKey = key;
+ }
+
+ public String toString() {
+ return myKey;
+ }
+
+ private static void register(@NotNull EventAction action) {
+ ourAllActions.put(action.myKey, action);
+ }
+
+ @NotNull
+ public static EventAction from(@NotNull SVNEventAction action) {
+ return ObjectUtils.notNull(ourAllActions.get(action.toString()), UNKNOWN);
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/FileStatusResultParser.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/FileStatusResultParser.java
index fc202c2..7bc0b32a 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/FileStatusResultParser.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/FileStatusResultParser.java
@@ -6,8 +6,6 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -17,20 +15,18 @@
*/
public class FileStatusResultParser {
- private static final double DEFAULT_PROGRESS = 0.0;
-
@NotNull
private Pattern myLinePattern;
@Nullable
- private ISVNEventHandler handler;
+ private ProgressTracker handler;
@NotNull
- private Convertor<Matcher, SVNEvent> myConvertor;
+ private Convertor<Matcher, ProgressEvent> myConvertor;
public FileStatusResultParser(@NotNull Pattern linePattern,
- @Nullable ISVNEventHandler handler,
- @NotNull Convertor<Matcher, SVNEvent> convertor) {
+ @Nullable ProgressTracker handler,
+ @NotNull Convertor<Matcher, ProgressEvent> convertor) {
myLinePattern = linePattern;
this.handler = handler;
myConvertor = convertor;
@@ -59,7 +55,7 @@
public void process(@NotNull Matcher matcher) throws VcsException {
if (handler != null) {
try {
- handler.handleEvent(myConvertor.convert(matcher), DEFAULT_PROGRESS);
+ handler.consume(myConvertor.convert(matcher));
} catch (SVNException e) {
throw new VcsException(e);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/InfoCommandRepositoryProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/InfoCommandRepositoryProvider.java
index c2be897..bfcf37d 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/InfoCommandRepositoryProvider.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/InfoCommandRepositoryProvider.java
@@ -18,8 +18,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnVcs;
-import org.tmatesoft.svn.core.wc.SVNInfo;
-import org.tmatesoft.svn.core.wc.SVNRevision;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.wc2.SvnTarget;
/**
@@ -42,7 +41,7 @@
result = new Repository(myTarget.getURL());
}
else {
- SVNInfo info = myVcs.getInfo(myTarget.getFile());
+ Info info = myVcs.getInfo(myTarget.getFile());
result = info != null ? new Repository(info.getRepositoryRootURL()) : null;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/NodeKind.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/NodeKind.java
new file mode 100644
index 0000000..e4820b8
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/NodeKind.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.api;
+
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.tmatesoft.svn.core.SVNNodeKind;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlEnumValue;
+import java.util.Map;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+@XmlEnum
+public enum NodeKind {
+
+ // see comments in LogEntryPath.Builder for cases when "" kind could appear
+ @XmlEnumValue("") UNKNOWN("unknown"),
+ @XmlEnumValue("file") FILE("file"),
+ @XmlEnumValue("dir") DIR("dir"),
+ // used in ConflictVersion when node is missing
+ @XmlEnumValue("none") NONE("none");
+
+ @NotNull private static final Map<String, NodeKind> ourAllNodeKinds = ContainerUtil.newHashMap();
+
+ static {
+ for (NodeKind kind : NodeKind.values()) {
+ register(kind);
+ }
+ }
+
+ @NotNull private final String myKey;
+
+ NodeKind(@NotNull String key) {
+ myKey = key;
+ }
+
+ public boolean isFile() {
+ return FILE.equals(this);
+ }
+
+ public boolean isDirectory() {
+ return DIR.equals(this);
+ }
+
+ public boolean isNone() {
+ return NONE.equals(this);
+ }
+
+ @Override
+ public String toString() {
+ return myKey;
+ }
+
+ private static void register(@NotNull NodeKind kind) {
+ ourAllNodeKinds.put(kind.myKey, kind);
+ }
+
+ @NotNull
+ public static NodeKind from(@NotNull String nodeKindName) {
+ NodeKind result = ourAllNodeKinds.get(nodeKindName);
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unknown node kind " + nodeKindName);
+ }
+
+ return result;
+ }
+
+ @NotNull
+ public static NodeKind from(@NotNull SVNNodeKind nodeKind) {
+ return from(nodeKind.toString());
+ }
+
+ @NotNull
+ public static NodeKind from(boolean isDirectory) {
+ return isDirectory ? DIR : FILE;
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ProgressEvent.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ProgressEvent.java
new file mode 100644
index 0000000..12bd2e1
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ProgressEvent.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.api;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.status.StatusType;
+import org.tmatesoft.svn.core.SVNErrorMessage;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.wc.SVNEvent;
+
+import java.io.File;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public class ProgressEvent {
+
+ private final File myFile;
+
+ private final long myRevision;
+ private final SVNURL myURL;
+
+ @NotNull private final StatusType myContentsStatus;
+ @NotNull private final StatusType myPropertiesStatus;
+ private final SVNErrorMessage myErrorMessage;
+ private final EventAction myAction;
+
+ @Nullable
+ public static ProgressEvent create(@Nullable SVNEvent event) {
+ ProgressEvent result = null;
+
+ if (event != null) {
+ if (event.getFile() == null && event.getURL() == null) {
+ result = new ProgressEvent(event.getErrorMessage());
+ }
+ else {
+ result =
+ new ProgressEvent(event.getFile(), event.getRevision(), StatusType.from(event.getContentsStatus()), StatusType.from(event.getPropertiesStatus()),
+ EventAction.from(event.getAction()), event.getErrorMessage(), event.getURL());
+ }
+ }
+
+ return result;
+ }
+
+ public ProgressEvent(SVNErrorMessage errorMessage) {
+ this(null, 0, null, null, EventAction.SKIP, errorMessage, null);
+ }
+
+ public ProgressEvent(File file,
+ long revision,
+ @Nullable StatusType contentStatus,
+ @Nullable StatusType propertiesStatus,
+ EventAction action,
+ SVNErrorMessage error,
+ SVNURL url) {
+ myFile = file != null ? file.getAbsoluteFile() : null;
+ myRevision = revision;
+ myContentsStatus = contentStatus == null ? StatusType.INAPPLICABLE : contentStatus;
+ myPropertiesStatus = propertiesStatus == null ? StatusType.INAPPLICABLE : propertiesStatus;
+ myAction = action;
+ myErrorMessage = error;
+ myURL = url;
+ }
+
+ public File getFile() {
+ return myFile;
+ }
+
+ public EventAction getAction() {
+ return myAction;
+ }
+
+ @NotNull
+ public StatusType getContentsStatus() {
+ return myContentsStatus;
+ }
+
+ public SVNErrorMessage getErrorMessage() {
+ return myErrorMessage;
+ }
+
+ @NotNull
+ public StatusType getPropertiesStatus() {
+ return myPropertiesStatus;
+ }
+
+ public long getRevision() {
+ return myRevision;
+ }
+
+ public SVNURL getURL() {
+ return myURL;
+ }
+
+ @Nullable
+ public String getPath() {
+ return myFile != null ? myFile.getName() : myURL != null ? myURL.toString() : null;
+ }
+
+ public String toString() {
+ return getAction() + " " + getFile() + " " + getURL();
+ }
+}
\ No newline at end of file
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ProgressTracker.java
similarity index 63%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
copy to plugins/svn4idea/src/org/jetbrains/idea/svn/api/ProgressTracker.java
index 2a24920..303b66a 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/ProgressTracker.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package org.jetbrains.idea.svn.api;
+
+import com.intellij.util.ThrowableConsumer;
+import org.tmatesoft.svn.core.SVNCancelException;
+import org.tmatesoft.svn.core.SVNException;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author Konstantin Kolosovsky.
*/
-public class RemoteCancelledException extends com.intellij.remote.RemoteCancelledException {
- public RemoteCancelledException(String s) {
- super(s);
- }
+public interface ProgressTracker extends ThrowableConsumer<ProgressEvent, SVNException> {
+
+ void checkCancelled() throws SVNCancelException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/SvnKitClientFactory.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/SvnKitClientFactory.java
index 1b834c1..f46f5f0 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/api/SvnKitClientFactory.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/api/SvnKitClientFactory.java
@@ -29,7 +29,6 @@
import org.jetbrains.idea.svn.update.SvnKitUpdateClient;
import org.jetbrains.idea.svn.update.UpdateClient;
import org.jetbrains.idea.svn.upgrade.SvnKitUpgradeClient;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.ISVNStatusFileProvider;
/**
@@ -72,7 +71,7 @@
@NotNull
@Override
- public StatusClient createStatusClient(@Nullable ISVNStatusFileProvider provider, @NotNull ISVNEventHandler handler) {
+ public StatusClient createStatusClient(@Nullable ISVNStatusFileProvider provider, @NotNull ProgressTracker handler) {
return prepare(new SvnKitStatusClient(provider, handler));
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/BranchesLoader.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/BranchesLoader.java
index 698ed90..10f4574 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/BranchesLoader.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/BranchesLoader.java
@@ -20,6 +20,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.SvnConfiguration;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
+import org.jetbrains.idea.svn.browse.DirectoryEntryConsumer;
import org.jetbrains.idea.svn.integrate.SvnBranchItem;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.wc.SVNLogClient;
@@ -42,13 +45,14 @@
SVNURL branchesUrl = SVNURL.parseURIEncoded(url);
List<SvnBranchItem> result = new LinkedList<SvnBranchItem>();
SvnTarget target = SvnTarget.fromURL(branchesUrl);
- ISVNDirEntryHandler handler = createHandler(branchesUrl, result);
if (!passive) {
// TODO: Implement ability to specify interactive/non-interactive auth mode for clients
- vcs.getFactory(target).createBrowseClient().list(target, SVNRevision.HEAD, SVNDepth.IMMEDIATES, handler);
+ DirectoryEntryConsumer handler = createConsumer(branchesUrl, result);
+ vcs.getFactory(target).createBrowseClient().list(target, SVNRevision.HEAD, Depth.IMMEDIATES, handler);
}
else {
+ ISVNDirEntryHandler handler = createHandler(branchesUrl, result);
SVNLogClient client = vcs.getSvnKitManager().createLogClient(configuration.getPassiveAuthenticationManager(project));
client
.doList(target.getURL(), target.getPegRevision(), SVNRevision.HEAD, false, SVNDepth.IMMEDIATES, SVNDirEntry.DIRENT_ALL, handler);
@@ -69,4 +73,18 @@
}
};
}
+
+ @NotNull
+ private static DirectoryEntryConsumer createConsumer(@NotNull final SVNURL branchesUrl, @NotNull final List<SvnBranchItem> result) {
+ return new DirectoryEntryConsumer() {
+
+ @Override
+ public void consume(final DirectoryEntry entry) throws SVNException {
+ // TODO: Remove equality check with branchesUrl when SVNLogClient will not be used directly, but rather through BrowseClient.
+ if (!branchesUrl.equals(entry.getUrl()) && entry.getDate() != null) {
+ result.add(new SvnBranchItem(entry.getUrl().toDecodedString(), entry.getDate(), entry.getRevision()));
+ }
+ }
+ };
+ }
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/DefaultConfigLoader.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/DefaultConfigLoader.java
index 315954e..d52798e 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/DefaultConfigLoader.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/DefaultConfigLoader.java
@@ -24,10 +24,13 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
+import org.jetbrains.idea.svn.browse.DirectoryEntryConsumer;
+import org.jetbrains.idea.svn.info.Info;
import org.jetbrains.idea.svn.integrate.SvnBranchItem;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -52,7 +55,7 @@
final SvnVcs vcs = SvnVcs.getInstance(project);
File rootFile = new File(vcsRoot.getPath());
- final SVNInfo info = vcs.getInfo(rootFile);
+ final Info info = vcs.getInfo(rootFile);
if (info == null || info.getURL() == null) {
LOG.info("Directory is not a working copy: " + vcsRoot.getPresentableUrl());
return null;
@@ -67,7 +70,7 @@
SVNURL rootPath = baseUrl.removePathTail();
SvnTarget target = SvnTarget.fromURL(rootPath);
- vcs.getFactory(target).createBrowseClient().list(target, SVNRevision.HEAD, SVNDepth.IMMEDIATES, createHandler(result, rootPath));
+ vcs.getFactory(target).createBrowseClient().list(target, SVNRevision.HEAD, Depth.IMMEDIATES, createHandler(result, rootPath));
break;
}
if (SVNPathUtil.removeTail(baseUrl.getPath()).length() == 0) {
@@ -88,13 +91,15 @@
}
@NotNull
- private static ISVNDirEntryHandler createHandler(final SvnBranchConfigurationNew result, final SVNURL rootPath) {
- return new ISVNDirEntryHandler() {
- public void handleDirEntry(final SVNDirEntry dirEntry) throws SVNException {
- if (SVNNodeKind.DIR.equals(dirEntry.getKind())) {
- SVNURL childUrl = rootPath.appendPath(dirEntry.getName(), false);
+ private static DirectoryEntryConsumer createHandler(final SvnBranchConfigurationNew result, final SVNURL rootPath) {
+ return new DirectoryEntryConsumer() {
- if (StringUtil.endsWithIgnoreCase(dirEntry.getName(), DEFAULT_TRUNK_NAME)) {
+ @Override
+ public void consume(final DirectoryEntry entry) throws SVNException {
+ if (entry.isDirectory()) {
+ SVNURL childUrl = rootPath.appendPath(entry.getName(), false);
+
+ if (StringUtil.endsWithIgnoreCase(entry.getName(), DEFAULT_TRUNK_NAME)) {
result.setTrunkUrl(childUrl.toString());
}
else {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/SvnBranchConfigurationNew.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/SvnBranchConfigurationNew.java
index b3554ce..4102210 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/SvnBranchConfigurationNew.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/SvnBranchConfigurationNew.java
@@ -23,12 +23,12 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.info.Info;
import org.jetbrains.idea.svn.integrate.SvnBranchItem;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
import org.tmatesoft.svn.core.internal.util.SVNURLUtil;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import java.io.File;
import java.util.*;
@@ -221,7 +221,7 @@
private BranchRootSearcher(final SvnVcs vcs, final VirtualFile root) throws SVNException {
myRoot = root;
myBranchesUnder = new HashMap<String, String>();
- final SVNInfo info = vcs.getInfo(myRoot.getPath());
+ final Info info = vcs.getInfo(myRoot.getPath());
myRootUrl = info != null ? info.getURL() : null;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/BrowseClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/BrowseClient.java
index 92e64bb..f5c46cb 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/BrowseClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/BrowseClient.java
@@ -18,9 +18,8 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.ISVNDirEntryHandler;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -29,7 +28,7 @@
*/
public interface BrowseClient extends SvnClient {
- void list(@NotNull SvnTarget target, @Nullable SVNRevision revision, @Nullable SVNDepth depth, @Nullable ISVNDirEntryHandler handler)
+ void list(@NotNull SvnTarget target, @Nullable SVNRevision revision, @Nullable Depth depth, @Nullable DirectoryEntryConsumer handler)
throws VcsException;
long createDirectory(@NotNull SvnTarget target, @NotNull String message, boolean makeParents) throws VcsException;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/CmdBrowseClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/CmdBrowseClient.java
index 20d60a9..bceb516 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/CmdBrowseClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/CmdBrowseClient.java
@@ -21,12 +21,17 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.NodeKind;
import org.jetbrains.idea.svn.checkin.CmdCheckinClient;
+import org.jetbrains.idea.svn.checkin.CommitInfo;
import org.jetbrains.idea.svn.commandLine.CommandExecutor;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.*;
+import org.jetbrains.idea.svn.lock.Lock;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -35,7 +40,6 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
-import java.util.Date;
import java.util.List;
/**
@@ -46,8 +50,8 @@
@Override
public void list(@NotNull SvnTarget target,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
- @Nullable ISVNDirEntryHandler handler) throws VcsException {
+ @Nullable Depth depth,
+ @Nullable DirectoryEntryConsumer handler) throws VcsException {
assertUrl(target);
List<String> parameters = new ArrayList<String>();
@@ -85,15 +89,15 @@
return listener.getCommittedRevision();
}
- private static void parseOutput(@NotNull SVNURL url, @NotNull CommandExecutor command, @Nullable ISVNDirEntryHandler handler)
- throws VcsException, SVNException {
+ private static void parseOutput(@NotNull SVNURL url, @NotNull CommandExecutor command, @Nullable DirectoryEntryConsumer handler)
+ throws VcsException, SVNException {
try {
TargetLists lists = CommandUtil.parse(command.getOutput(), TargetLists.class);
if (handler != null && lists != null) {
for (TargetList list : lists.lists) {
for (Entry entry : list.entries) {
- handler.handleDirEntry(entry.toDirEntry(url));
+ handler.consume(entry.toDirectoryEntry(url));
}
}
}
@@ -122,8 +126,8 @@
public static class Entry {
- @XmlAttribute(name = "kind")
- public String kind;
+ @XmlAttribute(name = "kind", required = true)
+ public NodeKind kind;
@XmlElement(name = "name")
public String name;
@@ -131,68 +135,15 @@
@XmlElement(name = "size")
public long size;
- @XmlElement(name = "commit")
- public Commit commit;
+ public CommitInfo.Builder commit;
- @XmlElement(name = "lock")
- public Lock lock;
+ public Lock.Builder lock;
- public long revision() {
- return commit != null ? commit.revision : 0;
- }
-
- public String author() {
- return commit != null ? commit.author : "";
- }
-
- public Date date() {
- return commit != null ? commit.date : null;
- }
-
- public SVNDirEntry toDirEntry(@NotNull SVNURL url) throws SVNException {
+ @NotNull
+ public DirectoryEntry toDirectoryEntry(@NotNull SVNURL url) throws SVNException {
// TODO: repository is not used for now
- SVNDirEntry entry =
- new SVNDirEntry(url.appendPath(name, false), null, PathUtil.getFileName(name), SVNNodeKind.parseKind(kind), size, false, revision(),
- date(), author());
-
- entry.setRelativePath(name);
- entry.setLock(lock != null ? lock.toLock(entry.getRelativePath()) : null);
-
- return entry;
- }
- }
-
- public static class Commit {
-
- @XmlAttribute(name = "revision")
- public long revision;
-
- @XmlElement(name = "author")
- public String author;
-
- @XmlElement(name = "date")
- public Date date;
- }
-
- public static class Lock {
-
- @XmlElement(name = "token")
- public String token;
-
- @XmlElement(name = "owner")
- public String owner;
-
- @XmlElement(name = "comment")
- public String comment;
-
- @XmlElement(name = "created")
- public Date created;
-
- @XmlElement(name = "expires")
- public Date expires;
-
- public SVNLock toLock(@NotNull String path) {
- return new SVNLock(path, token, owner, comment, created, expires);
+ return new DirectoryEntry(url.appendPath(name, false), null, PathUtil.getFileName(name), kind,
+ commit != null ? commit.build() : null, name);
}
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/DirectoryEntry.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/DirectoryEntry.java
new file mode 100644
index 0000000..e29e6e46
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/DirectoryEntry.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.browse;
+
+import com.intellij.util.ObjectUtils;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.BaseNodeDescription;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.jetbrains.idea.svn.checkin.CommitInfo;
+import org.tmatesoft.svn.core.SVNDirEntry;
+import org.tmatesoft.svn.core.SVNURL;
+
+import java.util.Date;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public class DirectoryEntry extends BaseNodeDescription implements Comparable<DirectoryEntry> {
+
+ private final String myName;
+ @NotNull private final CommitInfo myCommitInfo;
+ private final String myPath;
+ private final SVNURL myUrl;
+ private final SVNURL myRepositoryRoot;
+
+ @NotNull
+ public static DirectoryEntry create(@NotNull SVNDirEntry entry) {
+ return new DirectoryEntry(entry.getURL(), entry.getRepositoryRoot(), entry.getName(), NodeKind.from(entry.getKind()),
+ new CommitInfo.Builder(entry.getRevision(), entry.getDate(), entry.getAuthor()).build(),
+ entry.getRelativePath());
+ }
+
+ public DirectoryEntry(SVNURL url,
+ SVNURL repositoryRoot,
+ String name,
+ @NotNull NodeKind kind,
+ @Nullable CommitInfo commitInfo,
+ String path) {
+ super(kind);
+ myUrl = url;
+ myRepositoryRoot = repositoryRoot;
+ myName = name;
+ myCommitInfo = ObjectUtils.notNull(commitInfo, CommitInfo.EMPTY);
+ myPath = path;
+ }
+
+ public SVNURL getUrl() {
+ return myUrl;
+ }
+
+ public SVNURL getRepositoryRoot() {
+ return myRepositoryRoot;
+ }
+
+ public String getName() {
+ return myName;
+ }
+
+ @NotNull
+ public NodeKind getKind() {
+ return myKind;
+ }
+
+ public Date getDate() {
+ return myCommitInfo.getDate();
+ }
+
+ public long getRevision() {
+ return myCommitInfo.getRevision();
+ }
+
+ public String getAuthor() {
+ return myCommitInfo.getAuthor();
+ }
+
+ public String getRelativePath() {
+ return myPath == null ? myName : myPath;
+ }
+
+ @Override
+ public int compareTo(@NotNull DirectoryEntry o) {
+ int result = getKind().compareTo(o.getKind());
+
+ return result != 0 ? result : myUrl.toString().compareTo(o.getUrl().toString());
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/DirectoryEntryConsumer.java
similarity index 69%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
copy to plugins/svn4idea/src/org/jetbrains/idea/svn/browse/DirectoryEntryConsumer.java
index 2a24920..f404413 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/DirectoryEntryConsumer.java
@@ -13,15 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package org.jetbrains.idea.svn.browse;
+
+import com.intellij.util.ThrowableConsumer;
+import org.tmatesoft.svn.core.SVNException;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author Konstantin Kolosovsky.
*/
-public class RemoteCancelledException extends com.intellij.remote.RemoteCancelledException {
- public RemoteCancelledException(String s) {
- super(s);
- }
+public interface DirectoryEntryConsumer extends ThrowableConsumer<DirectoryEntry, SVNException> {
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/SvnKitBrowseClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/SvnKitBrowseClient.java
index 42ac680..cdbb1ff 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/SvnKitBrowseClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/browse/SvnKitBrowseClient.java
@@ -20,6 +20,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.wc.SVNLogClient;
@@ -33,8 +34,8 @@
@Override
public void list(@NotNull SvnTarget target,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
- @Nullable ISVNDirEntryHandler handler) throws VcsException {
+ @Nullable Depth depth,
+ @Nullable DirectoryEntryConsumer handler) throws VcsException {
assertUrl(target);
SVNLogClient client = myVcs.getSvnKitManager().createLogClient();
@@ -42,10 +43,10 @@
try {
if (target.isFile()) {
- client.doList(target.getFile(), target.getPegRevision(), revision, true, depth, SVNDirEntry.DIRENT_ALL, wrappedHandler);
+ client.doList(target.getFile(), target.getPegRevision(), notNullize(revision), true, toDepth(depth), SVNDirEntry.DIRENT_ALL, wrappedHandler);
}
else {
- client.doList(target.getURL(), target.getPegRevision(), revision, true, depth, SVNDirEntry.DIRENT_ALL, wrappedHandler);
+ client.doList(target.getURL(), target.getPegRevision(), notNullize(revision), true, toDepth(depth), SVNDirEntry.DIRENT_ALL, wrappedHandler);
}
}
catch (SVNException e) {
@@ -69,26 +70,26 @@
}
@Nullable
- private static ISVNDirEntryHandler wrapHandler(@Nullable ISVNDirEntryHandler handler) {
+ private static ISVNDirEntryHandler wrapHandler(@Nullable DirectoryEntryConsumer handler) {
return handler == null ? null : new SkipEmptyNameDirectoriesHandler(handler);
}
public static class SkipEmptyNameDirectoriesHandler implements ISVNDirEntryHandler {
- @NotNull private final ISVNDirEntryHandler handler;
+ @NotNull private final DirectoryEntryConsumer handler;
- public SkipEmptyNameDirectoriesHandler(@NotNull ISVNDirEntryHandler handler) {
+ public SkipEmptyNameDirectoriesHandler(@NotNull DirectoryEntryConsumer handler) {
this.handler = handler;
}
@Override
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException {
if (!isEmptyNameDirectory(dirEntry)) {
- handler.handleDirEntry(dirEntry);
+ handler.consume(DirectoryEntry.create(dirEntry));
}
}
- private static boolean isEmptyNameDirectory(SVNDirEntry dirEntry) {
+ private static boolean isEmptyNameDirectory(@NotNull SVNDirEntry dirEntry) {
return SVNNodeKind.DIR.equals(dirEntry.getKind()) && StringUtil.isEmpty(dirEntry.getName());
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/change/CmdChangeListClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/change/CmdChangeListClient.java
index 2791ce8..dc9fedd 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/change/CmdChangeListClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/change/CmdChangeListClient.java
@@ -4,9 +4,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -25,7 +25,7 @@
parameters.add(changeList);
CommandUtil.put(parameters, path);
- CommandUtil.put(parameters, SVNDepth.EMPTY);
+ CommandUtil.put(parameters, Depth.EMPTY);
if (changeListsToOperate != null) {
CommandUtil.putChangeLists(parameters, Arrays.asList(changeListsToOperate));
}
@@ -41,7 +41,7 @@
parameters.add("--remove");
CommandUtil.put(parameters, path);
- CommandUtil.put(parameters, SVNDepth.EMPTY);
+ CommandUtil.put(parameters, Depth.EMPTY);
// for now parsing of the output is not required as command is executed only for one file
// and will be either successful or exception will be thrown
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CheckinClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CheckinClient.java
index 628c222..cc8e2ef 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CheckinClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CheckinClient.java
@@ -18,7 +18,6 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNCommitInfo;
import java.io.File;
import java.util.Collection;
@@ -29,5 +28,5 @@
public interface CheckinClient extends SvnClient {
@NotNull
- SVNCommitInfo[] commit(@NotNull Collection<File> paths, @NotNull String comment) throws VcsException;
+ CommitInfo[] commit(@NotNull Collection<File> paths, @NotNull String comment) throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CmdCheckinClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CmdCheckinClient.java
index ce95c64..ced5e62 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CmdCheckinClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CmdCheckinClient.java
@@ -29,13 +29,14 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.jetbrains.idea.svn.commandLine.*;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.commandLine.CommandUtil;
+import org.jetbrains.idea.svn.commandLine.LineCommandAdapter;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.commandLine.SvnCommandName;
+import org.jetbrains.idea.svn.status.Status;
import org.jetbrains.idea.svn.status.StatusClient;
-import org.tmatesoft.svn.core.SVNCommitInfo;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.SVNStatus;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -57,26 +58,21 @@
@NotNull
@Override
- public SVNCommitInfo[] commit(@NotNull Collection<File> paths, @NotNull String message) throws VcsException {
+ public CommitInfo[] commit(@NotNull Collection<File> paths, @NotNull String message) throws VcsException {
// if directory renames were used, IDEA reports all files under them as moved, but for svn we can not pass some of them
// to commit command - since not all paths are registered as changes -> so we need to filter these cases, but only if
// there at least some child-parent relationships in passed paths
- try {
- paths = filterCommittables(paths);
- }
- catch (SVNException e) {
- throw new SvnBindException(e);
- }
+ paths = filterCommittables(paths);
return commit(ArrayUtil.toObjectArray(paths, File.class), message);
}
@NotNull
- public SVNCommitInfo[] commit(@NotNull File[] paths, @NotNull String message) throws VcsException {
- if (paths.length == 0) return new SVNCommitInfo[]{SVNCommitInfo.NULL};
+ public CommitInfo[] commit(@NotNull File[] paths, @NotNull String message) throws VcsException {
+ if (paths.length == 0) return new CommitInfo[]{CommitInfo.EMPTY};
final List<String> parameters = new ArrayList<String>();
- CommandUtil.put(parameters, SVNDepth.EMPTY);
+ CommandUtil.put(parameters, Depth.EMPTY);
CommandUtil.put(parameters, false, "--no-unlock");
CommandUtil.put(parameters, false, "--keep-changelists");
CommandUtil.putChangeLists(parameters, null);
@@ -95,7 +91,7 @@
long revision = validateRevisionNumber(listener.getCommittedRevision());
- return new SVNCommitInfo[]{new SVNCommitInfo(revision, null, null, null)};
+ return new CommitInfo[]{new CommitInfo.Builder().setRevision(revision).build()};
}
private static long validateRevisionNumber(long revision) throws VcsException {
@@ -106,7 +102,7 @@
return revision;
}
- private Collection<File> filterCommittables(@NotNull Collection<File> committables) throws SVNException {
+ private Collection<File> filterCommittables(@NotNull Collection<File> committables) throws SvnBindException {
final Set<String> childrenOfSomebody = ContainerUtil.newHashSet();
new AbstractFilterChildren<File>() {
@Override
@@ -135,13 +131,13 @@
}
else {
try {
- final SVNStatus status = statusClient.doStatus(file, false);
- if (status != null && !SVNStatusType.STATUS_NONE.equals(status.getContentsStatus()) &&
- !SVNStatusType.STATUS_UNVERSIONED.equals(status.getContentsStatus())) {
+ final Status status = statusClient.doStatus(file, false);
+ if (status != null && !StatusType.STATUS_NONE.equals(status.getContentsStatus()) &&
+ !StatusType.STATUS_UNVERSIONED.equals(status.getContentsStatus())) {
result.add(file);
}
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
// not versioned
LOG.info(e);
throw e;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CmdImportClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CmdImportClient.java
index 74eeadb..a06c280 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CmdImportClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CmdImportClient.java
@@ -4,9 +4,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.ISVNCommitHandler;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -23,7 +23,7 @@
@Override
public long doImport(@NotNull File path,
@NotNull SVNURL url,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@NotNull String message,
boolean noIgnore,
@Nullable CommitEventHandler handler,
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CommitEventHandler.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CommitEventHandler.java
index 87be3fa..54a9219 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CommitEventHandler.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CommitEventHandler.java
@@ -15,7 +15,7 @@
*/
package org.jetbrains.idea.svn.checkin;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import java.io.File;
@@ -26,7 +26,7 @@
* Date: 2/26/13
* Time: 10:12 AM
*/
-public interface CommitEventHandler extends ISVNEventHandler {
+public interface CommitEventHandler extends ProgressTracker {
void commitEvent(final CommitEventType type, final File target);
void committedRevision(final long revNum);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CommitInfo.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CommitInfo.java
new file mode 100644
index 0000000..a09d3c0
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/CommitInfo.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.checkin;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.tmatesoft.svn.core.SVNErrorMessage;
+
+import javax.xml.bind.annotation.*;
+import java.util.Date;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public class CommitInfo {
+
+ public static final CommitInfo EMPTY = new CommitInfo.Builder().setRevision(-1).build();
+
+ private final long myRevision;
+ private final Date myDate;
+ private final String myAuthor;
+ @Nullable private final SVNErrorMessage myErrorMessage;
+
+ private CommitInfo(@NotNull CommitInfo.Builder builder) {
+ myRevision = builder.revision;
+ myAuthor = builder.author;
+ myDate = builder.date;
+ myErrorMessage = builder.error;
+ }
+
+ public long getRevision() {
+ return myRevision;
+ }
+
+ public String getAuthor() {
+ return myAuthor;
+ }
+
+ public Date getDate() {
+ return myDate;
+ }
+
+ @Nullable
+ public SVNErrorMessage getErrorMessage() {
+ return myErrorMessage;
+ }
+
+ @XmlAccessorType(XmlAccessType.NONE)
+ @XmlType(name = "commit")
+ @XmlRootElement(name = "commit")
+ public static class Builder {
+
+ @XmlAttribute(name = "revision")
+ private long revision;
+
+ @XmlElement(name = "author")
+ private String author;
+
+ @XmlElement(name = "date")
+ private Date date;
+
+ @Nullable private SVNErrorMessage error;
+
+ public Builder() {
+ }
+
+ public Builder(long revision, Date date, String author) {
+ this.revision = revision;
+ this.date = date;
+ this.author = author;
+ }
+
+ public long getRevision() {
+ return revision;
+ }
+
+ public String getAuthor() {
+ return author;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ @NotNull
+ public Builder setRevision(long revision) {
+ this.revision = revision;
+ return this;
+ }
+
+ @NotNull
+ public Builder setAuthor(String author) {
+ this.author = author;
+ return this;
+ }
+
+ @NotNull
+ public Builder setDate(Date date) {
+ this.date = date;
+ return this;
+ }
+
+ @NotNull
+ public Builder setError(@Nullable SVNErrorMessage error) {
+ this.error = error;
+ return this;
+ }
+
+ @NotNull
+ public CommitInfo build() {
+ return new CommitInfo(this);
+ }
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/IdeaCommitHandler.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/IdeaCommitHandler.java
index 3b78ac6..2dc4669 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/IdeaCommitHandler.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/IdeaCommitHandler.java
@@ -27,11 +27,10 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnBundle;
-import org.jetbrains.idea.svn.SvnUtil;
+import org.jetbrains.idea.svn.api.EventAction;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.tmatesoft.svn.core.SVNCancelException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNEventAction;
import java.io.File;
import java.util.List;
@@ -42,7 +41,7 @@
* Date: 2/26/13
* Time: 11:13 AM
*/
-public class IdeaCommitHandler implements CommitEventHandler, ISVNEventHandler {
+public class IdeaCommitHandler implements CommitEventHandler, ProgressTracker {
private static final Logger LOG = Logger.getInstance(IdeaCommitHandler.class);
@@ -81,8 +80,8 @@
myProgress.setText2(SvnBundle.message("status.text.comitted.revision", revNum));
}
- public void handleEvent(SVNEvent event, double p) {
- final String path = SvnUtil.getPathForProgress(event);
+ public void consume(ProgressEvent event) {
+ final String path = event.getPath();
if (path != null) {
CommitEventType eventType = convert(event.getAction());
@@ -120,7 +119,7 @@
}
}
- private void trackDeletedFile(@NotNull SVNEvent event) {
+ private void trackDeletedFile(@NotNull ProgressEvent event) {
@NonNls final String filePath = "file://" + event.getFile().getAbsolutePath().replace(File.separatorChar, '/');
VirtualFile virtualFile = ApplicationManager.getApplication().runReadAction(new Computable<VirtualFile>() {
@Nullable
@@ -135,22 +134,22 @@
}
@NotNull
- private static CommitEventType convert(@NotNull SVNEventAction action) {
+ private static CommitEventType convert(@NotNull EventAction action) {
CommitEventType result = CommitEventType.unknown;
- if (SVNEventAction.COMMIT_ADDED.equals(action)) {
+ if (EventAction.COMMIT_ADDED.equals(action)) {
result = CommitEventType.adding;
- } else if (SVNEventAction.COMMIT_DELETED.equals(action)) {
+ } else if (EventAction.COMMIT_DELETED.equals(action)) {
result = CommitEventType.deleting;
- } else if (SVNEventAction.COMMIT_MODIFIED.equals(action)) {
+ } else if (EventAction.COMMIT_MODIFIED.equals(action)) {
result = CommitEventType.sending;
- } else if (SVNEventAction.COMMIT_REPLACED.equals(action)) {
+ } else if (EventAction.COMMIT_REPLACED.equals(action)) {
result = CommitEventType.replacing;
- } else if (SVNEventAction.COMMIT_DELTA_SENT.equals(action)) {
+ } else if (EventAction.COMMIT_DELTA_SENT.equals(action)) {
result = CommitEventType.transmittingDeltas;
- } else if (SVNEventAction.SKIP.equals(action)) {
+ } else if (EventAction.SKIP.equals(action)) {
result = CommitEventType.skipped;
- } else if (SVNEventAction.FAILED_OUT_OF_DATE.equals(action)) {
+ } else if (EventAction.FAILED_OUT_OF_DATE.equals(action)) {
result = CommitEventType.failedOutOfDate;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/ImportClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/ImportClient.java
index d3c273e..9338c5d 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/ImportClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/ImportClient.java
@@ -3,8 +3,8 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.ISVNCommitHandler;
@@ -17,7 +17,7 @@
long doImport(@NotNull File path,
@NotNull SVNURL url,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@NotNull String message,
boolean noIgnore,
@Nullable CommitEventHandler handler,
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnCheckinEnvironment.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnCheckinEnvironment.java
index 6fb1b95..c9a8435 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnCheckinEnvironment.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnCheckinEnvironment.java
@@ -45,14 +45,14 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.*;
-import org.tmatesoft.svn.core.SVNCommitInfo;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNStatus;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import javax.swing.*;
import java.awt.*;
@@ -130,18 +130,18 @@
return;
}
- SVNCommitInfo[] results = mySvnVcs.getFactory(format).createCheckinClient().commit(committables, comment);
+ CommitInfo[] results = mySvnVcs.getFactory(format).createCheckinClient().commit(committables, comment);
final StringBuilder committedRevisions = new StringBuilder();
- for (SVNCommitInfo result : results) {
+ for (CommitInfo result : results) {
if (result.getErrorMessage() != null) {
exception.add(new VcsException(result.getErrorMessage().getFullMessage()));
}
- else if (result != SVNCommitInfo.NULL && result.getNewRevision() > 0) {
+ else if (result != CommitInfo.EMPTY && result.getRevision() > 0) {
if (committedRevisions.length() > 0) {
committedRevisions.append(", ");
}
- committedRevisions.append(result.getNewRevision());
+ committedRevisions.append(result.getRevision());
}
}
if (committedRevisions.length() > 0) {
@@ -199,11 +199,9 @@
}
private void addParents(File file, final Adder adder) {
- SVNStatus status = getStatus(file);
+ Status status = getStatus(file);
- if (status != null &&
- (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_ADDED) ||
- SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_REPLACED))) {
+ if (status != null && status.is(StatusType.STATUS_ADDED, StatusType.STATUS_REPLACED)) {
// file should be added
adder.add(file);
file = file.getParentFile();
@@ -214,13 +212,13 @@
}
@Nullable
- private SVNStatus getStatus(@NotNull File file) {
- SVNStatus result = null;
+ private Status getStatus(@NotNull File file) {
+ Status result = null;
try {
result = mySvnVcs.getFactory(file).createStatusClient().doStatus(file, false);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
LOG.info(e);
}
@@ -287,9 +285,9 @@
public static List<VcsException> scheduleUnversionedFilesForAddition(@NotNull SvnVcs vcs, List<VirtualFile> files, final boolean recursive) {
Collections.sort(files, FilePathComparator.getInstance());
- ISVNEventHandler eventHandler = new SvnProgressCanceller() {
+ ProgressTracker eventHandler = new SvnProgressCanceller() {
@Override
- public void handleEvent(SVNEvent event, double progress) throws SVNException {
+ public void consume(ProgressEvent event) throws SVNException {
// TODO: indicator is null here when invoking "Add" action
ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
File file = event.getFile();
@@ -301,7 +299,7 @@
};
List<VcsException> exceptions = new ArrayList<VcsException>();
- SVNDepth depth = recursive ? SVNDepth.INFINITY : SVNDepth.EMPTY;
+ Depth depth = Depth.allOrEmpty(recursive);
for (VirtualFile file : files) {
try {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnCheckinHandlerFactory.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnCheckinHandlerFactory.java
index 8af993b..29e5fe9 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnCheckinHandlerFactory.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnCheckinHandlerFactory.java
@@ -32,15 +32,15 @@
import com.intellij.openapi.vcs.checkin.VcsCheckinHandlerFactory;
import com.intellij.openapi.vcs.ui.RefreshableOnComponent;
import com.intellij.openapi.vcs.update.ActionInfo;
-import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.PairConsumer;
+import com.intellij.util.containers.MultiMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.*;
import org.jetbrains.idea.svn.update.AutoSvnUpdater;
-import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -74,22 +74,20 @@
public ReturnResult beforeCheckin(@Nullable CommitExecutor executor, PairConsumer<Object, Object> additionalDataConsumer) {
if (executor instanceof LocalCommitExecutor) return ReturnResult.COMMIT;
final SvnVcs vcs = SvnVcs.getInstance(project);
- final Map<String, Integer> copiesInfo = splitIntoCopies(vcs, myChanges);
+ final MultiMap<String, WorkingCopyFormat> copiesInfo = splitIntoCopies(vcs, myChanges);
final List<String> repoUrls = new ArrayList<String>();
- for (Map.Entry<String, Integer> entry : copiesInfo.entrySet()) {
- if (entry.getValue() == 3) {
+ for (Map.Entry<String, Collection<WorkingCopyFormat>> entry : copiesInfo.entrySet()) {
+ if (entry.getValue().size() > 1) {
repoUrls.add(entry.getKey());
}
}
if (! repoUrls.isEmpty()) {
- final String join = StringUtil.join(repoUrls.toArray(new String[repoUrls.size()]), ",\n");
+ final String join = StringUtil.join(repoUrls, ",\n");
final int isOk = Messages.showOkCancelDialog(project,
SvnBundle.message("checkin.different.formats.involved", repoUrls.size() > 1 ? 1 : 0, join),
"Subversion: Commit Will Split", Messages.getWarningIcon());
- if (Messages.OK == isOk) {
- return ReturnResult.COMMIT;
- }
- return ReturnResult.CANCEL;
+
+ return Messages.OK == isOk ? ReturnResult.COMMIT : ReturnResult.CANCEL;
}
return ReturnResult.COMMIT;
}
@@ -104,17 +102,17 @@
if (SvnConfiguration.getInstance(project).isAutoUpdateAfterCommit()) {
final VirtualFile[] roots = ProjectLevelVcsManager.getInstance(project).getRootsUnderVcs(SvnVcs.getInstance(project));
final List<FilePath> paths = new ArrayList<FilePath>();
- for (int i = 0; i < roots.length; i++) {
- VirtualFile root = roots[i];
+ for (VirtualFile root : roots) {
boolean take = false;
for (VirtualFile commitRoot : commitRoots) {
- if (VfsUtil.isAncestor(root, commitRoot, false)) {
+ if (VfsUtilCore.isAncestor(root, commitRoot, false)) {
take = true;
break;
}
}
- if (! take) continue;
- paths.add(new FilePathImpl(root));
+ if (take) {
+ paths.add(new FilePathImpl(root));
+ }
}
if (paths.isEmpty()) return;
ApplicationManager.getApplication().invokeLater(new Runnable() {
@@ -128,25 +126,19 @@
};
}
- private static Map<String, Integer> splitIntoCopies(SvnVcs vcs, final Collection<Change> changes) {
- final SvnFileUrlMapping mapping = vcs.getSvnFileUrlMapping();
+ @NotNull
+ private static MultiMap<String, WorkingCopyFormat> splitIntoCopies(@NotNull SvnVcs vcs, @NotNull Collection<Change> changes) {
+ MultiMap<String, WorkingCopyFormat> result = MultiMap.createSet();
+ SvnFileUrlMapping mapping = vcs.getSvnFileUrlMapping();
- final Map<String, Integer> copiesInfo = new java.util.HashMap<String, Integer>();
for (Change change : changes) {
- final File ioFile = ChangesUtil.getFilePath(change).getIOFile();
- final RootUrlInfo path = mapping.getWcRootForFilePath(ioFile);
- if (path == null) continue;
- final Integer integer = copiesInfo.get(path.getRepositoryUrl());
- int result = integer == null ? 0 : integer;
- if (result != 3) {
- if (WorkingCopyFormat.ONE_DOT_SEVEN.equals(path.getFormat())) {
- result |= 2;
- } else {
- result |= 1;
- }
- copiesInfo.put(path.getRepositoryUrl(), result);
+ RootUrlInfo path = mapping.getWcRootForFilePath(ChangesUtil.getFilePath(change).getIOFile());
+
+ if (path != null) {
+ result.putValue(path.getRepositoryUrl(), path.getFormat());
}
}
- return copiesInfo;
+
+ return result;
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnKitCheckinClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnKitCheckinClient.java
index a81aecd..c3f203a 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnKitCheckinClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnKitCheckinClient.java
@@ -20,6 +20,8 @@
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.api.BaseSvnClient;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
@@ -41,7 +43,7 @@
@NotNull
@Override
- public SVNCommitInfo[] commit(@NotNull Collection<File> paths, @NotNull String comment) throws VcsException {
+ public CommitInfo[] commit(@NotNull Collection<File> paths, @NotNull String comment) throws VcsException {
File[] pathsToCommit = ArrayUtil.toObjectArray(paths, File.class);
boolean keepLocks = myVcs.getSvnConfiguration().isKeepLocks();
SVNCommitPacket[] commitPackets = null;
@@ -49,7 +51,7 @@
SVNCommitClient committer = myVcs.getSvnKitManager().createCommitClient();
IdeaCommitHandler handler = new IdeaCommitHandler(ProgressManager.getInstance().getProgressIndicator(), true, true);
- committer.setEventHandler(handler);
+ committer.setEventHandler(toEventHandler(handler));
try {
commitPackets = committer.doCollectCommitItems(pathsToCommit, keepLocks, true, SVNDepth.EMPTY, true, null);
results = committer.doCommit(commitPackets, keepLocks, comment);
@@ -76,6 +78,17 @@
f.putUserData(VirtualFile.REQUESTOR_MARKER, this);
}
- return results;
+ return convert(results);
+ }
+
+ @NotNull
+ private static CommitInfo[] convert(@NotNull SVNCommitInfo[] infos) {
+ return ContainerUtil.map(infos, new Function<SVNCommitInfo, CommitInfo>() {
+ @Override
+ public CommitInfo fun(SVNCommitInfo info) {
+ return new CommitInfo.Builder(info.getNewRevision(), info.getDate(), info.getAuthor())
+ .setError(info.getErrorMessage()).build();
+ }
+ }, new CommitInfo[0]);
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnKitImportClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnKitImportClient.java
index 23edc8f..d64f8c3 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnKitImportClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnKitImportClient.java
@@ -4,9 +4,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNCommitInfo;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.ISVNCommitHandler;
@@ -22,18 +22,18 @@
@Override
public long doImport(@NotNull File path,
@NotNull SVNURL url,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@NotNull String message,
boolean noIgnore,
@Nullable CommitEventHandler handler,
@Nullable ISVNCommitHandler commitHandler) throws VcsException {
SVNCommitClient client = myVcs.getSvnKitManager().createCommitClient();
- client.setEventHandler(handler);
+ client.setEventHandler(toEventHandler(handler));
client.setCommitHandler(commitHandler);
try {
- SVNCommitInfo info = client.doImport(path, url, message, null, !noIgnore, false, depth);
+ SVNCommitInfo info = client.doImport(path, url, message, null, !noIgnore, false, toDepth(depth));
return info.getNewRevision();
}
catch (SVNException e) {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CheckoutClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CheckoutClient.java
index b31d0da..d338ca1 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CheckoutClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CheckoutClient.java
@@ -4,9 +4,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.WorkingCopyFormat;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -21,11 +21,11 @@
void checkout(@NotNull SvnTarget source,
@NotNull File destination,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean ignoreExternals,
boolean force,
@NotNull WorkingCopyFormat format,
- @Nullable ISVNEventHandler handler) throws VcsException;
+ @Nullable ProgressTracker handler) throws VcsException;
List<WorkingCopyFormat> getSupportedFormats() throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CheckoutEventHandler.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CheckoutEventHandler.java
index 88f2a69..868c38b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CheckoutEventHandler.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CheckoutEventHandler.java
@@ -22,16 +22,15 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnBundle;
-import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.EventAction;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.tmatesoft.svn.core.SVNCancelException;
import org.tmatesoft.svn.core.SVNErrorCode;
import org.tmatesoft.svn.core.SVNErrorMessage;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNEventAction;
-public class CheckoutEventHandler implements ISVNEventHandler {
+public class CheckoutEventHandler implements ProgressTracker {
@Nullable private final ProgressIndicator myIndicator;
private int myExternalsCount;
@NotNull private final SvnVcs myVCS;
@@ -46,20 +45,19 @@
myCnt = 0;
}
- public void handleEvent(SVNEvent event, double progress) {
- final String path = SvnUtil.getPathForProgress(event);
- if (path == null) {
+ public void consume(ProgressEvent event) {
+ if (event.getPath() == null) {
return;
}
- if (event.getAction() == SVNEventAction.UPDATE_EXTERNAL) {
+ if (event.getAction() == EventAction.UPDATE_EXTERNAL) {
myExternalsCount++;
progress(SvnBundle.message("progress.text2.fetching.external.location", event.getFile().getAbsolutePath()));
}
- else if (event.getAction() == SVNEventAction.UPDATE_ADD) {
+ else if (event.getAction() == EventAction.UPDATE_ADD) {
progress2(SvnBundle.message(myIsExport ? "progress.text2.exported" : "progress.text2.checked.out", event.getFile().getName(), myCnt));
++ myCnt;
}
- else if (event.getAction() == SVNEventAction.UPDATE_COMPLETED) {
+ else if (event.getAction() == EventAction.UPDATE_COMPLETED) {
myExternalsCount--;
progress2(
(SvnBundle.message(myIsExport ? "progress.text2.exported.revision" : "progress.text2.checked.out.revision", event.getRevision())));
@@ -70,10 +68,10 @@
StatusBar.Info.set(SvnBundle.message(myIsExport ? "progress.text2.exported.revision" : "status.text.checked.out.revision", event.getRevision()), project);
}
}
- } else if (event.getAction() == SVNEventAction.COMMIT_ADDED) {
- progress2((SvnBundle.message("progress.text2.adding", path)));
- } else if (event.getAction() == SVNEventAction.COMMIT_DELTA_SENT) {
- progress2((SvnBundle.message("progress.text2.transmitting.delta", path)));
+ } else if (event.getAction() == EventAction.COMMIT_ADDED) {
+ progress2((SvnBundle.message("progress.text2.adding", event.getPath())));
+ } else if (event.getAction() == EventAction.COMMIT_DELTA_SENT) {
+ progress2((SvnBundle.message("progress.text2.transmitting.delta", event.getPath())));
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CmdCheckoutClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CmdCheckoutClient.java
index b292e43..7ea00c6 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CmdCheckoutClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CmdCheckoutClient.java
@@ -6,11 +6,11 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.WorkingCopyFormat;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.commandLine.BaseUpdateCommandListener;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -26,11 +26,11 @@
public void checkout(@NotNull SvnTarget source,
@NotNull File destination,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean ignoreExternals,
boolean force,
@NotNull WorkingCopyFormat format,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable ProgressTracker handler) throws VcsException {
validateFormat(format, getSupportedFormats());
List<String> parameters = new ArrayList<String>();
@@ -57,7 +57,7 @@
private void run(@NotNull SvnTarget source,
@NotNull File destination,
- @Nullable ISVNEventHandler handler,
+ @Nullable ProgressTracker handler,
@NotNull List<String> parameters) throws VcsException {
BaseUpdateCommandListener listener = new BaseUpdateCommandListener(destination, handler);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CmdExportClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CmdExportClient.java
index 1e40113..a35c7a4 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CmdExportClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/CmdExportClient.java
@@ -5,11 +5,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.commandLine.BaseUpdateCommandListener;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -26,11 +26,11 @@
public void export(@NotNull SvnTarget from,
@NotNull File to,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@Nullable String nativeLineEnd,
boolean force,
boolean ignoreExternals,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable ProgressTracker handler) throws VcsException {
List<String> parameters = new ArrayList<String>();
CommandUtil.put(parameters, from);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/ExportClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/ExportClient.java
index 6ddd6de..4033ead 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/ExportClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/ExportClient.java
@@ -3,9 +3,9 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -19,9 +19,9 @@
void export(@NotNull SvnTarget from,
@NotNull File to,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@Nullable String nativeLineEnd,
boolean force,
boolean ignoreExternals,
- @Nullable ISVNEventHandler handler) throws VcsException;
+ @Nullable ProgressTracker handler) throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnCheckoutProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnCheckoutProvider.java
index 634d528..c7422ef 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnCheckoutProvider.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnCheckoutProvider.java
@@ -44,12 +44,13 @@
import org.jetbrains.idea.svn.actions.ExclusiveBackgroundVcsAction;
import org.jetbrains.idea.svn.actions.SvnExcludingIgnoredOperation;
import org.jetbrains.idea.svn.api.ClientFactory;
-import org.jetbrains.idea.svn.checkin.IdeaCommitHandler;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.checkin.CommitEventHandler;
+import org.jetbrains.idea.svn.checkin.IdeaCommitHandler;
import org.jetbrains.idea.svn.dialogs.CheckoutDialog;
import org.jetbrains.idea.svn.dialogs.UpgradeFormatDialog;
import org.tmatesoft.svn.core.SVNCancelException;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.*;
@@ -68,8 +69,8 @@
dialog.show();
}
- public static void doCheckout(final Project project, final File target, final String url, final SVNRevision revision,
- final SVNDepth depth, final boolean ignoreExternals, @Nullable final Listener listener) {
+ public static void doCheckout(@NotNull Project project, @NotNull File target, final String url, final SVNRevision revision,
+ final Depth depth, final boolean ignoreExternals, @Nullable final Listener listener) {
if (! target.exists()) {
target.mkdirs();
}
@@ -95,7 +96,7 @@
final File target,
final String url,
final SVNRevision revision,
- final SVNDepth depth,
+ final Depth depth,
final boolean ignoreExternals,
final Listener listener, final WorkingCopyFormat selectedFormat) {
final Ref<Boolean> checkoutSuccessful = new Ref<Boolean>();
@@ -108,7 +109,7 @@
SvnWorkingCopyFormatHolder.setPresetFormat(format);
SvnVcs vcs = SvnVcs.getInstance(project);
- ISVNEventHandler handler = new CheckoutEventHandler(vcs, false, ProgressManager.getInstance().getProgressIndicator());
+ ProgressTracker handler = new CheckoutEventHandler(vcs, false, ProgressManager.getInstance().getProgressIndicator());
ProgressManager.progress(SvnBundle.message("progress.text.checking.out", target.getAbsolutePath()));
try {
getFactory(vcs, format).createCheckoutClient()
@@ -186,11 +187,11 @@
@CalledInAwt
@NotNull
- public static WorkingCopyFormat promptForWCopyFormat(final File target, final Project project) {
+ public static WorkingCopyFormat promptForWCopyFormat(@NotNull File target, @NotNull Project project) {
return new CheckoutFormatFromUserProvider(project, target).prompt();
}
- public static void doExport(final Project project, final File target, final SVNURL url, final SVNDepth depth,
+ public static void doExport(final Project project, final File target, final SVNURL url, final Depth depth,
final boolean ignoreExternals, final boolean force, final String eolStyle) {
try {
final VcsException[] exception = new VcsException[1];
@@ -199,7 +200,7 @@
ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
public void run() {
ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
- ISVNEventHandler handler = new CheckoutEventHandler(vcs, true, progressIndicator);
+ ProgressTracker handler = new CheckoutEventHandler(vcs, true, progressIndicator);
try {
progressIndicator.setText(SvnBundle.message("progress.text.export", target.getAbsolutePath()));
@@ -221,7 +222,7 @@
}
}
- public static void doImport(final Project project, final File target, final SVNURL url, final SVNDepth depth,
+ public static void doImport(final Project project, final File target, final SVNURL url, final Depth depth,
final boolean includeIgnored, final String message) {
final Ref<String> errorMessage = new Ref<String>();
final SvnVcs vcs = SvnVcs.getInstance(project);
@@ -312,14 +313,15 @@
public WorkingCopyFormat prompt() {
assert !ApplicationManager.getApplication().isUnitTestMode();
- final WorkingCopyFormat result = displayUpgradeDialog(WorkingCopyFormat.ONE_DOT_SEVEN);
+ final WorkingCopyFormat result = displayUpgradeDialog();
ApplicationManager.getApplication().getMessageBus().syncPublisher(SvnVcs.WC_CONVERTED).run();
return result;
}
- private WorkingCopyFormat displayUpgradeDialog(@NotNull WorkingCopyFormat defaultSelection) {
+ @NotNull
+ private WorkingCopyFormat displayUpgradeDialog() {
final UpgradeFormatDialog dialog = new UpgradeFormatDialog(myProject, myPath, false);
final ModalityState dialogState = ModalityState.any();
@@ -354,6 +356,7 @@
return dialog.isOK() ? dialog.getUpgradeMode() : WorkingCopyFormat.UNKNOWN;
}
+ @NotNull
private List<WorkingCopyFormat> loadSupportedFormats() {
List<WorkingCopyFormat> result = ContainerUtil.newArrayList();
@@ -368,6 +371,7 @@
return result;
}
+ @NotNull
private static List<WorkingCopyFormat> getOtherFactoryFormats(@NotNull ClientFactory otherFactory) {
List<WorkingCopyFormat> result;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnKitCheckoutClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnKitCheckoutClient.java
index 9abd2da..d8f0ea5 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnKitCheckoutClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnKitCheckoutClient.java
@@ -5,11 +5,11 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.WorkingCopyFormat;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNUpdateClient;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -39,11 +39,11 @@
public void checkout(@NotNull SvnTarget source,
@NotNull File destination,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean ignoreExternals,
boolean force,
@NotNull WorkingCopyFormat format,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable ProgressTracker handler) throws VcsException {
assertUrl(source);
validateFormat(format, getSupportedFormats());
@@ -54,10 +54,10 @@
}
client.setIgnoreExternals(ignoreExternals);
- client.setEventHandler(handler);
+ client.setEventHandler(toEventHandler(handler));
try {
- client.doCheckout(source.getURL(), destination, source.getPegRevision(), revision, depth, force);
+ client.doCheckout(source.getURL(), destination, source.getPegRevision(), revision, toDepth(depth), force);
}
catch (SVNException e) {
throw new SvnBindException(e);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnKitExportClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnKitExportClient.java
index df7b496..66eac24 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnKitExportClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/checkout/SvnKitExportClient.java
@@ -4,10 +4,10 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNUpdateClient;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -23,22 +23,22 @@
public void export(@NotNull SvnTarget from,
@NotNull File to,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@Nullable String nativeLineEnd,
boolean force,
boolean ignoreExternals,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable ProgressTracker handler) throws VcsException {
SVNUpdateClient client = myVcs.getSvnKitManager().createUpdateClient();
- client.setEventHandler(handler);
+ client.setEventHandler(toEventHandler(handler));
client.setIgnoreExternals(ignoreExternals);
try {
if (from.isFile()) {
- client.doExport(from.getFile(), to, from.getPegRevision(), revision, nativeLineEnd, force, depth);
+ client.doExport(from.getFile(), to, from.getPegRevision(), revision, nativeLineEnd, force, toDepth(depth));
}
else {
- client.doExport(from.getURL(), to, from.getPegRevision(), revision, nativeLineEnd, force, depth);
+ client.doExport(from.getURL(), to, from.getPegRevision(), revision, nativeLineEnd, force, toDepth(depth));
}
}
catch (SVNException e) {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/CleanupClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/CleanupClient.java
index 3d1b9ee..6bf8610 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/CleanupClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/CleanupClient.java
@@ -3,8 +3,8 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import java.io.File;
@@ -13,5 +13,5 @@
*/
public interface CleanupClient extends SvnClient {
- void cleanup(@NotNull File path, @Nullable ISVNEventHandler handler) throws VcsException;
+ void cleanup(@NotNull File path, @Nullable ProgressTracker handler) throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/CmdCleanupClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/CmdCleanupClient.java
index 6ee1763..4781445 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/CmdCleanupClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/CmdCleanupClient.java
@@ -4,9 +4,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -19,7 +19,7 @@
public class CmdCleanupClient extends BaseSvnClient implements CleanupClient {
@Override
- public void cleanup(@NotNull File path, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void cleanup(@NotNull File path, @Nullable ProgressTracker handler) throws VcsException {
// TODO: Implement event handler support - currently in SVNKit implementation handler is used to support cancelling
List<String> parameters = new ArrayList<String>();
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/SvnKitCleanupClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/SvnKitCleanupClient.java
index b19a505..00ae19a 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/SvnKitCleanupClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/cleanup/SvnKitCleanupClient.java
@@ -4,9 +4,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNWCClient;
import java.io.File;
@@ -17,10 +17,10 @@
public class SvnKitCleanupClient extends BaseSvnClient implements CleanupClient {
@Override
- public void cleanup(@NotNull File path, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void cleanup(@NotNull File path, @Nullable ProgressTracker handler) throws VcsException {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
- client.setEventHandler(handler);
+ client.setEventHandler(toEventHandler(handler));
try {
client.doCleanup(path);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/BaseUpdateCommandListener.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/BaseUpdateCommandListener.java
index eb80bad..a8ef20b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/BaseUpdateCommandListener.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/BaseUpdateCommandListener.java
@@ -2,12 +2,11 @@
import com.intellij.execution.process.ProcessOutputTypes;
import com.intellij.openapi.util.Key;
-import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
import java.io.File;
import java.util.concurrent.atomic.AtomicReference;
@@ -21,12 +20,12 @@
private final UpdateOutputLineConverter converter;
@Nullable
- private final ISVNEventHandler handler;
+ private final ProgressTracker handler;
@NotNull
private final AtomicReference<SVNException> exception;
- public BaseUpdateCommandListener(@NotNull File base, @Nullable ISVNEventHandler handler) {
+ public BaseUpdateCommandListener(@NotNull File base, @Nullable ProgressTracker handler) {
this.handler = handler;
this.converter = new UpdateOutputLineConverter(base);
exception = new AtomicReference<SVNException>();
@@ -35,7 +34,7 @@
@Override
public void onLineAvailable(String line, Key outputType) {
if (ProcessOutputTypes.STDOUT.equals(outputType)) {
- final SVNEvent event = converter.convert(line);
+ final ProgressEvent event = converter.convert(line);
if (event != null) {
beforeHandler(event);
try {
@@ -49,28 +48,20 @@
}
}
- private void callHandler(SVNEvent event) throws SVNException {
+ private void callHandler(ProgressEvent event) throws SVNException {
if (handler != null) {
- handler.handleEvent(event, 0.5);
+ handler.consume(event);
}
}
- public void throwIfException() throws SVNException {
+ public void throwWrappedIfException() throws SvnBindException {
SVNException e = exception.get();
if (e != null) {
- throw e;
+ throw new SvnBindException(e);
}
}
- public void throwWrappedIfException() throws VcsException {
- SVNException e = exception.get();
-
- if (e != null) {
- throw new VcsException(e);
- }
- }
-
- protected void beforeHandler(@NotNull SVNEvent event) {
+ protected void beforeHandler(@NotNull ProgressEvent event) {
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/Command.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/Command.java
index 66216d3..50215fb 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/Command.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/Command.java
@@ -5,7 +5,7 @@
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.tmatesoft.svn.core.ISVNCanceller;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -31,7 +31,7 @@
@Nullable private volatile SVNURL myRepositoryUrl;
@NotNull private SvnTarget myTarget;
- @Nullable private ISVNCanceller myCanceller;
+ @Nullable private ProgressTracker myCanceller;
public Command(@NotNull SvnCommandName name) {
myName = name;
@@ -52,11 +52,11 @@
}
@Nullable
- public ISVNCanceller getCanceller() {
+ public ProgressTracker getCanceller() {
return myCanceller;
}
- public void setCanceller(@Nullable ISVNCanceller canceller) {
+ public void setCanceller(@Nullable ProgressTracker canceller) {
myCanceller = canceller;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandUtil.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandUtil.java
index 84794b7..eee7987 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandUtil.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandUtil.java
@@ -4,10 +4,10 @@
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.wc.SVNDiffOptions;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.diff.DiffOptions;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import javax.xml.bind.JAXBContext;
@@ -90,12 +90,12 @@
}
}
- public static void put(@NotNull List<String> parameters, @Nullable SVNDepth depth) {
+ public static void put(@NotNull List<String> parameters, @Nullable Depth depth) {
put(parameters, depth, false);
}
- public static void put(@NotNull List<String> parameters, @Nullable SVNDepth depth, boolean sticky) {
- if (depth != null && !SVNDepth.UNKNOWN.equals(depth)) {
+ public static void put(@NotNull List<String> parameters, @Nullable Depth depth, boolean sticky) {
+ if (depth != null && !Depth.UNKNOWN.equals(depth)) {
parameters.add("--depth");
parameters.add(depth.getName());
@@ -113,7 +113,7 @@
}
}
- public static void put(@NotNull List<String> parameters, @Nullable SVNDiffOptions diffOptions) {
+ public static void put(@NotNull List<String> parameters, @Nullable DiffOptions diffOptions) {
if (diffOptions != null) {
StringBuilder builder = new StringBuilder();
@@ -172,29 +172,29 @@
}
@NotNull
- public static SVNStatusType getStatusType(@Nullable String type) {
+ public static StatusType getStatusType(@Nullable String type) {
return getStatusType(getStatusChar(type));
}
@NotNull
- public static SVNStatusType getStatusType(char first) {
- final SVNStatusType contentsStatus;
+ public static StatusType getStatusType(char first) {
+ final StatusType contentsStatus;
if ('A' == first) {
- contentsStatus = SVNStatusType.STATUS_ADDED;
+ contentsStatus = StatusType.STATUS_ADDED;
} else if ('D' == first) {
- contentsStatus = SVNStatusType.STATUS_DELETED;
+ contentsStatus = StatusType.STATUS_DELETED;
} else if ('U' == first) {
- contentsStatus = SVNStatusType.CHANGED;
+ contentsStatus = StatusType.CHANGED;
} else if ('C' == first) {
- contentsStatus = SVNStatusType.CONFLICTED;
+ contentsStatus = StatusType.CONFLICTED;
} else if ('G' == first) {
- contentsStatus = SVNStatusType.MERGED;
+ contentsStatus = StatusType.MERGED;
} else if ('R' == first) {
- contentsStatus = SVNStatusType.STATUS_REPLACED;
+ contentsStatus = StatusType.STATUS_REPLACED;
} else if ('E' == first) {
- contentsStatus = SVNStatusType.STATUS_OBSTRUCTED;
+ contentsStatus = StatusType.STATUS_OBSTRUCTED;
} else {
- contentsStatus = SVNStatusType.STATUS_NORMAL;
+ contentsStatus = StatusType.STATUS_NORMAL;
}
return contentsStatus;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnBindException.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnBindException.java
index 80c1f40..6694083 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnBindException.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnBindException.java
@@ -42,9 +42,16 @@
public static final int ERROR_BASE = 120000;
public static final int CATEGORY_SIZE = 5000;
+ public static final String ERROR_MESSAGE_FORMAT = "svn: E%d: %s";
+
@NotNull private final MultiMap<Integer, String> errors = MultiMap.create();
@NotNull private final MultiMap<Integer, String> warnings = MultiMap.create();
+ public SvnBindException(@NotNull SVNErrorCode code, @NotNull String message) {
+ super(String.format(ERROR_MESSAGE_FORMAT, code.getCode(), message));
+ errors.putValue(code.getCode(), getMessage());
+ }
+
public SvnBindException(String message) {
super(message);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnExceptionWrapper.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnExceptionWrapper.java
index cd451e1..d7b84965 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnExceptionWrapper.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnExceptionWrapper.java
@@ -40,4 +40,8 @@
public SvnExceptionWrapper(SVNException cause) {
super(cause);
}
+
+ public SvnExceptionWrapper(SvnBindException cause) {
+ super(cause);
+ }
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/UpdateOutputLineConverter.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/UpdateOutputLineConverter.java
index a5a1ab8..602a6e8 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/UpdateOutputLineConverter.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/UpdateOutputLineConverter.java
@@ -18,12 +18,11 @@
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnUtil;
+import org.jetbrains.idea.svn.api.EventAction;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.SVNErrorCode;
import org.tmatesoft.svn.core.SVNErrorMessage;
-import org.tmatesoft.svn.core.SVNNodeKind;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNEventAction;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import java.io.File;
import java.util.Arrays;
@@ -80,7 +79,7 @@
myCurrentFile = base;
}
- public SVNEvent convert(final String line) {
+ public ProgressEvent convert(final String line) {
// TODO: Add direct processing of "Summary of conflicts" lines at the end of "svn update" output (if there are conflicts).
// TODO: Now it works ok because parseNormalLine could not determine necessary statuses from that and further lines
if (StringUtil.isEmptyOrSpaces(line)) return null;
@@ -89,23 +88,19 @@
return null;
} else if (line.startsWith(UPDATING)) {
myCurrentFile = parseForPath(line);
- return new SVNEvent(myCurrentFile, myCurrentFile == null ? null : (myCurrentFile.isDirectory() ? SVNNodeKind.DIR : SVNNodeKind.FILE),
- null, -1, null, null, null, null, SVNEventAction.UPDATE_NONE, SVNEventAction.UPDATE_NONE, null, null, null, null, null);
+ return new ProgressEvent(myCurrentFile, -1, null, null, EventAction.UPDATE_NONE, null, null);
} else if (line.startsWith(RESTORED)) {
myCurrentFile = parseForPath(line);
- return new SVNEvent(myCurrentFile, myCurrentFile == null ? null : (myCurrentFile.isDirectory() ? SVNNodeKind.DIR : SVNNodeKind.FILE),
- null, -1, null, null, null, null, SVNEventAction.RESTORE, SVNEventAction.RESTORE, null, null, null, null, null);
+ return new ProgressEvent(myCurrentFile, -1, null, null, EventAction.RESTORE, null, null);
} else if (line.startsWith(SKIPPED)) {
// called, for instance, when folder is not working copy
myCurrentFile = parseForPath(line);
final String comment = parseComment(line);
- return new SVNEvent(myCurrentFile, myCurrentFile == null ? null : (myCurrentFile.isDirectory() ? SVNNodeKind.DIR : SVNNodeKind.FILE),
- null, -1, null, null, null, null, SVNEventAction.SKIP, SVNEventAction.SKIP,
- comment == null ? null : SVNErrorMessage.create(SVNErrorCode.WC_OBSTRUCTED_UPDATE, comment), null, null, null, null);
+ return new ProgressEvent(myCurrentFile, -1, null, null, EventAction.SKIP,
+ comment == null ? null : SVNErrorMessage.create(SVNErrorCode.WC_OBSTRUCTED_UPDATE, comment), null);
} else if (line.startsWith(FETCHING_EXTERNAL)) {
myCurrentFile = parseForPath(line);
- return new SVNEvent(myCurrentFile, myCurrentFile == null ? null : (myCurrentFile.isDirectory() ? SVNNodeKind.DIR : SVNNodeKind.FILE),
- null, -1, null, null, null, null, SVNEventAction.UPDATE_EXTERNAL, SVNEventAction.UPDATE_EXTERNAL, null, null, null, null, null);
+ return new ProgressEvent(myCurrentFile, -1, null, null, EventAction.UPDATE_EXTERNAL, null, null);
}
for (int i = 0; i < ourCompletePatterns.length; i++) {
@@ -114,10 +109,7 @@
if (revision != -1) {
// TODO: seems that myCurrentFile will not always be correct - complete update message could be right after complete externals update
// TODO: check this and use Stack instead
- return new SVNEvent(myCurrentFile,
- myCurrentFile == null ? null : (myCurrentFile.isDirectory() ? SVNNodeKind.DIR : SVNNodeKind.FILE),
- null, revision, null, null, null, null, SVNEventAction.UPDATE_COMPLETED, SVNEventAction.UPDATE_COMPLETED, null,
- null, null, null, null);
+ return new ProgressEvent(myCurrentFile, revision, null, null, EventAction.UPDATE_COMPLETED, null, null);
}
}
@@ -127,13 +119,13 @@
private final static Set<Character> ourActions = new HashSet<Character>(Arrays.asList(new Character[] {'A', 'D', 'U', 'C', 'G', 'E', 'R'}));
@Nullable
- private SVNEvent parseNormalString(final String line) {
+ private ProgressEvent parseNormalString(final String line) {
if (line.length() < 5) return null;
final char first = line.charAt(0);
if (' ' != first && ! ourActions.contains(first)) return null;
- final SVNStatusType contentsStatus = CommandUtil.getStatusType(first);
+ final StatusType contentsStatus = CommandUtil.getStatusType(first);
final char second = line.charAt(1);
- final SVNStatusType propertiesStatus = CommandUtil.getStatusType(second);
+ final StatusType propertiesStatus = CommandUtil.getStatusType(second);
final char lock = line.charAt(2); // dont know what to do with stolen lock info
if (' ' != lock && 'B' != lock) return null;
final char treeConflict = line.charAt(3);
@@ -143,29 +135,26 @@
final String path = line.substring(4).trim();
if (StringUtil.isEmptyOrSpaces(path)) return null;
final File file = createFile(path);
- if (SVNStatusType.STATUS_OBSTRUCTED.equals(contentsStatus)) {
+ if (StatusType.STATUS_OBSTRUCTED.equals(contentsStatus)) {
// obstructed
- return new SVNEvent(file, file.isDirectory() ? SVNNodeKind.DIR : SVNNodeKind.FILE,
- null, -1, contentsStatus, propertiesStatus, null, null, SVNEventAction.UPDATE_SKIP_OBSTRUCTION, SVNEventAction.UPDATE_ADD,
- null, null, null, null, null);
+ return new ProgressEvent(file, -1, contentsStatus, propertiesStatus, EventAction.UPDATE_SKIP_OBSTRUCTION, null, null);
}
- SVNEventAction action;
- SVNEventAction expectedAction;
- if (SVNStatusType.STATUS_ADDED.equals(contentsStatus)) {
- expectedAction = SVNEventAction.UPDATE_ADD;
- } else if (SVNStatusType.STATUS_DELETED.equals(contentsStatus)) {
- expectedAction = SVNEventAction.UPDATE_DELETE;
+ EventAction action;
+ EventAction expectedAction;
+ if (StatusType.STATUS_ADDED.equals(contentsStatus)) {
+ expectedAction = EventAction.UPDATE_ADD;
+ } else if (StatusType.STATUS_DELETED.equals(contentsStatus)) {
+ expectedAction = EventAction.UPDATE_DELETE;
} else {
- expectedAction = SVNEventAction.UPDATE_UPDATE;
+ expectedAction = EventAction.UPDATE_UPDATE;
}
action = expectedAction;
if (haveTreeConflict) {
- action = SVNEventAction.TREE_CONFLICT;
+ action = EventAction.TREE_CONFLICT;
}
- return new SVNEvent(file, file.isDirectory() ? SVNNodeKind.DIR : SVNNodeKind.FILE, null, -1, contentsStatus, propertiesStatus, null,
- null, action, expectedAction, null, null, null, null, null);
+ return new ProgressEvent(file, -1, contentsStatus, propertiesStatus, action, null, null);
}
private File createFile(String path) {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/config/SvnConfigureProxiesDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/config/SvnConfigureProxiesDialog.java
index c966737..a70a4f2 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/config/SvnConfigureProxiesDialog.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/config/SvnConfigureProxiesDialog.java
@@ -25,7 +25,6 @@
import com.intellij.ui.components.JBTabbedPane;
import org.jetbrains.idea.svn.*;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
-import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.wc.SVNRevision;
import javax.swing.*;
@@ -43,7 +42,7 @@
super(project, true);
valid = true;
myProject = project;
-
+
setTitle(SvnBundle.message("dialog.title.edit.http.proxies.settings"));
final Ref<SvnServerFileManager> systemManager = new Ref<SvnServerFileManager>();
@@ -56,7 +55,7 @@
myUserTab = new SvnConfigureProxiesComponent(userManager.get(), myValidator, this);
init();
-
+
mySystemTab.reset();
myUserTab.reset();
myValidator.run();
@@ -140,9 +139,6 @@
try {
SvnVcs.getInstance(myProject).getInfo(SvnUtil.createUrl(url), SVNRevision.HEAD);
}
- catch (SVNException exc) {
- excRef.set(exc);
- }
catch (SvnBindException e) {
excRef.set(e);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/CmdConflictClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/CmdConflictClient.java
index 39a222d..a07425d 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/CmdConflictClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/CmdConflictClient.java
@@ -4,9 +4,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -22,7 +22,7 @@
// TODO: Or rewrite logic to have one "Resolve conflicts" action instead of separate actions for each conflict type.
@Override
public void resolve(@NotNull File path,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean resolveProperty,
boolean resolveContent,
boolean resolveTree) throws VcsException {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictAction.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictAction.java
new file mode 100644
index 0000000..f4111ce
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictAction.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.conflict;
+
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Map;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public enum ConflictAction {
+
+ EDIT("edit", "edited"),
+ ADD("add", "added"),
+ DELETE("delete", "deleted"),
+ REPLACE("replace", "replaced");
+
+ @NotNull private static final Map<String, ConflictAction> ourAllActions = ContainerUtil.newHashMap();
+
+ static {
+ for (ConflictAction action : ConflictAction.values()) {
+ register(action);
+ }
+ }
+
+ @NotNull private final String myKey;
+ @NotNull private final String[] myOtherKeys;
+
+ ConflictAction(@NotNull String key, @NotNull String... otherKeys) {
+ myKey = key;
+ myOtherKeys = otherKeys;
+ }
+
+ @Override
+ public String toString() {
+ return myKey;
+ }
+
+ private static void register(@NotNull ConflictAction action) {
+ ourAllActions.put(action.myKey, action);
+
+ for (String otherKey : action.myOtherKeys) {
+ ourAllActions.put(otherKey, action);
+ }
+ }
+
+ @NotNull
+ public static ConflictAction from(@NotNull String actionName) {
+ ConflictAction result = ourAllActions.get(actionName);
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unknown conflict action " + actionName);
+ }
+
+ return result;
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictClient.java
index 64e50b8..7d86206 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictClient.java
@@ -3,8 +3,8 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
import java.io.File;
@@ -13,6 +13,6 @@
*/
public interface ConflictClient extends SvnClient {
- void resolve(@NotNull File path, @Nullable SVNDepth depth, boolean resolveProperty, boolean resolveContent, boolean resolveTree)
+ void resolve(@NotNull File path, @Nullable Depth depth, boolean resolveProperty, boolean resolveContent, boolean resolveTree)
throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictOperation.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictOperation.java
new file mode 100644
index 0000000..d0936a5
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictOperation.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.conflict;
+
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public enum ConflictOperation {
+ NONE,
+ UPDATE,
+ SWITCH,
+ MERGE;
+
+ @NotNull
+ public static ConflictOperation from(@NotNull @NonNls String operationName) {
+ return valueOf(ConflictOperation.class, operationName.toUpperCase());
+ }
+
+ @Override
+ @NonNls
+ public String toString() {
+ return super.toString().toLowerCase();
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictReason.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictReason.java
new file mode 100644
index 0000000..71eaf6d
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictReason.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.conflict;
+
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Map;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public enum ConflictReason {
+
+ EDITED("edit", "edited"),
+ OBSTRUCTED("obstruction", "obstruct", "obstructed"),
+ DELETED("delete", "deleted"),
+ MISSING("missing", "miss"),
+ UNVERSIONED("unversioned", "unversion"),
+
+ /**
+ * @since 1.6
+ */
+ ADDED("add", "added"),
+
+ /**
+ * @since 1.7
+ */
+ REPLACED("replace", "replaced"),
+
+ /**
+ * @since 1.8
+ */
+ MOVED_AWAY("moved-away"),
+ MOVED_HERE("moved-here");
+
+ @NotNull private static final Map<String, ConflictReason> ourAllReasons = ContainerUtil.newHashMap();
+
+ static {
+ for (ConflictReason reason : ConflictReason.values()) {
+ register(reason);
+ }
+ }
+
+ @NotNull private final String myKey;
+ @NotNull private final String[] myOtherKeys;
+
+ ConflictReason(@NotNull String key, @NotNull String... otherKeys) {
+ myKey = key;
+ myOtherKeys = otherKeys;
+ }
+
+ @Override
+ public String toString() {
+ return myKey;
+ }
+
+ private static void register(@NotNull ConflictReason reason) {
+ ourAllReasons.put(reason.myKey, reason);
+
+ for (String key : reason.myOtherKeys) {
+ ourAllReasons.put(key, reason);
+ }
+ }
+
+ @NotNull
+ public static ConflictReason from(@NotNull String reasonName) {
+ ConflictReason result = ourAllReasons.get(reasonName);
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unknown conflict reason " + reasonName);
+ }
+
+ return result;
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictVersion.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictVersion.java
new file mode 100644
index 0000000..cee4cf5
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictVersion.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.conflict;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.BaseNodeDescription;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.internal.wc.SVNConflictVersion;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public class ConflictVersion extends BaseNodeDescription {
+
+ private final SVNURL myRepositoryRoot;
+ private final String myPath;
+ private final long myPegRevision;
+
+ @Nullable
+ public static ConflictVersion create(@Nullable SVNConflictVersion conflictVersion) {
+ ConflictVersion result = null;
+
+ if (conflictVersion != null) {
+ result = new ConflictVersion(conflictVersion.getRepositoryRoot(), conflictVersion.getPath(), conflictVersion.getPegRevision(),
+ NodeKind.from(conflictVersion.getKind()));
+ }
+
+ return result;
+ }
+
+ public ConflictVersion(SVNURL repositoryRoot, String path, long pegRevision, @NotNull NodeKind kind) {
+ super(kind);
+ myRepositoryRoot = repositoryRoot;
+ myPath = path;
+ myPegRevision = pegRevision;
+ }
+
+ public SVNURL getRepositoryRoot() {
+ return myRepositoryRoot;
+ }
+
+ public String getPath() {
+ return myPath;
+ }
+
+ public long getPegRevision() {
+ return myPegRevision;
+ }
+
+ @NotNull
+ public NodeKind getKind() {
+ return myKind;
+ }
+
+ @NotNull
+ public String toPresentableString() {
+ StringBuilder urlBuilder = new StringBuilder();
+
+ urlBuilder.append(myRepositoryRoot != null ? myRepositoryRoot : "");
+ urlBuilder.append("/");
+ urlBuilder.append(myPath != null ? myPath : "...");
+
+ return "(" + getKind() + ") " + urlBuilder + "@" + getPegRevision();
+ }
+
+ @NotNull
+ public static String toPresentableString(@Nullable ConflictVersion version) {
+ return version == null ? "" : version.toPresentableString();
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/SvnKitConflictClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/SvnKitConflictClient.java
index b60ea38..80fab5a 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/SvnKitConflictClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/SvnKitConflictClient.java
@@ -4,7 +4,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.wc.SVNConflictChoice;
@@ -16,13 +16,13 @@
public class SvnKitConflictClient extends BaseSvnClient implements ConflictClient {
@Override
public void resolve(@NotNull File path,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean resolveProperty,
boolean resolveContent,
boolean resolveTree) throws VcsException {
try {
myVcs.getSvnKitManager().createWCClient()
- .doResolve(path, depth, resolveContent, resolveProperty, resolveTree, SVNConflictChoice.MERGED);
+ .doResolve(path, toDepth(depth), resolveContent, resolveProperty, resolveTree, SVNConflictChoice.MERGED);
}
catch (SVNException e) {
throw new VcsException(e);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/TreeConflictDescription.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/TreeConflictDescription.java
new file mode 100644
index 0000000..541b6ae
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/TreeConflictDescription.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.conflict;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.BaseNodeDescription;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.tmatesoft.svn.core.wc.SVNTreeConflictDescription;
+
+import java.io.File;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public class TreeConflictDescription extends BaseNodeDescription {
+
+ private final File myPath;
+ private final ConflictAction myConflictAction;
+ private final ConflictReason myConflictReason;
+
+ private final ConflictOperation myOperation;
+ private final ConflictVersion mySourceLeftVersion;
+ private final ConflictVersion mySourceRightVersion;
+
+ @Nullable
+ public static TreeConflictDescription create(@Nullable SVNTreeConflictDescription conflict) {
+ TreeConflictDescription result = null;
+
+ if (conflict != null) {
+ result =
+ new TreeConflictDescription(conflict.getPath(), NodeKind.from(conflict.getNodeKind()),
+ ConflictAction.from(conflict.getConflictAction().getName()),
+ ConflictReason.from(conflict.getConflictReason().getName()),
+ ConflictOperation.from(conflict.getOperation().getName()),
+ ConflictVersion.create(conflict.getSourceLeftVersion()),
+ ConflictVersion.create(conflict.getSourceRightVersion()));
+ }
+
+ return result;
+ }
+
+ public TreeConflictDescription(File path,
+ @NotNull NodeKind nodeKind,
+ ConflictAction conflictAction,
+ ConflictReason conflictReason,
+ ConflictOperation operation,
+ ConflictVersion sourceLeftVersion,
+ ConflictVersion sourceRightVersion) {
+ super(nodeKind);
+ myPath = path;
+ myConflictAction = conflictAction;
+ myConflictReason = conflictReason;
+
+ myOperation = operation;
+ mySourceLeftVersion = sourceLeftVersion;
+ mySourceRightVersion = sourceRightVersion;
+ }
+
+ // TODO: is*Conflict() methods are not really necessary in any logic - remove them
+ public boolean isTextConflict() {
+ return false;
+ }
+
+ public boolean isPropertyConflict() {
+ return false;
+ }
+
+ public boolean isTreeConflict() {
+ return true;
+ }
+
+ public File getPath() {
+ return myPath;
+ }
+
+ public ConflictAction getConflictAction() {
+ return myConflictAction;
+ }
+
+ public ConflictReason getConflictReason() {
+ return myConflictReason;
+ }
+
+ @NotNull
+ public NodeKind getNodeKind() {
+ return myKind;
+ }
+
+ public ConflictOperation getOperation() {
+ return myOperation;
+ }
+
+ public ConflictVersion getSourceLeftVersion() {
+ return mySourceLeftVersion;
+ }
+
+ public ConflictVersion getSourceRightVersion() {
+ return mySourceRightVersion;
+ }
+
+ @NotNull
+ public String toPresentableString() {
+ return "local " + getConflictReason() + ", incoming " + getConflictAction() + " upon " + getOperation();
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/CmdCopyMoveClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/CmdCopyMoveClient.java
index e73e9fb..6a42a0f 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/CmdCopyMoveClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/CmdCopyMoveClient.java
@@ -6,12 +6,12 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.checkin.CmdCheckinClient;
import org.jetbrains.idea.svn.checkin.CommitEventHandler;
import org.jetbrains.idea.svn.commandLine.BaseUpdateCommandListener;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -78,7 +78,7 @@
@NotNull File destination,
@Nullable SVNRevision revision,
boolean makeParents,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable ProgressTracker handler) throws VcsException {
List<String> parameters = new ArrayList<String>();
CommandUtil.put(parameters, source);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/CopyMoveClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/CopyMoveClient.java
index dd4395f..b4b9ed9 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/CopyMoveClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/CopyMoveClient.java
@@ -3,9 +3,9 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.api.SvnClient;
import org.jetbrains.idea.svn.checkin.CommitEventHandler;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -41,5 +41,5 @@
@NotNull File destination,
@Nullable SVNRevision revision,
boolean makeParents,
- @Nullable ISVNEventHandler handler) throws VcsException;
+ @Nullable ProgressTracker handler) throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/SvnKitCopyMoveClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/SvnKitCopyMoveClient.java
index 1a46e7c..7f6f64c 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/SvnKitCopyMoveClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/copy/SvnKitCopyMoveClient.java
@@ -4,11 +4,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.checkin.CommitEventHandler;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNCommitInfo;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNCopyClient;
import org.tmatesoft.svn.core.wc.SVNCopySource;
import org.tmatesoft.svn.core.wc.SVNRevision;
@@ -50,7 +50,7 @@
final SVNCopySource copySource = createCopySource(source, revision);
SVNCopyClient client = myVcs.getSvnKitManager().createCopyClient();
- client.setEventHandler(handler);
+ client.setEventHandler(toEventHandler(handler));
SVNCommitInfo info;
try {
@@ -69,9 +69,9 @@
@NotNull File destination,
@Nullable SVNRevision revision,
boolean makeParents,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable ProgressTracker handler) throws VcsException {
SVNCopyClient client = myVcs.getSvnKitManager().createCopyClient();
- client.setEventHandler(handler);
+ client.setEventHandler(toEventHandler(handler));
try {
client.doCopy(new SVNCopySource[]{createCopySource(source, revision)}, destination, false, makeParents, true);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/CmdDeleteClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/CmdDeleteClient.java
index dfd6d72..9d1d0c0 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/CmdDeleteClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/CmdDeleteClient.java
@@ -5,12 +5,12 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.checkin.CmdCheckinClient;
import org.jetbrains.idea.svn.commandLine.BaseUpdateCommandListener;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -23,7 +23,7 @@
public class CmdDeleteClient extends BaseSvnClient implements DeleteClient {
@Override
- public void delete(@NotNull File path, boolean force, boolean dryRun, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void delete(@NotNull File path, boolean force, boolean dryRun, @Nullable ProgressTracker handler) throws VcsException {
// TODO: no actual support for dryRun in 'svn delete', SvnKit performs certain validation on file status and svn:externals property
// TODO: probably add some widespread checks for dryRun delete - but most likely this should be placed upper - in merge logic
if (!dryRun) {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/DeleteClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/DeleteClient.java
index ec6f014..a609354 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/DeleteClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/DeleteClient.java
@@ -3,9 +3,9 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.api.SvnClient;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import java.io.File;
@@ -14,7 +14,7 @@
*/
public interface DeleteClient extends SvnClient {
- void delete(@NotNull File path, boolean force, boolean dryRun, @Nullable ISVNEventHandler handler) throws VcsException;
+ void delete(@NotNull File path, boolean force, boolean dryRun, @Nullable ProgressTracker handler) throws VcsException;
long delete(@NotNull SVNURL url, @NotNull String message) throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/SvnKitDeleteClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/SvnKitDeleteClient.java
index 7e67b17..c2cdb42 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/SvnKitDeleteClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/delete/SvnKitDeleteClient.java
@@ -4,11 +4,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNCommitInfo;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNWCClient;
import java.io.File;
@@ -19,9 +19,9 @@
public class SvnKitDeleteClient extends BaseSvnClient implements DeleteClient {
@Override
- public void delete(@NotNull File path, boolean force, boolean dryRun, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void delete(@NotNull File path, boolean force, boolean dryRun, @Nullable ProgressTracker handler) throws VcsException {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
- client.setEventHandler(handler);
+ client.setEventHandler(toEventHandler(handler));
try {
client.doDelete(path, force, dryRun);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/BranchMerger.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/BranchMerger.java
index 463ed6e..4dfcf57 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/BranchMerger.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/BranchMerger.java
@@ -21,13 +21,14 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.diff.DiffOptions;
import org.jetbrains.idea.svn.integrate.IMerger;
import org.jetbrains.idea.svn.integrate.MergeClient;
import org.jetbrains.idea.svn.update.UpdateEventHandler;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNDiffOptions;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -81,12 +82,13 @@
client.merge(SvnTarget.fromURL(mySourceUrl), destination, false, createDiffOptions(), myHandler);
} else {
client.merge(SvnTarget.fromURL(mySourceUrl, SVNRevision.create(mySourceCopyRevision)),
- SvnTarget.fromURL(mySourceUrl, mySourceLatestRevision), destination, SVNDepth.INFINITY, true, false, false, true,
+ SvnTarget.fromURL(mySourceUrl, mySourceLatestRevision), destination, Depth.INFINITY, true, false, false, true,
createDiffOptions(), myHandler);
}
}
- private SVNDiffOptions createDiffOptions() {
+ @NotNull
+ private DiffOptions createDiffOptions() {
return myVcs.getSvnConfiguration().getMergeOptions();
}
@@ -110,7 +112,7 @@
try {
result = SvnUtil.getHeadRevision(myVcs, mySourceUrl);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
LOG.info(e);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CopiesPanel.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CopiesPanel.java
index 37dd5a5..9ca5b89 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CopiesPanel.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CopiesPanel.java
@@ -47,10 +47,10 @@
import org.jetbrains.idea.svn.actions.CleanupWorker;
import org.jetbrains.idea.svn.actions.SelectBranchPopup;
import org.jetbrains.idea.svn.api.ClientFactory;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew;
import org.jetbrains.idea.svn.checkout.SvnCheckoutProvider;
import org.jetbrains.idea.svn.integrate.QuickMergeInteractionImpl;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
import org.tmatesoft.svn.core.wc.SVNRevision;
@@ -228,7 +228,7 @@
if (result == Messages.OK) {
// update of view will be triggered by roots changed event
SvnCheckoutProvider.checkout(myVcs.getProject(), new File(wcInfo.getPath()), wcInfo.getRootUrl(), SVNRevision.HEAD,
- SVNDepth.INFINITY, false, null, wcInfo.getFormat());
+ Depth.INFINITY, false, null, wcInfo.getFormat());
}
} else if (CHANGE_FORMAT.equals(e.getDescription())) {
changeFormat(wcInfo, upgradeFormats);
@@ -296,7 +296,7 @@
sb.append("<tr valign=\"top\"><td>Format:</td><td colspan=\"2\">").append(info.getFormat().getName()).append("</td></tr>");
}
- if (!SVNDepth.INFINITY.equals(info.getStickyDepth()) && !info.hasError()) {
+ if (!Depth.INFINITY.equals(info.getStickyDepth()) && !info.hasError()) {
// can fix
sb.append("<tr valign=\"top\"><td>Depth:</td><td>").append(info.getStickyDepth().getName()).append("</td><td><a href=\"").
append(FIX_DEPTH).append("\">Fix</a></td></tr>");
@@ -312,7 +312,7 @@
sb.append("<tr valign=\"top\"><td colspan=\"3\"><i>").append("Working copy root</i></td></tr>");
}
if (!info.hasError()) {
- if (WorkingCopyFormat.ONE_DOT_SEVEN.equals(info.getFormat()) || WorkingCopyFormat.ONE_DOT_EIGHT.equals(info.getFormat())) {
+ if (info.getFormat().isOrGreater(WorkingCopyFormat.ONE_DOT_SEVEN)) {
sb.append("<tr valign=\"top\"><td colspan=\"3\"><a href=\"").append(CLEANUP).append("\">Cleanup</a></td></tr>");
}
sb.append("<tr valign=\"top\"><td colspan=\"3\"><a href=\"").append(CONFIGURE_BRANCHES).append("\">Configure Branches</a></td></tr>");
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CreateBranchOrTagDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CreateBranchOrTagDialog.java
index 9c5d194..a09de54 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CreateBranchOrTagDialog.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CreateBranchOrTagDialog.java
@@ -37,10 +37,10 @@
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew;
+import org.jetbrains.idea.svn.info.Info;
import org.jetbrains.idea.svn.update.SvnRevisionPanel;
import org.tmatesoft.svn.core.internal.util.SVNEncodingUtil;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import javax.swing.*;
@@ -264,7 +264,7 @@
super.init();
SvnVcs vcs = SvnVcs.getInstance(myProject);
String revStr = "";
- SVNInfo info = vcs.getInfo(mySrcFile);
+ Info info = vcs.getInfo(mySrcFile);
if (info != null) {
mySrcURL = info.getURL() == null ? null : info.getURL().toString();
revStr = String.valueOf(info.getRevision());
@@ -349,7 +349,7 @@
return true;
}
else if (myWorkingCopyRadioButton.isSelected()) {
- SVNInfo info = SvnVcs.getInstance(myProject).getInfo(mySrcFile);
+ Info info = SvnVcs.getInstance(myProject).getInfo(mySrcFile);
String srcUrl = info != null && info.getURL() != null ? info.getURL().toString() : null;
if (srcUrl == null) {
myErrorLabel.setText(SvnBundle.message("create.branch.no.working.copy.error", myWorkingCopyField.getText()));
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/LoadRecentBranchRevisions.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/LoadRecentBranchRevisions.java
index 5748aa5..b710823 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/LoadRecentBranchRevisions.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/LoadRecentBranchRevisions.java
@@ -27,12 +27,8 @@
import com.intellij.util.continuation.Where;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.SvnBundle;
-import org.jetbrains.idea.svn.history.SvnChangeList;
-import org.jetbrains.idea.svn.history.SvnCommittedChangesProvider;
-import org.jetbrains.idea.svn.history.SvnRepositoryLocation;
-import org.jetbrains.idea.svn.history.TreeStructureNode;
+import org.jetbrains.idea.svn.history.*;
import org.jetbrains.idea.svn.mergeinfo.OneShotMergeInfoHelper;
-import org.tmatesoft.svn.core.SVNLogEntry;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
import java.util.ArrayList;
@@ -94,12 +90,12 @@
ProgressManager.progress2(
SvnBundle.message("progress.text2.collecting.history", myMergeContext.getSourceUrl() + (myFirst > 0 ? ("@" + myFirst) : "")));
- final List<Pair<SvnChangeList, TreeStructureNode<SVNLogEntry>>> list = new ArrayList<Pair<SvnChangeList, TreeStructureNode<SVNLogEntry>>>();
+ final List<Pair<SvnChangeList, LogHierarchyNode>> list = new ArrayList<Pair<SvnChangeList, LogHierarchyNode>>();
try {
committedChangesProvider.getCommittedChangesWithMergedRevisons(settings, new SvnRepositoryLocation(myMergeContext.getSourceUrl()),
myBunchSize + (myFirst > 0 ? 2 : 1),
- new PairConsumer<SvnChangeList, TreeStructureNode<SVNLogEntry>>() {
- public void consume(SvnChangeList svnList, TreeStructureNode<SVNLogEntry> tree) {
+ new PairConsumer<SvnChangeList, LogHierarchyNode>() {
+ public void consume(SvnChangeList svnList, LogHierarchyNode tree) {
indicator.setText2(SvnBundle.message("progress.text2.processing.revision", svnList.getNumber()));
list.add(Pair.create(svnList, tree));
}
@@ -109,7 +105,7 @@
return;
}
myCommittedChangeLists = new ArrayList<CommittedChangeList>();
- for (Pair<SvnChangeList, TreeStructureNode<SVNLogEntry>> pair : list) {
+ for (Pair<SvnChangeList, LogHierarchyNode> pair : list) {
// do not take first since it's equal
if (myFirst > 0 && myFirst == pair.getFirst().getNumber()) continue;
// TODO: Currently path filtering with QuickMerge.checkListForPaths is not applied as it removes some necessary revisions
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PropertiesComponent.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PropertiesComponent.java
index 81116e6..860c524e 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PropertiesComponent.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PropertiesComponent.java
@@ -36,6 +36,7 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnPropertyKeys;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.wc.ISVNPropertyHandler;
import org.tmatesoft.svn.core.wc.SVNPropertyData;
@@ -166,7 +167,7 @@
public void handleProperty(long revision, SVNPropertyData property) throws SVNException {
}
};
- vcs.getFactory(file).createPropertyClient().list(SvnTarget.fromFile(file, SVNRevision.UNDEFINED), SVNRevision.WORKING, SVNDepth.EMPTY,
+ vcs.getFactory(file).createPropertyClient().list(SvnTarget.fromFile(file, SVNRevision.UNDEFINED), SVNRevision.WORKING, Depth.EMPTY,
handler);
}
catch (VcsException e) {
@@ -272,7 +273,7 @@
try {
myVcs.getFactory(myFile).createPropertyClient()
.setProperty(myFile, property, value != null ? SVNPropertyValue.create(value) : null,
- SVNDepth.getInfinityOrEmptyDepth(recursive), force);
+ Depth.allOrEmpty(recursive), force);
}
catch (VcsException error) {
VcsBalloonProblemNotifier
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserComponent.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserComponent.java
index 78acfe3..0fd1f06 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserComponent.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserComponent.java
@@ -18,7 +18,6 @@
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataProvider;
-import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.project.Project;
@@ -37,11 +36,10 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
import org.jetbrains.idea.svn.dialogs.browserCache.Expander;
import org.jetbrains.idea.svn.history.SvnFileRevision;
-import org.tmatesoft.svn.core.SVNDirEntry;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNRevision;
@@ -152,7 +150,7 @@
}
@Nullable
- public SVNDirEntry getSelectedEntry() {
+ public DirectoryEntry getSelectedEntry() {
TreePath selection = myRepositoryTree.getSelectionPath();
if (selection == null) {
return null;
@@ -241,8 +239,8 @@
final RepositoryTreeNode node = getSelectedNode();
if (node == null) return null;
- SVNDirEntry entry = node.getSVNDirEntry();
- if (entry == null || entry.getKind() != SVNNodeKind.FILE) {
+ DirectoryEntry entry = node.getSVNDirEntry();
+ if (entry == null || !entry.isFile()) {
return null;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java
index 5fe1996..191acf3 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java
@@ -53,6 +53,7 @@
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.actions.BrowseRepositoryAction;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
import org.jetbrains.idea.svn.checkout.SvnCheckoutProvider;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.dialogs.browser.*;
@@ -60,7 +61,9 @@
import org.jetbrains.idea.svn.dialogs.browserCache.KeepingExpandedExpander;
import org.jetbrains.idea.svn.dialogs.browserCache.SyntheticWorker;
import org.jetbrains.idea.svn.history.SvnRepositoryLocation;
-import org.tmatesoft.svn.core.*;
+import org.tmatesoft.svn.core.SVNErrorCode;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -345,8 +348,8 @@
if (node == null) {
return;
}
- boolean isDirectory = node.getUserObject() instanceof SVNURL ||
- (node.getSVNDirEntry() != null && node.getSVNDirEntry().getKind() == SVNNodeKind.DIR);
+ boolean isDirectory =
+ node.getUserObject() instanceof SVNURL || (node.getSVNDirEntry() != null && node.getSVNDirEntry().isDirectory());
String url = node.getURL().toDecodedString();
AbstractVcsHelper.getInstance(myProject)
@@ -500,14 +503,8 @@
}
public void update(AnActionEvent e) {
- RepositoryTreeNode node = myBrowserComponent.getSelectedNode();
//e.getPresentation().setText(SvnBundle.message("repository.browser.new.folder.action"), true);
- if (node != null) {
- SVNDirEntry entry = node.getSVNDirEntry();
- e.getPresentation().setEnabled(entry == null || entry.getKind() == SVNNodeKind.DIR);
- } else {
- e.getPresentation().setEnabled(false);
- }
+ setEnabled(e, myBrowserComponent.getSelectedNode());
}
public void actionPerformed(AnActionEvent e) {
@@ -537,14 +534,8 @@
protected class DiffAction extends AnAction {
public void update(AnActionEvent e) {
- RepositoryTreeNode node = getRepositoryBrowser().getSelectedNode();
e.getPresentation().setText("Compare With...", true);
- if (node != null) {
- SVNDirEntry entry = node.getSVNDirEntry();
- e.getPresentation().setEnabled(entry == null || entry.getKind() == SVNNodeKind.DIR);
- } else {
- e.getPresentation().setEnabled(false);
- }
+ setEnabled(e, getRepositoryBrowser().getSelectedNode());
}
public void actionPerformed(AnActionEvent e) {
@@ -854,14 +845,8 @@
public void update(AnActionEvent e) {
e.getPresentation().setVisible(showImportAction());
e.getPresentation().setText(SvnBundle.message("repository.browser.import.action"));
- RepositoryTreeNode node = getRepositoryBrowser().getSelectedNode();
- final boolean running = ProjectLevelVcsManager.getInstance(myProject).isBackgroundVcsOperationRunning();
- if (node != null) {
- SVNDirEntry entry = node.getSVNDirEntry();
- e.getPresentation().setEnabled((entry == null || entry.getKind() == SVNNodeKind.DIR) && (! running));
- } else {
- e.getPresentation().setEnabled(false);
- }
+ setEnabled(e, getRepositoryBrowser().getSelectedNode(),
+ ProjectLevelVcsManager.getInstance(myProject).isBackgroundVcsOperationRunning());
}
public void actionPerformed(AnActionEvent e) {
@@ -897,13 +882,7 @@
protected class CheckoutAction extends AnAction {
public void update(AnActionEvent e) {
e.getPresentation().setText("_Checkout...", true);
- RepositoryTreeNode node = getRepositoryBrowser().getSelectedNode();
- if (node != null) {
- SVNDirEntry entry = node.getSVNDirEntry();
- e.getPresentation().setEnabled(entry == null || entry.getKind() == SVNNodeKind.DIR);
- } else {
- e.getPresentation().setEnabled(false);
- }
+ setEnabled(e, getRepositoryBrowser().getSelectedNode());
}
public void actionPerformed(AnActionEvent e) {
final RepositoryTreeNode selectedNode = getSelectedNode();
@@ -914,6 +893,14 @@
}
}
+ private static void setEnabled(@NotNull AnActionEvent e, @Nullable RepositoryTreeNode node) {
+ setEnabled(e, node, false);
+ }
+
+ private static void setEnabled(@NotNull AnActionEvent e, @Nullable RepositoryTreeNode node, boolean isRunning) {
+ e.getPresentation().setEnabled(node != null && (node.getSVNDirEntry() == null || node.getSVNDirEntry().isDirectory()) && !isRunning);
+ }
+
protected class BrowseChangesAction extends AnAction {
public BrowseChangesAction() {
super(SvnBundle.message("repository.browser.browse.changes.action"),
@@ -1051,14 +1038,14 @@
SVNURL url = selectedNode.getURL();
String relativePath = "";
- final SVNDirEntry dirEntry = selectedNode.getSVNDirEntry();
- if (dirEntry != null) {
- if (dirEntry.getRepositoryRoot() != null) {
- if (! dirEntry.getRepositoryRoot().equals(url)) {
- relativePath = SVNPathUtil.getRelativePath(dirEntry.getRepositoryRoot().toString(), url.toDecodedString());
+ final DirectoryEntry entry = selectedNode.getSVNDirEntry();
+ if (entry != null) {
+ if (entry.getRepositoryRoot() != null) {
+ if (! entry.getRepositoryRoot().equals(url)) {
+ relativePath = SVNPathUtil.getRelativePath(entry.getRepositoryRoot().toString(), url.toDecodedString());
}
} else {
- relativePath = dirEntry.getRelativePath();
+ relativePath = entry.getRelativePath();
}
} else {
relativePath = url.getPath();
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryTreeNode.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryTreeNode.java
index d3ef02d..f21ca17 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryTreeNode.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryTreeNode.java
@@ -21,11 +21,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
import org.jetbrains.idea.svn.dialogs.browserCache.Expander;
import org.jetbrains.idea.svn.dialogs.browserCache.NodeLoadState;
-import org.tmatesoft.svn.core.SVNDirEntry;
-import org.tmatesoft.svn.core.SVNErrorMessage;
-import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
@@ -89,7 +87,7 @@
}
public boolean isLeaf() {
- return myUserObject instanceof SVNDirEntry ? ((SVNDirEntry) myUserObject).getKind() == SVNNodeKind.FILE : false;
+ return myUserObject instanceof DirectoryEntry && ((DirectoryEntry)myUserObject).isFile();
}
public TreeNode getParent() {
@@ -146,9 +144,9 @@
}
@Nullable
- public SVNDirEntry getSVNDirEntry() {
- if (myUserObject instanceof SVNDirEntry) {
- return (SVNDirEntry) myUserObject;
+ public DirectoryEntry getSVNDirEntry() {
+ if (myUserObject instanceof DirectoryEntry) {
+ return (DirectoryEntry) myUserObject;
}
return null;
}
@@ -161,7 +159,7 @@
}
public boolean isRepositoryRoot() {
- return ! (myUserObject instanceof SVNDirEntry);
+ return ! (myUserObject instanceof DirectoryEntry);
}
@NotNull
@@ -194,13 +192,13 @@
return myModel.isDisposed();
}
- public void setChildren(final List<SVNDirEntry> children, final NodeLoadState state) {
+ public void setChildren(final List<DirectoryEntry> children, final NodeLoadState state) {
final List<TreeNode> nodes = new ArrayList<TreeNode>();
- for (final SVNDirEntry entry : children) {
- if (!myModel.isShowFiles() && entry.getKind() != SVNNodeKind.DIR) {
+ for (final DirectoryEntry entry : children) {
+ if (!myModel.isShowFiles() && !entry.isDirectory()) {
continue;
}
- nodes.add(new RepositoryTreeNode(myModel, this, entry.getURL(), entry, state));
+ nodes.add(new RepositoryTreeNode(myModel, this, entry.getUrl(), entry, state));
}
myChildrenLoadState = state;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SelectLocationDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SelectLocationDialog.java
index 10bfc09..a6ca6ad 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SelectLocationDialog.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SelectLocationDialog.java
@@ -28,8 +28,8 @@
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.dialogs.browser.UrlOpeningExpander;
-import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNEncodingUtil;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
@@ -79,7 +79,7 @@
boolean showFiles,
String errorMessage) {
try {
- SVNURL svnUrl = SVNURL.parseURIEncoded(url);
+ SVNURL svnUrl = SvnUtil.createUrl(url);
final SVNURL repositoryUrl = initRoot(project, svnUrl);
if (repositoryUrl == null) {
Messages.showErrorDialog(project, "Can not detect repository root for URL: " + url,
@@ -91,7 +91,7 @@
dialog.show();
return dialog;
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
Messages.showErrorDialog(project, errorMessage != null ? errorMessage : e.getMessage(),
SvnBundle.message("dialog.title.select.repository.location"));
return null;
@@ -124,15 +124,15 @@
}
@Nullable
- private static SVNURL initRoot(final Project project, final SVNURL url) throws SVNException {
+ private static SVNURL initRoot(final Project project, final SVNURL url) throws SvnBindException {
final Ref<SVNURL> result = new Ref<SVNURL>();
- final Ref<SVNException> excRef = new Ref<SVNException>();
+ final Ref<SvnBindException> excRef = new Ref<SvnBindException>();
ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
public void run() {
try {
result.set(SvnUtil.getRepositoryRoot(SvnVcs.getInstance(project), url));
- } catch (SVNException e) {
+ } catch (SvnBindException e) {
excRef.set(e);
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SetPropertyDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SetPropertyDialog.java
index 421f0a0..28375d2 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SetPropertyDialog.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SetPropertyDialog.java
@@ -27,8 +27,8 @@
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnPropertyKeys;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.properties.PropertyClient;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNPropertyValue;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.ISVNPropertyHandler;
@@ -221,7 +221,7 @@
};
PropertyClient client = myVCS.getFactory(file).createPropertyClient();
- client.list(SvnTarget.fromFile(file, SVNRevision.WORKING), SVNRevision.WORKING, SVNDepth.EMPTY, handler);
+ client.list(SvnTarget.fromFile(file, SVNRevision.WORKING), SVNRevision.WORKING, Depth.EMPTY, handler);
}
catch (VcsException e) {
LOG.info(e);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnFormatWorker.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnFormatWorker.java
index 8e99055..bfdadef 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnFormatWorker.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnFormatWorker.java
@@ -33,11 +33,11 @@
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.WorkingCopyFormat;
import org.jetbrains.idea.svn.api.ClientFactory;
+import org.jetbrains.idea.svn.api.EventAction;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.tmatesoft.svn.core.SVNCancelException;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNEventAction;
import java.io.File;
import java.util.ArrayList;
@@ -111,7 +111,7 @@
String cleanupMessage = SvnBundle.message("action.Subversion.cleanup.progress.text", path.getAbsolutePath());
String upgradeMessage =
SvnBundle.message("action.change.wcopy.format.task.progress.text", path.getAbsolutePath(), wcInfo.getFormat(), myNewFormat);
- ISVNEventHandler handler = createUpgradeHandler(indicator, cleanupMessage, upgradeMessage);
+ ProgressTracker handler = createUpgradeHandler(indicator, cleanupMessage, upgradeMessage);
getFactory(path, myNewFormat).createUpgradeClient().upgrade(path, myNewFormat, handler);
} catch (Throwable e) {
@@ -155,22 +155,22 @@
return result;
}
- private static ISVNEventHandler createUpgradeHandler(@NotNull final ProgressIndicator indicator,
+ private static ProgressTracker createUpgradeHandler(@NotNull final ProgressIndicator indicator,
@NotNull final String cleanupMessage,
@NotNull final String upgradeMessage) {
- return new ISVNEventHandler() {
+ return new ProgressTracker() {
@Override
- public void handleEvent(SVNEvent event, double progress) throws SVNException {
+ public void consume(ProgressEvent event) throws SVNException {
if (event.getFile() != null) {
- if (SVNEventAction.UPGRADED_PATH.equals(event.getAction())) {
+ if (EventAction.UPGRADED_PATH.equals(event.getAction())) {
indicator.setText2("Upgraded path " + VcsUtil.getPathForProgressPresentation(event.getFile()));
}
// fake event indicating cleanup start
- if (SVNEventAction.UPDATE_STARTED.equals(event.getAction())) {
+ if (EventAction.UPDATE_STARTED.equals(event.getAction())) {
indicator.setText(cleanupMessage);
}
// fake event indicating upgrade start
- if (SVNEventAction.UPDATE_COMPLETED.equals(event.getAction())) {
+ if (EventAction.UPDATE_COMPLETED.equals(event.getAction())) {
indicator.setText(upgradeMessage);
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnRepositoryTreeCellRenderer.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnRepositoryTreeCellRenderer.java
index 1215be7..6ecd89f 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnRepositoryTreeCellRenderer.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnRepositoryTreeCellRenderer.java
@@ -21,9 +21,8 @@
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.PlatformIcons;
import com.intellij.util.text.DateFormatUtil;
-import org.tmatesoft.svn.core.SVNDirEntry;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
import org.tmatesoft.svn.core.SVNErrorMessage;
-import org.tmatesoft.svn.core.SVNNodeKind;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
@@ -44,7 +43,7 @@
String name = node.getSVNDirEntry().getName();
append(name, node.isCached() ? SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES);
if (myIsShowDetails) {
- SVNDirEntry entry = node.getSVNDirEntry();
+ DirectoryEntry entry = node.getSVNDirEntry();
append(" " + entry.getRevision(), SimpleTextAttributes.GRAY_ATTRIBUTES);
if (entry.getAuthor() != null) {
append(" " + entry.getAuthor(), SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
@@ -53,11 +52,9 @@
append(" " + DateFormatUtil.formatPrettyDateTime(entry.getDate()), SimpleTextAttributes.GRAY_ATTRIBUTES);
}
}
- if (node.getSVNDirEntry().getKind() == SVNNodeKind.FILE) {
- setIcon(FileTypeManager.getInstance().getFileTypeByFileName(name).getIcon());
- } else {
- setIcon(PlatformIcons.DIRECTORY_CLOSED_ICON);
- }
+ setIcon(node.getSVNDirEntry().isFile()
+ ? FileTypeManager.getInstance().getFileTypeByFileName(name).getIcon()
+ : PlatformIcons.DIRECTORY_CLOSED_ICON);
}
} else if (value instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/WCInfo.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/WCInfo.java
index a75fa4a..8fc57db 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/WCInfo.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/WCInfo.java
@@ -20,22 +20,22 @@
import org.jetbrains.idea.svn.NestedCopyType;
import org.jetbrains.idea.svn.RootUrlInfo;
import org.jetbrains.idea.svn.WorkingCopyFormat;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.SVNException;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNURL;
public class WCInfo implements WCPaths {
private final boolean myIsWcRoot;
- private final SVNDepth myStickyDepth;
+ private final Depth myStickyDepth;
@NotNull private final RootUrlInfo myRootInfo;
- public WCInfo(@NotNull RootUrlInfo rootInfo, boolean isWcRoot, SVNDepth stickyDepth) {
+ public WCInfo(@NotNull RootUrlInfo rootInfo, boolean isWcRoot, Depth stickyDepth) {
myRootInfo = rootInfo;
myIsWcRoot = isWcRoot;
myStickyDepth = stickyDepth;
}
- public SVNDepth getStickyDepth() {
+ public Depth getStickyDepth() {
return myStickyDepth;
}
@@ -70,7 +70,7 @@
public String getErrorMessage() {
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
- SVNException error = getRootInfo().getNode().getError();
+ SvnBindException error = getRootInfo().getNode().getError();
return error != null ? error.getMessage() : "";
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/CheckoutOptionsDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/CheckoutOptionsDialog.java
index b5c3782..e42fdd5 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/CheckoutOptionsDialog.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/CheckoutOptionsDialog.java
@@ -30,9 +30,9 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.DepthCombo;
import org.jetbrains.idea.svn.SvnBundle;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.revision.SvnSelectRevisionPanel;
import org.jetbrains.idea.svn.update.SvnRevisionPanel;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNRevision;
@@ -147,7 +147,7 @@
return (objects == null) || (objects.length != 1) ? null : (File) objects[0];
}
- public SVNDepth getDepth() {
+ public Depth getDepth() {
return myDepthCombo.getDepth();
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/ExportOptionsDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/ExportOptionsDialog.java
index 38aff96..7f6de72 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/ExportOptionsDialog.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/ExportOptionsDialog.java
@@ -26,7 +26,7 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.DepthCombo;
import org.jetbrains.idea.svn.SvnBundle;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
import org.tmatesoft.svn.core.SVNURL;
import javax.swing.*;
@@ -64,7 +64,7 @@
return new File(myPathField.getText());
}
- public SVNDepth getDepth() {
+ public Depth getDepth() {
return myDepth.getDepth();
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/ImportOptionsDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/ImportOptionsDialog.java
index aba7cf7..0694247 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/ImportOptionsDialog.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/ImportOptionsDialog.java
@@ -29,7 +29,7 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.DepthCombo;
import org.jetbrains.idea.svn.SvnBundle;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
import org.tmatesoft.svn.core.SVNURL;
import javax.swing.*;
@@ -68,7 +68,7 @@
return new File(myPathField.getText());
}
- public SVNDepth getDepth() {
+ public Depth getDepth() {
return myDepth.getDepth();
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/CacheLoader.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/CacheLoader.java
index 07d2d60..d80efb9 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/CacheLoader.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/CacheLoader.java
@@ -16,9 +16,8 @@
package org.jetbrains.idea.svn.dialogs.browserCache;
import com.intellij.openapi.components.ServiceManager;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
import org.jetbrains.idea.svn.dialogs.RepositoryTreeNode;
-import org.tmatesoft.svn.core.SVNDirEntry;
-import org.tmatesoft.svn.core.SVNErrorMessage;
import javax.swing.*;
import java.util.List;
@@ -40,7 +39,7 @@
public void run() {
final String nodeUrl = node.getURL().toString();
- final List<SVNDirEntry> cached = myCache.getChildren(nodeUrl);
+ final List<DirectoryEntry> cached = myCache.getChildren(nodeUrl);
if (cached != null) {
refreshNode(node, cached, expander);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/Loader.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/Loader.java
index 774b0718..ab2b6dd 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/Loader.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/Loader.java
@@ -15,9 +15,8 @@
*/
package org.jetbrains.idea.svn.dialogs.browserCache;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
import org.jetbrains.idea.svn.dialogs.RepositoryTreeNode;
-import org.tmatesoft.svn.core.SVNDirEntry;
-import org.tmatesoft.svn.core.SVNErrorMessage;
import java.util.List;
@@ -47,7 +46,7 @@
existingNode.setErrorNode(text, getNodeLoadState());
}
- protected void refreshNode(final RepositoryTreeNode node, final List<SVNDirEntry> data, final Expander expander) {
+ protected void refreshNode(final RepositoryTreeNode node, final List<DirectoryEntry> data, final Expander expander) {
if (node.isDisposed()) {
return;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/RepositoryLoader.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/RepositoryLoader.java
index 4c9fc92..319699c 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/RepositoryLoader.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/RepositoryLoader.java
@@ -23,7 +23,10 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.auth.SvnAuthenticationProvider;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
+import org.jetbrains.idea.svn.browse.DirectoryEntryConsumer;
import org.jetbrains.idea.svn.dialogs.RepositoryTreeNode;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.wc.SVNRevision;
@@ -56,7 +59,7 @@
}
}
- private void setResults(final Pair<RepositoryTreeNode, Expander> data, final List<SVNDirEntry> children) {
+ private void setResults(final Pair<RepositoryTreeNode, Expander> data, final List<DirectoryEntry> children) {
myCache.put(data.first.getURL().toString(), children);
refreshNode(data.first, children, data.second);
}
@@ -114,19 +117,21 @@
}
public void run() {
- final Collection<SVNDirEntry> entries = new TreeSet<SVNDirEntry>();
+ final Collection<DirectoryEntry> entries = new TreeSet<DirectoryEntry>();
final RepositoryTreeNode node = myData.first;
final SvnVcs vcs = node.getVcs();
SvnAuthenticationProvider.forceInteractive();
- ISVNDirEntryHandler handler = new ISVNDirEntryHandler() {
- public void handleDirEntry(final SVNDirEntry dirEntry) throws SVNException {
- entries.add(dirEntry);
+ DirectoryEntryConsumer handler = new DirectoryEntryConsumer() {
+
+ @Override
+ public void consume(final DirectoryEntry entry) throws SVNException {
+ entries.add(entry);
}
};
try {
SvnTarget target = SvnTarget.fromURL(node.getURL());
- vcs.getFactoryFromSettings().createBrowseClient().list(target, SVNRevision.HEAD, SVNDepth.IMMEDIATES, handler);
+ vcs.getFactoryFromSettings().createBrowseClient().list(target, SVNRevision.HEAD, Depth.IMMEDIATES, handler);
}
catch (final VcsException e) {
SwingUtilities.invokeLater(new Runnable() {
@@ -142,7 +147,7 @@
SwingUtilities.invokeLater(new Runnable() {
public void run() {
- setResults(myData, new ArrayList<SVNDirEntry>(entries));
+ setResults(myData, new ArrayList<DirectoryEntry>(entries));
startNext();
}
});
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/SvnRepositoryCache.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/SvnRepositoryCache.java
index b615abb..d038dc1 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/SvnRepositoryCache.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/SvnRepositoryCache.java
@@ -18,15 +18,14 @@
import com.intellij.openapi.components.ServiceManager;
import com.intellij.util.containers.SoftHashMap;
import org.jetbrains.annotations.Nullable;
-import org.tmatesoft.svn.core.SVNDirEntry;
-import org.tmatesoft.svn.core.SVNErrorMessage;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class SvnRepositoryCache {
- private final Map<String, List<SVNDirEntry>> myMap;
+ private final Map<String, List<DirectoryEntry>> myMap;
private final Map<String, String> myErrorsMap;
public static SvnRepositoryCache getInstance() {
@@ -34,12 +33,12 @@
}
private SvnRepositoryCache() {
- myMap = new SoftHashMap<String, List<SVNDirEntry>>();
+ myMap = new SoftHashMap<String, List<DirectoryEntry>>();
myErrorsMap = new SoftHashMap<String, String>();
}
@Nullable
- public List<SVNDirEntry> getChildren(final String parent) {
+ public List<DirectoryEntry> getChildren(final String parent) {
return myMap.get(parent);
}
@@ -53,7 +52,7 @@
myErrorsMap.put(parent, error);
}
- public void put(final String parent, List<SVNDirEntry> children) {
+ public void put(final String parent, List<DirectoryEntry> children) {
myErrorsMap.remove(parent);
myMap.put(parent, children);
}
@@ -64,8 +63,8 @@
}
public void clear(final String repositoryRootUrl) {
- for (Iterator<Map.Entry<String, List<SVNDirEntry>>> iterator = myMap.entrySet().iterator(); iterator.hasNext();) {
- final Map.Entry<String, List<SVNDirEntry>> entry = iterator.next();
+ for (Iterator<Map.Entry<String, List<DirectoryEntry>>> iterator = myMap.entrySet().iterator(); iterator.hasNext();) {
+ final Map.Entry<String, List<DirectoryEntry>> entry = iterator.next();
if (entry.getKey().startsWith(repositoryRootUrl)) {
iterator.remove();
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/SyntheticWorker.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/SyntheticWorker.java
index 5ee07d8..5d7c3c3 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/SyntheticWorker.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browserCache/SyntheticWorker.java
@@ -17,12 +17,12 @@
import com.intellij.util.NotNullFunction;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
+import org.jetbrains.idea.svn.checkin.CommitInfo;
import org.jetbrains.idea.svn.dialogs.RepositoryTreeNode;
-import org.tmatesoft.svn.core.SVNDirEntry;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNRevision;
import java.util.*;
@@ -44,13 +44,13 @@
return;
}
- final List<SVNDirEntry> children = myCache.getChildren(parentUrl);
+ final List<DirectoryEntry> children = myCache.getChildren(parentUrl);
if (children == null) {
return;
}
- for (Iterator<SVNDirEntry> iterator = children.iterator(); iterator.hasNext();) {
- final SVNDirEntry entry = iterator.next();
- if (myUrl.equals(entry.getURL())) {
+ for (Iterator<DirectoryEntry> iterator = children.iterator(); iterator.hasNext(); ) {
+ final DirectoryEntry entry = iterator.next();
+ if (myUrl.equals(entry.getUrl())) {
iterator.remove();
}
}
@@ -60,21 +60,14 @@
public void addSyntheticChildToSelf(final SVNURL newUrl, final SVNURL repositoryUrl, final String name, final boolean isDir) {
final String currentUrlAsString = myUrl.toString();
- final List<SVNDirEntry> children = myCache.getChildren(currentUrlAsString);
+ final List<DirectoryEntry> children = myCache.getChildren(currentUrlAsString);
if (children == null) {
return;
}
children.add(createSyntheticEntry(newUrl, repositoryUrl, name, isDir));
- Collections.sort(children, new Comparator<SVNDirEntry>() {
- public int compare(final SVNDirEntry o1, final SVNDirEntry o2) {
- final boolean dirStatus = SVNNodeKind.DIR.equals(o1.getKind()) ^ SVNNodeKind.DIR.equals(o1.getKind());
- if (dirStatus) {
- return SVNNodeKind.DIR.equals(o1.getKind()) ? -1 : 1;
- }
- return o1.toString().compareTo(o2.toString());
- }
- });
+ // TODO: Seems that just Set instead of List could be used in cache - so no sort() after add() will be required
+ Collections.sort(children);
myCache.put(currentUrlAsString, children);
}
@@ -91,8 +84,8 @@
node.doOnSubtree(new Remover());
}
- public static SVNDirEntry createSyntheticEntry(final SVNURL newUrl, final SVNURL repositoryUrl, final String name, final boolean isDir) {
- return new SVNDirEntry(newUrl, repositoryUrl, name, isDir ? SVNNodeKind.DIR : SVNNodeKind.FILE, 0, false, SVNRevision.UNDEFINED.getNumber(), null, null);
+ public static DirectoryEntry createSyntheticEntry(final SVNURL newUrl, final SVNURL repositoryUrl, final String name, final boolean isDir) {
+ return new DirectoryEntry(newUrl, repositoryUrl, name, NodeKind.from(isDir), CommitInfo.EMPTY, null);
}
private static class Remover implements NotNullFunction<RepositoryTreeNode, Object> {
@@ -116,15 +109,15 @@
@NotNull
public Object fun(final RepositoryTreeNode repositoryTreeNode) {
- final List<SVNDirEntry> children = myCache.getChildren(repositoryTreeNode.getURL().toString());
+ final List<DirectoryEntry> children = myCache.getChildren(repositoryTreeNode.getURL().toString());
if (children == null) {
return Boolean.FALSE;
}
- final List<SVNDirEntry> newChildren = new ArrayList<SVNDirEntry>(children.size());
+ final List<DirectoryEntry> newChildren = new ArrayList<DirectoryEntry>(children.size());
try {
- for (SVNDirEntry child : children) {
- newChildren.add(createSyntheticEntry(convertUrl(child.getURL()), child.getRepositoryRoot(), child.getName(), SVNNodeKind.DIR.equals(child.getKind())));
+ for (DirectoryEntry child : children) {
+ newChildren.add(createSyntheticEntry(convertUrl(child.getUrl()), child.getRepositoryRoot(), child.getName(), child.isDirectory()));
}
myCache.put(convertUrl(repositoryTreeNode.getURL()).toString(), newChildren);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/CmdDiffClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/CmdDiffClient.java
index 10890d1..4971347 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/CmdDiffClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/CmdDiffClient.java
@@ -30,21 +30,18 @@
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.WorkingCopyFormat;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.NodeKind;
import org.jetbrains.idea.svn.commandLine.CommandExecutor;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
import org.jetbrains.idea.svn.history.SvnRepositoryContentRevision;
import org.jetbrains.idea.svn.status.SvnStatusHandler;
-import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import javax.xml.bind.JAXBException;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.*;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
@@ -64,7 +61,7 @@
assertDirectory(target1);
WorkingCopyFormat format = WorkingCopyFormat.from(myFactory.createVersionClient().getVersion());
- if (!format.isOrGreater(WorkingCopyFormat.ONE_DOT_EIGHT)) {
+ if (format.less(WorkingCopyFormat.ONE_DOT_EIGHT)) {
throw new SvnBindException("Could not compare local file and remote url with executable for svn " + format);
}
}
@@ -104,8 +101,8 @@
DiffInfo diffInfo = CommandUtil.parse(executor.getOutput(), DiffInfo.class);
List<Change> result = ContainerUtil.newArrayList();
- if (diffInfo != null && diffInfo.paths != null) {
- for (DiffPath path : diffInfo.paths.diffPaths) {
+ if (diffInfo != null) {
+ for (DiffPath path : diffInfo.diffPaths) {
result.add(createChange(target1, target2, path));
}
}
@@ -194,20 +191,15 @@
@XmlRootElement(name = "diff")
public static class DiffInfo {
- @XmlElement(name = "paths")
- public DiffPaths paths;
- }
-
- public static class DiffPaths {
-
+ @XmlElementWrapper(name = "paths")
@XmlElement(name = "path")
public List<DiffPath> diffPaths = new ArrayList<DiffPath>();
}
public static class DiffPath {
- @XmlAttribute(name = "kind")
- public String kind;
+ @XmlAttribute(name = "kind", required = true)
+ public NodeKind kind;
@XmlAttribute(name = "props")
public String propertiesStatus;
@@ -219,7 +211,7 @@
public String path;
public boolean isDirectory() {
- return SVNNodeKind.DIR.equals(SVNNodeKind.parseKind(kind));
+ return kind.isDirectory();
}
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/DiffOptions.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/DiffOptions.java
new file mode 100644
index 0000000..1e44a83
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/DiffOptions.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.diff;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public class DiffOptions {
+
+ private final boolean myIgnoreAllWhitespace;
+ private final boolean myIgnoreAmountOfWhitespace;
+ private final boolean myIgnoreEOLStyle;
+
+ public DiffOptions(boolean ignoreAllWhitespace, boolean ignoreAmountOfWhiteSpace, boolean ignoreEOLStyle) {
+ myIgnoreAllWhitespace = ignoreAllWhitespace;
+ myIgnoreAmountOfWhitespace = ignoreAmountOfWhiteSpace;
+ myIgnoreEOLStyle = ignoreEOLStyle;
+ }
+
+ public boolean isIgnoreAllWhitespace() {
+ return myIgnoreAllWhitespace;
+ }
+
+ public boolean isIgnoreAmountOfWhitespace() {
+ return myIgnoreAmountOfWhitespace;
+ }
+
+ public boolean isIgnoreEOLStyle() {
+ return myIgnoreEOLStyle;
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/DirectoryWithBranchComparer.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/DirectoryWithBranchComparer.java
index 4d3a09a..0f0e6a7 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/DirectoryWithBranchComparer.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/DirectoryWithBranchComparer.java
@@ -65,7 +65,7 @@
// svn 1.7 command line "--summarize" option for "diff" command does not support comparing working copy directories with repository
// directories - that is why command line is only used explicitly for svn 1.8
- return WorkingCopyFormat.ONE_DOT_EIGHT.equals(format) ? myVcs.getCommandLineFactory() : myVcs.getSvnKitFactory();
+ return format.isOrGreater(WorkingCopyFormat.ONE_DOT_EIGHT) ? myVcs.getCommandLineFactory() : myVcs.getSvnKitFactory();
}
@Override
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/SvnKitDiffClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/SvnKitDiffClient.java
index 850fb1b..0a1b148 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/SvnKitDiffClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/diff/SvnKitDiffClient.java
@@ -19,10 +19,11 @@
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
-import org.jetbrains.idea.svn.SvnProgressCanceller;
import org.jetbrains.idea.svn.WorkingCopyFormat;
import org.jetbrains.idea.svn.api.BaseSvnClient;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.info.Info;
+import org.jetbrains.idea.svn.svnkit.SvnKitProgressCanceller;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.internal.wc.SVNCancellableEditor;
import org.tmatesoft.svn.core.internal.wc.SVNErrorManager;
@@ -38,7 +39,6 @@
import org.tmatesoft.svn.core.io.SVNRepository;
import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import org.tmatesoft.svn.util.SVNDebugLog;
@@ -114,7 +114,7 @@
private Collection<Change> runUrlDiff() throws SVNException {
SVNRepository sourceRepository = myVcs.getSvnKitManager().createRepository(myTarget1.getURL());
- sourceRepository.setCanceller(new SvnProgressCanceller());
+ sourceRepository.setCanceller(new SvnKitProgressCanceller());
SvnDiffEditor diffEditor;
final long rev;
SVNRepository targetRepository = null;
@@ -123,7 +123,7 @@
// generate Map of path->Change
targetRepository = myVcs.getSvnKitManager().createRepository(myTarget2.getURL());
diffEditor = new SvnDiffEditor(sourceRepository, targetRepository, -1, false);
- final ISVNEditor cancellableEditor = SVNCancellableEditor.newInstance(diffEditor, new SvnProgressCanceller(), null);
+ final ISVNEditor cancellableEditor = SVNCancellableEditor.newInstance(diffEditor, new SvnKitProgressCanceller(), null);
sourceRepository.diff(myTarget2.getURL(), rev, rev, null, true, true, false, new ISVNReporterBaton() {
public void report(ISVNReporter reporter) throws SVNException {
reporter.setPath("", null, rev, false);
@@ -142,7 +142,7 @@
}
private Collection<Change> run17Diff() throws SVNException {
- final SVNInfo info1 = myVcs.getInfo(myTarget1.getFile(), SVNRevision.HEAD);
+ final Info info1 = myVcs.getInfo(myTarget1.getFile(), SVNRevision.HEAD);
if (info1 == null) {
SVNErrorMessage err =
@@ -172,7 +172,7 @@
repository2 = myVcs.getSvnKitManager().createRepository(myTarget2.getURL());
SvnDiffEditor diffEditor = new SvnDiffEditor(myTarget1.getFile(), repository2, rev, true);
repository.diff(myTarget2.getURL(), rev, rev, null, true, SVNDepth.INFINITY, false, reporter17,
- SVNCancellableEditor.newInstance(diffEditor, new SvnProgressCanceller(), null));
+ SVNCancellableEditor.newInstance(diffEditor, new SvnKitProgressCanceller(), null));
return diffEditor.getChangesMap().values();
}
@@ -219,7 +219,7 @@
SvnDiffEditor diffEditor =
new SvnDiffEditor(target == null ? myTarget1.getFile() : myTarget1.getFile().getParentFile(), repository2, rev, true);
repository.diff(myTarget2.getURL(), rev, rev, target, true, true, false, reporter,
- SVNCancellableEditor.newInstance(diffEditor, new SvnProgressCanceller(), null));
+ SVNCancellableEditor.newInstance(diffEditor, new SvnKitProgressCanceller(), null));
return diffEditor.getChangesMap().values();
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/CmdHistoryClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/CmdHistoryClient.java
index 3494b9a..ca934d4 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/CmdHistoryClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/CmdHistoryClient.java
@@ -9,19 +9,15 @@
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.*;
+import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import javax.xml.bind.JAXBException;
-import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlValue;
import java.util.ArrayList;
-import java.util.Date;
import java.util.List;
-import java.util.Map;
/**
* @author Konstantin Kolosovsky.
@@ -37,7 +33,7 @@
boolean includeMergedRevisions,
long limit,
@Nullable String[] revisionProperties,
- @Nullable ISVNLogEntryHandler handler) throws VcsException {
+ @Nullable LogEntryConsumer handler) throws VcsException {
// TODO: add revision properties parameter if necessary
List<String> parameters =
@@ -54,13 +50,13 @@
}
}
- private static void parseOutput(@NotNull CommandExecutor command, @Nullable ISVNLogEntryHandler handler)
+ private static void parseOutput(@NotNull CommandExecutor command, @Nullable LogEntryConsumer handler)
throws VcsException, SVNException {
try {
LogInfo log = CommandUtil.parse(command.getOutput(), LogInfo.class);
if (handler != null && log != null) {
- for (LogEntry entry : log.entries) {
+ for (LogEntry.Builder entry : log.entries) {
iterateRecursively(entry, handler);
}
}
@@ -70,16 +66,16 @@
}
}
- private static void iterateRecursively(@NotNull LogEntry entry, @NotNull ISVNLogEntryHandler handler) throws SVNException {
- handler.handleLogEntry(entry.toLogEntry());
+ private static void iterateRecursively(@NotNull LogEntry.Builder entry, @NotNull LogEntryConsumer handler) throws SVNException {
+ handler.consume(entry.build());
- for (LogEntry childEntry : entry.childEntries) {
+ for (LogEntry.Builder childEntry : entry.getChildEntries()) {
iterateRecursively(childEntry, handler);
}
if (entry.hasChildren()) {
// empty log entry passed to handler to fully correspond to SVNKit behavior.
- handler.handleLogEntry(SVNLogEntry.EMPTY_ENTRY);
+ handler.consume(LogEntry.EMPTY);
}
}
@@ -109,81 +105,6 @@
public static class LogInfo {
@XmlElement(name = "logentry")
- public List<LogEntry> entries = new ArrayList<LogEntry>();
- }
-
- public static class LogEntry {
-
- @XmlAttribute(name = "revision")
- public long revision;
-
- @XmlElement(name = "author")
- public String author;
-
- @XmlElement(name = "date")
- public Date date;
-
- @XmlElement(name = "msg")
- public String message;
-
- @XmlElement(name = "paths")
- public ChangedPaths changedPaths;
-
- @XmlElement(name = "logentry")
- public List<LogEntry> childEntries = new ArrayList<LogEntry>();
-
- public boolean hasChildren() {
- return !childEntries.isEmpty();
- }
-
- public SVNLogEntry toLogEntry() {
- SVNLogEntry entry = new SVNLogEntry(toChangedPathsMap(), revision, author, date, message);
-
- entry.setHasChildren(hasChildren());
-
- return entry;
- }
-
- public Map<String, SVNLogEntryPath> toChangedPathsMap() {
- return changedPaths != null ? changedPaths.toMap() : ContainerUtil.<String, SVNLogEntryPath>newHashMap();
- }
- }
-
- public static class ChangedPaths {
-
- @XmlElement(name = "path")
- public List<ChangedPath> changedPaths = new ArrayList<ChangedPath>();
-
- public Map<String, SVNLogEntryPath> toMap() {
- Map<String, SVNLogEntryPath> changes = ContainerUtil.newHashMap();
-
- for (ChangedPath path : changedPaths) {
- changes.put(path.path, path.toLogEntryPath());
- }
-
- return changes;
- }
- }
-
- public static class ChangedPath {
-
- @XmlAttribute(name = "kind")
- public String kind;
-
- @XmlAttribute(name = "action")
- public String action;
-
- @XmlAttribute(name = "copyfrom-path")
- public String copyFromPath;
-
- @XmlAttribute(name = "copyfrom-rev")
- public long copyFromRevision;
-
- @XmlValue
- public String path;
-
- public SVNLogEntryPath toLogEntryPath() {
- return new SVNLogEntryPath(path, CommandUtil.getStatusChar(action), copyFromPath, copyFromRevision);
- }
+ public List<LogEntry.Builder> entries = ContainerUtil.newArrayList();
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/FirstInBranch.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/FirstInBranch.java
index f871ee0..a075251 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/FirstInBranch.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/FirstInBranch.java
@@ -125,7 +125,7 @@
}
}
- private static class MyLogEntryHandler implements ISVNLogEntryHandler {
+ private static class MyLogEntryHandler implements LogEntryConsumer {
@NotNull private final SvnPathThroughHistoryCorrection myTrunkCorrector;
@NotNull private final SvnPathThroughHistoryCorrection myBranchCorrector;
@@ -137,17 +137,18 @@
myBranchCorrector = new SvnPathThroughHistoryCorrection(branchUrl);
}
- public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
+ @Override
+ public void consume(LogEntry logEntry) throws SVNException {
final Map map = logEntry.getChangedPaths();
checkEntries(logEntry, map);
- myTrunkCorrector.handleLogEntry(logEntry);
- myBranchCorrector.handleLogEntry(logEntry);
+ myTrunkCorrector.consume(logEntry);
+ myBranchCorrector.consume(logEntry);
checkEntries(logEntry, map);
}
- private void checkEntries(SVNLogEntry logEntry, Map map) throws SVNCancelException {
+ private void checkEntries(LogEntry logEntry, Map map) throws SVNCancelException {
for (Object o : map.values()) {
- final SVNLogEntryPath path = (SVNLogEntryPath) o;
+ final LogEntryPath path = (LogEntryPath) o;
final String localPath = path.getPath();
final String copyPath = path.getCopyPath();
@@ -159,7 +160,7 @@
}
}
- private boolean checkForCopyCase(SVNLogEntry logEntry, SVNLogEntryPath path, String localPath, String copyPath,
+ private boolean checkForCopyCase(LogEntry logEntry, LogEntryPath path, String localPath, String copyPath,
final String trunkUrl, final String branchUrl) {
if (equalOrParent(localPath, branchUrl) && equalOrParent(copyPath, trunkUrl)) {
myCopyDataConsumer.consume(new CopyData(path.getCopyRevision(), logEntry.getRevision(), true));
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/HistoryClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/HistoryClient.java
index d719e75..c85eb9e 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/HistoryClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/HistoryClient.java
@@ -4,7 +4,6 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.ISVNLogEntryHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -21,5 +20,5 @@
boolean includeMergedRevisions,
long limit,
@Nullable String[] revisionProperties,
- @Nullable ISVNLogEntryHandler handler) throws VcsException;
+ @Nullable LogEntryConsumer handler) throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LatestExistentSearcher.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LatestExistentSearcher.java
index dc1def4..030db0d 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LatestExistentSearcher.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LatestExistentSearcher.java
@@ -25,9 +25,10 @@
import org.jetbrains.idea.svn.SvnFileUrlMapping;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.internal.util.SVNURLUtil;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -84,9 +85,6 @@
myVcs.getFactory(target).createHistoryClient().doLog(target, startRevision, SVNRevision.HEAD, false, true, false, 0, null,
createHandler(latest));
}
- catch (SVNException e) {
- LOG.info(e);
- }
catch (VcsException e) {
LOG.info(e);
}
@@ -95,12 +93,13 @@
}
@NotNull
- private ISVNLogEntryHandler createHandler(@NotNull final Ref<Long> latest) {
- return new ISVNLogEntryHandler() {
- public void handleLogEntry(final SVNLogEntry logEntry) throws SVNException {
+ private LogEntryConsumer createHandler(@NotNull final Ref<Long> latest) {
+ return new LogEntryConsumer() {
+ @Override
+ public void consume(final LogEntry logEntry) throws SVNException {
final Map changedPaths = logEntry.getChangedPaths();
for (Object o : changedPaths.values()) {
- final SVNLogEntryPath path = (SVNLogEntryPath)o;
+ final LogEntryPath path = (LogEntryPath)o;
if ((path.getType() == 'D') && (myRelativeUrl.equals(path.getPath()))) {
latest.set(logEntry.getRevision());
throw new SVNException(SVNErrorMessage.UNKNOWN_ERROR_MESSAGE);
@@ -125,7 +124,7 @@
}
}
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
LOG.info(e);
}
@@ -138,7 +137,7 @@
final RootUrlInfo rootUrlInfo = mapping.getWcRootForUrl(myUrl.toString());
if (rootUrlInfo == null) return true;
final VirtualFile vf = rootUrlInfo.getVirtualFile();
- final SVNInfo info = myVcs.getInfo(vf);
+ final Info info = myVcs.getInfo(vf);
if ((info == null) || (info.getRevision() == null)) {
return false;
}
@@ -149,24 +148,24 @@
}
@Nullable
- private SVNURL getExistingParent(SVNURL url) throws SVNException {
+ private SVNURL getExistingParent(SVNURL url) throws SvnBindException {
while (url != null && !url.equals(myRepositoryUrl) && !existsInRevision(url, myEndNumber)) {
- url = url.removePathTail();
+ url = SvnUtil.removePathTail(url);
}
return url;
}
- private boolean existsInRevision(@NotNull SVNURL url, long revisionNumber) throws SVNException {
+ private boolean existsInRevision(@NotNull SVNURL url, long revisionNumber) throws SvnBindException {
SVNRevision revision = SVNRevision.create(revisionNumber);
- SVNInfo info = null;
+ Info info = null;
try {
info = myVcs.getInfo(url, revision, revision);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
// throw error if not "does not exist" error code
- if (!SVNErrorCode.RA_ILLEGAL_URL.equals(e.getErrorMessage().getErrorCode())) {
+ if (!e.contains(SVNErrorCode.RA_ILLEGAL_URL)) {
throw e;
}
}
@@ -174,7 +173,7 @@
return info != null;
}
- private long getLatestRevision() throws SVNException {
+ private long getLatestRevision() throws SvnBindException {
return SvnUtil.getHeadRevision(myVcs, myRepositoryUrl).getNumber();
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogEntry.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogEntry.java
new file mode 100644
index 0000000..1b3d126
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogEntry.java
@@ -0,0 +1,187 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.history;
+
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.tmatesoft.svn.core.SVNLogEntry;
+import org.tmatesoft.svn.core.SVNLogEntryPath;
+
+import javax.xml.bind.annotation.*;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public class LogEntry {
+
+ public static final LogEntry EMPTY = new LogEntry.Builder().setRevision(-1).setHasChildren(false).build();
+
+ private final long myRevision;
+ private final Date myDate;
+ private final String myMessage;
+ private final String myAuthor;
+ @NotNull private final Map<String, LogEntryPath> myChangedPaths;
+ private boolean myHasChildren;
+
+ @Nullable
+ public static LogEntry create(@Nullable SVNLogEntry entry) {
+ LogEntry result = null;
+
+ if (entry != null) {
+ LogEntry.Builder builder = new LogEntry.Builder();
+
+ if (entry.getChangedPaths() != null) {
+ for (SVNLogEntryPath path : entry.getChangedPaths().values()) {
+ builder.addPath(LogEntryPath.create(path));
+ }
+ }
+
+ result = builder.setRevision(entry.getRevision()).setAuthor(entry.getAuthor()).setDate(entry.getDate()).setMessage(entry.getMessage())
+ .setHasChildren(entry.hasChildren()).build();
+ }
+
+ return result;
+ }
+
+ public LogEntry(@NotNull LogEntry.Builder builder) {
+ myRevision = builder.revision;
+ myChangedPaths = toImmutable(builder.changedPaths);
+ myAuthor = builder.author;
+ myDate = builder.date;
+ myMessage = builder.message;
+ myHasChildren = builder.hasChildren();
+ }
+
+ @NotNull
+ private static Map<String, LogEntryPath> toImmutable(@NotNull List<LogEntryPath.Builder> paths) {
+ ContainerUtil.ImmutableMapBuilder<String, LogEntryPath> builder = ContainerUtil.immutableMapBuilder();
+
+ for (LogEntryPath.Builder path : paths) {
+ builder.put(path.getPath(), path.build());
+ }
+
+ return builder.build();
+ }
+
+ @NotNull
+ public Map<String, LogEntryPath> getChangedPaths() {
+ return myChangedPaths;
+ }
+
+ public String getAuthor() {
+ return myAuthor;
+ }
+
+ public Date getDate() {
+ return myDate;
+ }
+
+ public String getMessage() {
+ return myMessage;
+ }
+
+ public long getRevision() {
+ return myRevision;
+ }
+
+ public boolean hasChildren() {
+ return myHasChildren;
+ }
+
+ @XmlAccessorType(XmlAccessType.NONE)
+ // type explicitly specified not to conflict with LogEntryPath.Builder
+ @XmlType(name = "logentry")
+ public static class Builder {
+
+ @XmlAttribute(name = "revision")
+ private long revision;
+
+ @XmlElement(name = "author")
+ private String author;
+
+ @XmlElement(name = "date")
+ private Date date;
+
+ @XmlElement(name = "msg")
+ private String message;
+
+ @XmlElementWrapper(name = "paths")
+ @XmlElement(name = "path")
+ private List<LogEntryPath.Builder> changedPaths = ContainerUtil.newArrayList();
+
+ @XmlElement(name = "logentry")
+ private List<LogEntry.Builder> childEntries = ContainerUtil.newArrayList();
+
+ @NotNull
+ public List<LogEntry.Builder> getChildEntries() {
+ return childEntries;
+ }
+
+ public boolean hasChildren() {
+ return !childEntries.isEmpty();
+ }
+
+ @NotNull
+ public Builder setRevision(long revision) {
+ this.revision = revision;
+ return this;
+ }
+
+ @NotNull
+ public Builder setAuthor(String author) {
+ this.author = author;
+ return this;
+ }
+
+ @NotNull
+ public Builder setDate(Date date) {
+ this.date = date;
+ return this;
+ }
+
+ @NotNull
+ public Builder setMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ @NotNull
+ public Builder setHasChildren(boolean hasChildren) {
+ // probably LogEntry interface will be changed and child entries will be specified explicitly later, but for now just use such "fake"
+ // implementation for setting "hasChildren" value
+ childEntries.clear();
+ if (hasChildren) {
+ childEntries.add(this);
+ }
+ return this;
+ }
+
+ @NotNull
+ public Builder addPath(@NotNull LogEntryPath.Builder path) {
+ changedPaths.add(path);
+ return this;
+ }
+
+ @NotNull
+ public LogEntry build() {
+ return new LogEntry(this);
+ }
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogEntryConsumer.java
similarity index 70%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
copy to plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogEntryConsumer.java
index 2a24920..b3269b1 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogEntryConsumer.java
@@ -13,15 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package org.jetbrains.idea.svn.history;
+
+import com.intellij.util.ThrowableConsumer;
+import org.tmatesoft.svn.core.SVNException;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author Konstantin Kolosovsky.
*/
-public class RemoteCancelledException extends com.intellij.remote.RemoteCancelledException {
- public RemoteCancelledException(String s) {
- super(s);
- }
+public interface LogEntryConsumer extends ThrowableConsumer<LogEntry, SVNException> {
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogEntryPath.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogEntryPath.java
new file mode 100644
index 0000000..41215f7
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogEntryPath.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.history;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.idea.svn.api.BaseNodeDescription;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.jetbrains.idea.svn.commandLine.CommandUtil;
+import org.tmatesoft.svn.core.SVNLogEntryPath;
+
+import javax.xml.bind.annotation.*;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public class LogEntryPath extends BaseNodeDescription {
+
+ private final String myPath;
+ private final char myType;
+ private final String myCopyPath;
+ private final long myCopyRevision;
+
+ @NotNull
+ public static LogEntryPath.Builder create(@NotNull SVNLogEntryPath path) {
+ return new LogEntryPath.Builder().setPath(path.getPath()).setType(path.getType()).setCopyFromPath(
+ path.getCopyPath()).setCopyFromRevision(path.getCopyRevision()).setKind(NodeKind.from(path.getKind()));
+ }
+
+ public LogEntryPath(@NotNull LogEntryPath.Builder builder) {
+ super(builder.kind);
+ myPath = builder.path;
+ myType = CommandUtil.getStatusChar(builder.action);
+ myCopyPath = builder.copyFromPath;
+ myCopyRevision = builder.copyFromRevision;
+ }
+
+ public String getCopyPath() {
+ return myCopyPath;
+ }
+
+ public long getCopyRevision() {
+ return myCopyRevision;
+ }
+
+ public String getPath() {
+ return myPath;
+ }
+
+ public char getType() {
+ return myType;
+ }
+
+ @NotNull
+ public NodeKind getKind() {
+ return myKind;
+ }
+
+ @XmlAccessorType(XmlAccessType.NONE)
+ // type explicitly specified not to conflict with LogEntry.Builder
+ @XmlType(name = "logentrypath")
+ public static class Builder {
+
+ // empty string could be here if repository was < 1.6 when committing (see comments in schema for svn client xml output , in
+ // svn source code repository) - this will result in kind = NodeKind.UNKNOWN
+ @XmlAttribute(name = "kind", required = true)
+ private NodeKind kind;
+
+ @XmlAttribute(name = "action")
+ private String action;
+
+ @XmlAttribute(name = "copyfrom-path")
+ private String copyFromPath;
+
+ @XmlAttribute(name = "copyfrom-rev")
+ private long copyFromRevision;
+
+ @XmlValue
+ private String path;
+
+ public String getPath() {
+ return path;
+ }
+
+ @NotNull
+ public Builder setKind(@NotNull NodeKind kind) {
+ this.kind = kind;
+ return this;
+ }
+
+ @NotNull
+ public Builder setType(char type) {
+ this.action = String.valueOf(type);
+ return this;
+ }
+
+ @NotNull
+ public Builder setCopyFromPath(String copyFromPath) {
+ this.copyFromPath = copyFromPath;
+ return this;
+ }
+
+ @NotNull
+ public Builder setCopyFromRevision(long copyFromRevision) {
+ this.copyFromRevision = copyFromRevision;
+ return this;
+ }
+
+ @NotNull
+ public Builder setPath(String path) {
+ this.path = path;
+ return this;
+ }
+
+ @NotNull
+ public LogEntryPath build() {
+ return new LogEntryPath(this);
+ }
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/TreeStructureNode.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogHierarchyNode.java
similarity index 66%
rename from plugins/svn4idea/src/org/jetbrains/idea/svn/history/TreeStructureNode.java
rename to plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogHierarchyNode.java
index 370f54f..d9ce35a 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/TreeStructureNode.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LogHierarchyNode.java
@@ -18,24 +18,24 @@
import java.util.LinkedList;
import java.util.List;
-public class TreeStructureNode<T> {
- private final T myMe;
- private final List<TreeStructureNode<T>> myChildren;
+public class LogHierarchyNode {
+ private final LogEntry myMe;
+ private final List<LogHierarchyNode> myChildren;
- public TreeStructureNode(final T me) {
- myChildren = new LinkedList<TreeStructureNode<T>>();
+ public LogHierarchyNode(final LogEntry me) {
+ myChildren = new LinkedList<LogHierarchyNode>();
myMe = me;
}
- public void add(final T child) {
- myChildren.add(new TreeStructureNode<T>(child));
+ public void add(final LogEntry child) {
+ myChildren.add(new LogHierarchyNode(child));
}
- public List<TreeStructureNode<T>> getChildren() {
+ public List<LogHierarchyNode> getChildren() {
return myChildren;
}
- public T getMe() {
+ public LogEntry getMe() {
return myMe;
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/MergeSourceHierarchyBuilder.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/MergeSourceHierarchyBuilder.java
index f0a77198..87896a7 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/MergeSourceHierarchyBuilder.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/MergeSourceHierarchyBuilder.java
@@ -20,24 +20,23 @@
import com.intellij.util.ThrowableConsumer;
import org.jetbrains.annotations.NotNull;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNLogEntry;
import java.util.List;
/**
* @author Konstantin Kolosovsky.
*/
-public class MergeSourceHierarchyBuilder implements ThrowableConsumer<Pair<SVNLogEntry, Integer>, SVNException> {
+public class MergeSourceHierarchyBuilder implements ThrowableConsumer<Pair<LogEntry, Integer>, SVNException> {
- private TreeStructureNode<SVNLogEntry> myCurrentHierarchy;
- @NotNull private final Consumer<TreeStructureNode<SVNLogEntry>> myConsumer;
+ private LogHierarchyNode myCurrentHierarchy;
+ @NotNull private final Consumer<LogHierarchyNode> myConsumer;
- public MergeSourceHierarchyBuilder(@NotNull Consumer<TreeStructureNode<SVNLogEntry>> consumer) {
+ public MergeSourceHierarchyBuilder(@NotNull Consumer<LogHierarchyNode> consumer) {
myConsumer = consumer;
}
- public void consume(Pair<SVNLogEntry, Integer> svnLogEntryIntegerPair) throws SVNException {
- final SVNLogEntry logEntry = svnLogEntryIntegerPair.getFirst();
+ public void consume(Pair<LogEntry, Integer> svnLogEntryIntegerPair) throws SVNException {
+ final LogEntry logEntry = svnLogEntryIntegerPair.getFirst();
final Integer mergeLevel = svnLogEntryIntegerPair.getSecond();
if (mergeLevel < 0) {
@@ -45,11 +44,11 @@
myConsumer.consume(myCurrentHierarchy);
}
if (logEntry.hasChildren()) {
- myCurrentHierarchy = new TreeStructureNode<SVNLogEntry>(logEntry);
+ myCurrentHierarchy = new LogHierarchyNode(logEntry);
} else {
// just pass
myCurrentHierarchy = null;
- myConsumer.consume(new TreeStructureNode<SVNLogEntry>(logEntry));
+ myConsumer.consume(new LogHierarchyNode(logEntry));
}
} else {
addToLevel(myCurrentHierarchy, logEntry, mergeLevel);
@@ -62,12 +61,12 @@
}
}
- private static void addToLevel(final TreeStructureNode<SVNLogEntry> tree, final SVNLogEntry entry, final int left) {
+ private static void addToLevel(final LogHierarchyNode tree, final LogEntry entry, final int left) {
assert tree != null;
if (left == 0) {
tree.add(entry);
} else {
- final List<TreeStructureNode<SVNLogEntry>> children = tree.getChildren();
+ final List<LogHierarchyNode> children = tree.getChildren();
assert ! children.isEmpty();
addToLevel(children.get(children.size() - 1), entry, left - 1);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SingleCommittedListProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SingleCommittedListProvider.java
index 6ac6adc..d9b37e0 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SingleCommittedListProvider.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SingleCommittedListProvider.java
@@ -125,8 +125,9 @@
SvnTarget target = SvnTarget.fromURL(url);
myVcs.getFactory(target).createHistoryClient().doLog(target, SVNRevision.HEAD, revisionBefore, false, true, false, 0, null,
- new ISVNLogEntryHandler() {
- public void handleLogEntry(SVNLogEntry logEntry) {
+ new LogEntryConsumer() {
+ @Override
+ public void consume(LogEntry logEntry) {
checkDisposed();
// date could be null for lists where there are paths that user has no rights to observe
if (logEntry.getDate() != null) {
@@ -144,7 +145,7 @@
}
@NotNull
- private SvnChangeList createChangeList(@NotNull SVNLogEntry logEntry) {
+ private SvnChangeList createChangeList(@NotNull LogEntry logEntry) {
return new SvnChangeList(myVcs, svnRootLocation, logEntry, repositoryUrl.toDecodedString());
}
@@ -155,8 +156,9 @@
}
private boolean searchForUrl(@NotNull SVNURL url) throws VcsException {
- ISVNLogEntryHandler handler = new ISVNLogEntryHandler() {
- public void handleLogEntry(SVNLogEntry logEntry) {
+ LogEntryConsumer handler = new LogEntryConsumer() {
+ @Override
+ public void consume(LogEntry logEntry) {
checkDisposed();
// date could be null for lists where there are paths that user has no rights to observe
if (logEntry.getDate() != null) {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnChangeList.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnChangeList.java
index f894bb3..01f9a21 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnChangeList.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnChangeList.java
@@ -40,10 +40,13 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.*;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.browse.DirectoryEntry;
+import org.jetbrains.idea.svn.browse.DirectoryEntryConsumer;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -102,7 +105,7 @@
myKnownAsDirectories = new HashSet<String>(0);
}
- public SvnChangeList(SvnVcs vcs, @NotNull final SvnRepositoryLocation location, final SVNLogEntry logEntry, String repositoryRoot) {
+ public SvnChangeList(SvnVcs vcs, @NotNull final SvnRepositoryLocation location, final LogEntry logEntry, String repositoryRoot) {
myVcs = vcs;
myLocation = location;
myRevision = logEntry.getRevision();
@@ -114,10 +117,10 @@
myCommonPathSearcher = new CommonPathSearcher();
myKnownAsDirectories = new HashSet<String>(0);
- for(SVNLogEntryPath entry : logEntry.getChangedPaths().values()) {
+ for(LogEntryPath entry : logEntry.getChangedPaths().values()) {
final String path = entry.getPath();
- if (SVNNodeKind.DIR.equals(entry.getKind())) {
+ if (entry.isDirectory()) {
myKnownAsDirectories.add(path);
}
@@ -394,8 +397,8 @@
// TODO: Logic with detecting "isDirectory" status is not clear enough. Why we can't just collect this info from logEntry and
// TODO: if loading from disk - use cached values? Not to invoke separate call here.
SVNRevision beforeRevision = SVNRevision.create(getRevision(idxData.second.booleanValue()));
- SVNInfo info = myVcs.getInfo(SvnUtil.createUrl(revision.getFullPath()), beforeRevision, beforeRevision);
- boolean isDirectory = info != null && SVNNodeKind.DIR.equals(info.getKind());
+ Info info = myVcs.getInfo(SvnUtil.createUrl(revision.getFullPath()), beforeRevision, beforeRevision);
+ boolean isDirectory = info != null && info.isDirectory();
Change replacingChange = new Change(createRevision((SvnRepositoryContentRevision)sourceChange.getBeforeRevision(), isDirectory),
createRevision((SvnRepositoryContentRevision)sourceChange.getAfterRevision(), isDirectory));
replacingChange.setIsReplaced(sourceChange.isIsReplaced());
@@ -478,12 +481,14 @@
SVNRevision revisionNumber = SVNRevision.create(getRevision(isBefore));
SvnTarget target = SvnTarget.fromURL(fullPath, revisionNumber);
- myVcs.getFactory(target).createBrowseClient().list(target, revisionNumber, SVNDepth.INFINITY, new ISVNDirEntryHandler() {
- public void handleDirEntry(final SVNDirEntry dirEntry) throws SVNException {
- final String childPath = path + '/' + dirEntry.getRelativePath();
+ myVcs.getFactory(target).createBrowseClient().list(target, revisionNumber, Depth.INFINITY, new DirectoryEntryConsumer() {
+
+ @Override
+ public void consume(final DirectoryEntry entry) throws SVNException {
+ final String childPath = path + '/' + entry.getRelativePath();
if (!duplicates.contains(Pair.create(isBefore, childPath))) {
- final ContentRevision contentRevision = createRevision(childPath, isBefore, SVNNodeKind.DIR.equals(dirEntry.getKind()));
+ final ContentRevision contentRevision = createRevision(childPath, isBefore, entry.isDirectory());
result.add(new Change(isBefore ? contentRevision : null, isBefore ? null : contentRevision));
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java
index 556ef1e..8364289 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java
@@ -49,12 +49,13 @@
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.actions.ConfigureBranchesAction;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.status.StatusConsumer;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.*;
-import org.tmatesoft.svn.core.wc.ISVNStatusHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNStatus;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.DataInput;
@@ -139,8 +140,8 @@
final String repositoryRoot = getRepositoryRoot(svnLocation);
final ChangeBrowserSettings.Filter filter = settings.createFilter();
- getCommittedChangesImpl(settings, svnLocation, maxCount, new Consumer<SVNLogEntry>() {
- public void consume(final SVNLogEntry svnLogEntry) {
+ getCommittedChangesImpl(settings, svnLocation, maxCount, new Consumer<LogEntry>() {
+ public void consume(final LogEntry svnLogEntry) {
final SvnChangeList cl = new SvnChangeList(myVcs, svnLocation, svnLogEntry, repositoryRoot);
if (filter.accepts(cl)) {
consumer.consume(cl);
@@ -158,8 +159,8 @@
final ArrayList<SvnChangeList> result = new ArrayList<SvnChangeList>();
final String repositoryRoot = getRepositoryRoot(svnLocation);
- getCommittedChangesImpl(settings, svnLocation, maxCount, new Consumer<SVNLogEntry>() {
- public void consume(final SVNLogEntry svnLogEntry) {
+ getCommittedChangesImpl(settings, svnLocation, maxCount, new Consumer<LogEntry>() {
+ public void consume(final LogEntry svnLogEntry) {
result.add(new SvnChangeList(myVcs, svnLocation, svnLogEntry, repositoryRoot));
}
}, false, true);
@@ -169,24 +170,24 @@
public void getCommittedChangesWithMergedRevisons(final ChangeBrowserSettings settings,
final RepositoryLocation location, final int maxCount,
- final PairConsumer<SvnChangeList, TreeStructureNode<SVNLogEntry>> finalConsumer)
+ final PairConsumer<SvnChangeList, LogHierarchyNode> finalConsumer)
throws VcsException {
final SvnRepositoryLocation svnLocation = (SvnRepositoryLocation) location;
final String repositoryRoot = getRepositoryRoot(svnLocation);
- final MergeSourceHierarchyBuilder builder = new MergeSourceHierarchyBuilder(new Consumer<TreeStructureNode<SVNLogEntry>>() {
- public void consume(TreeStructureNode<SVNLogEntry> node) {
+ final MergeSourceHierarchyBuilder builder = new MergeSourceHierarchyBuilder(new Consumer<LogHierarchyNode>() {
+ public void consume(LogHierarchyNode node) {
finalConsumer.consume(new SvnChangeList(myVcs, svnLocation, node.getMe(), repositoryRoot), node);
}
});
- final SvnMergeSourceTracker mergeSourceTracker = new SvnMergeSourceTracker(new ThrowableConsumer<Pair<SVNLogEntry, Integer>, SVNException>() {
- public void consume(Pair<SVNLogEntry, Integer> svnLogEntryIntegerPair) throws SVNException {
+ final SvnMergeSourceTracker mergeSourceTracker = new SvnMergeSourceTracker(new ThrowableConsumer<Pair<LogEntry, Integer>, SVNException>() {
+ public void consume(Pair<LogEntry, Integer> svnLogEntryIntegerPair) throws SVNException {
builder.consume(svnLogEntryIntegerPair);
}
});
- getCommittedChangesImpl(settings, svnLocation, maxCount, new Consumer<SVNLogEntry>() {
- public void consume(final SVNLogEntry svnLogEntry) {
+ getCommittedChangesImpl(settings, svnLocation, maxCount, new Consumer<LogEntry>() {
+ public void consume(final LogEntry svnLogEntry) {
try {
mergeSourceTracker.consume(svnLogEntry);
}
@@ -204,13 +205,7 @@
// TODO: Additionally SvnRepositoryLocation could possibly be refactored to always contain FilePath (or similar local item)
// TODO: So here we could get repository url without performing remote svn command
- SVNURL rootUrl;
- try {
- rootUrl = SvnUtil.getRepositoryRoot(myVcs, svnLocation.toSvnUrl());
- }
- catch (SVNException e) {
- throw new SvnBindException(e);
- }
+ SVNURL rootUrl = SvnUtil.getRepositoryRoot(myVcs, svnLocation.toSvnUrl());
if (rootUrl == null) {
throw new SvnBindException("Could not resolve repository root url for " + svnLocation);
@@ -220,7 +215,7 @@
}
private void getCommittedChangesImpl(ChangeBrowserSettings settings, final SvnRepositoryLocation location,
- final int maxCount, final Consumer<SVNLogEntry> resultConsumer, final boolean includeMergedRevisions,
+ final int maxCount, final Consumer<LogEntry> resultConsumer, final boolean includeMergedRevisions,
final boolean filterOutByDate) throws VcsException {
setCollectingChangesProgress(location);
@@ -258,11 +253,12 @@
}
@NotNull
- private ISVNLogEntryHandler createLogHandler(final Consumer<SVNLogEntry> resultConsumer,
+ private LogEntryConsumer createLogHandler(final Consumer<LogEntry> resultConsumer,
final boolean filterOutByDate,
final String author) {
- return new ISVNLogEntryHandler() {
- public void handleLogEntry(SVNLogEntry logEntry) {
+ return new LogEntryConsumer() {
+ @Override
+ public void consume(LogEntry logEntry) {
if (myProject.isDisposed()) throw new ProcessCanceledException();
ProgressManager.progress2(SvnBundle.message("progress.text2.processing.revision", logEntry.getRevision()));
@@ -381,31 +377,26 @@
final Set<FilePath> result = ContainerUtil.newHashSet();
File rootFile = root.getIOFile();
- try {
- myVcs.getFactory(rootFile).createStatusClient()
- .doStatus(rootFile, SVNRevision.UNDEFINED, SVNDepth.INFINITY, true, false, false, false, new ISVNStatusHandler() {
- @Override
- public void handleStatus(SVNStatus status) throws SVNException {
- File file = status.getFile();
- boolean changedOnServer = isNotNone(status.getRemoteContentsStatus()) ||
- isNotNone(status.getRemoteNodeStatus()) ||
- isNotNone(status.getRemotePropertiesStatus());
+ myVcs.getFactory(rootFile).createStatusClient()
+ .doStatus(rootFile, SVNRevision.UNDEFINED, Depth.INFINITY, true, false, false, false, new StatusConsumer() {
+ @Override
+ public void consume(Status status) throws SVNException {
+ File file = status.getFile();
+ boolean changedOnServer = isNotNone(status.getRemoteContentsStatus()) ||
+ isNotNone(status.getRemoteNodeStatus()) ||
+ isNotNone(status.getRemotePropertiesStatus());
- if (file != null && changedOnServer) {
- result.add(VcsUtil.getFilePath(file, file.isDirectory()));
- }
+ if (file != null && changedOnServer) {
+ result.add(VcsUtil.getFilePath(file, file.isDirectory()));
}
- }, null);
- }
- catch (SVNException e) {
- throw new SvnBindException(e);
- }
+ }
+ }, null);
return result;
}
- private static boolean isNotNone(@Nullable SVNStatusType status) {
- return status != null && !SVNStatusType.STATUS_NONE.equals(status);
+ private static boolean isNotNone(@Nullable StatusType status) {
+ return status != null && !StatusType.STATUS_NONE.equals(status);
}
public boolean refreshCacheByNumber() {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCopyPathTracker.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCopyPathTracker.java
index 70e982a..413e05b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCopyPathTracker.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCopyPathTracker.java
@@ -22,8 +22,6 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnFileUrlMapping;
import org.jetbrains.idea.svn.SvnVcs;
-import org.tmatesoft.svn.core.SVNLogEntry;
-import org.tmatesoft.svn.core.SVNLogEntryPath;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
import java.io.File;
@@ -45,12 +43,12 @@
myCurrentPath = relativeUrl;
}
- public void accept(@NotNull final SVNLogEntry entry) {
+ public void accept(@NotNull final LogEntry entry) {
final Map changedPaths = entry.getChangedPaths();
if (changedPaths == null) return;
for (Object o : changedPaths.values()) {
- final SVNLogEntryPath entryPath = (SVNLogEntryPath) o;
+ final LogEntryPath entryPath = (LogEntryPath) o;
if (entryPath != null && 'A' == entryPath.getType() && entryPath.getCopyPath() != null) {
if (myCurrentPath.equals(entryPath.getPath())) {
myHadChanged = true;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnFileRevision.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnFileRevision.java
index 046e16c..007df92 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnFileRevision.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnFileRevision.java
@@ -26,12 +26,13 @@
import com.intellij.openapi.vcs.history.VcsFileRevision;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vcs.impl.ContentRevisionCache;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnRevisionNumber;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
-import org.tmatesoft.svn.core.SVNLogEntry;
+import org.jetbrains.idea.svn.checkin.CommitInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -47,7 +48,7 @@
private final Date myDate;
private String myCommitMessage;
private final String myAuthor;
- private final VcsRevisionNumber myRevisionNumber;
+ private final SvnRevisionNumber myRevisionNumber;
private final SvnVcs myVCS;
private final String myURL;
private final SVNRevision myPegRevision;
@@ -79,7 +80,7 @@
public SvnFileRevision(SvnVcs vcs,
SVNRevision pegRevision,
- SVNLogEntry logEntry,
+ LogEntry logEntry,
String url,
String copyFromPath, Charset charset) {
myCharset = charset;
@@ -96,6 +97,11 @@
myMergeSources = new ArrayList<SvnFileRevision>();
}
+ @NotNull
+ public CommitInfo getCommitInfo() {
+ return new CommitInfo.Builder(myRevisionNumber.getRevision().getNumber(), myDate, myAuthor).build();
+ }
+
public String getURL() {
return myURL;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java
index 92b619a..9e9dd7e 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java
@@ -40,10 +40,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.*;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
import org.tmatesoft.svn.core.internal.wc.SVNErrorManager;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import org.tmatesoft.svn.util.SVNLogType;
@@ -284,7 +285,7 @@
}
private static class LocalLoader extends LogLoader {
- private SVNInfo myInfo;
+ private Info myInfo;
private LocalLoader(SvnVcs vcs, FilePath file, SVNRevision from, SVNRevision to, int limit, SVNRevision peg, boolean showMergeSources) {
super(vcs, file, from, to, limit, peg, showMergeSources);
@@ -419,7 +420,7 @@
private void loadBackwards(SVNURL svnurl) throws SVNException, VcsException {
// this method is called when svnurl does not exist in latest repository revision - thus concrete old revision is used for "info"
// command to get repository url
- SVNInfo info = myVcs.getInfo(svnurl, myPeg, myPeg);
+ Info info = myVcs.getInfo(svnurl, myPeg, myPeg);
final SVNURL rootURL = info != null ? info.getRepositoryRootURL() : null;
final String root = rootURL != null ? rootURL.toString() : "";
String relativeUrl = myUrl;
@@ -444,11 +445,11 @@
}
private boolean existsNow(SVNURL svnurl) {
- final SVNInfo info;
+ final Info info;
try {
info = myVcs.getInfo(svnurl, SVNRevision.HEAD, SVNRevision.HEAD);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
return false;
}
return info != null && info.getURL() != null && info.getRevision().isValid();
@@ -470,7 +471,7 @@
return false;
}
- private static class MyLogEntryHandler implements ISVNLogEntryHandler {
+ private static class MyLogEntryHandler implements LogEntryConsumer {
private final ProgressIndicator myIndicator;
protected final SvnVcs myVcs;
protected final SvnPathThroughHistoryCorrection myLastPathCorrector;
@@ -503,10 +504,10 @@
myPegRevision = pegRevision;
myUrl = url;
myRepositoryRoot = repoRootURL;
- myTracker = new SvnMergeSourceTracker(new ThrowableConsumer<Pair<SVNLogEntry, Integer>, SVNException>() {
+ myTracker = new SvnMergeSourceTracker(new ThrowableConsumer<Pair<LogEntry, Integer>, SVNException>() {
@Override
- public void consume(final Pair<SVNLogEntry, Integer> svnLogEntryIntegerPair) throws SVNException {
- final SVNLogEntry logEntry = svnLogEntryIntegerPair.getFirst();
+ public void consume(final Pair<LogEntry, Integer> svnLogEntryIntegerPair) throws SVNException {
+ final LogEntry logEntry = svnLogEntryIntegerPair.getFirst();
if (myIndicator != null) {
if (myIndicator.isCanceled()) {
@@ -514,12 +515,12 @@
}
myIndicator.setText2(SvnBundle.message("progress.text2.revision.processed", logEntry.getRevision()));
}
- SVNLogEntryPath entryPath = null;
+ LogEntryPath entryPath = null;
String copyPath = null;
final int mergeLevel = svnLogEntryIntegerPair.getSecond();
if (! myLastPathCorrector.isRoot()) {
- myLastPathCorrector.handleLogEntry(logEntry);
+ myLastPathCorrector.consume(logEntry);
entryPath = myLastPathCorrector.getDirectlyMentioned();
copyPath = null;
if (entryPath != null) {
@@ -528,7 +529,7 @@
// if there are no path with exact match, check whether parent or child paths had changed
// "entry path" is allowed to be null now; if it is null, last path would be taken for revision construction
- // Separate SVNLogEntry is issued for each "merge source" revision. These "merge source" revisions are treated as child
+ // Separate LogEntry is issued for each "merge source" revision. These "merge source" revisions are treated as child
// revisions of some other revision - this way we construct merge hierarchy.
// mergeLevel >= 0 indicates that we are currently processing some "merge source" revision. This "merge source" revision
// contains changes from some other branch - so checkForChildChanges() and checkForParentChanges() return "false".
@@ -556,11 +557,11 @@
});
}
- private boolean checkForParentChanges(SVNLogEntry logEntry) {
+ private boolean checkForParentChanges(LogEntry logEntry) {
final String lastPathBefore = myLastPathCorrector.getBefore();
String path = SVNPathUtil.removeTail(lastPathBefore);
while (path.length() > 0) {
- final SVNLogEntryPath entryPath = logEntry.getChangedPaths().get(path);
+ final LogEntryPath entryPath = logEntry.getChangedPaths().get(path);
// A & D are checked since we are not interested in parent folders property changes, only in structure changes
// TODO: seems that R (replaced) should also be checked here
if (entryPath != null && (entryPath.getType() == 'A' || entryPath.getType() == 'D')) {
@@ -576,7 +577,7 @@
// TODO: this makes sense only for directories, but should always return true if something under the directory was changed in revision
// TODO: as svn will provide child changes in history for directory
- private boolean checkForChildChanges(SVNLogEntry logEntry) {
+ private boolean checkForChildChanges(LogEntry logEntry) {
final String lastPathBefore = myLastPathCorrector.getBefore();
for (String key : logEntry.getChangedPaths().keySet()) {
if (SVNPathUtil.isAncestor(lastPathBefore, key)) {
@@ -587,7 +588,7 @@
}
@Override
- public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
+ public void consume(LogEntry logEntry) throws SVNException {
myTracker.consume(logEntry);
}
@@ -605,7 +606,7 @@
}
}
- protected SvnFileRevision createRevision(final SVNLogEntry logEntry, final String copyPath, SVNLogEntryPath entryPath) throws SVNException {
+ protected SvnFileRevision createRevision(final LogEntry logEntry, final String copyPath, LogEntryPath entryPath) throws SVNException {
Date date = logEntry.getDate();
String author = logEntry.getAuthor();
String message = logEntry.getMessage();
@@ -628,7 +629,7 @@
}
@Override
- protected SvnFileRevision createRevision(final SVNLogEntry logEntry, final String copyPath, SVNLogEntryPath entryPath)
+ protected SvnFileRevision createRevision(final LogEntry logEntry, final String copyPath, LogEntryPath entryPath)
throws SVNException {
final SVNURL url = entryPath == null ? myRepositoryRoot.appendPath(myLastPathCorrector.getBefore(), false) :
myRepositoryRoot.appendPath(entryPath.getPath(), true);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistorySession.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistorySession.java
index 171b39c..f2f91bc 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistorySession.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistorySession.java
@@ -20,7 +20,7 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnRevisionNumber;
import org.jetbrains.idea.svn.SvnVcs;
-import org.tmatesoft.svn.core.wc.SVNInfo;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.wc.SVNRevision;
import java.io.File;
@@ -69,7 +69,7 @@
}
public static VcsRevisionNumber getCurrentCommittedRevision(final SvnVcs vcs, final File file) {
- SVNInfo info = vcs.getInfo(file);
+ Info info = vcs.getInfo(file);
return info != null ? new SvnRevisionNumber(info.getCommittedRevision()) : null;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnKitHistoryClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnKitHistoryClient.java
index ca387bc..0aca830 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnKitHistoryClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnKitHistoryClient.java
@@ -8,6 +8,7 @@
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.ISVNLogEntryHandler;
import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNLogEntry;
import org.tmatesoft.svn.core.wc.SVNLogClient;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -28,22 +29,38 @@
boolean includeMergedRevisions,
long limit,
@Nullable String[] revisionProperties,
- @Nullable ISVNLogEntryHandler handler) throws VcsException {
+ @Nullable LogEntryConsumer handler) throws VcsException {
try {
// TODO: a bug noticed when testing: we should pass "limit + 1" to get "limit" rows
SVNLogClient client = myVcs.getSvnKitManager().createLogClient();
if (target.isFile()) {
client.doLog(new File[]{target.getFile()}, startRevision, endRevision, target.getPegRevision(), stopOnCopy, discoverChangedPaths,
- includeMergedRevisions, limit, revisionProperties, handler);
+ includeMergedRevisions, limit, revisionProperties, toHandler(handler));
}
else {
client.doLog(target.getURL(), ArrayUtil.EMPTY_STRING_ARRAY, target.getPegRevision(), startRevision, endRevision, stopOnCopy,
- discoverChangedPaths, includeMergedRevisions, limit, revisionProperties, handler);
+ discoverChangedPaths, includeMergedRevisions, limit, revisionProperties, toHandler(handler));
}
}
catch (SVNException e) {
throw new SvnBindException(e);
}
}
+
+ @Nullable
+ private static ISVNLogEntryHandler toHandler(@Nullable final LogEntryConsumer handler) {
+ ISVNLogEntryHandler result = null;
+
+ if (handler != null) {
+ result = new ISVNLogEntryHandler() {
+ @Override
+ public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
+ handler.consume(LogEntry.create(logEntry));
+ }
+ };
+ }
+
+ return result;
+ }
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnLogUtil.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnLogUtil.java
index 7f4f25f..878f38e 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnLogUtil.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnLogUtil.java
@@ -24,8 +24,6 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnVcs;
-import org.tmatesoft.svn.core.ISVNLogEntryHandler;
-import org.tmatesoft.svn.core.SVNLogEntry;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -50,7 +48,7 @@
final int maxCount, final boolean includingYoungest, final boolean includeOldest)
throws VcsException {
final List<CommittedChangeList> result = new ArrayList<CommittedChangeList>();
- ISVNLogEntryHandler handler = createLogHandler(fromIncluding, toIncluding, includingYoungest, includeOldest, result);
+ LogEntryConsumer handler = createLogHandler(fromIncluding, toIncluding, includingYoungest, includeOldest, result);
SvnTarget target = SvnTarget.fromURL(myLocation.toSvnUrl());
myVcs.getFactory(target).createHistoryClient().doLog(target, fromIncluding, toIncluding, true, true, false, maxCount, null, handler);
@@ -59,12 +57,13 @@
}
@NotNull
- private ISVNLogEntryHandler createLogHandler(final SVNRevision fromIncluding,
+ private LogEntryConsumer createLogHandler(final SVNRevision fromIncluding,
final SVNRevision toIncluding,
final boolean includingYoungest,
final boolean includeOldest, final List<CommittedChangeList> result) {
- return new ISVNLogEntryHandler() {
- public void handleLogEntry(SVNLogEntry logEntry) {
+ return new LogEntryConsumer() {
+ @Override
+ public void consume(LogEntry logEntry) {
if (myProject.isDisposed()) throw new ProcessCanceledException();
final ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnMergeSourceDetails.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnMergeSourceDetails.java
index f3ed602..be0722b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnMergeSourceDetails.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnMergeSourceDetails.java
@@ -21,6 +21,7 @@
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.MasterDetailsComponent;
import com.intellij.openapi.ui.NamedConfigurable;
+import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.vcs.changes.committed.CommittedChangeListRenderer;
import com.intellij.openapi.vcs.changes.ui.ChangeListViewerDialog;
@@ -73,6 +74,8 @@
final ContentManager contentManager = toolWindow.getContentManager();
final MyDialog dialog = new MyDialog(project, revision, file);
+ // TODO: Temporary memory leak fix - rewrite this part not to create dialog if only createCenterPanel(), but not show() is invoked
+ Disposer.register(project, dialog.getDisposable());
Content content = ContentFactory.SERVICE.getInstance().createContent(dialog.createCenterPanel(),
SvnBundle.message("merge.source.details.title", (file == null) ? revision.getURL() : file.getName(), revision.getRevisionNumber().asString()), true);
@@ -213,7 +216,10 @@
if (list == null) {
myPanel = new JPanel();
} else {
- myPanel = new ChangeListViewerDialog(myProject, list).createCenterPanel();
+ ChangeListViewerDialog dialog = new ChangeListViewerDialog(myProject, list);
+ // TODO: Temporary memory leak fix - rewrite this part not to create dialog if only createCenterPanel(), but not show() is invoked
+ Disposer.register(myProject, dialog.getDisposable());
+ myPanel = dialog.createCenterPanel();
}
}
return myPanel;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnMergeSourceTracker.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnMergeSourceTracker.java
index 53f1518..023d848 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnMergeSourceTracker.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnMergeSourceTracker.java
@@ -18,24 +18,23 @@
import com.intellij.openapi.util.Pair;
import com.intellij.util.ThrowableConsumer;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNLogEntry;
public class SvnMergeSourceTracker {
private int myMergeLevel;
// -1 - not merge source; 0 - direct merge source
- private ThrowableConsumer<Pair<SVNLogEntry, Integer>, SVNException> myConsumer;
+ private ThrowableConsumer<Pair<LogEntry, Integer>, SVNException> myConsumer;
- public SvnMergeSourceTracker(final ThrowableConsumer<Pair<SVNLogEntry, Integer>, SVNException> consumer) {
+ public SvnMergeSourceTracker(final ThrowableConsumer<Pair<LogEntry, Integer>, SVNException> consumer) {
myConsumer = consumer;
myMergeLevel = -1;
}
- public void consume(final SVNLogEntry logEntry) throws SVNException {
+ public void consume(final LogEntry logEntry) throws SVNException {
if (logEntry.getRevision() < 0) {
-- myMergeLevel;
return;
}
- myConsumer.consume(new Pair<SVNLogEntry, Integer>(logEntry, myMergeLevel));
+ myConsumer.consume(new Pair<LogEntry, Integer>(logEntry, myMergeLevel));
if (logEntry.hasChildren()) {
++ myMergeLevel;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnPathThroughHistoryCorrection.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnPathThroughHistoryCorrection.java
index 8ecb8a3..bf6c08e 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnPathThroughHistoryCorrection.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnPathThroughHistoryCorrection.java
@@ -17,10 +17,7 @@
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.idea.svn.SvnUtil;
-import org.tmatesoft.svn.core.ISVNLogEntryHandler;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNLogEntry;
-import org.tmatesoft.svn.core.SVNLogEntryPath;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
import java.util.Map;
@@ -33,10 +30,10 @@
*
* We consider here, that history is traversed "from now to past"
*/
-public class SvnPathThroughHistoryCorrection implements ISVNLogEntryHandler {
+public class SvnPathThroughHistoryCorrection implements LogEntryConsumer {
private String myBefore;
private String myPath;
- private SVNLogEntryPath myDirectlyMentioned;
+ private LogEntryPath myDirectlyMentioned;
private boolean myRoot;
public SvnPathThroughHistoryCorrection(String path) {
@@ -46,14 +43,14 @@
}
@Override
- public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
+ public void consume(LogEntry logEntry) throws SVNException {
if (myRoot) {
return;
}
myBefore = myPath;
myDirectlyMentioned = null;
- final Map<String,SVNLogEntryPath> paths = logEntry.getChangedPaths();
- final SVNLogEntryPath entryPath = paths.get(myPath);
+ final Map<String,LogEntryPath> paths = logEntry.getChangedPaths();
+ final LogEntryPath entryPath = paths.get(myPath);
if (entryPath != null) {
myDirectlyMentioned = entryPath;
// exact match
@@ -62,7 +59,7 @@
return;
}
}
- for (SVNLogEntryPath path : paths.values()) {
+ for (LogEntryPath path : paths.values()) {
// "the origin path *from where* the item, ..."
// TODO: this could incorrectly handle case when parent folder was replaced - see IDEA-103042
// TODO: or several parent folder renames occur IDEA-96825
@@ -89,7 +86,7 @@
return myBefore;
}
- public SVNLogEntryPath getDirectlyMentioned() {
+ public LogEntryPath getDirectlyMentioned() {
return myDirectlyMentioned;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnRevisionsNavigationMediator.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnRevisionsNavigationMediator.java
index 7a11aee..ca69ba7 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnRevisionsNavigationMediator.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnRevisionsNavigationMediator.java
@@ -28,8 +28,8 @@
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.idea.svn.SvnVcs;
-import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.SVNInfo;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.wc.SVNRevision;
import java.util.*;
@@ -56,7 +56,7 @@
myChunks = new LinkedList<List<Fragment>>();
final VcsException[] exception = new VcsException[1];
- final Ref<SVNInfo> infoRef = new Ref<SVNInfo>();
+ final Ref<Info> infoRef = new Ref<Info>();
Runnable process = new Runnable() {
@Override
@@ -64,17 +64,14 @@
try {
infoRef.set(vcs.getInfo(location.toSvnUrl(), SVNRevision.HEAD));
}
- catch (VcsException e) {
+ catch (SvnBindException e) {
exception[0] = e;
}
- catch (SVNException e) {
- exception[0] = new VcsException(e);
- }
}
};
underProgress(exception, process);
- SVNInfo info = infoRef.get();
+ Info info = infoRef.get();
if (info == null || info.getRevision() == null || info.getRepositoryRootURL() == null) {
throw new VcsException("Could not get head info for " + location);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/ignore/SvnPropertyService.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/ignore/SvnPropertyService.java
index 2bd8627..8a9dbf7 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/ignore/SvnPropertyService.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/ignore/SvnPropertyService.java
@@ -23,7 +23,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.SvnPropertyKeys;
import org.jetbrains.idea.svn.SvnVcs;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
import org.tmatesoft.svn.core.SVNPropertyValue;
import org.tmatesoft.svn.core.wc.SVNPropertyData;
import org.tmatesoft.svn.core.wc.SVNRevision;
@@ -187,7 +187,7 @@
String newValue = getNewPropertyValue(data, propertyValue);
newValue = (newValue.trim().isEmpty()) ? null : newValue;
myVcs.getFactory(folderDir).createPropertyClient()
- .setProperty(folderDir, SvnPropertyKeys.SVN_IGNORE, SVNPropertyValue.create(newValue), SVNDepth.EMPTY, false);
+ .setProperty(folderDir, SvnPropertyKeys.SVN_IGNORE, SVNPropertyValue.create(newValue), Depth.EMPTY, false);
if (myUseCommonExtension) {
dirtyScopeManager.dirDirtyRecursively(folder);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/CmdInfoClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/CmdInfoClient.java
index 475dd1a..91eb7ce 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/CmdInfoClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/CmdInfoClient.java
@@ -20,17 +20,16 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.util.Consumer;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.commandLine.*;
-import org.tmatesoft.svn.core.*;
-import org.tmatesoft.svn.core.wc.ISVNInfoHandler;
-import org.tmatesoft.svn.core.wc.SVNInfo;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import org.xml.sax.SAXException;
@@ -41,7 +40,6 @@
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -55,48 +53,7 @@
private static final Logger LOG = Logger.getInstance(CmdInfoClient.class);
- @Override
- public void doInfo(File path, SVNRevision revision, boolean recursive, ISVNInfoHandler handler) throws SVNException {
- doInfo(path, SVNRevision.UNDEFINED, revision, recursive ? SVNDepth.INFINITY : SVNDepth.EMPTY, null, handler);
- }
-
- @Override
- public void doInfo(File path, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNInfoHandler handler)
- throws SVNException {
- doInfo(path, pegRevision, revision, recursive ? SVNDepth.INFINITY : SVNDepth.EMPTY, null, handler);
- }
-
- @Override
- public void doInfo(File path,
- SVNRevision pegRevision,
- SVNRevision revision,
- SVNDepth depth,
- Collection changeLists,
- final ISVNInfoHandler handler) throws SVNException {
- File base = path.isDirectory() ? path : path.getParentFile();
- base = CommandUtil.correctUpToExistingParent(base);
- if (base == null) {
- // very unrealistic
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Can not find existing parent file"));
- }
- issueCommand(path, pegRevision, revision, depth, changeLists, handler, base);
- }
-
- private void issueCommand(File path, SVNRevision pegRevision,
- SVNRevision revision,
- SVNDepth depth,
- Collection changeLists,
- final ISVNInfoHandler handler, File base) throws SVNException {
- List<String> parameters = new ArrayList<String>();
-
- fillParameters(path.getAbsolutePath(), pegRevision, revision, depth, parameters);
- // TODO: Fix this check - update corresponding parameters in InfoClient
- CommandUtil.putChangeLists(parameters, changeLists);
-
- parseResult(handler, base, execute(parameters, path));
- }
-
- private String execute(@NotNull List<String> parameters, @NotNull File path) throws SVNException {
+ private String execute(@NotNull List<String> parameters, @NotNull File path) throws SvnBindException {
// workaround: separately capture command output - used in exception handling logic to overcome svn 1.8 issue (see below)
final ProcessOutput output = new ProcessOutput();
LineCommandListener listener = new LineCommandAdapter() {
@@ -113,51 +70,46 @@
return command.getOutput();
}
- catch (VcsException e) {
- final String text = e.getMessage();
- final boolean notEmpty = !StringUtil.isEmptyOrSpaces(text);
- if (notEmpty && text.contains("W155010")) {
+ catch (SvnBindException e) {
+ final String text = StringUtil.notNullize(e.getMessage());
+ if (text.contains("W155010")) {
// if "svn info" is executed for several files at once, then this warning could be printed only for some files, but info for other
// files should be parsed from output
return output.getStdout();
}
// not a working copy exception
// "E155007: '' is not a working copy"
- if (notEmpty && text.contains("is not a working copy")) {
- if (StringUtil.isNotEmpty(output.getStdout())) {
- // TODO: Seems not reproducible in 1.8.4
- // workaround: as in subversion 1.8 "svn info" on a working copy root outputs such error for parent folder,
- // if there are files with conflicts.
- // but the requested info is still in the output except root closing tag
- return output.getStdout() + "</info>";
- } else {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.WC_NOT_WORKING_COPY, e), e);
- }
- // svn: E200009: Could not display info for all targets because some targets don't exist
- } else if (notEmpty && text.contains("some targets don't exist")) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, e), e);
- } else if (notEmpty && text.contains(String.valueOf(SVNErrorCode.WC_UPGRADE_REQUIRED.getCode()))) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.WC_UPGRADE_REQUIRED, e), e);
- } else if (notEmpty &&
- (text.contains("upgrade your Subversion client") ||
- text.contains(String.valueOf(SVNErrorCode.WC_UNSUPPORTED_FORMAT.getCode())))) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.WC_UNSUPPORTED_FORMAT, e), e);
+ if (text.contains("is not a working copy") && StringUtil.isNotEmpty(output.getStdout())) {
+ // TODO: Seems not reproducible in 1.8.4
+ // workaround: as in subversion 1.8 "svn info" on a working copy root outputs such error for parent folder,
+ // if there are files with conflicts.
+ // but the requested info is still in the output except root closing tag
+ return output.getStdout() + "</info>";
}
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e), e);
+ throw e;
}
}
- private static void parseResult(@NotNull final ISVNInfoHandler handler, @Nullable File base, @Nullable String result) throws SVNException {
+ @Nullable
+ private static Info parseResult(@Nullable File base, @Nullable String result) throws SvnBindException {
+ CollectInfoHandler handler = new CollectInfoHandler();
+
+ parseResult(handler, base, result);
+
+ return handler.getInfo();
+ }
+
+ private static void parseResult(@NotNull final InfoConsumer handler, @Nullable File base, @Nullable String result)
+ throws SvnBindException {
if (StringUtil.isEmptyOrSpaces(result)) {
return;
}
- final SvnInfoHandler[] infoHandler = new SvnInfoHandler[1];
- infoHandler[0] = new SvnInfoHandler(base, new Consumer<SVNInfo>() {
+ final SvnInfoHandler infoHandler = new SvnInfoHandler(base, new Consumer<Info>() {
@Override
- public void consume(SVNInfo info) {
+ public void consume(Info info) {
try {
- handler.handleInfo(info);
+ handler.consume(info);
}
catch (SVNException e) {
throw new SvnExceptionWrapper(e);
@@ -165,87 +117,68 @@
}
});
+ parseResult(result, infoHandler);
+ }
+
+ private static void parseResult(@NotNull String result, @NotNull SvnInfoHandler handler) throws SvnBindException {
try {
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
- parser.parse(new ByteArrayInputStream(result.trim().getBytes(CharsetToolkit.UTF8_CHARSET)), infoHandler[0]);
+ parser.parse(new ByteArrayInputStream(result.trim().getBytes(CharsetToolkit.UTF8_CHARSET)), handler);
}
catch (SvnExceptionWrapper e) {
LOG.info("info output " + result);
- throw (SVNException) e.getCause();
+ throw new SvnBindException(e.getCause());
} catch (IOException e) {
LOG.info("info output " + result);
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e), e);
+ throw new SvnBindException(e);
}
catch (ParserConfigurationException e) {
LOG.info("info output " + result);
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e), e);
+ throw new SvnBindException(e);
}
catch (SAXException e) {
LOG.info("info output " + result);
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e), e);
+ throw new SvnBindException(e);
}
}
- private static void fillParameters(String path, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, List<String> parameters) {
+ @NotNull
+ private static List<String> buildParameters(@NotNull String path,
+ @Nullable SVNRevision pegRevision,
+ @Nullable SVNRevision revision,
+ @Nullable Depth depth) {
+ List<String> parameters = ContainerUtil.newArrayList();
+
CommandUtil.put(parameters, depth);
CommandUtil.put(parameters, revision);
CommandUtil.put(parameters, path, pegRevision);
parameters.add("--xml");
+
+ return parameters;
}
@Override
- public void doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNInfoHandler handler)
- throws SVNException {
- doInfo(url, pegRevision, revision, recursive ? SVNDepth.INFINITY : SVNDepth.EMPTY, handler);
- }
-
- @Override
- public void doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, ISVNInfoHandler handler)
- throws SVNException {
- String path = url.toDecodedString();
- List<String> parameters = new ArrayList<String>();
-
- fillParameters(path, pegRevision, revision, depth, parameters);
- CommandExecutor command;
- try {
- command = execute(myVcs, SvnTarget.fromURL(url), SvnCommandName.info, parameters, null);
- }
- catch (SvnBindException e) {
- SVNErrorCode code = e.contains(SVNErrorCode.RA_ILLEGAL_URL) ? SVNErrorCode.RA_ILLEGAL_URL : SVNErrorCode.IO_ERROR;
-
- throw new SVNException(SVNErrorMessage.create(code, e), e);
+ public Info doInfo(File path, SVNRevision revision) throws SvnBindException {
+ File base = path.isDirectory() ? path : path.getParentFile();
+ base = CommandUtil.correctUpToExistingParent(base);
+ if (base == null) {
+ // very unrealistic
+ throw new SvnBindException("Can not find existing parent file");
}
- parseResult(handler, null, command.getOutput());
+ return parseResult(base, execute(buildParameters(path.getAbsolutePath(), SVNRevision.UNDEFINED, revision, Depth.EMPTY), path));
}
@Override
- public SVNInfo doInfo(File path, SVNRevision revision) throws SVNException {
- final SVNInfo[] infoArr = new SVNInfo[1];
- doInfo(path, SVNRevision.UNDEFINED, revision, SVNDepth.EMPTY, null, new ISVNInfoHandler() {
- @Override
- public void handleInfo(SVNInfo info) throws SVNException {
- infoArr[0] = info;
- }
- });
- return infoArr[0];
+ public Info doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision) throws SvnBindException {
+ CommandExecutor command = execute(myVcs, SvnTarget.fromURL(url), SvnCommandName.info, buildParameters(url.toDecodedString(), pegRevision, revision, Depth.EMPTY), null);
+
+ return parseResult(null, command.getOutput());
}
@Override
- public SVNInfo doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision) throws SVNException {
- final SVNInfo[] infoArr = new SVNInfo[1];
- doInfo(url, pegRevision, revision, SVNDepth.EMPTY, new ISVNInfoHandler() {
- @Override
- public void handleInfo(SVNInfo info) throws SVNException {
- infoArr[0] = info;
- }
- });
- return infoArr[0];
- }
-
- @Override
- public void doInfo(@NotNull Collection<File> paths, @Nullable ISVNInfoHandler handler) throws SVNException {
+ public void doInfo(@NotNull Collection<File> paths, @Nullable InfoConsumer handler) throws SvnBindException {
File base = ContainerUtil.getFirstItem(paths);
if (base != null) {
@@ -265,4 +198,19 @@
}
}
}
+
+ private static class CollectInfoHandler implements InfoConsumer {
+
+ @Nullable private Info myInfo;
+
+ @Override
+ public void consume(Info info) throws SVNException {
+ myInfo = info;
+ }
+
+ @Nullable
+ public Info getInfo() {
+ return myInfo;
+ }
+ }
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/IdeaSVNInfo.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/IdeaSVNInfo.java
deleted file mode 100644
index 0e2905e..0000000
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/IdeaSVNInfo.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright 2000-2012 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 org.jetbrains.idea.svn.info;
-
-import org.jetbrains.annotations.Nullable;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.SVNLock;
-import org.tmatesoft.svn.core.SVNNodeKind;
-import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNInfo;
-import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNTreeConflictDescription;
-
-import java.io.File;
-import java.util.Date;
-
-/**
- * Created by IntelliJ IDEA.
- * User: Irina.Chernushina
- * Date: 1/23/12
- * Time: 1:02 PM
- */
-public class IdeaSVNInfo extends SVNInfo {
- private final Date myCorrectCommittedDate;
- private final Date myCorrectTextDate;
-
- public IdeaSVNInfo(@Nullable File file,
- SVNURL url,
- SVNURL rootURL,
- long revision,
- SVNNodeKind kind,
- String uuid,
- long committedRevision,
- Date committedDate,
- String author,
- String schedule,
- SVNURL copyFromURL,
- long copyFromRevision,
- Date textTime,
- String propTime,
- String checksum,
- String conflictOld,
- String conflictNew,
- String conflictWorking,
- String propRejectFile,
- SVNLock lock,
- SVNDepth depth,
- String changelistName,
- long wcSize,
- SVNTreeConflictDescription treeConflict) {
- super(file, url, rootURL, revision, kind, uuid, committedRevision, null, author, schedule, copyFromURL, copyFromRevision,
- null, propTime, checksum, conflictOld, conflictNew, conflictWorking, propRejectFile, lock, depth, changelistName, wcSize,
- treeConflict);
- myCorrectCommittedDate = committedDate;
- myCorrectTextDate = textTime;
- }
-
- /**
- * Gets the item's last commit date. This is the value of the item's
- * {@link org.tmatesoft.svn.core.SVNProperty#COMMITTED_DATE}
- * property.
- *
- * @return the item's last commit date
- */
- @Override
- public Date getCommittedDate() {
- return myCorrectCommittedDate;
- }
-
- /**
- * Gets the value of the item's {@link org.tmatesoft.svn.core.SVNProperty#TEXT_TIME}
- * property. It corresponds to the last commit time.
- *
- * @return the value of the item's text-time property
- */
- @Override
- public Date getTextTime() {
- return myCorrectTextDate;
- }
-
- public IdeaSVNInfo(String path,
- SVNURL url,
- SVNRevision revision,
- SVNNodeKind kind,
- String uuid,
- SVNURL reposRootURL,
- long comittedRevision, Date date, String author, SVNLock lock, SVNDepth depth, long size) {
- super(path, url, revision, kind, uuid, reposRootURL, comittedRevision, date, author, lock, depth, size);
- myCorrectCommittedDate = date;
- myCorrectTextDate = null;
- }
-}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/Info.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/Info.java
new file mode 100644
index 0000000..96dbdbb
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/Info.java
@@ -0,0 +1,267 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.info;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.BaseNodeDescription;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.jetbrains.idea.svn.conflict.TreeConflictDescription;
+import org.jetbrains.idea.svn.lock.Lock;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.internal.util.SVNDate;
+import org.tmatesoft.svn.core.wc.SVNInfo;
+import org.tmatesoft.svn.core.wc.SVNRevision;
+
+import java.io.File;
+import java.util.Date;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public class Info extends BaseNodeDescription {
+
+ private final File myFile;
+ private final String myPath;
+ private final SVNURL myURL;
+ private final SVNRevision myRevision;
+ private final SVNURL myRepositoryRootURL;
+ private final String myRepositoryUUID;
+ private final SVNRevision myCommittedRevision;
+ private final Date myCommittedDate;
+ private final String myAuthor;
+ @Nullable private final Lock myLock;
+ private final boolean myIsRemote;
+ private final String mySchedule;
+ private final SVNURL myCopyFromURL;
+ private final SVNRevision myCopyFromRevision;
+ private final File myConflictOldFile;
+ private final File myConflictNewFile;
+ private final File myConflictWrkFile;
+ private final File myPropConflictFile;
+ private final Depth myDepth;
+ @Nullable private final TreeConflictDescription myTreeConflict;
+
+ @NotNull
+ public static Info create(@NotNull SVNInfo info) {
+ Info result;
+
+ if (info.isRemote()) {
+ result = new Info(info.getPath(), info.getURL(), info.getRevision(), NodeKind.from(info.getKind()), info.getRepositoryUUID(),
+ info.getRepositoryRootURL(), info.getCommittedRevision().getNumber(), info.getCommittedDate(), info.getAuthor(),
+ Lock.create(info.getLock()), Depth.from(info.getDepth()));
+ }
+ else {
+ result =
+ new Info(info.getFile(), info.getURL(), info.getRepositoryRootURL(), info.getRevision().getNumber(), NodeKind.from(info.getKind()),
+ info.getRepositoryUUID(), info.getCommittedRevision().getNumber(), toString(info.getCommittedDate()), info.getAuthor(),
+ info.getSchedule(), info.getCopyFromURL(), info.getCopyFromRevision().getNumber(), getPath(info.getConflictOldFile()),
+ getPath(info.getConflictNewFile()), getPath(info.getConflictWrkFile()), getPath(info.getPropConflictFile()),
+ Lock.create(info.getLock()), Depth.from(info.getDepth()), TreeConflictDescription.create(info.getTreeConflict()));
+ }
+
+ return result;
+ }
+
+ public Info(File file,
+ SVNURL url,
+ SVNURL rootURL,
+ long revision,
+ @NotNull NodeKind kind,
+ String uuid,
+ long committedRevision,
+ String committedDate,
+ String author,
+ String schedule,
+ SVNURL copyFromURL,
+ long copyFromRevision,
+ String conflictOld,
+ String conflictNew,
+ String conflictWorking,
+ String propRejectFile,
+ @Nullable Lock lock,
+ Depth depth,
+ @Nullable TreeConflictDescription treeConflict) {
+ super(kind);
+ myFile = file;
+ myURL = url;
+ myRevision = SVNRevision.create(revision);
+ myRepositoryUUID = uuid;
+ myRepositoryRootURL = rootURL;
+
+ myCommittedRevision = SVNRevision.create(committedRevision);
+ myCommittedDate = committedDate != null ? SVNDate.parseDate(committedDate) : null;
+ myAuthor = author;
+
+ mySchedule = schedule;
+
+ myCopyFromURL = copyFromURL;
+ myCopyFromRevision = SVNRevision.create(copyFromRevision);
+
+ myLock = lock;
+ myTreeConflict = treeConflict;
+
+ myConflictOldFile = resolveConflictFile(file, conflictOld);
+ myConflictNewFile = resolveConflictFile(file, conflictNew);
+ myConflictWrkFile = resolveConflictFile(file, conflictWorking);
+ myPropConflictFile = resolveConflictFile(file, propRejectFile);
+
+ myIsRemote = false;
+ myDepth = depth;
+
+ myPath = null;
+ }
+
+ public Info(String path,
+ SVNURL url,
+ SVNRevision revision,
+ @NotNull NodeKind kind,
+ String uuid,
+ SVNURL reposRootURL,
+ long committedRevision,
+ Date date,
+ String author,
+ @Nullable Lock lock,
+ Depth depth) {
+ super(kind);
+ myIsRemote = true;
+ myURL = url;
+ myRevision = revision;
+ myRepositoryRootURL = reposRootURL;
+ myRepositoryUUID = uuid;
+
+ myCommittedDate = date;
+ myCommittedRevision = SVNRevision.create(committedRevision);
+ myAuthor = author;
+
+ myLock = lock;
+ myPath = path;
+ myDepth = depth;
+
+ myFile = null;
+ mySchedule = null;
+ myCopyFromURL = null;
+ myCopyFromRevision = null;
+ myConflictOldFile = null;
+ myConflictNewFile = null;
+ myConflictWrkFile = null;
+ myPropConflictFile = null;
+ myTreeConflict = null;
+ }
+
+ public String getAuthor() {
+ return myAuthor;
+ }
+
+ public Date getCommittedDate() {
+ return myCommittedDate;
+ }
+
+ public SVNRevision getCommittedRevision() {
+ return myCommittedRevision;
+ }
+
+ public File getConflictNewFile() {
+ return myConflictNewFile;
+ }
+
+ public File getConflictOldFile() {
+ return myConflictOldFile;
+ }
+
+ public File getConflictWrkFile() {
+ return myConflictWrkFile;
+ }
+
+ @Nullable
+ public TreeConflictDescription getTreeConflict() {
+ return myTreeConflict;
+ }
+
+ public SVNRevision getCopyFromRevision() {
+ return myCopyFromRevision;
+ }
+
+ public SVNURL getCopyFromURL() {
+ return myCopyFromURL;
+ }
+
+ public File getFile() {
+ return myFile;
+ }
+
+ public boolean isRemote() {
+ return myIsRemote;
+ }
+
+ @NotNull
+ public NodeKind getKind() {
+ return myKind;
+ }
+
+ @Nullable
+ public Lock getLock() {
+ return myLock;
+ }
+
+ public String getPath() {
+ return myPath;
+ }
+
+ public File getPropConflictFile() {
+ return myPropConflictFile;
+ }
+
+ public SVNURL getRepositoryRootURL() {
+ return myRepositoryRootURL;
+ }
+
+ public String getRepositoryUUID() {
+ return myRepositoryUUID;
+ }
+
+ public SVNRevision getRevision() {
+ return myRevision;
+ }
+
+ public String getSchedule() {
+ return mySchedule;
+ }
+
+ public SVNURL getURL() {
+ return myURL;
+ }
+
+ public Depth getDepth() {
+ return myDepth;
+ }
+
+ @Nullable
+ private static File resolveConflictFile(@Nullable File file, @Nullable String path) {
+ return file != null && path != null ? new File(file.getParentFile(), path) : null;
+ }
+
+ @Nullable
+ private static String getPath(@Nullable File file) {
+ return file != null ? file.getPath() : null;
+ }
+
+ @Nullable
+ private static String toString(@Nullable Date date) {
+ return date != null ? date.toString() : null;
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/InfoClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/InfoClient.java
index f6582e6..56f87a0 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/InfoClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/InfoClient.java
@@ -18,11 +18,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.SVNException;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.ISVNInfoHandler;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import java.io.File;
@@ -36,15 +33,9 @@
*/
public interface InfoClient extends SvnClient {
- void doInfo(File path, SVNRevision revision, boolean recursive, ISVNInfoHandler handler) throws SVNException;
- void doInfo(File path, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNInfoHandler handler) throws SVNException;
- void doInfo(File path, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth,
- Collection changeLists, ISVNInfoHandler handler) throws SVNException;
- void doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNInfoHandler handler) throws SVNException;
- void doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth,
- ISVNInfoHandler handler) throws SVNException;
- SVNInfo doInfo(File path, SVNRevision revision) throws SVNException;
- SVNInfo doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision) throws SVNException;
+ Info doInfo(File path, SVNRevision revision) throws SvnBindException;
- void doInfo(@NotNull Collection<File> paths, @Nullable ISVNInfoHandler handler) throws SVNException;
+ Info doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision) throws SvnBindException;
+
+ void doInfo(@NotNull Collection<File> paths, @Nullable InfoConsumer handler) throws SvnBindException;
}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/InfoConsumer.java
similarity index 68%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
copy to plugins/svn4idea/src/org/jetbrains/idea/svn/info/InfoConsumer.java
index 2a24920..317b2b6 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCancelledException.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/InfoConsumer.java
@@ -13,15 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package org.jetbrains.idea.svn.info;
+
+import com.intellij.util.ThrowableConsumer;
+import org.jetbrains.idea.svn.info.Info;
+import org.tmatesoft.svn.core.SVNException;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author Konstantin Kolosovsky.
*/
-public class RemoteCancelledException extends com.intellij.remote.RemoteCancelledException {
- public RemoteCancelledException(String s) {
- super(s);
- }
+public interface InfoConsumer extends ThrowableConsumer<Info, SVNException> {
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SVNLockWrapper.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SVNLockWrapper.java
deleted file mode 100644
index f575207..0000000
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SVNLockWrapper.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2000-2012 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 org.jetbrains.idea.svn.info;
-
-import org.tmatesoft.svn.core.SVNLock;
-
-import java.util.Date;
-
-/**
- * Created with IntelliJ IDEA.
- * User: Irina.Chernushina
- * Date: 2/21/12
- * Time: 2:33 PM
- */
-public class SVNLockWrapper {
- private String myPath;
- private String myID;
- private String myOwner;
- private String myComment;
- private Date myCreationDate;
- private Date myExpirationDate;
-
- public SVNLockWrapper(String path, String ID, String owner, String comment, Date creationDate, Date expirationDate) {
- myPath = path;
- myID = ID;
- myOwner = owner;
- myComment = comment;
- myCreationDate = creationDate;
- myExpirationDate = expirationDate;
- }
-
- public SVNLockWrapper() {
- }
-
- public SVNLock create() {
- return new SVNLock(myPath, myID, myOwner, myComment, myCreationDate, myExpirationDate);
- }
-
- public String getPath() {
- return myPath;
- }
-
- public void setPath(String path) {
- myPath = path;
- }
-
- public String getID() {
- return myID;
- }
-
- public void setID(String ID) {
- myID = ID;
- }
-
- public String getOwner() {
- return myOwner;
- }
-
- public void setOwner(String owner) {
- myOwner = owner;
- }
-
- public String getComment() {
- return myComment;
- }
-
- public void setComment(String comment) {
- myComment = comment;
- }
-
- public Date getCreationDate() {
- return myCreationDate;
- }
-
- public void setCreationDate(Date creationDate) {
- myCreationDate = creationDate;
- }
-
- public Date getExpirationDate() {
- return myExpirationDate;
- }
-
- public void setExpirationDate(Date expirationDate) {
- myExpirationDate = expirationDate;
- }
-}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoHandler.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoHandler.java
index e2e5fa9..969225e 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoHandler.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoHandler.java
@@ -21,12 +21,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnUtil;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.jetbrains.idea.svn.lock.Lock;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNDate;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
@@ -42,14 +41,14 @@
*/
public class SvnInfoHandler extends DefaultHandler {
@Nullable private final File myBase;
- private final Consumer<SVNInfo> myInfoConsumer;
- private Map<File, SVNInfo> myResultsMap;
+ private final Consumer<org.jetbrains.idea.svn.info.Info> myInfoConsumer;
+ private Map<File, org.jetbrains.idea.svn.info.Info> myResultsMap;
private SvnInfoStructure myPending;
private final Map<String, Getter<ElementHandlerBase>> myElementsMap;
private final List<ElementHandlerBase> myParseStack;
private final StringBuilder mySb;
- public SvnInfoHandler(@Nullable File base, final Consumer<SVNInfo> infoConsumer) {
+ public SvnInfoHandler(@Nullable File base, final Consumer<org.jetbrains.idea.svn.info.Info> infoConsumer) {
myBase = base;
myInfoConsumer = infoConsumer;
myPending = createPending();
@@ -57,12 +56,12 @@
fillElements();
myParseStack = new ArrayList<ElementHandlerBase>();
myParseStack.add(new Fake());
- myResultsMap = new HashMap<File, SVNInfo>();
+ myResultsMap = new HashMap<File, org.jetbrains.idea.svn.info.Info>();
mySb = new StringBuilder();
}
private void switchPending() throws SAXException {
- final SVNInfo info;
+ final org.jetbrains.idea.svn.info.Info info;
try {
info = myPending.convert();
}
@@ -78,7 +77,7 @@
private SvnInfoStructure createPending() {
SvnInfoStructure pending = new SvnInfoStructure();
- pending.myDepth = SVNDepth.INFINITY;
+ pending.myDepth = org.jetbrains.idea.svn.api.Depth.INFINITY;
return pending;
}
@@ -280,7 +279,7 @@
myElementsMap.put("lock", new Getter<ElementHandlerBase>() {
@Override
public ElementHandlerBase get() {
- return new Lock();
+ return new LockElement();
}
});
myElementsMap.put("token", new Getter<ElementHandlerBase>() {
@@ -345,7 +344,7 @@
});
}
- public Map<File, SVNInfo> getResultsMap() {
+ public Map<File, org.jetbrains.idea.svn.info.Info> getResultsMap() {
return myResultsMap;
}
@@ -514,8 +513,7 @@
@Override
public void characters(String s, SvnInfoStructure structure) throws SAXException {
- final SVNDate date = SVNDate.parseDate(s);
- structure.myCommittedDate = date;
+ structure.myCommittedDate = s;
}
}
@@ -600,8 +598,7 @@
@Override
public void characters(String s, SvnInfoStructure structure) throws SAXException {
- final SVNDate date = SVNDate.parseDate(s);
- structure.myTextTime = date;
+ structure.myTextTime = s;
}
}
@@ -616,7 +613,7 @@
@Override
public void characters(String s, SvnInfoStructure structure) throws SAXException {
- structure.myDepth = SVNDepth.fromString(s);
+ structure.myDepth = org.jetbrains.idea.svn.api.Depth.from(s);
}
}
@@ -796,14 +793,14 @@
}
}
- private static class Lock extends ElementHandlerBase {
- private Lock() {
+ private static class LockElement extends ElementHandlerBase {
+ private LockElement() {
super(new String[]{"token", "owner", "comment", "created"}, new String[]{});
}
@Override
protected void updateInfo(Attributes attributes, SvnInfoStructure structure) throws SAXException {
- structure.myLockWrapper = new SVNLockWrapper();
+ structure.myLockBuilder = new Lock.Builder();
}
@Override
@@ -822,7 +819,7 @@
@Override
public void characters(String s, SvnInfoStructure structure) throws SAXException {
- structure.myLockWrapper.setID(s);
+ structure.myLockBuilder.setToken(s);
}
}
@@ -837,7 +834,7 @@
@Override
public void characters(String s, SvnInfoStructure structure) throws SAXException {
- structure.myLockWrapper.setOwner(s);
+ structure.myLockBuilder.setOwner(s);
}
}
@@ -852,7 +849,7 @@
@Override
public void characters(String s, SvnInfoStructure structure) throws SAXException {
- structure.myLockWrapper.setComment(s);
+ structure.myLockBuilder.setComment(s);
}
}
@@ -867,7 +864,7 @@
@Override
public void characters(String s, SvnInfoStructure structure) throws SAXException {
- structure.myLockWrapper.setCreationDate(SVNDate.parseDate(s));
+ structure.myLockBuilder.setCreationDate(SVNDate.parseDate(s));
}
}
@@ -883,7 +880,7 @@
protected void updateInfo(Attributes attributes, SvnInfoStructure structure) throws SAXException {
final String kind = attributes.getValue("kind");
assertSAX(! StringUtil.isEmptyOrSpaces(kind));
- structure.myKind = SVNNodeKind.parseKind(kind);
+ structure.myKind = NodeKind.from(kind);
if (myBase != null) {
final String path = attributes.getValue("path");
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoStructure.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoStructure.java
index 6e1b1db..4292988 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoStructure.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoStructure.java
@@ -15,17 +15,18 @@
*/
package org.jetbrains.idea.svn.info;
-import com.intellij.util.containers.ContainerUtil;
-import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.jetbrains.idea.svn.conflict.ConflictAction;
+import org.jetbrains.idea.svn.conflict.ConflictOperation;
+import org.jetbrains.idea.svn.conflict.ConflictReason;
+import org.jetbrains.idea.svn.lock.Lock;
import org.tmatesoft.svn.core.*;
-import org.tmatesoft.svn.core.internal.wc.SVNConflictVersion;
-import org.tmatesoft.svn.core.wc.*;
import org.xml.sax.SAXException;
import java.io.File;
import java.util.Date;
-import java.util.Map;
/**
* Created with IntelliJ IDEA.
@@ -35,46 +36,28 @@
*/
public class SvnInfoStructure {
- private static final Map<String, SVNConflictAction> ourConflictActions = ContainerUtil.newHashMap();
- private static final Map<String, SVNConflictReason> ourConflictReasons = ContainerUtil.newHashMap();
-
- static {
- ourConflictActions.put("add", SVNConflictAction.ADD);
- ourConflictActions.put("edit", SVNConflictAction.EDIT);
- ourConflictActions.put("delete", SVNConflictAction.DELETE);
- ourConflictActions.put("replace", SVNConflictAction.REPLACE);
-
- ourConflictReasons.put("edit", SVNConflictReason.EDITED);
- ourConflictReasons.put("obstruct", SVNConflictReason.OBSTRUCTED);
- ourConflictReasons.put("delete", SVNConflictReason.DELETED);
- ourConflictReasons.put("miss", SVNConflictReason.MISSING);
- ourConflictReasons.put("unversion", SVNConflictReason.UNVERSIONED);
- ourConflictReasons.put("add", SVNConflictReason.ADDED);
- ourConflictReasons.put("replace", SVNConflictReason.REPLACED);
- }
-
@Nullable public File myFile;
public String relativeUrl;
public SVNURL myUrl;
public SVNURL myRootURL;
public long myRevision;
- public SVNNodeKind myKind;
+ public NodeKind myKind;
public String myUuid;
public long myCommittedRevision;
- public Date myCommittedDate;
+ public String myCommittedDate;
public String myAuthor;
public String mySchedule;
public SVNURL myCopyFromURL;
public long myCopyFromRevision;
- public Date myTextTime;
+ public String myTextTime;
public String myPropTime;
public String myChecksum;
public String myConflictOld;
public String myConflictNew;
public String myConflictWorking;
public String myPropRejectFile;
- public SVNLockWrapper myLockWrapper;
- public SVNDepth myDepth;
+ public Lock.Builder myLockBuilder;
+ public Depth myDepth;
public String myChangelistName;
public long myWcSize;
public Date myCorrectCommittedDate;
@@ -82,65 +65,37 @@
public TreeConflictDescription myTreeConflict;
- public SVNInfo convert() throws SAXException, SVNException {
- return new IdeaSVNInfo(myFile, myUrl, myRootURL, myRevision, myKind, myUuid, myCommittedRevision, myCommittedDate, myAuthor, mySchedule,
- myCopyFromURL, myCopyFromRevision, myTextTime, myPropTime, myChecksum, myConflictOld, myConflictNew, myConflictWorking,
- myPropRejectFile, getLock(), myDepth, myChangelistName, myWcSize, createTreeConflict());
+ public Info convert() throws SAXException, SVNException {
+ return new Info(myFile, myUrl, myRootURL, myRevision, myKind, myUuid, myCommittedRevision, myCommittedDate, myAuthor, mySchedule,
+ myCopyFromURL, myCopyFromRevision, myConflictOld, myConflictNew, myConflictWorking,
+ myPropRejectFile, getLock(), myDepth, createTreeConflict());
}
- private SVNLock getLock() {
- SVNLock lock = null;
-
- if (myLockWrapper != null) {
- myLockWrapper.setPath(relativeUrl);
- lock = myLockWrapper.create();
- }
-
- return lock;
+ @Nullable
+ private Lock getLock() {
+ return myLockBuilder != null ? myLockBuilder.build() : null;
}
- private SVNTreeConflictDescription createTreeConflict() throws SAXException, SVNException {
+ private org.jetbrains.idea.svn.conflict.TreeConflictDescription createTreeConflict() throws SAXException, SVNException {
if (myTreeConflict == null) {
return null;
}
else {
assert myFile != null;
- final SVNConflictAction action = parseConflictAction(myTreeConflict.myAction);
- final SVNConflictReason reason = parseConflictReason(myTreeConflict.myReason);
- SVNOperation operation = SVNOperation.fromString(myTreeConflict.myOperation);
- operation = operation == null ? SVNOperation.NONE : operation;
- return new SVNTreeConflictDescription(myFile, myKind, action, reason, operation,
- createVersion(myTreeConflict.mySourceLeft),
- createVersion(myTreeConflict.mySourceRight));
+ return new org.jetbrains.idea.svn.conflict.TreeConflictDescription(myFile, myKind, ConflictAction.from(myTreeConflict.myAction),
+ ConflictReason.from(myTreeConflict.myReason),
+ ConflictOperation.from(myTreeConflict.myOperation),
+ createVersion(myTreeConflict.mySourceLeft),
+ createVersion(myTreeConflict.mySourceRight));
}
}
- private SVNConflictAction parseConflictAction(@NotNull String actionName) {
- SVNConflictAction action = SVNConflictAction.fromString(actionName);
- action = action != null ? action : ourConflictActions.get(actionName);
-
- if (action == null) {
- throw new IllegalArgumentException("Unknown conflict action " + actionName);
- }
-
- return action;
- }
-
- private SVNConflictReason parseConflictReason(@NotNull String reasonName) throws SAXException {
- SVNConflictReason reason = SVNConflictReason.fromString(reasonName);
- reason = reason != null ? reason : ourConflictReasons.get(reasonName);
-
- if (reason == null) {
- throw new SAXException("Can not parse conflict reason: " + reasonName);
- }
-
- return reason;
- }
-
- private SVNConflictVersion createVersion(final ConflictVersion version) throws SVNException, SAXException {
- return version == null ? null : new SVNConflictVersion(SVNURL.parseURIEncoded(version.myRepoUrl), version.myPathInRepo,
- parseRevision(version.myRevision), SVNNodeKind.parseKind(version.myKind));
+ private org.jetbrains.idea.svn.conflict.ConflictVersion createVersion(final ConflictVersion version) throws SVNException, SAXException {
+ return version == null
+ ? null
+ : new org.jetbrains.idea.svn.conflict.ConflictVersion(SVNURL.parseURIEncoded(version.myRepoUrl), version.myPathInRepo,
+ parseRevision(version.myRevision), NodeKind.from(version.myKind));
}
private long parseRevision(final String revision) throws SAXException {
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnKitInfoClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnKitInfoClient.java
index 7f50e85..3db2c64 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnKitInfoClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnKitInfoClient.java
@@ -18,12 +18,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.jetbrains.idea.svn.info.InfoClient;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.ISVNInfoHandler;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNWCClient;
@@ -43,50 +40,27 @@
}
@Override
- public void doInfo(File path, SVNRevision revision, boolean recursive, ISVNInfoHandler handler) throws SVNException {
- getClient().doInfo(path, revision, recursive, handler);
+ public Info doInfo(File path, SVNRevision revision) throws SvnBindException {
+ try {
+ return Info.create(getClient().doInfo(path, revision));
+ }
+ catch (SVNException e) {
+ throw new SvnBindException(e);
+ }
}
@Override
- public void doInfo(File path, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNInfoHandler handler)
- throws SVNException {
- getClient().doInfo(path, pegRevision, revision, recursive, handler);
+ public Info doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision) throws SvnBindException {
+ try {
+ return Info.create(getClient().doInfo(url, pegRevision, revision));
+ }
+ catch (SVNException e) {
+ throw new SvnBindException(e);
+ }
}
@Override
- public void doInfo(File path,
- SVNRevision pegRevision,
- SVNRevision revision,
- SVNDepth depth,
- Collection changeLists,
- ISVNInfoHandler handler) throws SVNException {
- getClient().doInfo(path, pegRevision, revision, depth, changeLists, handler);
- }
-
- @Override
- public void doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNInfoHandler handler)
- throws SVNException {
- getClient().doInfo(url, pegRevision, revision, recursive, handler);
- }
-
- @Override
- public void doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, ISVNInfoHandler handler)
- throws SVNException {
- getClient().doInfo(url, pegRevision, revision, depth, handler);
- }
-
- @Override
- public SVNInfo doInfo(File path, SVNRevision revision) throws SVNException {
- return getClient().doInfo(path, revision);
- }
-
- @Override
- public SVNInfo doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision) throws SVNException {
- return getClient().doInfo(url, pegRevision, revision);
- }
-
- @Override
- public void doInfo(@NotNull Collection<File> paths, @Nullable ISVNInfoHandler handler) throws SVNException {
+ public void doInfo(@NotNull Collection<File> paths, @Nullable InfoConsumer handler) throws SvnBindException {
throw new UnsupportedOperationException();
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/CmdMergeClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/CmdMergeClient.java
index 63eb66d..2f9d8ae 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/CmdMergeClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/CmdMergeClient.java
@@ -4,10 +4,10 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.commandLine.*;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNDiffOptions;
+import org.jetbrains.idea.svn.diff.DiffOptions;
import org.tmatesoft.svn.core.wc.SVNRevisionRange;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -23,8 +23,8 @@
public void merge(@NotNull SvnTarget source,
@NotNull File destination,
boolean dryRun,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable final ISVNEventHandler handler) throws VcsException {
+ @Nullable DiffOptions diffOptions,
+ @Nullable final ProgressTracker handler) throws VcsException {
assertUrl(source);
List<String> parameters = new ArrayList<String>();
@@ -38,12 +38,12 @@
public void merge(@NotNull SvnTarget source,
@NotNull SVNRevisionRange range,
@NotNull File destination,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean dryRun,
boolean recordOnly,
boolean force,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable DiffOptions diffOptions,
+ @Nullable ProgressTracker handler) throws VcsException {
assertUrl(source);
List<String> parameters = new ArrayList<String>();
@@ -60,13 +60,13 @@
public void merge(@NotNull SvnTarget source1,
@NotNull SvnTarget source2,
@NotNull File destination,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean useAncestry,
boolean dryRun,
boolean recordOnly,
boolean force,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable DiffOptions diffOptions,
+ @Nullable ProgressTracker handler) throws VcsException {
assertUrl(source1);
assertUrl(source2);
@@ -82,12 +82,12 @@
private static void fillParameters(@NotNull List<String> parameters,
@NotNull File destination,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean dryRun,
boolean recordOnly,
boolean force,
boolean reintegrate,
- @Nullable SVNDiffOptions diffOptions) {
+ @Nullable DiffOptions diffOptions) {
CommandUtil.put(parameters, destination);
CommandUtil.put(parameters, diffOptions);
CommandUtil.put(parameters, dryRun, "--dry-run");
@@ -102,7 +102,7 @@
CommandUtil.put(parameters, reintegrate, "--reintegrate");
}
- private void run(File destination, ISVNEventHandler handler, List<String> parameters) throws VcsException {
+ private void run(File destination, ProgressTracker handler, List<String> parameters) throws VcsException {
BaseUpdateCommandListener listener = new BaseUpdateCommandListener(CommandUtil.correctUpToExistingParent(destination), handler);
execute(myVcs, SvnTarget.fromFile(destination), SvnCommandName.merge, parameters, listener);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/GroupMerger.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/GroupMerger.java
index cb62668..73346ad 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/GroupMerger.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/GroupMerger.java
@@ -27,8 +27,8 @@
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnConfiguration;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.update.UpdateEventHandler;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNRevision;
@@ -131,7 +131,7 @@
SvnTarget source = SvnTarget.fromURL(myCurrentBranchUrl);
MergeClient client = myVcs.getFactory(myTarget).createMergeClient();
- client.merge(source, createRange(), myTarget, SVNDepth.INFINITY, mySvnConfig.isMergeDryRun(), myDryRun, true,
+ client.merge(source, createRange(), myTarget, Depth.INFINITY, mySvnConfig.isMergeDryRun(), myDryRun, true,
mySvnConfig.getMergeOptions(), myHandler);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/IntegrateEventHandler.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/IntegrateEventHandler.java
index 75533d8..d043c95 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/IntegrateEventHandler.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/IntegrateEventHandler.java
@@ -19,22 +19,22 @@
import com.intellij.openapi.vcs.update.FileGroup;
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.EventAction;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.status.StatusType;
import org.jetbrains.idea.svn.update.UpdateEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNEventAction;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
public class IntegrateEventHandler extends UpdateEventHandler {
public IntegrateEventHandler(final SvnVcs vcs, final ProgressIndicator progressIndicator) {
super(vcs, progressIndicator, null);
}
- protected boolean handleInDescendants(final SVNEvent event) {
- if ((event.getAction() == SVNEventAction.UPDATE_UPDATE) && (event.getContentsStatus() == SVNStatusType.UNCHANGED) &&
- (event.getPropertiesStatus() == SVNStatusType.UNKNOWN)) {
+ protected boolean handleInDescendants(final ProgressEvent event) {
+ if ((event.getAction() == EventAction.UPDATE_UPDATE) && (event.getContentsStatus() == StatusType.UNCHANGED) &&
+ (event.getPropertiesStatus() == StatusType.UNKNOWN)) {
myText2 = SvnBundle.message("progres.text2.updated", event.getFile().getName());
return true;
- } else if (event.getAction() == SVNEventAction.DELETE) {
+ } else if (event.getAction() == EventAction.DELETE) {
addFileToGroup(FileGroup.REMOVED_FROM_REPOSITORY_ID, event);
myText2 = SvnBundle.message("progress.text2.deleted", event.getFile().getName());
return true;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/IntegratedSelectedOptionsDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/IntegratedSelectedOptionsDialog.java
index 3029f15..3b2184c 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/IntegratedSelectedOptionsDialog.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/IntegratedSelectedOptionsDialog.java
@@ -32,8 +32,8 @@
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.*;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
@@ -248,7 +248,7 @@
@Nullable
private static SVNURL realTargetUrl(final SvnVcs vcs, final WorkingCopyInfo info, final String targetBranchUrl) {
- final SVNInfo svnInfo = vcs.getInfo(info.getLocalPath());
+ final Info svnInfo = vcs.getInfo(info.getLocalPath());
final SVNURL svnurl = svnInfo != null ? svnInfo.getURL() : null;
return (svnurl != null) && (svnurl.toString().startsWith(targetBranchUrl)) ? svnurl : null;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeCalculatorTask.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeCalculatorTask.java
index 782bd78..6e9f165 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeCalculatorTask.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeCalculatorTask.java
@@ -33,16 +33,11 @@
import org.jetbrains.idea.svn.dialogs.MergeContext;
import org.jetbrains.idea.svn.dialogs.QuickMergeContentsVariants;
import org.jetbrains.idea.svn.dialogs.SvnBranchPointsCalculator;
-import org.jetbrains.idea.svn.history.SvnChangeList;
-import org.jetbrains.idea.svn.history.SvnCommittedChangesProvider;
-import org.jetbrains.idea.svn.history.SvnRepositoryLocation;
-import org.jetbrains.idea.svn.history.TreeStructureNode;
+import org.jetbrains.idea.svn.history.*;
import org.jetbrains.idea.svn.mergeinfo.MergeChecker;
import org.jetbrains.idea.svn.mergeinfo.OneShotMergeInfoHelper;
import org.jetbrains.idea.svn.mergeinfo.SvnMergeInfoCache;
import org.jetbrains.idea.svn.update.UpdateEventHandler;
-import org.tmatesoft.svn.core.SVNLogEntry;
-import org.tmatesoft.svn.core.SVNLogEntryPath;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
@@ -121,13 +116,13 @@
String relativeBranch = SVNPathUtil.getRelativePath(myMergeContext.getWcInfo().getRepositoryRoot(), myMergeContext.getSourceUrl());
relativeBranch = (relativeBranch.startsWith("/") ? relativeBranch : "/" + relativeBranch);
- final LinkedList<Pair<SvnChangeList, TreeStructureNode<SVNLogEntry>>> list =
- new LinkedList<Pair<SvnChangeList, TreeStructureNode<SVNLogEntry>>>();
+ final LinkedList<Pair<SvnChangeList, LogHierarchyNode>> list =
+ new LinkedList<Pair<SvnChangeList, LogHierarchyNode>>();
try {
committedChangesProvider.getCommittedChangesWithMergedRevisons(settings, new SvnRepositoryLocation(myMergeContext.getSourceUrl()), 0,
- new PairConsumer<SvnChangeList, TreeStructureNode<SVNLogEntry>>() {
+ new PairConsumer<SvnChangeList, LogHierarchyNode>() {
public void consume(SvnChangeList svnList,
- TreeStructureNode<SVNLogEntry> tree) {
+ LogHierarchyNode tree) {
indicator.checkCanceled();
if (sourceLatest >= svnList.getNumber()) return;
list.add(
@@ -144,7 +139,7 @@
indicator.setText("Checking merge information...");
// to do not go into file system while asking something on the net
- for (Pair<SvnChangeList, TreeStructureNode<SVNLogEntry>> pair : list) {
+ for (Pair<SvnChangeList, LogHierarchyNode> pair : list) {
final SvnChangeList svnList = pair.getFirst();
final SvnMergeInfoCache.MergeCheckResult checkResult = myMergeChecker.checkList(svnList);
indicator.setText2("Processing revision " + svnList.getNumber());
@@ -204,7 +199,7 @@
// true if errors found
static boolean checkListForPaths(String relativeLocal,
- String relativeBranch, Pair<SvnChangeList, TreeStructureNode<SVNLogEntry>> pair) {
+ String relativeBranch, Pair<SvnChangeList, LogHierarchyNode> pair) {
// TODO: Such filtering logic is not clear enough so far (and probably not correct for all cases - for instance when we perform merge
// TODO: from branch1 to branch2 and have revision which contain merge changes from branch3 to branch1.
// TODO: In this case paths of child log entries will not contain neither urls from branch1 nor from branch2 - and checkEntry() method
@@ -212,9 +207,9 @@
// TODO: Why do we check entries recursively - we have a revision - set of changes in the "merge from" branch? Why do we need to check
// TODO: where they came from - we want avoid some circular merges or what? Does subversion itself perform such checks or not?
- final List<TreeStructureNode<SVNLogEntry>> children = pair.getSecond().getChildren();
+ final List<LogHierarchyNode> children = pair.getSecond().getChildren();
boolean localChange = false;
- for (TreeStructureNode<SVNLogEntry> child : children) {
+ for (LogHierarchyNode child : children) {
if (checkForSubtree(child, relativeLocal, relativeBranch)) {
localChange = true;
break;
@@ -228,13 +223,13 @@
}
// true if errors found
- private static boolean checkForSubtree(final TreeStructureNode<SVNLogEntry> tree,
+ private static boolean checkForSubtree(final LogHierarchyNode tree,
String relativeBranch, final String localURL) {
- final LinkedList<TreeStructureNode<SVNLogEntry>> queue = new LinkedList<TreeStructureNode<SVNLogEntry>>();
+ final LinkedList<LogHierarchyNode> queue = new LinkedList<LogHierarchyNode>();
queue.addLast(tree);
while (!queue.isEmpty()) {
- final TreeStructureNode<SVNLogEntry> element = queue.removeFirst();
+ final LogHierarchyNode element = queue.removeFirst();
ProgressManager.checkCanceled();
if (checkForEntry(element.getMe(), localURL, relativeBranch)) return true;
@@ -248,11 +243,11 @@
// or if no changed paths in current branch, checks if at least one path in "merge from" branch
// NOTE: this fails for "merge-source" log entries from other branches - when all changed paths are from some
// third branch - this logic treats such log entry as local.
- private static boolean checkForEntry(final SVNLogEntry entry, final String localURL, String relativeBranch) {
+ private static boolean checkForEntry(final LogEntry entry, final String localURL, String relativeBranch) {
boolean atLeastOneUnderBranch = false;
final Map map = entry.getChangedPaths();
for (Object o : map.values()) {
- final SVNLogEntryPath path = (SVNLogEntryPath)o;
+ final LogEntryPath path = (LogEntryPath)o;
if (SVNPathUtil.isAncestor(localURL, path.getPath())) {
return true;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeClient.java
index 94e4c9ce..d32ea29 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeClient.java
@@ -3,10 +3,10 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNDiffOptions;
+import org.jetbrains.idea.svn.diff.DiffOptions;
import org.tmatesoft.svn.core.wc.SVNRevisionRange;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -20,27 +20,27 @@
void merge(@NotNull SvnTarget source,
@NotNull File destination,
boolean dryRun,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable ISVNEventHandler handler) throws VcsException;
+ @Nullable DiffOptions diffOptions,
+ @Nullable ProgressTracker handler) throws VcsException;
void merge(@NotNull SvnTarget source,
@NotNull SVNRevisionRange range,
@NotNull File destination,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean dryRun,
boolean recordOnly,
boolean force,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable ISVNEventHandler handler) throws VcsException;
+ @Nullable DiffOptions diffOptions,
+ @Nullable ProgressTracker handler) throws VcsException;
void merge(@NotNull SvnTarget source1,
@NotNull SvnTarget source2,
@NotNull File destination,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean useAncestry,
boolean dryRun,
boolean recordOnly,
boolean force,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable ISVNEventHandler handler) throws VcsException;
+ @Nullable DiffOptions diffOptions,
+ @Nullable ProgressTracker handler) throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/Merger.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/Merger.java
index 8f534b9..07e0c5b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/Merger.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/Merger.java
@@ -28,8 +28,9 @@
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnConfiguration;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.update.UpdateEventHandler;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.*;
@@ -44,7 +45,7 @@
public class Merger implements IMerger {
protected final List<CommittedChangeList> myChangeLists;
protected final File myTarget;
- @Nullable private final ISVNEventHandler myHandler;
+ @Nullable private final ProgressTracker myHandler;
protected int myCount;
private final ProgressIndicator myProgressIndicator;
protected CommittedChangeList myLatestProcessed;
@@ -128,7 +129,7 @@
SvnTarget source = SvnTarget.fromURL(myCurrentBranchUrl);
MergeClient client = myVcs.getFactory(myTarget).createMergeClient();
- client.merge(source, createRange(), myTarget, SVNDepth.INFINITY, mySvnConfig.isMergeDryRun(), isRecordOnly(), true,
+ client.merge(source, createRange(), myTarget, Depth.INFINITY, mySvnConfig.isMergeDryRun(), isRecordOnly(), true,
mySvnConfig.getMergeOptions(), myHandler);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/PointMerger.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/PointMerger.java
index 1a58a3c..aabf015 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/PointMerger.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/PointMerger.java
@@ -22,11 +22,11 @@
import org.jetbrains.idea.svn.SvnRevisionNumber;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.copy.CopyMoveClient;
import org.jetbrains.idea.svn.delete.DeleteClient;
import org.jetbrains.idea.svn.history.SvnRepositoryContentRevision;
import org.jetbrains.idea.svn.update.UpdateEventHandler;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
@@ -87,7 +87,7 @@
SvnTarget source1 = SvnTarget.fromURL(SVNURL.parseURIEncoded(beforeUrl), ((SvnRevisionNumber)before.getRevisionNumber()).getRevision());
SvnTarget source2 = SvnTarget.fromURL(SVNURL.parseURIEncoded(afterUrl), ((SvnRevisionNumber) after.getRevisionNumber()).getRevision());
- client.merge(source1, source2, afterPath, SVNDepth.FILES, true, mySvnConfig.isMergeDryRun(), false, false, mySvnConfig.getMergeOptions(),
+ client.merge(source1, source2, afterPath, Depth.FILES, true, mySvnConfig.isMergeDryRun(), false, false, mySvnConfig.getMergeOptions(),
myHandler);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/SvnIntegrateChangesTask.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/SvnIntegrateChangesTask.java
index b4e544b..5dd6f24 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/SvnIntegrateChangesTask.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/SvnIntegrateChangesTask.java
@@ -36,11 +36,11 @@
import org.jetbrains.idea.svn.SvnChangeProvider;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.status.StatusType;
import org.jetbrains.idea.svn.update.UpdateEventHandler;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNStatus;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import java.io.File;
import java.util.ArrayList;
@@ -267,8 +267,8 @@
private void initMergeTarget() {
final File mergeInfoHolder = myMerger.getMergeInfoHolder();
if (mergeInfoHolder != null) {
- final SVNStatus svnStatus = SvnUtil.getStatus(myVcs, mergeInfoHolder);
- if ((svnStatus != null) && (SVNStatusType.STATUS_MODIFIED.equals(svnStatus.getPropertiesStatus()))) {
+ final Status svnStatus = SvnUtil.getStatus(myVcs, mergeInfoHolder);
+ if ((svnStatus != null) && (StatusType.STATUS_MODIFIED.equals(svnStatus.getPropertiesStatus()))) {
myMergeTarget = FilePathImpl.create(mergeInfoHolder, mergeInfoHolder.isDirectory());
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/SvnKitMergeClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/SvnKitMergeClient.java
index e3635ff..51cbc7c 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/SvnKitMergeClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/SvnKitMergeClient.java
@@ -4,11 +4,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
+import org.jetbrains.idea.svn.diff.DiffOptions;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNDiffClient;
-import org.tmatesoft.svn.core.wc.SVNDiffOptions;
import org.tmatesoft.svn.core.wc.SVNRevisionRange;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -23,8 +23,8 @@
public void merge(@NotNull SvnTarget source,
@NotNull File destination,
boolean dryRun,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable DiffOptions diffOptions,
+ @Nullable ProgressTracker handler) throws VcsException {
assertUrl(source);
try {
@@ -39,17 +39,17 @@
public void merge(@NotNull SvnTarget source,
@NotNull SVNRevisionRange range,
@NotNull File destination,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean dryRun,
boolean recordOnly,
boolean force,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable DiffOptions diffOptions,
+ @Nullable ProgressTracker handler) throws VcsException {
assertUrl(source);
try {
createClient(diffOptions, handler).doMerge(source.getURL(), source.getPegRevision(), Collections.singletonList(range), destination,
- depth, true, force, dryRun, recordOnly);
+ toDepth(depth), true, force, dryRun, recordOnly);
}
catch (SVNException e) {
throw new VcsException(e);
@@ -60,19 +60,19 @@
public void merge(@NotNull SvnTarget source1,
@NotNull SvnTarget source2,
@NotNull File destination,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean useAncestry,
boolean dryRun,
boolean recordOnly,
boolean force,
- @Nullable SVNDiffOptions diffOptions,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @Nullable DiffOptions diffOptions,
+ @Nullable ProgressTracker handler) throws VcsException {
assertUrl(source1);
assertUrl(source2);
try {
createClient(diffOptions, handler).doMerge(source1.getURL(), source1.getPegRevision(), source2.getURL(), source2.getPegRevision(),
- destination, depth, useAncestry, force, dryRun, recordOnly);
+ destination, toDepth(depth), useAncestry, force, dryRun, recordOnly);
}
catch (SVNException e) {
throw new VcsException(e);
@@ -80,11 +80,11 @@
}
@NotNull
- private SVNDiffClient createClient(@Nullable SVNDiffOptions diffOptions, @Nullable ISVNEventHandler handler) {
+ private SVNDiffClient createClient(@Nullable DiffOptions diffOptions, @Nullable ProgressTracker handler) {
SVNDiffClient client = myVcs.getSvnKitManager().createDiffClient();
- client.setMergeOptions(diffOptions);
- client.setEventHandler(handler);
+ client.setMergeOptions(toDiffOptions(diffOptions));
+ client.setEventHandler(toEventHandler(handler));
return client;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/CmdLockClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/CmdLockClient.java
index abc4b5b..551431d 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/CmdLockClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/CmdLockClient.java
@@ -5,15 +5,14 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.EventAction;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.commandLine.CommandExecutor;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
import org.tmatesoft.svn.core.SVNErrorMessage;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNNodeKind;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNEventAction;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -26,22 +25,22 @@
public class CmdLockClient extends BaseSvnClient implements LockClient {
@Override
- public void lock(@NotNull File file, boolean force, @NotNull String message, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void lock(@NotNull File file, boolean force, @NotNull String message, @Nullable ProgressTracker handler) throws VcsException {
List<String> parameters = prepareParameters(file, force);
parameters.add("--message");
parameters.add(message);
CommandExecutor command = execute(myVcs, SvnTarget.fromFile(file), SvnCommandName.lock, parameters, null);
- handleCommandCompletion(command, file, SVNEventAction.LOCKED, SVNEventAction.LOCK_FAILED, handler);
+ handleCommandCompletion(command, file, EventAction.LOCKED, EventAction.LOCK_FAILED, handler);
}
@Override
- public void unlock(@NotNull File file, boolean force, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void unlock(@NotNull File file, boolean force, @Nullable ProgressTracker handler) throws VcsException {
List<String> parameters = prepareParameters(file, force);
CommandExecutor command = execute(myVcs, SvnTarget.fromFile(file), SvnCommandName.unlock, parameters, null);
- handleCommandCompletion(command, file, SVNEventAction.UNLOCKED, SVNEventAction.UNLOCK_FAILED, handler);
+ handleCommandCompletion(command, file, EventAction.UNLOCKED, EventAction.UNLOCK_FAILED, handler);
}
private static List<String> prepareParameters(@NotNull File file, boolean force) {
@@ -55,9 +54,9 @@
private static void handleCommandCompletion(@NotNull CommandExecutor command,
@NotNull File file,
- @NotNull SVNEventAction success,
- @NotNull SVNEventAction failure,
- @Nullable ISVNEventHandler handler) throws VcsException {
+ @NotNull EventAction success,
+ @NotNull EventAction failure,
+ @Nullable ProgressTracker handler) throws VcsException {
// just warning appears in output when can not lock/unlock file for some reason (like, that file is already locked)
SVNErrorMessage error = SvnUtil.parseWarning(command.getErrorOutput());
@@ -70,17 +69,16 @@
}
private static void invokeHandler(@NotNull File file,
- @NotNull SVNEventAction action,
- @Nullable ISVNEventHandler handler,
+ @NotNull EventAction action,
+ @Nullable ProgressTracker handler,
@Nullable SVNErrorMessage error)
throws SVNException {
if (handler != null) {
- handler.handleEvent(createEvent(file, action, error), 1);
+ handler.consume(createEvent(file, action, error));
}
}
- private static SVNEvent createEvent(@NotNull File file, @NotNull SVNEventAction action, @Nullable SVNErrorMessage error) {
- return new SVNEvent(file, file.isDirectory() ? SVNNodeKind.DIR : SVNNodeKind.FILE, null, -1, null, null, null, null, action, action,
- error, null, null, null, null);
+ private static ProgressEvent createEvent(@NotNull File file, @NotNull EventAction action, @Nullable SVNErrorMessage error) {
+ return new ProgressEvent(file, -1, null, null, action, error, null);
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/Lock.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/Lock.java
new file mode 100644
index 0000000..60598a9
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/Lock.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.lock;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.tmatesoft.svn.core.SVNLock;
+
+import javax.xml.bind.annotation.*;
+import java.util.Date;
+
+/**
+ * TODO: Probably unify with LogicalLock class
+ *
+ * @author Konstantin Kolosovsky.
+ */
+public class Lock {
+
+ private final String myOwner;
+ private final String myComment;
+ private final Date myCreationDate;
+ @Nullable private final Date myExpirationDate;
+
+ @Nullable
+ public static Lock create(@Nullable SVNLock lock) {
+ Lock result = null;
+
+ if (lock != null) {
+ result = new Lock.Builder().setOwner(lock.getOwner()).setComment(lock.getComment()).setCreationDate(lock.getCreationDate())
+ .setExpirationDate(lock.getExpirationDate()).build();
+ }
+
+ return result;
+ }
+
+ public Lock(@NotNull Lock.Builder builder) {
+ myOwner = builder.owner;
+ myComment = builder.comment;
+ myCreationDate = builder.created;
+ myExpirationDate = builder.expires;
+ }
+
+ public String getComment() {
+ return myComment;
+ }
+
+ public Date getCreationDate() {
+ return myCreationDate;
+ }
+
+ @Nullable
+ public Date getExpirationDate() {
+ return myExpirationDate;
+ }
+
+ public String getOwner() {
+ return myOwner;
+ }
+
+ @XmlAccessorType(XmlAccessType.NONE)
+ @XmlType(name = "lock")
+ @XmlRootElement(name = "lock")
+ public static class Builder {
+
+ @XmlElement(name = "token")
+ private String token;
+
+ @XmlElement(name = "owner")
+ private String owner;
+
+ @XmlElement(name = "comment")
+ private String comment;
+
+ @XmlElement(name = "created")
+ private Date created;
+
+ @XmlElement(name = "expires")
+ @Nullable private Date expires;
+
+ @NotNull
+ public Builder setToken(String token) {
+ this.token = token;
+ return this;
+ }
+
+ @NotNull
+ public Builder setOwner(String owner) {
+ this.owner = owner;
+ return this;
+ }
+
+ @NotNull
+ public Builder setComment(String comment) {
+ this.comment = comment;
+ return this;
+ }
+
+ @NotNull
+ public Builder setCreationDate(Date creationDate) {
+ this.created = creationDate;
+ return this;
+ }
+
+ @NotNull
+ public Builder setExpirationDate(@Nullable Date expirationDate) {
+ this.expires = expirationDate;
+ return this;
+ }
+
+ @NotNull
+ public Lock build() {
+ return new Lock(this);
+ }
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/LockClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/LockClient.java
index f36891f..4a64a4e 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/LockClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/LockClient.java
@@ -3,8 +3,8 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import java.io.File;
@@ -16,9 +16,9 @@
void lock(@NotNull File file,
boolean force,
@NotNull String message,
- @Nullable ISVNEventHandler handler) throws VcsException;
+ @Nullable ProgressTracker handler) throws VcsException;
void unlock(@NotNull File file,
boolean force,
- @Nullable ISVNEventHandler handler) throws VcsException;
+ @Nullable ProgressTracker handler) throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/SvnKitLockClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/SvnKitLockClient.java
index d11aec2..2db2650 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/SvnKitLockClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/lock/SvnKitLockClient.java
@@ -4,9 +4,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNWCClient;
import java.io.File;
@@ -17,7 +17,7 @@
public class SvnKitLockClient extends BaseSvnClient implements LockClient {
@Override
- public void lock(@NotNull File file, boolean force, @NotNull String message, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void lock(@NotNull File file, boolean force, @NotNull String message, @Nullable ProgressTracker handler) throws VcsException {
try {
getClient(handler).doLock(new File[]{file}, force, message);
}
@@ -27,7 +27,7 @@
}
@Override
- public void unlock(@NotNull File file, boolean force, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void unlock(@NotNull File file, boolean force, @Nullable ProgressTracker handler) throws VcsException {
try {
getClient(handler).doUnlock(new File[]{file}, force);
}
@@ -37,10 +37,10 @@
}
@NotNull
- private SVNWCClient getClient(@Nullable ISVNEventHandler handler) {
+ private SVNWCClient getClient(@Nullable ProgressTracker handler) {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
- client.setEventHandler(handler);
+ client.setEventHandler(toEventHandler(handler));
return client;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/BranchInfo.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/BranchInfo.java
index ead9b7d..6263829 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/BranchInfo.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/BranchInfo.java
@@ -21,10 +21,10 @@
import com.intellij.util.containers.MultiMap;
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.history.SvnChangeList;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.internal.util.SVNMergeInfoUtil;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNPropertyData;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -123,7 +123,7 @@
}
private SvnMergeInfoCache.MergeCheckResult checkAlive(final SvnChangeList list, final String branchPath) {
- final SVNInfo info = getInfo(new File(branchPath));
+ final Info info = getInfo(new File(branchPath));
if (info == null || info.getURL() == null || (! SVNPathUtil.isAncestor(myBranchUrl, info.getURL().toString()))) {
return SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
}
@@ -179,7 +179,7 @@
// no paths in local copy
return SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS;
}
- final SVNInfo svnInfo = getInfo(new File(branchRootPath));
+ final Info svnInfo = getInfo(new File(branchRootPath));
if (svnInfo == null || svnInfo.getRevision() == null || svnInfo.getURL() == null) {
return SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
}
@@ -238,7 +238,7 @@
return processMergeinfoProperty(keyString, revisionAsked, mergeinfoProperty.getValue(), trunkUrl, false);
}
- private SVNInfo getInfo(final File pathFile) {
+ private Info getInfo(final File pathFile) {
return myVcs.getInfo(pathFile);
}
@@ -255,7 +255,7 @@
}
}
- final SVNInfo svnInfo = getInfo(pathFile);
+ final Info svnInfo = getInfo(pathFile);
if (svnInfo == null || svnInfo.getRevision() == null || svnInfo.getURL() == null) {
LOG.info("Svninfo for " + pathFile + " is null or not full.");
return SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/OneRecursiveShotMergeInfoWorker.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/OneRecursiveShotMergeInfoWorker.java
index bd2c415..0ea95c9 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/OneRecursiveShotMergeInfoWorker.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/OneRecursiveShotMergeInfoWorker.java
@@ -21,6 +21,7 @@
import com.intellij.openapi.vcs.VcsException;
import com.intellij.util.PairProcessor;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.dialogs.MergeContext;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.internal.util.SVNMergeInfoUtil;
@@ -61,7 +62,7 @@
}
public void prepare() throws VcsException {
- final SVNDepth depth = myMergeContext.getVcs().getSvnConfiguration().isCheckNestedForQuickMerge() ? SVNDepth.INFINITY : SVNDepth.EMPTY;
+ final Depth depth = Depth.allOrEmpty(myMergeContext.getVcs().getSvnConfiguration().isCheckNestedForQuickMerge());
ISVNPropertyHandler handler = new ISVNPropertyHandler() {
public void handleProperty(File path, SVNPropertyData property) throws SVNException {
final String key = keyFromFile(path);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/CmdPropertyClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/CmdPropertyClient.java
index 60ab43c..e855abe 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/CmdPropertyClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/CmdPropertyClient.java
@@ -5,12 +5,13 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.commandLine.CommandExecutor;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.wc.ISVNPropertyHandler;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNPropertyData;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -63,7 +64,7 @@
public void getProperty(@NotNull SvnTarget target,
@NotNull String property,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@Nullable ISVNPropertyHandler handler) throws VcsException {
List<String> parameters = new ArrayList<String>();
@@ -77,7 +78,7 @@
@Override
public void list(@NotNull SvnTarget target,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@Nullable ISVNPropertyHandler handler) throws VcsException {
List<String> parameters = new ArrayList<String>();
fillListParameters(target, revision, depth, parameters, true);
@@ -90,7 +91,7 @@
public void setProperty(@NotNull File file,
@NotNull String property,
@Nullable SVNPropertyValue value,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean force) throws VcsException {
runSetProperty(SvnTarget.fromFile(file), property, null, depth, value, force);
}
@@ -101,7 +102,7 @@
currentProperties.putAll(properties);
for (String propertyName : currentProperties.nameSet()) {
- setProperty(file, propertyName, currentProperties.getSVNPropertyValue(propertyName), SVNDepth.EMPTY, true);
+ setProperty(file, propertyName, currentProperties.getSVNPropertyValue(propertyName), Depth.EMPTY, true);
}
}
@@ -109,7 +110,7 @@
private SVNProperties collectPropertiesToDelete(@NotNull File file) throws VcsException {
final SVNProperties result = new SVNProperties();
- list(SvnTarget.fromFile(file), null, SVNDepth.EMPTY, new ISVNPropertyHandler() {
+ list(SvnTarget.fromFile(file), null, Depth.EMPTY, new ISVNPropertyHandler() {
@Override
public void handleProperty(File path, SVNPropertyData property) throws SVNException {
// null indicates property will be deleted
@@ -140,7 +141,7 @@
private void runSetProperty(@NotNull SvnTarget target,
@NotNull String property,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@Nullable SVNPropertyValue value,
boolean force) throws VcsException {
List<String> parameters = new ArrayList<String>();
@@ -169,7 +170,7 @@
private void fillListParameters(@NotNull SvnTarget target,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@NotNull List<String> parameters,
boolean verbose) {
CommandUtil.put(parameters, target);
@@ -266,7 +267,7 @@
// base should be resolved manually - could not set revision to BASE to get revision property
if (SVNRevision.BASE.equals(revision)) {
- SVNInfo info = myVcs.getInfo(path, SVNRevision.BASE);
+ Info info = myVcs.getInfo(path, SVNRevision.BASE);
result = info != null ? info.getRevision().getNumber() : -1;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/PropertyClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/PropertyClient.java
index b44f7ea..1b61d59 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/PropertyClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/PropertyClient.java
@@ -5,8 +5,8 @@
import com.intellij.util.LineSeparator;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNProperties;
import org.tmatesoft.svn.core.SVNPropertyValue;
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions;
@@ -38,18 +38,18 @@
void getProperty(@NotNull SvnTarget target, @NotNull String property,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@Nullable ISVNPropertyHandler handler) throws VcsException;
void list(@NotNull SvnTarget target,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@Nullable ISVNPropertyHandler handler) throws VcsException;
void setProperty(@NotNull File file,
@NotNull String property,
@Nullable SVNPropertyValue value,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean force) throws VcsException;
void setProperties(@NotNull File file, @NotNull SVNProperties properties) throws VcsException;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/SvnKitPropertyClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/SvnKitPropertyClient.java
index 6434392..4ad3f10 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/SvnKitPropertyClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/properties/SvnKitPropertyClient.java
@@ -4,6 +4,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.wc.*;
@@ -50,7 +51,7 @@
public void getProperty(@NotNull SvnTarget target,
@NotNull String property,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@Nullable ISVNPropertyHandler handler) throws VcsException {
runGetProperty(target, property, revision, depth, handler);
}
@@ -58,7 +59,7 @@
@Override
public void list(@NotNull SvnTarget target,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@Nullable ISVNPropertyHandler handler) throws VcsException {
runGetProperty(target, null, revision, depth, handler);
}
@@ -67,10 +68,10 @@
public void setProperty(@NotNull File file,
@NotNull String property,
@Nullable SVNPropertyValue value,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean force) throws VcsException {
try {
- createClient().doSetProperty(file, property, value, force, depth, null, null);
+ createClient().doSetProperty(file, property, value, force, toDepth(depth), null, null);
}
catch (SVNException e) {
throw new SvnBindException(e);
@@ -114,15 +115,15 @@
private void runGetProperty(@NotNull SvnTarget target,
@Nullable String property,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
@Nullable ISVNPropertyHandler handler) throws VcsException {
SVNWCClient client = createClient();
try {
if (target.isURL()) {
- client.doGetProperty(target.getURL(), property, target.getPegRevision(), revision, depth, handler);
+ client.doGetProperty(target.getURL(), property, target.getPegRevision(), revision, toDepth(depth), handler);
} else {
- client.doGetProperty(target.getFile(), property, target.getPegRevision(), revision, depth, handler, null);
+ client.doGetProperty(target.getFile(), property, target.getPegRevision(), revision, toDepth(depth), handler, null);
}
} catch (SVNException e) {
throw new VcsException(e);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/CmdRevertClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/CmdRevertClient.java
index aef5ae9..a57e24b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/CmdRevertClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/CmdRevertClient.java
@@ -4,15 +4,11 @@
import com.intellij.util.containers.Convertor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.jetbrains.idea.svn.api.FileStatusResultParser;
+import org.jetbrains.idea.svn.api.*;
import org.jetbrains.idea.svn.commandLine.CommandExecutor;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNEventAction;
+import org.jetbrains.idea.svn.api.Depth;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -32,7 +28,7 @@
private static final Pattern CHANGED_PATH = Pattern.compile(STATUS + PATH + OPTIONAL_COMMENT);
@Override
- public void revert(@NotNull File[] paths, @Nullable SVNDepth depth, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void revert(@NotNull File[] paths, @Nullable Depth depth, @Nullable ProgressTracker handler) throws VcsException {
if (paths.length > 0) {
List<String> parameters = prepareParameters(paths, depth);
@@ -46,7 +42,7 @@
}
}
- private static List<String> prepareParameters(File[] paths, SVNDepth depth) {
+ private static List<String> prepareParameters(File[] paths, Depth depth) {
ArrayList<String> parameters = new ArrayList<String>();
CommandUtil.put(parameters, paths);
@@ -55,9 +51,9 @@
return parameters;
}
- private static class RevertStatusConvertor implements Convertor<Matcher, SVNEvent> {
+ private static class RevertStatusConvertor implements Convertor<Matcher, ProgressEvent> {
- public SVNEvent convert(@NotNull Matcher matcher) {
+ public ProgressEvent convert(@NotNull Matcher matcher) {
String statusMessage = matcher.group(1);
String path = matcher.group(2);
@@ -65,17 +61,17 @@
}
@Nullable
- public static SVNEventAction createAction(@NotNull String code) {
- SVNEventAction result = null;
+ public static EventAction createAction(@NotNull String code) {
+ EventAction result = null;
if ("Reverted".equals(code)) {
- result = SVNEventAction.REVERT;
+ result = EventAction.REVERT;
}
else if ("Failed to revert".equals(code)) {
- result = SVNEventAction.FAILED_REVERT;
+ result = EventAction.FAILED_REVERT;
}
else if ("Skipped".equals(code)) {
- result = SVNEventAction.SKIP;
+ result = EventAction.SKIP;
}
return result;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/RevertClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/RevertClient.java
index 053de37..5f0d26b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/RevertClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/RevertClient.java
@@ -3,9 +3,9 @@
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import java.io.File;
@@ -14,5 +14,5 @@
*/
public interface RevertClient extends SvnClient {
- void revert(@NotNull File[] paths, @Nullable SVNDepth depth, @Nullable ISVNEventHandler handler) throws VcsException;
+ void revert(@NotNull File[] paths, @Nullable Depth depth, @Nullable ProgressTracker handler) throws VcsException;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/SvnKitRevertClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/SvnKitRevertClient.java
index ea88ebc..06593f4 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/SvnKitRevertClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/revert/SvnKitRevertClient.java
@@ -4,9 +4,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNWCClient;
import java.io.File;
@@ -17,12 +17,12 @@
public class SvnKitRevertClient extends BaseSvnClient implements RevertClient {
@Override
- public void revert(@NotNull File[] paths, @Nullable SVNDepth depth, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void revert(@NotNull File[] paths, @Nullable Depth depth, @Nullable ProgressTracker handler) throws VcsException {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
- client.setEventHandler(handler);
+ client.setEventHandler(toEventHandler(handler));
try {
- client.doRevert(paths, depth, null);
+ client.doRevert(paths, toDepth(depth), null);
}
catch (SVNException e) {
throw new VcsException(e);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/rollback/SvnRollbackEnvironment.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/rollback/SvnRollbackEnvironment.java
index 01c86eb..237d05b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/rollback/SvnRollbackEnvironment.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/rollback/SvnRollbackEnvironment.java
@@ -28,6 +28,12 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.*;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.EventAction;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.wc.*;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -75,15 +81,15 @@
checker.gather(changes);
exceptions.addAll(checker.getExceptions());
- ISVNEventHandler revertHandler = new ISVNEventHandler() {
- public void handleEvent(SVNEvent event, double progress) {
- if (event.getAction() == SVNEventAction.REVERT) {
+ ProgressTracker revertHandler = new ProgressTracker() {
+ public void consume(ProgressEvent event) {
+ if (event.getAction() == EventAction.REVERT) {
final File file = event.getFile();
if (file != null) {
listener.accept(file);
}
}
- if (event.getAction() == SVNEventAction.FAILED_REVERT) {
+ if (event.getAction() == EventAction.FAILED_REVERT) {
exceptions.add(new VcsException("Revert failed"));
}
}
@@ -150,7 +156,7 @@
final File source = entry.getKey();
final ThroughRenameInfo info = entry.getValue();
if (info.isVersioned()) {
- mySvnVcs.getFactory(source).createPropertyClient().list(SvnTarget.fromFile(source), SVNRevision.WORKING, SVNDepth.EMPTY, handler);
+ mySvnVcs.getFactory(source).createPropertyClient().list(SvnTarget.fromFile(source), SVNRevision.WORKING, Depth.EMPTY, handler);
}
if (source.isDirectory()) {
if (! FileUtil.filesEqual(info.getTo(), info.getFirstTo())) {
@@ -225,8 +231,8 @@
catch (IOException e) {
exceptions.add(new VcsException(e));
}
- catch (SVNException e) {
- exceptions.add(new VcsException(e));
+ catch (VcsException e) {
+ exceptions.add(e);
}
}
}
@@ -248,10 +254,10 @@
private static class Reverter {
@NotNull private final SvnVcs myVcs;
- private ISVNEventHandler myHandler;
+ private ProgressTracker myHandler;
private final List<VcsException> myExceptions;
- private Reverter(@NotNull SvnVcs vcs, ISVNEventHandler handler, List<VcsException> exceptions) {
+ private Reverter(@NotNull SvnVcs vcs, ProgressTracker handler, List<VcsException> exceptions) {
myVcs = vcs;
myHandler = handler;
myExceptions = exceptions;
@@ -261,7 +267,7 @@
if (files.length == 0) return;
try {
// Files passed here are split into groups by root and working copy format - thus we could determine factory based on first file
- myVcs.getFactory(files[0]).createRevertClient().revert(files, recursive ? SVNDepth.INFINITY : SVNDepth.EMPTY, myHandler);
+ myVcs.getFactory(files[0]).createRevertClient().revert(files, Depth.allOrEmpty(recursive), myHandler);
}
catch (VcsException e) {
processRevertError(e);
@@ -298,9 +304,9 @@
}
private void revertFileOrDir(File file) throws SVNException, VcsException {
- SVNInfo info = mySvnVcs.getInfo(file);
+ Info info = mySvnVcs.getInfo(file);
if (info != null) {
- if (info.getKind() == SVNNodeKind.FILE) {
+ if (info.isFile()) {
doRevert(file, false);
} else {
if (SVNProperty.SCHEDULE_ADD.equals(info.getSchedule())) {
@@ -321,17 +327,17 @@
}
private void doRevert(@NotNull File path, boolean recursive) throws VcsException {
- mySvnVcs.getFactory(path).createRevertClient().revert(new File[]{path}, SVNDepth.fromRecurse(recursive), null);
+ mySvnVcs.getFactory(path).createRevertClient().revert(new File[]{path}, Depth.allOrFiles(recursive), null);
}
- private boolean is17OrGreaterCopy(final File file, final SVNInfo info) throws VcsException {
+ private boolean is17OrGreaterCopy(final File file, final Info info) throws VcsException {
final RootsToWorkingCopies copies = mySvnVcs.getRootsToWorkingCopies();
WorkingCopy copy = copies.getMatchingCopy(info.getURL());
if (copy == null) {
WorkingCopyFormat format = mySvnVcs.getWorkingCopyFormat(file);
- return !WorkingCopyFormat.UNKNOWN.equals(format) && format.isOrGreater(WorkingCopyFormat.ONE_DOT_SEVEN);
+ return format.isOrGreater(WorkingCopyFormat.ONE_DOT_SEVEN);
} else {
return copy.is17Copy();
}
@@ -614,6 +620,9 @@
catch (SVNException e) {
myExceptions.add(new VcsException(e));
}
+ catch (SvnBindException e) {
+ myExceptions.add(e);
+ }
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/CmdStatusClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/CmdStatusClient.java
index 235f5d1..4030c83 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/CmdStatusClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/CmdStatusClient.java
@@ -18,18 +18,18 @@
import com.intellij.openapi.util.Getter;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.util.containers.Convertor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.jetbrains.idea.svn.commandLine.CommandExecutor;
-import org.jetbrains.idea.svn.commandLine.CommandUtil;
-import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.jetbrains.idea.svn.commandLine.SvnExceptionWrapper;
-import org.tmatesoft.svn.core.*;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.commandLine.*;
+import org.jetbrains.idea.svn.info.Info;
+import org.tmatesoft.svn.core.SVNErrorCode;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
import org.tmatesoft.svn.core.wc.*;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -52,75 +52,38 @@
public class CmdStatusClient extends BaseSvnClient implements StatusClient {
@Override
- public long doStatus(File path, boolean recursive, boolean remote, boolean reportAll, boolean includeIgnored, ISVNStatusHandler handler)
- throws SVNException {
- return doStatus(path, recursive, remote, reportAll, includeIgnored, false, handler);
- }
-
- @Override
- public long doStatus(File path,
- boolean recursive,
- boolean remote,
- boolean reportAll,
- boolean includeIgnored,
- boolean collectParentExternals,
- ISVNStatusHandler handler) throws SVNException {
- return doStatus(path, SVNRevision.UNDEFINED, recursive, remote, reportAll, includeIgnored, collectParentExternals, handler);
- }
-
- @Override
- public long doStatus(File path,
- SVNRevision revision,
- boolean recursive,
- boolean remote,
- boolean reportAll,
- boolean includeIgnored,
- boolean collectParentExternals,
- ISVNStatusHandler handler) throws SVNException {
- return doStatus(path, revision, recursive ? SVNDepth.INFINITY : SVNDepth.EMPTY, remote, reportAll, includeIgnored,
- collectParentExternals, handler, null);
- }
-
- @Override
public long doStatus(final File path,
final SVNRevision revision,
- final SVNDepth depth,
+ final Depth depth,
boolean remote,
boolean reportAll,
boolean includeIgnored,
boolean collectParentExternals,
- final ISVNStatusHandler handler,
- final Collection changeLists) throws SVNException {
+ final StatusConsumer handler,
+ final Collection changeLists) throws SvnBindException {
File base = path.isDirectory() ? path : path.getParentFile();
base = CommandUtil.correctUpToExistingParent(base);
- final SVNInfo infoBase = myFactory.createInfoClient().doInfo(base, revision);
+ final Info infoBase = myFactory.createInfoClient().doInfo(base, revision);
List<String> parameters = new ArrayList<String>();
putParameters(parameters, path, depth, remote, reportAll, includeIgnored, changeLists);
- CommandExecutor command;
- try {
- command = execute(myVcs, SvnTarget.fromFile(path), SvnCommandName.st, parameters, null);
- }
- catch (VcsException e) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e), e);
- }
+ CommandExecutor command = execute(myVcs, SvnTarget.fromFile(path), SvnCommandName.st, parameters, null);
parseResult(path, revision, handler, base, infoBase, command);
return 0;
}
private void parseResult(final File path,
SVNRevision revision,
- ISVNStatusHandler handler,
+ StatusConsumer handler,
File base,
- SVNInfo infoBase,
- CommandExecutor command) throws SVNException {
+ Info infoBase,
+ CommandExecutor command) throws SvnBindException {
String result = command.getOutput();
if (StringUtil.isEmptyOrSpaces(result)) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.FS_GENERAL, "Status request returned nothing for command: " +
- command.getCommandText()));
+ throw new SvnBindException("Status request returned nothing for command: " + command.getCommandText());
}
try {
@@ -130,8 +93,7 @@
parser.parse(new ByteArrayInputStream(result.trim().getBytes(CharsetToolkit.UTF8_CHARSET)), svnHandl[0]);
if (!svnHandl[0].isAnythingReported()) {
if (!SvnUtil.isSvnVersioned(myVcs, path)) {
- throw new SVNException(
- SVNErrorMessage.create(SVNErrorCode.WC_NOT_DIRECTORY, "Command - " + command.getCommandText() + ". Result - " + result));
+ throw new SvnBindException(SVNErrorCode.WC_NOT_DIRECTORY, "Command - " + command.getCommandText() + ". Result - " + result);
} else {
// return status indicating "NORMAL" state
// typical output would be like
@@ -142,38 +104,42 @@
PortableStatus status = new PortableStatus();
status.setPath(path.getAbsolutePath());
- status.setContentsStatus(SVNStatusType.STATUS_NORMAL);
- status.setInfoGetter(new Getter<SVNInfo>() {
+ status.setContentsStatus(StatusType.STATUS_NORMAL);
+ status.setInfoGetter(new Getter<Info>() {
@Override
- public SVNInfo get() {
+ public Info get() {
return createInfoGetter(null).convert(path);
}
});
- handler.handleStatus(status);
+ try {
+ handler.consume(status);
+ }
+ catch (SVNException e) {
+ throw new SvnBindException(e);
+ }
}
}
}
catch (SvnExceptionWrapper e) {
- throw (SVNException) e.getCause();
+ throw new SvnBindException(e.getCause());
} catch (IOException e) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e), e);
+ throw new SvnBindException(e);
}
catch (ParserConfigurationException e) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e), e);
+ throw new SvnBindException(e);
}
catch (SAXException e) {
// status parsing errors are logged separately as sometimes there are parsing errors connected to terminal output handling.
// these errors primarily occur when status output is rather large.
// and status output could be large, for instance, when working copy is locked (seems that each file is listed in status output).
command.logCommand();
-
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e), e);
+ throw new SvnBindException(e);
}
}
private static void putParameters(@NotNull List<String> parameters,
@NotNull File path,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean remote,
boolean reportAll,
boolean includeIgnored,
@@ -189,33 +155,33 @@
}
public SvnStatusHandler createStatusHandler(final SVNRevision revision,
- final ISVNStatusHandler handler,
+ final StatusConsumer handler,
final File base,
- final SVNInfo infoBase, final SvnStatusHandler[] svnHandl) {
+ final Info infoBase, final SvnStatusHandler[] svnHandl) {
final SvnStatusHandler.ExternalDataCallback callback = createStatusCallback(handler, base, infoBase, svnHandl);
return new SvnStatusHandler(callback, base, createInfoGetter(revision));
}
- private Convertor<File, SVNInfo> createInfoGetter(final SVNRevision revision) {
- return new Convertor<File, SVNInfo>() {
+ private Convertor<File, Info> createInfoGetter(final SVNRevision revision) {
+ return new Convertor<File, Info>() {
@Override
- public SVNInfo convert(File o) {
+ public Info convert(File o) {
try {
return myFactory.createInfoClient().doInfo(o, revision);
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
throw new SvnExceptionWrapper(e);
}
}
};
}
- public static SvnStatusHandler.ExternalDataCallback createStatusCallback(final ISVNStatusHandler handler,
+ public static SvnStatusHandler.ExternalDataCallback createStatusCallback(final StatusConsumer handler,
final File base,
- final SVNInfo infoBase,
+ final Info infoBase,
final SvnStatusHandler[] svnHandl) {
- final Map<File, SVNInfo> externalsMap = new HashMap<File, SVNInfo>();
+ final Map<File, Info> externalsMap = new HashMap<File, Info>();
final String[] changelistName = new String[1];
return new SvnStatusHandler.ExternalDataCallback() {
@@ -225,7 +191,7 @@
pending.setChangelistName(changelistName[0]);
try {
//if (infoBase != null) {
- SVNInfo baseInfo = infoBase;
+ Info baseInfo = infoBase;
File baseFile = base;
final File pendingFile = new File(pending.getPath());
if (! externalsMap.isEmpty()) {
@@ -250,10 +216,10 @@
}
pending.setURL(SVNURL.parseURIEncoded(append));
}
- if (SVNStatusType.STATUS_EXTERNAL.equals(pending.getNodeStatus())) {
+ if (StatusType.STATUS_EXTERNAL.equals(pending.getNodeStatus())) {
externalsMap.put(pending.getFile(), pending.getInfo());
}
- handler.handleStatus(pending);
+ handler.consume(pending);
}
catch (SVNException e) {
throw new SvnExceptionWrapper(e);
@@ -268,16 +234,11 @@
}
@Override
- public SVNStatus doStatus(File path, boolean remote) throws SVNException {
- return doStatus(path, remote, false);
- }
-
- @Override
- public SVNStatus doStatus(File path, boolean remote, boolean collectParentExternals) throws SVNException {
- final SVNStatus[] svnStatus = new SVNStatus[1];
- doStatus(path, SVNRevision.UNDEFINED, SVNDepth.EMPTY, remote, false, false, collectParentExternals, new ISVNStatusHandler() {
+ public Status doStatus(File path, boolean remote) throws SvnBindException {
+ final Status[] svnStatus = new Status[1];
+ doStatus(path, SVNRevision.UNDEFINED, Depth.EMPTY, remote, false, false, false, new StatusConsumer() {
@Override
- public void handleStatus(SVNStatus status) throws SVNException {
+ public void consume(Status status) throws SVNException {
svnStatus[0] = status;
}
}, null);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/PortableStatus.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/PortableStatus.java
index e78c0cd..4ed2d78 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/PortableStatus.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/PortableStatus.java
@@ -15,10 +15,13 @@
*/
package org.jetbrains.idea.svn.status;
-import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Getter;
-import org.tmatesoft.svn.core.SVNLock;
-import org.tmatesoft.svn.core.SVNNodeKind;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.jetbrains.idea.svn.conflict.TreeConflictDescription;
+import org.jetbrains.idea.svn.info.Info;
+import org.jetbrains.idea.svn.lock.Lock;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.*;
@@ -27,18 +30,18 @@
import java.util.Map;
/**
+ * TODO: Merge PortableStatus and Status to single class.
+ *
* Created by IntelliJ IDEA.
* User: Irina.Chernushina
* Date: 1/24/12
* Time: 12:29 PM
*/
-public class PortableStatus extends SVNStatus {
-
- private static final Logger LOG = Logger.getInstance(PortableStatus.class);
+public class PortableStatus extends Status {
private boolean myConflicted;
- private Getter<SVNInfo> myInfoGetter;
- private SVNInfo myInfo;
+ private Getter<Info> myInfoGetter;
+ private Info myInfo;
private String myPath;
private boolean myFileExists;
@@ -81,42 +84,42 @@
*/
public PortableStatus(SVNURL url,
File file,
- SVNNodeKind kind,
+ @NotNull NodeKind kind,
SVNRevision revision,
SVNRevision committedRevision,
Date committedDate,
String author,
- SVNStatusType contentsStatus,
- SVNStatusType propertiesStatus,
- SVNStatusType remoteContentsStatus,
- SVNStatusType remotePropertiesStatus,
+ StatusType contentsStatus,
+ StatusType propertiesStatus,
+ StatusType remoteContentsStatus,
+ StatusType remotePropertiesStatus,
boolean isLocked,
boolean isCopied,
boolean isSwitched,
boolean isFileExternal,
- SVNLock remoteLock,
- SVNLock localLock,
+ @Nullable Lock remoteLock,
+ @Nullable Lock localLock,
Map entryProperties,
String changelistName,
int wcFormatVersion,
boolean isConflicted,
- Getter<SVNInfo> infoGetter) {
- super(url, file, kind, revision, committedRevision, committedDate, author, contentsStatus, propertiesStatus, remoteContentsStatus,
- remotePropertiesStatus, isLocked, isCopied, isSwitched, isFileExternal, null, null, null, null, null, null, remoteLock,
- localLock, entryProperties, changelistName, wcFormatVersion, null);
+ Getter<Info> infoGetter) {
+ super(url, file, kind, revision, committedRevision, contentsStatus, propertiesStatus, remoteContentsStatus,
+ remotePropertiesStatus, isLocked, isCopied, isSwitched, null, remoteLock,
+ localLock, changelistName, null);
myConflicted = isConflicted;
- myInfoGetter = infoGetter == null ? new Getter<SVNInfo>() {
+ myInfoGetter = infoGetter == null ? new Getter<Info>() {
@Override
- public SVNInfo get() {
+ public Info get() {
return null;
}
} : infoGetter;
}
public PortableStatus() {
- myInfoGetter = new Getter<SVNInfo>() {
+ myInfoGetter = new Getter<Info>() {
@Override
- public SVNInfo get() {
+ public Info get() {
return null;
}
};
@@ -124,22 +127,12 @@
}
@Override
- public int getWorkingCopyFormat() {
- LOG.error("Do not use working copy format detection through status");
- return 0;
- }
-
- @Override
public void setIsConflicted(boolean isConflicted) {
myConflicted = isConflicted;
super.setIsConflicted(isConflicted);
}
- public void setConflicted(boolean conflicted) {
- myConflicted = conflicted;
- }
-
- public void setInfoGetter(Getter<SVNInfo> infoGetter) {
+ public void setInfoGetter(Getter<Info> infoGetter) {
myInfoGetter = infoGetter;
}
@@ -148,10 +141,10 @@
return myConflicted;
}
- private SVNInfo initInfo() {
+ private Info initInfo() {
if (myInfo == null) {
- final SVNStatusType contentsStatus = getContentsStatus();
- if (contentsStatus == null || SVNStatusType.UNKNOWN.equals(contentsStatus)) {
+ final StatusType contentsStatus = getContentsStatus();
+ if (contentsStatus == null || StatusType.UNKNOWN.equals(contentsStatus)) {
return null;
}
myInfo = myInfoGetter.get();
@@ -159,14 +152,15 @@
return myInfo;
}
- public SVNInfo getInfo() {
+ public Info getInfo() {
return initInfo();
}
@Override
- public SVNNodeKind getKind() {
+ @NotNull
+ public NodeKind getKind() {
if (myFileExists) return super.getKind();
- final SVNInfo info = initInfo();
+ final Info info = initInfo();
if (info != null) {
return info.getKind();
}
@@ -174,68 +168,6 @@
}
/**
- * Gets the temporary file that contains all latest changes from the
- * repository which led to a conflict with local changes. This file is at
- * the HEAD revision.
- *
- * @return an autogenerated temporary file just as it is in the latest
- * revision in the repository
- */
- @Override
- public File getConflictNewFile() {
- if (! isConflicted()) return null;
- final SVNInfo info = initInfo();
- return info == null ? null : info.getConflictNewFile();
- }
-
- /**
- * Gets the temporary BASE revision file of that working file that is
- * currently in conflict with changes received from the repository. This
- * file does not contain the latest user's modifications, only 'pristine'
- * contents.
- *
- * @return an autogenerated temporary file just as the conflicting file was
- * before any modifications to it
- */
- @Override
- public File getConflictOldFile() {
- if (! isConflicted()) return null;
- final SVNInfo info = initInfo();
- return info == null ? null : info.getConflictOldFile();
- }
-
- /**
- * Gets the temporary <i>'.mine'</i> file with all current local changes to
- * the original file. That is if the file item is in conflict with changes
- * that came during an update this temporary file is created to get the
- * snapshot of the user's file with only the user's local modifications and
- * nothing more.
- *
- * @return an autogenerated temporary file with only the user's
- * modifications
- */
- @Override
- public File getConflictWrkFile() {
- if (! isConflicted()) return null;
- final SVNInfo info = initInfo();
- return info == null ? null : info.getConflictWrkFile();
- }
-
- /**
- * Gets the <i>'.prej'</i> file containing details on properties conflicts.
- * If the item's properties are in conflict with those that came during an
- * update this file will contain a conflict description.
- *
- * @return the properties conflicts file
- */
- @Override
- public File getPropRejectFile() {
- if (! isConflicted()) return null;
- final SVNInfo info = initInfo();
- return info == null ? null : info.getPropConflictFile();
- }
-
- /**
* Gets the URL (repository location) of the ancestor from which the item
* was copied. That is when the item is added with history.
*
@@ -244,7 +176,7 @@
@Override
public String getCopyFromURL() {
if (! isCopied()) return null;
- final SVNInfo info = initInfo();
+ final Info info = initInfo();
if (info == null) return null;
SVNURL url = initInfo().getCopyFromURL();
return url == null ? null : url.toString();
@@ -255,7 +187,7 @@
SVNURL url = super.getURL();
if (url == null) {
- SVNInfo info = initInfo();
+ Info info = initInfo();
url = info != null ? info.getURL() : url;
}
@@ -267,7 +199,7 @@
SVNURL url = super.getRepositoryRootURL();
if (url == null) {
- SVNInfo info = initInfo();
+ Info info = initInfo();
url = info != null ? info.getRepositoryRootURL() : url;
}
@@ -279,7 +211,7 @@
File file = super.getFile();
if (file == null) {
- SVNInfo info = initInfo();
+ Info info = initInfo();
file = info != null ? info.getFile() : file;
}
@@ -291,28 +223,15 @@
final SVNRevision revision = super.getRevision();
if (revision != null && revision.isValid()) return revision;
- final SVNStatusType status = getContentsStatus();
- if (SVNStatusType.STATUS_NONE.equals(status) || SVNStatusType.STATUS_UNVERSIONED.equals(status) ||
- SVNStatusType.STATUS_ADDED.equals(status)) return revision;
+ final StatusType status = getContentsStatus();
+ if (StatusType.STATUS_NONE.equals(status) || StatusType.STATUS_UNVERSIONED.equals(status) ||
+ StatusType.STATUS_ADDED.equals(status)) return revision;
- final SVNInfo info = initInfo();
+ final Info info = initInfo();
return info == null ? revision : info.getRevision();
}
/**
- * Gets the revision of the item's ancestor from which the item was copied
- * (the item is added with history).
- *
- * @return the ancestor's revision
- */
- @Override
- public SVNRevision getCopyFromRevision() {
- if (! isCopied()) return null;
- final SVNInfo info = initInfo();
- return info == null ? null : info.getCopyFromRevision();
- }
-
- /**
* Returns a tree conflict description.
*
* @return tree conflict description; <code>null</code> if no conflict
@@ -320,9 +239,10 @@
* @since 1.3
*/
@Override
- public SVNTreeConflictDescription getTreeConflict() {
+ @Nullable
+ public TreeConflictDescription getTreeConflict() {
if (! isConflicted()) return null;
- final SVNInfo info = initInfo();
+ final Info info = initInfo();
return info == null ? null : info.getTreeConflict();
}
@@ -334,7 +254,7 @@
return myPath;
}
- public void setKind(boolean exists, SVNNodeKind kind) {
+ public void setKind(boolean exists, @NotNull NodeKind kind) {
myFileExists = exists;
setKind(kind);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/Status.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/Status.java
new file mode 100644
index 0000000..7fc8151
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/Status.java
@@ -0,0 +1,313 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.status;
+
+import com.intellij.openapi.util.Condition;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.jetbrains.idea.svn.conflict.TreeConflictDescription;
+import org.jetbrains.idea.svn.lock.Lock;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.wc.SVNRevision;
+import org.tmatesoft.svn.core.wc.SVNStatus;
+
+import java.io.File;
+
+/**
+ * TODO: Could also inherit BaseNodeDescription when myKind becomes final.
+ *
+ * @author Konstantin Kolosovsky.
+ */
+public class Status {
+ private SVNURL myURL;
+ private File myFile;
+ private @NotNull NodeKind myKind;
+ private SVNRevision myRevision;
+ private SVNRevision myCommittedRevision;
+ private StatusType myContentsStatus;
+ private StatusType myPropertiesStatus;
+ private StatusType myRemoteContentsStatus;
+ private StatusType myRemoteNodeStatus;
+ private StatusType myRemotePropertiesStatus;
+ private boolean myIsLocked;
+ private boolean myIsCopied;
+ private boolean myIsSwitched;
+ private String myCopyFromURL;
+ @Nullable private Lock myRemoteLock;
+ @Nullable private Lock myLocalLock;
+ private SVNRevision myRemoteRevision;
+ private String myChangelistName;
+ @Nullable private TreeConflictDescription myTreeConflict;
+ private boolean myIsConflicted;
+
+ private StatusType myNodeStatus;
+ private SVNURL myRepositoryRootURL;
+
+ @Nullable
+ public static Status create(@Nullable SVNStatus status) {
+ Status result = null;
+
+ if (status != null) {
+ result =
+ new Status(status.getURL(), status.getFile(), NodeKind.from(status.getKind()), status.getRevision(), status.getCommittedRevision(),
+ StatusType.from(status.getContentsStatus()), StatusType.from(status.getPropertiesStatus()),
+ StatusType.from(status.getRemoteContentsStatus()), StatusType.from(status.getRemotePropertiesStatus()),
+ status.isLocked(), status.isCopied(), status.isSwitched(), status.getCopyFromURL(), Lock.create(status.getRemoteLock()),
+ Lock.create(status.getLocalLock()), status.getChangelistName(),
+ TreeConflictDescription.create(status.getTreeConflict()));
+ result.setIsConflicted(status.isConflicted());
+ result.setNodeStatus(StatusType.from(status.getNodeStatus()));
+ result.setRemoteNodeStatus(StatusType.from(status.getRemoteNodeStatus()));
+ result.setRemoteRevision(status.getRemoteRevision());
+ result.setRepositoryRootURL(status.getRepositoryRootURL());
+ }
+
+ return result;
+ }
+
+ public Status(SVNURL url,
+ File file,
+ @NotNull NodeKind kind,
+ SVNRevision revision,
+ SVNRevision committedRevision,
+ StatusType contentsStatus,
+ StatusType propertiesStatus,
+ StatusType remoteContentsStatus,
+ StatusType remotePropertiesStatus,
+ boolean isLocked,
+ boolean isCopied,
+ boolean isSwitched,
+ String copyFromURL,
+ @Nullable Lock remoteLock,
+ @Nullable Lock localLock,
+ String changelistName,
+ @Nullable TreeConflictDescription treeConflict) {
+ myURL = url;
+ myFile = file;
+ myKind = kind;
+ myRevision = revision == null ? SVNRevision.UNDEFINED : revision;
+ myCommittedRevision = committedRevision == null ? SVNRevision.UNDEFINED : committedRevision;
+ myContentsStatus = contentsStatus == null ? StatusType.STATUS_NONE : contentsStatus;
+ myPropertiesStatus = propertiesStatus == null ? StatusType.STATUS_NONE : propertiesStatus;
+ myRemoteContentsStatus = remoteContentsStatus == null ? StatusType.STATUS_NONE : remoteContentsStatus;
+ myRemotePropertiesStatus = remotePropertiesStatus == null ? StatusType.STATUS_NONE : remotePropertiesStatus;
+ myRemoteNodeStatus = StatusType.STATUS_NONE;
+ myIsLocked = isLocked;
+ myIsCopied = isCopied;
+ myIsSwitched = isSwitched;
+ myCopyFromURL = copyFromURL;
+ myRemoteLock = remoteLock;
+ myLocalLock = localLock;
+ myChangelistName = changelistName;
+ myTreeConflict = treeConflict;
+ myRemoteRevision = SVNRevision.UNDEFINED;
+ }
+
+ public Status() {
+ setRevision(SVNRevision.UNDEFINED);
+ myRemoteRevision = SVNRevision.UNDEFINED;
+ }
+
+ public SVNURL getURL() {
+ return myURL;
+ }
+
+ public File getFile() {
+ return myFile;
+ }
+
+ @NotNull
+ public NodeKind getKind() {
+ return myKind;
+ }
+
+ public SVNRevision getRevision() {
+ return myRevision;
+ }
+
+ public SVNRevision getCommittedRevision() {
+ return myCommittedRevision;
+ }
+
+ public StatusType getContentsStatus() {
+ return myContentsStatus;
+ }
+
+ public StatusType getPropertiesStatus() {
+ return myPropertiesStatus;
+ }
+
+ public StatusType getRemoteContentsStatus() {
+ return myRemoteContentsStatus;
+ }
+
+ public StatusType getRemotePropertiesStatus() {
+ return myRemotePropertiesStatus;
+ }
+
+ public boolean is(@NotNull StatusType type) {
+ return type.equals(getNodeStatus()) || type.equals(getContentsStatus());
+ }
+
+ public boolean is(@NotNull StatusType... types) {
+ return ContainerUtil.or(types, new Condition<StatusType>() {
+ @Override
+ public boolean value(StatusType type) {
+ return is(type);
+ }
+ });
+ }
+
+ public boolean isLocked() {
+ return myIsLocked;
+ }
+
+ public boolean isCopied() {
+ return myIsCopied;
+ }
+
+ public boolean isSwitched() {
+ return myIsSwitched;
+ }
+
+ public String getCopyFromURL() {
+ return myCopyFromURL;
+ }
+
+ @Nullable
+ public Lock getRemoteLock() {
+ return myRemoteLock;
+ }
+
+ @Nullable
+ public Lock getLocalLock() {
+ return myLocalLock;
+ }
+
+ public SVNRevision getRemoteRevision() {
+ return myRemoteRevision;
+ }
+
+ public String getChangelistName() {
+ return myChangelistName;
+ }
+
+ @Nullable
+ public TreeConflictDescription getTreeConflict() {
+ return myTreeConflict;
+ }
+
+ public boolean isConflicted() {
+ return myIsConflicted;
+ }
+
+ public StatusType getRemoteNodeStatus() {
+ return myRemoteNodeStatus;
+ }
+
+ public StatusType getNodeStatus() {
+ if (myNodeStatus == null) {
+ return myContentsStatus;
+ }
+ return myNodeStatus;
+ }
+
+ public SVNURL getRepositoryRootURL() {
+ return myRepositoryRootURL;
+ }
+
+ public void setURL(SVNURL uRL) {
+ myURL = uRL;
+ }
+
+ public void setFile(File file) {
+ myFile = file;
+ }
+
+ public void setKind(@NotNull NodeKind kind) {
+ myKind = kind;
+ }
+
+ public void setRevision(SVNRevision revision) {
+ myRevision = revision;
+ }
+
+ public void setCommittedRevision(SVNRevision committedRevision) {
+ myCommittedRevision = committedRevision;
+ }
+
+ public void setContentsStatus(StatusType statusType) {
+ myContentsStatus = statusType;
+ }
+
+ public void setPropertiesStatus(StatusType propertiesStatus) {
+ myPropertiesStatus = propertiesStatus;
+ }
+
+ public void setRemoteContentsStatus(StatusType remoteContentsStatus) {
+ myRemoteContentsStatus = remoteContentsStatus;
+ }
+
+ public void setRemotePropertiesStatus(StatusType remotePropertiesStatus) {
+ myRemotePropertiesStatus = remotePropertiesStatus;
+ }
+
+ public void setIsLocked(boolean isLocked) {
+ myIsLocked = isLocked;
+ }
+
+ public void setIsCopied(boolean isCopied) {
+ myIsCopied = isCopied;
+ }
+
+ public void setIsSwitched(boolean isSwitched) {
+ myIsSwitched = isSwitched;
+ }
+
+ public void setRemoteLock(@Nullable Lock remoteLock) {
+ myRemoteLock = remoteLock;
+ }
+
+ public void setLocalLock(@Nullable Lock localLock) {
+ myLocalLock = localLock;
+ }
+
+ public void setChangelistName(String changelistName) {
+ myChangelistName = changelistName;
+ }
+
+ public void setIsConflicted(boolean isConflicted) {
+ myIsConflicted = isConflicted;
+ }
+
+ public void setRemoteNodeStatus(StatusType remoteNodeStatus) {
+ myRemoteNodeStatus = remoteNodeStatus;
+ }
+
+ public void setNodeStatus(StatusType nodeStatus) {
+ myNodeStatus = nodeStatus;
+ }
+
+ public void setRepositoryRootURL(SVNURL repositoryRootURL) {
+ myRepositoryRootURL = repositoryRootURL;
+ }
+
+ public void setRemoteRevision(SVNRevision remoteRevision) {
+ myRemoteRevision = remoteRevision;
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/StatusClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/StatusClient.java
index 4b43e6c..9bbf74b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/StatusClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/StatusClient.java
@@ -15,12 +15,11 @@
*/
package org.jetbrains.idea.svn.status;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNStatusHandler;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNStatus;
import java.io.File;
import java.util.Collection;
@@ -32,13 +31,20 @@
* Time: 9:46 AM
*/
public interface StatusClient extends SvnClient {
- long doStatus(File path, boolean recursive, boolean remote, boolean reportAll,
- boolean includeIgnored, ISVNStatusHandler handler) throws SVNException;
- long doStatus(File path, boolean recursive, boolean remote, boolean reportAll, boolean includeIgnored, boolean collectParentExternals, ISVNStatusHandler handler) throws SVNException;
- long doStatus(File path, SVNRevision revision, boolean recursive, boolean remote, boolean reportAll, boolean includeIgnored, boolean collectParentExternals, ISVNStatusHandler handler) throws SVNException;
- long doStatus(File path, SVNRevision revision, SVNDepth depth, boolean remote, boolean reportAll,
- boolean includeIgnored, boolean collectParentExternals, ISVNStatusHandler handler,
- Collection changeLists) throws SVNException;
- SVNStatus doStatus( File path, boolean remote) throws SVNException;
- SVNStatus doStatus(File path, boolean remote, boolean collectParentExternals) throws SVNException;
+
+ /**
+ * TODO: Return value is never used by other code
+ */
+ long doStatus(File path,
+ SVNRevision revision,
+ Depth depth,
+ boolean remote,
+ boolean reportAll,
+ boolean includeIgnored,
+ boolean collectParentExternals,
+ StatusConsumer handler,
+ Collection changeLists) throws SvnBindException;
+
+ @Nullable
+ Status doStatus(File path, boolean remote) throws SvnBindException;
}
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkData.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/StatusConsumer.java
similarity index 71%
copy from platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkData.java
copy to plugins/svn4idea/src/org/jetbrains/idea/svn/status/StatusConsumer.java
index d99ea33..ca82bdc 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteSdkData.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/StatusConsumer.java
@@ -13,14 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package org.jetbrains.idea.svn.status;
-import com.intellij.remote.RemoteSdkCredentials;
+import com.intellij.util.ThrowableConsumer;
+import org.tmatesoft.svn.core.SVNException;
/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
+ * @author Konstantin Kolosovsky.
*/
-public interface RemoteSdkData extends RemoteSdkCredentials {
+public interface StatusConsumer extends ThrowableConsumer<Status, SVNException> {
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/StatusType.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/StatusType.java
new file mode 100644
index 0000000..ff1c3a8
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/StatusType.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.status;
+
+import com.intellij.util.ObjectUtils;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.tmatesoft.svn.core.wc.SVNStatusType;
+
+import java.util.Map;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public enum StatusType {
+
+ // currently used to represent some not used status types from SVNKit
+ UNUSED("unused"),
+
+ INAPPLICABLE("inapplicable"),
+ UNKNOWN("unknown"),
+ UNCHANGED("unchanged"),
+ MISSING("missing"),
+ OBSTRUCTED("obstructed"),
+ CHANGED("changed"),
+ MERGED("merged"),
+ CONFLICTED("conflicted"),
+
+ STATUS_NONE("none"),
+ STATUS_NORMAL("normal", ' '),
+ STATUS_MODIFIED("modified", 'M'),
+ STATUS_ADDED("added", 'A'),
+ STATUS_DELETED("deleted", 'D'),
+ STATUS_UNVERSIONED("unversioned", '?'),
+ STATUS_MISSING("missing", '!'),
+ STATUS_REPLACED("replaced", 'R'),
+ STATUS_CONFLICTED("conflicted", 'C'),
+ STATUS_OBSTRUCTED("obstructed", '~'),
+ STATUS_IGNORED("ignored", 'I'),
+ // directory is incomplete - checkout or update was interrupted
+ STATUS_INCOMPLETE("incomplete", '!'),
+ STATUS_EXTERNAL("external", 'X');
+
+ private static final String STATUS_PREFIX = "STATUS_";
+
+ @NotNull private static final Map<String, StatusType> ourOtherStatusTypes = ContainerUtil.newHashMap();
+ @NotNull private static final Map<String, StatusType> ourStatusTypesForStatusOperation = ContainerUtil.newHashMap();
+
+ static {
+ for (StatusType action : StatusType.values()) {
+ register(action);
+ }
+ }
+
+ private String myName;
+ private char myCode;
+
+ StatusType(String name) {
+ this(name, ' ');
+ }
+
+ StatusType(String name, char code) {
+ myName = name;
+ myCode = code;
+ }
+
+ public char getCode() {
+ return myCode;
+ }
+
+ public String toString() {
+ return myName;
+ }
+
+ private static void register(@NotNull StatusType action) {
+ (action.name().startsWith(STATUS_PREFIX) ? ourStatusTypesForStatusOperation : ourOtherStatusTypes).put(action.myName, action);
+ }
+
+ @NotNull
+ public static StatusType from(@NotNull SVNStatusType type) {
+ StatusType result = ourOtherStatusTypes.get(type.toString());
+
+ // CONFLICTED, OBSTRUCTED, MISSING status types have corresponding STATUS_* analogs with same names - so additional check added when
+ // converting from SVNKit values
+ if (type != SVNStatusType.CONFLICTED && type != SVNStatusType.OBSTRUCTED && type != SVNStatusType.MISSING) {
+ result = ObjectUtils.chooseNotNull(ourStatusTypesForStatusOperation.get(type.toString()), result);
+ }
+
+ return ObjectUtils.notNull(result, UNUSED);
+ }
+
+ @Nullable
+ public static StatusType forStatusOperation(@NotNull String statusName) {
+ return ourStatusTypesForStatusOperation.get(statusName);
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/SvnKitStatusClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/SvnKitStatusClient.java
index 4fc337b..3f33435 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/SvnKitStatusClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/SvnKitStatusClient.java
@@ -18,8 +18,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.jetbrains.idea.svn.status.StatusClient;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.wc.*;
@@ -36,68 +37,50 @@
private SVNStatusClient myStatusClient;
@Nullable private final ISVNStatusFileProvider myProvider;
- @Nullable private final ISVNEventHandler myHandler;
+ @Nullable private final ProgressTracker myHandler;
public SvnKitStatusClient() {
this(null, null);
}
- public SvnKitStatusClient(@Nullable ISVNStatusFileProvider provider, @Nullable ISVNEventHandler handler) {
+ public SvnKitStatusClient(@Nullable ISVNStatusFileProvider provider, @Nullable ProgressTracker handler) {
myProvider = provider;
myHandler = handler;
}
@Override
- public long doStatus(File path, boolean recursive, boolean remote, boolean reportAll, boolean includeIgnored, ISVNStatusHandler handler)
- throws SVNException {
- return getStatusClient().doStatus(path, recursive, remote, reportAll, includeIgnored, handler);
- }
-
- @Override
- public long doStatus(File path,
- boolean recursive,
- boolean remote,
- boolean reportAll,
- boolean includeIgnored,
- boolean collectParentExternals,
- ISVNStatusHandler handler) throws SVNException {
- return getStatusClient().doStatus(path, recursive, remote, reportAll, includeIgnored, collectParentExternals, handler);
- }
-
- @Override
public long doStatus(File path,
SVNRevision revision,
- boolean recursive,
+ Depth depth,
boolean remote,
boolean reportAll,
boolean includeIgnored,
boolean collectParentExternals,
- ISVNStatusHandler handler) throws SVNException {
- return getStatusClient().doStatus(path, revision, recursive, remote, reportAll, includeIgnored, collectParentExternals, handler);
+ final StatusConsumer handler,
+ Collection changeLists) throws SvnBindException {
+ try {
+ return getStatusClient()
+ .doStatus(path, revision, toDepth(depth), remote, reportAll, includeIgnored, collectParentExternals, new ISVNStatusHandler() {
+ @Override
+ public void handleStatus(SVNStatus status) throws SVNException {
+ handler.consume(Status.create(status));
+ }
+ }, changeLists);
+ }
+ catch (SVNException e) {
+ throw new SvnBindException(e);
+ }
}
@Override
- public long doStatus(File path,
- SVNRevision revision,
- SVNDepth depth,
- boolean remote,
- boolean reportAll,
- boolean includeIgnored,
- boolean collectParentExternals,
- ISVNStatusHandler handler,
- Collection changeLists) throws SVNException {
- return getStatusClient()
- .doStatus(path, revision, depth, remote, reportAll, includeIgnored, collectParentExternals, handler, changeLists);
- }
-
- @Override
- public SVNStatus doStatus(File path, boolean remote) throws SVNException {
- return getStatusClient().doStatus(path, remote);
- }
-
- @Override
- public SVNStatus doStatus(File path, boolean remote, boolean collectParentExternals) throws SVNException {
- return getStatusClient().doStatus(path, remote, collectParentExternals);
+ @Nullable
+ public Status doStatus(File path, boolean remote) throws SvnBindException {
+ try {
+ return Status.create(getStatusClient().doStatus(path, remote));
+ }
+ catch (SVNException e) {
+ throw new SvnBindException(e);
+ }
}
@NotNull
@@ -111,7 +94,7 @@
if (myStatusClient == null) {
myStatusClient = myVcs.getSvnKitManager().createStatusClient();
myStatusClient.setFilesProvider(myProvider);
- myStatusClient.setEventHandler(myHandler);
+ myStatusClient.setEventHandler(toEventHandler(myHandler));
}
return myStatusClient;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/SvnStatusHandler.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/SvnStatusHandler.java
index 642914a..e0f9758 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/status/SvnStatusHandler.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/status/SvnStatusHandler.java
@@ -18,18 +18,16 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Getter;
import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.Convertor;
import com.intellij.util.containers.MultiMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnUtil;
-import org.jetbrains.idea.svn.info.SVNLockWrapper;
-import org.tmatesoft.svn.core.SVNNodeKind;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.jetbrains.idea.svn.info.Info;
+import org.jetbrains.idea.svn.lock.Lock;
import org.tmatesoft.svn.core.internal.util.SVNDate;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
@@ -47,29 +45,9 @@
private static final Logger LOG = Logger.getInstance(SvnStatusHandler.class);
- public static final Map<String, SVNStatusType> ourStatusTypes = ContainerUtil.newHashMap();
-
- static {
- // TODO: Check STATUS_MERGED as it is marked deprecated
- put(SVNStatusType.STATUS_ADDED, SVNStatusType.STATUS_CONFLICTED, SVNStatusType.STATUS_DELETED, SVNStatusType.STATUS_EXTERNAL,
- SVNStatusType.STATUS_IGNORED, SVNStatusType.STATUS_INCOMPLETE, SVNStatusType.STATUS_MERGED, SVNStatusType.STATUS_MISSING,
- SVNStatusType.STATUS_MODIFIED, SVNStatusType.STATUS_NONE, SVNStatusType.STATUS_NORMAL, SVNStatusType.STATUS_OBSTRUCTED,
- SVNStatusType.STATUS_REPLACED, SVNStatusType.STATUS_UNVERSIONED);
- }
-
- private static void put(@NotNull SVNStatusType... statusTypes) {
- for (SVNStatusType statusType : statusTypes) {
- put(statusType);
- }
- }
-
- private static void put(@NotNull SVNStatusType statusType) {
- ourStatusTypes.put(statusType.toString(), statusType);
- }
-
@Nullable
- public static SVNStatusType getStatus(@NotNull String code) {
- SVNStatusType result = ourStatusTypes.get(code);
+ public static StatusType getStatus(@NotNull String code) {
+ StatusType result = StatusType.forStatusOperation(code);
if (result == null) {
LOG.info("Unknown status type " + code);
@@ -83,7 +61,7 @@
private MultiMap<String, PortableStatus> myCurrentListChanges;
private PortableStatus myPending;
private boolean myInRemoteStatus;
- private SVNLockWrapper myLockWrapper;
+ private Lock.Builder myLockBuilder;
private final List<ElementHandlerBase> myParseStack;
private final Map<String, Getter<ElementHandlerBase>> myElementsMap;
@@ -92,7 +70,7 @@
private final StringBuilder mySb;
private boolean myAnythingReported;
- public SvnStatusHandler(final ExternalDataCallback dataCallback, File base, final Convertor<File, SVNInfo> infoGetter) {
+ public SvnStatusHandler(final ExternalDataCallback dataCallback, File base, final Convertor<File, Info> infoGetter) {
myBase = base;
myParseStack = new ArrayList<ElementHandlerBase>();
myParseStack.add(new Fake());
@@ -104,17 +82,17 @@
myDataCallback = new DataCallback() {
@Override
public void startLock() {
- myLockWrapper = new SVNLockWrapper();
+ myLockBuilder = new Lock.Builder();
}
@Override
public void endLock() {
if (myInRemoteStatus) {
- myPending.setRemoteLock(myLockWrapper.create());
+ myPending.setRemoteLock(myLockBuilder.build());
} else {
- myPending.setLocalLock(myLockWrapper.create());
+ myPending.setLocalLock(myLockBuilder.build());
}
- myLockWrapper = null;
+ myLockBuilder = null;
}
@Override
@@ -143,17 +121,17 @@
myDataCallback = new DataCallback() {
@Override
public void startLock() {
- myLockWrapper = new SVNLockWrapper();
+ myLockBuilder = new Lock.Builder();
}
@Override
public void endLock() {
if (myInRemoteStatus) {
- myPending.setRemoteLock(myLockWrapper.create());
+ myPending.setRemoteLock(myLockBuilder.build());
} else {
- myPending.setLocalLock(myLockWrapper.create());
+ myPending.setLocalLock(myLockBuilder.build());
}
- myLockWrapper = null;
+ myLockBuilder = null;
}
@Override
@@ -191,12 +169,12 @@
return myAnythingReported;
}
- private void newPending(final Convertor<File, SVNInfo> infoGetter) {
+ private void newPending(final Convertor<File, Info> infoGetter) {
final PortableStatus status = new PortableStatus();
myPending = status;
- status.setInfoGetter(new Getter<SVNInfo>() {
+ status.setInfoGetter(new Getter<Info>() {
@Override
- public SVNInfo get() {
+ public Info get() {
return infoGetter.convert(status.getFile());
}
});
@@ -224,7 +202,7 @@
myElementsMap.put("lock", new Getter<ElementHandlerBase>() {
@Override
public ElementHandlerBase get() {
- return new Lock();
+ return new LockElement();
}
});
@@ -319,7 +297,7 @@
assertSAX(! myParseStack.isEmpty());
ElementHandlerBase current = myParseStack.get(myParseStack.size() - 1);
if (mySb.length() > 0) {
- current.characters(mySb.toString().trim(), myPending, myLockWrapper);
+ current.characters(mySb.toString().trim(), myPending, myLockBuilder);
mySb.setLength(0);
}
@@ -329,7 +307,7 @@
assertSAX(myElementsMap.containsKey(qName));
final ElementHandlerBase newChild = myElementsMap.get(qName).get();
newChild.preAttributesEffect(myDataCallback);
- newChild.updateStatus(attributes, myPending, myLockWrapper);
+ newChild.updateStatus(attributes, myPending, myLockBuilder);
newChild.preEffect(myDataCallback);
myParseStack.add(newChild);
return;
@@ -365,13 +343,13 @@
}
}
- private static SVNStatusType parseContentsStatus(Attributes attributes) throws SAXException {
+ private static StatusType parseContentsStatus(Attributes attributes) throws SAXException {
final String item = attributes.getValue("item");
assertSAX(item != null);
return getStatus(item);
}
- private static SVNStatusType parsePropertiesStatus(Attributes attributes) throws SAXException {
+ private static StatusType parsePropertiesStatus(Attributes attributes) throws SAXException {
final String props = attributes.getValue("props");
assertSAX(props != null);
return getStatus(props);
@@ -383,7 +361,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
}
@Override
@@ -395,7 +373,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -405,7 +383,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
}
@Override
@@ -417,8 +395,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
- pending.setCommittedDate(SVNDate.parseDate(s));
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -428,7 +405,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
}
@Override
@@ -440,8 +417,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
- pending.setAuthor(s);
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -456,7 +432,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
final String revision = attributes.getValue("revision");
if (!StringUtil.isEmpty(revision)) {
status.setCommittedRevision(SVNRevision.create(Long.valueOf(revision)));
@@ -472,7 +448,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -508,7 +484,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
}
@Override
@@ -520,7 +496,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
final SVNDate date = SVNDate.parseDate(s);
lock.setCreationDate(date);
}
@@ -532,7 +508,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
}
@Override
@@ -544,7 +520,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
lock.setComment(s);
}
}
@@ -555,7 +531,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
}
@Override
@@ -567,7 +543,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
lock.setOwner(s);
}
}
@@ -578,7 +554,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
}
@Override
@@ -590,19 +566,18 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
- lock.setID(s);
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
+ lock.setToken(s);
}
}
- private static class Lock extends ElementHandlerBase {
- private Lock() {
+ private static class LockElement extends ElementHandlerBase {
+ private LockElement() {
super(new String[]{"token", "owner", "comment", "created"}, new String[]{});
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
- lock.setPath(status.getPath());
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
}
@Override
@@ -620,7 +595,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -630,11 +605,11 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
- final SVNStatusType propertiesStatus = parsePropertiesStatus(attributes);
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
+ final StatusType propertiesStatus = parsePropertiesStatus(attributes);
status.setRemotePropertiesStatus(propertiesStatus);
- final SVNStatusType contentsStatus = parseContentsStatus(attributes);
+ final StatusType contentsStatus = parseContentsStatus(attributes);
status.setRemoteContentsStatus(contentsStatus);
}
@@ -653,7 +628,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -675,13 +650,13 @@
revision="120">*/
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
- final SVNStatusType propertiesStatus = parsePropertiesStatus(attributes);
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
+ final StatusType propertiesStatus = parsePropertiesStatus(attributes);
status.setPropertiesStatus(propertiesStatus);
- final SVNStatusType contentsStatus = parseContentsStatus(attributes);
+ final StatusType contentsStatus = parseContentsStatus(attributes);
status.setContentsStatus(contentsStatus);
- if (SVNStatusType.STATUS_CONFLICTED.equals(propertiesStatus) || SVNStatusType.STATUS_CONFLICTED.equals(contentsStatus)) {
+ if (StatusType.STATUS_CONFLICTED.equals(propertiesStatus) || StatusType.STATUS_CONFLICTED.equals(contentsStatus)) {
status.setIsConflicted(true);
}
@@ -724,7 +699,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -737,14 +712,14 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
final String path = attributes.getValue("path");
assertSAX(path != null);
final File file = SvnUtil.resolvePath(myBase, path);
status.setFile(file);
final boolean exists = file.exists();
if (exists) {
- status.setKind(exists, file.isDirectory() ? SVNNodeKind.DIR : SVNNodeKind.FILE);
+ status.setKind(exists, NodeKind.from(file.isDirectory()));
} else {
// this is a hack. This is done so because of strange svn native client output:
/*
@@ -779,15 +754,15 @@
and no "mod4" under
*/
- final SVNStatusType ns = status.getNodeStatus();
- if (myBase.getName().equals(path) && ! SVNStatusType.MISSING.equals(ns) &&
- ! SVNStatusType.STATUS_DELETED.equals(ns) ) {
- status.setKind(true, SVNNodeKind.DIR);
+ final StatusType ns = status.getNodeStatus();
+ if (myBase.getName().equals(path) && ! StatusType.MISSING.equals(ns) &&
+ ! StatusType.STATUS_DELETED.equals(ns) ) {
+ status.setKind(true, NodeKind.DIR);
status.setFile(myBase);
status.setPath("");
return;
}
- status.setKind(exists, SVNNodeKind.UNKNOWN);
+ status.setKind(exists, NodeKind.UNKNOWN);
}
status.setPath(path);
}
@@ -802,7 +777,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -814,7 +789,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
final String name = attributes.getValue("name");
assertSAX(! StringUtil.isEmptyOrSpaces(name));
myName = name;
@@ -830,7 +805,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -840,7 +815,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) {
}
@Override
@@ -852,7 +827,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -862,7 +837,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException {
}
@Override
@@ -874,7 +849,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -884,7 +859,7 @@
}
@Override
- protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) {
+ protected void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) {
}
@Override
@@ -896,7 +871,7 @@
}
@Override
- public void characters(String s, PortableStatus pending, SVNLockWrapper lock) {
+ public void characters(String s, PortableStatus pending, Lock.Builder lock) {
}
}
@@ -909,7 +884,7 @@
myAwaitedChildrenMultiple = new HashSet<String>(Arrays.asList(awaitedChildrenMultiple));
}
- protected abstract void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException;
+ protected abstract void updateStatus(Attributes attributes, PortableStatus status, Lock.Builder lock) throws SAXException;
public abstract void postEffect(final DataCallback callback);
public abstract void preEffect(final DataCallback callback);
@@ -920,7 +895,7 @@
return myAwaitedChildren.remove(qName);
}
- public abstract void characters(String s, PortableStatus pending, SVNLockWrapper lock);
+ public abstract void characters(String s, PortableStatus pending, Lock.Builder lock);
public void preAttributesEffect(DataCallback callback) {}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/svnkit/SvnKitProgressCanceller.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/svnkit/SvnKitProgressCanceller.java
new file mode 100644
index 0000000..6bb3706
--- /dev/null
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/svnkit/SvnKitProgressCanceller.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2014 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 org.jetbrains.idea.svn.svnkit;
+
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import org.tmatesoft.svn.core.ISVNCanceller;
+import org.tmatesoft.svn.core.SVNCancelException;
+
+/**
+ * @author Konstantin Kolosovsky.
+ */
+public class SvnKitProgressCanceller implements ISVNCanceller {
+
+ public void checkCancelled() throws SVNCancelException {
+ final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
+ if (indicator != null && indicator.isCanceled()) {
+ throw new SVNCancelException();
+ }
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java
index 762f444..b655cdc 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java
@@ -52,12 +52,11 @@
import com.intellij.util.continuation.Where;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.*;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.conflict.TreeConflictDescription;
import org.jetbrains.idea.svn.history.SvnChangeList;
import org.jetbrains.idea.svn.history.SvnRepositoryLocation;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNTreeConflictDescription;
import java.io.File;
import java.io.IOException;
@@ -71,7 +70,7 @@
*/
public class MergeFromTheirsResolver {
private final SvnVcs myVcs;
- private final SVNTreeConflictDescription myDescription;
+ private final TreeConflictDescription myDescription;
private final Change myChange;
private final FilePath myOldFilePath;
private final FilePath myNewFilePath;
@@ -86,7 +85,7 @@
private List<TextFilePatch> myTextPatches;
private VirtualFile myBaseForPatch;
- public MergeFromTheirsResolver(SvnVcs vcs, SVNTreeConflictDescription description, Change change, SvnRevisionNumber revision) {
+ public MergeFromTheirsResolver(SvnVcs vcs, TreeConflictDescription description, Change change, SvnRevisionNumber revision) {
myVcs = vcs;
myDescription = description;
myChange = change;
@@ -126,11 +125,7 @@
});
final List<TaskDescriptor> tasks = new SmartList<TaskDescriptor>();
- if (SVNNodeKind.DIR.equals(myDescription.getNodeKind())) {
- tasks.add(new PreloadChangesContentsForDir());
- } else {
- tasks.add(new PreloadChangesContentsForFile());
- }
+ tasks.add(myDescription.isDirectory() ? new PreloadChangesContentsForDir() : new PreloadChangesContentsForFile());
tasks.add(new ConvertTextPaths());
tasks.add(new PatchCreator());
tasks.add(new SelectPatchesInApplyPatchDialog());
@@ -290,7 +285,7 @@
// TODO: is used. Command line also does not support automatic directory creation.
// TODO: Need to check additionally if there are cases when directory does not exist and add corresponding code.
myVcs.getFactory(myOldFilePath.getIOFile()).createAddClient()
- .add(myOldFilePath.getIOFile(), SVNDepth.EMPTY, true, false, true, null);
+ .add(myOldFilePath.getIOFile(), Depth.EMPTY, true, false, true, null);
}
catch (VcsException e) {
context.handleException(e, true);
@@ -564,7 +559,7 @@
}
}
- private List<CommittedChangeList> loadSvnChangeListsForPatch(SVNTreeConflictDescription description) throws VcsException {
+ private List<CommittedChangeList> loadSvnChangeListsForPatch(TreeConflictDescription description) throws VcsException {
long max = description.getSourceRightVersion().getPegRevision();
long min = description.getSourceLeftVersion().getPegRevision();
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/SvnTreeConflictResolver.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/SvnTreeConflictResolver.java
index c637ce2..584666c 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/SvnTreeConflictResolver.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/SvnTreeConflictResolver.java
@@ -27,8 +27,13 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnRevisionNumber;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.conflict.TreeConflictDescription;
+import org.jetbrains.idea.svn.status.Status;
import org.jetbrains.idea.svn.status.StatusClient;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.status.StatusConsumer;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.wc.*;
@@ -57,7 +62,7 @@
myDirtyScopeManager = VcsDirtyScopeManager.getInstance(myVcs.getProject());
}
- public void resolveSelectTheirsFull(SVNTreeConflictDescription d) throws VcsException {
+ public void resolveSelectTheirsFull(TreeConflictDescription d) throws VcsException {
final LocalHistory localHistory = LocalHistory.getInstance();
localHistory.putSystemLabel(myVcs.getProject(), "Before accepting theirs for " + TreeConflictRefreshablePanel.filePath(myPath));
try {
@@ -84,74 +89,64 @@
private void revertAdditional() throws VcsException {
if (myRevertPath == null) return;
final File ioFile = myRevertPath.getIOFile();
- try {
- final SVNStatus status = myVcs.getFactory(ioFile).createStatusClient().doStatus(ioFile, false);
- myVcs.getFactory(ioFile).createRevertClient().revert(new File[]{ioFile}, SVNDepth.INFINITY, null);
- if (SVNStatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
- FileUtil.delete(ioFile);
- }
- }
- catch (SVNException e) {
- throw new VcsException(e);
+ final Status status = myVcs.getFactory(ioFile).createStatusClient().doStatus(ioFile, false);
+ myVcs.getFactory(ioFile).createRevertClient().revert(new File[]{ioFile}, Depth.INFINITY, null);
+ if (StatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
+ FileUtil.delete(ioFile);
}
pathDirty(myRevertPath);
}
- public void resolveSelectMineFull(SVNTreeConflictDescription d) throws VcsException {
+ public void resolveSelectMineFull(TreeConflictDescription d) throws VcsException {
final File ioFile = myPath.getIOFile();
- myVcs.getFactory(ioFile).createConflictClient().resolve(ioFile, SVNDepth.INFINITY, true, true, true);
+ myVcs.getFactory(ioFile).createConflictClient().resolve(ioFile, Depth.INFINITY, true, true, true);
pathDirty(myPath);
}
private void updatetoTheirsFull() throws VcsException {
- try {
- final File ioFile = myPath.getIOFile();
- SVNStatus status = myVcs.getFactory(ioFile).createStatusClient().doStatus(ioFile, false);
- if (myCommittedRevision == null) {
- myCommittedRevision = new SvnRevisionNumber(status.getCommittedRevision());
- }
- if (status == null || SVNStatusType.STATUS_UNVERSIONED.equals(status.getNodeStatus())) {
- myVcs.getFactory(ioFile).createRevertClient().revert(new File[]{ioFile}, SVNDepth.INFINITY, null);
- updateIoFile(ioFile, SVNRevision.HEAD);
- return;
- } else if (SVNStatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
- myVcs.getFactory(ioFile).createRevertClient().revert(new File[]{ioFile}, SVNDepth.INFINITY, null);
- updateIoFile(ioFile, SVNRevision.HEAD);
- FileUtil.delete(ioFile);
- return;
- } else {
- final Set<File> usedToBeAdded = new HashSet<File>();
- if (myPath.isDirectory()) {
- StatusClient statusClient = myVcs.getFactory(ioFile).createStatusClient();
- statusClient.doStatus(ioFile, SVNRevision.UNDEFINED, SVNDepth.INFINITY, false, false, false, false,
- new ISVNStatusHandler() {
- @Override
- public void handleStatus(SVNStatus status) throws SVNException {
- if (status != null && SVNStatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
- usedToBeAdded.add(status.getFile());
- }
- }
- }, null);
- }
- myVcs.getFactory(ioFile).createRevertClient().revert(new File[]{ioFile}, SVNDepth.INFINITY, null);
- for (File wasAdded : usedToBeAdded) {
- FileUtil.delete(wasAdded);
- }
- updateIoFile(ioFile, SVNRevision.HEAD);
- }
+ final File ioFile = myPath.getIOFile();
+ Status status = myVcs.getFactory(ioFile).createStatusClient().doStatus(ioFile, false);
+ if (myCommittedRevision == null) {
+ myCommittedRevision = new SvnRevisionNumber(status.getCommittedRevision());
}
- catch (SVNException e1) {
- throw new VcsException(e1);
+ if (status == null || StatusType.STATUS_UNVERSIONED.equals(status.getNodeStatus())) {
+ myVcs.getFactory(ioFile).createRevertClient().revert(new File[]{ioFile}, Depth.INFINITY, null);
+ updateIoFile(ioFile, SVNRevision.HEAD);
+ return;
+ } else if (StatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
+ myVcs.getFactory(ioFile).createRevertClient().revert(new File[]{ioFile}, Depth.INFINITY, null);
+ updateIoFile(ioFile, SVNRevision.HEAD);
+ FileUtil.delete(ioFile);
+ return;
+ } else {
+ final Set<File> usedToBeAdded = new HashSet<File>();
+ if (myPath.isDirectory()) {
+ StatusClient statusClient = myVcs.getFactory(ioFile).createStatusClient();
+ statusClient.doStatus(ioFile, SVNRevision.UNDEFINED, Depth.INFINITY, false, false, false, false,
+ new StatusConsumer() {
+ @Override
+ public void consume(Status status) throws SVNException {
+ if (status != null && StatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
+ usedToBeAdded.add(status.getFile());
+ }
+ }
+ }, null);
+ }
+ myVcs.getFactory(ioFile).createRevertClient().revert(new File[]{ioFile}, Depth.INFINITY, null);
+ for (File wasAdded : usedToBeAdded) {
+ FileUtil.delete(wasAdded);
+ }
+ updateIoFile(ioFile, SVNRevision.HEAD);
}
}
- private void updateIoFile(@NotNull File ioFile, @NotNull final SVNRevision revision) throws SVNException {
+ private void updateIoFile(@NotNull File ioFile, @NotNull final SVNRevision revision) throws SvnBindException {
if (! ioFile.exists()) {
File parent = ioFile.getParentFile();
- myVcs.getFactory(parent).createUpdateClient().doUpdate(parent, revision, SVNDepth.INFINITY, true, false);
+ myVcs.getFactory(parent).createUpdateClient().doUpdate(parent, revision, Depth.INFINITY, true, false);
} else {
- myVcs.getFactory(ioFile).createUpdateClient().doUpdate(ioFile, revision, SVNDepth.INFINITY, false, false);
+ myVcs.getFactory(ioFile).createUpdateClient().doUpdate(ioFile, revision, Depth.INFINITY, false, false);
}
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/TreeConflictRefreshablePanel.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/TreeConflictRefreshablePanel.java
index da0b1e7..9a68d635 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/TreeConflictRefreshablePanel.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/TreeConflictRefreshablePanel.java
@@ -43,16 +43,14 @@
import org.jetbrains.idea.svn.ConflictedSvnChange;
import org.jetbrains.idea.svn.SvnRevisionNumber;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.conflict.ConflictAction;
+import org.jetbrains.idea.svn.conflict.ConflictReason;
+import org.jetbrains.idea.svn.conflict.ConflictVersion;
+import org.jetbrains.idea.svn.conflict.TreeConflictDescription;
import org.jetbrains.idea.svn.history.SvnHistoryProvider;
import org.jetbrains.idea.svn.history.SvnHistorySession;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNNodeKind;
-import org.tmatesoft.svn.core.internal.wc.SVNConflictVersion;
-import org.tmatesoft.svn.core.internal.wc.SVNTreeConflictUtil;
-import org.tmatesoft.svn.core.wc.SVNConflictAction;
-import org.tmatesoft.svn.core.wc.SVNConflictReason;
import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNTreeConflictDescription;
import javax.swing.*;
import java.awt.*;
@@ -96,7 +94,7 @@
return true;
}
- private static boolean descriptionsEqual(SVNTreeConflictDescription d1, SVNTreeConflictDescription d2) {
+ private static boolean descriptionsEqual(TreeConflictDescription d1, TreeConflictDescription d2) {
if (d1.isPropertyConflict() != d2.isPropertyConflict()) return false;
if (d1.isTextConflict() != d2.isTextConflict()) return false;
if (d1.isTreeConflict() != d2.isTreeConflict()) return false;
@@ -111,7 +109,7 @@
return true;
}
- private static boolean compareConflictVersion(SVNConflictVersion v1, SVNConflictVersion v2) {
+ private static boolean compareConflictVersion(ConflictVersion v1, ConflictVersion v2) {
if (v1 == null && v2 == null) return true;
if (v1 == null || v2 == null) return false;
if (! v1.getKind().equals(v2.getKind())) return false;
@@ -131,7 +129,7 @@
processDescription(myChange.getAfterDescription()));
}
- private BeforeAfter<ConflictSidePresentation> processDescription(SVNTreeConflictDescription description) throws VcsException {
+ private BeforeAfter<ConflictSidePresentation> processDescription(TreeConflictDescription description) throws VcsException {
if (description == null) return null;
if (myChange.getBeforeRevision() != null) {
myCommittedRevision = (SvnRevisionNumber)SvnHistorySession.getCurrentCommittedRevision(myVcs,
@@ -180,12 +178,12 @@
return new BeforeAfter<ConflictSidePresentation>(leftSide, rightSide);
}
- private static boolean isDifferentURLs(SVNTreeConflictDescription description) {
+ private static boolean isDifferentURLs(TreeConflictDescription description) {
return description.getSourceLeftVersion() != null && description.getSourceRightVersion() != null &&
! Comparing.equal(description.getSourceLeftVersion().getPath(), description.getSourceRightVersion().getPath());
}
- private ConflictSidePresentation createSide(SVNConflictVersion version, final SVNRevision untilThisOther, final boolean isLeft) throws VcsException {
+ private ConflictSidePresentation createSide(ConflictVersion version, final SVNRevision untilThisOther, final boolean isLeft) throws VcsException {
if (version == null) return EmptyConflictSide.getInstance();
if (myChange.getBeforeRevision() != null && myCommittedRevision != null) {
SvnRevisionNumber number = myCommittedRevision;
@@ -226,12 +224,12 @@
return wrapper;
}
- private void appendDescription(SVNTreeConflictDescription description,
+ private void appendDescription(TreeConflictDescription description,
JPanel main,
GridBagConstraints gb,
BeforeAfter<ConflictSidePresentation> ba, boolean directory) {
if (description == null) return;
- JLabel descriptionLbl = new JLabel(SVNTreeConflictUtil.getHumanReadableConflictDescription(description));
+ JLabel descriptionLbl = new JLabel(description.toPresentableString());
descriptionLbl.setForeground(Color.red);
main.add(descriptionLbl, gb);
++ gb.gridy;
@@ -243,7 +241,7 @@
addSide(main, gb, ba.getAfter(), description.getSourceRightVersion(), "Right", directory);
}
- private void addResolveButtons(SVNTreeConflictDescription description, JPanel main, GridBagConstraints gb) {
+ private void addResolveButtons(TreeConflictDescription description, JPanel main, GridBagConstraints gb) {
final FlowLayout flowLayout = new FlowLayout(FlowLayout.LEFT, 5, 5);
JPanel wrapper = new JPanel(flowLayout);
final JButton both = new JButton("Both");
@@ -266,7 +264,7 @@
++ gb.gridy;
}
- private ActionListener createRight(final SVNTreeConflictDescription description) {
+ private ActionListener createRight(final TreeConflictDescription description) {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -276,11 +274,11 @@
FileDocumentManager.getInstance().saveAllDocuments();
final Paths paths = getPaths(description);
ProgressManager.getInstance().run(
- new VcsBackgroundTask<SVNTreeConflictDescription>(myVcs.getProject(), "Accepting theirs for: " + filePath(paths.myMainPath),
+ new VcsBackgroundTask<TreeConflictDescription>(myVcs.getProject(), "Accepting theirs for: " + filePath(paths.myMainPath),
BackgroundFromStartOption.getInstance(), Collections.singletonList(description),
true) {
@Override
- protected void process(SVNTreeConflictDescription d) throws VcsException {
+ protected void process(TreeConflictDescription d) throws VcsException {
new SvnTreeConflictResolver(myVcs, paths.myMainPath, myCommittedRevision, paths.myAdditionalPath).resolveSelectTheirsFull(d);
}
@@ -296,11 +294,11 @@
};
}
- private Paths getPaths(final SVNTreeConflictDescription description) {
- FilePath mainPath = new FilePathImpl(description.getPath(), SVNNodeKind.DIR.equals(description.getNodeKind()));
+ private Paths getPaths(final TreeConflictDescription description) {
+ FilePath mainPath;
FilePath additionalPath = null;
if (myChange.isMoved() || myChange.isRenamed()) {
- if (SVNConflictAction.ADD.equals(description.getConflictAction())) {
+ if (ConflictAction.ADD.equals(description.getConflictAction())) {
mainPath = myChange.getAfterRevision().getFile();
additionalPath = myChange.getBeforeRevision().getFile();
} else {
@@ -323,7 +321,7 @@
}
}
- private ActionListener createLeft(final SVNTreeConflictDescription description) {
+ private ActionListener createLeft(final TreeConflictDescription description) {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -333,11 +331,11 @@
FileDocumentManager.getInstance().saveAllDocuments();
final Paths paths = getPaths(description);
ProgressManager.getInstance().run(
- new VcsBackgroundTask<SVNTreeConflictDescription>(myVcs.getProject(), "Accepting yours for: " + filePath(paths.myMainPath),
+ new VcsBackgroundTask<TreeConflictDescription>(myVcs.getProject(), "Accepting yours for: " + filePath(paths.myMainPath),
BackgroundFromStartOption.getInstance(), Collections.singletonList(description),
true) {
@Override
- protected void process(SVNTreeConflictDescription d) throws VcsException {
+ protected void process(TreeConflictDescription d) throws VcsException {
new SvnTreeConflictResolver(myVcs, paths.myMainPath, myCommittedRevision, paths.myAdditionalPath).resolveSelectMineFull(d);
}
@@ -353,22 +351,22 @@
};
}
- private ActionListener createMerge(final SVNTreeConflictDescription description) {
+ private ActionListener createMerge(final TreeConflictDescription description) {
if (isDifferentURLs(description)) {
return null;
}
// my edit, theirs move or delete
- if (SVNConflictAction.EDIT.equals(description.getConflictAction()) && description.getSourceLeftVersion() != null &&
- SVNConflictReason.DELETED.equals(description.getConflictReason()) && (myChange.isMoved() || myChange.isRenamed()) &&
+ if (ConflictAction.EDIT.equals(description.getConflictAction()) && description.getSourceLeftVersion() != null &&
+ ConflictReason.DELETED.equals(description.getConflictReason()) && (myChange.isMoved() || myChange.isRenamed()) &&
myCommittedRevision != null) {
- if (myPath.isDirectory() == SVNNodeKind.DIR.equals(description.getSourceRightVersion().getKind())) {
+ if (myPath.isDirectory() == description.getSourceRightVersion().isDirectory()) {
return createMergeTheirsForFile(description);
}
}
return null;
}
- private ActionListener createMergeTheirsForFile(final SVNTreeConflictDescription description) {
+ private ActionListener createMergeTheirsForFile(final TreeConflictDescription description) {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -381,7 +379,7 @@
return newFilePath.getName() + " (" + newFilePath.getParentPath().getPath() + ")";
}
- private static ActionListener createBoth(SVNTreeConflictDescription description) {
+ private static ActionListener createBoth(TreeConflictDescription description) {
return null;
}
@@ -397,10 +395,10 @@
private void addSide(JPanel main,
GridBagConstraints gb,
ConflictSidePresentation before,
- SVNConflictVersion leftVersion, final String name, boolean directory) {
+ ConflictVersion leftVersion, final String name, boolean directory) {
final String leftPresentation = leftVersion == null ? name + ": (" + (directory ? "directory" : "file") +
(myChange.getBeforeRevision() == null ? ") added" : ") unversioned") :
- name + ": " + FileUtil.toSystemIndependentName(SVNTreeConflictUtil.getHumanReadableConflictVersion(leftVersion));
+ name + ": " + FileUtil.toSystemIndependentName(ConflictVersion.toPresentableString(leftVersion));
gb.insets.top = 10;
main.add(new JLabel(leftPresentation), gb);
++ gb.gridy;
@@ -454,9 +452,9 @@
private abstract static class AbstractConflictSide<T> implements ConflictSidePresentation, Convertor<T, VcsRevisionNumber> {
protected final Project myProject;
- protected final SVNConflictVersion myVersion;
+ protected final ConflictVersion myVersion;
- private AbstractConflictSide(Project project, SVNConflictVersion version) {
+ private AbstractConflictSide(Project project, ConflictVersion version) {
myProject = project;
myVersion = version;
}
@@ -472,13 +470,13 @@
private FileHistoryPanelImpl myFileHistoryPanel;
private TLongArrayList myListToReportLoaded;
- private HistoryConflictSide(SvnVcs vcs, SVNConflictVersion version, final SVNRevision peg) throws VcsException {
+ private HistoryConflictSide(SvnVcs vcs, ConflictVersion version, final SVNRevision peg) throws VcsException {
super(vcs.getProject(), version);
myVcs = vcs;
myPeg = peg;
try {
myPath = FilePathImpl.createNonLocal(
- version.getRepositoryRoot().appendPath(FileUtil.toSystemIndependentName(version.getPath()), true).toString(), SVNNodeKind.DIR.equals(version.getKind()));
+ version.getRepositoryRoot().appendPath(FileUtil.toSystemIndependentName(version.getPath()), true).toString(), version.isDirectory());
}
catch (SVNException e) {
throw new VcsException(e);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AbstractSvnUpdatePanel.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AbstractSvnUpdatePanel.java
index 0cea23e..c57d043 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AbstractSvnUpdatePanel.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AbstractSvnUpdatePanel.java
@@ -23,8 +23,8 @@
import org.jetbrains.idea.svn.DepthCombo;
import org.jetbrains.idea.svn.SvnConfiguration;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import javax.swing.*;
import java.awt.*;
@@ -106,7 +106,7 @@
@Nullable
private SVNURL getUrlFor(@NotNull final FilePath root) {
- final SVNInfo info = myVCS.getInfo(root.getIOFile());
+ final Info info = myVCS.getInfo(root.getIOFile());
return info != null ? info.getURL() : null;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AbstractUpdateIntegrateCrawler.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AbstractUpdateIntegrateCrawler.java
index 47b1580..991c2fe 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AbstractUpdateIntegrateCrawler.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AbstractUpdateIntegrateCrawler.java
@@ -22,9 +22,7 @@
import org.jetbrains.idea.svn.SvnBundle;
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.SvnWCRootCrawler;
-import org.tmatesoft.svn.core.SVNErrorCode;
-import org.tmatesoft.svn.core.SVNErrorMessage;
-import org.tmatesoft.svn.core.SVNException;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import java.io.File;
import java.util.Collection;
@@ -58,13 +56,9 @@
long rev = doUpdate(root);
if (rev < 0 && !isMerge()) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.UNKNOWN, SvnBundle.message("exception.text.root.was.not.properly.updated", root)));
+ throw new SvnBindException(SvnBundle.message("exception.text.root.was.not.properly.updated", root));
}
}
- catch (SVNException e) {
- LOG.info(e);
- myExceptions.add(new VcsException(e));
- }
catch (VcsException e) {
LOG.info(e);
myExceptions.add(e);
@@ -73,7 +67,7 @@
protected abstract void showProgressMessage(ProgressIndicator progress, File root);
- protected abstract long doUpdate(File root) throws SVNException, VcsException;
+ protected abstract long doUpdate(File root) throws VcsException;
protected abstract boolean isMerge();
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AutoSvnUpdater.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AutoSvnUpdater.java
index 925d13c7..4bb3dbe 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AutoSvnUpdater.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/AutoSvnUpdater.java
@@ -29,7 +29,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.svn.SvnConfiguration;
import org.jetbrains.idea.svn.SvnVcs;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
import org.tmatesoft.svn.core.wc.SVNRevision;
import javax.swing.*;
@@ -66,7 +66,7 @@
final SvnConfiguration configuration17 = SvnConfiguration.getInstance(myProject);
configuration17.setForceUpdate(false);
configuration17.setUpdateLockOnDemand(false);
- configuration17.setUpdateDepth(SVNDepth.INFINITY);
+ configuration17.setUpdateDepth(Depth.INFINITY);
final SvnVcs vcs = SvnVcs.getInstance(myProject);
for (FilePath root : myRoots) {
configureUpdateRootInfo(root, configuration17.getUpdateRootInfo(root.getIOFile(), vcs));
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/CmdUpdateClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/CmdUpdateClient.java
index 051be89..61b0592 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/CmdUpdateClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/CmdUpdateClient.java
@@ -16,16 +16,17 @@
package org.jetbrains.idea.svn.update;
import com.intellij.openapi.util.io.FileUtil;
-import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.EventAction;
+import org.jetbrains.idea.svn.api.ProgressEvent;
import org.jetbrains.idea.svn.commandLine.BaseUpdateCommandListener;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.*;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNEventAction;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc2.SvnTarget;
@@ -47,46 +48,24 @@
private static final Pattern ourExceptionPattern = Pattern.compile("svn: E(\\d{6}): .+");
private static final String ourAuthenticationRealm = "Authentication realm:";
- @Override
- public long[] doUpdate(final File[] paths, final SVNRevision revision, final SVNDepth depth, final boolean allowUnversionedObstructions,
- final boolean depthIsSticky, final boolean makeParents) throws SVNException {
- // since one revision is passed -> I assume same repository here
- checkWorkingCopy(paths[0]);
-
- final List<String> parameters = new ArrayList<String>();
-
- fillParameters(parameters, revision, depth, depthIsSticky, allowUnversionedObstructions);
- CommandUtil.put(parameters, makeParents, "--parents");
- CommandUtil.put(parameters, myIgnoreExternals, "--ignore-externals");
- CommandUtil.put(parameters, paths);
-
- return run(paths, parameters, SvnCommandName.up);
- }
-
- private void checkWorkingCopy(@NotNull File path) throws SVNException {
- final SVNInfo info = myFactory.createInfoClient().doInfo(path, SVNRevision.UNDEFINED);
+ private void checkWorkingCopy(@NotNull File path) throws SvnBindException {
+ final Info info = myFactory.createInfoClient().doInfo(path, SVNRevision.UNDEFINED);
if (info == null || info.getURL() == null) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.WC_NOT_WORKING_COPY, path.getPath()));
+ throw new SvnBindException(SVNErrorCode.WC_NOT_WORKING_COPY, path.getPath());
}
}
- private long[] run(@NotNull File[] paths, @NotNull List<String> parameters, @NotNull SvnCommandName command) throws SVNException {
- File base = paths[0];
- base = base.isDirectory() ? base : base.getParentFile();
+ private long[] run(@NotNull File path, @NotNull List<String> parameters, @NotNull SvnCommandName command) throws SvnBindException {
+ File base = path.isDirectory() ? path : path.getParentFile();
final AtomicReference<long[]> updatedToRevision = new AtomicReference<long[]>();
updatedToRevision.set(new long[0]);
- final BaseUpdateCommandListener listener = createCommandListener(paths, updatedToRevision, base);
- try {
- execute(myVcs, SvnTarget.fromFile(base), command, parameters, listener);
- }
- catch (VcsException e) {
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e));
- }
+ final BaseUpdateCommandListener listener = createCommandListener(new File[]{path}, updatedToRevision, base);
+ execute(myVcs, SvnTarget.fromFile(base), command, parameters, listener);
- listener.throwIfException();
+ listener.throwWrappedIfException();
return updatedToRevision.get();
}
@@ -98,8 +77,8 @@
final long[] myRevisions = new long[paths.length];
@Override
- protected void beforeHandler(@NotNull SVNEvent event) {
- if (SVNEventAction.UPDATE_COMPLETED.equals(event.getAction())) {
+ protected void beforeHandler(@NotNull ProgressEvent event) {
+ if (EventAction.UPDATE_COMPLETED.equals(event.getAction())) {
final long eventRevision = event.getRevision();
for (int i = 0; i < paths.length; i++) {
final File path = paths[i];
@@ -121,7 +100,7 @@
private static void fillParameters(@NotNull List<String> parameters,
@Nullable SVNRevision revision,
- @Nullable SVNDepth depth,
+ @Nullable Depth depth,
boolean depthIsSticky,
boolean allowUnversionedObstructions) {
@@ -155,9 +134,17 @@
}
@Override
- public long doUpdate(File path, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky)
- throws SVNException {
- final long[] longs = doUpdate(new File[]{path}, revision, depth, allowUnversionedObstructions, depthIsSticky, false);
+ public long doUpdate(File path, SVNRevision revision, Depth depth, boolean allowUnversionedObstructions, boolean depthIsSticky)
+ throws SvnBindException {
+ checkWorkingCopy(path);
+
+ final List<String> parameters = new ArrayList<String>();
+
+ fillParameters(parameters, revision, depth, depthIsSticky, allowUnversionedObstructions);
+ CommandUtil.put(parameters, myIgnoreExternals, "--ignore-externals");
+ CommandUtil.put(parameters, path);
+
+ final long[] longs = run(path, parameters, SvnCommandName.up);
return longs[0];
}
@@ -166,9 +153,9 @@
SVNURL url,
SVNRevision pegRevision,
SVNRevision revision,
- SVNDepth depth,
+ Depth depth,
boolean allowUnversionedObstructions,
- boolean depthIsSticky) throws SVNException {
+ boolean depthIsSticky) throws SvnBindException {
checkWorkingCopy(path);
List<String> parameters = new ArrayList<String>();
@@ -178,7 +165,7 @@
fillParameters(parameters, revision, depth, depthIsSticky, allowUnversionedObstructions);
parameters.add("--ignore-ancestry");
- long[] revisions = run(new File[]{path}, parameters, SvnCommandName.switchCopy);
+ long[] revisions = run(path, parameters, SvnCommandName.switchCopy);
return revisions != null && revisions.length > 0 ? revisions[0] : -1;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/MergeRootInfo.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/MergeRootInfo.java
index 872ee8f..6bc2af0 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/MergeRootInfo.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/MergeRootInfo.java
@@ -16,9 +16,9 @@
package org.jetbrains.idea.svn.update;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import java.io.File;
@@ -33,7 +33,7 @@
myRevision1 = SVNRevision.HEAD;
myRevision2 = SVNRevision.HEAD;
- SVNInfo info = vcs.getInfo(file);
+ Info info = vcs.getInfo(file);
myUrl1 = info != null && info.getURL() != null ? info.getURL().toString() : "";
myUrl2 = myUrl1;
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/SvnKitUpdateClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/SvnKitUpdateClient.java
index be9923d..eaf6578 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/SvnKitUpdateClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/SvnKitUpdateClient.java
@@ -18,10 +18,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNUpdateClient;
@@ -35,24 +36,19 @@
*/
public class SvnKitUpdateClient extends BaseSvnClient implements UpdateClient {
- @Nullable protected ISVNEventHandler myDispatcher;
+ @Nullable protected ProgressTracker myDispatcher;
protected boolean myIgnoreExternals;
protected boolean myLocksOnDemand;
@Override
- public long[] doUpdate(File[] paths,
- SVNRevision revision,
- SVNDepth depth,
- boolean allowUnversionedObstructions,
- boolean depthIsSticky,
- boolean makeParents) throws SVNException {
- return getClient().doUpdate(paths, revision, depth, allowUnversionedObstructions, depthIsSticky, makeParents);
- }
-
- @Override
- public long doUpdate(File path, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky)
- throws SVNException {
- return getClient().doUpdate(path, revision, depth, allowUnversionedObstructions, depthIsSticky);
+ public long doUpdate(File path, SVNRevision revision, Depth depth, boolean allowUnversionedObstructions, boolean depthIsSticky)
+ throws SvnBindException {
+ try {
+ return getClient().doUpdate(path, revision, toDepth(depth), allowUnversionedObstructions, depthIsSticky);
+ }
+ catch (SVNException e) {
+ throw new SvnBindException(e);
+ }
}
@Override
@@ -60,9 +56,14 @@
SVNURL url,
SVNRevision pegRevision,
SVNRevision revision,
- SVNDepth depth,
- boolean allowUnversionedObstructions, boolean depthIsSticky) throws SVNException {
- return getClient().doSwitch(path, url, pegRevision, revision, depth, allowUnversionedObstructions, depthIsSticky);
+ Depth depth,
+ boolean allowUnversionedObstructions, boolean depthIsSticky) throws SvnBindException {
+ try {
+ return getClient().doSwitch(path, url, pegRevision, revision, toDepth(depth), allowUnversionedObstructions, depthIsSticky);
+ }
+ catch (SVNException e) {
+ throw new SvnBindException(e);
+ }
}
@Override
@@ -71,7 +72,7 @@
}
@Override
- public void setEventHandler(ISVNEventHandler dispatcher) {
+ public void setEventHandler(ProgressTracker dispatcher) {
myDispatcher = dispatcher;
}
@@ -84,7 +85,7 @@
private SVNUpdateClient getClient() {
SVNUpdateClient client = myVcs.getSvnKitManager().createUpdateClient();
- client.setEventHandler(myDispatcher);
+ client.setEventHandler(toEventHandler(myDispatcher));
client.setIgnoreExternals(myIgnoreExternals);
client.setUpdateLocksOnDemand(myLocksOnDemand);
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/SvnUpdateEnvironment.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/SvnUpdateEnvironment.java
index e4d25c3..554b2c2 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/SvnUpdateEnvironment.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/SvnUpdateEnvironment.java
@@ -24,9 +24,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.*;
-import org.tmatesoft.svn.core.SVNException;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import java.io.File;
@@ -70,7 +70,7 @@
progress.setText(SvnBundle.message("progress.text.updating", root.getAbsolutePath()));
}
- protected long doUpdate(final File root) throws SVNException {
+ protected long doUpdate(final File root) throws SvnBindException {
final long rev;
final SvnConfiguration configuration = SvnConfiguration.getInstance(myVcs.getProject());
@@ -113,7 +113,7 @@
@Nullable
private static SVNURL getSourceUrl(final SvnVcs vcs, final File root) {
- final SVNInfo svnInfo = vcs.getInfo(root);
+ final Info svnInfo = vcs.getInfo(root);
return svnInfo != null ? svnInfo.getURL() : null;
}
@@ -140,7 +140,7 @@
}
}
}
- catch (SVNException e) {
+ catch (SvnBindException e) {
Messages.showErrorDialog(myVcs.getProject(), e.getMessage(), SvnBundle.message("switch.target.problem.title"));
return false;
}*/
@@ -148,7 +148,7 @@
return true;
}
- private SVNRevision correctRevision(@NotNull UpdateRootInfo value) throws SVNException {
+ private SVNRevision correctRevision(@NotNull UpdateRootInfo value) throws SvnBindException {
if (SVNRevision.HEAD.equals(value.getRevision())) {
// find acual revision to update to (a bug if just say head in switch)
value.setRevision(SvnUtil.getHeadRevision(myVcs, value.getUrl()));
@@ -157,9 +157,9 @@
}
// false - do not do update
- private boolean checkAncestry(final File sourceFile, final SVNURL targetUrl, final SVNRevision targetRevision) throws SVNException {
- final SVNInfo sourceSvnInfo = myVcs.getInfo(sourceFile);
- final SVNInfo targetSvnInfo = myVcs.getInfo(targetUrl, targetRevision);
+ private boolean checkAncestry(final File sourceFile, final SVNURL targetUrl, final SVNRevision targetRevision) throws SvnBindException {
+ final Info sourceSvnInfo = myVcs.getInfo(sourceFile);
+ final Info targetSvnInfo = myVcs.getInfo(targetUrl, targetRevision);
if (sourceSvnInfo == null || targetSvnInfo == null) {
// cannot check
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateClient.java
index b68829e..7155400 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateClient.java
@@ -15,11 +15,11 @@
*/
package org.jetbrains.idea.svn.update;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.SVNDepth;
-import org.tmatesoft.svn.core.SVNException;
+import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.wc.SVNRevision;
import java.io.File;
@@ -32,14 +32,19 @@
*/
public interface UpdateClient extends SvnClient {
- long[] doUpdate(File[] paths, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky, boolean makeParents) throws SVNException;
-
- long doUpdate(File path, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky) throws SVNException;
+ long doUpdate(File path, SVNRevision revision, Depth depth, boolean allowUnversionedObstructions, boolean depthIsSticky)
+ throws SvnBindException;
void setUpdateLocksOnDemand(boolean locksOnDemand);
- long doSwitch(File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky) throws SVNException;
+ long doSwitch(File path,
+ SVNURL url,
+ SVNRevision pegRevision,
+ SVNRevision revision,
+ Depth depth,
+ boolean allowUnversionedObstructions,
+ boolean depthIsSticky) throws SvnBindException;
- void setEventHandler(ISVNEventHandler dispatcher);
+ void setEventHandler(ProgressTracker dispatcher);
void setIgnoreExternals(boolean ignoreExternals);
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateEventHandler.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateEventHandler.java
index cea4edb..fc552db 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateEventHandler.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateEventHandler.java
@@ -25,6 +25,10 @@
import org.jetbrains.idea.svn.SvnFileUrlMapping;
import org.jetbrains.idea.svn.SvnRevisionNumber;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.api.EventAction;
+import org.jetbrains.idea.svn.api.ProgressEvent;
+import org.jetbrains.idea.svn.api.ProgressTracker;
+import org.jetbrains.idea.svn.status.StatusType;
import org.tmatesoft.svn.core.SVNCancelException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.wc.SVNErrorManager;
@@ -38,7 +42,7 @@
/**
* @author lesya
*/
-public class UpdateEventHandler implements ISVNEventHandler {
+public class UpdateEventHandler implements ProgressTracker {
private ProgressIndicator myProgressIndicator;
private UpdatedFiles myUpdatedFiles;
private int myExternalsCount;
@@ -66,7 +70,7 @@
myUpdatedFiles = updatedFiles;
}
- public void handleEvent(final SVNEvent event, double progress) {
+ public void consume(final ProgressEvent event) {
if (event == null || event.getFile() == null) {
return;
}
@@ -81,7 +85,7 @@
return;
}
- if (event.getAction() == SVNEventAction.TREE_CONFLICT) {
+ if (event.getAction() == EventAction.TREE_CONFLICT) {
myText2 = SvnBundle.message("progress.text2.treeconflicted", displayPath);
updateProgressIndicator();
myUpdatedFiles.registerGroup(createFileGroup(VcsBundle.message("update.group.name.merged.with.tree.conflicts"),
@@ -89,10 +93,10 @@
addFileToGroup(FileGroup.MERGED_WITH_TREE_CONFLICT, event);
}
- if (event.getAction() == SVNEventAction.UPDATE_ADD ||
- event.getAction() == SVNEventAction.ADD) {
+ if (event.getAction() == EventAction.UPDATE_ADD ||
+ event.getAction() == EventAction.ADD) {
myText2 = SvnBundle.message("progress.text2.added", displayPath);
- if (event.getContentsStatus() == SVNStatusType.CONFLICTED || event.getPropertiesStatus() == SVNStatusType.CONFLICTED) {
+ if (event.getContentsStatus() == StatusType.CONFLICTED || event.getPropertiesStatus() == StatusType.CONFLICTED) {
addFileToGroup(FileGroup.MERGED_WITH_CONFLICT_ID, event);
myText2 = SvnBundle.message("progress.text2.conflicted", displayPath);
} else if (myUpdatedFiles.getGroupById(FileGroup.REMOVED_FROM_REPOSITORY_ID).getFiles().contains(path)) {
@@ -106,38 +110,38 @@
addFileToGroup(FileGroup.CREATED_ID, event);
}
}
- else if (event.getAction() == SVNEventAction.UPDATE_NONE) {
+ else if (event.getAction() == EventAction.UPDATE_NONE) {
// skip it
return;
}
- else if (event.getAction() == SVNEventAction.UPDATE_DELETE) {
+ else if (event.getAction() == EventAction.UPDATE_DELETE) {
myText2 = SvnBundle.message("progress.text2.deleted", displayPath);
addFileToGroup(FileGroup.REMOVED_FROM_REPOSITORY_ID, event);
}
- else if (event.getAction() == SVNEventAction.UPDATE_UPDATE) {
+ else if (event.getAction() == EventAction.UPDATE_UPDATE) {
possiblySwitched(event);
- if (event.getContentsStatus() == SVNStatusType.CONFLICTED || event.getPropertiesStatus() == SVNStatusType.CONFLICTED) {
- if (event.getContentsStatus() == SVNStatusType.CONFLICTED) {
+ if (event.getContentsStatus() == StatusType.CONFLICTED || event.getPropertiesStatus() == StatusType.CONFLICTED) {
+ if (event.getContentsStatus() == StatusType.CONFLICTED) {
addFileToGroup(FileGroup.MERGED_WITH_CONFLICT_ID, event);
}
- if (event.getPropertiesStatus() == SVNStatusType.CONFLICTED) {
+ if (event.getPropertiesStatus() == StatusType.CONFLICTED) {
addFileToGroup(FileGroup.MERGED_WITH_PROPERTY_CONFLICT_ID, event);
}
myText2 = SvnBundle.message("progress.text2.conflicted", displayPath);
}
- else if (event.getContentsStatus() == SVNStatusType.MERGED || event.getPropertiesStatus() == SVNStatusType.MERGED) {
+ else if (event.getContentsStatus() == StatusType.MERGED || event.getPropertiesStatus() == StatusType.MERGED) {
myText2 = SvnBundle.message("progres.text2.merged", displayPath);
addFileToGroup(FileGroup.MERGED_ID, event);
}
- else if (event.getContentsStatus() == SVNStatusType.CHANGED || event.getPropertiesStatus() == SVNStatusType.CHANGED) {
+ else if (event.getContentsStatus() == StatusType.CHANGED || event.getPropertiesStatus() == StatusType.CHANGED) {
myText2 = SvnBundle.message("progres.text2.updated", displayPath);
addFileToGroup(FileGroup.UPDATED_ID, event);
}
- else if (event.getContentsStatus() == SVNStatusType.UNCHANGED &&
- (event.getPropertiesStatus() == SVNStatusType.UNCHANGED || event.getPropertiesStatus() == SVNStatusType.UNKNOWN)) {
+ else if (event.getContentsStatus() == StatusType.UNCHANGED &&
+ (event.getPropertiesStatus() == StatusType.UNCHANGED || event.getPropertiesStatus() == StatusType.UNKNOWN)) {
myText2 = SvnBundle.message("progres.text2.updated", displayPath);
- } else if (SVNStatusType.INAPPLICABLE.equals(event.getContentsStatus()) &&
- (event.getPropertiesStatus() == SVNStatusType.UNCHANGED || event.getPropertiesStatus() == SVNStatusType.UNKNOWN)) {
+ } else if (StatusType.INAPPLICABLE.equals(event.getContentsStatus()) &&
+ (event.getPropertiesStatus() == StatusType.UNCHANGED || event.getPropertiesStatus() == StatusType.UNKNOWN)) {
myText2 = SvnBundle.message("progres.text2.updated", displayPath);
}
else {
@@ -145,7 +149,7 @@
addFileToGroup(FileGroup.UNKNOWN_ID, event);
}
}
- else if (event.getAction() == SVNEventAction.UPDATE_EXTERNAL) {
+ else if (event.getAction() == EventAction.UPDATE_EXTERNAL) {
if (mySequentialUpdatesContext != null) {
mySequentialUpdatesContext.registerExternalRootBeingUpdated(event.getFile());
}
@@ -158,11 +162,11 @@
addFileToGroup(AbstractSvnUpdateIntegrateEnvironment.EXTERNAL_ID, event);
myText = SvnBundle.message("progress.text.updating.external.location", event.getFile().getAbsolutePath());
}
- else if (event.getAction() == SVNEventAction.RESTORE) {
+ else if (event.getAction() == EventAction.RESTORE) {
myText2 = SvnBundle.message("progress.text2.restored.file", displayPath);
addFileToGroup(FileGroup.RESTORED_ID, event);
}
- else if (event.getAction() == SVNEventAction.UPDATE_COMPLETED && event.getRevision() >= 0) {
+ else if (event.getAction() == EventAction.UPDATE_COMPLETED && event.getRevision() >= 0) {
possiblySwitched(event);
myExternalsCount--;
myText2 = SvnBundle.message("progres.text2.updated.to.revision", event.getRevision());
@@ -171,7 +175,7 @@
StatusBar.Info.set(SvnBundle.message("status.text.updated.to.revision", event.getRevision()), myVCS.getProject());
}
}
- else if (event.getAction() == SVNEventAction.SKIP) {
+ else if (event.getAction() == EventAction.SKIP) {
myText2 = SvnBundle.message("progress.text2.skipped.file", displayPath);
addFileToGroup(FileGroup.SKIPPED_ID, event);
}
@@ -179,7 +183,7 @@
updateProgressIndicator();
}
- private void possiblySwitched(SVNEvent event) {
+ private void possiblySwitched(ProgressEvent event) {
final File file = event.getFile();
if (file == null) return;
final SVNURL wasUrl = myUrlToCheckForSwitch.get(file);
@@ -189,7 +193,7 @@
}
}
- private boolean itemSwitched(final SVNEvent event) {
+ private boolean itemSwitched(final ProgressEvent event) {
final File file = event.getFile();
final SvnFileUrlMapping urlMapping = myVCS.getSvnFileUrlMapping();
final SVNURL currentUrl = urlMapping.getUrlForFile(file);
@@ -207,11 +211,11 @@
}
}
- protected boolean handleInDescendants(final SVNEvent event) {
+ protected boolean handleInDescendants(final ProgressEvent event) {
return false;
}
- protected void addFileToGroup(final String id, final SVNEvent event) {
+ protected void addFileToGroup(final String id, final ProgressEvent event) {
final FileGroup fileGroup = myUpdatedFiles.getGroupById(id);
final String path = event.getFile().getAbsolutePath();
fileGroup.add(path, SvnVcs.getKey(), new SvnRevisionNumber(SVNRevision.create(event.getRevision())));
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateRootInfo.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateRootInfo.java
index b2a318b..c858f788 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateRootInfo.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateRootInfo.java
@@ -16,9 +16,9 @@
package org.jetbrains.idea.svn.update;
import org.jetbrains.idea.svn.SvnVcs;
+import org.jetbrains.idea.svn.info.Info;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import java.io.File;
@@ -31,7 +31,7 @@
public UpdateRootInfo(File file, SvnVcs vcs) {
myRevision = SVNRevision.HEAD;
- SVNInfo info = vcs.getInfo(file);
+ Info info = vcs.getInfo(file);
myUrl = info != null && info.getURL() != null ? info.getURL().toString() : "";
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/CmdUpgradeClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/CmdUpgradeClient.java
index 3a4e6eb..f276154 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/CmdUpgradeClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/CmdUpgradeClient.java
@@ -7,14 +7,10 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.WorkingCopyFormat;
-import org.jetbrains.idea.svn.api.BaseSvnClient;
-import org.jetbrains.idea.svn.api.FileStatusResultParser;
+import org.jetbrains.idea.svn.api.*;
import org.jetbrains.idea.svn.commandLine.CommandUtil;
import org.jetbrains.idea.svn.commandLine.LineCommandAdapter;
import org.jetbrains.idea.svn.commandLine.SvnCommandName;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEvent;
-import org.tmatesoft.svn.core.wc.SVNEventAction;
import org.tmatesoft.svn.core.wc2.SvnTarget;
import java.io.File;
@@ -34,11 +30,11 @@
private static final Pattern CHANGED_PATH = Pattern.compile(STATUS + PATH);
@Override
- public void upgrade(@NotNull File path, @NotNull WorkingCopyFormat format, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void upgrade(@NotNull File path, @NotNull WorkingCopyFormat format, @Nullable ProgressTracker handler) throws VcsException {
validateFormat(format, getSupportedFormats());
// fake event indicating upgrade start
- callHandler(handler, createEvent(path, SVNEventAction.UPDATE_COMPLETED));
+ callHandler(handler, createEvent(path, EventAction.UPDATE_COMPLETED));
List<String> parameters = new ArrayList<String>();
@@ -64,9 +60,9 @@
return result;
}
- private static class UpgradeStatusConvertor implements Convertor<Matcher, SVNEvent> {
+ private static class UpgradeStatusConvertor implements Convertor<Matcher, ProgressEvent> {
- public SVNEvent convert(@NotNull Matcher matcher) {
+ public ProgressEvent convert(@NotNull Matcher matcher) {
String statusMessage = matcher.group(1);
String path = matcher.group(2);
@@ -74,11 +70,11 @@
}
@Nullable
- public static SVNEventAction createAction(@NotNull String code) {
- SVNEventAction result = null;
+ public static EventAction createAction(@NotNull String code) {
+ EventAction result = null;
if ("Upgraded".equals(code)) {
- result = SVNEventAction.UPGRADED_PATH;
+ result = EventAction.UPGRADED_PATH;
}
return result;
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/SvnKitUpgradeClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/SvnKitUpgradeClient.java
index 66b5f71..f583ad2 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/SvnKitUpgradeClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/SvnKitUpgradeClient.java
@@ -5,11 +5,11 @@
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.WorkingCopyFormat;
import org.jetbrains.idea.svn.api.BaseSvnClient;
+import org.jetbrains.idea.svn.api.EventAction;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.checkout.SvnKitCheckoutClient;
import org.jetbrains.idea.svn.commandLine.SvnBindException;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
-import org.tmatesoft.svn.core.wc.SVNEventAction;
import org.tmatesoft.svn.core.wc.SVNWCClient;
import java.io.File;
@@ -21,12 +21,12 @@
public class SvnKitUpgradeClient extends BaseSvnClient implements UpgradeClient {
@Override
- public void upgrade(@NotNull File path, @NotNull WorkingCopyFormat format, @Nullable ISVNEventHandler handler) throws VcsException {
+ public void upgrade(@NotNull File path, @NotNull WorkingCopyFormat format, @Nullable ProgressTracker handler) throws VcsException {
validateFormat(format, getSupportedFormats());
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
- client.setEventHandler(handler);
+ client.setEventHandler(toEventHandler(handler));
try {
cleanupIfNecessary(path, format, client, handler);
upgrade(path, format, client, handler);
@@ -44,11 +44,11 @@
private static void cleanupIfNecessary(@NotNull File path,
@NotNull WorkingCopyFormat format,
@NotNull SVNWCClient client,
- @Nullable ISVNEventHandler handler) throws SVNException, VcsException {
+ @Nullable ProgressTracker handler) throws SVNException, VcsException {
// cleanup is executed only for SVNKit as it could handle both 1.6 and 1.7 formats
if (WorkingCopyFormat.ONE_DOT_SEVEN.equals(format)) {
// fake event indicating cleanup start
- callHandler(handler, createEvent(path, SVNEventAction.UPDATE_STARTED));
+ callHandler(handler, createEvent(path, EventAction.UPDATE_STARTED));
client.doCleanup(path);
}
}
@@ -56,9 +56,9 @@
private static void upgrade(@NotNull File path,
@NotNull WorkingCopyFormat format,
@NotNull SVNWCClient client,
- @Nullable ISVNEventHandler handler) throws SVNException, VcsException {
+ @Nullable ProgressTracker handler) throws SVNException, VcsException {
// fake event indicating upgrade start
- callHandler(handler, createEvent(path, SVNEventAction.UPDATE_COMPLETED));
+ callHandler(handler, createEvent(path, EventAction.UPDATE_COMPLETED));
client.doSetWCFormat(path, format.getFormat());
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/UpgradeClient.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/UpgradeClient.java
index 2d22acf..22d916f 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/UpgradeClient.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/upgrade/UpgradeClient.java
@@ -4,8 +4,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.WorkingCopyFormat;
+import org.jetbrains.idea.svn.api.ProgressTracker;
import org.jetbrains.idea.svn.api.SvnClient;
-import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import java.io.File;
import java.util.List;
@@ -15,7 +15,7 @@
*/
public interface UpgradeClient extends SvnClient {
- void upgrade(@NotNull File path, @NotNull WorkingCopyFormat format, @Nullable ISVNEventHandler handler) throws VcsException;
+ void upgrade(@NotNull File path, @NotNull WorkingCopyFormat format, @Nullable ProgressTracker handler) throws VcsException;
List<WorkingCopyFormat> getSupportedFormats() throws VcsException;
}
diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/ConflictCreator.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/ConflictCreator.java
index 635484f..cca76e1 100644
--- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/ConflictCreator.java
+++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/ConflictCreator.java
@@ -26,8 +26,8 @@
import com.intellij.util.Processor;
import com.intellij.util.containers.Convertor;
import junit.framework.Assert;
-import org.tmatesoft.svn.core.wc.SVNInfo;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
+import org.jetbrains.idea.svn.info.Info;
+import org.jetbrains.idea.svn.status.StatusType;
import java.io.File;
import java.io.IOException;
@@ -100,7 +100,7 @@
String subPath = "";
for (String part : parts) {
final String path = subPath + part;
- SVNInfo info = vcs.getInfo(new File(myTheirsDir.getPath(), path));
+ Info info = vcs.getInfo(new File(myTheirsDir.getPath(), path));
if (info == null || info.getURL() == null) {
myClientRunner.add(myTheirsDir, path);
}
@@ -161,15 +161,15 @@
final File target = new File(root.getPath(), fileData.myRelativePath);
// we dont apply properties changes fow now
- if (SVNStatusType.STATUS_MISSING.equals(fileData.myNodeStatus)) {
+ if (StatusType.STATUS_MISSING.equals(fileData.myNodeStatus)) {
// delete existing only from fs
FileUtil.delete(target);
return;
- } else if (SVNStatusType.STATUS_UNVERSIONED.equals(fileData.myNodeStatus)) {
+ } else if (StatusType.STATUS_UNVERSIONED.equals(fileData.myNodeStatus)) {
// create new unversioned
createFile(root, fileData, target);
return;
- } else if (SVNStatusType.STATUS_ADDED.equals(fileData.myNodeStatus)) {
+ } else if (StatusType.STATUS_ADDED.equals(fileData.myNodeStatus)) {
if (fileData.myCopyFrom != null) {
myClientRunner.copy(root, fileData.myCopyFrom, fileData.myRelativePath);
return;
@@ -177,11 +177,11 @@
createFile(root, fileData, target);
myClientRunner.add(root, fileData.myRelativePath);
return;
- } else if (SVNStatusType.STATUS_DELETED.equals(fileData.myNodeStatus)) {
+ } else if (StatusType.STATUS_DELETED.equals(fileData.myNodeStatus)) {
myClientRunner.delete(root, fileData.myRelativePath);
return;
- } else if (SVNStatusType.STATUS_NORMAL.equals(fileData.myNodeStatus)) {
- if (SVNStatusType.STATUS_MODIFIED.equals(fileData.myContentsStatus)) {
+ } else if (StatusType.STATUS_NORMAL.equals(fileData.myNodeStatus)) {
+ if (StatusType.STATUS_MODIFIED.equals(fileData.myContentsStatus)) {
createFile(root, fileData, target);
return;
}
diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnCachingRevisionsTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnCachingRevisionsTest.java
index ee9e2cd..d3a9bc5 100644
--- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnCachingRevisionsTest.java
+++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnCachingRevisionsTest.java
@@ -8,7 +8,6 @@
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
import org.jetbrains.idea.svn.history.*;
-import org.tmatesoft.svn.core.SVNLogEntry;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNRevision;
@@ -36,8 +35,10 @@
}
private SvnChangeList createList(final long revision) {
- return new SvnChangeList(null, myLocation,
- new SVNLogEntry(Collections.emptyMap(), revision, AUTHOR, new Date(System.currentTimeMillis()), ""), ROOT.toDecodedString());
+ LogEntry entry =
+ new LogEntry.Builder().setRevision(revision).setAuthor(AUTHOR).setDate(new Date(System.currentTimeMillis())).setMessage("").build();
+
+ return new SvnChangeList(null, myLocation, entry, ROOT.toDecodedString());
}
private class MockSvnLogLoader implements SvnLogLoader {
diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnMergeInfoTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnMergeInfoTest.java
index 1ed14dc..b6d83ad 100644
--- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnMergeInfoTest.java
+++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnMergeInfoTest.java
@@ -24,20 +24,20 @@
import com.intellij.util.ArrayUtil;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.dialogs.MergeContext;
import org.jetbrains.idea.svn.dialogs.WCInfo;
import org.jetbrains.idea.svn.history.SvnChangeList;
import org.jetbrains.idea.svn.history.SvnRepositoryLocation;
+import org.jetbrains.idea.svn.info.Info;
import org.jetbrains.idea.svn.mergeinfo.BranchInfo;
import org.jetbrains.idea.svn.mergeinfo.OneShotMergeInfoHelper;
import org.jetbrains.idea.svn.mergeinfo.SvnMergeInfoCache;
import org.junit.Assert;
import org.junit.Test;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNPropertyData;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNWCClient;
@@ -86,7 +86,7 @@
VirtualFile vcsRoot = LocalFileSystem.getInstance().findFileByIoFile(myBranchVcsRoot);
Node node = new Node(vcsRoot, SVNURL.parseURIEncoded(myBranchUrl), SVNURL.parseURIEncoded(myRepoUrl));
RootUrlInfo root = new RootUrlInfo(node, WorkingCopyFormat.ONE_DOT_SIX, vcsRoot, null);
- myWCInfo = new WCInfo(root, true, SVNDepth.INFINITY);
+ myWCInfo = new WCInfo(root, true, Depth.INFINITY);
myMergeContext = new MergeContext(SvnVcs.getInstance(myProject), myTrunkUrl, myWCInfo, SVNPathUtil.tail(myTrunkUrl), vcsRoot);
myOneShotMergeInfoHelper = new OneShotMergeInfoHelper(myMergeContext);
@@ -255,7 +255,7 @@
assertMergeInfo(myBranchVcsRoot, "/trunk:3");
- final SVNInfo f1info = myVcs.getInfo(new File(myBranchVcsRoot, "folder/f1.txt"));
+ final Info f1info = myVcs.getInfo(new File(myBranchVcsRoot, "folder/f1.txt"));
assert f1info.getRevision().getNumber() == 2;
final List<SvnChangeList> changeListList = getTrunkChangeLists();
diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnNativeClientAuthTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnNativeClientAuthTest.java
index 99f7b0c..a0dfa97 100644
--- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnNativeClientAuthTest.java
+++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnNativeClientAuthTest.java
@@ -30,6 +30,7 @@
import com.intellij.util.containers.Convertor;
import junit.framework.Assert;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.auth.SvnAuthenticationManager;
import org.jetbrains.idea.svn.auth.SvnAuthenticationNotifier;
import org.jetbrains.idea.svn.checkout.SvnCheckoutProvider;
@@ -544,7 +545,7 @@
root.deleteOnExit();
Assert.assertTrue(root.exists());
SvnCheckoutProvider
- .checkout(myProject, root, url, SVNRevision.HEAD, SVNDepth.INFINITY, false, new CheckoutProvider.Listener() {
+ .checkout(myProject, root, url, SVNRevision.HEAD, Depth.INFINITY, false, new CheckoutProvider.Listener() {
@Override
public void directoryCheckedOut(File directory, VcsKey vcs) {
}
diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnParseCommandLineParseTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnParseCommandLineParseTest.java
index ec78b9f..6e0ee96 100644
--- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnParseCommandLineParseTest.java
+++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnParseCommandLineParseTest.java
@@ -24,19 +24,15 @@
import com.intellij.util.containers.MultiMap;
import junit.framework.Assert;
import junit.framework.TestCase;
-import org.jetbrains.idea.svn.status.CmdStatusClient;
+import org.jetbrains.idea.svn.api.Depth;
+import org.jetbrains.idea.svn.api.NodeKind;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.info.Info;
+import org.jetbrains.idea.svn.status.*;
import org.jetbrains.idea.svn.info.SvnInfoHandler;
-import org.jetbrains.idea.svn.status.SvnStatusHandler;
-import org.jetbrains.idea.svn.info.IdeaSVNInfo;
-import org.jetbrains.idea.svn.status.PortableStatus;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.wc.ISVNStatusHandler;
-import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
-import org.tmatesoft.svn.core.wc.SVNStatus;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
@@ -84,10 +80,10 @@
"</entry>\n" +
"</info>";
- final SVNInfo[] info = new SVNInfo[1];
- final SvnInfoHandler handler = new SvnInfoHandler(new File("C:/base/"), new Consumer<SVNInfo>() {
+ final Info[] info = new Info[1];
+ final SvnInfoHandler handler = new SvnInfoHandler(new File("C:/base/"), new Consumer<Info>() {
@Override
- public void consume(SVNInfo info1) {
+ public void consume(Info info1) {
info[0] = info1;
}
});
@@ -574,9 +570,9 @@
@Override
public void switchChangeList(String newList) {
}
- }, new File(basePath), new Convertor<File, SVNInfo>() {
+ }, new File(basePath), new Convertor<File, Info>() {
@Override
- public SVNInfo convert(File o) {
+ public Info convert(File o) {
try {
o.getCanonicalFile();
}
@@ -616,9 +612,9 @@
return StringUtil.replace(s, "C:/", LINUX_ROOT);
}
- private IdeaSVNInfo createStubInfo(final String basePath, final String baseUrl) throws SVNException {
- return new IdeaSVNInfo(basePath, SVNURL.parseURIEncoded(baseUrl), SVNRevision.HEAD, SVNNodeKind.FILE, "",
- SVNURL.parseURIEncoded("http://a.b.c"), 1, new Date(), "me", null, SVNDepth.EMPTY, 1);
+ private Info createStubInfo(final String basePath, final String baseUrl) throws SVNException {
+ return new Info(basePath, SVNURL.parseURIEncoded(baseUrl), SVNRevision.HEAD, NodeKind.FILE, "",
+ SVNURL.parseURIEncoded("http://a.b.c"), 1, new Date(), "me", null, Depth.EMPTY);
}
public void testStatusInExternalMove() throws Exception {
@@ -671,9 +667,9 @@
final String basePath = "C:\\TestProjects\\sortedProjects\\Subversion\\local2\\sep12main\\main";
final SvnStatusHandler[] handler = new SvnStatusHandler[1];
final File baseFile = new File(basePath);
- final SvnStatusHandler.ExternalDataCallback callback = CmdStatusClient.createStatusCallback(new ISVNStatusHandler() {
+ final SvnStatusHandler.ExternalDataCallback callback = CmdStatusClient.createStatusCallback(new StatusConsumer() {
@Override
- public void handleStatus(SVNStatus status) throws SVNException {
+ public void consume(Status status) throws SVNException {
System.out.println(status.getURL());
if (new File(
"C:\\TestProjects\\sortedProjects\\Subversion\\local2\\sep12main\\main\\slave\\src\\com\\slave\\MacMessagesParser.java")
@@ -686,9 +682,9 @@
}
}
}, baseFile, createStubInfo(basePath, "http://mainurl/"), handler);
- handler[0] = new SvnStatusHandler(callback, baseFile, new Convertor<File, SVNInfo>() {
+ handler[0] = new SvnStatusHandler(callback, baseFile, new Convertor<File, Info>() {
@Override
- public SVNInfo convert(File o) {
+ public Info convert(File o) {
try {
if (new File("C:\\TestProjects\\sortedProjects\\Subversion\\local2\\sep12main\\main\\slave").equals(o)) {
return createStubInfo(o.getPath(), "http://external");
@@ -756,9 +752,9 @@
@Override
public void switchChangeList(String newList) {
}
- }, new File(basePath), new Convertor<File, SVNInfo>() {
+ }, new File(basePath), new Convertor<File, Info>() {
@Override
- public SVNInfo convert(File o) {
+ public Info convert(File o) {
try {
o.getCanonicalFile();
}
@@ -846,9 +842,9 @@
public void switchChangeList(String newList) {
clName[0] = newList;
}
- }, new File(basePath), new Convertor<File, SVNInfo>() {
+ }, new File(basePath), new Convertor<File, Info>() {
@Override
- public SVNInfo convert(File o) {
+ public Info convert(File o) {
try {
o.getCanonicalFile();
}
diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnProtocolsTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnProtocolsTest.java
index 358f372..af17c9a 100644
--- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnProtocolsTest.java
+++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnProtocolsTest.java
@@ -35,6 +35,7 @@
import com.intellij.util.Processor;
import com.intellij.util.containers.Convertor;
import junit.framework.Assert;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.auth.SvnAuthenticationManager;
import org.jetbrains.idea.svn.checkout.SvnCheckoutProvider;
import org.junit.Before;
@@ -222,7 +223,7 @@
root.deleteOnExit();
Assert.assertTrue(root.exists());
SvnCheckoutProvider
- .checkout(myProject, root, url, SVNRevision.HEAD, SVNDepth.INFINITY, false, new CheckoutProvider.Listener() {
+ .checkout(myProject, root, url, SVNRevision.HEAD, Depth.INFINITY, false, new CheckoutProvider.Listener() {
@Override
public void directoryCheckedOut(File directory, VcsKey vcs) {
}
diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnResolveTreeAcceptVariantsTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnResolveTreeAcceptVariantsTest.java
index 071da76..03d3875 100644
--- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnResolveTreeAcceptVariantsTest.java
+++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnResolveTreeAcceptVariantsTest.java
@@ -26,12 +26,12 @@
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Processor;
import junit.framework.Assert;
+import org.jetbrains.idea.svn.info.Info;
+import org.jetbrains.idea.svn.status.Status;
+import org.jetbrains.idea.svn.status.StatusType;
import org.jetbrains.idea.svn.treeConflict.SvnTreeConflictResolver;
import org.junit.Before;
import org.junit.Test;
-import org.tmatesoft.svn.core.wc.SVNInfo;
-import org.tmatesoft.svn.core.wc.SVNStatus;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
import java.io.File;
import java.io.IOException;
@@ -162,43 +162,43 @@
}
private void checkStatusesAfterMineFullResolve(TreeConflictData.Data data, File conflictIoFile) {
- SVNStatus conflStatus = SvnUtil.getStatus(myVcs, conflictIoFile);
+ Status conflStatus = SvnUtil.getStatus(myVcs, conflictIoFile);
Assert.assertTrue(createTestFailedComment(data, conflictIoFile.getPath()) + " tree conflict resolved",
conflStatus.getTreeConflict() == null);
Collection<TreeConflictData.FileData> leftFiles = data.getLeftFiles();
for (TreeConflictData.FileData file : leftFiles) {
File exFile = new File(myWorkingCopyDir.getPath(), file.myRelativePath);
- final SVNStatus status = SvnUtil.getStatus(myVcs, exFile);
+ final Status status = SvnUtil.getStatus(myVcs, exFile);
boolean theirsExists = new File(myTheirs.getPath(), file.myRelativePath).exists();
- if (SVNStatusType.STATUS_UNVERSIONED.equals(file.myNodeStatus)) {
+ if (StatusType.STATUS_UNVERSIONED.equals(file.myNodeStatus)) {
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (file exists)", exFile.exists());
if (theirsExists) {
// should be deleted
- Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (unversioned)", status == null || SVNStatusType.STATUS_DELETED.equals(status.getNodeStatus()));
+ Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (unversioned)", status == null || StatusType.STATUS_DELETED.equals(status.getNodeStatus()));
} else {
// unversioned
- Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (unversioned)", status == null || SVNStatusType.STATUS_UNVERSIONED.equals(status.getNodeStatus()));
+ Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (unversioned)", status == null || StatusType.STATUS_UNVERSIONED.equals(status.getNodeStatus()));
}
- } else if (SVNStatusType.STATUS_DELETED.equals(file.myNodeStatus)) {
+ } else if (StatusType.STATUS_DELETED.equals(file.myNodeStatus)) {
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (deleted status)", status != null && file.myNodeStatus.equals(status.getNodeStatus()));
- } else if (SVNStatusType.STATUS_ADDED.equals(file.myNodeStatus)) {
+ } else if (StatusType.STATUS_ADDED.equals(file.myNodeStatus)) {
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (file exists)", exFile.exists());
if (theirsExists) {
- Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (added status)", status != null && SVNStatusType.STATUS_REPLACED.equals(status.getNodeStatus()));
+ Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (added status)", status != null && StatusType.STATUS_REPLACED.equals(status.getNodeStatus()));
} else {
- Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (added status)", status != null && SVNStatusType.STATUS_ADDED.equals(status.getNodeStatus()));
+ Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (added status)", status != null && StatusType.STATUS_ADDED.equals(status.getNodeStatus()));
}
} else {
- if (SVNStatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
+ if (StatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
// in theirs -> deleted
Assert.assertFalse(createTestFailedComment(data, file.myRelativePath) + " check deleted in theirs", theirsExists);
} else {
if (theirsExists) {
- Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (normal node status)", status != null && SVNStatusType.STATUS_REPLACED.equals(status.getNodeStatus()));
+ Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (normal node status)", status != null && StatusType.STATUS_REPLACED.equals(status.getNodeStatus()));
} else {
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (normal node status)", status != null &&
- (SVNStatusType.STATUS_NORMAL.equals(status.getNodeStatus()) || SVNStatusType.STATUS_MODIFIED.equals(status.getNodeStatus())));
+ (StatusType.STATUS_NORMAL.equals(status.getNodeStatus()) || StatusType.STATUS_MODIFIED.equals(status.getNodeStatus())));
}
}
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (modified text status)", status != null && file.myContentsStatus.equals(status.getContentsStatus()));
@@ -271,8 +271,8 @@
exists);
}
final File theirsFile = new File(file.getPath());
- SVNInfo theirsInfo = myVcs.getInfo(theirsFile);
- SVNInfo thisInfo = myVcs.getInfo(workingFile);
+ Info theirsInfo = myVcs.getInfo(theirsFile);
+ Info thisInfo = myVcs.getInfo(workingFile);
if (theirsInfo != null) {
Assert.assertEquals("Check failed for test: " + getTestName(data) + " and file: " + relative + " in: " + myWorkingCopyDir.getPath() +
", theirs: " + theirsInfo.getRevision().getNumber() + ", mine: " + thisInfo.getRevision().getNumber(),
diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnTreeConflictDataTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnTreeConflictDataTest.java
index a38d851..0017249 100644
--- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnTreeConflictDataTest.java
+++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnTreeConflictDataTest.java
@@ -23,18 +23,15 @@
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import junit.framework.Assert;
+import org.jetbrains.idea.svn.conflict.ConflictAction;
+import org.jetbrains.idea.svn.conflict.ConflictOperation;
+import org.jetbrains.idea.svn.conflict.ConflictVersion;
+import org.jetbrains.idea.svn.conflict.TreeConflictDescription;
import org.junit.Before;
import org.junit.Test;
-import org.tmatesoft.svn.core.SVNNodeKind;
-import org.tmatesoft.svn.core.internal.wc.SVNConflictVersion;
-import org.tmatesoft.svn.core.wc.SVNConflictAction;
-import org.tmatesoft.svn.core.wc.SVNOperation;
-import org.tmatesoft.svn.core.wc.SVNTreeConflictDescription;
import java.io.File;
-import static com.intellij.util.TimeoutUtil.sleep;
-
/**
* @author Irina.Chernushina
* @since 2.05.2012
@@ -71,20 +68,20 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
Assert.assertNull(beforeDescription.getSourceLeftVersion());
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.FILE, version.getKind());
+ Assert.assertTrue(version.isFile());
}
@Test
@@ -99,22 +96,22 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.DELETE, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNotNull(leftVersion);
- Assert.assertEquals(SVNNodeKind.FILE, leftVersion.getKind());
+ Assert.assertTrue(leftVersion.isFile());
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.NONE, version.getKind());
+ Assert.assertTrue(version.isNone());
}
private String createConflict(final TreeConflictData.Data data) throws Exception {
@@ -138,22 +135,22 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.EDIT, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNotNull(leftVersion);
- Assert.assertEquals(SVNNodeKind.FILE, leftVersion.getKind());
+ Assert.assertTrue(leftVersion.isFile());
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.FILE, version.getKind());
+ Assert.assertTrue(version.isFile());
}
@Test
@@ -168,22 +165,22 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.DELETE, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNotNull(leftVersion);
- Assert.assertEquals(SVNNodeKind.FILE, leftVersion.getKind());
+ Assert.assertTrue(leftVersion.isFile());
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.NONE, version.getKind());
+ Assert.assertTrue(version.isNone());
}
@Test
@@ -198,21 +195,22 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.FILE, version.getKind());
+ Assert.assertTrue(version.isFile());
+
}
@Test
@@ -229,22 +227,23 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.EDIT, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNotNull(leftVersion);
- Assert.assertEquals(SVNNodeKind.FILE, leftVersion.getKind());
+ Assert.assertTrue(leftVersion.isFile());
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.FILE, version.getKind());
+ Assert.assertTrue(version.isFile());
+
}
@Test
@@ -261,22 +260,23 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- //Assert.assertEquals(SVNNodeKind.FILE, leftVersion.getKind());
+ //Assert.assertEquals(NodeKind.FILE, leftVersion.getKind());
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.FILE, version.getKind());
+ Assert.assertTrue(version.isFile());
+
}
//---------------------------------- dirs --------------------------------------------------------
@@ -292,21 +292,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.DIR, version.getKind());
+ Assert.assertTrue(version.isDirectory());
}
// not a conflict in Subversion 1.7.7. "mine" file becomes added
@@ -322,22 +322,22 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.DELETE, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNotNull(leftVersion);
- Assert.assertEquals(SVNNodeKind.DIR, leftVersion.getKind());
+ Assert.assertEquals(NodeKind.DIR, leftVersion.getKind());
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.NONE, version.getKind());
+ Assert.assertEquals(NodeKind.NONE, version.getKind());
}*/
@Test
@@ -350,22 +350,22 @@
final Change change = changeListManager.getChange(new FilePathImpl(new File(myWorkingCopyDir.getPath(), conflictFile), true));
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.EDIT, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNotNull(leftVersion);
- Assert.assertEquals(SVNNodeKind.DIR, leftVersion.getKind());
+ Assert.assertTrue(leftVersion.isDirectory());
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.DIR, version.getKind());
+ Assert.assertTrue(version.isDirectory());
}
@Test
@@ -380,22 +380,22 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.DELETE, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNotNull(leftVersion);
- Assert.assertEquals(SVNNodeKind.DIR, leftVersion.getKind());
+ Assert.assertTrue(leftVersion.isDirectory());
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.NONE, version.getKind());
+ Assert.assertTrue(version.isNone());
}
@Test
@@ -410,21 +410,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.DIR, version.getKind());
+ Assert.assertTrue(version.isDirectory());
}
@Test
@@ -437,22 +437,22 @@
final Change change = changeListManager.getChange(new FilePathImpl(new File(myWorkingCopyDir.getPath(), conflictFile), true));
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.EDIT, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNotNull(leftVersion);
- Assert.assertEquals(SVNNodeKind.DIR, leftVersion.getKind());
+ Assert.assertTrue(leftVersion.isDirectory());
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.DIR, version.getKind());
+ Assert.assertTrue(version.isDirectory());
}
@Test
@@ -465,22 +465,22 @@
final Change change = changeListManager.getChange(new FilePathImpl(new File(myWorkingCopyDir.getPath(), conflictFile), true));
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- //Assert.assertEquals(SVNNodeKind.DIR, leftVersion.getKind());
+ //Assert.assertEquals(NodeKind.DIR, leftVersion.getKind());
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.DIR, version.getKind());
+ Assert.assertTrue(version.isDirectory());
}
//---------------------------------
@Test
@@ -498,21 +498,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.DIR, version.getKind());
+ Assert.assertTrue(version.isDirectory());
}
@Test
@@ -530,21 +530,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.DIR, version.getKind());
+ Assert.assertTrue(version.isDirectory());
}
@Test
@@ -562,21 +562,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.DIR, version.getKind());
+ Assert.assertTrue(version.isDirectory());
}
@Test
@@ -594,21 +594,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.DIR, version.getKind());
+ Assert.assertTrue(version.isDirectory());
}
@Test
@@ -626,21 +626,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.DIR, version.getKind());
+ Assert.assertTrue(version.isDirectory());
}
//******************************************
// dir -> file (mine, theirs)
@@ -659,21 +659,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.FILE, version.getKind());
+ Assert.assertTrue(version.isFile());
}
@Test
@@ -691,21 +691,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.FILE, version.getKind());
+ Assert.assertTrue(version.isFile());
}
@Test
@@ -723,21 +723,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.FILE, version.getKind());
+ Assert.assertTrue(version.isFile());
}
@Test
@@ -755,21 +755,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.FILE, version.getKind());
+ Assert.assertTrue(version.isFile());
}
@Test
@@ -787,21 +787,21 @@
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
- SVNTreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
+ TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
- final SVNTreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
+ final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
Assert.assertNull(afterDescription);
- Assert.assertEquals(SVNOperation.UPDATE, beforeDescription.getOperation());
- Assert.assertEquals(SVNConflictAction.ADD, beforeDescription.getConflictAction());
+ Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
+ Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
- SVNConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
+ ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
- final SVNConflictVersion version = beforeDescription.getSourceRightVersion();
+ final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
- Assert.assertEquals(SVNNodeKind.FILE, version.getKind());
+ Assert.assertTrue(version.isFile());
}
private void createSubTree() throws Exception {
diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/TreeConflictData.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/TreeConflictData.java
index 2114e0e..178253b 100644
--- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/TreeConflictData.java
+++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/TreeConflictData.java
@@ -15,7 +15,7 @@
*/
package org.jetbrains.idea.svn;
-import org.tmatesoft.svn.core.wc.SVNStatusType;
+import org.jetbrains.idea.svn.status.StatusType;
import java.util.ArrayList;
import java.util.Arrays;
@@ -51,8 +51,8 @@
"@@ -0,0 +1,1 @@\n" +
"+added text\n" +
"\\ No newline at end of file\n",
- "added.txt", new FileData[]{new FileData("added.txt", "unversioned text", SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ "added.txt", new FileData[]{new FileData("added.txt", "unversioned text", StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_EDIT_THEIRS_DELETE = new Data("Index: root/source/s1.txt\n" +
@@ -62,8 +62,8 @@
"@@ -1,1 +0,0 @@\n" +
"-123\n" +
"\\ No newline at end of file\n", "root/source/s1.txt",
- new FileData[] {new FileData("root/source/s1.txt", "1*2*3", SVNStatusType.STATUS_NORMAL,
- SVNStatusType.STATUS_MODIFIED, SVNStatusType.STATUS_NORMAL, false)});
+ new FileData[] {new FileData("root/source/s1.txt", "1*2*3", StatusType.STATUS_NORMAL,
+ StatusType.STATUS_MODIFIED, StatusType.STATUS_NORMAL, false)});
Data MINE_DELETE_THEIRS_EDIT = new Data("Index: root/source/s1.txt\n" +
"===================================================================\n" +
"--- root/source/s1.txt\t(revision 358)\n" +
@@ -73,24 +73,24 @@
"\\ No newline at end of file\n" +
"+1*2*3\n" +
"\\ No newline at end of file\n", "root/source/s1.txt",
- new FileData[] {new FileData("root/source/s1.txt", null, SVNStatusType.STATUS_DELETED,
- SVNStatusType.STATUS_DELETED, SVNStatusType.STATUS_DELETED, false)});
+ new FileData[] {new FileData("root/source/s1.txt", null, StatusType.STATUS_DELETED,
+ StatusType.STATUS_DELETED, StatusType.STATUS_DELETED, false)});
Data MINE_EDIT_THEIRS_MOVE = new Data("Index: root/source/s1.txt\n" +
"===================================================================\n" +
"--- root/source/s1.txt\t(revision 358)\n" +
"+++ root/source/s1renamed.txt\t(revision )\n" +
"@@ -1,0 +1,0 @@\n", "root/source/s1.txt",
- new FileData[] {new FileData("root/source/s1.txt", "1*2*3", SVNStatusType.STATUS_NORMAL,
- SVNStatusType.STATUS_MODIFIED, SVNStatusType.STATUS_NORMAL, false)});
+ new FileData[] {new FileData("root/source/s1.txt", "1*2*3", StatusType.STATUS_NORMAL,
+ StatusType.STATUS_MODIFIED, StatusType.STATUS_NORMAL, false)});
Data MINE_UNV_THEIRS_MOVE = new Data("Index: root/source/s1.txt\n" +
"===================================================================\n" +
"--- root/source/s1.txt\t(revision 358)\n" +
"+++ root/source/s1renamed.txt\t(revision )\n" +
"@@ -1,0 +1,0 @@\n", "root/source/s1renamed.txt",
- new FileData[] {new FileData("root/source/s1renamed.txt", "1*2*3", SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ new FileData[] {new FileData("root/source/s1renamed.txt", "1*2*3", StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_MOVE_THEIRS_EDIT = new Data("Index: root/source/s1.txt\n" +
"===================================================================\n" +
@@ -102,10 +102,10 @@
"+1*2*3\n" +
// conflict would be marked by svn on s1.txt, but here we put s1moved.txt, for change list manager to find the change
"\\ No newline at end of file\n", "root/source/s1moved.txt",
- new FileData[] {new FileData("root/source/s1moved.txt", null, SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_ADDED, SVNStatusType.STATUS_ADDED, false, "root/source/s1.txt"),
- new FileData("root/source/s1.txt", null, SVNStatusType.STATUS_DELETED,
- SVNStatusType.STATUS_DELETED, SVNStatusType.STATUS_DELETED, false)});
+ new FileData[] {new FileData("root/source/s1moved.txt", null, StatusType.STATUS_ADDED,
+ StatusType.STATUS_ADDED, StatusType.STATUS_ADDED, false, "root/source/s1.txt"),
+ new FileData("root/source/s1.txt", null, StatusType.STATUS_DELETED,
+ StatusType.STATUS_DELETED, StatusType.STATUS_DELETED, false)});
Data MINE_MOVE_THEIRS_ADD = new Data("Index: root/source/s1moved.txt\n" +
"===================================================================\n" +
"--- root/source/s1moved.txt\t(revision )\n" +
@@ -114,10 +114,10 @@
"+added text\n" +
"\\ No newline at end of file\n",
"root/source/s1moved.txt",
- new FileData[] {new FileData("root/source/s1moved.txt", null, SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_ADDED, SVNStatusType.STATUS_ADDED, false, "root/source/s1.txt"),
- new FileData("root/source/s1.txt", null, SVNStatusType.STATUS_DELETED,
- SVNStatusType.STATUS_DELETED, SVNStatusType.STATUS_DELETED, false)}) {
+ new FileData[] {new FileData("root/source/s1moved.txt", null, StatusType.STATUS_ADDED,
+ StatusType.STATUS_ADDED, StatusType.STATUS_ADDED, false, "root/source/s1.txt"),
+ new FileData("root/source/s1.txt", null, StatusType.STATUS_DELETED,
+ StatusType.STATUS_DELETED, StatusType.STATUS_DELETED, false)}) {
@Override
protected void afterInit() {
setExcludeFromToTheirsCheck("root\\source\\s1.txt");
@@ -133,11 +133,11 @@
"@@ -0,0 +1,1 @@\n" +
"+added text\n" +
"\\ No newline at end of file\n",
- "addedDir", new FileData[]{new FileData("addedDir", null, SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ "addedDir", new FileData[]{new FileData("addedDir", null, StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
true),
- new FileData("addedDir/unv.txt", "unversioned", SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ new FileData("addedDir/unv.txt", "unversioned", StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_EDIT_THEIRS_DELETE = new Data("Index: root/source/s1.txt\n" +
@@ -154,8 +154,8 @@
"@@ -1,1 +0,0 @@\n" +
"-abc\n" +
"\\ No newline at end of file\n", "root/source",
- new FileData[] {new FileData("root/source/s1.txt", "1*2*3", SVNStatusType.STATUS_NORMAL,
- SVNStatusType.STATUS_MODIFIED, SVNStatusType.STATUS_NORMAL, false)});
+ new FileData[] {new FileData("root/source/s1.txt", "1*2*3", StatusType.STATUS_NORMAL,
+ StatusType.STATUS_MODIFIED, StatusType.STATUS_NORMAL, false)});
Data MINE_DELETE_THEIRS_EDIT = new Data("Index: root/source/s1.txt\n" +
"===================================================================\n" +
"--- root/source/s1.txt\t(revision 358)\n" +
@@ -165,8 +165,8 @@
"\\ No newline at end of file\n" +
"+1*2*3\n" +
"\\ No newline at end of file\n", "root/source",
- new FileData[] {new FileData("root/source", null, SVNStatusType.STATUS_DELETED,
- SVNStatusType.STATUS_DELETED, SVNStatusType.STATUS_DELETED, true)});
+ new FileData[] {new FileData("root/source", null, StatusType.STATUS_DELETED,
+ StatusType.STATUS_DELETED, StatusType.STATUS_DELETED, true)});
Data MINE_EDIT_THEIRS_MOVE = new Data(
"Index: root/source/s1.txt\n" +
@@ -180,8 +180,8 @@
"+++ root/source1/s2.txt\t(revision )\n" +
"@@ -1,0 +1,0 @@\n",
"root/source",
- new FileData[] {new FileData("root/source/s1.txt", "1*2*3", SVNStatusType.STATUS_NORMAL,
- SVNStatusType.STATUS_MODIFIED, SVNStatusType.STATUS_NORMAL, false)});
+ new FileData[] {new FileData("root/source/s1.txt", "1*2*3", StatusType.STATUS_NORMAL,
+ StatusType.STATUS_MODIFIED, StatusType.STATUS_NORMAL, false)});
Data MINE_UNV_THEIRS_MOVE = new Data(
"Index: root/source/s1.txt\n" +
@@ -194,11 +194,11 @@
"--- root/source/s2.txt\t(revision 358)\n" +
"+++ root/source1/s2.txt\t(revision )\n" +
"@@ -1,0 +1,0 @@\n", "root/source1",
- new FileData[] {new FileData("root/source1", null, SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ new FileData[] {new FileData("root/source1", null, StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
true),
- new FileData("root/source1/unv.txt", "unversioned", SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ new FileData("root/source1/unv.txt", "unversioned", StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_MOVE_THEIRS_EDIT = new Data("Index: root/source/s1.txt\n" +
@@ -211,10 +211,10 @@
"+1*2*3\n" +
"\\ No newline at end of file\n", "root/source",
new FileData[] {
- new FileData("root/sourceNew", null, SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_ADDED, SVNStatusType.STATUS_ADDED, true, "root/source"),
- new FileData("root/source", null, SVNStatusType.STATUS_DELETED,
- SVNStatusType.STATUS_DELETED, SVNStatusType.STATUS_DELETED, true)});
+ new FileData("root/sourceNew", null, StatusType.STATUS_ADDED,
+ StatusType.STATUS_ADDED, StatusType.STATUS_ADDED, true, "root/source"),
+ new FileData("root/source", null, StatusType.STATUS_DELETED,
+ StatusType.STATUS_DELETED, StatusType.STATUS_DELETED, true)});
Data MINE_MOVE_THEIRS_ADD = new Data("Index: root/sourceNew/added.txt\n" +
"===================================================================\n" +
"--- root/sourceNew/added.txt\t(revision )\n" +
@@ -223,10 +223,10 @@
"+added text\n" +
"\\ No newline at end of file\n", "root/sourceNew",
new FileData[] {
- new FileData("root/sourceNew", null, SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_ADDED, SVNStatusType.STATUS_ADDED, true, "root/source"),
- new FileData("root/source", null, SVNStatusType.STATUS_DELETED,
- SVNStatusType.STATUS_DELETED, SVNStatusType.STATUS_DELETED, true)}) {
+ new FileData("root/sourceNew", null, StatusType.STATUS_ADDED,
+ StatusType.STATUS_ADDED, StatusType.STATUS_ADDED, true, "root/source"),
+ new FileData("root/source", null, StatusType.STATUS_DELETED,
+ StatusType.STATUS_DELETED, StatusType.STATUS_DELETED, true)}) {
@Override
protected void afterInit() {
setExcludeFromToTheirsCheck("root\\source", "root\\source\\s1.txt", "root\\source\\s2.txt");
@@ -243,8 +243,8 @@
"@@ -0,0 +1,1 @@\n" +
"+added text\n" +
"\\ No newline at end of file\n",
- "addedDir", new FileData[]{new FileData("addedDir", "unversioned", SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ "addedDir", new FileData[]{new FileData("addedDir", "unversioned", StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_ADD_THEIRS_ADD = new Data("Index: addedDir/added.txt\n" +
@@ -254,8 +254,8 @@
"@@ -0,0 +1,1 @@\n" +
"+added text\n" +
"\\ No newline at end of file\n",
- "addedDir", new FileData[]{new FileData("addedDir", "unversioned", SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ "addedDir", new FileData[]{new FileData("addedDir", "unversioned", StatusType.STATUS_ADDED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_UNV_THEIRS_MOVE = new Data( "Index: root/source/s1.txt\n" +
@@ -268,8 +268,8 @@
"--- root/source/s2.txt\t(revision 358)\n" +
"+++ root/source1/s2.txt\t(revision )\n" +
"@@ -1,0 +1,0 @@\n",
- "root/source1", new FileData[]{new FileData("root/source1", "unversioned", SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ "root/source1", new FileData[]{new FileData("root/source1", "unversioned", StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_ADD_THEIRS_MOVE = new Data( "Index: root/source/s1.txt\n" +
@@ -282,8 +282,8 @@
"--- root/source/s2.txt\t(revision 358)\n" +
"+++ root/source1/s2.txt\t(revision )\n" +
"@@ -1,0 +1,0 @@\n",
- "root/source1", new FileData[]{new FileData("root/source1", "unversioned", SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ "root/source1", new FileData[]{new FileData("root/source1", "unversioned", StatusType.STATUS_ADDED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_MOVE_THEIRS_ADD = new Data("Index: addedDir/added.txt\n" +
"===================================================================\n" +
@@ -292,11 +292,11 @@
"@@ -0,0 +1,1 @@\n" +
"+added text\n" +
"\\ No newline at end of file\n",
- "addedDir", new FileData[]{new FileData("addedDir", null, SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_ADDED, SVNStatusType.STATUS_ADDED,
+ "addedDir", new FileData[]{new FileData("addedDir", null, StatusType.STATUS_ADDED,
+ StatusType.STATUS_ADDED, StatusType.STATUS_ADDED,
false, "root/source/s1.txt"),
- new FileData("root/source/s1.txt", null, SVNStatusType.STATUS_DELETED,
- SVNStatusType.STATUS_DELETED, SVNStatusType.STATUS_DELETED,
+ new FileData("root/source/s1.txt", null, StatusType.STATUS_DELETED,
+ StatusType.STATUS_DELETED, StatusType.STATUS_DELETED,
false, null)}) {
@Override
protected void afterInit() {
@@ -314,11 +314,11 @@
"@@ -0,0 +1,1 @@\n" +
"+added text\n" +
"\\ No newline at end of file\n",
- "addedDir.txt", new FileData[]{new FileData("addedDir.txt", null, SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ "addedDir.txt", new FileData[]{new FileData("addedDir.txt", null, StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
true),
- new FileData("addedDir.txt/unv.txt", "unversioned", SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ new FileData("addedDir.txt/unv.txt", "unversioned", StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_ADD_THEIRS_ADD = new Data("Index: addedDir.txt\n" +
@@ -328,11 +328,11 @@
"@@ -0,0 +1,1 @@\n" +
"+added text\n" +
"\\ No newline at end of file\n",
- "addedDir.txt", new FileData[]{new FileData("addedDir.txt", null, SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ "addedDir.txt", new FileData[]{new FileData("addedDir.txt", null, StatusType.STATUS_ADDED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
true),
- new FileData("addedDir.txt/unv.txt", "unversioned", SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ new FileData("addedDir.txt/unv.txt", "unversioned", StatusType.STATUS_ADDED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_UNV_THEIRS_MOVE = new Data( "Index: root/source/s1.txt\n" +
@@ -342,12 +342,12 @@
"@@ -1,0 +1,0 @@\n" +
"\\ No newline at end of file\n",
"root/source/s1renamed.txt", new FileData[]{new FileData("root/source/s1renamed.txt", null,
- SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
true),
new FileData("root/source/s1renamed.txt/file.txt", "unversioned",
- SVNStatusType.STATUS_UNVERSIONED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_ADD_THEIRS_MOVE = new Data( "Index: root/source/s1.txt\n" +
@@ -357,12 +357,12 @@
"@@ -1,0 +1,0 @@\n" +
"\\ No newline at end of file\n",
"root/source/s1renamed.txt", new FileData[]{new FileData("root/source/s1renamed.txt", null,
- SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_ADDED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
true),
new FileData("root/source/s1renamed.txt/file.txt", "unversioned",
- SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_UNVERSIONED, SVNStatusType.STATUS_UNVERSIONED,
+ StatusType.STATUS_ADDED,
+ StatusType.STATUS_UNVERSIONED, StatusType.STATUS_UNVERSIONED,
false)});
Data MINE_MOVE_THEIRS_ADD = new Data("Index: addedDir.txt\n" +
@@ -372,10 +372,10 @@
"@@ -0,0 +1,1 @@\n" +
"+added text\n" +
"\\ No newline at end of file\n",
- "addedDir.txt", new FileData[]{new FileData("addedDir.txt", null, SVNStatusType.STATUS_ADDED,
- SVNStatusType.STATUS_ADDED, SVNStatusType.STATUS_ADDED, true, "root/source"),
- new FileData("root/source", null, SVNStatusType.STATUS_DELETED,
- SVNStatusType.STATUS_DELETED, SVNStatusType.STATUS_DELETED, true)}) {
+ "addedDir.txt", new FileData[]{new FileData("addedDir.txt", null, StatusType.STATUS_ADDED,
+ StatusType.STATUS_ADDED, StatusType.STATUS_ADDED, true, "root/source"),
+ new FileData("root/source", null, StatusType.STATUS_DELETED,
+ StatusType.STATUS_DELETED, StatusType.STATUS_DELETED, true)}) {
@Override
protected void afterInit() {
setExcludeFromToTheirsCheck("root\\source", "root\\source\\s1.txt", "root\\source\\s2.txt");
@@ -424,26 +424,26 @@
public final String myRelativePath;
public final String myContents;
public final String myCopyFrom;
- public final SVNStatusType myNodeStatus;
- public final SVNStatusType myContentsStatus;
+ public final StatusType myNodeStatus;
+ public final StatusType myContentsStatus;
// not used for now
- public final SVNStatusType myPropertiesStatus;
+ public final StatusType myPropertiesStatus;
public boolean myIsDir;
public FileData(String relativePath,
String contents,
- SVNStatusType nodeStatus,
- SVNStatusType contentsStatus,
- SVNStatusType propertiesStatus,
+ StatusType nodeStatus,
+ StatusType contentsStatus,
+ StatusType propertiesStatus,
boolean isDir) {
this(relativePath, contents, nodeStatus, contentsStatus, propertiesStatus, isDir, null);
}
public FileData(String relativePath,
String contents,
- SVNStatusType nodeStatus,
- SVNStatusType contentsStatus,
- SVNStatusType propertiesStatus,
+ StatusType nodeStatus,
+ StatusType contentsStatus,
+ StatusType propertiesStatus,
boolean isDir, final String copyFrom) {
myRelativePath = relativePath;
myContents = contents;
diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnCachingRevisionsTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnCachingRevisionsTest.java
index 749ee38..c5f7b9d 100644
--- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnCachingRevisionsTest.java
+++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnCachingRevisionsTest.java
@@ -10,7 +10,6 @@
import org.jetbrains.idea.svn.SvnApplicationSettings;
import org.jetbrains.idea.svn.SvnUtil;
import org.jetbrains.idea.svn.history.*;
-import org.tmatesoft.svn.core.SVNLogEntry;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNRevision;
@@ -38,8 +37,9 @@
}
private SvnChangeList createList(final long revision) {
- return new SvnChangeList(null, myLocation,
- new SVNLogEntry(Collections.emptyMap(), revision, AUTHOR, new Date(System.currentTimeMillis()), ""), ROOT.toDecodedString());
+ LogEntry entry =
+ new LogEntry.Builder().setRevision(revision).setAuthor(AUTHOR).setDate(new Date(System.currentTimeMillis())).setMessage("").build();
+ return new SvnChangeList(null, myLocation, entry, ROOT.toDecodedString());
}
private class MockSvnLogLoader implements SvnLogLoader {
diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnMergeInfoTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnMergeInfoTest.java
index cab82d7f..028b8c5 100644
--- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnMergeInfoTest.java
+++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnMergeInfoTest.java
@@ -25,6 +25,7 @@
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.idea.svn.*;
+import org.jetbrains.idea.svn.api.Depth;
import org.jetbrains.idea.svn.dialogs.MergeContext;
import org.jetbrains.idea.svn.dialogs.WCInfo;
import org.jetbrains.idea.svn.history.SvnChangeList;
@@ -34,7 +35,6 @@
import org.jetbrains.idea.svn.mergeinfo.SvnMergeInfoCache;
import org.junit.Assert;
import org.junit.Test;
-import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNPropertyData;
@@ -65,7 +65,7 @@
VirtualFile vcsRoot = LocalFileSystem.getInstance().findFileByIoFile(myBranchVcsRoot);
Node node = new Node(vcsRoot, SVNURL.parseURIEncoded(myRepoUrl + "/branch"), SVNURL.parseURIEncoded(myRepoUrl));
RootUrlInfo root = new RootUrlInfo(node, WorkingCopyFormat.ONE_DOT_SIX, vcsRoot, null);
- myWCInfo = new WCInfo(root, true, SVNDepth.INFINITY);
+ myWCInfo = new WCInfo(root, true, Depth.INFINITY);
myMergeContext = new MergeContext(SvnVcs.getInstance(myProject), myRepoUrl + "/trunk", myWCInfo, "trunk", vcsRoot);
myOneShotMergeInfoHelper = new OneShotMergeInfoHelper(myMergeContext);
diff --git a/plugins/tasks/tasks-api/src/com/intellij/tasks/impl/BaseRepositoryImpl.java b/plugins/tasks/tasks-api/src/com/intellij/tasks/impl/BaseRepositoryImpl.java
index 5a0aa95..30ecaf1 100644
--- a/plugins/tasks/tasks-api/src/com/intellij/tasks/impl/BaseRepositoryImpl.java
+++ b/plugins/tasks/tasks-api/src/com/intellij/tasks/impl/BaseRepositoryImpl.java
@@ -1,9 +1,11 @@
package com.intellij.tasks.impl;
+import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.tasks.TaskRepositoryType;
import com.intellij.tasks.config.TaskSettings;
import com.intellij.util.net.HttpConfigurable;
+import com.intellij.util.net.ssl.CertificateManager;
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.auth.AuthScope;
import org.jetbrains.annotations.NotNull;
@@ -51,6 +53,11 @@
private HttpClient createClient() {
HttpClient client = new HttpClient(new MultiThreadedHttpConnectionManager());
configureHttpClient(client);
+ // After CertificateManager became application service it no longer "automagically" preliminarily
+ // initializes default SSL context as required for trackers written in httpclient 3.x.
+ // Clients that use httpclient 4.x (see NewBaseRepositoryImpl.getHttpClient) install SSL context explicitly though.
+ // This workaround allows to install context properly as soon as HTTP client is needed.
+ ServiceManager.getService(CertificateManager.class);
return client;
}
@@ -76,7 +83,8 @@
client.getParams().setCredentialCharset("UTF-8");
client.getParams().setAuthenticationPreemptive(true);
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(getUsername(), getPassword()));
- } else {
+ }
+ else {
client.getState().clearCredentials();
client.getParams().setAuthenticationPreemptive(false);
}
diff --git a/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRemoteApi.java b/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRemoteApi.java
index 22e93a9..8ee9c97 100644
--- a/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRemoteApi.java
+++ b/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRemoteApi.java
@@ -5,7 +5,7 @@
import com.intellij.tasks.TaskState;
import com.intellij.tasks.jira.rest.api2.JiraRestApi2;
import com.intellij.tasks.jira.rest.api20alpha1.JiraRestApi20Alpha1;
-import com.intellij.tasks.jira.soap.JiraSoapApi;
+import com.intellij.tasks.jira.soap.JiraLegacyApi;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -47,11 +47,11 @@
public abstract ApiType getType();
public enum ApiType {
- SOAP("SOAP") {
+ LEGACY("XML-RPC + RSS") {
@NotNull
@Override
- public JiraSoapApi createApi(@NotNull JiraRepository repository) {
- return new JiraSoapApi(repository);
+ public JiraLegacyApi createApi(@NotNull JiraRepository repository) {
+ return new JiraLegacyApi(repository);
}
},
REST_2_0("REST 2.0") {
diff --git a/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepository.java b/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepository.java
index c5a469a..b8004ca 100644
--- a/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepository.java
+++ b/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepository.java
@@ -15,23 +15,31 @@
import com.intellij.tasks.impl.TaskUtil;
import com.intellij.tasks.impl.gson.GsonUtil;
import com.intellij.tasks.jira.rest.JiraRestApi;
-import com.intellij.tasks.jira.soap.JiraSoapApi;
+import com.intellij.tasks.jira.soap.JiraLegacyApi;
import com.intellij.util.ArrayUtil;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.xmlb.annotations.Tag;
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.cookie.CookiePolicy;
import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.xmlrpc.CommonsXmlRpcTransport;
+import org.apache.xmlrpc.XmlRpcClient;
+import org.apache.xmlrpc.XmlRpcRequest;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.InputStream;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Hashtable;
import java.util.List;
+import java.util.Vector;
import java.util.regex.Pattern;
/**
* @author Dmitry Avdeev
*/
+@SuppressWarnings("UseOfObsoleteCollectionType")
@Tag("JIRA")
public class JiraRepository extends BaseRepositoryImpl {
@@ -51,6 +59,7 @@
private String mySearchQuery = TaskBundle.message("jira.default.query");
private JiraRemoteApi myApiVersion;
+ private String myJiraVersion;
/**
* Serialization constructor
@@ -69,6 +78,7 @@
private JiraRepository(JiraRepository other) {
super(other);
mySearchQuery = other.mySearchQuery;
+ myJiraVersion = other.myJiraVersion;
if (other.myApiVersion != null) {
myApiVersion = other.myApiVersion.getType().createApi(this);
}
@@ -77,8 +87,13 @@
@Override
public boolean equals(Object o) {
if (!super.equals(o)) return false;
- if (o.getClass() != getClass()) return false;
- return Comparing.equal(mySearchQuery, ((JiraRepository)o).mySearchQuery);
+ if (!(o instanceof JiraRepository)) return false;
+
+ JiraRepository repository = (JiraRepository)o;
+
+ if (!Comparing.equal(mySearchQuery, repository.getSearchQuery())) return false;
+ if (!Comparing.equal(myJiraVersion, repository.getJiraVersion())) return false;
+ return true;
}
@@ -149,7 +164,7 @@
public JiraRemoteApi discoverApiVersion() throws Exception {
if (LEGACY_API_ONLY) {
LOG.info("Intentionally using only legacy JIRA API");
- return new JiraSoapApi(this);
+ return createLegacyApi();
}
String responseBody;
@@ -164,7 +179,7 @@
// not the way to check it safely.
StatusLine status = method.getStatusLine();
if (status != null && status.getStatusCode() == HttpStatus.SC_NOT_FOUND) {
- return new JiraSoapApi(this);
+ return createLegacyApi();
}
else {
throw e;
@@ -173,13 +188,31 @@
JsonObject object = GSON.fromJson(responseBody, JsonObject.class);
// when JIRA 4.x support will be dropped 'versionNumber' array in response
// may be used instead version string parsing
- JiraRestApi restApi = JiraRestApi.fromJiraVersion(object.get("version").getAsString(), this);
+ myJiraVersion = object.get("version").getAsString();
+ JiraRestApi restApi = JiraRestApi.fromJiraVersion(myJiraVersion, this);
if (restApi == null) {
throw new Exception(TaskBundle.message("jira.failure.no.REST"));
}
return restApi;
}
+ private JiraLegacyApi createLegacyApi() {
+ try {
+ XmlRpcClient client = new XmlRpcClient(getUrl());
+ Vector<String> parameters = new Vector<String>(Collections.singletonList(""));
+ XmlRpcRequest request = new XmlRpcRequest("jira1.getServerInfo", parameters);
+ @SuppressWarnings("unchecked") Hashtable<String, Object> response =
+ (Hashtable<String, Object>)client.execute(request, new CommonsXmlRpcTransport(new URL(getUrl()), getHttpClient()));
+ if (response != null) {
+ myJiraVersion = (String)response.get("version");
+ }
+ }
+ catch (Exception e) {
+ LOG.error("Cannot find out JIRA version via XML-RPC", e);
+ }
+ return new JiraLegacyApi(this);
+ }
+
private void ensureApiVersionDiscovered() throws Exception {
if (myApiVersion == null || LEGACY_API_ONLY || REDISCOVER_API) {
myApiVersion = discoverApiVersion();
@@ -275,7 +308,7 @@
}
private boolean isRestApiSupported() {
- return myApiVersion != null && myApiVersion.getType() != JiraRemoteApi.ApiType.SOAP;
+ return myApiVersion != null && myApiVersion.getType() != JiraRemoteApi.ApiType.LEGACY;
}
public boolean isJqlSupported() {
@@ -322,6 +355,16 @@
}
}
+ @Nullable
+ public String getJiraVersion() {
+ return myJiraVersion;
+ }
+
+ @SuppressWarnings("UnusedDeclaration")
+ public void setJiraVersion(@Nullable String jiraVersion) {
+ myJiraVersion = jiraVersion;
+ }
+
public String getRestUrl(String... parts) {
return getUrl() + REST_API_PATH + "/" + StringUtil.join(parts, "/");
}
diff --git a/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepositoryEditor.java b/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepositoryEditor.java
index 3299ac4..a8ed1f8 100644
--- a/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepositoryEditor.java
+++ b/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepositoryEditor.java
@@ -16,7 +16,7 @@
package com.intellij.tasks.jira;
import com.intellij.openapi.project.Project;
-import com.intellij.tasks.TaskBundle;
+import com.intellij.openapi.util.text.StringUtil;
import com.intellij.tasks.config.BaseRepositoryEditor;
import com.intellij.tasks.jira.jql.JqlLanguage;
import com.intellij.ui.EditorTextField;
@@ -35,6 +35,7 @@
public class JiraRepositoryEditor extends BaseRepositoryEditor<JiraRepository> {
private EditorTextField mySearchQueryField;
private JBLabel mySearchLabel;
+ private JBLabel myNoteLabel;
public JiraRepositoryEditor(Project project, JiraRepository repository, Consumer<JiraRepository> changeListener) {
super(project, repository, changeListener);
@@ -53,6 +54,7 @@
if (connectionSuccessful) {
enableJqlSearchIfSupported();
}
+ updateNote();
}
@Nullable
@@ -62,14 +64,20 @@
enableJqlSearchIfSupported();
installListener(mySearchQueryField);
mySearchLabel = new JBLabel("Search:", SwingConstants.RIGHT);
- JBLabel note = new JBLabel(TaskBundle.message("jira.failure.no.JQL"));
- note.setComponentStyle(UIUtil.ComponentStyle.SMALL);
+ myNoteLabel = new JBLabel();
+ myNoteLabel.setComponentStyle(UIUtil.ComponentStyle.SMALL);
+ updateNote();
return FormBuilder.createFormBuilder()
.addLabeledComponent(mySearchLabel, mySearchQueryField)
- .addComponentToRightColumn(note)
+ .addComponentToRightColumn(myNoteLabel)
.getPanel();
}
+ private void updateNote() {
+ myNoteLabel.setText("JQL search cannot be used in JIRA versions prior 4.2. " +
+ String.format("Your version: %s.", StringUtil.notNullize(myRepository.getJiraVersion(), "unknown")));
+ }
+
@Override
public void setAnchor(@Nullable final JComponent anchor) {
super.setAnchor(anchor);
diff --git a/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/soap/JiraSoapApi.java b/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/soap/JiraLegacyApi.java
similarity index 93%
rename from plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/soap/JiraSoapApi.java
rename to plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/soap/JiraLegacyApi.java
index 1484329..e8cbee8 100644
--- a/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/soap/JiraSoapApi.java
+++ b/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/soap/JiraLegacyApi.java
@@ -22,18 +22,18 @@
import java.util.List;
/**
- * Legacy SOAP connector restored due to IDEA-120595.
+ * Legacy integration restored due to IDEA-120595.
*
* @author Mikhail Golubev
*/
-public class JiraSoapApi extends JiraRemoteApi {
+public class JiraLegacyApi extends JiraRemoteApi {
- private static final Logger LOG = Logger.getInstance(JiraSoapApi.class);
+ private static final Logger LOG = Logger.getInstance(JiraLegacyApi.class);
@NonNls private static final String RSS_SEARCH_PATH = "/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml";
public static final String RSS_ISSUE_PATH = "/si/jira.issueviews:issue-xml/";
- public JiraSoapApi(@NotNull JiraRepository repository) {
+ public JiraLegacyApi(@NotNull JiraRepository repository) {
super(repository);
}
@@ -99,7 +99,7 @@
@NotNull
@Override
public final ApiType getType() {
- return ApiType.SOAP;
+ return ApiType.LEGACY;
}
@Override
diff --git a/plugins/tasks/tasks-core/src/META-INF/plugin.xml b/plugins/tasks/tasks-core/src/META-INF/plugin.xml
index 36268b4..6f3ac82 100644
--- a/plugins/tasks/tasks-core/src/META-INF/plugin.xml
+++ b/plugins/tasks/tasks-core/src/META-INF/plugin.xml
@@ -103,7 +103,7 @@
<extensions defaultExtensionNs="com.intellij">
<errorHandler implementation="com.intellij.diagnostic.ITNReporter"/>
- <projectConfigurable instance="com.intellij.tasks.config.TaskConfigurable" id="tasks" displayName="Tasks" nonDefaultProject="true">
+ <projectConfigurable groupId="tools" instance="com.intellij.tasks.config.TaskConfigurable" id="tasks" displayName="Tasks" nonDefaultProject="true">
<configurable instance="com.intellij.tasks.config.TaskRepositoriesConfigurable" displayName="Servers" id="tasks.servers"/>
</projectConfigurable>
diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/TrelloRepository.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/TrelloRepository.java
index f7723a9..eafe341 100644
--- a/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/TrelloRepository.java
+++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/TrelloRepository.java
@@ -107,8 +107,8 @@
}
@Override
- public Task[] getIssues(@Nullable String query, int max, long since) throws Exception {
- List<TrelloCard> cards = fetchCards();
+ public Task[] getIssues(@Nullable String query, int offset, int limit, boolean withClosed) throws Exception {
+ List<TrelloCard> cards = fetchCards(offset + limit, withClosed);
return ContainerUtil.map2Array(cards, Task.class, new Function<TrelloCard, Task>() {
@Override
public Task fun(TrelloCard card) {
@@ -120,17 +120,24 @@
@Nullable
@Override
public Task findTask(@NotNull String id) throws Exception {
- String url = TRELLO_API_BASE_URL + "/cards/" + id + "?actions=commentCard&fields=" + encodeUrl(TrelloCard.REQUIRED_FIELDS) ;
+ TrelloCard card = fetchCardById(id);
+ return card != null ? new TrelloTask(card, this) : null;
+ }
+
+ @Nullable
+ public TrelloCard fetchCardById(@NotNull String id) throws Exception {
+ String url = TRELLO_API_BASE_URL + "/cards/" + id + "?actions=commentCard&fields=" + encodeUrl(TrelloCard.REQUIRED_FIELDS);
try {
- return new TrelloTask(makeRequestAndDeserializeJsonResponse(url, TrelloCard.class), this);
+ return makeRequestAndDeserializeJsonResponse(url, TrelloCard.class);
}
// Trello returns string "The requested resource was not found." or "invalid id"
- // if card can't be found
+ // if card can't be found, which not only cannot be deserialized, but also not valid JSON at all.
catch (JsonParseException e) {
return null;
}
}
+
@Nullable
public TrelloUser getCurrentUser() {
return myCurrentUser;
@@ -241,7 +248,7 @@
}
@NotNull
- private List<TrelloCard> fetchCards() throws Exception {
+ public List<TrelloCard> fetchCards(int limit, boolean withClosed) throws Exception {
boolean fromList = false;
// choose most appropriate card provider
String baseUrl;
@@ -258,8 +265,10 @@
else {
throw new IllegalStateException("Not configured");
}
- String allCardsUrl = baseUrl + "?filter=all&fields=" + encodeUrl(TrelloCard.REQUIRED_FIELDS);
- List<TrelloCard> cards = makeRequestAndDeserializeJsonResponse(allCardsUrl, TrelloUtil.LIST_OF_CARDS_TYPE);
+ String fetchCardsUrl = baseUrl + "?fields=" + encodeUrl(TrelloCard.REQUIRED_FIELDS) + "&limit" + limit;
+ // 'visible' filter for some reason is not supported for lists
+ fetchCardsUrl += withClosed || fromList ? "&filter=all" : "&filter=visible";
+ List<TrelloCard> cards = makeRequestAndDeserializeJsonResponse(fetchCardsUrl, TrelloUtil.LIST_OF_CARDS_TYPE);
LOG.debug("Total " + cards.size() + " cards downloaded");
if (!myIncludeAllCards) {
cards = ContainerUtil.filter(cards, new Condition<TrelloCard>() {
@@ -270,7 +279,10 @@
});
LOG.debug("Total " + cards.size() + " cards after filtering");
}
- if (!fromList) {
+ if (!cards.isEmpty()) {
+ if (fromList) {
+ baseUrl = TRELLO_API_BASE_URL + "/boards/" + cards.get(0).getIdBoard() + "/cards";
+ }
// fix for IDEA-111470 and IDEA-111475
// Select IDs of visible cards, e.d. cards that either archived explicitly, belong to archived list or closed board.
// This information can't be extracted from single card description, because its 'closed' field
diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/model/TrelloCard.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/model/TrelloCard.java
index f4fc18d..4aebd6a 100644
--- a/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/model/TrelloCard.java
+++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/model/TrelloCard.java
@@ -44,7 +44,6 @@
@SerializedName("desc")
private String description;
private String url;
- @SerializedName("due")
private boolean closed;
private Date dateLastActivity;
private List<TrelloLabel> labels;
@@ -91,7 +90,7 @@
}
@Override
- public void setName(String name) {
+ public void setName(@NotNull String name) {
this.name = name;
}
diff --git a/plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/live/LiveIntegrationTestCase.java b/plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/live/LiveIntegrationTestCase.java
new file mode 100644
index 0000000..c579350
--- /dev/null
+++ b/plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/live/LiveIntegrationTestCase.java
@@ -0,0 +1,22 @@
+package com.intellij.tasks.integration.live;
+
+import com.intellij.tasks.TaskManagerTestCase;
+import com.intellij.tasks.TaskRepository;
+
+/**
+ * @author Mikhail Golubev
+ */
+public abstract class LiveIntegrationTestCase<T extends TaskRepository> extends TaskManagerTestCase {
+ protected T myRepository;
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ myRepository = createRepository();
+ }
+
+ /**
+ * @return new instance of task repository <b>with authenticated user<b/>
+ */
+ protected abstract T createRepository() throws Exception;
+}
diff --git a/plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/live/TrelloIntegrationTest.java b/plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/live/TrelloIntegrationTest.java
new file mode 100644
index 0000000..3da6ad3
--- /dev/null
+++ b/plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/live/TrelloIntegrationTest.java
@@ -0,0 +1,142 @@
+package com.intellij.tasks.integration.live;
+
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.tasks.trello.TrelloRepository;
+import com.intellij.tasks.trello.TrelloRepositoryType;
+import com.intellij.tasks.trello.model.*;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author Mikhail Golubev
+ */
+public class TrelloIntegrationTest extends LiveIntegrationTestCase<TrelloRepository> {
+
+ private static final String BOARD_1_NAME = "Board 1";
+ private static final String BOARD_1_ID = "53c416a8a6e5a78753562043";
+
+ private static final String LIST_1_1_NAME = "List 1-1";
+ private static final String LIST_1_1_ID = "53c416a8a6e5a78753562044";
+
+ private static final String CARD_1_1_1_NAME = "Card 1-1-1";
+ private static final String CARD_1_1_1_ID = "53c416d8b4bd36fb078446e5";
+
+ @Override
+ protected TrelloRepository createRepository() throws Exception {
+ TrelloRepository repository = new TrelloRepository(new TrelloRepositoryType());
+ String token = System.getProperty("tasks.tests.trello.token");
+ if (StringUtil.isEmpty(token)) {
+ throw new AssertionError("Authorization token is not set");
+ }
+ repository.setPassword(token);
+ TrelloUser user = repository.fetchUserByToken();
+ assertNotNull(user);
+ repository.setCurrentUser(user);
+ return repository;
+ }
+
+ // TODO Check closed tasks exclusion
+ // TODO Check various cards visibility corner cases
+
+ public void testFetchBoard() throws Exception {
+ TrelloBoard board = myRepository.fetchBoardById(BOARD_1_ID);
+ assertNotNull(board);
+ assertEquals(BOARD_1_NAME, board.getName());
+ }
+
+ public void testFetchList() throws Exception {
+ TrelloList list = myRepository.fetchListById(LIST_1_1_ID);
+ assertNotNull(list);
+ assertEquals(LIST_1_1_NAME, list.getName());
+ }
+
+ public void testFetchCard() throws Exception {
+ TrelloCard card = myRepository.fetchCardById(CARD_1_1_1_ID);
+ assertNotNull(card);
+ assertEquals(CARD_1_1_1_NAME, card.getName());
+ }
+
+ public void testFetchBoardsOfUser() throws Exception {
+ List<TrelloBoard> boards = myRepository.fetchUserBoards();
+ assertEquals(2, boards.size());
+ assertObjectsNamed("All boards of the user should be included", boards, "Board 1", "Board 2");
+ }
+
+ public void testFetchListsOfBoard() throws Exception {
+ TrelloBoard selectedBoard = myRepository.fetchBoardById(BOARD_1_ID);
+ assertNotNull(selectedBoard);
+ myRepository.setCurrentBoard(selectedBoard);
+ List<TrelloList> lists = myRepository.fetchBoardLists();
+ assertEquals(3, lists.size());
+ assertObjectsNamed("All lists of the board should be included", lists, "List 1-1", "List 1-2", "List 1-3");
+ }
+
+ @NotNull
+ private List<TrelloCard> fetchCards(@Nullable String boardId, @Nullable String listId, boolean withClosed) throws Exception {
+ if (boardId != null) {
+ TrelloBoard selectedBoard = myRepository.fetchBoardById(BOARD_1_ID);
+ assertNotNull(selectedBoard);
+ myRepository.setCurrentBoard(selectedBoard);
+ }
+ if (listId != null) {
+ TrelloList selectedList = myRepository.fetchListById(LIST_1_1_ID);
+ assertNotNull(selectedList);
+ myRepository.setCurrentList(selectedList);
+ }
+ return myRepository.fetchCards(100, withClosed);
+ }
+
+ public void testFetchingCardsOfUser() throws Exception {
+ myRepository.setIncludeAllCards(true);
+ List<TrelloCard> cards = fetchCards(null, null, true);
+ assertObjectsNamed("All cards assigned to user should be included", cards, "Card 1-1-1");
+ }
+
+ public void testFetchingCardsOfBoard() throws Exception {
+ myRepository.setIncludeAllCards(true);
+ List<TrelloCard> cards = fetchCards(BOARD_1_ID, null, true);
+ assertObjectsNamed("All cards of the board should be included",
+ cards, "Card 1-1-1", "Card 1-1-2", "Card 1-2-1", "Card 1-3-1", "Archived Card");
+ }
+
+ public void testCardsFilteringByMembership() throws Exception {
+ myRepository.setIncludeAllCards(true);
+ List<TrelloCard> allCards = fetchCards(BOARD_1_ID, LIST_1_1_ID, true);
+ assertObjectsNamed("All cards of the list should be included", allCards, "Card 1-1-1", "Card 1-1-2", "Archived Card");
+
+ myRepository.setIncludeAllCards(false);
+ List<TrelloCard> assignedCards = fetchCards(BOARD_1_ID, LIST_1_1_ID, true);
+ assertObjectsNamed("Only cards of the list assigned to user should be included", assignedCards, "Card 1-1-1");
+ }
+
+ public void testCardsFilteringByStatus() throws Exception {
+ myRepository.setIncludeAllCards(true);
+ List<TrelloCard> allCards = fetchCards(BOARD_1_ID, LIST_1_1_NAME, true);
+ assertObjectsNamed("All cards of the list should be included", allCards, "Card 1-1-1", "Card 1-1-2", "Archived Card");
+
+ TrelloCard card = ContainerUtil.find(allCards, new Condition<TrelloCard>() {
+ @Override
+ public boolean value(TrelloCard card) {
+ return card.getName().equals("Archived Card");
+ }
+ });
+ assertNotNull(card);
+ assertTrue(card.isClosed());
+ assertFalse(card.isVisible());
+ }
+
+ static void assertObjectsNamed(@NotNull String message, @NotNull Collection<? extends TrelloModel> objects, @NotNull String... names) {
+ assertEquals(message, ContainerUtil.newHashSet(names), ContainerUtil.map2Set(objects, new Function<TrelloModel, String>() {
+ @Override
+ public String fun(TrelloModel model) {
+ return model.getName();
+ }
+ }));
+ }
+}
diff --git a/plugins/terminal/resources/META-INF/terminal.xml b/plugins/terminal/resources/META-INF/terminal.xml
index ed2a2b5..11a18e1 100644
--- a/plugins/terminal/resources/META-INF/terminal.xml
+++ b/plugins/terminal/resources/META-INF/terminal.xml
@@ -11,7 +11,7 @@
<toolWindow id="Terminal" anchor="bottom" icon="TerminalIcons.OpenTerminal_13x13"
factoryClass="org.jetbrains.plugins.terminal.TerminalToolWindowFactory" secondary="false"/>
- <projectConfigurable instance="org.jetbrains.plugins.terminal.TerminalOptionsConfigurable"/>
+ <projectConfigurable groupId="tools" displayName="Terminal" instance="org.jetbrains.plugins.terminal.TerminalOptionsConfigurable"/>
<fileEditorProvider implementation="org.jetbrains.plugins.terminal.vfs.TerminalSessionEditorProvider"/>
</extensions>
diff --git a/plugins/ui-designer/src/META-INF/plugin.xml b/plugins/ui-designer/src/META-INF/plugin.xml
index 6724c40..bca8934 100644
--- a/plugins/ui-designer/src/META-INF/plugin.xml
+++ b/plugins/ui-designer/src/META-INF/plugin.xml
@@ -33,7 +33,7 @@
<i18nInspectionTool implementation="com.intellij.uiDesigner.i18n.I18nFormInspection"/>
<java15InspectionTool implementation="com.intellij.uiDesigner.inspections.Java15FormInspection"/>
- <projectConfigurable instance="com.intellij.uiDesigner.GuiDesignerConfigurable" id="project.propGUI" key="title.gui.designer"
+ <projectConfigurable groupId="editor" instance="com.intellij.uiDesigner.GuiDesignerConfigurable" id="project.propGUI" key="title.gui.designer"
bundle="messages.UIDesignerBundle"/>
<favoriteNodeProvider implementation="com.intellij.uiDesigner.projectView.UIDesignerFavoriteNodeProvider"/>
diff --git a/plugins/xpath/xpath-view/src/META-INF/plugin.xml b/plugins/xpath/xpath-view/src/META-INF/plugin.xml
index 65a942a..2030b75 100644
--- a/plugins/xpath/xpath-view/src/META-INF/plugin.xml
+++ b/plugins/xpath/xpath-view/src/META-INF/plugin.xml
@@ -59,7 +59,7 @@
serviceInterface="org.intellij.lang.xpath.xslt.psi.XsltElementFactory"
serviceImplementation="org.intellij.lang.xpath.xslt.psi.impl.XsltElementFactoryImpl" />
- <projectConfigurable instance="org.intellij.lang.xpath.xslt.associations.impl.FileAssociationsConfigurable" id="xslt.associations" displayName="XSLT File Associations" nonDefaultProject="true" />
+ <projectConfigurable groupId="language" instance="org.intellij.lang.xpath.xslt.associations.impl.FileAssociationsConfigurable" id="xslt.associations" displayName="XSLT File Associations" nonDefaultProject="true" />
<projectService
serviceInterface="org.intellij.lang.xpath.xslt.associations.impl.FileAssociationsConfigurable$UIState"
@@ -137,8 +137,8 @@
<category>XSLT</category>
</intentionAction>
- <applicationConfigurable instance="org.intellij.plugins.xpathView.XPathConfigurable" id="xpath.settings" displayName="XPath Viewer" />
- <applicationConfigurable instance="org.intellij.lang.xpath.xslt.impl.XsltConfigImpl$UIImpl" id="settings.xslt"
+ <applicationConfigurable groupId="tools" instance="org.intellij.plugins.xpathView.XPathConfigurable" id="xpath.settings" displayName="XPath Viewer" />
+ <applicationConfigurable groupId="language" instance="org.intellij.lang.xpath.xslt.impl.XsltConfigImpl$UIImpl" id="settings.xslt"
displayName="XSLT"/>
<fileIconPatcher implementation="org.intellij.lang.xpath.xslt.impl.XsltIconProvider"/>
diff --git a/python/helpers/coverage/__init__.py b/python/helpers/coverage/__init__.py
index d8dbc0f..193b7a1 100644
--- a/python/helpers/coverage/__init__.py
+++ b/python/helpers/coverage/__init__.py
@@ -5,19 +5,13 @@
"""
-__version__ = "3.5" # see detailed history in CHANGES.txt
-
-__url__ = "http://nedbatchelder.com/code/coverage"
-if max(__version__).isalpha():
- # For pre-releases, use a version-specific URL.
- __url__ += "/" + __version__
+from coverage.version import __version__, __url__
from coverage.control import coverage, process_startup
from coverage.data import CoverageData
from coverage.cmdline import main, CoverageScript
from coverage.misc import CoverageException
-
# Module-level functions. The original API to this module was based on
# functions defined directly in the module, with a singleton of the coverage()
# class. That design hampered programmability, so the current api uses
@@ -36,12 +30,34 @@
called.
"""
+ # Disable pylint msg W0612, because a bunch of variables look unused, but
+ # they're accessed via locals().
+ # pylint: disable=W0612
+
def wrapper(*args, **kwargs):
"""Singleton wrapper around a coverage method."""
global _the_coverage
if not _the_coverage:
_the_coverage = coverage(auto_data=True)
return getattr(_the_coverage, name)(*args, **kwargs)
+
+ import inspect
+ meth = getattr(coverage, name)
+ args, varargs, kw, defaults = inspect.getargspec(meth)
+ argspec = inspect.formatargspec(args[1:], varargs, kw, defaults)
+ docstring = meth.__doc__
+ wrapper.__doc__ = ("""\
+ A first-use-singleton wrapper around coverage.%(name)s.
+
+ This wrapper is provided for backward compatibility with legacy code.
+ New code should use coverage.%(name)s directly.
+
+ %(name)s%(argspec)s:
+
+ %(docstring)s
+ """ % locals()
+ )
+
return wrapper
@@ -57,10 +73,26 @@
annotate = _singleton_method('annotate')
+# On Windows, we encode and decode deep enough that something goes wrong and
+# the encodings.utf_8 module is loaded and then unloaded, I don't know why.
+# Adding a reference here prevents it from being unloaded. Yuk.
+import encodings.utf_8
+
+# Because of the "from coverage.control import fooey" lines at the top of the
+# file, there's an entry for coverage.coverage in sys.modules, mapped to None.
+# This makes some inspection tools (like pydoc) unable to find the class
+# coverage.coverage. So remove that entry.
+import sys
+try:
+ del sys.modules['coverage.coverage']
+except KeyError:
+ pass
+
+
# COPYRIGHT AND LICENSE
#
# Copyright 2001 Gareth Rees. All rights reserved.
-# Copyright 2004-2010 Ned Batchelder. All rights reserved.
+# Copyright 2004-2013 Ned Batchelder. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
diff --git a/python/helpers/coverage/__main__.py b/python/helpers/coverage/__main__.py
index af5fa9f..55e0d25 100644
--- a/python/helpers/coverage/__main__.py
+++ b/python/helpers/coverage/__main__.py
@@ -1,3 +1,4 @@
-"""Coverage.py's main entrypoint."""
+"""Coverage.py's main entry point."""
+import sys
from coverage.cmdline import main
-main()
+sys.exit(main())
diff --git a/python/helpers/coverage/annotate.py b/python/helpers/coverage/annotate.py
index a556d85..5c39678 100644
--- a/python/helpers/coverage/annotate.py
+++ b/python/helpers/coverage/annotate.py
@@ -2,6 +2,7 @@
import os, re
+from coverage.backward import sorted # pylint: disable=W0622
from coverage.report import Reporter
class AnnotateReporter(Reporter):
@@ -26,20 +27,20 @@
"""
- def __init__(self, coverage, ignore_errors=False):
- super(AnnotateReporter, self).__init__(coverage, ignore_errors)
+ def __init__(self, coverage, config):
+ super(AnnotateReporter, self).__init__(coverage, config)
self.directory = None
blank_re = re.compile(r"\s*(#|$)")
else_re = re.compile(r"\s*else\s*:\s*(#|$)")
- def report(self, morfs, config, directory=None):
+ def report(self, morfs, directory=None):
"""Run the report.
See `coverage.report()` for arguments.
"""
- self.report_files(self.annotate_file, morfs, config, directory)
+ self.report_files(self.annotate_file, morfs, directory)
def annotate_file(self, cu, analysis):
"""Annotate a single file.
@@ -59,9 +60,9 @@
dest_file = filename + ",cover"
dest = open(dest_file, 'w')
- statements = analysis.statements
- missing = analysis.missing
- excluded = analysis.excluded
+ statements = sorted(analysis.statements)
+ missing = sorted(analysis.missing)
+ excluded = sorted(analysis.excluded)
lineno = 0
i = 0
diff --git a/python/helpers/coverage/backward.py b/python/helpers/coverage/backward.py
index f0a34ac..7d26854 100644
--- a/python/helpers/coverage/backward.py
+++ b/python/helpers/coverage/backward.py
@@ -6,7 +6,7 @@
# W0611: Unused import blah
# W0622: Redefining built-in blah
-import os, sys
+import os, re, sys
# Python 2.3 doesn't have `set`
try:
@@ -24,6 +24,31 @@
lst.sort()
return lst
+# Python 2.3 doesn't have `reversed`.
+try:
+ reversed = reversed
+except NameError:
+ def reversed(iterable):
+ """A 2.3-compatible implementation of `reversed`."""
+ lst = list(iterable)
+ return lst[::-1]
+
+# rpartition is new in 2.5
+try:
+ "".rpartition
+except AttributeError:
+ def rpartition(s, sep):
+ """Implement s.rpartition(sep) for old Pythons."""
+ i = s.rfind(sep)
+ if i == -1:
+ return ('', '', s)
+ else:
+ return (s[:i], sep, s[i+len(sep):])
+else:
+ def rpartition(s, sep):
+ """A common interface for new Pythons."""
+ return s.rpartition(sep)
+
# Pythons 2 and 3 differ on where to get StringIO
try:
from cStringIO import StringIO
@@ -49,6 +74,18 @@
except NameError:
range = range
+# A function to iterate listlessly over a dict's items.
+try:
+ {}.iteritems
+except AttributeError:
+ def iitems(d):
+ """Produce the items from dict `d`."""
+ return d.items()
+else:
+ def iitems(d):
+ """Produce the items from dict `d`."""
+ return d.iteritems()
+
# Exec is a statement in Py2, a function in Py3
if sys.version_info >= (3, 0):
def exec_code_object(code, global_map):
@@ -66,21 +103,32 @@
)
)
-# ConfigParser was renamed to the more-standard configparser
-try:
- import configparser
-except ImportError:
- import ConfigParser as configparser
-
-# Python 3.2 provides `tokenize.open`, the best way to open source files.
-try:
+# Reading Python source and interpreting the coding comment is a big deal.
+if sys.version_info >= (3, 0):
+ # Python 3.2 provides `tokenize.open`, the best way to open source files.
import tokenize
- open_source = tokenize.open # pylint: disable=E1101
-except AttributeError:
+ try:
+ open_source = tokenize.open # pylint: disable=E1101
+ except AttributeError:
+ from io import TextIOWrapper
+ detect_encoding = tokenize.detect_encoding # pylint: disable=E1101
+ # Copied from the 3.2 stdlib:
+ def open_source(fname):
+ """Open a file in read only mode using the encoding detected by
+ detect_encoding().
+ """
+ buffer = open(fname, 'rb')
+ encoding, _ = detect_encoding(buffer.readline)
+ buffer.seek(0)
+ text = TextIOWrapper(buffer, encoding, line_buffering=True)
+ text.mode = 'r'
+ return text
+else:
def open_source(fname):
"""Open a source file the best way."""
return open(fname, "rU")
+
# Python 3.x is picky about bytes and strings, so provide methods to
# get them right, and make them no-ops in 2.x
if sys.version_info >= (3, 0):
@@ -92,6 +140,19 @@
"""Convert bytes `b` to a string."""
return b.decode('utf8')
+ def binary_bytes(byte_values):
+ """Produce a byte string with the ints from `byte_values`."""
+ return bytes(byte_values)
+
+ def byte_to_int(byte_value):
+ """Turn an element of a bytes object into an int."""
+ return byte_value
+
+ def bytes_to_ints(bytes_value):
+ """Turn a bytes object into a sequence of ints."""
+ # In Py3, iterating bytes gives ints.
+ return bytes_value
+
else:
def to_bytes(s):
"""Convert string `s` to bytes (no-op in 2.x)."""
@@ -101,6 +162,19 @@
"""Convert bytes `b` to a string (no-op in 2.x)."""
return b
+ def binary_bytes(byte_values):
+ """Produce a byte string with the ints from `byte_values`."""
+ return "".join([chr(b) for b in byte_values])
+
+ def byte_to_int(byte_value):
+ """Turn an element of a bytes object into an int."""
+ return ord(byte_value)
+
+ def bytes_to_ints(bytes_value):
+ """Turn a bytes object into a sequence of ints."""
+ for byte in bytes_value:
+ yield ord(byte)
+
# Md5 is available in different places.
try:
import hashlib
diff --git a/python/helpers/coverage/bytecode.py b/python/helpers/coverage/bytecode.py
index ab522d6..8536063 100644
--- a/python/helpers/coverage/bytecode.py
+++ b/python/helpers/coverage/bytecode.py
@@ -1,14 +1,25 @@
"""Bytecode manipulation for coverage.py"""
-import opcode, sys, types
+import opcode, types
+
+from coverage.backward import byte_to_int
class ByteCode(object):
"""A single bytecode."""
def __init__(self):
+ # The offset of this bytecode in the code object.
self.offset = -1
+
+ # The opcode, defined in the `opcode` module.
self.op = -1
+
+ # The argument, a small integer, whose meaning depends on the opcode.
self.arg = -1
+
+ # The offset in the code object of the next bytecode.
self.next_offset = -1
+
+ # The offset to jump to.
self.jump_to = -1
@@ -18,44 +29,34 @@
Returns `ByteCode` objects.
"""
+ # pylint: disable=R0924
def __init__(self, code):
self.code = code
- self.offset = 0
- if sys.version_info >= (3, 0):
- def __getitem__(self, i):
- return self.code[i]
- else:
- def __getitem__(self, i):
- return ord(self.code[i])
+ def __getitem__(self, i):
+ return byte_to_int(self.code[i])
def __iter__(self):
- return self
+ offset = 0
+ while offset < len(self.code):
+ bc = ByteCode()
+ bc.op = self[offset]
+ bc.offset = offset
- def __next__(self):
- if self.offset >= len(self.code):
- raise StopIteration
+ next_offset = offset+1
+ if bc.op >= opcode.HAVE_ARGUMENT:
+ bc.arg = self[offset+1] + 256*self[offset+2]
+ next_offset += 2
- bc = ByteCode()
- bc.op = self[self.offset]
- bc.offset = self.offset
+ label = -1
+ if bc.op in opcode.hasjrel:
+ label = next_offset + bc.arg
+ elif bc.op in opcode.hasjabs:
+ label = bc.arg
+ bc.jump_to = label
- next_offset = self.offset+1
- if bc.op >= opcode.HAVE_ARGUMENT:
- bc.arg = self[self.offset+1] + 256*self[self.offset+2]
- next_offset += 2
-
- label = -1
- if bc.op in opcode.hasjrel:
- label = next_offset + bc.arg
- elif bc.op in opcode.hasjabs:
- label = bc.arg
- bc.jump_to = label
-
- bc.next_offset = self.offset = next_offset
- return bc
-
- next = __next__ # Py2k uses an old-style non-dunder name.
+ bc.next_offset = offset = next_offset
+ yield bc
class CodeObjects(object):
@@ -64,18 +65,11 @@
self.stack = [code]
def __iter__(self):
- return self
-
- def __next__(self):
- if self.stack:
+ while self.stack:
# We're going to return the code object on the stack, but first
# push its children for later returning.
code = self.stack.pop()
for c in code.co_consts:
if isinstance(c, types.CodeType):
self.stack.append(c)
- return code
-
- raise StopIteration
-
- next = __next__
+ yield code
diff --git a/python/helpers/coverage/cmdline.py b/python/helpers/coverage/cmdline.py
index 1ce5e0f..ea112a8 100644
--- a/python/helpers/coverage/cmdline.py
+++ b/python/helpers/coverage/cmdline.py
@@ -1,10 +1,11 @@
"""Command-line support for Coverage."""
-import optparse, re, sys, traceback
+import optparse, os, sys, time, traceback
from coverage.backward import sorted # pylint: disable=W0622
from coverage.execfile import run_python_file, run_python_module
from coverage.misc import CoverageException, ExceptionDuringRun, NoSource
+from coverage.debug import info_formatter
class Opts(object):
@@ -19,11 +20,18 @@
'', '--branch', action='store_true',
help="Measure branch coverage in addition to statement coverage."
)
+ debug = optparse.make_option(
+ '', '--debug', action='store', metavar="OPTS",
+ help="Debug options, separated by commas"
+ )
directory = optparse.make_option(
- '-d', '--directory', action='store',
- metavar="DIR",
+ '-d', '--directory', action='store', metavar="DIR",
help="Write the output files to DIR."
)
+ fail_under = optparse.make_option(
+ '', '--fail-under', action='store', metavar="MIN", type="int",
+ help="Exit with a status of 2 if the total coverage is less than MIN."
+ )
help = optparse.make_option(
'-h', '--help', action='store_true',
help="Get help on this command."
@@ -89,6 +97,10 @@
help="Use a simpler but slower trace method. Try this if you get "
"seemingly impossible results!"
)
+ title = optparse.make_option(
+ '', '--title', action='store', metavar="TITLE",
+ help="A text string to use as the title on the HTML."
+ )
version = optparse.make_option(
'', '--version', action='store_true',
help="Display version information and exit."
@@ -110,7 +122,9 @@
self.set_defaults(
actions=[],
branch=None,
+ debug=None,
directory=None,
+ fail_under=None,
help=None,
ignore_errors=None,
include=None,
@@ -122,6 +136,7 @@
show_missing=None,
source=None,
timid=None,
+ title=None,
erase_first=None,
version=None,
)
@@ -273,9 +288,11 @@
'html': CmdOptionParser("html",
[
Opts.directory,
+ Opts.fail_under,
Opts.ignore_errors,
Opts.omit,
Opts.include,
+ Opts.title,
] + GLOBAL_ARGS,
usage = "[options] [modules]",
description = "Create an HTML report of the coverage of the files. "
@@ -285,6 +302,7 @@
'report': CmdOptionParser("report",
[
+ Opts.fail_under,
Opts.ignore_errors,
Opts.omit,
Opts.include,
@@ -298,6 +316,7 @@
[
Opts.append,
Opts.branch,
+ Opts.debug,
Opts.pylib,
Opts.parallel_mode,
Opts.module,
@@ -314,20 +333,20 @@
'xml': CmdOptionParser("xml",
[
+ Opts.fail_under,
Opts.ignore_errors,
Opts.omit,
Opts.include,
Opts.output_xml,
] + GLOBAL_ARGS,
cmd = "xml",
- defaults = {'outfile': 'coverage.xml'},
usage = "[options] [modules]",
description = "Generate an XML report of coverage results."
),
}
-OK, ERR = 0, 1
+OK, ERR, FAIL_UNDER = 0, 1, 2
class CoverageScript(object):
@@ -346,27 +365,10 @@
self.run_python_file = _run_python_file or run_python_file
self.run_python_module = _run_python_module or run_python_module
self.help_fn = _help_fn or self.help
+ self.classic = False
self.coverage = None
- def help(self, error=None, topic=None, parser=None):
- """Display an error message, or the named topic."""
- assert error or topic or parser
- if error:
- print(error)
- print("Use 'coverage help' for help.")
- elif parser:
- print(parser.format_help().strip())
- else:
- # Parse out the topic we want from HELP_TOPICS
- topic_list = re.split("(?m)^=+ (\w+) =+$", HELP_TOPICS)
- topics = dict(zip(topic_list[1::2], topic_list[2::2]))
- help_msg = topics.get(topic, '').strip()
- if help_msg:
- print(help_msg % self.covpkg.__dict__)
- else:
- print("Don't know topic %r" % topic)
-
def command_line(self, argv):
"""The bulk of the command line interface to Coverage.
@@ -376,15 +378,14 @@
"""
# Collect the command-line options.
-
if not argv:
self.help_fn(topic='minimum_help')
return OK
# The command syntax we parse depends on the first argument. Classic
# syntax always starts with an option.
- classic = argv[0].startswith('-')
- if classic:
+ self.classic = argv[0].startswith('-')
+ if self.classic:
parser = ClassicOptionParser()
else:
parser = CMDS.get(argv[0])
@@ -398,64 +399,19 @@
if not ok:
return ERR
- # Handle help.
- if options.help:
- if classic:
- self.help_fn(topic='help')
- else:
- self.help_fn(parser=parser)
- return OK
-
- if "help" in options.actions:
- if args:
- for a in args:
- parser = CMDS.get(a)
- if parser:
- self.help_fn(parser=parser)
- else:
- self.help_fn(topic=a)
- else:
- self.help_fn(topic='help')
- return OK
-
- # Handle version.
- if options.version:
- self.help_fn(topic='version')
+ # Handle help and version.
+ if self.do_help(options, args, parser):
return OK
# Check for conflicts and problems in the options.
- for i in ['erase', 'execute']:
- for j in ['annotate', 'html', 'report', 'combine']:
- if (i in options.actions) and (j in options.actions):
- self.help_fn("You can't specify the '%s' and '%s' "
- "options at the same time." % (i, j))
- return ERR
-
- if not options.actions:
- self.help_fn(
- "You must specify at least one of -e, -x, -c, -r, -a, or -b."
- )
- return ERR
- args_allowed = (
- 'execute' in options.actions or
- 'annotate' in options.actions or
- 'html' in options.actions or
- 'debug' in options.actions or
- 'report' in options.actions or
- 'xml' in options.actions
- )
- if not args_allowed and args:
- self.help_fn("Unexpected arguments: %s" % " ".join(args))
- return ERR
-
- if 'execute' in options.actions and not args:
- self.help_fn("Nothing to do.")
+ if not self.args_ok(options, args):
return ERR
# Listify the list options.
source = unshell_list(options.source)
omit = unshell_list(options.omit)
include = unshell_list(options.include)
+ debug = unshell_list(options.debug)
# Do something.
self.coverage = self.covpkg.coverage(
@@ -467,41 +423,11 @@
source = source,
omit = omit,
include = include,
+ debug = debug,
)
if 'debug' in options.actions:
- if not args:
- self.help_fn("What information would you like: data, sys?")
- return ERR
- for info in args:
- if info == 'sys':
- print("-- sys ----------------------------------------")
- for label, info in self.coverage.sysinfo():
- if info == []:
- info = "-none-"
- if isinstance(info, list):
- print("%15s:" % label)
- for e in info:
- print("%15s %s" % ("", e))
- else:
- print("%15s: %s" % (label, info))
- elif info == 'data':
- print("-- data ---------------------------------------")
- self.coverage.load()
- print("path: %s" % self.coverage.data.filename)
- print("has_arcs: %r" % self.coverage.data.has_arcs())
- summary = self.coverage.data.summary(fullpath=True)
- if summary:
- filenames = sorted(summary.keys())
- print("\n%d files:" % len(filenames))
- for f in filenames:
- print("%s: %d lines" % (f, summary[f]))
- else:
- print("No data collected")
- else:
- self.help_fn("Don't know what you mean by %r" % info)
- return ERR
- return OK
+ return self.do_debug(args)
if 'erase' in options.actions or options.erase_first:
self.coverage.erase()
@@ -509,22 +435,7 @@
self.coverage.load()
if 'execute' in options.actions:
- # Run the script.
- self.coverage.start()
- code_ran = True
- try:
- try:
- if options.module:
- self.run_python_module(args[0], args)
- else:
- self.run_python_file(args[0], args)
- except NoSource:
- code_ran = False
- raise
- finally:
- if code_ran:
- self.coverage.stop()
- self.coverage.save()
+ self.do_execute(options, args)
if 'combine' in options.actions:
self.coverage.combine()
@@ -539,18 +450,167 @@
)
if 'report' in options.actions:
- self.coverage.report(
+ total = self.coverage.report(
show_missing=options.show_missing, **report_args)
if 'annotate' in options.actions:
self.coverage.annotate(
directory=options.directory, **report_args)
if 'html' in options.actions:
- self.coverage.html_report(
- directory=options.directory, **report_args)
+ total = self.coverage.html_report(
+ directory=options.directory, title=options.title,
+ **report_args)
if 'xml' in options.actions:
outfile = options.outfile
- self.coverage.xml_report(outfile=outfile, **report_args)
+ total = self.coverage.xml_report(outfile=outfile, **report_args)
+ if options.fail_under is not None:
+ if total >= options.fail_under:
+ return OK
+ else:
+ return FAIL_UNDER
+ else:
+ return OK
+
+ def help(self, error=None, topic=None, parser=None):
+ """Display an error message, or the named topic."""
+ assert error or topic or parser
+ if error:
+ print(error)
+ print("Use 'coverage help' for help.")
+ elif parser:
+ print(parser.format_help().strip())
+ else:
+ help_msg = HELP_TOPICS.get(topic, '').strip()
+ if help_msg:
+ print(help_msg % self.covpkg.__dict__)
+ else:
+ print("Don't know topic %r" % topic)
+
+ def do_help(self, options, args, parser):
+ """Deal with help requests.
+
+ Return True if it handled the request, False if not.
+
+ """
+ # Handle help.
+ if options.help:
+ if self.classic:
+ self.help_fn(topic='help')
+ else:
+ self.help_fn(parser=parser)
+ return True
+
+ if "help" in options.actions:
+ if args:
+ for a in args:
+ parser = CMDS.get(a)
+ if parser:
+ self.help_fn(parser=parser)
+ else:
+ self.help_fn(topic=a)
+ else:
+ self.help_fn(topic='help')
+ return True
+
+ # Handle version.
+ if options.version:
+ self.help_fn(topic='version')
+ return True
+
+ return False
+
+ def args_ok(self, options, args):
+ """Check for conflicts and problems in the options.
+
+ Returns True if everything is ok, or False if not.
+
+ """
+ for i in ['erase', 'execute']:
+ for j in ['annotate', 'html', 'report', 'combine']:
+ if (i in options.actions) and (j in options.actions):
+ self.help_fn("You can't specify the '%s' and '%s' "
+ "options at the same time." % (i, j))
+ return False
+
+ if not options.actions:
+ self.help_fn(
+ "You must specify at least one of -e, -x, -c, -r, -a, or -b."
+ )
+ return False
+ args_allowed = (
+ 'execute' in options.actions or
+ 'annotate' in options.actions or
+ 'html' in options.actions or
+ 'debug' in options.actions or
+ 'report' in options.actions or
+ 'xml' in options.actions
+ )
+ if not args_allowed and args:
+ self.help_fn("Unexpected arguments: %s" % " ".join(args))
+ return False
+
+ if 'execute' in options.actions and not args:
+ self.help_fn("Nothing to do.")
+ return False
+
+ return True
+
+ def do_execute(self, options, args):
+ """Implementation of 'coverage run'."""
+
+ # Set the first path element properly.
+ old_path0 = sys.path[0]
+
+ # Run the script.
+ self.coverage.start()
+ code_ran = True
+ try:
+ try:
+ if options.module:
+ sys.path[0] = ''
+ self.run_python_module(args[0], args)
+ else:
+ filename = args[0]
+ sys.path[0] = os.path.abspath(os.path.dirname(filename))
+ self.run_python_file(filename, args)
+ except NoSource:
+ code_ran = False
+ raise
+ finally:
+ self.coverage.stop()
+ if code_ran:
+ self.coverage.save()
+
+ # Restore the old path
+ sys.path[0] = old_path0
+
+ def do_debug(self, args):
+ """Implementation of 'coverage debug'."""
+
+ if not args:
+ self.help_fn("What information would you like: data, sys?")
+ return ERR
+ for info in args:
+ if info == 'sys':
+ print("-- sys ----------------------------------------")
+ for line in info_formatter(self.coverage.sysinfo()):
+ print(" %s" % line)
+ elif info == 'data':
+ print("-- data ---------------------------------------")
+ self.coverage.load()
+ print("path: %s" % self.coverage.data.filename)
+ print("has_arcs: %r" % self.coverage.data.has_arcs())
+ summary = self.coverage.data.summary(fullpath=True)
+ if summary:
+ filenames = sorted(summary.keys())
+ print("\n%d files:" % len(filenames))
+ for f in filenames:
+ print("%s: %d lines" % (f, summary[f]))
+ else:
+ print("No data collected")
+ else:
+ self.help_fn("Don't know what you mean by %r" % info)
+ return ERR
return OK
@@ -568,10 +628,10 @@
return s.split(',')
-HELP_TOPICS = r"""
-
-== classic ====================================================================
-Coverage.py version %(__version__)s
+HELP_TOPICS = {
+# -------------------------
+'classic':
+r"""Coverage.py version %(__version__)s
Measure, collect, and report on code coverage in Python programs.
Usage:
@@ -615,8 +675,9 @@
Coverage data is saved in the file .coverage by default. Set the
COVERAGE_FILE environment variable to save it somewhere else.
-
-== help =======================================================================
+""",
+# -------------------------
+'help': """\
Coverage.py, version %(__version__)s
Measure, collect, and report on code coverage in Python programs.
@@ -635,26 +696,32 @@
Use "coverage help <command>" for detailed help on any command.
Use "coverage help classic" for help on older command syntax.
For more information, see %(__url__)s
-
-== minimum_help ===============================================================
+""",
+# -------------------------
+'minimum_help': """\
Code coverage for Python. Use 'coverage help' for help.
-
-== version ====================================================================
+""",
+# -------------------------
+'version': """\
Coverage.py, version %(__version__)s. %(__url__)s
-
-"""
+""",
+}
def main(argv=None):
- """The main entrypoint to Coverage.
+ """The main entry point to Coverage.
- This is installed as the script entrypoint.
+ This is installed as the script entry point.
"""
if argv is None:
argv = sys.argv[1:]
try:
+ start = time.clock()
status = CoverageScript().command_line(argv)
+ end = time.clock()
+ if 0:
+ print("time: %.3fs" % (end - start))
except ExceptionDuringRun:
# An exception was caught while running the product code. The
# sys.exc_info() return tuple is packed into an ExceptionDuringRun
diff --git a/python/helpers/coverage/codeunit.py b/python/helpers/coverage/codeunit.py
index 55f44a2..ca1ae5c 100644
--- a/python/helpers/coverage/codeunit.py
+++ b/python/helpers/coverage/codeunit.py
@@ -52,8 +52,10 @@
else:
f = morf
# .pyc files should always refer to a .py instead.
- if f.endswith('.pyc'):
+ if f.endswith('.pyc') or f.endswith('.pyo'):
f = f[:-1]
+ elif f.endswith('$py.class'): # Jython
+ f = f[:-9] + ".py"
self.filename = self.file_locator.canonical_filename(f)
if hasattr(morf, '__name__'):
@@ -77,12 +79,18 @@
# Annoying comparison operators. Py3k wants __lt__ etc, and Py2k needs all
# of them defined.
- def __lt__(self, other): return self.name < other.name
- def __le__(self, other): return self.name <= other.name
- def __eq__(self, other): return self.name == other.name
- def __ne__(self, other): return self.name != other.name
- def __gt__(self, other): return self.name > other.name
- def __ge__(self, other): return self.name >= other.name
+ def __lt__(self, other):
+ return self.name < other.name
+ def __le__(self, other):
+ return self.name <= other.name
+ def __eq__(self, other):
+ return self.name == other.name
+ def __ne__(self, other):
+ return self.name != other.name
+ def __gt__(self, other):
+ return self.name > other.name
+ def __ge__(self, other):
+ return self.name >= other.name
def flat_rootname(self):
"""A base for a flat filename to correspond to this code unit.
@@ -113,5 +121,25 @@
# Couldn't find source.
raise CoverageException(
- "No source for code %r." % self.filename
+ "No source for code '%s'." % self.filename
)
+
+ def should_be_python(self):
+ """Does it seem like this file should contain Python?
+
+ This is used to decide if a file reported as part of the exection of
+ a program was really likely to have contained Python in the first
+ place.
+
+ """
+ # Get the file extension.
+ _, ext = os.path.splitext(self.filename)
+
+ # Anything named *.py* should be Python.
+ if ext.startswith('.py'):
+ return True
+ # A file with no extension should be Python.
+ if not ext:
+ return True
+ # Everything else is probably not Python.
+ return False
diff --git a/python/helpers/coverage/collector.py b/python/helpers/coverage/collector.py
index 9c40d16..8ba7d87 100644
--- a/python/helpers/coverage/collector.py
+++ b/python/helpers/coverage/collector.py
@@ -1,13 +1,24 @@
"""Raw data collector for Coverage."""
-import sys, threading
+import os, sys, threading
try:
# Use the C extension code when we can, for speed.
- from coverage.tracer import Tracer
+ from coverage.tracer import CTracer # pylint: disable=F0401,E0611
except ImportError:
# Couldn't import the C extension, maybe it isn't built.
- Tracer = None
+ if os.getenv('COVERAGE_TEST_TRACER') == 'c':
+ # During testing, we use the COVERAGE_TEST_TRACER env var to indicate
+ # that we've fiddled with the environment to test this fallback code.
+ # If we thought we had a C tracer, but couldn't import it, then exit
+ # quickly and clearly instead of dribbling confusing errors. I'm using
+ # sys.exit here instead of an exception because an exception here
+ # causes all sorts of other noise in unittest.
+ sys.stderr.write(
+ "*** COVERAGE_TEST_TRACER is 'c' but can't import CTracer!\n"
+ )
+ sys.exit(1)
+ CTracer = None
class PyTracer(object):
@@ -40,12 +51,19 @@
self.last_exc_back = None
self.last_exc_firstlineno = 0
self.arcs = False
+ self.thread = None
+ self.stopped = False
def _trace(self, frame, event, arg_unused):
"""The trace function passed to sys.settrace."""
- #print("trace event: %s %r @%d" % (
- # event, frame.f_code.co_filename, frame.f_lineno))
+ if self.stopped:
+ return
+
+ if 0:
+ sys.stderr.write("trace event: %s %r @%d\n" % (
+ event, frame.f_code.co_filename, frame.f_lineno
+ ))
if self.last_exc_back:
if frame == self.last_exc_back:
@@ -61,10 +79,11 @@
# in this file.
self.data_stack.append((self.cur_file_data, self.last_line))
filename = frame.f_code.co_filename
- tracename = self.should_trace_cache.get(filename)
- if tracename is None:
+ if filename not in self.should_trace_cache:
tracename = self.should_trace(filename, frame)
self.should_trace_cache[filename] = tracename
+ else:
+ tracename = self.should_trace_cache[filename]
#print("called, stack is %d deep, tracename is %r" % (
# len(self.data_stack), tracename))
if tracename:
@@ -105,15 +124,24 @@
Return a Python function suitable for use with sys.settrace().
"""
+ self.thread = threading.currentThread()
sys.settrace(self._trace)
return self._trace
def stop(self):
"""Stop this Tracer."""
+ self.stopped = True
+ if self.thread != threading.currentThread():
+ # Called on a different thread than started us: we can't unhook
+ # ourseves, but we've set the flag that we should stop, so we won't
+ # do any more tracing.
+ return
+
if hasattr(sys, "gettrace") and self.warn:
if sys.gettrace() != self._trace:
msg = "Trace function changed, measurement is likely wrong: %r"
- self.warn(msg % sys.gettrace())
+ self.warn(msg % (sys.gettrace(),))
+ #print("Stopping tracer on %s" % threading.current_thread().ident)
sys.settrace(None)
def get_stats(self):
@@ -146,7 +174,7 @@
"""Create a collector.
`should_trace` is a function, taking a filename, and returning a
- canonicalized filename, or False depending on whether the file should
+ canonicalized filename, or None depending on whether the file should
be traced or not.
If `timid` is true, then a slower simpler trace function will be
@@ -173,7 +201,7 @@
else:
# Being fast: use the C Tracer if it is available, else the Python
# trace function.
- self._trace_class = Tracer or PyTracer
+ self._trace_class = CTracer or PyTracer
def __repr__(self):
return "<Collector at 0x%x>" % id(self)
@@ -190,7 +218,7 @@
# A cache of the results from should_trace, the decision about whether
# to trace execution in a file. A dict of filename to (filename or
- # False).
+ # None).
self.should_trace_cache = {}
# Our active Tracers.
@@ -232,9 +260,29 @@
if self._collectors:
self._collectors[-1].pause()
self._collectors.append(self)
- #print >>sys.stderr, "Started: %r" % self._collectors
+ #print("Started: %r" % self._collectors, file=sys.stderr)
+
+ # Check to see whether we had a fullcoverage tracer installed.
+ traces0 = []
+ if hasattr(sys, "gettrace"):
+ fn0 = sys.gettrace()
+ if fn0:
+ tracer0 = getattr(fn0, '__self__', None)
+ if tracer0:
+ traces0 = getattr(tracer0, 'traces', [])
+
# Install the tracer on this thread.
- self._start_tracer()
+ fn = self._start_tracer()
+
+ for args in traces0:
+ (frame, event, arg), lineno = args
+ try:
+ fn(frame, event, arg, lineno=lineno)
+ except TypeError:
+ raise Exception(
+ "fullcoverage must be run with the C trace function."
+ )
+
# Install our installation tracer in threading, to jump start other
# threads.
threading.settrace(self._installation_trace)
diff --git a/python/helpers/coverage/config.py b/python/helpers/coverage/config.py
index 6b441dd..87318ff 100644
--- a/python/helpers/coverage/config.py
+++ b/python/helpers/coverage/config.py
@@ -1,7 +1,76 @@
"""Config file for coverage.py"""
-import os
-from coverage.backward import configparser # pylint: disable=W0622
+import os, re, sys
+from coverage.backward import string_class, iitems
+
+# In py3, # ConfigParser was renamed to the more-standard configparser
+try:
+ import configparser # pylint: disable=F0401
+except ImportError:
+ import ConfigParser as configparser
+
+
+class HandyConfigParser(configparser.RawConfigParser):
+ """Our specialization of ConfigParser."""
+
+ def read(self, filename):
+ """Read a filename as UTF-8 configuration data."""
+ kwargs = {}
+ if sys.version_info >= (3, 2):
+ kwargs['encoding'] = "utf-8"
+ return configparser.RawConfigParser.read(self, filename, **kwargs)
+
+ def get(self, *args, **kwargs):
+ v = configparser.RawConfigParser.get(self, *args, **kwargs)
+ def dollar_replace(m):
+ """Called for each $replacement."""
+ # Only one of the groups will have matched, just get its text.
+ word = [w for w in m.groups() if w is not None][0]
+ if word == "$":
+ return "$"
+ else:
+ return os.environ.get(word, '')
+
+ dollar_pattern = r"""(?x) # Use extended regex syntax
+ \$(?: # A dollar sign, then
+ (?P<v1>\w+) | # a plain word,
+ {(?P<v2>\w+)} | # or a {-wrapped word,
+ (?P<char>[$]) # or a dollar sign.
+ )
+ """
+ v = re.sub(dollar_pattern, dollar_replace, v)
+ return v
+
+ def getlist(self, section, option):
+ """Read a list of strings.
+
+ The value of `section` and `option` is treated as a comma- and newline-
+ separated list of strings. Each value is stripped of whitespace.
+
+ Returns the list of strings.
+
+ """
+ value_list = self.get(section, option)
+ values = []
+ for value_line in value_list.split('\n'):
+ for value in value_line.split(','):
+ value = value.strip()
+ if value:
+ values.append(value)
+ return values
+
+ def getlinelist(self, section, option):
+ """Read a list of full-line strings.
+
+ The value of `section` and `option` is treated as a newline-separated
+ list of strings. Each value is stripped of whitespace.
+
+ Returns the list of strings.
+
+ """
+ value_list = self.get(section, option)
+ return list(filter(None, value_list.split('\n')))
+
# The default line exclusion regexes
DEFAULT_EXCLUDE = [
@@ -29,9 +98,12 @@
operation of coverage.py.
"""
-
def __init__(self):
"""Initialize the configuration attributes to their defaults."""
+ # Metadata about the config.
+ self.attempted_config_files = []
+ self.config_files = []
+
# Defaults for [run]
self.branch = False
self.cover_pylib = False
@@ -39,6 +111,7 @@
self.parallel = False
self.timid = False
self.source = None
+ self.debug = []
# Defaults for [report]
self.exclude_list = DEFAULT_EXCLUDE[:]
@@ -48,13 +121,19 @@
self.partial_list = DEFAULT_PARTIAL[:]
self.partial_always_list = DEFAULT_PARTIAL_ALWAYS[:]
self.precision = 0
+ self.show_missing = False
# Defaults for [html]
self.html_dir = "htmlcov"
+ self.extra_css = None
+ self.html_title = "Coverage report"
# Defaults for [xml]
self.xml_output = "coverage.xml"
+ # Defaults for [paths]
+ self.paths = {}
+
def from_environment(self, env_var):
"""Read configuration from the `env_var` environment variable."""
# Timidity: for nose users, read an environment variable. This is a
@@ -64,93 +143,71 @@
if env:
self.timid = ('--timid' in env)
+ MUST_BE_LIST = ["omit", "include", "debug"]
+
def from_args(self, **kwargs):
"""Read config values from `kwargs`."""
- for k, v in kwargs.items():
+ for k, v in iitems(kwargs):
if v is not None:
+ if k in self.MUST_BE_LIST and isinstance(v, string_class):
+ v = [v]
setattr(self, k, v)
- def from_file(self, *files):
- """Read configuration from .rc files.
+ def from_file(self, filename):
+ """Read configuration from a .rc file.
- Each argument in `files` is a file name to read.
+ `filename` is a file name to read.
"""
- cp = configparser.RawConfigParser()
- cp.read(files)
+ self.attempted_config_files.append(filename)
+ cp = HandyConfigParser()
+ files_read = cp.read(filename)
+ if files_read is not None: # return value changed in 2.4
+ self.config_files.extend(files_read)
+
+ for option_spec in self.CONFIG_FILE_OPTIONS:
+ self.set_attr_from_config_option(cp, *option_spec)
+
+ # [paths] is special
+ if cp.has_section('paths'):
+ for option in cp.options('paths'):
+ self.paths[option] = cp.getlist('paths', option)
+
+ CONFIG_FILE_OPTIONS = [
# [run]
- if cp.has_option('run', 'branch'):
- self.branch = cp.getboolean('run', 'branch')
- if cp.has_option('run', 'cover_pylib'):
- self.cover_pylib = cp.getboolean('run', 'cover_pylib')
- if cp.has_option('run', 'data_file'):
- self.data_file = cp.get('run', 'data_file')
- if cp.has_option('run', 'include'):
- self.include = self.get_list(cp, 'run', 'include')
- if cp.has_option('run', 'omit'):
- self.omit = self.get_list(cp, 'run', 'omit')
- if cp.has_option('run', 'parallel'):
- self.parallel = cp.getboolean('run', 'parallel')
- if cp.has_option('run', 'source'):
- self.source = self.get_list(cp, 'run', 'source')
- if cp.has_option('run', 'timid'):
- self.timid = cp.getboolean('run', 'timid')
+ ('branch', 'run:branch', 'boolean'),
+ ('cover_pylib', 'run:cover_pylib', 'boolean'),
+ ('data_file', 'run:data_file'),
+ ('debug', 'run:debug', 'list'),
+ ('include', 'run:include', 'list'),
+ ('omit', 'run:omit', 'list'),
+ ('parallel', 'run:parallel', 'boolean'),
+ ('source', 'run:source', 'list'),
+ ('timid', 'run:timid', 'boolean'),
# [report]
- if cp.has_option('report', 'exclude_lines'):
- self.exclude_list = \
- self.get_line_list(cp, 'report', 'exclude_lines')
- if cp.has_option('report', 'ignore_errors'):
- self.ignore_errors = cp.getboolean('report', 'ignore_errors')
- if cp.has_option('report', 'include'):
- self.include = self.get_list(cp, 'report', 'include')
- if cp.has_option('report', 'omit'):
- self.omit = self.get_list(cp, 'report', 'omit')
- if cp.has_option('report', 'partial_branches'):
- self.partial_list = \
- self.get_line_list(cp, 'report', 'partial_branches')
- if cp.has_option('report', 'partial_branches_always'):
- self.partial_always_list = \
- self.get_line_list(cp, 'report', 'partial_branches_always')
- if cp.has_option('report', 'precision'):
- self.precision = cp.getint('report', 'precision')
+ ('exclude_list', 'report:exclude_lines', 'linelist'),
+ ('ignore_errors', 'report:ignore_errors', 'boolean'),
+ ('include', 'report:include', 'list'),
+ ('omit', 'report:omit', 'list'),
+ ('partial_list', 'report:partial_branches', 'linelist'),
+ ('partial_always_list', 'report:partial_branches_always', 'linelist'),
+ ('precision', 'report:precision', 'int'),
+ ('show_missing', 'report:show_missing', 'boolean'),
# [html]
- if cp.has_option('html', 'directory'):
- self.html_dir = cp.get('html', 'directory')
+ ('html_dir', 'html:directory'),
+ ('extra_css', 'html:extra_css'),
+ ('html_title', 'html:title'),
# [xml]
- if cp.has_option('xml', 'output'):
- self.xml_output = cp.get('xml', 'output')
+ ('xml_output', 'xml:output'),
+ ]
- def get_list(self, cp, section, option):
- """Read a list of strings from the ConfigParser `cp`.
-
- The value of `section` and `option` is treated as a comma- and newline-
- separated list of strings. Each value is stripped of whitespace.
-
- Returns the list of strings.
-
- """
- value_list = cp.get(section, option)
- values = []
- for value_line in value_list.split('\n'):
- for value in value_line.split(','):
- value = value.strip()
- if value:
- values.append(value)
- return values
-
- def get_line_list(self, cp, section, option):
- """Read a list of full-line strings from the ConfigParser `cp`.
-
- The value of `section` and `option` is treated as a newline-separated
- list of strings. Each value is stripped of whitespace.
-
- Returns the list of strings.
-
- """
- value_list = cp.get(section, option)
- return list(filter(None, value_list.split('\n')))
-
+ def set_attr_from_config_option(self, cp, attr, where, type_=''):
+ """Set an attribute on self if it exists in the ConfigParser."""
+ section, option = where.split(":")
+ if cp.has_option(section, option):
+ method = getattr(cp, 'get'+type_)
+ setattr(self, attr, method(section, option))
diff --git a/python/helpers/coverage/control.py b/python/helpers/coverage/control.py
index 5ca1ef9..f75a3dd 100644
--- a/python/helpers/coverage/control.py
+++ b/python/helpers/coverage/control.py
@@ -3,21 +3,31 @@
import atexit, os, random, socket, sys
from coverage.annotate import AnnotateReporter
-from coverage.backward import string_class
+from coverage.backward import string_class, iitems, sorted # pylint: disable=W0622
from coverage.codeunit import code_unit_factory, CodeUnit
from coverage.collector import Collector
from coverage.config import CoverageConfig
from coverage.data import CoverageData
+from coverage.debug import DebugControl
from coverage.files import FileLocator, TreeMatcher, FnmatchMatcher
-from coverage.files import find_python_files
+from coverage.files import PathAliases, find_python_files, prep_patterns
from coverage.html import HtmlReporter
from coverage.misc import CoverageException, bool_or_none, join_regex
+from coverage.misc import file_be_gone
from coverage.results import Analysis, Numbers
from coverage.summary import SummaryReporter
from coverage.xmlreport import XmlReporter
+# Pypy has some unusual stuff in the "stdlib". Consider those locations
+# when deciding where the stdlib is.
+try:
+ import _structseq # pylint: disable=F0401
+except ImportError:
+ _structseq = None
+
+
class coverage(object):
- """Programmatic access to Coverage.
+ """Programmatic access to coverage.py.
To use::
@@ -25,14 +35,15 @@
cov = coverage()
cov.start()
- #.. blah blah (run your code) blah blah ..
+ #.. call your code ..
cov.stop()
cov.html_report(directory='covhtml')
"""
def __init__(self, data_file=None, data_suffix=None, cover_pylib=None,
auto_data=False, timid=None, branch=None, config_file=True,
- source=None, omit=None, include=None):
+ source=None, omit=None, include=None, debug=None,
+ debug_file=None):
"""
`data_file` is the base name of the data file to use, defaulting to
".coverage". `data_suffix` is appended (with a dot) to `data_file` to
@@ -67,6 +78,10 @@
`include` will be measured, files that match `omit` will not. Each
will also accept a single string argument.
+ `debug` is a list of strings indicating what debugging information is
+ desired. `debug_file` is the file to write debug messages to,
+ defaulting to stderr.
+
"""
from coverage import __version__
@@ -96,18 +111,16 @@
self.config.data_file = env_data_file
# 4: from constructor arguments:
- if isinstance(omit, string_class):
- omit = [omit]
- if isinstance(include, string_class):
- include = [include]
self.config.from_args(
data_file=data_file, cover_pylib=cover_pylib, timid=timid,
branch=branch, parallel=bool_or_none(data_suffix),
- source=source, omit=omit, include=include
+ source=source, omit=omit, include=include, debug=debug,
)
+ # Create and configure the debugging controller.
+ self.debug = DebugControl(self.config.debug, debug_file or sys.stderr)
+
self.auto_data = auto_data
- self.atexit_registered = False
# _exclude_re is a dict mapping exclusion list names to compiled
# regexes.
@@ -125,8 +138,8 @@
else:
self.source_pkgs.append(src)
- self.omit = self._prep_patterns(self.config.omit)
- self.include = self._prep_patterns(self.config.include)
+ self.omit = prep_patterns(self.config.omit)
+ self.include = prep_patterns(self.config.include)
self.collector = Collector(
self._should_trace, timid=self.config.timid,
@@ -151,7 +164,8 @@
# started rather than wherever the process eventually chdir'd to.
self.data = CoverageData(
basename=self.config.data_file,
- collector="coverage v%s" % __version__
+ collector="coverage v%s" % __version__,
+ debug=self.debug,
)
# The dirs for files considered "installed with the interpreter".
@@ -162,9 +176,9 @@
# environments (virtualenv, for example), these modules may be
# spread across a few locations. Look at all the candidate modules
# we've imported, and take all the different ones.
- for m in (atexit, os, random, socket):
- if hasattr(m, "__file__"):
- m_dir = self._canonical_dir(m.__file__)
+ for m in (atexit, os, random, socket, _structseq):
+ if m is not None and hasattr(m, "__file__"):
+ m_dir = self._canonical_dir(m)
if m_dir not in self.pylib_dirs:
self.pylib_dirs.append(m_dir)
@@ -172,63 +186,61 @@
# where we are.
self.cover_dir = self._canonical_dir(__file__)
- # The matchers for _should_trace, created when tracing starts.
+ # The matchers for _should_trace.
self.source_match = None
self.pylib_match = self.cover_match = None
self.include_match = self.omit_match = None
- # Only _harvest_data once per measurement cycle.
- self._harvested = False
-
# Set the reporting precision.
Numbers.set_precision(self.config.precision)
- # When tearing down the coverage object, modules can become None.
- # Saving the modules as object attributes avoids problems, but it is
- # quite ad-hoc which modules need to be saved and which references
- # need to use the object attributes.
- self.socket = socket
- self.os = os
- self.random = random
+ # Is it ok for no data to be collected?
+ self._warn_no_data = True
+ self._warn_unimported_source = True
- def _canonical_dir(self, f):
- """Return the canonical directory of the file `f`."""
- return os.path.split(self.file_locator.canonical_filename(f))[0]
+ # State machine variables:
+ # Have we started collecting and not stopped it?
+ self._started = False
+ # Have we measured some data and not harvested it?
+ self._measured = False
+
+ atexit.register(self._atexit)
+
+ def _canonical_dir(self, morf):
+ """Return the canonical directory of the module or file `morf`."""
+ return os.path.split(CodeUnit(morf, self.file_locator).filename)[0]
def _source_for_file(self, filename):
"""Return the source file for `filename`."""
if not filename.endswith(".py"):
if filename[-4:-1] == ".py":
filename = filename[:-1]
+ elif filename.endswith("$py.class"): # jython
+ filename = filename[:-9] + ".py"
return filename
- def _should_trace(self, filename, frame):
- """Decide whether to trace execution in `filename`
+ def _should_trace_with_reason(self, filename, frame):
+ """Decide whether to trace execution in `filename`, with a reason.
This function is called from the trace function. As each new file name
is encountered, this function determines whether it is traced or not.
- Returns a canonicalized filename if it should be traced, False if it
- should not.
+ Returns a pair of values: the first indicates whether the file should
+ be traced: it's a canonicalized filename if it should be traced, None
+ if it should not. The second value is a string, the resason for the
+ decision.
"""
- if os is None:
- return False
+ if not filename:
+ # Empty string is pretty useless
+ return None, "empty string isn't a filename"
if filename.startswith('<'):
# Lots of non-file execution is represented with artificial
# filenames like "<string>", "<doctest readme.txt[0]>", or
# "<exec_function>". Don't ever trace these executions, since we
# can't do anything with the data later anyway.
- return False
-
- if filename.endswith(".html"):
- # Jinja and maybe other templating systems compile templates into
- # Python code, but use the template filename as the filename in
- # the compiled code. Of course, those filenames are useless later
- # so don't bother collecting. TODO: How should we really separate
- # out good file extensions from bad?
- return False
+ return None, "not a real filename"
self._check_for_packages()
@@ -248,64 +260,53 @@
canonical = self.file_locator.canonical_filename(filename)
- # If the user specified source, then that's authoritative about what to
- # measure. If they didn't, then we have to exclude the stdlib and
- # coverage.py directories.
+ # If the user specified source or include, then that's authoritative
+ # about the outer bound of what to measure and we don't have to apply
+ # any canned exclusions. If they didn't, then we have to exclude the
+ # stdlib and coverage.py directories.
if self.source_match:
if not self.source_match.match(canonical):
- return False
+ return None, "falls outside the --source trees"
+ elif self.include_match:
+ if not self.include_match.match(canonical):
+ return None, "falls outside the --include trees"
else:
# If we aren't supposed to trace installed code, then check if this
# is near the Python standard library and skip it if so.
if self.pylib_match and self.pylib_match.match(canonical):
- return False
+ return None, "is in the stdlib"
# We exclude the coverage code itself, since a little of it will be
# measured otherwise.
if self.cover_match and self.cover_match.match(canonical):
- return False
+ return None, "is part of coverage.py"
- # Check the file against the include and omit patterns.
- if self.include_match and not self.include_match.match(canonical):
- return False
+ # Check the file against the omit pattern.
if self.omit_match and self.omit_match.match(canonical):
- return False
+ return None, "is inside an --omit pattern"
+ return canonical, "because we love you"
+
+ def _should_trace(self, filename, frame):
+ """Decide whether to trace execution in `filename`.
+
+ Calls `_should_trace_with_reason`, and returns just the decision.
+
+ """
+ canonical, reason = self._should_trace_with_reason(filename, frame)
+ if self.debug.should('trace'):
+ if not canonical:
+ msg = "Not tracing %r: %s" % (filename, reason)
+ else:
+ msg = "Tracing %r" % (filename,)
+ self.debug.write(msg)
return canonical
- # To log what should_trace returns, change this to "if 1:"
- if 0:
- _real_should_trace = _should_trace
- def _should_trace(self, filename, frame): # pylint: disable=E0102
- """A logging decorator around the real _should_trace function."""
- ret = self._real_should_trace(filename, frame)
- print("should_trace: %r -> %r" % (filename, ret))
- return ret
-
def _warn(self, msg):
"""Use `msg` as a warning."""
self._warnings.append(msg)
sys.stderr.write("Coverage.py warning: %s\n" % msg)
- def _prep_patterns(self, patterns):
- """Prepare the file patterns for use in a `FnmatchMatcher`.
-
- If a pattern starts with a wildcard, it is used as a pattern
- as-is. If it does not start with a wildcard, then it is made
- absolute with the current directory.
-
- If `patterns` is None, an empty list is returned.
-
- """
- patterns = patterns or []
- prepped = []
- for p in patterns or []:
- if p.startswith("*") or p.startswith("?"):
- prepped.append(p)
- else:
- prepped.append(self.file_locator.abs_file(p))
- return prepped
-
def _check_for_packages(self):
"""Update the source_match matcher with latest imported packages."""
# Our self.source_pkgs attribute is a list of package names we want to
@@ -325,17 +326,23 @@
try:
pkg_file = mod.__file__
except AttributeError:
- self._warn("Module %s has no Python source." % pkg)
+ pkg_file = None
else:
d, f = os.path.split(pkg_file)
- if f.startswith('__init__.'):
+ if f.startswith('__init__'):
# This is actually a package, return the directory.
pkg_file = d
else:
pkg_file = self._source_for_file(pkg_file)
pkg_file = self.file_locator.canonical_filename(pkg_file)
+ if not os.path.exists(pkg_file):
+ pkg_file = None
+
+ if pkg_file:
self.source.append(pkg_file)
self.source_match.add(pkg_file)
+ else:
+ self._warn("Module %s has no Python source." % pkg)
for pkg in found:
self.source_pkgs.remove(pkg)
@@ -354,17 +361,21 @@
self.data.read()
def start(self):
- """Start measuring code coverage."""
+ """Start measuring code coverage.
+
+ Coverage measurement actually occurs in functions called after `start`
+ is invoked. Statements in the same scope as `start` won't be measured.
+
+ Once you invoke `start`, you must also call `stop` eventually, or your
+ process might not shut down cleanly.
+
+ """
if self.run_suffix:
# Calling start() means we're running code, so use the run_suffix
# as the data_suffix when we eventually save the data.
self.data_suffix = self.run_suffix
if self.auto_data:
self.load()
- # Save coverage data when Python exits.
- if not self.atexit_registered:
- atexit.register(self.save)
- self.atexit_registered = True
# Create the matchers we need for _should_trace
if self.source or self.source_pkgs:
@@ -379,13 +390,31 @@
if self.omit:
self.omit_match = FnmatchMatcher(self.omit)
- self._harvested = False
+ # The user may want to debug things, show info if desired.
+ if self.debug.should('config'):
+ self.debug.write("Configuration values:")
+ config_info = sorted(self.config.__dict__.items())
+ self.debug.write_formatted_info(config_info)
+
+ if self.debug.should('sys'):
+ self.debug.write("Debugging info:")
+ self.debug.write_formatted_info(self.sysinfo())
+
self.collector.start()
+ self._started = True
+ self._measured = True
def stop(self):
"""Stop measuring code coverage."""
+ self._started = False
self.collector.stop()
- self._harvest_data()
+
+ def _atexit(self):
+ """Clean up on process shutdown."""
+ if self._started:
+ self.stop()
+ if self.auto_data:
+ self.save()
def erase(self):
"""Erase previously-collected coverage data.
@@ -449,9 +478,15 @@
# plenty of distinguishing information. We do this here in
# `save()` at the last minute so that the pid will be correct even
# if the process forks.
- data_suffix = "%s.%s.%06d" % (
- self.socket.gethostname(), self.os.getpid(),
- self.random.randint(0, 99999)
+ extra = ""
+ if _TEST_NAME_FILE:
+ f = open(_TEST_NAME_FILE)
+ test_name = f.read()
+ f.close()
+ extra = "." + test_name
+ data_suffix = "%s%s.%s.%06d" % (
+ socket.gethostname(), extra, os.getpid(),
+ random.randint(0, 999999)
)
self._harvest_data()
@@ -465,7 +500,14 @@
current measurements.
"""
- self.data.combine_parallel_data()
+ aliases = None
+ if self.config.paths:
+ aliases = PathAliases(self.file_locator)
+ for paths in self.config.paths.values():
+ result = paths[0]
+ for pattern in paths[1:]:
+ aliases.add(pattern, result)
+ self.data.combine_parallel_data(aliases=aliases)
def _harvest_data(self):
"""Get the collected data and reset the collector.
@@ -473,27 +515,37 @@
Also warn about various problems collecting data.
"""
- if not self._harvested:
- self.data.add_line_data(self.collector.get_line_data())
- self.data.add_arc_data(self.collector.get_arc_data())
- self.collector.reset()
+ if not self._measured:
+ return
- # If there are still entries in the source_pkgs list, then we never
- # encountered those packages.
+ self.data.add_line_data(self.collector.get_line_data())
+ self.data.add_arc_data(self.collector.get_arc_data())
+ self.collector.reset()
+
+ # If there are still entries in the source_pkgs list, then we never
+ # encountered those packages.
+ if self._warn_unimported_source:
for pkg in self.source_pkgs:
self._warn("Module %s was never imported." % pkg)
- # Find out if we got any data.
- summary = self.data.summary()
- if not summary:
- self._warn("No data was collected.")
+ # Find out if we got any data.
+ summary = self.data.summary()
+ if not summary and self._warn_no_data:
+ self._warn("No data was collected.")
- # Find files that were never executed at all.
- for src in self.source:
- for py_file in find_python_files(src):
- self.data.touch_file(py_file)
+ # Find files that were never executed at all.
+ for src in self.source:
+ for py_file in find_python_files(src):
+ py_file = self.file_locator.canonical_filename(py_file)
- self._harvested = True
+ if self.omit_match and self.omit_match.match(py_file):
+ # Turns out this file was omitted, so don't pull it back
+ # in as unexecuted.
+ continue
+
+ self.data.touch_file(py_file)
+
+ self._measured = False
# Backward compatibility with version 1.
def analysis(self, morf):
@@ -520,8 +572,11 @@
"""
analysis = self._analyze(morf)
return (
- analysis.filename, analysis.statements, analysis.excluded,
- analysis.missing, analysis.missing_formatted()
+ analysis.filename,
+ sorted(analysis.statements),
+ sorted(analysis.excluded),
+ sorted(analysis.missing),
+ analysis.missing_formatted(),
)
def _analyze(self, it):
@@ -530,6 +585,7 @@
Returns an `Analysis` object.
"""
+ self._harvest_data()
if not isinstance(it, CodeUnit):
it = code_unit_factory(it, self.file_locator)[0]
@@ -548,14 +604,16 @@
match those patterns will be included in the report. Modules matching
`omit` will not be included in the report.
+ Returns a float, the total percentage covered.
+
"""
+ self._harvest_data()
self.config.from_args(
- ignore_errors=ignore_errors, omit=omit, include=include
+ ignore_errors=ignore_errors, omit=omit, include=include,
+ show_missing=show_missing,
)
- reporter = SummaryReporter(
- self, show_missing, self.config.ignore_errors
- )
- reporter.report(morfs, outfile=file, config=self.config)
+ reporter = SummaryReporter(self, self.config)
+ return reporter.report(morfs, outfile=file)
def annotate(self, morfs=None, directory=None, ignore_errors=None,
omit=None, include=None):
@@ -569,25 +627,39 @@
See `coverage.report()` for other arguments.
"""
+ self._harvest_data()
self.config.from_args(
ignore_errors=ignore_errors, omit=omit, include=include
)
- reporter = AnnotateReporter(self, self.config.ignore_errors)
- reporter.report(morfs, config=self.config, directory=directory)
+ reporter = AnnotateReporter(self, self.config)
+ reporter.report(morfs, directory=directory)
def html_report(self, morfs=None, directory=None, ignore_errors=None,
- omit=None, include=None):
+ omit=None, include=None, extra_css=None, title=None):
"""Generate an HTML report.
+ The HTML is written to `directory`. The file "index.html" is the
+ overview starting point, with links to more detailed pages for
+ individual modules.
+
+ `extra_css` is a path to a file of other CSS to apply on the page.
+ It will be copied into the HTML directory.
+
+ `title` is a text string (not HTML) to use as the title of the HTML
+ report.
+
See `coverage.report()` for other arguments.
+ Returns a float, the total percentage covered.
+
"""
+ self._harvest_data()
self.config.from_args(
ignore_errors=ignore_errors, omit=omit, include=include,
- html_dir=directory,
+ html_dir=directory, extra_css=extra_css, html_title=title,
)
- reporter = HtmlReporter(self, self.config.ignore_errors)
- reporter.report(morfs, config=self.config)
+ reporter = HtmlReporter(self, self.config)
+ return reporter.report(morfs)
def xml_report(self, morfs=None, outfile=None, ignore_errors=None,
omit=None, include=None):
@@ -600,12 +672,16 @@
See `coverage.report()` for other arguments.
+ Returns a float, the total percentage covered.
+
"""
+ self._harvest_data()
self.config.from_args(
ignore_errors=ignore_errors, omit=omit, include=include,
xml_output=outfile,
)
file_to_close = None
+ delete_file = False
if self.config.xml_output:
if self.config.xml_output == '-':
outfile = sys.stdout
@@ -613,11 +689,17 @@
outfile = open(self.config.xml_output, "w")
file_to_close = outfile
try:
- reporter = XmlReporter(self, self.config.ignore_errors)
- reporter.report(morfs, outfile=outfile, config=self.config)
+ try:
+ reporter = XmlReporter(self, self.config)
+ return reporter.report(morfs, outfile=outfile)
+ except CoverageException:
+ delete_file = True
+ raise
finally:
if file_to_close:
file_to_close.close()
+ if delete_file:
+ file_be_gone(self.config.xml_output)
def sysinfo(self):
"""Return a list of (key, value) pairs showing internal information."""
@@ -625,22 +707,43 @@
import coverage as covmod
import platform, re
+ try:
+ implementation = platform.python_implementation()
+ except AttributeError:
+ implementation = "unknown"
+
info = [
('version', covmod.__version__),
('coverage', covmod.__file__),
('cover_dir', self.cover_dir),
('pylib_dirs', self.pylib_dirs),
('tracer', self.collector.tracer_name()),
+ ('config_files', self.config.attempted_config_files),
+ ('configs_read', self.config.config_files),
('data_path', self.data.filename),
('python', sys.version.replace('\n', '')),
('platform', platform.platform()),
+ ('implementation', implementation),
+ ('executable', sys.executable),
('cwd', os.getcwd()),
('path', sys.path),
- ('environment', [
- ("%s = %s" % (k, v)) for k, v in os.environ.items()
- if re.search("^COV|^PY", k)
- ]),
+ ('environment', sorted([
+ ("%s = %s" % (k, v)) for k, v in iitems(os.environ)
+ if re.search(r"^COV|^PY", k)
+ ])),
+ ('command_line', " ".join(getattr(sys, 'argv', ['???']))),
]
+ if self.source_match:
+ info.append(('source_match', self.source_match.info()))
+ if self.include_match:
+ info.append(('include_match', self.include_match.info()))
+ if self.omit_match:
+ info.append(('omit_match', self.omit_match.info()))
+ if self.cover_match:
+ info.append(('cover_match', self.cover_match.info()))
+ if self.pylib_match:
+ info.append(('pylib_match', self.pylib_match.info()))
+
return info
@@ -667,7 +770,10 @@
cps = os.environ.get("COVERAGE_PROCESS_START")
if cps:
cov = coverage(config_file=cps, auto_data=True)
- if os.environ.get("COVERAGE_COVERAGE"):
- # Measuring coverage within coverage.py takes yet more trickery.
- cov.cover_dir = "Please measure coverage.py!"
cov.start()
+ cov._warn_no_data = False
+ cov._warn_unimported_source = False
+
+
+# A hack for debugging testing in subprocesses.
+_TEST_NAME_FILE = "" #"/tmp/covtest.txt"
diff --git a/python/helpers/coverage/data.py b/python/helpers/coverage/data.py
index 3263cb3..fb88c5b 100644
--- a/python/helpers/coverage/data.py
+++ b/python/helpers/coverage/data.py
@@ -2,7 +2,9 @@
import os
-from coverage.backward import pickle, sorted # pylint: disable=W0622
+from coverage.backward import iitems, pickle, sorted # pylint: disable=W0622
+from coverage.files import PathAliases
+from coverage.misc import file_be_gone
class CoverageData(object):
@@ -21,15 +23,18 @@
"""
- def __init__(self, basename=None, collector=None):
+ def __init__(self, basename=None, collector=None, debug=None):
"""Create a CoverageData.
`basename` is the name of the file to use for storing data.
`collector` is a string describing the coverage measurement software.
+ `debug` is a `DebugControl` object for writing debug messages.
+
"""
self.collector = collector or 'unknown'
+ self.debug = debug
self.use_file = True
@@ -59,10 +64,6 @@
#
self.arcs = {}
- self.os = os
- self.sorted = sorted
- self.pickle = pickle
-
def usefile(self, use_file=True):
"""Set whether or not to use a disk file for data."""
self.use_file = use_file
@@ -92,21 +93,21 @@
def erase(self):
"""Erase the data, both in this object, and from its file storage."""
if self.use_file:
- if self.filename and os.path.exists(self.filename):
- os.remove(self.filename)
+ if self.filename:
+ file_be_gone(self.filename)
self.lines = {}
self.arcs = {}
def line_data(self):
"""Return the map from filenames to lists of line numbers executed."""
return dict(
- [(f, self.sorted(lmap.keys())) for f, lmap in self.lines.items()]
+ [(f, sorted(lmap.keys())) for f, lmap in iitems(self.lines)]
)
def arc_data(self):
"""Return the map from filenames to lists of line number pairs."""
return dict(
- [(f, self.sorted(amap.keys())) for f, amap in self.arcs.items()]
+ [(f, sorted(amap.keys())) for f, amap in iitems(self.arcs)]
)
def write_file(self, filename):
@@ -123,10 +124,13 @@
if self.collector:
data['collector'] = self.collector
+ if self.debug and self.debug.should('dataio'):
+ self.debug.write("Writing data to %r" % (filename,))
+
# Write the pickle to the file.
fdata = open(filename, 'wb')
try:
- self.pickle.dump(data, fdata, 2)
+ pickle.dump(data, fdata, 2)
finally:
fdata.close()
@@ -136,6 +140,8 @@
def raw_data(self, filename):
"""Return the raw pickled data from `filename`."""
+ if self.debug and self.debug.should('dataio'):
+ self.debug.write("Reading data from %r" % (filename,))
fdata = open(filename, 'rb')
try:
data = pickle.load(fdata)
@@ -158,33 +164,39 @@
# Unpack the 'lines' item.
lines = dict([
(f, dict.fromkeys(linenos, None))
- for f, linenos in data.get('lines', {}).items()
+ for f, linenos in iitems(data.get('lines', {}))
])
# Unpack the 'arcs' item.
arcs = dict([
(f, dict.fromkeys(arcpairs, None))
- for f, arcpairs in data.get('arcs', {}).items()
+ for f, arcpairs in iitems(data.get('arcs', {}))
])
except Exception:
pass
return lines, arcs
- def combine_parallel_data(self):
+ def combine_parallel_data(self, aliases=None):
"""Combine a number of data files together.
Treat `self.filename` as a file prefix, and combine the data from all
of the data files starting with that prefix plus a dot.
+ If `aliases` is provided, it's a `PathAliases` object that is used to
+ re-map paths to match the local machine's.
+
"""
+ aliases = aliases or PathAliases()
data_dir, local = os.path.split(self.filename)
localdot = local + '.'
for f in os.listdir(data_dir or '.'):
if f.startswith(localdot):
full_path = os.path.join(data_dir, f)
new_lines, new_arcs = self._read_file(full_path)
- for filename, file_data in new_lines.items():
+ for filename, file_data in iitems(new_lines):
+ filename = aliases.map(filename)
self.lines.setdefault(filename, {}).update(file_data)
- for filename, file_data in new_arcs.items():
+ for filename, file_data in iitems(new_arcs):
+ filename = aliases.map(filename)
self.arcs.setdefault(filename, {}).update(file_data)
if f != local:
os.remove(full_path)
@@ -195,7 +207,7 @@
`line_data` is { filename: { lineno: None, ... }, ...}
"""
- for filename, linenos in line_data.items():
+ for filename, linenos in iitems(line_data):
self.lines.setdefault(filename, {}).update(linenos)
def add_arc_data(self, arc_data):
@@ -204,7 +216,7 @@
`arc_data` is { filename: { (l1,l2): None, ... }, ...}
"""
- for filename, arcs in arc_data.items():
+ for filename, arcs in iitems(arc_data):
self.arcs.setdefault(filename, {}).update(arcs)
def touch_file(self, filename):
@@ -245,8 +257,8 @@
if fullpath:
filename_fn = lambda f: f
else:
- filename_fn = self.os.path.basename
- for filename, lines in self.lines.items():
+ filename_fn = os.path.basename
+ for filename, lines in iitems(self.lines):
summ[filename_fn(filename)] = len(lines)
return summ
diff --git a/python/helpers/coverage/debug.py b/python/helpers/coverage/debug.py
new file mode 100644
index 0000000..104f3b1
--- /dev/null
+++ b/python/helpers/coverage/debug.py
@@ -0,0 +1,54 @@
+"""Control of and utilities for debugging."""
+
+import os
+
+
+# When debugging, it can be helpful to force some options, especially when
+# debugging the configuration mechanisms you usually use to control debugging!
+# This is a list of forced debugging options.
+FORCED_DEBUG = []
+
+
+class DebugControl(object):
+ """Control and output for debugging."""
+
+ def __init__(self, options, output):
+ """Configure the options and output file for debugging."""
+ self.options = options
+ self.output = output
+
+ def should(self, option):
+ """Decide whether to output debug information in category `option`."""
+ return (option in self.options or option in FORCED_DEBUG)
+
+ def write(self, msg):
+ """Write a line of debug output."""
+ if self.should('pid'):
+ msg = "pid %5d: %s" % (os.getpid(), msg)
+ self.output.write(msg+"\n")
+ self.output.flush()
+
+ def write_formatted_info(self, info):
+ """Write a sequence of (label,data) pairs nicely."""
+ for line in info_formatter(info):
+ self.write(" %s" % line)
+
+
+def info_formatter(info):
+ """Produce a sequence of formatted lines from info.
+
+ `info` is a sequence of pairs (label, data). The produced lines are
+ nicely formatted, ready to print.
+
+ """
+ label_len = max([len(l) for l, _d in info])
+ for label, data in info:
+ if data == []:
+ data = "-none-"
+ if isinstance(data, (list, tuple)):
+ prefix = "%*s:" % (label_len, label)
+ for e in data:
+ yield "%*s %s" % (label_len+1, prefix, e)
+ prefix = ""
+ else:
+ yield "%*s: %s" % (label_len, label, data)
diff --git a/python/helpers/coverage/execfile.py b/python/helpers/coverage/execfile.py
index 71227b7..f6ebdf7 100644
--- a/python/helpers/coverage/execfile.py
+++ b/python/helpers/coverage/execfile.py
@@ -1,9 +1,9 @@
"""Execute files of Python code."""
-import imp, os, sys
+import imp, marshal, os, sys
from coverage.backward import exec_code_object, open_source
-from coverage.misc import NoSource, ExceptionDuringRun
+from coverage.misc import ExceptionDuringRun, NoCode, NoSource
try:
@@ -65,6 +65,8 @@
openfile.close()
# Finally, hand the file off to run_python_file for execution.
+ pathname = os.path.abspath(pathname)
+ args[0] = pathname
run_python_file(pathname, args, package=packagename)
@@ -82,34 +84,22 @@
main_mod = imp.new_module('__main__')
sys.modules['__main__'] = main_mod
main_mod.__file__ = filename
- main_mod.__package__ = package
+ if package:
+ main_mod.__package__ = package
main_mod.__builtins__ = BUILTINS
- # Set sys.argv and the first path element properly.
+ # Set sys.argv properly.
old_argv = sys.argv
- old_path0 = sys.path[0]
sys.argv = args
- sys.path[0] = os.path.abspath(os.path.dirname(filename))
try:
- # Open the source file.
- try:
- source_file = open_source(filename)
- except IOError:
- raise NoSource("No file to run: %r" % filename)
+ # Make a code object somehow.
+ if filename.endswith(".pyc") or filename.endswith(".pyo"):
+ code = make_code_from_pyc(filename)
+ else:
+ code = make_code_from_py(filename)
- try:
- source = source_file.read()
- finally:
- source_file.close()
-
- # We have the source. `compile` still needs the last line to be clean,
- # so make sure it is, then compile a code object from it.
- if source[-1] != '\n':
- source += '\n'
- code = compile(source, filename, "exec")
-
- # Execute the source file.
+ # Execute the code object.
try:
exec_code_object(code, main_mod.__dict__)
except SystemExit:
@@ -130,4 +120,52 @@
# Restore the old argv and path
sys.argv = old_argv
- sys.path[0] = old_path0
+
+def make_code_from_py(filename):
+ """Get source from `filename` and make a code object of it."""
+ # Open the source file.
+ try:
+ source_file = open_source(filename)
+ except IOError:
+ raise NoSource("No file to run: %r" % filename)
+
+ try:
+ source = source_file.read()
+ finally:
+ source_file.close()
+
+ # We have the source. `compile` still needs the last line to be clean,
+ # so make sure it is, then compile a code object from it.
+ if not source or source[-1] != '\n':
+ source += '\n'
+ code = compile(source, filename, "exec")
+
+ return code
+
+
+def make_code_from_pyc(filename):
+ """Get a code object from a .pyc file."""
+ try:
+ fpyc = open(filename, "rb")
+ except IOError:
+ raise NoCode("No file to run: %r" % filename)
+
+ try:
+ # First four bytes are a version-specific magic number. It has to
+ # match or we won't run the file.
+ magic = fpyc.read(4)
+ if magic != imp.get_magic():
+ raise NoCode("Bad magic number in .pyc file")
+
+ # Skip the junk in the header that we don't need.
+ fpyc.read(4) # Skip the moddate.
+ if sys.version_info >= (3, 3):
+ # 3.3 added another long to the header (size), skip it.
+ fpyc.read(4)
+
+ # The rest of the file is the code object we want.
+ code = marshal.load(fpyc)
+ finally:
+ fpyc.close()
+
+ return code
diff --git a/python/helpers/coverage/files.py b/python/helpers/coverage/files.py
index a68a0a7..464535a 100644
--- a/python/helpers/coverage/files.py
+++ b/python/helpers/coverage/files.py
@@ -1,23 +1,21 @@
"""File wrangling."""
from coverage.backward import to_string
-import fnmatch, os, sys
+from coverage.misc import CoverageException
+import fnmatch, os, os.path, re, sys
+import ntpath, posixpath
class FileLocator(object):
"""Understand how filenames work."""
def __init__(self):
# The absolute path to our current directory.
- self.relative_dir = self.abs_file(os.curdir) + os.sep
+ self.relative_dir = os.path.normcase(abs_file(os.curdir) + os.sep)
# Cache of results of calling the canonical_filename() method, to
# avoid duplicating work.
self.canonical_filename_cache = {}
- def abs_file(self, filename):
- """Return the absolute normalized form of `filename`."""
- return os.path.normcase(os.path.abspath(os.path.realpath(filename)))
-
def relative_filename(self, filename):
"""Return the relative form of `filename`.
@@ -25,8 +23,9 @@
`FileLocator` was constructed.
"""
- if filename.startswith(self.relative_dir):
- filename = filename.replace(self.relative_dir, "")
+ fnorm = os.path.normcase(filename)
+ if fnorm.startswith(self.relative_dir):
+ filename = filename[len(self.relative_dir):]
return filename
def canonical_filename(self, filename):
@@ -36,19 +35,15 @@
"""
if filename not in self.canonical_filename_cache:
- f = filename
- if os.path.isabs(f) and not os.path.exists(f):
- if self.get_zip_data(f) is None:
- f = os.path.basename(f)
- if not os.path.isabs(f):
+ if not os.path.isabs(filename):
for path in [os.curdir] + sys.path:
if path is None:
continue
- g = os.path.join(path, f)
- if os.path.exists(g):
- f = g
+ f = os.path.join(path, filename)
+ if os.path.exists(f):
+ filename = f
break
- cf = self.abs_file(f)
+ cf = abs_file(filename)
self.canonical_filename_cache[filename] = cf
return self.canonical_filename_cache[filename]
@@ -77,6 +72,78 @@
return None
+if sys.platform == 'win32':
+
+ def actual_path(path):
+ """Get the actual path of `path`, including the correct case."""
+ if path in actual_path.cache:
+ return actual_path.cache[path]
+
+ head, tail = os.path.split(path)
+ if not tail:
+ actpath = head
+ elif not head:
+ actpath = tail
+ else:
+ head = actual_path(head)
+ if head in actual_path.list_cache:
+ files = actual_path.list_cache[head]
+ else:
+ try:
+ files = os.listdir(head)
+ except OSError:
+ files = []
+ actual_path.list_cache[head] = files
+ normtail = os.path.normcase(tail)
+ for f in files:
+ if os.path.normcase(f) == normtail:
+ tail = f
+ break
+ actpath = os.path.join(head, tail)
+ actual_path.cache[path] = actpath
+ return actpath
+
+ actual_path.cache = {}
+ actual_path.list_cache = {}
+
+else:
+ def actual_path(filename):
+ """The actual path for non-Windows platforms."""
+ return filename
+
+
+def abs_file(filename):
+ """Return the absolute normalized form of `filename`."""
+ path = os.path.expandvars(os.path.expanduser(filename))
+ path = os.path.abspath(os.path.realpath(path))
+ path = actual_path(path)
+ return path
+
+
+def isabs_anywhere(filename):
+ """Is `filename` an absolute path on any OS?"""
+ return ntpath.isabs(filename) or posixpath.isabs(filename)
+
+
+def prep_patterns(patterns):
+ """Prepare the file patterns for use in a `FnmatchMatcher`.
+
+ If a pattern starts with a wildcard, it is used as a pattern
+ as-is. If it does not start with a wildcard, then it is made
+ absolute with the current directory.
+
+ If `patterns` is None, an empty list is returned.
+
+ """
+ prepped = []
+ for p in patterns or []:
+ if p.startswith("*") or p.startswith("?"):
+ prepped.append(p)
+ else:
+ prepped.append(abs_file(p))
+ return prepped
+
+
class TreeMatcher(object):
"""A matcher for files in a tree."""
def __init__(self, directories):
@@ -85,6 +152,10 @@
def __repr__(self):
return "<TreeMatcher %r>" % self.dirs
+ def info(self):
+ """A list of strings for displaying when dumping state."""
+ return self.dirs
+
def add(self, directory):
"""Add another directory to the list we match for."""
self.dirs.append(directory)
@@ -110,6 +181,10 @@
def __repr__(self):
return "<FnmatchMatcher %r>" % self.pats
+ def info(self):
+ """A list of strings for displaying when dumping state."""
+ return self.pats
+
def match(self, fpath):
"""Does `fpath` match one of our filename patterns?"""
for pat in self.pats:
@@ -118,14 +193,117 @@
return False
+def sep(s):
+ """Find the path separator used in this string, or os.sep if none."""
+ sep_match = re.search(r"[\\/]", s)
+ if sep_match:
+ the_sep = sep_match.group(0)
+ else:
+ the_sep = os.sep
+ return the_sep
+
+
+class PathAliases(object):
+ """A collection of aliases for paths.
+
+ When combining data files from remote machines, often the paths to source
+ code are different, for example, due to OS differences, or because of
+ serialized checkouts on continuous integration machines.
+
+ A `PathAliases` object tracks a list of pattern/result pairs, and can
+ map a path through those aliases to produce a unified path.
+
+ `locator` is a FileLocator that is used to canonicalize the results.
+
+ """
+ def __init__(self, locator=None):
+ self.aliases = []
+ self.locator = locator
+
+ def add(self, pattern, result):
+ """Add the `pattern`/`result` pair to the list of aliases.
+
+ `pattern` is an `fnmatch`-style pattern. `result` is a simple
+ string. When mapping paths, if a path starts with a match against
+ `pattern`, then that match is replaced with `result`. This models
+ isomorphic source trees being rooted at different places on two
+ different machines.
+
+ `pattern` can't end with a wildcard component, since that would
+ match an entire tree, and not just its root.
+
+ """
+ # The pattern can't end with a wildcard component.
+ pattern = pattern.rstrip(r"\/")
+ if pattern.endswith("*"):
+ raise CoverageException("Pattern must not end with wildcards.")
+ pattern_sep = sep(pattern)
+
+ # The pattern is meant to match a filepath. Let's make it absolute
+ # unless it already is, or is meant to match any prefix.
+ if not pattern.startswith('*') and not isabs_anywhere(pattern):
+ pattern = abs_file(pattern)
+ pattern += pattern_sep
+
+ # Make a regex from the pattern. fnmatch always adds a \Z or $ to
+ # match the whole string, which we don't want.
+ regex_pat = fnmatch.translate(pattern).replace(r'\Z(', '(')
+ if regex_pat.endswith("$"):
+ regex_pat = regex_pat[:-1]
+ # We want */a/b.py to match on Windows too, so change slash to match
+ # either separator.
+ regex_pat = regex_pat.replace(r"\/", r"[\\/]")
+ # We want case-insensitive matching, so add that flag.
+ regex = re.compile(r"(?i)" + regex_pat)
+
+ # Normalize the result: it must end with a path separator.
+ result_sep = sep(result)
+ result = result.rstrip(r"\/") + result_sep
+ self.aliases.append((regex, result, pattern_sep, result_sep))
+
+ def map(self, path):
+ """Map `path` through the aliases.
+
+ `path` is checked against all of the patterns. The first pattern to
+ match is used to replace the root of the path with the result root.
+ Only one pattern is ever used. If no patterns match, `path` is
+ returned unchanged.
+
+ The separator style in the result is made to match that of the result
+ in the alias.
+
+ """
+ for regex, result, pattern_sep, result_sep in self.aliases:
+ m = regex.match(path)
+ if m:
+ new = path.replace(m.group(0), result)
+ if pattern_sep != result_sep:
+ new = new.replace(pattern_sep, result_sep)
+ if self.locator:
+ new = self.locator.canonical_filename(new)
+ return new
+ return path
+
+
def find_python_files(dirname):
- """Yield all of the importable Python files in `dirname`, recursively."""
- for dirpath, dirnames, filenames in os.walk(dirname, topdown=True):
- if '__init__.py' not in filenames:
+ """Yield all of the importable Python files in `dirname`, recursively.
+
+ To be importable, the files have to be in a directory with a __init__.py,
+ except for `dirname` itself, which isn't required to have one. The
+ assumption is that `dirname` was specified directly, so the user knows
+ best, but subdirectories are checked for a __init__.py to be sure we only
+ find the importable files.
+
+ """
+ for i, (dirpath, dirnames, filenames) in enumerate(os.walk(dirname)):
+ if i > 0 and '__init__.py' not in filenames:
# If a directory doesn't have __init__.py, then it isn't
# importable and neither are its files
del dirnames[:]
continue
for filename in filenames:
- if fnmatch.fnmatch(filename, "*.py"):
+ # We're only interested in files that look like reasonable Python
+ # files: Must end with .py or .pyw, and must not have certain funny
+ # characters that probably mean they are editor junk.
+ if re.match(r"^[^.#~!$@%^&*()+=,]+\.pyw?$", filename):
yield os.path.join(dirpath, filename)
diff --git a/python/helpers/coverage/fullcoverage/encodings.py b/python/helpers/coverage/fullcoverage/encodings.py
new file mode 100644
index 0000000..6a258d6
--- /dev/null
+++ b/python/helpers/coverage/fullcoverage/encodings.py
@@ -0,0 +1,57 @@
+"""Imposter encodings module that installs a coverage-style tracer.
+
+This is NOT the encodings module; it is an imposter that sets up tracing
+instrumentation and then replaces itself with the real encodings module.
+
+If the directory that holds this file is placed first in the PYTHONPATH when
+using "coverage" to run Python's tests, then this file will become the very
+first module imported by the internals of Python 3. It installs a
+coverage-compatible trace function that can watch Standard Library modules
+execute from the very earliest stages of Python's own boot process. This fixes
+a problem with coverage - that it starts too late to trace the coverage of many
+of the most fundamental modules in the Standard Library.
+
+"""
+
+import sys
+
+class FullCoverageTracer(object):
+ def __init__(self):
+ # `traces` is a list of trace events. Frames are tricky: the same
+ # frame object is used for a whole scope, with new line numbers
+ # written into it. So in one scope, all the frame objects are the
+ # same object, and will eventually all will point to the last line
+ # executed. So we keep the line numbers alongside the frames.
+ # The list looks like:
+ #
+ # traces = [
+ # ((frame, event, arg), lineno), ...
+ # ]
+ #
+ self.traces = []
+
+ def fullcoverage_trace(self, *args):
+ frame, event, arg = args
+ self.traces.append((args, frame.f_lineno))
+ return self.fullcoverage_trace
+
+sys.settrace(FullCoverageTracer().fullcoverage_trace)
+
+# In coverage/files.py is actual_filename(), which uses glob.glob. I don't
+# understand why, but that use of glob borks everything if fullcoverage is in
+# effect. So here we make an ugly hail-mary pass to switch off glob.glob over
+# there. This means when using fullcoverage, Windows path names will not be
+# their actual case.
+
+#sys.fullcoverage = True
+
+# Finally, remove our own directory from sys.path; remove ourselves from
+# sys.modules; and re-import "encodings", which will be the real package
+# this time. Note that the delete from sys.modules dictionary has to
+# happen last, since all of the symbols in this module will become None
+# at that exact moment, including "sys".
+
+parentdir = max(filter(__file__.startswith, sys.path), key=len)
+sys.path.remove(parentdir)
+del sys.modules['encodings']
+import encodings
diff --git a/python/helpers/coverage/html.py b/python/helpers/coverage/html.py
index fffd9b4..5242236 100644
--- a/python/helpers/coverage/html.py
+++ b/python/helpers/coverage/html.py
@@ -1,21 +1,45 @@
"""HTML reporting for Coverage."""
-import os, re, shutil
+import os, re, shutil, sys
import coverage
from coverage.backward import pickle
from coverage.misc import CoverageException, Hasher
-from coverage.phystokens import source_token_lines
+from coverage.phystokens import source_token_lines, source_encoding
from coverage.report import Reporter
+from coverage.results import Numbers
from coverage.templite import Templite
-# Disable pylint msg W0612, because a bunch of variables look unused, but
-# they're accessed in a Templite context via locals().
-# pylint: disable=W0612
-def data_filename(fname):
- """Return the path to a data file of ours."""
- return os.path.join(os.path.split(__file__)[0], fname)
+# Static files are looked for in a list of places.
+STATIC_PATH = [
+ # The place Debian puts system Javascript libraries.
+ "/usr/share/javascript",
+
+ # Our htmlfiles directory.
+ os.path.join(os.path.dirname(__file__), "htmlfiles"),
+]
+
+def data_filename(fname, pkgdir=""):
+ """Return the path to a data file of ours.
+
+ The file is searched for on `STATIC_PATH`, and the first place it's found,
+ is returned.
+
+ Each directory in `STATIC_PATH` is searched as-is, and also, if `pkgdir`
+ is provided, at that subdirectory.
+
+ """
+ for static_dir in STATIC_PATH:
+ static_filename = os.path.join(static_dir, fname)
+ if os.path.exists(static_filename):
+ return static_filename
+ if pkgdir:
+ static_filename = os.path.join(static_dir, pkgdir, fname)
+ if os.path.exists(static_filename):
+ return static_filename
+ raise CoverageException("Couldn't find static file %r" % fname)
+
def data(fname):
"""Return the contents of a data file of ours."""
@@ -31,26 +55,27 @@
# These files will be copied from the htmlfiles dir to the output dir.
STATIC_FILES = [
- "style.css",
- "jquery-1.4.3.min.js",
- "jquery.hotkeys.js",
- "jquery.isonscreen.js",
- "jquery.tablesorter.min.js",
- "coverage_html.js",
- "keybd_closed.png",
- "keybd_open.png",
+ ("style.css", ""),
+ ("jquery.min.js", "jquery"),
+ ("jquery.hotkeys.js", "jquery-hotkeys"),
+ ("jquery.isonscreen.js", "jquery-isonscreen"),
+ ("jquery.tablesorter.min.js", "jquery-tablesorter"),
+ ("coverage_html.js", ""),
+ ("keybd_closed.png", ""),
+ ("keybd_open.png", ""),
]
- def __init__(self, cov, ignore_errors=False):
- super(HtmlReporter, self).__init__(cov, ignore_errors)
+ def __init__(self, cov, config):
+ super(HtmlReporter, self).__init__(cov, config)
self.directory = None
self.template_globals = {
'escape': escape,
+ 'title': self.config.html_title,
'__url__': coverage.__url__,
'__version__': coverage.__version__,
}
self.source_tmpl = Templite(
- data("htmlfiles/pyfile.html"), self.template_globals
+ data("pyfile.html"), self.template_globals
)
self.coverage = cov
@@ -58,29 +83,34 @@
self.files = []
self.arcs = self.coverage.data.has_arcs()
self.status = HtmlStatus()
+ self.extra_css = None
+ self.totals = Numbers()
- def report(self, morfs, config=None):
+ def report(self, morfs):
"""Generate an HTML report for `morfs`.
- `morfs` is a list of modules or filenames. `config` is a
- CoverageConfig instance.
+ `morfs` is a list of modules or filenames.
"""
- assert config.html_dir, "must provide a directory for html reporting"
+ assert self.config.html_dir, "must give a directory for html reporting"
# Read the status data.
- self.status.read(config.html_dir)
+ self.status.read(self.config.html_dir)
# Check that this run used the same settings as the last run.
m = Hasher()
- m.update(config)
+ m.update(self.config)
these_settings = m.digest()
if self.status.settings_hash() != these_settings:
self.status.reset()
self.status.set_settings_hash(these_settings)
+ # The user may have extra CSS they want copied.
+ if self.config.extra_css:
+ self.extra_css = os.path.basename(self.config.extra_css)
+
# Process all the files.
- self.report_files(self.html_file, morfs, config, config.html_dir)
+ self.report_files(self.html_file, morfs, self.config.html_dir)
if not self.files:
raise CoverageException("No data to report.")
@@ -88,13 +118,34 @@
# Write the index file.
self.index_file()
- # Create the once-per-directory files.
- for static in self.STATIC_FILES:
+ self.make_local_static_report_files()
+
+ return self.totals.pc_covered
+
+ def make_local_static_report_files(self):
+ """Make local instances of static files for HTML report."""
+ # The files we provide must always be copied.
+ for static, pkgdir in self.STATIC_FILES:
shutil.copyfile(
- data_filename("htmlfiles/" + static),
+ data_filename(static, pkgdir),
os.path.join(self.directory, static)
)
+ # The user may have extra CSS they want copied.
+ if self.extra_css:
+ shutil.copyfile(
+ self.config.extra_css,
+ os.path.join(self.directory, self.extra_css)
+ )
+
+ def write_html(self, fname, html):
+ """Write `html` to `fname`, properly encoded."""
+ fout = open(fname, "wb")
+ try:
+ fout.write(html.encode('ascii', 'xmlcharrefreplace'))
+ finally:
+ fout.close()
+
def file_hash(self, source, cu):
"""Compute a hash that changes if the file needs to be re-reported."""
m = Hasher()
@@ -121,11 +172,20 @@
self.status.set_file_hash(flat_rootname, this_hash)
+ # If need be, determine the encoding of the source file. We use it
+ # later to properly write the HTML.
+ if sys.version_info < (3, 0):
+ encoding = source_encoding(source)
+ # Some UTF8 files have the dreaded UTF8 BOM. If so, junk it.
+ if encoding.startswith("utf-8") and source[:3] == "\xef\xbb\xbf":
+ source = source[3:]
+ encoding = "utf-8"
+
+ # Get the numbers for this file.
nums = analysis.numbers
- missing_branch_arcs = analysis.missing_branch_arcs()
- n_par = 0 # accumulated below.
- arcs = self.arcs
+ if self.arcs:
+ missing_branch_arcs = analysis.missing_branch_arcs()
# These classes determine which lines are highlighted by default.
c_run = "run hide_run"
@@ -149,7 +209,6 @@
line_class.append(c_mis)
elif self.arcs and lineno in missing_branch_arcs:
line_class.append(c_par)
- n_par += 1
annlines = []
for b in missing_branch_arcs[lineno]:
if b < 0:
@@ -184,19 +243,22 @@
})
# Write the HTML page for this file.
+ html = spaceless(self.source_tmpl.render({
+ 'c_exc': c_exc, 'c_mis': c_mis, 'c_par': c_par, 'c_run': c_run,
+ 'arcs': self.arcs, 'extra_css': self.extra_css,
+ 'cu': cu, 'nums': nums, 'lines': lines,
+ }))
+
+ if sys.version_info < (3, 0):
+ html = html.decode(encoding)
+
html_filename = flat_rootname + ".html"
html_path = os.path.join(self.directory, html_filename)
- html = spaceless(self.source_tmpl.render(locals()))
- fhtml = open(html_path, 'w')
- try:
- fhtml.write(html)
- finally:
- fhtml.close()
+ self.write_html(html_path, html)
# Save this file's information for the index file.
index_info = {
'nums': nums,
- 'par': n_par,
'html_filename': html_filename,
'name': cu.name,
}
@@ -206,19 +268,24 @@
def index_file(self):
"""Write the index.html file for this report."""
index_tmpl = Templite(
- data("htmlfiles/index.html"), self.template_globals
+ data("index.html"), self.template_globals
)
- files = self.files
- arcs = self.arcs
+ self.totals = sum([f['nums'] for f in self.files])
- totals = sum([f['nums'] for f in files])
+ html = index_tmpl.render({
+ 'arcs': self.arcs,
+ 'extra_css': self.extra_css,
+ 'files': self.files,
+ 'totals': self.totals,
+ })
- fhtml = open(os.path.join(self.directory, "index.html"), "w")
- try:
- fhtml.write(index_tmpl.render(locals()))
- finally:
- fhtml.close()
+ if sys.version_info < (3, 0):
+ html = html.decode("utf-8")
+ self.write_html(
+ os.path.join(self.directory, "index.html"),
+ html
+ )
# Write the latest hashes for next time.
self.status.write(self.directory)
@@ -243,8 +310,12 @@
usable = False
try:
status_file = os.path.join(directory, self.STATUS_FILE)
- status = pickle.load(open(status_file, "rb"))
- except IOError:
+ fstatus = open(status_file, "rb")
+ try:
+ status = pickle.load(fstatus)
+ finally:
+ fstatus.close()
+ except (IOError, ValueError):
usable = False
else:
usable = True
@@ -321,5 +392,5 @@
Get rid of some.
"""
- html = re.sub(">\s+<p ", ">\n<p ", html)
+ html = re.sub(r">\s+<p ", ">\n<p ", html)
return html
diff --git a/python/helpers/coverage/htmlfiles/coverage_html.js b/python/helpers/coverage/htmlfiles/coverage_html.js
index da3e22c..b24006d 100644
--- a/python/helpers/coverage/htmlfiles/coverage_html.js
+++ b/python/helpers/coverage/htmlfiles/coverage_html.js
@@ -122,6 +122,11 @@
.bind('keydown', '1', coverage.to_first_chunk)
;
+ $(".button_toggle_run").click(function (evt) {coverage.toggle_lines(evt.target, "run");});
+ $(".button_toggle_exc").click(function (evt) {coverage.toggle_lines(evt.target, "exc");});
+ $(".button_toggle_mis").click(function (evt) {coverage.toggle_lines(evt.target, "mis");});
+ $(".button_toggle_par").click(function (evt) {coverage.toggle_lines(evt.target, "par");});
+
coverage.assign_shortkeys();
coverage.wire_up_help_panel();
};
@@ -369,4 +374,3 @@
coverage.finish_scrolling = function () {
$("html,body").stop(true, true);
};
-
diff --git a/python/helpers/coverage/htmlfiles/index.html b/python/helpers/coverage/htmlfiles/index.html
index 04b314a..c831823 100644
--- a/python/helpers/coverage/htmlfiles/index.html
+++ b/python/helpers/coverage/htmlfiles/index.html
@@ -2,9 +2,12 @@
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
- <title>Coverage report</title>
+ <title>{{ title|escape }}</title>
<link rel='stylesheet' href='style.css' type='text/css'>
- <script type='text/javascript' src='jquery-1.4.3.min.js'></script>
+ {% if extra_css %}
+ <link rel='stylesheet' href='{{ extra_css }}' type='text/css'>
+ {% endif %}
+ <script type='text/javascript' src='jquery.min.js'></script>
<script type='text/javascript' src='jquery.tablesorter.min.js'></script>
<script type='text/javascript' src='jquery.hotkeys.js'></script>
<script type='text/javascript' src='coverage_html.js'></script>
@@ -16,7 +19,7 @@
<div id='header'>
<div class='content'>
- <h1>Coverage report:
+ <h1>{{ title|escape }}:
<span class='pc_cov'>{{totals.pc_covered_str}}%</span>
</h1>
<img id='keyboard_icon' src='keybd_closed.png'>
@@ -66,7 +69,7 @@
<td>{{totals.n_excluded}}</td>
{% if arcs %}
<td>{{totals.n_branches}}</td>
- <td>{{totals.n_missing_branches}}</td>
+ <td>{{totals.n_partial_branches}}</td>
{% endif %}
<td class='right'>{{totals.pc_covered_str}}%</td>
</tr>
@@ -80,7 +83,7 @@
<td>{{file.nums.n_excluded}}</td>
{% if arcs %}
<td>{{file.nums.n_branches}}</td>
- <td>{{file.nums.n_missing_branches}}</td>
+ <td>{{file.nums.n_partial_branches}}</td>
{% endif %}
<td class='right'>{{file.nums.pc_covered_str}}%</td>
</tr>
diff --git a/python/helpers/coverage/htmlfiles/jquery-1.4.3.min.js b/python/helpers/coverage/htmlfiles/jquery.min.js
similarity index 100%
rename from python/helpers/coverage/htmlfiles/jquery-1.4.3.min.js
rename to python/helpers/coverage/htmlfiles/jquery.min.js
diff --git a/python/helpers/coverage/htmlfiles/keybd_closed.png b/python/helpers/coverage/htmlfiles/keybd_closed.png
old mode 100644
new mode 100755
index 6843abf..f2b0418
--- a/python/helpers/coverage/htmlfiles/keybd_closed.png
+++ b/python/helpers/coverage/htmlfiles/keybd_closed.png
Binary files differ
diff --git a/python/helpers/coverage/htmlfiles/keybd_open.png b/python/helpers/coverage/htmlfiles/keybd_open.png
old mode 100644
new mode 100755
index 5a681ea..a77961d
--- a/python/helpers/coverage/htmlfiles/keybd_open.png
+++ b/python/helpers/coverage/htmlfiles/keybd_open.png
Binary files differ
diff --git a/python/helpers/coverage/htmlfiles/pyfile.html b/python/helpers/coverage/htmlfiles/pyfile.html
index ee0a3b1..88c158d 100644
--- a/python/helpers/coverage/htmlfiles/pyfile.html
+++ b/python/helpers/coverage/htmlfiles/pyfile.html
@@ -7,7 +7,10 @@
<meta http-equiv='X-UA-Compatible' content='IE=emulateIE7' />
<title>Coverage for {{cu.name|escape}}: {{nums.pc_covered_str}}%</title>
<link rel='stylesheet' href='style.css' type='text/css'>
- <script type='text/javascript' src='jquery-1.4.3.min.js'></script>
+ {% if extra_css %}
+ <link rel='stylesheet' href='{{ extra_css }}' type='text/css'>
+ {% endif %}
+ <script type='text/javascript' src='jquery.min.js'></script>
<script type='text/javascript' src='jquery.hotkeys.js'></script>
<script type='text/javascript' src='jquery.isonscreen.js'></script>
<script type='text/javascript' src='coverage_html.js'></script>
@@ -24,12 +27,12 @@
</h1>
<img id='keyboard_icon' src='keybd_closed.png'>
<h2 class='stats'>
- {{nums.n_statements}} statements
- <span class='{{c_run}} shortkey_r' onclick='coverage.toggle_lines(this, "run")'>{{nums.n_executed}} run</span>
- <span class='{{c_mis}} shortkey_m' onclick='coverage.toggle_lines(this, "mis")'>{{nums.n_missing}} missing</span>
- <span class='{{c_exc}} shortkey_x' onclick='coverage.toggle_lines(this, "exc")'>{{nums.n_excluded}} excluded</span>
+ {{nums.n_statements}} statements
+ <span class='{{c_run}} shortkey_r button_toggle_run'>{{nums.n_executed}} run</span>
+ <span class='{{c_mis}} shortkey_m button_toggle_mis'>{{nums.n_missing}} missing</span>
+ <span class='{{c_exc}} shortkey_x button_toggle_exc'>{{nums.n_excluded}} excluded</span>
{% if arcs %}
- <span class='{{c_par}} shortkey_p' onclick='coverage.toggle_lines(this, "par")'>{{n_par}} partial</span>
+ <span class='{{c_par}} shortkey_p button_toggle_par'>{{nums.n_partial_branches}} partial</span>
{% endif %}
</h2>
</div>
diff --git a/python/helpers/coverage/htmlfiles/style.css b/python/helpers/coverage/htmlfiles/style.css
index c40357b..811c640 100644
--- a/python/helpers/coverage/htmlfiles/style.css
+++ b/python/helpers/coverage/htmlfiles/style.css
@@ -24,8 +24,8 @@
/* Set base font size to 12/16 */
p {
- font-size: .75em; /* 12/16 */
- line-height: 1.3333em; /* 16/12 */
+ font-size: .75em; /* 12/16 */
+ line-height: 1.33333333em; /* 16/12 */
}
table {
@@ -102,6 +102,31 @@
border-color: #999 #ccc #ccc #999;
}
+.stats span.run {
+ background: #ddffdd;
+}
+.stats span.exc {
+ background: #eeeeee;
+}
+.stats span.mis {
+ background: #ffdddd;
+}
+.stats span.hide_run {
+ background: #eeffee;
+}
+.stats span.hide_exc {
+ background: #f5f5f5;
+}
+.stats span.hide_mis {
+ background: #ffeeee;
+}
+.stats span.par {
+ background: #ffffaa;
+}
+.stats span.hide_par {
+ background: #ffffcc;
+}
+
/* Help panel */
#keyboard_icon {
float: right;
diff --git a/python/helpers/coverage/misc.py b/python/helpers/coverage/misc.py
index fd9be85..0378173 100644
--- a/python/helpers/coverage/misc.py
+++ b/python/helpers/coverage/misc.py
@@ -1,6 +1,10 @@
"""Miscellaneous stuff for Coverage."""
+import errno
import inspect
+import os
+import sys
+
from coverage.backward import md5, sorted # pylint: disable=W0622
from coverage.backward import string_class, to_bytes
@@ -34,6 +38,8 @@
i = 0
j = 0
start = None
+ statements = sorted(statements)
+ lines = sorted(lines)
while i < len(statements) and j < len(lines):
if statements[i] == lines[j]:
if start == None:
@@ -50,6 +56,12 @@
return ret
+def short_stack():
+ """Return a string summarizing the call stack."""
+ stack = inspect.stack()[:0:-1]
+ return "\n".join(["%30s : %s @%d" % (t[3],t[1],t[2]) for t in stack])
+
+
def expensive(fn):
"""A decorator to cache the result of an expensive operation.
@@ -76,13 +88,23 @@
def join_regex(regexes):
"""Combine a list of regexes into one that matches any of them."""
if len(regexes) > 1:
- return "(" + ")|(".join(regexes) + ")"
+ return "|".join(["(%s)" % r for r in regexes])
elif regexes:
return regexes[0]
else:
return ""
+def file_be_gone(path):
+ """Remove a file, and don't get annoyed if it doesn't exist."""
+ try:
+ os.remove(path)
+ except OSError:
+ _, e, _ = sys.exc_info()
+ if e.errno != errno.ENOENT:
+ raise
+
+
class Hasher(object):
"""Hashes Python data into md5."""
def __init__(self):
@@ -93,8 +115,10 @@
self.md5.update(to_bytes(str(type(v))))
if isinstance(v, string_class):
self.md5.update(to_bytes(v))
+ elif v is None:
+ pass
elif isinstance(v, (int, float)):
- self.update(str(v))
+ self.md5.update(to_bytes(str(v)))
elif isinstance(v, (tuple, list)):
for e in v:
self.update(e)
@@ -126,6 +150,10 @@
"""We couldn't find the source for a module."""
pass
+class NoCode(NoSource):
+ """We couldn't find any code at all."""
+ pass
+
class NotPython(CoverageException):
"""A source file turned out not to be parsable Python."""
pass
diff --git a/python/helpers/coverage/parser.py b/python/helpers/coverage/parser.py
index cbbb5a6..7a145a2 100644
--- a/python/helpers/coverage/parser.py
+++ b/python/helpers/coverage/parser.py
@@ -1,9 +1,11 @@
"""Code parsing for Coverage."""
-import glob, opcode, os, re, sys, token, tokenize
+import dis, re, sys, token, tokenize
from coverage.backward import set, sorted, StringIO # pylint: disable=W0622
-from coverage.backward import open_source
+from coverage.backward import open_source, range # pylint: disable=W0622
+from coverage.backward import reversed # pylint: disable=W0622
+from coverage.backward import bytes_to_ints
from coverage.bytecode import ByteCodes, CodeObjects
from coverage.misc import nice_pair, expensive, join_regex
from coverage.misc import CoverageException, NoSource, NotPython
@@ -32,9 +34,13 @@
except IOError:
_, err, _ = sys.exc_info()
raise NoSource(
- "No source for code: %r: %s" % (self.filename, err)
+ "No source for code: '%s': %s" % (self.filename, err)
)
+ # Scrap the BOM if it exists.
+ if self.text and ord(self.text[0]) == 0xfeff:
+ self.text = self.text[1:]
+
self.exclude = exclude
self.show_tokens = False
@@ -102,9 +108,9 @@
first_line = None
empty = True
- tokgen = tokenize.generate_tokens(StringIO(self.text).readline)
+ tokgen = generate_tokens(self.text)
for toktype, ttext, (slineno, _), (elineno, _), ltext in tokgen:
- if self.show_tokens: # pragma: no cover
+ if self.show_tokens: # pragma: not covered
print("%10s %5s %-20r %r" % (
tokenize.tok_name.get(toktype, toktype),
nice_pair((slineno, elineno)), ttext, ltext
@@ -130,8 +136,7 @@
# (a trick from trace.py in the stdlib.) This works for
# 99.9999% of cases. For the rest (!) see:
# http://stackoverflow.com/questions/1769332/x/1769794#1769794
- for i in range(slineno, elineno+1):
- self.docstrings.add(i)
+ self.docstrings.update(range(slineno, elineno+1))
elif toktype == token.NEWLINE:
if first_line is not None and elineno != first_line:
# We're at the end of a line, and we've ended on a
@@ -170,16 +175,18 @@
first_line = line
return first_line
- def first_lines(self, lines, ignore=None):
+ def first_lines(self, lines, *ignores):
"""Map the line numbers in `lines` to the correct first line of the
statement.
- Skip any line mentioned in `ignore`.
+ Skip any line mentioned in any of the sequences in `ignores`.
- Returns a sorted list of the first lines.
+ Returns a set of the first lines.
"""
- ignore = ignore or []
+ ignore = set()
+ for ign in ignores:
+ ignore.update(ign)
lset = set()
for l in lines:
if l in ignore:
@@ -187,23 +194,34 @@
new_l = self.first_line(l)
if new_l not in ignore:
lset.add(new_l)
- return sorted(lset)
+ return lset
def parse_source(self):
"""Parse source text to find executable lines, excluded lines, etc.
- Return values are 1) a sorted list of executable line numbers, and
- 2) a sorted list of excluded line numbers.
+ Return values are 1) a set of executable line numbers, and 2) a set of
+ excluded line numbers.
Reported line numbers are normalized to the first line of multi-line
statements.
"""
- self._raw_parse()
+ try:
+ self._raw_parse()
+ except (tokenize.TokenError, IndentationError):
+ _, tokerr, _ = sys.exc_info()
+ msg, lineno = tokerr.args
+ raise NotPython(
+ "Couldn't parse '%s' as Python source: '%s' at %s" %
+ (self.filename, msg, lineno)
+ )
excluded_lines = self.first_lines(self.excluded)
- ignore = excluded_lines + list(self.docstrings)
- lines = self.first_lines(self.statement_starts, ignore)
+ lines = self.first_lines(
+ self.statement_starts,
+ excluded_lines,
+ self.docstrings
+ )
return lines, excluded_lines
@@ -258,8 +276,8 @@
## Opcodes that guide the ByteParser.
def _opcode(name):
- """Return the opcode by name from the opcode module."""
- return opcode.opmap[name]
+ """Return the opcode by name from the dis module."""
+ return dis.opmap[name]
def _opcode_set(*names):
"""Return a set of opcodes by the names in `names`."""
@@ -297,7 +315,7 @@
OPS_POP_BLOCK = _opcode_set('POP_BLOCK')
# Opcodes that have a jump destination, but aren't really a jump.
-OPS_NO_JUMP = _opcode_set('SETUP_EXCEPT', 'SETUP_FINALLY')
+OPS_NO_JUMP = OPS_PUSH_BLOCK
# Individual opcodes we need below.
OP_BREAK_LOOP = _opcode('BREAK_LOOP')
@@ -314,6 +332,7 @@
def __init__(self, code=None, text=None, filename=None):
if code:
self.code = code
+ self.text = text
else:
if not text:
assert filename, "If no code or text, need a filename"
@@ -322,6 +341,7 @@
text = sourcef.read()
finally:
sourcef.close()
+ self.text = text
try:
# Python 2.3 and 2.4 don't like partial last lines, so be sure
@@ -350,69 +370,54 @@
The iteration includes `self` as its first value.
"""
- return map(lambda c: ByteParser(code=c), CodeObjects(self.code))
-
- # Getting numbers from the lnotab value changed in Py3.0.
- if sys.version_info >= (3, 0):
- def _lnotab_increments(self, lnotab):
- """Return a list of ints from the lnotab bytes in 3.x"""
- return list(lnotab)
- else:
- def _lnotab_increments(self, lnotab):
- """Return a list of ints from the lnotab string in 2.x"""
- return [ord(c) for c in lnotab]
+ children = CodeObjects(self.code)
+ return [ByteParser(code=c, text=self.text) for c in children]
def _bytes_lines(self):
"""Map byte offsets to line numbers in `code`.
Uses co_lnotab described in Python/compile.c to map byte offsets to
- line numbers. Returns a list: [(b0, l0), (b1, l1), ...]
+ line numbers. Produces a sequence: (b0, l0), (b1, l1), ...
+
+ Only byte offsets that correspond to line numbers are included in the
+ results.
"""
# Adapted from dis.py in the standard library.
- byte_increments = self._lnotab_increments(self.code.co_lnotab[0::2])
- line_increments = self._lnotab_increments(self.code.co_lnotab[1::2])
+ byte_increments = bytes_to_ints(self.code.co_lnotab[0::2])
+ line_increments = bytes_to_ints(self.code.co_lnotab[1::2])
- bytes_lines = []
last_line_num = None
line_num = self.code.co_firstlineno
byte_num = 0
for byte_incr, line_incr in zip(byte_increments, line_increments):
if byte_incr:
if line_num != last_line_num:
- bytes_lines.append((byte_num, line_num))
+ yield (byte_num, line_num)
last_line_num = line_num
byte_num += byte_incr
line_num += line_incr
if line_num != last_line_num:
- bytes_lines.append((byte_num, line_num))
- return bytes_lines
+ yield (byte_num, line_num)
def _find_statements(self):
"""Find the statements in `self.code`.
- Return a set of line numbers that start statements. Recurses into all
- code objects reachable from `self.code`.
+ Produce a sequence of line numbers that start statements. Recurses
+ into all code objects reachable from `self.code`.
"""
- stmts = set()
for bp in self.child_parsers():
# Get all of the lineno information from this code.
for _, l in bp._bytes_lines():
- stmts.add(l)
- return stmts
+ yield l
- def _disassemble(self): # pragma: no cover
- """Disassemble code, for ad-hoc experimenting."""
-
- import dis
-
- for bp in self.child_parsers():
- print("\n%s: " % bp.code)
- dis.dis(bp.code)
- print("Bytes lines: %r" % bp._bytes_lines())
-
- print("")
+ def _block_stack_repr(self, block_stack):
+ """Get a string version of `block_stack`, for debugging."""
+ blocks = ", ".join(
+ ["(%s, %r)" % (dis.opname[b[0]], b[1]) for b in block_stack]
+ )
+ return "[" + blocks + "]"
def _split_into_chunks(self):
"""Split the code object into a list of `Chunk` objects.
@@ -423,10 +428,11 @@
Returns a list of `Chunk` objects.
"""
-
# The list of chunks so far, and the one we're working on.
chunks = []
chunk = None
+
+ # A dict mapping byte offsets of line starts to the line numbers.
bytes_lines_map = dict(self._bytes_lines())
# The block stack: loops and try blocks get pushed here for the
@@ -441,24 +447,38 @@
# We have to handle the last two bytecodes specially.
ult = penult = None
- for bc in ByteCodes(self.code.co_code):
+ # Get a set of all of the jump-to points.
+ jump_to = set()
+ bytecodes = list(ByteCodes(self.code.co_code))
+ for bc in bytecodes:
+ if bc.jump_to >= 0:
+ jump_to.add(bc.jump_to)
+
+ chunk_lineno = 0
+
+ # Walk the byte codes building chunks.
+ for bc in bytecodes:
# Maybe have to start a new chunk
+ start_new_chunk = False
+ first_chunk = False
if bc.offset in bytes_lines_map:
# Start a new chunk for each source line number.
- if chunk:
- chunk.exits.add(bc.offset)
- chunk = Chunk(bc.offset, bytes_lines_map[bc.offset])
- chunks.append(chunk)
+ start_new_chunk = True
+ chunk_lineno = bytes_lines_map[bc.offset]
+ first_chunk = True
+ elif bc.offset in jump_to:
+ # To make chunks have a single entrance, we have to make a new
+ # chunk when we get to a place some bytecode jumps to.
+ start_new_chunk = True
elif bc.op in OPS_CHUNK_BEGIN:
# Jumps deserve their own unnumbered chunk. This fixes
# problems with jumps to jumps getting confused.
+ start_new_chunk = True
+
+ if not chunk or start_new_chunk:
if chunk:
chunk.exits.add(bc.offset)
- chunk = Chunk(bc.offset)
- chunks.append(chunk)
-
- if not chunk:
- chunk = Chunk(bc.offset)
+ chunk = Chunk(bc.offset, chunk_lineno, first_chunk)
chunks.append(chunk)
# Look at the opcode
@@ -487,15 +507,11 @@
chunk.exits.add(block_stack[-1][1])
chunk = None
if bc.op == OP_END_FINALLY:
- if block_stack:
- # A break that goes through a finally will jump to whatever
- # block is on top of the stack.
- chunk.exits.add(block_stack[-1][1])
# For the finally clause we need to find the closest exception
# block, and use its jump target as an exit.
- for iblock in range(len(block_stack)-1, -1, -1):
- if block_stack[iblock][0] in OPS_EXCEPT_BLOCKS:
- chunk.exits.add(block_stack[iblock][1])
+ for block in reversed(block_stack):
+ if block[0] in OPS_EXCEPT_BLOCKS:
+ chunk.exits.add(block[1])
break
if bc.op == OP_COMPARE_OP and bc.arg == COMPARE_EXCEPTION:
# This is an except clause. We want to overlook the next
@@ -521,23 +537,33 @@
last_chunk = chunks[-1]
last_chunk.exits.remove(ex)
last_chunk.exits.add(penult.offset)
- chunk = Chunk(penult.offset)
+ chunk = Chunk(
+ penult.offset, last_chunk.line, False
+ )
chunk.exits.add(ex)
chunks.append(chunk)
# Give all the chunks a length.
- chunks[-1].length = bc.next_offset - chunks[-1].byte
+ chunks[-1].length = bc.next_offset - chunks[-1].byte # pylint: disable=W0631,C0301
for i in range(len(chunks)-1):
chunks[i].length = chunks[i+1].byte - chunks[i].byte
+ #self.validate_chunks(chunks)
return chunks
+ def validate_chunks(self, chunks):
+ """Validate the rule that chunks have a single entrance."""
+ # starts is the entrances to the chunks
+ starts = set([ch.byte for ch in chunks])
+ for ch in chunks:
+ assert all([(ex in starts or ex < 0) for ex in ch.exits])
+
def _arcs(self):
"""Find the executable arcs in the code.
- Returns a set of pairs, (from,to). From and to are integer line
- numbers. If from is < 0, then the arc is an entrance into the code
- object. If to is < 0, the arc is an exit from the code object.
+ Yields pairs: (from,to). From and to are integer line numbers. If
+ from is < 0, then the arc is an entrance into the code object. If to
+ is < 0, the arc is an exit from the code object.
"""
chunks = self._split_into_chunks()
@@ -545,65 +571,43 @@
# A map from byte offsets to chunks jumped into.
byte_chunks = dict([(c.byte, c) for c in chunks])
- # Build a map from byte offsets to actual lines reached.
- byte_lines = {}
- bytes_to_add = set([c.byte for c in chunks])
+ # There's always an entrance at the first chunk.
+ yield (-1, byte_chunks[0].line)
- while bytes_to_add:
- byte_to_add = bytes_to_add.pop()
- if byte_to_add in byte_lines or byte_to_add < 0:
+ # Traverse from the first chunk in each line, and yield arcs where
+ # the trace function will be invoked.
+ for chunk in chunks:
+ if not chunk.first:
continue
- # Which lines does this chunk lead to?
- bytes_considered = set()
- bytes_to_consider = [byte_to_add]
- lines = set()
+ chunks_considered = set()
+ chunks_to_consider = [chunk]
+ while chunks_to_consider:
+ # Get the chunk we're considering, and make sure we don't
+ # consider it again
+ this_chunk = chunks_to_consider.pop()
+ chunks_considered.add(this_chunk)
- while bytes_to_consider:
- byte = bytes_to_consider.pop()
- bytes_considered.add(byte)
-
- # Find chunk for byte
- try:
- ch = byte_chunks[byte]
- except KeyError:
- for ch in chunks:
- if ch.byte <= byte < ch.byte+ch.length:
- break
- else:
- # No chunk for this byte!
- raise Exception("Couldn't find chunk @ %d" % byte)
- byte_chunks[byte] = ch
-
- if ch.line:
- lines.add(ch.line)
- else:
- for ex in ch.exits:
- if ex < 0:
- lines.add(ex)
- elif ex not in bytes_considered:
- bytes_to_consider.append(ex)
-
- bytes_to_add.update(ch.exits)
-
- byte_lines[byte_to_add] = lines
-
- # Figure out for each chunk where the exits go.
- arcs = set()
- for chunk in chunks:
- if chunk.line:
- for ex in chunk.exits:
+ # For each exit, add the line number if the trace function
+ # would be triggered, or add the chunk to those being
+ # considered if not.
+ for ex in this_chunk.exits:
if ex < 0:
- exit_lines = [ex]
+ yield (chunk.line, ex)
else:
- exit_lines = byte_lines[ex]
- for exit_line in exit_lines:
- if chunk.line != exit_line:
- arcs.add((chunk.line, exit_line))
- for line in byte_lines[0]:
- arcs.add((-1, line))
+ next_chunk = byte_chunks[ex]
+ if next_chunk in chunks_considered:
+ continue
- return arcs
+ # The trace function is invoked if visiting the first
+ # bytecode in a line, or if the transition is a
+ # backward jump.
+ backward_jump = next_chunk.byte < this_chunk.byte
+ if next_chunk.first or backward_jump:
+ if next_chunk.line != chunk.line:
+ yield (chunk.line, next_chunk.line)
+ else:
+ chunks_to_consider.append(next_chunk)
def _all_chunks(self):
"""Returns a list of `Chunk` objects for this code and its children.
@@ -631,11 +635,11 @@
class Chunk(object):
- """A sequence of bytecodes with a single entrance.
+ """A sequence of byte codes with a single entrance.
To analyze byte code, we have to divide it into chunks, sequences of byte
- codes such that each basic block has only one entrance, the first
- instruction in the block.
+ codes such that each chunk has only one entrance, the first instruction in
+ the block.
This is almost the CS concept of `basic block`_, except that we're willing
to have many exits from a chunk, and "basic block" is a more cumbersome
@@ -643,158 +647,54 @@
.. _basic block: http://en.wikipedia.org/wiki/Basic_block
+ `line` is the source line number containing this chunk.
+
+ `first` is true if this is the first chunk in the source line.
+
An exit < 0 means the chunk can leave the code (return). The exit is
the negative of the starting line number of the code block.
"""
- def __init__(self, byte, line=0):
+ def __init__(self, byte, line, first):
self.byte = byte
self.line = line
+ self.first = first
self.length = 0
self.exits = set()
def __repr__(self):
- return "<%d+%d @%d %r>" % (
- self.byte, self.length, self.line, list(self.exits)
- )
-
-
-class AdHocMain(object): # pragma: no cover
- """An ad-hoc main for code parsing experiments."""
-
- def main(self, args):
- """A main function for trying the code from the command line."""
-
- from optparse import OptionParser
-
- parser = OptionParser()
- parser.add_option(
- "-c", action="store_true", dest="chunks",
- help="Show basic block chunks"
- )
- parser.add_option(
- "-d", action="store_true", dest="dis",
- help="Disassemble"
- )
- parser.add_option(
- "-R", action="store_true", dest="recursive",
- help="Recurse to find source files"
- )
- parser.add_option(
- "-s", action="store_true", dest="source",
- help="Show analyzed source"
- )
- parser.add_option(
- "-t", action="store_true", dest="tokens",
- help="Show tokens"
- )
-
- options, args = parser.parse_args()
- if options.recursive:
- if args:
- root = args[0]
- else:
- root = "."
- for root, _, _ in os.walk(root):
- for f in glob.glob(root + "/*.py"):
- self.adhoc_one_file(options, f)
+ if self.first:
+ bang = "!"
else:
- self.adhoc_one_file(options, args[0])
+ bang = ""
+ return "<%d+%d @%d%s %r>" % (
+ self.byte, self.length, self.line, bang, list(self.exits)
+ )
- def adhoc_one_file(self, options, filename):
- """Process just one file."""
- if options.dis or options.chunks:
- try:
- bp = ByteParser(filename=filename)
- except CoverageException:
- _, err, _ = sys.exc_info()
- print("%s" % (err,))
- return
+class CachedTokenizer(object):
+ """A one-element cache around tokenize.generate_tokens.
- if options.dis:
- print("Main code:")
- bp._disassemble()
+ When reporting, coverage.py tokenizes files twice, once to find the
+ structure of the file, and once to syntax-color it. Tokenizing is
+ expensive, and easily cached.
- if options.chunks:
- chunks = bp._all_chunks()
- if options.recursive:
- print("%6d: %s" % (len(chunks), filename))
- else:
- print("Chunks: %r" % chunks)
- arcs = bp._all_arcs()
- print("Arcs: %r" % sorted(arcs))
+ This is a one-element cache so that our twice-in-a-row tokenizing doesn't
+ actually tokenize twice.
- if options.source or options.tokens:
- cp = CodeParser(filename=filename, exclude=r"no\s*cover")
- cp.show_tokens = options.tokens
- cp._raw_parse()
+ """
+ def __init__(self):
+ self.last_text = None
+ self.last_tokens = None
- if options.source:
- if options.chunks:
- arc_width, arc_chars = self.arc_ascii_art(arcs)
- else:
- arc_width, arc_chars = 0, {}
+ def generate_tokens(self, text):
+ """A stand-in for `tokenize.generate_tokens`."""
+ if text != self.last_text:
+ self.last_text = text
+ self.last_tokens = list(
+ tokenize.generate_tokens(StringIO(text).readline)
+ )
+ return self.last_tokens
- exit_counts = cp.exit_counts()
-
- for i, ltext in enumerate(cp.lines):
- lineno = i+1
- m0 = m1 = m2 = m3 = a = ' '
- if lineno in cp.statement_starts:
- m0 = '-'
- exits = exit_counts.get(lineno, 0)
- if exits > 1:
- m1 = str(exits)
- if lineno in cp.docstrings:
- m2 = '"'
- if lineno in cp.classdefs:
- m2 = 'C'
- if lineno in cp.excluded:
- m3 = 'x'
- a = arc_chars.get(lineno, '').ljust(arc_width)
- print("%4d %s%s%s%s%s %s" %
- (lineno, m0, m1, m2, m3, a, ltext)
- )
-
- def arc_ascii_art(self, arcs):
- """Draw arcs as ascii art.
-
- Returns a width of characters needed to draw all the arcs, and a
- dictionary mapping line numbers to ascii strings to draw for that line.
-
- """
- arc_chars = {}
- for lfrom, lto in sorted(arcs):
- if lfrom < 0:
- arc_chars[lto] = arc_chars.get(lto, '') + 'v'
- elif lto < 0:
- arc_chars[lfrom] = arc_chars.get(lfrom, '') + '^'
- else:
- if lfrom == lto - 1:
- # Don't show obvious arcs.
- continue
- if lfrom < lto:
- l1, l2 = lfrom, lto
- else:
- l1, l2 = lto, lfrom
- w = max([len(arc_chars.get(l, '')) for l in range(l1, l2+1)])
- for l in range(l1, l2+1):
- if l == lfrom:
- ch = '<'
- elif l == lto:
- ch = '>'
- else:
- ch = '|'
- arc_chars[l] = arc_chars.get(l, '').ljust(w) + ch
- arc_width = 0
-
- if arc_chars:
- arc_width = max([len(a) for a in arc_chars.values()])
- else:
- arc_width = 0
-
- return arc_width, arc_chars
-
-if __name__ == '__main__':
- AdHocMain().main(sys.argv[1:])
+# Create our generate_tokens cache as a callable replacement function.
+generate_tokens = CachedTokenizer().generate_tokens
diff --git a/python/helpers/coverage/phystokens.py b/python/helpers/coverage/phystokens.py
index fc4f2c9..99b1d5ba 100644
--- a/python/helpers/coverage/phystokens.py
+++ b/python/helpers/coverage/phystokens.py
@@ -1,7 +1,9 @@
"""Better tokenizing for coverage.py."""
-import keyword, re, token, tokenize
-from coverage.backward import StringIO # pylint: disable=W0622
+import codecs, keyword, re, sys, token, tokenize
+from coverage.backward import set # pylint: disable=W0622
+from coverage.parser import generate_tokens
+
def phys_tokens(toks):
"""Return all physical tokens, even line continuations.
@@ -18,7 +20,7 @@
last_ttype = None
for ttype, ttext, (slineno, scol), (elineno, ecol), ltext in toks:
if last_lineno != elineno:
- if last_line and last_line[-2:] == "\\\n":
+ if last_line and last_line.endswith("\\\n"):
# We are at the beginning of a new line, and the last line
# ended with a backslash. We probably have to inject a
# backslash token into the stream. Unfortunately, there's more
@@ -74,11 +76,11 @@
is indistinguishable from a final line with a newline.
"""
- ws_tokens = [token.INDENT, token.DEDENT, token.NEWLINE, tokenize.NL]
+ ws_tokens = set([token.INDENT, token.DEDENT, token.NEWLINE, tokenize.NL])
line = []
col = 0
source = source.expandtabs(8).replace('\r\n', '\n')
- tokgen = tokenize.generate_tokens(StringIO(source).readline)
+ tokgen = generate_tokens(source)
for ttype, ttext, (_, scol), (_, ecol), _ in phys_tokens(tokgen):
mark_start = True
for part in re.split('(\n)', ttext):
@@ -106,3 +108,103 @@
if line:
yield line
+
+def source_encoding(source):
+ """Determine the encoding for `source` (a string), according to PEP 263.
+
+ Returns a string, the name of the encoding.
+
+ """
+ # Note: this function should never be called on Python 3, since py3 has
+ # built-in tools to do this.
+ assert sys.version_info < (3, 0)
+
+ # This is mostly code adapted from Py3.2's tokenize module.
+
+ cookie_re = re.compile(r"coding[:=]\s*([-\w.]+)")
+
+ # Do this so the detect_encode code we copied will work.
+ readline = iter(source.splitlines(True)).next
+
+ def _get_normal_name(orig_enc):
+ """Imitates get_normal_name in tokenizer.c."""
+ # Only care about the first 12 characters.
+ enc = orig_enc[:12].lower().replace("_", "-")
+ if re.match(r"^utf-8($|-)", enc):
+ return "utf-8"
+ if re.match(r"^(latin-1|iso-8859-1|iso-latin-1)($|-)", enc):
+ return "iso-8859-1"
+ return orig_enc
+
+ # From detect_encode():
+ # It detects the encoding from the presence of a utf-8 bom or an encoding
+ # cookie as specified in pep-0263. If both a bom and a cookie are present,
+ # but disagree, a SyntaxError will be raised. If the encoding cookie is an
+ # invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found,
+ # 'utf-8-sig' is returned.
+
+ # If no encoding is specified, then the default will be returned. The
+ # default varied with version.
+
+ if sys.version_info <= (2, 4):
+ default = 'iso-8859-1'
+ else:
+ default = 'ascii'
+
+ bom_found = False
+ encoding = None
+
+ def read_or_stop():
+ """Get the next source line, or ''."""
+ try:
+ return readline()
+ except StopIteration:
+ return ''
+
+ def find_cookie(line):
+ """Find an encoding cookie in `line`."""
+ try:
+ line_string = line.decode('ascii')
+ except UnicodeDecodeError:
+ return None
+
+ matches = cookie_re.findall(line_string)
+ if not matches:
+ return None
+ encoding = _get_normal_name(matches[0])
+ try:
+ codec = codecs.lookup(encoding)
+ except LookupError:
+ # This behaviour mimics the Python interpreter
+ raise SyntaxError("unknown encoding: " + encoding)
+
+ if bom_found:
+ # codecs in 2.3 were raw tuples of functions, assume the best.
+ codec_name = getattr(codec, 'name', encoding)
+ if codec_name != 'utf-8':
+ # This behaviour mimics the Python interpreter
+ raise SyntaxError('encoding problem: utf-8')
+ encoding += '-sig'
+ return encoding
+
+ first = read_or_stop()
+ if first.startswith(codecs.BOM_UTF8):
+ bom_found = True
+ first = first[3:]
+ default = 'utf-8-sig'
+ if not first:
+ return default
+
+ encoding = find_cookie(first)
+ if encoding:
+ return encoding
+
+ second = read_or_stop()
+ if not second:
+ return default
+
+ encoding = find_cookie(second)
+ if encoding:
+ return encoding
+
+ return default
diff --git a/python/helpers/coverage/report.py b/python/helpers/coverage/report.py
index 6c5510a..34f4442 100644
--- a/python/helpers/coverage/report.py
+++ b/python/helpers/coverage/report.py
@@ -2,20 +2,21 @@
import fnmatch, os
from coverage.codeunit import code_unit_factory
+from coverage.files import prep_patterns
from coverage.misc import CoverageException, NoSource, NotPython
class Reporter(object):
"""A base class for all reporters."""
- def __init__(self, coverage, ignore_errors=False):
+ def __init__(self, coverage, config):
"""Create a reporter.
- `coverage` is the coverage instance. `ignore_errors` controls how
- skittish the reporter will be during file processing.
+ `coverage` is the coverage instance. `config` is an instance of
+ CoverageConfig, for controlling all sorts of behavior.
"""
self.coverage = coverage
- self.ignore_errors = ignore_errors
+ self.config = config
# The code units to report on. Set by find_code_units.
self.code_units = []
@@ -24,19 +25,18 @@
# classes.
self.directory = None
- def find_code_units(self, morfs, config):
+ def find_code_units(self, morfs):
"""Find the code units we'll report on.
- `morfs` is a list of modules or filenames. `config` is a
- CoverageConfig instance.
+ `morfs` is a list of modules or filenames.
"""
morfs = morfs or self.coverage.data.measured_files()
file_locator = self.coverage.file_locator
self.code_units = code_unit_factory(morfs, file_locator)
- if config.include:
- patterns = [file_locator.abs_file(p) for p in config.include]
+ if self.config.include:
+ patterns = prep_patterns(self.config.include)
filtered = []
for cu in self.code_units:
for pattern in patterns:
@@ -45,8 +45,8 @@
break
self.code_units = filtered
- if config.omit:
- patterns = [file_locator.abs_file(p) for p in config.omit]
+ if self.config.omit:
+ patterns = prep_patterns(self.config.omit)
filtered = []
for cu in self.code_units:
for pattern in patterns:
@@ -58,7 +58,7 @@
self.code_units.sort()
- def report_files(self, report_fn, morfs, config, directory=None):
+ def report_files(self, report_fn, morfs, directory=None):
"""Run a reporting function on a number of morfs.
`report_fn` is called for each relative morf in `morfs`. It is called
@@ -69,10 +69,8 @@
where `code_unit` is the `CodeUnit` for the morf, and `analysis` is
the `Analysis` for the morf.
- `config` is a CoverageConfig instance.
-
"""
- self.find_code_units(morfs, config)
+ self.find_code_units(morfs)
if not self.code_units:
raise CoverageException("No data to report.")
@@ -84,6 +82,11 @@
for cu in self.code_units:
try:
report_fn(cu, self.coverage._analyze(cu))
- except (NoSource, NotPython):
- if not self.ignore_errors:
+ except NoSource:
+ if not self.config.ignore_errors:
+ raise
+ except NotPython:
+ # Only report errors for .py files, and only if we didn't
+ # explicitly suppress those errors.
+ if cu.should_be_python() and not self.config.ignore_errors:
raise
diff --git a/python/helpers/coverage/results.py b/python/helpers/coverage/results.py
index adfb8f4..db6df0d 100644
--- a/python/helpers/coverage/results.py
+++ b/python/helpers/coverage/results.py
@@ -2,7 +2,7 @@
import os
-from coverage.backward import set, sorted # pylint: disable=W0622
+from coverage.backward import iitems, set, sorted # pylint: disable=W0622
from coverage.misc import format_lines, join_regex, NoSource
from coverage.parser import CodeParser
@@ -15,16 +15,10 @@
self.code_unit = code_unit
self.filename = self.code_unit.filename
- ext = os.path.splitext(self.filename)[1]
- source = None
- if ext == '.py':
- if not os.path.exists(self.filename):
- source = self.coverage.file_locator.get_zip_data(self.filename)
- if not source:
- raise NoSource("No source for code: %r" % self.filename)
+ actual_filename, source = self.find_source(self.filename)
self.parser = CodeParser(
- text=source, filename=self.filename,
+ text=source, filename=actual_filename,
exclude=self.coverage._exclude_regex('exclude')
)
self.statements, self.excluded = self.parser.parse_source()
@@ -32,7 +26,7 @@
# Identify missing statements.
executed = self.coverage.data.executed_lines(self.filename)
exec1 = self.parser.first_lines(executed)
- self.missing = sorted(set(self.statements) - set(exec1))
+ self.missing = self.statements - exec1
if self.coverage.data.has_arcs():
self.no_branch = self.parser.lines_matching(
@@ -41,9 +35,12 @@
)
n_branches = self.total_branches()
mba = self.missing_branch_arcs()
- n_missing_branches = sum([len(v) for v in mba.values()])
+ n_partial_branches = sum(
+ [len(v) for k,v in iitems(mba) if k not in self.missing]
+ )
+ n_missing_branches = sum([len(v) for k,v in iitems(mba)])
else:
- n_branches = n_missing_branches = 0
+ n_branches = n_partial_branches = n_missing_branches = 0
self.no_branch = set()
self.numbers = Numbers(
@@ -52,9 +49,48 @@
n_excluded=len(self.excluded),
n_missing=len(self.missing),
n_branches=n_branches,
+ n_partial_branches=n_partial_branches,
n_missing_branches=n_missing_branches,
)
+ def find_source(self, filename):
+ """Find the source for `filename`.
+
+ Returns two values: the actual filename, and the source.
+
+ The source returned depends on which of these cases holds:
+
+ * The filename seems to be a non-source file: returns None
+
+ * The filename is a source file, and actually exists: returns None.
+
+ * The filename is a source file, and is in a zip file or egg:
+ returns the source.
+
+ * The filename is a source file, but couldn't be found: raises
+ `NoSource`.
+
+ """
+ source = None
+
+ base, ext = os.path.splitext(filename)
+ TRY_EXTS = {
+ '.py': ['.py', '.pyw'],
+ '.pyw': ['.pyw'],
+ }
+ try_exts = TRY_EXTS.get(ext)
+ if not try_exts:
+ return filename, None
+
+ for try_ext in try_exts:
+ try_filename = base + try_ext
+ if os.path.exists(try_filename):
+ return try_filename, None
+ source = self.coverage.file_locator.get_zip_data(try_filename)
+ if source:
+ return try_filename, source
+ raise NoSource("No source for code: '%s'" % filename)
+
def missing_formatted(self):
"""The missing line numbers, formatted nicely.
@@ -107,7 +143,7 @@
def branch_lines(self):
"""Returns a list of line numbers that have more than one exit."""
exit_counts = self.parser.exit_counts()
- return [l1 for l1,count in exit_counts.items() if count > 1]
+ return [l1 for l1,count in iitems(exit_counts) if count > 1]
def total_branches(self):
"""How many total branches are there?"""
@@ -164,13 +200,14 @@
_near100 = 99.0
def __init__(self, n_files=0, n_statements=0, n_excluded=0, n_missing=0,
- n_branches=0, n_missing_branches=0
+ n_branches=0, n_partial_branches=0, n_missing_branches=0
):
self.n_files = n_files
self.n_statements = n_statements
self.n_excluded = n_excluded
self.n_missing = n_missing
self.n_branches = n_branches
+ self.n_partial_branches = n_partial_branches
self.n_missing_branches = n_missing_branches
def set_precision(cls, precision):
@@ -234,8 +271,12 @@
nums.n_excluded = self.n_excluded + other.n_excluded
nums.n_missing = self.n_missing + other.n_missing
nums.n_branches = self.n_branches + other.n_branches
- nums.n_missing_branches = (self.n_missing_branches +
- other.n_missing_branches)
+ nums.n_partial_branches = (
+ self.n_partial_branches + other.n_partial_branches
+ )
+ nums.n_missing_branches = (
+ self.n_missing_branches + other.n_missing_branches
+ )
return nums
def __radd__(self, other):
diff --git a/python/helpers/coverage/summary.py b/python/helpers/coverage/summary.py
index 599ae78..c99c530 100644
--- a/python/helpers/coverage/summary.py
+++ b/python/helpers/coverage/summary.py
@@ -4,24 +4,23 @@
from coverage.report import Reporter
from coverage.results import Numbers
+from coverage.misc import NotPython
class SummaryReporter(Reporter):
"""A reporter for writing the summary report."""
- def __init__(self, coverage, show_missing=True, ignore_errors=False):
- super(SummaryReporter, self).__init__(coverage, ignore_errors)
- self.show_missing = show_missing
+ def __init__(self, coverage, config):
+ super(SummaryReporter, self).__init__(coverage, config)
self.branches = coverage.data.has_arcs()
- def report(self, morfs, outfile=None, config=None):
+ def report(self, morfs, outfile=None):
"""Writes a report summarizing coverage statistics per module.
- `outfile` is a file object to write the summary to. `config` is a
- CoverageConfig instance.
+ `outfile` is a file object to write the summary to.
"""
- self.find_code_units(morfs, config)
+ self.find_code_units(morfs)
# Prepare the formatting strings
max_name = max([len(cu.name) for cu in self.code_units] + [5])
@@ -30,12 +29,12 @@
header = (fmt_name % "Name") + " Stmts Miss"
fmt_coverage = fmt_name + "%6d %6d"
if self.branches:
- header += " Branch BrPart"
+ header += " Branch BrMiss"
fmt_coverage += " %6d %6d"
width100 = Numbers.pc_str_width()
header += "%*s" % (width100+4, "Cover")
fmt_coverage += "%%%ds%%%%" % (width100+3,)
- if self.show_missing:
+ if self.config.show_missing:
header += " Missing"
fmt_coverage += " %s"
rule = "-" * len(header) + "\n"
@@ -59,15 +58,19 @@
if self.branches:
args += (nums.n_branches, nums.n_missing_branches)
args += (nums.pc_covered_str,)
- if self.show_missing:
+ if self.config.show_missing:
args += (analysis.missing_formatted(),)
outfile.write(fmt_coverage % args)
total += nums
- except KeyboardInterrupt: # pragma: no cover
+ except KeyboardInterrupt: # pragma: not covered
raise
except:
- if not self.ignore_errors:
+ report_it = not self.config.ignore_errors
+ if report_it:
typ, msg = sys.exc_info()[:2]
+ if typ is NotPython and not cu.should_be_python():
+ report_it = False
+ if report_it:
outfile.write(fmt_err % (cu.name, typ.__name__, msg))
if total.n_files > 1:
@@ -76,6 +79,8 @@
if self.branches:
args += (total.n_branches, total.n_missing_branches)
args += (total.pc_covered_str,)
- if self.show_missing:
+ if self.config.show_missing:
args += ("",)
outfile.write(fmt_coverage % args)
+
+ return total.pc_covered
diff --git a/python/helpers/coverage/templite.py b/python/helpers/coverage/templite.py
index c39e061..e5c0baf 100644
--- a/python/helpers/coverage/templite.py
+++ b/python/helpers/coverage/templite.py
@@ -2,7 +2,53 @@
# Coincidentally named the same as http://code.activestate.com/recipes/496702/
-import re, sys
+import re
+
+from coverage.backward import set # pylint: disable=W0622
+
+
+class CodeBuilder(object):
+ """Build source code conveniently."""
+
+ def __init__(self, indent=0):
+ self.code = []
+ self.indent_amount = indent
+
+ def add_line(self, line):
+ """Add a line of source to the code.
+
+ Don't include indentations or newlines.
+
+ """
+ self.code.append(" " * self.indent_amount)
+ self.code.append(line)
+ self.code.append("\n")
+
+ def add_section(self):
+ """Add a section, a sub-CodeBuilder."""
+ sect = CodeBuilder(self.indent_amount)
+ self.code.append(sect)
+ return sect
+
+ def indent(self):
+ """Increase the current indent for following lines."""
+ self.indent_amount += 4
+
+ def dedent(self):
+ """Decrease the current indent for following lines."""
+ self.indent_amount -= 4
+
+ def __str__(self):
+ return "".join([str(c) for c in self.code])
+
+ def get_function(self, fn_name):
+ """Compile the code, and return the function `fn_name`."""
+ assert self.indent_amount == 0
+ g = {}
+ code_text = str(self)
+ exec(code_text, g)
+ return g[fn_name]
+
class Templite(object):
"""A simple template renderer, for a nano-subset of Django syntax.
@@ -39,53 +85,104 @@
for context in contexts:
self.context.update(context)
+ # We construct a function in source form, then compile it and hold onto
+ # it, and execute it to render the template.
+ code = CodeBuilder()
+
+ code.add_line("def render(ctx, dot):")
+ code.indent()
+ vars_code = code.add_section()
+ self.all_vars = set()
+ self.loop_vars = set()
+ code.add_line("result = []")
+ code.add_line("a = result.append")
+ code.add_line("e = result.extend")
+ code.add_line("s = str")
+
+ buffered = []
+ def flush_output():
+ """Force `buffered` to the code builder."""
+ if len(buffered) == 1:
+ code.add_line("a(%s)" % buffered[0])
+ elif len(buffered) > 1:
+ code.add_line("e([%s])" % ",".join(buffered))
+ del buffered[:]
+
# Split the text to form a list of tokens.
toks = re.split(r"(?s)({{.*?}}|{%.*?%}|{#.*?#})", text)
- # Parse the tokens into a nested list of operations. Each item in the
- # list is a tuple with an opcode, and arguments. They'll be
- # interpreted by TempliteEngine.
- #
- # When parsing an action tag with nested content (if, for), the current
- # ops list is pushed onto ops_stack, and the parsing continues in a new
- # ops list that is part of the arguments to the if or for op.
- ops = []
ops_stack = []
for tok in toks:
if tok.startswith('{{'):
- # Expression: ('exp', expr)
- ops.append(('exp', tok[2:-2].strip()))
+ # An expression to evaluate.
+ buffered.append("s(%s)" % self.expr_code(tok[2:-2].strip()))
elif tok.startswith('{#'):
# Comment: ignore it and move on.
continue
elif tok.startswith('{%'):
# Action tag: split into words and parse further.
+ flush_output()
words = tok[2:-2].strip().split()
if words[0] == 'if':
- # If: ('if', (expr, body_ops))
- if_ops = []
+ # An if statement: evaluate the expression to determine if.
assert len(words) == 2
- ops.append(('if', (words[1], if_ops)))
- ops_stack.append(ops)
- ops = if_ops
+ ops_stack.append('if')
+ code.add_line("if %s:" % self.expr_code(words[1]))
+ code.indent()
elif words[0] == 'for':
- # For: ('for', (varname, listexpr, body_ops))
+ # A loop: iterate over expression result.
assert len(words) == 4 and words[2] == 'in'
- for_ops = []
- ops.append(('for', (words[1], words[3], for_ops)))
- ops_stack.append(ops)
- ops = for_ops
+ ops_stack.append('for')
+ self.loop_vars.add(words[1])
+ code.add_line(
+ "for c_%s in %s:" % (
+ words[1],
+ self.expr_code(words[3])
+ )
+ )
+ code.indent()
elif words[0].startswith('end'):
# Endsomething. Pop the ops stack
- ops = ops_stack.pop()
- assert ops[-1][0] == words[0][3:]
+ end_what = words[0][3:]
+ if ops_stack[-1] != end_what:
+ raise SyntaxError("Mismatched end tag: %r" % end_what)
+ ops_stack.pop()
+ code.dedent()
else:
- raise SyntaxError("Don't understand tag %r" % words)
+ raise SyntaxError("Don't understand tag: %r" % words[0])
else:
- ops.append(('lit', tok))
+ # Literal content. If it isn't empty, output it.
+ if tok:
+ buffered.append("%r" % tok)
+ flush_output()
- assert not ops_stack, "Unmatched action tag: %r" % ops_stack[-1][0]
- self.ops = ops
+ for var_name in self.all_vars - self.loop_vars:
+ vars_code.add_line("c_%s = ctx[%r]" % (var_name, var_name))
+
+ if ops_stack:
+ raise SyntaxError("Unmatched action tag: %r" % ops_stack[-1])
+
+ code.add_line("return ''.join(result)")
+ code.dedent()
+ self.render_function = code.get_function('render')
+
+ def expr_code(self, expr):
+ """Generate a Python expression for `expr`."""
+ if "|" in expr:
+ pipes = expr.split("|")
+ code = self.expr_code(pipes[0])
+ for func in pipes[1:]:
+ self.all_vars.add(func)
+ code = "c_%s(%s)" % (func, code)
+ elif "." in expr:
+ dots = expr.split(".")
+ code = self.expr_code(dots[0])
+ args = [repr(d) for d in dots[1:]]
+ code = "dot(%s, %s)" % (code, ", ".join(args))
+ else:
+ self.all_vars.add(expr)
+ code = "c_%s" % expr
+ return code
def render(self, context=None):
"""Render this template by applying it to `context`.
@@ -97,70 +194,15 @@
ctx = dict(self.context)
if context:
ctx.update(context)
+ return self.render_function(ctx, self.do_dots)
- # Run it through an engine, and return the result.
- engine = _TempliteEngine(ctx)
- engine.execute(self.ops)
- return "".join(engine.result)
-
-
-class _TempliteEngine(object):
- """Executes Templite objects to produce strings."""
- def __init__(self, context):
- self.context = context
- self.result = []
-
- def execute(self, ops):
- """Execute `ops` in the engine.
-
- Called recursively for the bodies of if's and loops.
-
- """
- for op, args in ops:
- if op == 'lit':
- self.result.append(args)
- elif op == 'exp':
- try:
- self.result.append(str(self.evaluate(args)))
- except:
- exc_class, exc, _ = sys.exc_info()
- new_exc = exc_class("Couldn't evaluate {{ %s }}: %s"
- % (args, exc))
- raise new_exc
- elif op == 'if':
- expr, body = args
- if self.evaluate(expr):
- self.execute(body)
- elif op == 'for':
- var, lis, body = args
- vals = self.evaluate(lis)
- for val in vals:
- self.context[var] = val
- self.execute(body)
- else:
- raise AssertionError("TempliteEngine doesn't grok op %r" % op)
-
- def evaluate(self, expr):
- """Evaluate an expression.
-
- `expr` can have pipes and dots to indicate data access and filtering.
-
- """
- if "|" in expr:
- pipes = expr.split("|")
- value = self.evaluate(pipes[0])
- for func in pipes[1:]:
- value = self.evaluate(func)(value)
- elif "." in expr:
- dots = expr.split('.')
- value = self.evaluate(dots[0])
- for dot in dots[1:]:
- try:
- value = getattr(value, dot)
- except AttributeError:
- value = value[dot]
- if hasattr(value, '__call__'):
- value = value()
- else:
- value = self.context[expr]
+ def do_dots(self, value, *dots):
+ """Evaluate dotted expressions at runtime."""
+ for dot in dots:
+ try:
+ value = getattr(value, dot)
+ except AttributeError:
+ value = value[dot]
+ if hasattr(value, '__call__'):
+ value = value()
return value
diff --git a/python/helpers/coverage/tracer.c b/python/helpers/coverage/tracer.c
new file mode 100644
index 0000000..97dd113
--- /dev/null
+++ b/python/helpers/coverage/tracer.c
@@ -0,0 +1,730 @@
+/* C-based Tracer for Coverage. */
+
+#include "Python.h"
+#include "compile.h" /* in 2.3, this wasn't part of Python.h */
+#include "eval.h" /* or this. */
+#include "structmember.h"
+#include "frameobject.h"
+
+/* Compile-time debugging helpers */
+#undef WHAT_LOG /* Define to log the WHAT params in the trace function. */
+#undef TRACE_LOG /* Define to log our bookkeeping. */
+#undef COLLECT_STATS /* Collect counters: stats are printed when tracer is stopped. */
+
+#if COLLECT_STATS
+#define STATS(x) x
+#else
+#define STATS(x)
+#endif
+
+/* Py 2.x and 3.x compatibility */
+
+#ifndef Py_TYPE
+#define Py_TYPE(o) (((PyObject*)(o))->ob_type)
+#endif
+
+#if PY_MAJOR_VERSION >= 3
+
+#define MyText_Type PyUnicode_Type
+#define MyText_Check(o) PyUnicode_Check(o)
+#define MyText_AS_BYTES(o) PyUnicode_AsASCIIString(o)
+#define MyText_AS_STRING(o) PyBytes_AS_STRING(o)
+#define MyInt_FromLong(l) PyLong_FromLong(l)
+
+#define MyType_HEAD_INIT PyVarObject_HEAD_INIT(NULL, 0)
+
+#else
+
+#define MyText_Type PyString_Type
+#define MyText_Check(o) PyString_Check(o)
+#define MyText_AS_BYTES(o) (Py_INCREF(o), o)
+#define MyText_AS_STRING(o) PyString_AS_STRING(o)
+#define MyInt_FromLong(l) PyInt_FromLong(l)
+
+#define MyType_HEAD_INIT PyObject_HEAD_INIT(NULL) 0,
+
+#endif /* Py3k */
+
+/* The values returned to indicate ok or error. */
+#define RET_OK 0
+#define RET_ERROR -1
+
+/* An entry on the data stack. For each call frame, we need to record the
+ dictionary to capture data, and the last line number executed in that
+ frame.
+*/
+typedef struct {
+ PyObject * file_data; /* PyMem_Malloc'ed, a borrowed ref. */
+ int last_line;
+} DataStackEntry;
+
+/* The CTracer type. */
+
+typedef struct {
+ PyObject_HEAD
+
+ /* Python objects manipulated directly by the Collector class. */
+ PyObject * should_trace;
+ PyObject * warn;
+ PyObject * data;
+ PyObject * should_trace_cache;
+ PyObject * arcs;
+
+ /* Has the tracer been started? */
+ int started;
+ /* Are we tracing arcs, or just lines? */
+ int tracing_arcs;
+
+ /*
+ The data stack is a stack of dictionaries. Each dictionary collects
+ data for a single source file. The data stack parallels the call stack:
+ each call pushes the new frame's file data onto the data stack, and each
+ return pops file data off.
+
+ The file data is a dictionary whose form depends on the tracing options.
+ If tracing arcs, the keys are line number pairs. If not tracing arcs,
+ the keys are line numbers. In both cases, the value is irrelevant
+ (None).
+ */
+ /* The index of the last-used entry in data_stack. */
+ int depth;
+ /* The file data at each level, or NULL if not recording. */
+ DataStackEntry * data_stack;
+ int data_stack_alloc; /* number of entries allocated at data_stack. */
+
+ /* The current file_data dictionary. Borrowed. */
+ PyObject * cur_file_data;
+
+ /* The line number of the last line recorded, for tracing arcs.
+ -1 means there was no previous line, as when entering a code object.
+ */
+ int last_line;
+
+ /* The parent frame for the last exception event, to fix missing returns. */
+ PyFrameObject * last_exc_back;
+ int last_exc_firstlineno;
+
+#if COLLECT_STATS
+ struct {
+ unsigned int calls;
+ unsigned int lines;
+ unsigned int returns;
+ unsigned int exceptions;
+ unsigned int others;
+ unsigned int new_files;
+ unsigned int missed_returns;
+ unsigned int stack_reallocs;
+ unsigned int errors;
+ } stats;
+#endif /* COLLECT_STATS */
+} CTracer;
+
+#define STACK_DELTA 100
+
+static int
+CTracer_init(CTracer *self, PyObject *args_unused, PyObject *kwds_unused)
+{
+#if COLLECT_STATS
+ self->stats.calls = 0;
+ self->stats.lines = 0;
+ self->stats.returns = 0;
+ self->stats.exceptions = 0;
+ self->stats.others = 0;
+ self->stats.new_files = 0;
+ self->stats.missed_returns = 0;
+ self->stats.stack_reallocs = 0;
+ self->stats.errors = 0;
+#endif /* COLLECT_STATS */
+
+ self->should_trace = NULL;
+ self->warn = NULL;
+ self->data = NULL;
+ self->should_trace_cache = NULL;
+ self->arcs = NULL;
+
+ self->started = 0;
+ self->tracing_arcs = 0;
+
+ self->depth = -1;
+ self->data_stack = PyMem_Malloc(STACK_DELTA*sizeof(DataStackEntry));
+ if (self->data_stack == NULL) {
+ STATS( self->stats.errors++; )
+ PyErr_NoMemory();
+ return RET_ERROR;
+ }
+ self->data_stack_alloc = STACK_DELTA;
+
+ self->cur_file_data = NULL;
+ self->last_line = -1;
+
+ self->last_exc_back = NULL;
+
+ return RET_OK;
+}
+
+static void
+CTracer_dealloc(CTracer *self)
+{
+ if (self->started) {
+ PyEval_SetTrace(NULL, NULL);
+ }
+
+ Py_XDECREF(self->should_trace);
+ Py_XDECREF(self->warn);
+ Py_XDECREF(self->data);
+ Py_XDECREF(self->should_trace_cache);
+
+ PyMem_Free(self->data_stack);
+
+ Py_TYPE(self)->tp_free((PyObject*)self);
+}
+
+#if TRACE_LOG
+static const char *
+indent(int n)
+{
+ static const char * spaces =
+ " "
+ " "
+ " "
+ " "
+ ;
+ return spaces + strlen(spaces) - n*2;
+}
+
+static int logging = 0;
+/* Set these constants to be a file substring and line number to start logging. */
+static const char * start_file = "tests/views";
+static int start_line = 27;
+
+static void
+showlog(int depth, int lineno, PyObject * filename, const char * msg)
+{
+ if (logging) {
+ printf("%s%3d ", indent(depth), depth);
+ if (lineno) {
+ printf("%4d", lineno);
+ }
+ else {
+ printf(" ");
+ }
+ if (filename) {
+ PyObject *ascii = MyText_AS_BYTES(filename);
+ printf(" %s", MyText_AS_STRING(ascii));
+ Py_DECREF(ascii);
+ }
+ if (msg) {
+ printf(" %s", msg);
+ }
+ printf("\n");
+ }
+}
+
+#define SHOWLOG(a,b,c,d) showlog(a,b,c,d)
+#else
+#define SHOWLOG(a,b,c,d)
+#endif /* TRACE_LOG */
+
+#if WHAT_LOG
+static const char * what_sym[] = {"CALL", "EXC ", "LINE", "RET "};
+#endif
+
+/* Record a pair of integers in self->cur_file_data. */
+static int
+CTracer_record_pair(CTracer *self, int l1, int l2)
+{
+ int ret = RET_OK;
+
+ PyObject * t = Py_BuildValue("(ii)", l1, l2);
+ if (t != NULL) {
+ if (PyDict_SetItem(self->cur_file_data, t, Py_None) < 0) {
+ STATS( self->stats.errors++; )
+ ret = RET_ERROR;
+ }
+ Py_DECREF(t);
+ }
+ else {
+ STATS( self->stats.errors++; )
+ ret = RET_ERROR;
+ }
+ return ret;
+}
+
+/*
+ * The Trace Function
+ */
+static int
+CTracer_trace(CTracer *self, PyFrameObject *frame, int what, PyObject *arg_unused)
+{
+ int ret = RET_OK;
+ PyObject * filename = NULL;
+ PyObject * tracename = NULL;
+ #if WHAT_LOG || TRACE_LOG
+ PyObject * ascii = NULL;
+ #endif
+
+ #if WHAT_LOG
+ if (what <= sizeof(what_sym)/sizeof(const char *)) {
+ ascii = MyText_AS_BYTES(frame->f_code->co_filename);
+ printf("trace: %s @ %s %d\n", what_sym[what], MyText_AS_STRING(ascii), frame->f_lineno);
+ Py_DECREF(ascii);
+ }
+ #endif
+
+ #if TRACE_LOG
+ ascii = MyText_AS_BYTES(frame->f_code->co_filename);
+ if (strstr(MyText_AS_STRING(ascii), start_file) && frame->f_lineno == start_line) {
+ logging = 1;
+ }
+ Py_DECREF(ascii);
+ #endif
+
+ /* See below for details on missing-return detection. */
+ if (self->last_exc_back) {
+ if (frame == self->last_exc_back) {
+ /* Looks like someone forgot to send a return event. We'll clear
+ the exception state and do the RETURN code here. Notice that the
+ frame we have in hand here is not the correct frame for the RETURN,
+ that frame is gone. Our handling for RETURN doesn't need the
+ actual frame, but we do log it, so that will look a little off if
+ you're looking at the detailed log.
+
+ If someday we need to examine the frame when doing RETURN, then
+ we'll need to keep more of the missed frame's state.
+ */
+ STATS( self->stats.missed_returns++; )
+ if (self->depth >= 0) {
+ if (self->tracing_arcs && self->cur_file_data) {
+ if (CTracer_record_pair(self, self->last_line, -self->last_exc_firstlineno) < 0) {
+ return RET_ERROR;
+ }
+ }
+ SHOWLOG(self->depth, frame->f_lineno, frame->f_code->co_filename, "missedreturn");
+ self->cur_file_data = self->data_stack[self->depth].file_data;
+ self->last_line = self->data_stack[self->depth].last_line;
+ self->depth--;
+ }
+ }
+ self->last_exc_back = NULL;
+ }
+
+
+ switch (what) {
+ case PyTrace_CALL: /* 0 */
+ STATS( self->stats.calls++; )
+ /* Grow the stack. */
+ self->depth++;
+ if (self->depth >= self->data_stack_alloc) {
+ STATS( self->stats.stack_reallocs++; )
+ /* We've outgrown our data_stack array: make it bigger. */
+ int bigger = self->data_stack_alloc + STACK_DELTA;
+ DataStackEntry * bigger_data_stack = PyMem_Realloc(self->data_stack, bigger * sizeof(DataStackEntry));
+ if (bigger_data_stack == NULL) {
+ STATS( self->stats.errors++; )
+ PyErr_NoMemory();
+ self->depth--;
+ return RET_ERROR;
+ }
+ self->data_stack = bigger_data_stack;
+ self->data_stack_alloc = bigger;
+ }
+
+ /* Push the current state on the stack. */
+ self->data_stack[self->depth].file_data = self->cur_file_data;
+ self->data_stack[self->depth].last_line = self->last_line;
+
+ /* Check if we should trace this line. */
+ filename = frame->f_code->co_filename;
+ tracename = PyDict_GetItem(self->should_trace_cache, filename);
+ if (tracename == NULL) {
+ STATS( self->stats.new_files++; )
+ /* We've never considered this file before. */
+ /* Ask should_trace about it. */
+ PyObject * args = Py_BuildValue("(OO)", filename, frame);
+ tracename = PyObject_Call(self->should_trace, args, NULL);
+ Py_DECREF(args);
+ if (tracename == NULL) {
+ /* An error occurred inside should_trace. */
+ STATS( self->stats.errors++; )
+ return RET_ERROR;
+ }
+ if (PyDict_SetItem(self->should_trace_cache, filename, tracename) < 0) {
+ STATS( self->stats.errors++; )
+ return RET_ERROR;
+ }
+ }
+ else {
+ Py_INCREF(tracename);
+ }
+
+ /* If tracename is a string, then we're supposed to trace. */
+ if (MyText_Check(tracename)) {
+ PyObject * file_data = PyDict_GetItem(self->data, tracename);
+ if (file_data == NULL) {
+ file_data = PyDict_New();
+ if (file_data == NULL) {
+ STATS( self->stats.errors++; )
+ return RET_ERROR;
+ }
+ ret = PyDict_SetItem(self->data, tracename, file_data);
+ Py_DECREF(file_data);
+ if (ret < 0) {
+ STATS( self->stats.errors++; )
+ return RET_ERROR;
+ }
+ }
+ self->cur_file_data = file_data;
+ /* Make the frame right in case settrace(gettrace()) happens. */
+ Py_INCREF(self);
+ frame->f_trace = (PyObject*)self;
+ SHOWLOG(self->depth, frame->f_lineno, filename, "traced");
+ }
+ else {
+ self->cur_file_data = NULL;
+ SHOWLOG(self->depth, frame->f_lineno, filename, "skipped");
+ }
+
+ Py_DECREF(tracename);
+
+ self->last_line = -1;
+ break;
+
+ case PyTrace_RETURN: /* 3 */
+ STATS( self->stats.returns++; )
+ /* A near-copy of this code is above in the missing-return handler. */
+ if (self->depth >= 0) {
+ if (self->tracing_arcs && self->cur_file_data) {
+ int first = frame->f_code->co_firstlineno;
+ if (CTracer_record_pair(self, self->last_line, -first) < 0) {
+ return RET_ERROR;
+ }
+ }
+
+ SHOWLOG(self->depth, frame->f_lineno, frame->f_code->co_filename, "return");
+ self->cur_file_data = self->data_stack[self->depth].file_data;
+ self->last_line = self->data_stack[self->depth].last_line;
+ self->depth--;
+ }
+ break;
+
+ case PyTrace_LINE: /* 2 */
+ STATS( self->stats.lines++; )
+ if (self->depth >= 0) {
+ SHOWLOG(self->depth, frame->f_lineno, frame->f_code->co_filename, "line");
+ if (self->cur_file_data) {
+ /* We're tracing in this frame: record something. */
+ if (self->tracing_arcs) {
+ /* Tracing arcs: key is (last_line,this_line). */
+ if (CTracer_record_pair(self, self->last_line, frame->f_lineno) < 0) {
+ return RET_ERROR;
+ }
+ }
+ else {
+ /* Tracing lines: key is simply this_line. */
+ PyObject * this_line = MyInt_FromLong(frame->f_lineno);
+ if (this_line == NULL) {
+ STATS( self->stats.errors++; )
+ return RET_ERROR;
+ }
+ ret = PyDict_SetItem(self->cur_file_data, this_line, Py_None);
+ Py_DECREF(this_line);
+ if (ret < 0) {
+ STATS( self->stats.errors++; )
+ return RET_ERROR;
+ }
+ }
+ }
+ self->last_line = frame->f_lineno;
+ }
+ break;
+
+ case PyTrace_EXCEPTION:
+ /* Some code (Python 2.3, and pyexpat anywhere) fires an exception event
+ without a return event. To detect that, we'll keep a copy of the
+ parent frame for an exception event. If the next event is in that
+ frame, then we must have returned without a return event. We can
+ synthesize the missing event then.
+
+ Python itself fixed this problem in 2.4. Pyexpat still has the bug.
+ I've reported the problem with pyexpat as http://bugs.python.org/issue6359 .
+ If it gets fixed, this code should still work properly. Maybe some day
+ the bug will be fixed everywhere coverage.py is supported, and we can
+ remove this missing-return detection.
+
+ More about this fix: http://nedbatchelder.com/blog/200907/a_nasty_little_bug.html
+ */
+ STATS( self->stats.exceptions++; )
+ self->last_exc_back = frame->f_back;
+ self->last_exc_firstlineno = frame->f_code->co_firstlineno;
+ break;
+
+ default:
+ STATS( self->stats.others++; )
+ break;
+ }
+
+ return RET_OK;
+}
+
+/*
+ * Python has two ways to set the trace function: sys.settrace(fn), which
+ * takes a Python callable, and PyEval_SetTrace(func, obj), which takes
+ * a C function and a Python object. The way these work together is that
+ * sys.settrace(pyfn) calls PyEval_SetTrace(builtin_func, pyfn), using the
+ * Python callable as the object in PyEval_SetTrace. So sys.gettrace()
+ * simply returns the Python object used as the second argument to
+ * PyEval_SetTrace. So sys.gettrace() will return our self parameter, which
+ * means it must be callable to be used in sys.settrace().
+ *
+ * So we make our self callable, equivalent to invoking our trace function.
+ *
+ * To help with the process of replaying stored frames, this function has an
+ * optional keyword argument:
+ *
+ * def CTracer_call(frame, event, arg, lineno=0)
+ *
+ * If provided, the lineno argument is used as the line number, and the
+ * frame's f_lineno member is ignored.
+ */
+static PyObject *
+CTracer_call(CTracer *self, PyObject *args, PyObject *kwds)
+{
+ PyFrameObject *frame;
+ PyObject *what_str;
+ PyObject *arg;
+ int lineno = 0;
+ int what;
+ int orig_lineno;
+ PyObject *ret = NULL;
+
+ static char *what_names[] = {
+ "call", "exception", "line", "return",
+ "c_call", "c_exception", "c_return",
+ NULL
+ };
+
+ #if WHAT_LOG
+ printf("pytrace\n");
+ #endif
+
+ static char *kwlist[] = {"frame", "event", "arg", "lineno", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O|i:Tracer_call", kwlist,
+ &PyFrame_Type, &frame, &MyText_Type, &what_str, &arg, &lineno)) {
+ goto done;
+ }
+
+ /* In Python, the what argument is a string, we need to find an int
+ for the C function. */
+ for (what = 0; what_names[what]; what++) {
+ PyObject *ascii = MyText_AS_BYTES(what_str);
+ int should_break = !strcmp(MyText_AS_STRING(ascii), what_names[what]);
+ Py_DECREF(ascii);
+ if (should_break) {
+ break;
+ }
+ }
+
+ /* Save off the frame's lineno, and use the forced one, if provided. */
+ orig_lineno = frame->f_lineno;
+ if (lineno > 0) {
+ frame->f_lineno = lineno;
+ }
+
+ /* Invoke the C function, and return ourselves. */
+ if (CTracer_trace(self, frame, what, arg) == RET_OK) {
+ Py_INCREF(self);
+ ret = (PyObject *)self;
+ }
+
+ /* Clean up. */
+ frame->f_lineno = orig_lineno;
+
+done:
+ return ret;
+}
+
+static PyObject *
+CTracer_start(CTracer *self, PyObject *args_unused)
+{
+ PyEval_SetTrace((Py_tracefunc)CTracer_trace, (PyObject*)self);
+ self->started = 1;
+ self->tracing_arcs = self->arcs && PyObject_IsTrue(self->arcs);
+ self->last_line = -1;
+
+ /* start() returns a trace function usable with sys.settrace() */
+ Py_INCREF(self);
+ return (PyObject *)self;
+}
+
+static PyObject *
+CTracer_stop(CTracer *self, PyObject *args_unused)
+{
+ if (self->started) {
+ PyEval_SetTrace(NULL, NULL);
+ self->started = 0;
+ }
+
+ return Py_BuildValue("");
+}
+
+static PyObject *
+CTracer_get_stats(CTracer *self)
+{
+#if COLLECT_STATS
+ return Py_BuildValue(
+ "{sI,sI,sI,sI,sI,sI,sI,sI,si,sI}",
+ "calls", self->stats.calls,
+ "lines", self->stats.lines,
+ "returns", self->stats.returns,
+ "exceptions", self->stats.exceptions,
+ "others", self->stats.others,
+ "new_files", self->stats.new_files,
+ "missed_returns", self->stats.missed_returns,
+ "stack_reallocs", self->stats.stack_reallocs,
+ "stack_alloc", self->data_stack_alloc,
+ "errors", self->stats.errors
+ );
+#else
+ return Py_BuildValue("");
+#endif /* COLLECT_STATS */
+}
+
+static PyMemberDef
+CTracer_members[] = {
+ { "should_trace", T_OBJECT, offsetof(CTracer, should_trace), 0,
+ PyDoc_STR("Function indicating whether to trace a file.") },
+
+ { "warn", T_OBJECT, offsetof(CTracer, warn), 0,
+ PyDoc_STR("Function for issuing warnings.") },
+
+ { "data", T_OBJECT, offsetof(CTracer, data), 0,
+ PyDoc_STR("The raw dictionary of trace data.") },
+
+ { "should_trace_cache", T_OBJECT, offsetof(CTracer, should_trace_cache), 0,
+ PyDoc_STR("Dictionary caching should_trace results.") },
+
+ { "arcs", T_OBJECT, offsetof(CTracer, arcs), 0,
+ PyDoc_STR("Should we trace arcs, or just lines?") },
+
+ { NULL }
+};
+
+static PyMethodDef
+CTracer_methods[] = {
+ { "start", (PyCFunction) CTracer_start, METH_VARARGS,
+ PyDoc_STR("Start the tracer") },
+
+ { "stop", (PyCFunction) CTracer_stop, METH_VARARGS,
+ PyDoc_STR("Stop the tracer") },
+
+ { "get_stats", (PyCFunction) CTracer_get_stats, METH_VARARGS,
+ PyDoc_STR("Get statistics about the tracing") },
+
+ { NULL }
+};
+
+static PyTypeObject
+CTracerType = {
+ MyType_HEAD_INIT
+ "coverage.CTracer", /*tp_name*/
+ sizeof(CTracer), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ (destructor)CTracer_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ 0, /*tp_compare*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash */
+ (ternaryfunc)CTracer_call, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ "CTracer objects", /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ CTracer_methods, /* tp_methods */
+ CTracer_members, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)CTracer_init, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
+
+/* Module definition */
+
+#define MODULE_DOC PyDoc_STR("Fast coverage tracer.")
+
+#if PY_MAJOR_VERSION >= 3
+
+static PyModuleDef
+moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "coverage.tracer",
+ MODULE_DOC,
+ -1,
+ NULL, /* methods */
+ NULL,
+ NULL, /* traverse */
+ NULL, /* clear */
+ NULL
+};
+
+
+PyObject *
+PyInit_tracer(void)
+{
+ PyObject * mod = PyModule_Create(&moduledef);
+ if (mod == NULL) {
+ return NULL;
+ }
+
+ CTracerType.tp_new = PyType_GenericNew;
+ if (PyType_Ready(&CTracerType) < 0) {
+ Py_DECREF(mod);
+ return NULL;
+ }
+
+ Py_INCREF(&CTracerType);
+ PyModule_AddObject(mod, "CTracer", (PyObject *)&CTracerType);
+
+ return mod;
+}
+
+#else
+
+void
+inittracer(void)
+{
+ PyObject * mod;
+
+ mod = Py_InitModule3("coverage.tracer", NULL, MODULE_DOC);
+ if (mod == NULL) {
+ return;
+ }
+
+ CTracerType.tp_new = PyType_GenericNew;
+ if (PyType_Ready(&CTracerType) < 0) {
+ return;
+ }
+
+ Py_INCREF(&CTracerType);
+ PyModule_AddObject(mod, "CTracer", (PyObject *)&CTracerType);
+}
+
+#endif /* Py3k */
diff --git a/python/helpers/coverage/tracer.pyd b/python/helpers/coverage/tracer.pyd
deleted file mode 100644
index a13aa03..0000000
--- a/python/helpers/coverage/tracer.pyd
+++ /dev/null
Binary files differ
diff --git a/python/helpers/coverage/version.py b/python/helpers/coverage/version.py
new file mode 100644
index 0000000..a43bde8
--- /dev/null
+++ b/python/helpers/coverage/version.py
@@ -0,0 +1,9 @@
+"""The version and URL for coverage.py"""
+# This file is exec'ed in setup.py, don't import anything!
+
+__version__ = "3.7.1" # see detailed history in CHANGES.txt
+
+__url__ = "http://nedbatchelder.com/code/coverage"
+if max(__version__).isalpha():
+ # For pre-releases, use a version-specific URL.
+ __url__ += "/" + __version__
diff --git a/python/helpers/coverage/xmlreport.py b/python/helpers/coverage/xmlreport.py
index 5f6cc87..26ac02a 100644
--- a/python/helpers/coverage/xmlreport.py
+++ b/python/helpers/coverage/xmlreport.py
@@ -4,7 +4,7 @@
import xml.dom.minidom
from coverage import __url__, __version__
-from coverage.backward import sorted # pylint: disable=W0622
+from coverage.backward import sorted, rpartition # pylint: disable=W0622
from coverage.report import Reporter
def rate(hit, num):
@@ -15,20 +15,19 @@
class XmlReporter(Reporter):
"""A reporter for writing Cobertura-style XML coverage results."""
- def __init__(self, coverage, ignore_errors=False):
- super(XmlReporter, self).__init__(coverage, ignore_errors)
+ def __init__(self, coverage, config):
+ super(XmlReporter, self).__init__(coverage, config)
self.packages = None
self.xml_out = None
self.arcs = coverage.data.has_arcs()
- def report(self, morfs, outfile=None, config=None):
+ def report(self, morfs, outfile=None):
"""Generate a Cobertura-compatible XML report for `morfs`.
`morfs` is a list of modules or filenames.
- `outfile` is a file object to write the XML to. `config` is a
- CoverageConfig instance.
+ `outfile` is a file object to write the XML to.
"""
# Initial setup.
@@ -54,7 +53,7 @@
# Call xml_file for each file in the data.
self.packages = {}
- self.report_files(self.xml_file, morfs, config)
+ self.report_files(self.xml_file, morfs)
lnum_tot, lhits_tot = 0, 0
bnum_tot, bhits_tot = 0, 0
@@ -85,14 +84,23 @@
# Use the DOM to write the output file.
outfile.write(self.xml_out.toprettyxml())
+ # Return the total percentage.
+ denom = lnum_tot + bnum_tot
+ if denom == 0:
+ pct = 0.0
+ else:
+ pct = 100.0 * (lhits_tot + bhits_tot) / denom
+ return pct
+
def xml_file(self, cu, analysis):
"""Add to the XML report for a single file."""
# Create the 'lines' and 'package' XML elements, which
# are populated later. Note that a package == a directory.
- dirname, fname = os.path.split(cu.name)
- dirname = dirname or '.'
- package = self.packages.setdefault(dirname, [ {}, 0, 0, 0, 0 ])
+ package_name = rpartition(cu.name, ".")[0]
+ className = cu.name
+
+ package = self.packages.setdefault(package_name, [{}, 0, 0, 0, 0])
xclass = self.xml_out.createElement("class")
@@ -100,22 +108,22 @@
xlines = self.xml_out.createElement("lines")
xclass.appendChild(xlines)
- className = fname.replace('.', '_')
+
xclass.setAttribute("name", className)
- ext = os.path.splitext(cu.filename)[1]
- xclass.setAttribute("filename", cu.name + ext)
+ filename = cu.file_locator.relative_filename(cu.filename)
+ xclass.setAttribute("filename", filename.replace("\\", "/"))
xclass.setAttribute("complexity", "0")
branch_stats = analysis.branch_stats()
# For each statement, create an XML 'line' element.
- for line in analysis.statements:
+ for line in sorted(analysis.statements):
xline = self.xml_out.createElement("line")
xline.setAttribute("number", str(line))
# Q: can we get info about the number of times a statement is
# executed? If so, that should be recorded here.
- xline.setAttribute("hits", str(int(not line in analysis.missing)))
+ xline.setAttribute("hits", str(int(line not in analysis.missing)))
if self.arcs:
if line in branch_stats:
diff --git a/python/helpers/generator3.py b/python/helpers/generator3.py
index 50e9119..d09f6d9 100644
--- a/python/helpers/generator3.py
+++ b/python/helpers/generator3.py
@@ -161,6 +161,9 @@
path = os.path.normpath(path)
+ if path.endswith('.egg') and os.path.isfile(path):
+ say("%s\t%s\t%d", path, path, os.path.getsize(path))
+
for root, files in walk_python_path(path):
for name in files:
if name.endswith('.py'):
diff --git a/python/helpers/pep8.py b/python/helpers/pep8.py
index 2ce7554..f605f18 100644
--- a/python/helpers/pep8.py
+++ b/python/helpers/pep8.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# pep8.py - Check Python source code formatting, according to PEP 8
# Copyright (C) 2006-2009 Johann C. Rocholl <johann@rocholl.net>
-# Copyright (C) 2009-2013 Florent Xicluna <florent.xicluna@gmail.com>
+# Copyright (C) 2009-2014 Florent Xicluna <florent.xicluna@gmail.com>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
@@ -24,8 +24,7 @@
# SOFTWARE.
r"""
-Check Python source code formatting, according to PEP 8:
-http://www.python.org/dev/peps/pep-0008/
+Check Python source code formatting, according to PEP 8.
For usage and a list of options, try this:
$ python pep8.py -h
@@ -45,7 +44,9 @@
700 statements
900 syntax error
"""
-__version__ = '1.4.5a0'
+from __future__ import with_statement
+
+__version__ = '1.5.7'
import os
import sys
@@ -63,13 +64,13 @@
from ConfigParser import RawConfigParser
DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__'
-DEFAULT_IGNORE = 'E226,E24'
+DEFAULT_IGNORE = 'E123,E226,E24'
if sys.platform == 'win32':
DEFAULT_CONFIG = os.path.expanduser(r'~\.pep8')
else:
DEFAULT_CONFIG = os.path.join(os.getenv('XDG_CONFIG_HOME') or
os.path.expanduser('~/.config'), 'pep8')
-PROJECT_CONFIG = ('.pep8', 'tox.ini', 'setup.cfg')
+PROJECT_CONFIG = ('setup.cfg', 'tox.ini', '.pep8')
TESTSUITE_PATH = os.path.join(os.path.dirname(__file__), 'testsuite')
MAX_LINE_LENGTH = 79
REPORT_FORMAT = {
@@ -87,18 +88,21 @@
'**=', '*=', '/=', '//=', '+=', '-=', '!=', '<>', '<', '>',
'%=', '^=', '&=', '|=', '==', '<=', '>=', '<<=', '>>=', '='])
WHITESPACE = frozenset(' \t')
-SKIP_TOKENS = frozenset([tokenize.COMMENT, tokenize.NL, tokenize.NEWLINE,
- tokenize.INDENT, tokenize.DEDENT])
+NEWLINE = frozenset([tokenize.NL, tokenize.NEWLINE])
+SKIP_TOKENS = NEWLINE.union([tokenize.INDENT, tokenize.DEDENT])
+# ERRORTOKEN is triggered by backticks in Python 3
+SKIP_COMMENTS = SKIP_TOKENS.union([tokenize.COMMENT, tokenize.ERRORTOKEN])
BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines']
INDENT_REGEX = re.compile(r'([ \t]*)')
-RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*(,)')
-RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,\s*\w+\s*,\s*\w+')
+RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,')
+RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,.*,\s*\w+\s*$')
ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b')
DOCSTRING_REGEX = re.compile(r'u?r?["\']')
EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)')
COMPARE_SINGLETON_REGEX = re.compile(r'([=!]=)\s*(None|False|True)')
+COMPARE_NEGATIVE_REGEX = re.compile(r'\b(not)\s+[^[({ ]+\s+(in|is)\s')
COMPARE_TYPE_REGEX = re.compile(r'(?:[=!]=|is(?:\s+not)?)\s*type(?:s.\w+Type'
r'|\s*\(\s*([^)]*[^ )])\s*\))')
KEYWORD_REGEX = re.compile(r'(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS))
@@ -117,8 +121,7 @@
def tabs_or_spaces(physical_line, indent_char):
- r"""
- Never mix tabs and spaces.
+ r"""Never mix tabs and spaces.
The most popular way of indenting Python is with spaces only. The
second-most popular way is with tabs only. Code indented with a mixture
@@ -137,9 +140,7 @@
def tabs_obsolete(physical_line):
- r"""
- For new projects, spaces-only are strongly recommended over tabs. Most
- editors have features that make this easy to do.
+ r"""For new projects, spaces-only are strongly recommended over tabs.
Okay: if True:\n return
W191: if True:\n\treturn
@@ -150,16 +151,7 @@
def trailing_whitespace(physical_line):
- r"""
- JCR: Trailing whitespace is superfluous.
- FBM: Except when it occurs as part of a blank line (i.e. the line is
- nothing but whitespace). According to Python docs[1] a line with only
- whitespace is considered a blank line, and is to be ignored. However,
- matching a blank line to its indentation level avoids mistakenly
- terminating a multi-line statement (e.g. class declaration) when
- pasting code into the standard Python interpreter.
-
- [1] http://docs.python.org/reference/lexical_analysis.html#blank-lines
+ r"""Trailing whitespace is superfluous.
The warning returned varies on whether the line itself is blank, for easier
filtering for those who want to indent their blank lines.
@@ -179,30 +171,24 @@
return 0, "W293 blank line contains whitespace"
-def trailing_blank_lines(physical_line, lines, line_number):
- r"""
- JCR: Trailing blank lines are superfluous.
+def trailing_blank_lines(physical_line, lines, line_number, total_lines):
+ r"""Trailing blank lines are superfluous.
Okay: spam(1)
W391: spam(1)\n
+
+ However the last line should end with a new line (warning W292).
"""
- if not physical_line.rstrip() and line_number == len(lines):
- return 0, "W391 blank line at end of file"
+ if line_number == total_lines:
+ stripped_last_line = physical_line.rstrip()
+ if not stripped_last_line:
+ return 0, "W391 blank line at end of file"
+ if stripped_last_line == physical_line:
+ return len(physical_line), "W292 no newline at end of file"
-def missing_newline(physical_line):
- """
- JCR: The last line should have a newline.
-
- Reports warning W292.
- """
- if physical_line.rstrip() == physical_line:
- return len(physical_line), "W292 no newline at end of file"
-
-
-def maximum_line_length(physical_line, max_line_length):
- """
- Limit all lines to a maximum of 79 characters.
+def maximum_line_length(physical_line, max_line_length, multiline):
+ r"""Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to have
@@ -215,8 +201,13 @@
"""
line = physical_line.rstrip()
length = len(line)
- if length > max_line_length:
- if noqa(line):
+ if length > max_line_length and not noqa(line):
+ # Special case for long URLs in multi-line docstrings or comments,
+ # but still report the error when the 72 first chars are whitespaces.
+ chunks = line.split()
+ if ((len(chunks) == 1 and multiline) or
+ (len(chunks) == 2 and chunks[0] == '#')) and \
+ len(line) - len(chunks[-1]) < max_line_length - 7:
return
if hasattr(line, 'decode'): # Python 2
# The line could contain multi-byte characters
@@ -235,9 +226,8 @@
def blank_lines(logical_line, blank_lines, indent_level, line_number,
- previous_logical, previous_indent_level):
- r"""
- Separate top-level function and class definitions with two blank lines.
+ blank_before, previous_logical, previous_indent_level):
+ r"""Separate top-level function and class definitions with two blank lines.
Method definitions inside a class are separated by a single blank line.
@@ -265,19 +255,18 @@
yield 0, "E303 too many blank lines (%d)" % blank_lines
elif logical_line.startswith(('def ', 'class ', '@')):
if indent_level:
- if not (blank_lines or previous_indent_level < indent_level or
+ if not (blank_before or previous_indent_level < indent_level or
DOCSTRING_REGEX.match(previous_logical)):
yield 0, "E301 expected 1 blank line, found 0"
- elif blank_lines != 2:
- yield 0, "E302 expected 2 blank lines, found %d" % blank_lines
+ elif blank_before != 2:
+ yield 0, "E302 expected 2 blank lines, found %d" % blank_before
def extraneous_whitespace(logical_line):
- """
- Avoid extraneous whitespace in the following situations:
+ r"""Avoid extraneous whitespace.
+ Avoid extraneous whitespace in these situations:
- Immediately inside parentheses, brackets or braces.
-
- Immediately before a comma, semicolon, or colon.
Okay: spam(ham[1], {eggs: 2})
@@ -306,8 +295,7 @@
def whitespace_around_keywords(logical_line):
- r"""
- Avoid extraneous whitespace around keywords.
+ r"""Avoid extraneous whitespace around keywords.
Okay: True and False
E271: True and False
@@ -330,8 +318,7 @@
def missing_whitespace(logical_line):
- """
- JCR: Each comma, semicolon or colon should be followed by whitespace.
+ r"""Each comma, semicolon or colon should be followed by whitespace.
Okay: [a, b]
Okay: (3,)
@@ -358,8 +345,7 @@
def indentation(logical_line, previous_logical, indent_char,
indent_level, previous_indent_level):
- r"""
- Use 4 spaces per indentation level.
+ r"""Use 4 spaces per indentation level.
For really old code that you don't want to mess up, you can continue to
use 8-space tabs.
@@ -383,16 +369,16 @@
yield 0, "E113 unexpected indentation"
-def continuation_line_indentation(logical_line, tokens, indent_level, verbose):
- r"""
- Continuation lines should align wrapped elements either vertically using
- Python's implicit line joining inside parentheses, brackets and braces, or
- using a hanging indent.
+def continued_indentation(logical_line, tokens, indent_level, hang_closing,
+ indent_char, noqa, verbose):
+ r"""Continuation lines indentation.
- When using a hanging indent the following considerations should be applied:
+ Continuation lines should align wrapped elements either vertically
+ using Python's implicit line joining inside parentheses, brackets
+ and braces, or using a hanging indent.
+ When using a hanging indent these considerations should be applied:
- there should be no arguments on the first line, and
-
- further indentation should be used to clearly distinguish itself as a
continuation line.
@@ -404,14 +390,16 @@
E122: a = (\n42)
E123: a = (\n 42\n )
E124: a = (24,\n 42\n)
- E125: if (a or\n b):\n pass
+ E125: if (\n b):\n pass
E126: a = (\n 42)
E127: a = (24,\n 42)
E128: a = (24,\n 42)
+ E129: if (a or\n b):\n pass
+ E131: a = (\n 42\n 24)
"""
first_row = tokens[0][2][0]
nrows = 1 + tokens[-1][2][0] - first_row
- if nrows == 1 or noqa(tokens[0][4]):
+ if noqa or nrows == 1:
return
# indent_next tells us whether the next block is indented; assuming
@@ -421,13 +409,20 @@
indent_next = logical_line.endswith(':')
row = depth = 0
+ valid_hangs = (4,) if indent_char != '\t' else (4, 8)
# remember how many brackets were opened on each line
parens = [0] * nrows
# relative indents of physical lines
rel_indent = [0] * nrows
+ # for each depth, collect a list of opening rows
+ open_rows = [[0]]
+ # for each depth, memorize the hanging indentation
+ hangs = [None]
# visual indents
indent_chances = {}
last_indent = tokens[0][2]
+ visual_indent = None
+ # for each depth, memorize the visual indent column
indent = [last_indent[1]]
if verbose >= 3:
print(">>> " + tokens[0][4].rstrip())
@@ -437,8 +432,7 @@
newline = row < start[0] - first_row
if newline:
row = start[0] - first_row
- newline = (not last_token_multiline and
- token_type not in (tokenize.NL, tokenize.NEWLINE))
+ newline = not last_token_multiline and token_type not in NEWLINE
if newline:
# this is the beginning of a continuation line.
@@ -449,51 +443,61 @@
# record the initial indent.
rel_indent[row] = expand_indent(line) - indent_level
- if depth:
- # a bracket expression in a continuation line.
- # find the line that it was opened on
- for open_row in range(row - 1, -1, -1):
- if parens[open_row]:
- break
- else:
- # an unbracketed continuation line (ie, backslash)
- open_row = 0
- hang = rel_indent[row] - rel_indent[open_row]
- visual_indent = indent_chances.get(start[1])
+ # identify closing bracket
+ close_bracket = (token_type == tokenize.OP and text in ']})')
- if token_type == tokenize.OP and text in ']})':
- # this line starts with a closing bracket
- if indent[depth]:
- if start[1] != indent[depth]:
- yield (start, "E124 closing bracket does not match "
- "visual indentation")
- elif hang:
+ # is the indent relative to an opening bracket line?
+ for open_row in reversed(open_rows[depth]):
+ hang = rel_indent[row] - rel_indent[open_row]
+ hanging_indent = hang in valid_hangs
+ if hanging_indent:
+ break
+ if hangs[depth]:
+ hanging_indent = (hang == hangs[depth])
+ # is there any chance of visual indent?
+ visual_indent = (not close_bracket and hang > 0 and
+ indent_chances.get(start[1]))
+
+ if close_bracket and indent[depth]:
+ # closing bracket for visual indent
+ if start[1] != indent[depth]:
+ yield (start, "E124 closing bracket does not match "
+ "visual indentation")
+ elif close_bracket and not hang:
+ # closing bracket matches indentation of opening bracket's line
+ if hang_closing:
+ yield start, "E133 closing bracket is missing indentation"
+ elif indent[depth] and start[1] < indent[depth]:
+ if visual_indent is not True:
+ # visual indent is broken
+ yield (start, "E128 continuation line "
+ "under-indented for visual indent")
+ elif hanging_indent or (indent_next and rel_indent[row] == 8):
+ # hanging indent is verified
+ if close_bracket and not hang_closing:
yield (start, "E123 closing bracket does not match "
"indentation of opening bracket's line")
+ hangs[depth] = hang
elif visual_indent is True:
# visual indent is verified
- if not indent[depth]:
- indent[depth] = start[1]
+ indent[depth] = start[1]
elif visual_indent in (text, str):
# ignore token lined up with matching one from a previous line
pass
- elif indent[depth] and start[1] < indent[depth]:
- # visual indent is broken
- yield (start, "E128 continuation line "
- "under-indented for visual indent")
- elif hang == 4 or (indent_next and rel_indent[row] == 8):
- # hanging indent is verified
- pass
else:
# indent is broken
if hang <= 0:
error = "E122", "missing indentation or outdented"
elif indent[depth]:
error = "E127", "over-indented for visual indent"
- elif hang % 4:
- error = "E121", "indentation is not a multiple of four"
+ elif not close_bracket and hangs[depth]:
+ error = "E131", "unaligned for hanging indent"
else:
- error = "E126", "over-indented for hanging indent"
+ hangs[depth] = hang
+ if hang > 4:
+ error = "E126", "over-indented for hanging indent"
+ else:
+ error = "E121", "under-indented for hanging indent"
yield start, "%s continuation line %s" % error
# look for visual indenting
@@ -510,12 +514,18 @@
# special case for the "if" statement because len("if (") == 4
elif not indent_chances and not row and not depth and text == 'if':
indent_chances[end[1] + 1] = True
+ elif text == ':' and line[end[1]:].isspace():
+ open_rows[depth].append(row)
# keep track of bracket depth
if token_type == tokenize.OP:
if text in '([{':
depth += 1
indent.append(0)
+ hangs.append(None)
+ if len(open_rows) == depth:
+ open_rows.append([])
+ open_rows[depth].append(row)
parens[row] += 1
if verbose >= 4:
print("bracket depth %s seen, col %s, visual min = %s" %
@@ -523,12 +533,14 @@
elif text in ')]}' and depth > 0:
# parent indents should not be more than this one
prev_indent = indent.pop() or last_indent[1]
+ hangs.pop()
for d in range(depth):
if indent[d] > prev_indent:
indent[d] = 0
for ind in list(indent_chances):
if ind >= prev_indent:
del indent_chances[ind]
+ del open_rows[depth + 1:]
depth -= 1
if depth:
indent_chances[indent[depth]] = True
@@ -542,21 +554,25 @@
indent_chances[start[1]] = text
last_token_multiline = (start[0] != end[0])
+ if last_token_multiline:
+ rel_indent[end[0] - first_row] = rel_indent[row]
- if indent_next and rel_indent[-1] == 4:
- yield (last_indent, "E125 continuation line does not distinguish "
- "itself from next logical line")
+ if indent_next and expand_indent(line) == indent_level + 4:
+ pos = (start[0], indent[0] + 4)
+ if visual_indent:
+ code = "E129 visually indented line"
+ else:
+ code = "E125 continuation line"
+ yield pos, "%s with same indent as next logical line" % code
def whitespace_before_parameters(logical_line, tokens):
- """
+ r"""Avoid extraneous whitespace.
+
Avoid extraneous whitespace in the following situations:
-
- - Immediately before the open parenthesis that starts the argument
- list of a function call.
-
- - Immediately before the open parenthesis that starts an indexing or
- slicing.
+ - before the open parenthesis that starts the argument list of a
+ function call.
+ - before the open parenthesis that starts an indexing or slicing.
Okay: spam(1)
E211: spam (1)
@@ -565,11 +581,9 @@
E211: dict ['key'] = list[index]
E211: dict['key'] = list [index]
"""
- prev_type = tokens[0][0]
- prev_text = tokens[0][1]
- prev_end = tokens[0][3]
+ prev_type, prev_text, __, prev_end, __ = tokens[0]
for index in range(1, len(tokens)):
- token_type, text, start, end, line = tokens[index]
+ token_type, text, start, end, __ = tokens[index]
if (token_type == tokenize.OP and
text in '([' and
start != prev_end and
@@ -585,11 +599,7 @@
def whitespace_around_operator(logical_line):
- r"""
- Avoid extraneous whitespace in the following situations:
-
- - More than one space around an assignment (or other) operator to
- align it with another.
+ r"""Avoid extraneous whitespace around an operator.
Okay: a = 12 + 3
E221: a = 4 + 5
@@ -612,13 +622,15 @@
def missing_whitespace_around_operator(logical_line, tokens):
- r"""
+ r"""Surround operators with a single space on either side.
+
- Always surround these binary operators with a single space on
either side: assignment (=), augmented assignment (+=, -= etc.),
- comparisons (==, <, >, !=, <>, <=, >=, in, not in, is, is not),
+ comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
Booleans (and, or, not).
- - Use spaces around arithmetic operators.
+ - If operators with different priorities are used, consider adding
+ whitespace around the operators with the lowest priorities.
Okay: i = i + 1
Okay: submitted += 1
@@ -642,8 +654,7 @@
prev_type = tokenize.OP
prev_text = prev_end = None
for token_type, text, start, end, line in tokens:
- if token_type in (tokenize.NL, tokenize.NEWLINE, tokenize.ERRORTOKEN):
- # ERRORTOKEN is triggered by backticks in Python 3
+ if token_type in SKIP_COMMENTS:
continue
if text in ('(', 'lambda'):
parens += 1
@@ -683,18 +694,9 @@
# Check if the operator is being used as a binary operator
# Allow unary operators: -123, -x, +1.
# Allow argument unpacking: foo(*args, **kwargs).
- if prev_type == tokenize.OP:
- binary_usage = (prev_text in '}])')
- elif prev_type == tokenize.NAME:
- binary_usage = (prev_text not in KEYWORDS)
- else:
- binary_usage = (prev_type not in SKIP_TOKENS)
-
- if binary_usage:
- if text in WS_OPTIONAL_OPERATORS:
- need_space = None
- else:
- need_space = True
+ if (prev_text in '}])' if prev_type == tokenize.OP
+ else prev_text not in KEYWORDS):
+ need_space = None
elif text in WS_OPTIONAL_OPERATORS:
need_space = None
@@ -712,11 +714,7 @@
def whitespace_around_comma(logical_line):
- r"""
- Avoid extraneous whitespace in the following situations:
-
- - More than one space around an assignment (or other) operator to
- align it with another.
+ r"""Avoid extraneous whitespace after a comma or a colon.
Note: these checks are disabled by default
@@ -734,7 +732,8 @@
def whitespace_around_named_parameter_equals(logical_line, tokens):
- """
+ r"""Don't use spaces around the '=' sign in function arguments.
+
Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value.
@@ -753,6 +752,8 @@
prev_end = None
message = "E251 unexpected spaces around keyword / parameter equals"
for token_type, text, start, end, line in tokens:
+ if token_type == tokenize.NL:
+ continue
if no_space:
no_space = False
if start != prev_end:
@@ -769,38 +770,46 @@
prev_end = end
-def whitespace_before_inline_comment(logical_line, tokens):
- """
- Separate inline comments by at least two spaces.
+def whitespace_before_comment(logical_line, tokens):
+ r"""Separate inline comments by at least two spaces.
An inline comment is a comment on the same line as a statement. Inline
comments should be separated by at least two spaces from the statement.
They should start with a # and a single space.
+ Each line of a block comment starts with a # and a single space
+ (unless it is indented text inside the comment).
+
Okay: x = x + 1 # Increment x
Okay: x = x + 1 # Increment x
+ Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1 #Increment x
E262: x = x + 1 # Increment x
+ E265: #Block comment
"""
prev_end = (0, 0)
for token_type, text, start, end, line in tokens:
if token_type == tokenize.COMMENT:
- if not line[:start[1]].strip():
- continue
- if prev_end[0] == start[0] and start[1] < prev_end[1] + 2:
- yield (prev_end,
- "E261 at least two spaces before inline comment")
+ inline_comment = line[:start[1]].strip()
+ if inline_comment:
+ if prev_end[0] == start[0] and start[1] < prev_end[1] + 2:
+ yield (prev_end,
+ "E261 at least two spaces before inline comment")
symbol, sp, comment = text.partition(' ')
- if symbol not in ('#', '#:') or comment[:1].isspace():
- yield start, "E262 inline comment should start with '# '"
+ bad_prefix = symbol not in ('#', '#:')
+ if inline_comment:
+ if bad_prefix or comment[:1].isspace():
+ yield start, "E262 inline comment should start with '# '"
+ elif bad_prefix:
+ if text.rstrip('#') and (start[0] > 1 or symbol[1] != '!'):
+ yield start, "E265 block comment should start with '# '"
elif token_type != tokenize.NL:
prev_end = end
def imports_on_separate_lines(logical_line):
- r"""
- Imports should usually be on separate lines.
+ r"""Imports should usually be on separate lines.
Okay: import os\nimport sys
E401: import sys, os
@@ -819,13 +828,11 @@
def compound_statements(logical_line):
- r"""
- Compound statements (multiple statements on the same line) are
- generally discouraged.
+ r"""Compound statements (on the same line) are generally discouraged.
While sometimes it's okay to put an if/for/while with a small body
- on the same line, never do this for multi-clause statements. Also
- avoid folding such long lines!
+ on the same line, never do this for multi-clause statements.
+ Also avoid folding such long lines!
Okay: if foo == 'blah':\n do_blah_thing()
Okay: do_one()
@@ -847,24 +854,25 @@
line = logical_line
last_char = len(line) - 1
found = line.find(':')
- if -1 < found < last_char:
+ while -1 < found < last_char:
before = line[:found]
if (before.count('{') <= before.count('}') and # {'a': 1} (dict)
before.count('[') <= before.count(']') and # [1:2] (slice)
before.count('(') <= before.count(')') and # (Python 3 annotation)
not LAMBDA_REGEX.search(before)): # lambda x: x
yield found, "E701 multiple statements on one line (colon)"
+ found = line.find(':', found + 1)
found = line.find(';')
- if -1 < found:
+ while -1 < found:
if found < last_char:
yield found, "E702 multiple statements on one line (semicolon)"
else:
yield found, "E703 statement ends with a semicolon"
+ found = line.find(';', found + 1)
def explicit_line_join(logical_line, tokens):
- r"""
- Avoid explicit line join between brackets.
+ r"""Avoid explicit line join between brackets.
The preferred way of wrapping long lines is by using Python's implied line
continuation inside parentheses, brackets and braces. Long lines can be
@@ -897,8 +905,9 @@
parens -= 1
-def comparison_to_singleton(logical_line):
- """
+def comparison_to_singleton(logical_line, noqa):
+ r"""Comparison to singletons should use "is" or "is not".
+
Comparisons to singletons like None should always be done
with "is" or "is not", never the equality operators.
@@ -911,7 +920,7 @@
set to some other value. The other value might have a type (such as a
container) that could be false in a boolean context!
"""
- match = COMPARE_SINGLETON_REGEX.search(logical_line)
+ match = not noqa and COMPARE_SINGLETON_REGEX.search(logical_line)
if match:
same = (match.group(1) == '==')
singleton = match.group(2)
@@ -927,10 +936,31 @@
(code, singleton, msg))
-def comparison_type(logical_line):
+def comparison_negative(logical_line):
+ r"""Negative comparison should be done using "not in" and "is not".
+
+ Okay: if x not in y:\n pass
+ Okay: assert (X in Y or X is Z)
+ Okay: if not (X in Y):\n pass
+ Okay: zz = x is not y
+ E713: Z = not X in Y
+ E713: if not X.B in Y:\n pass
+ E714: if not X is Y:\n pass
+ E714: Z = not X.B is Y
"""
- Object type comparisons should always use isinstance() instead of
- comparing types directly.
+ match = COMPARE_NEGATIVE_REGEX.search(logical_line)
+ if match:
+ pos = match.start(1)
+ if match.group(2) == 'in':
+ yield pos, "E713 test for membership should be 'not in'"
+ else:
+ yield pos, "E714 test for object identity should be 'is not'"
+
+
+def comparison_type(logical_line):
+ r"""Object type comparisons should always use isinstance().
+
+ Do not compare types directly.
Okay: if isinstance(obj, int):
E721: if type(obj) is type(1):
@@ -947,44 +977,36 @@
inst = match.group(1)
if inst and isidentifier(inst) and inst not in SINGLETONS:
return # Allow comparison for types which are not obvious
- yield match.start(0), "E721 do not compare types, use 'isinstance()'"
+ yield match.start(), "E721 do not compare types, use 'isinstance()'"
-def python_3000_has_key(logical_line):
- r"""
- The {}.has_key() method is removed in the Python 3.
- Use the 'in' operation instead.
+def python_3000_has_key(logical_line, noqa):
+ r"""The {}.has_key() method is removed in Python 3: use the 'in' operator.
Okay: if "alph" in d:\n print d["alph"]
W601: assert d.has_key('alph')
"""
pos = logical_line.find('.has_key(')
- if pos > -1:
+ if pos > -1 and not noqa:
yield pos, "W601 .has_key() is deprecated, use 'in'"
def python_3000_raise_comma(logical_line):
- """
- When raising an exception, use "raise ValueError('message')"
- instead of the older form "raise ValueError, 'message'".
+ r"""When raising an exception, use "raise ValueError('message')".
- The paren-using form is preferred because when the exception arguments
- are long or include string formatting, you don't need to use line
- continuation characters thanks to the containing parentheses. The older
- form is removed in Python 3.
+ The older form is removed in Python 3.
Okay: raise DummyError("Message")
W602: raise DummyError, "Message"
"""
match = RAISE_COMMA_REGEX.match(logical_line)
if match and not RERAISE_COMMA_REGEX.match(logical_line):
- yield match.start(1), "W602 deprecated form of raising exception"
+ yield match.end() - 1, "W602 deprecated form of raising exception"
def python_3000_not_equal(logical_line):
- """
- != can also be written <>, but this is an obsolete usage kept for
- backwards compatibility only. New code should always use !=.
+ r"""New code should always use != instead of <>.
+
The older syntax is removed in Python 3.
Okay: if a != 'no':
@@ -996,9 +1018,7 @@
def python_3000_backticks(logical_line):
- """
- Backticks are removed in Python 3.
- Use repr() instead.
+ r"""Backticks are removed in Python 3: use repr() instead.
Okay: val = repr(1 + 2)
W604: val = `1 + 2`
@@ -1016,49 +1036,40 @@
if '' == ''.encode():
# Python 2: implicit encoding.
def readlines(filename):
- f = open(filename)
- try:
+ """Read the source code."""
+ with open(filename, 'rU') as f:
return f.readlines()
- finally:
- f.close()
-
isidentifier = re.compile(r'[a-zA-Z_]\w*').match
stdin_get_value = sys.stdin.read
else:
# Python 3
def readlines(filename):
- f = open(filename, 'rb')
+ """Read the source code."""
try:
- coding, lines = tokenize.detect_encoding(f.readline)
- f = TextIOWrapper(f, coding, line_buffering=True)
- return [l.decode(coding) for l in lines] + f.readlines()
+ with open(filename, 'rb') as f:
+ (coding, lines) = tokenize.detect_encoding(f.readline)
+ f = TextIOWrapper(f, coding, line_buffering=True)
+ return [l.decode(coding) for l in lines] + f.readlines()
except (LookupError, SyntaxError, UnicodeError):
- f.close()
- # Fall back if files are improperly declared
- f = open(filename, encoding='latin-1')
- return f.readlines()
- finally:
- f.close()
-
+ # Fall back if file encoding is improperly declared
+ with open(filename, encoding='latin-1') as f:
+ return f.readlines()
isidentifier = str.isidentifier
def stdin_get_value():
return TextIOWrapper(sys.stdin.buffer, errors='ignore').read()
-readlines.__doc__ = " Read the source code."
noqa = re.compile(r'# no(?:qa|pep8)\b', re.I).search
def expand_indent(line):
- r"""
- Return the amount of indentation.
+ r"""Return the amount of indentation.
+
Tabs are expanded to the next multiple of 8.
>>> expand_indent(' ')
4
>>> expand_indent('\t')
8
- >>> expand_indent(' \t')
- 8
>>> expand_indent(' \t')
8
>>> expand_indent(' \t')
@@ -1078,8 +1089,7 @@
def mute_string(text):
- """
- Replace contents with 'xxx' to prevent syntax matching.
+ """Replace contents with 'xxx' to prevent syntax matching.
>>> mute_string('"abc"')
'"xxx"'
@@ -1111,7 +1121,7 @@
continue
if line[:3] == '@@ ':
hunk_match = HUNK_REGEX.match(line)
- row, nrows = [int(g or '1') for g in hunk_match.groups()]
+ (row, nrows) = [int(g or '1') for g in hunk_match.groups()]
rv[path].update(range(row, row + nrows))
elif line[:3] == '+++':
path = line[4:].split('\t', 1)[0]
@@ -1123,9 +1133,24 @@
if rows and filename_match(path, patterns)])
-def filename_match(filename, patterns, default=True):
+def normalize_paths(value, parent=os.curdir):
+ """Parse a comma-separated list of paths.
+
+ Return a list of absolute paths.
"""
- Check if patterns contains a pattern that matches filename.
+ if not value or isinstance(value, list):
+ return value
+ paths = []
+ for path in value.split(','):
+ if '/' in path:
+ path = os.path.abspath(os.path.join(parent, path))
+ paths.append(path.rstrip('/'))
+ return paths
+
+
+def filename_match(filename, patterns, default=True):
+ """Check if patterns contains a pattern that matches filename.
+
If patterns is unspecified, this always returns True.
"""
if not patterns:
@@ -1133,6 +1158,15 @@
return any(fnmatch(filename, pattern) for pattern in patterns)
+if COMMENT_WITH_NL:
+ def _is_eol_token(token):
+ return (token[0] in NEWLINE or
+ (token[0] == tokenize.COMMENT and token[1] == token[4]))
+else:
+ def _is_eol_token(token):
+ return token[0] in NEWLINE
+
+
##############################################################################
# Framework to run all checks
##############################################################################
@@ -1142,9 +1176,7 @@
def register_check(check, codes=None):
- """
- Register a new check object.
- """
+ """Register a new check object."""
def _add_check(check, kind, codes, args):
if check in _checks[kind]:
_checks[kind][check][0].extend(codes or [])
@@ -1162,9 +1194,9 @@
def init_checks_registry():
- """
- Register all globally visible functions where the first argument name
- is 'physical_line' or 'logical_line'.
+ """Register all globally visible functions.
+
+ The first argument name is either 'physical_line' or 'logical_line'.
"""
mod = inspect.getmodule(register_check)
for (name, function) in inspect.getmembers(mod, inspect.isfunction):
@@ -1173,9 +1205,7 @@
class Checker(object):
- """
- Load a Python source file, tokenize it, check coding style.
- """
+ """Load a Python source file, tokenize it, check coding style."""
def __init__(self, filename=None, lines=None,
options=None, report=None, **kwargs):
@@ -1188,6 +1218,8 @@
self._logical_checks = options.logical_checks
self._ast_checks = options.ast_checks
self.max_line_length = options.max_line_length
+ self.multiline = False # in a multiline string?
+ self.hang_closing = options.hang_closing
self.verbose = options.verbose
self.filename = filename
if filename is None:
@@ -1200,161 +1232,190 @@
try:
self.lines = readlines(filename)
except IOError:
- exc_type, exc = sys.exc_info()[:2]
+ (exc_type, exc) = sys.exc_info()[:2]
self._io_error = '%s: %s' % (exc_type.__name__, exc)
self.lines = []
else:
self.lines = lines
+ if self.lines:
+ ord0 = ord(self.lines[0][0])
+ if ord0 in (0xef, 0xfeff): # Strip the UTF-8 BOM
+ if ord0 == 0xfeff:
+ self.lines[0] = self.lines[0][1:]
+ elif self.lines[0][:3] == '\xef\xbb\xbf':
+ self.lines[0] = self.lines[0][3:]
self.report = report or options.report
self.report_error = self.report.error
def report_invalid_syntax(self):
- exc_type, exc = sys.exc_info()[:2]
- offset = exc.args[1]
- if len(offset) > 2:
- offset = offset[1:3]
+ """Check if the syntax is valid."""
+ (exc_type, exc) = sys.exc_info()[:2]
+ if len(exc.args) > 1:
+ offset = exc.args[1]
+ if len(offset) > 2:
+ offset = offset[1:3]
+ else:
+ offset = (1, 0)
self.report_error(offset[0], offset[1] or 0,
'E901 %s: %s' % (exc_type.__name__, exc.args[0]),
self.report_invalid_syntax)
- report_invalid_syntax.__doc__ = " Check if the syntax is valid."
def readline(self):
- """
- Get the next line from the input buffer.
- """
- self.line_number += 1
- if self.line_number > len(self.lines):
+ """Get the next line from the input buffer."""
+ if self.line_number >= self.total_lines:
return ''
- return self.lines[self.line_number - 1]
-
- def readline_check_physical(self):
- """
- Check and return the next physical line. This method can be
- used to feed tokenize.generate_tokens.
- """
- line = self.readline()
- if line:
- self.check_physical(line)
+ line = self.lines[self.line_number]
+ self.line_number += 1
+ if self.indent_char is None and line[:1] in WHITESPACE:
+ self.indent_char = line[0]
return line
def run_check(self, check, argument_names):
- """
- Run a check plugin.
- """
+ """Run a check plugin."""
arguments = []
for name in argument_names:
arguments.append(getattr(self, name))
return check(*arguments)
def check_physical(self, line):
- """
- Run all physical checks on a raw input line.
- """
+ """Run all physical checks on a raw input line."""
self.physical_line = line
- if self.indent_char is None and line[:1] in WHITESPACE:
- self.indent_char = line[0]
for name, check, argument_names in self._physical_checks:
result = self.run_check(check, argument_names)
if result is not None:
- offset, text = result
+ (offset, text) = result
self.report_error(self.line_number, offset, text, check)
+ if text[:4] == 'E101':
+ self.indent_char = line[0]
def build_tokens_line(self):
- """
- Build a logical line from tokens.
- """
- self.mapping = []
+ """Build a logical line from tokens."""
logical = []
+ comments = []
length = 0
- previous = None
- for token in self.tokens:
- token_type, text = token[0:2]
+ prev_row = prev_col = mapping = None
+ for token_type, text, start, end, line in self.tokens:
if token_type in SKIP_TOKENS:
continue
+ if not mapping:
+ mapping = [(0, start)]
+ if token_type == tokenize.COMMENT:
+ comments.append(text)
+ continue
if token_type == tokenize.STRING:
text = mute_string(text)
- if previous:
- end_row, end = previous[3]
- start_row, start = token[2]
- if end_row != start_row: # different row
- prev_text = self.lines[end_row - 1][end - 1]
+ if prev_row:
+ (start_row, start_col) = start
+ if prev_row != start_row: # different row
+ prev_text = self.lines[prev_row - 1][prev_col - 1]
if prev_text == ',' or (prev_text not in '{[('
and text not in '}])'):
- logical.append(' ')
- length += 1
- elif end != start: # different column
- fill = self.lines[end_row - 1][end:start]
- logical.append(fill)
- length += len(fill)
- self.mapping.append((length, token))
+ text = ' ' + text
+ elif prev_col != start_col: # different column
+ text = line[prev_col:start_col] + text
logical.append(text)
length += len(text)
- previous = token
+ mapping.append((length, end))
+ (prev_row, prev_col) = end
self.logical_line = ''.join(logical)
- # With Python 2, if the line ends with '\r\r\n' the assertion fails
- # assert self.logical_line.strip() == self.logical_line
+ self.noqa = comments and noqa(''.join(comments))
+ return mapping
def check_logical(self):
- """
- Build a line from tokens and run all logical checks on it.
- """
- self.build_tokens_line()
+ """Build a line from tokens and run all logical checks on it."""
self.report.increment_logical_line()
- first_line = self.lines[self.mapping[0][1][2][0] - 1]
- indent = first_line[:self.mapping[0][1][2][1]]
- self.previous_indent_level = self.indent_level
- self.indent_level = expand_indent(indent)
+ mapping = self.build_tokens_line()
+ (start_row, start_col) = mapping[0][1]
+ start_line = self.lines[start_row - 1]
+ self.indent_level = expand_indent(start_line[:start_col])
+ if self.blank_before < self.blank_lines:
+ self.blank_before = self.blank_lines
if self.verbose >= 2:
print(self.logical_line[:80].rstrip())
for name, check, argument_names in self._logical_checks:
if self.verbose >= 4:
print(' ' + name)
- for result in self.run_check(check, argument_names):
- offset, text = result
- if isinstance(offset, tuple):
- orig_number, orig_offset = offset
- else:
- for token_offset, token in self.mapping:
- if offset >= token_offset:
- orig_number = token[2][0]
- orig_offset = (token[2][1] + offset - token_offset)
- self.report_error(orig_number, orig_offset, text, check)
- self.previous_logical = self.logical_line
+ for offset, text in self.run_check(check, argument_names) or ():
+ if not isinstance(offset, tuple):
+ for token_offset, pos in mapping:
+ if offset <= token_offset:
+ break
+ offset = (pos[0], pos[1] + offset - token_offset)
+ self.report_error(offset[0], offset[1], text, check)
+ if self.logical_line:
+ self.previous_indent_level = self.indent_level
+ self.previous_logical = self.logical_line
+ self.blank_lines = 0
+ self.tokens = []
def check_ast(self):
+ """Build the file's AST and run all AST checks."""
try:
tree = compile(''.join(self.lines), '', 'exec', PyCF_ONLY_AST)
- except SyntaxError:
+ except (SyntaxError, TypeError):
return self.report_invalid_syntax()
- for name, cls, _ in self._ast_checks:
+ for name, cls, __ in self._ast_checks:
checker = cls(tree, self.filename)
for lineno, offset, text, check in checker.run():
- if not noqa(self.lines[lineno - 1]):
+ if not self.lines or not noqa(self.lines[lineno - 1]):
self.report_error(lineno, offset, text, check)
def generate_tokens(self):
+ """Tokenize the file, run physical line checks and yield tokens."""
if self._io_error:
self.report_error(1, 0, 'E902 %s' % self._io_error, readlines)
- tokengen = tokenize.generate_tokens(self.readline_check_physical)
+ tokengen = tokenize.generate_tokens(self.readline)
try:
for token in tokengen:
+ if token[2][0] > self.total_lines:
+ return
+ self.maybe_check_physical(token)
yield token
except (SyntaxError, tokenize.TokenError):
self.report_invalid_syntax()
+ def maybe_check_physical(self, token):
+ """If appropriate (based on token), check current physical line(s)."""
+ # Called after every token, but act only on end of line.
+ if _is_eol_token(token):
+ # Obviously, a newline token ends a single physical line.
+ self.check_physical(token[4])
+ elif token[0] == tokenize.STRING and '\n' in token[1]:
+ # Less obviously, a string that contains newlines is a
+ # multiline string, either triple-quoted or with internal
+ # newlines backslash-escaped. Check every physical line in the
+ # string *except* for the last one: its newline is outside of
+ # the multiline string, so we consider it a regular physical
+ # line, and will check it like any other physical line.
+ #
+ # Subtleties:
+ # - we don't *completely* ignore the last line; if it contains
+ # the magical "# noqa" comment, we disable all physical
+ # checks for the entire multiline string
+ # - have to wind self.line_number back because initially it
+ # points to the last line of the string, and we want
+ # check_physical() to give accurate feedback
+ if noqa(token[4]):
+ return
+ self.multiline = True
+ self.line_number = token[2][0]
+ for line in token[1].split('\n')[:-1]:
+ self.check_physical(line + '\n')
+ self.line_number += 1
+ self.multiline = False
+
def check_all(self, expected=None, line_offset=0):
- """
- Run all checks on the input file.
- """
+ """Run all checks on the input file."""
self.report.init_file(self.filename, self.lines, expected, line_offset)
+ self.total_lines = len(self.lines)
if self._ast_checks:
self.check_ast()
self.line_number = 0
self.indent_char = None
- self.indent_level = 0
+ self.indent_level = self.previous_indent_level = 0
self.previous_logical = ''
self.tokens = []
- self.blank_lines = blank_lines_before_comment = 0
+ self.blank_lines = self.blank_before = 0
parens = 0
for token in self.generate_tokens():
self.tokens.append(token)
@@ -1372,29 +1433,33 @@
elif text in '}])':
parens -= 1
elif not parens:
- if token_type == tokenize.NEWLINE:
- if self.blank_lines < blank_lines_before_comment:
- self.blank_lines = blank_lines_before_comment
- self.check_logical()
- self.tokens = []
- self.blank_lines = blank_lines_before_comment = 0
- elif token_type == tokenize.NL:
- if len(self.tokens) == 1:
+ if token_type in NEWLINE:
+ if token_type == tokenize.NEWLINE:
+ self.check_logical()
+ self.blank_before = 0
+ elif len(self.tokens) == 1:
# The physical line contains only this token.
self.blank_lines += 1
- self.tokens = []
- elif token_type == tokenize.COMMENT and len(self.tokens) == 1:
- if blank_lines_before_comment < self.blank_lines:
- blank_lines_before_comment = self.blank_lines
- self.blank_lines = 0
- if COMMENT_WITH_NL:
+ del self.tokens[0]
+ else:
+ self.check_logical()
+ elif COMMENT_WITH_NL and token_type == tokenize.COMMENT:
+ if len(self.tokens) == 1:
# The comment also ends a physical line
- self.tokens = []
+ token = list(token)
+ token[1] = text.rstrip('\r\n')
+ token[3] = (token[2][0], token[2][1] + len(token[1]))
+ self.tokens = [tuple(token)]
+ self.check_logical()
+ if self.tokens:
+ self.check_physical(self.lines[-1])
+ self.check_logical()
return self.report.get_file_results()
class BaseReport(object):
"""Collect the results of the checks."""
+
print_filename = False
def __init__(self, options):
@@ -1457,8 +1522,7 @@
for key in self.messages if key.startswith(prefix)])
def get_statistics(self, prefix=''):
- """
- Get statistics for message codes that start with the prefix.
+ """Get statistics for message codes that start with the prefix.
prefix='' matches all errors and warnings
prefix='E' matches all errors
@@ -1529,9 +1593,9 @@
else:
line = self.lines[line_number - 1]
print(line.rstrip())
- print(' ' * offset + '^')
+ print(re.sub(r'\S', ' ', line[:offset]) + '^')
if self._show_pep8 and doc:
- print(doc.lstrip('\n').rstrip())
+ print(' ' + doc.strip())
return self.file_errors
@@ -1557,11 +1621,12 @@
parse_argv = kwargs.pop('parse_argv', False)
config_file = kwargs.pop('config_file', None)
parser = kwargs.pop('parser', None)
+ # build options from dict
+ options_dict = dict(*args, **kwargs)
+ arglist = None if parse_argv else options_dict.get('paths', None)
options, self.paths = process_options(
- parse_argv=parse_argv, config_file=config_file, parser=parser)
- if args or kwargs:
- # build options from dict
- options_dict = dict(*args, **kwargs)
+ arglist, parse_argv, config_file, parser)
+ if options_dict:
options.__dict__.update(options_dict)
if 'paths' in options_dict:
self.paths = options_dict['paths']
@@ -1572,11 +1637,14 @@
if not options.reporter:
options.reporter = BaseReport if options.quiet else StandardReport
- for index, value in enumerate(options.exclude):
- options.exclude[index] = value.rstrip('/')
- # Ignore all checks which are not explicitly selected
options.select = tuple(options.select or ())
- options.ignore = tuple(options.ignore or options.select and ('',))
+ if not (options.select or options.ignore or
+ options.testsuite or options.doctest) and DEFAULT_IGNORE:
+ # The default choice: ignore controversial checks
+ options.ignore = tuple(DEFAULT_IGNORE.split(','))
+ else:
+ # Ignore all checks which are not explicitly selected
+ options.ignore = ('',) if options.select else tuple(options.ignore)
options.benchmark_keys = BENCHMARK_KEYS[:]
options.ignore_code = self.ignore_code
options.physical_checks = self.get_checks('physical_line')
@@ -1629,37 +1697,45 @@
print('directory ' + root)
counters['directories'] += 1
for subdir in sorted(dirs):
- if self.excluded(os.path.join(root, subdir)):
+ if self.excluded(subdir, root):
dirs.remove(subdir)
for filename in sorted(files):
# contain a pattern that matches?
if ((filename_match(filename, filepatterns) and
- not self.excluded(filename))):
+ not self.excluded(filename, root))):
runner(os.path.join(root, filename))
- def excluded(self, filename):
+ def excluded(self, filename, parent=None):
+ """Check if the file should be excluded.
+
+ Check if 'options.exclude' contains a pattern that matches filename.
"""
- Check if options.exclude contains a pattern that matches filename.
- """
+ if not self.options.exclude:
+ return False
basename = os.path.basename(filename)
- return any((filename_match(filename, self.options.exclude,
- default=False),
- filename_match(basename, self.options.exclude,
- default=False)))
+ if filename_match(basename, self.options.exclude):
+ return True
+ if parent:
+ filename = os.path.join(parent, filename)
+ filename = os.path.abspath(filename)
+ return filename_match(filename, self.options.exclude)
def ignore_code(self, code):
- """
- Check if the error code should be ignored.
+ """Check if the error code should be ignored.
If 'options.select' contains a prefix of the error code,
return False. Else, if 'options.ignore' contains a prefix of
the error code, return True.
"""
+ if len(code) < 4 and any(s.startswith(code)
+ for s in self.options.select):
+ return False
return (code.startswith(self.options.ignore) and
not code.startswith(self.options.select))
def get_checks(self, argument_name):
- """
+ """Get all the checks for this category.
+
Find all globally visible functions where the first argument name
starts with argument_name and which contain selected tests.
"""
@@ -1675,8 +1751,9 @@
parser = OptionParser(prog=prog, version=version,
usage="%prog [options] input ...")
parser.config_options = [
- 'exclude', 'filename', 'select', 'ignore', 'max-line-length', 'count',
- 'format', 'quiet', 'show-pep8', 'show-source', 'statistics', 'verbose']
+ 'exclude', 'filename', 'select', 'ignore', 'max-line-length',
+ 'hang-closing', 'count', 'format', 'quiet', 'show-pep8',
+ 'show-source', 'statistics', 'verbose']
parser.add_option('-v', '--verbose', default=0, action='count',
help="print status messages, or debug with -vv")
parser.add_option('-q', '--quiet', default=0, action='count',
@@ -1711,6 +1788,9 @@
default=MAX_LINE_LENGTH,
help="set maximum allowed line length "
"(default: %default)")
+ parser.add_option('--hang-closing', action='store_true',
+ help="hang closing bracket instead of matching "
+ "indentation of opening bracket's line")
parser.add_option('--format', metavar='format', default='default',
help="set the error format [default|pylint|<custom>]")
parser.add_option('--diff', action='store_true',
@@ -1737,19 +1817,15 @@
print('user configuration: %s' % user_conf)
config.read(user_conf)
+ local_dir = os.curdir
parent = tail = args and os.path.abspath(os.path.commonprefix(args))
while tail:
- for name in PROJECT_CONFIG:
- local_conf = os.path.join(parent, name)
- if os.path.isfile(local_conf):
- break
- else:
- parent, tail = os.path.split(parent)
- continue
- if options.verbose:
- print('local configuration: %s' % local_conf)
- config.read(local_conf)
- break
+ if config.read([os.path.join(parent, fn) for fn in PROJECT_CONFIG]):
+ local_dir = parent
+ if options.verbose:
+ print('local configuration: in %s' % parent)
+ break
+ (parent, tail) = os.path.split(parent)
pep8_section = parser.prog
if config.has_section(pep8_section):
@@ -1757,29 +1833,30 @@
for o in parser.option_list])
# First, read the default values
- new_options, _ = parser.parse_args([])
+ (new_options, __) = parser.parse_args([])
# Second, parse the configuration
for opt in config.options(pep8_section):
+ if opt.replace('_', '-') not in parser.config_options:
+ print(" unknown option '%s' ignored" % opt)
+ continue
if options.verbose > 1:
print(" %s = %s" % (opt, config.get(pep8_section, opt)))
- if opt.replace('_', '-') not in parser.config_options:
- print("Unknown option: '%s'\n not in [%s]" %
- (opt, ' '.join(parser.config_options)))
- sys.exit(1)
normalized_opt = opt.replace('-', '_')
opt_type = option_list[normalized_opt]
if opt_type in ('int', 'count'):
value = config.getint(pep8_section, opt)
elif opt_type == 'string':
value = config.get(pep8_section, opt)
+ if normalized_opt == 'exclude':
+ value = normalize_paths(value, local_dir)
else:
assert opt_type in ('store_true', 'store_false')
value = config.getboolean(pep8_section, opt)
setattr(new_options, normalized_opt, value)
# Third, overwrite with the command-line options
- options, _ = parser.parse_args(arglist, values=new_options)
+ (options, __) = parser.parse_args(arglist, values=new_options)
options.doctest = options.testsuite = False
return options
@@ -1787,9 +1864,6 @@
def process_options(arglist=None, parse_argv=False, config_file=None,
parser=None):
"""Process options passed either via arglist or via command line args."""
- if not arglist and not parse_argv:
- # Don't read the command line if the module is used as a library.
- arglist = []
if not parser:
parser = get_parser()
if not parser.has_option('--config'):
@@ -1802,7 +1876,12 @@
(parser.prog, ', '.join(parser.config_options))))
group.add_option('--config', metavar='path', default=config_file,
help="user config file location (default: %default)")
- options, args = parser.parse_args(arglist)
+ # Don't read the command line if the module is used as a library.
+ if not arglist and not parse_argv:
+ arglist = []
+ # If parse_argv is True and arglist is None, arguments are
+ # parsed from the command line (sys.argv)
+ (options, args) = parser.parse_args(arglist)
options.reporter = None
if options.ensure_value('testsuite', False):
@@ -1817,18 +1896,10 @@
options = read_config(options, args, arglist, parser)
options.reporter = parse_argv and options.quiet == 1 and FileReport
- if options.filename:
- options.filename = options.filename.split(',')
- options.exclude = options.exclude.split(',')
- if options.select:
- options.select = options.select.split(',')
- if options.ignore:
- options.ignore = options.ignore.split(',')
- elif not (options.select or
- options.testsuite or options.doctest) and DEFAULT_IGNORE:
- # The default choice: ignore controversial checks
- # (for doctest and testsuite, all checks are required)
- options.ignore = DEFAULT_IGNORE.split(',')
+ options.filename = options.filename and options.filename.split(',')
+ options.exclude = normalize_paths(options.exclude)
+ options.select = options.select and options.select.split(',')
+ options.ignore = options.ignore and options.ignore.split(',')
if options.diff:
options.reporter = DiffReport
@@ -1841,13 +1912,19 @@
def _main():
"""Parse options and run checks on Python source."""
+ import signal
+
+ # Handle "Broken pipe" gracefully
+ try:
+ signal.signal(signal.SIGPIPE, lambda signum, frame: sys.exit(1))
+ except AttributeError:
+ pass # not supported on Windows
+
pep8style = StyleGuide(parse_argv=True, config_file=True)
options = pep8style.options
if options.doctest or options.testsuite:
- sys.path[:0] = [TESTSUITE_PATH]
- from test_pep8 import run_tests
- del sys.path[0]
- report = run_tests(pep8style, options.doctest, options.testsuite)
+ from testsuite.support import run_tests
+ report = run_tests(pep8style)
else:
report = pep8style.check_files()
if options.statistics:
diff --git a/python/helpers/pycharm/lettuce_runner.py b/python/helpers/pycharm/lettuce_runner.py
new file mode 100644
index 0000000..6aaa566
--- /dev/null
+++ b/python/helpers/pycharm/lettuce_runner.py
@@ -0,0 +1,132 @@
+# coding=utf-8
+"""
+BDD lettuce framework runner
+"""
+__author__ = 'Ilya.Kazakevich'
+import os
+from lettuce.exceptions import ReasonToFail
+import time
+import sys
+import tcmessages
+import lettuce
+from lettuce import core
+
+
+# Error message about unsupported outlines
+_NO_OUTLINE_ERROR = "Outline scenarios are not supported due to https://github.com/gabrielfalcao/lettuce/issues/451"
+
+
+class LettuceRunner(object):
+ """
+ TODO: Runs lettuce
+ """
+
+ def __init__(self, base_dir):
+ """
+ :param base_dir base directory to run tests in
+ :type base_dir: str
+
+ """
+ self.base_dir = base_dir
+ self.runner = lettuce.Runner(base_dir)
+ self.messages = tcmessages.TeamcityServiceMessages()
+ self.test_start_time = None
+
+ def report_tests(self):
+ """
+ :returns : number of tests
+ :rtype : int
+ """
+ result = 0
+ for feature_file in self.runner.loader.find_feature_files():
+ feature = core.Feature.from_file(feature_file)
+ for scenario in feature.scenarios:
+ assert isinstance(scenario, core.Scenario), scenario
+ if not scenario.outlines:
+ result += len(scenario.steps)
+ self.messages.testCount(result)
+
+ def report_scenario_started(self, scenario):
+ """
+ Reports scenario launched
+ :type scenario core.Scenario
+ :param scenario: scenario
+ """
+ if scenario.outlines:
+ self.messages.testIgnored(scenario.name,
+ _NO_OUTLINE_ERROR)
+ scenario.steps = [] # Clear to prevent running. TODO: Fix when this issue fixed
+ scenario.background = None # TODO: undocumented
+ return
+ self.report_suite(True, scenario.name, scenario.described_at)
+
+ def report_suite(self, is_start, name, described_at):
+ """
+ Reports some suite (scenario, feature, background etc) is started or stopped
+ :param is_start: started or not
+ :param name: suite name
+ :param described_at: where it is described (file, line)
+ :return:
+ """
+ if is_start:
+ self.messages.testSuiteStarted(name, self._gen_location(described_at))
+ else:
+ self.messages.testSuiteFinished(name)
+
+ def report_step(self, is_start, step):
+ """
+ Reports step start / stop
+ :param is_start: true if step started
+ :type step core.Step
+ :param step: step
+ """
+ test_name = step.sentence
+ if is_start:
+ self.test_start_time = time.time()
+ self.messages.testStarted(test_name, self._gen_location(step.described_at))
+ elif step.passed:
+ duration = 0
+ if self.test_start_time:
+ duration = long(time.time() - self.test_start_time)
+ self.messages.testFinished(test_name, duration=duration)
+ self.test_start_time = None
+ elif step.failed:
+ reason = step.why
+ assert isinstance(reason, ReasonToFail), reason
+ self.messages.testFailed(test_name, message=reason.exception, details=reason.traceback)
+
+ def _gen_location(self, description):
+ """
+ :param description: "described_at" (file, line)
+ :return: location in format file:line by "described_at"
+ """
+ return "file:///{}/{}:{}".format(self.base_dir, description.file, description.line)
+
+ def run(self):
+ """
+ Launches runner
+ """
+ self.report_tests()
+ self.messages.testMatrixEntered()
+
+ lettuce.before.each_feature(lambda f: self.report_suite(True, f.name, f.described_at))
+ lettuce.after.each_feature(lambda f: self.report_suite(False, f.name, f.described_at))
+
+ lettuce.before.each_scenario(lambda s: self.report_scenario_started(s))
+ lettuce.after.each_scenario(lambda s: self.report_suite(False, s.name, s.described_at))
+
+ lettuce.before.each_background(
+ lambda b, *args: self.report_suite(True, "Scenario background", b.feature.described_at))
+ lettuce.after.each_background(
+ lambda b, *args: self.report_suite(False, "Scenario background", b.feature.described_at))
+
+ lettuce.before.each_step(lambda s: self.report_step(True, s))
+ lettuce.after.each_step(lambda s: self.report_step(False, s))
+
+ self.runner.run()
+
+
+if __name__ == "__main__":
+ path = sys.argv[1] if len(sys.argv) > 1 else "."
+ assert os.path.exists(path), "{} does not exist".format(path)
+ LettuceRunner(path).run()
\ No newline at end of file
diff --git a/python/helpers/pycharm_generator_utils/module_redeclarator.py b/python/helpers/pycharm_generator_utils/module_redeclarator.py
index 3af1961..0dbdbb5 100644
--- a/python/helpers/pycharm_generator_utils/module_redeclarator.py
+++ b/python/helpers/pycharm_generator_utils/module_redeclarator.py
@@ -1007,6 +1007,8 @@
if self.doing_builtins and p_name == BUILTIN_MOD_NAME:
txt = create_generator()
self.classes_buf.out(0, txt)
+ txt = create_function()
+ self.classes_buf.out(0, txt)
# Fake <type 'namedtuple'>
if version[0] >= 3 or (version[0] == 2 and version[1] >= 6):
diff --git a/python/helpers/pycharm_generator_utils/util_methods.py b/python/helpers/pycharm_generator_utils/util_methods.py
index d679e33..b6805c4 100644
--- a/python/helpers/pycharm_generator_utils/util_methods.py
+++ b/python/helpers/pycharm_generator_utils/util_methods.py
@@ -75,6 +75,47 @@
"""
return txt
+def create_function():
+ txt = """
+class __function(object):
+ '''A mock class representing function type.'''
+
+ def __init__(self):
+ self.__name__ = ''
+ self.__doc__ = ''
+ self.__dict__ = ''
+ self.__module__ = ''
+"""
+ if version[0] == 2:
+ txt += """
+ self.func_defaults = {}
+ self.func_globals = {}
+ self.func_closure = None
+ self.func_code = None
+ self.func_name = ''
+ self.func_doc = ''
+ self.func_dict = ''
+"""
+ if version[0] >= 3 or (version[0] == 2 and version[1] >= 6):
+ txt += """
+ self.__defaults__ = {}
+ self.__globals__ = {}
+ self.__closure__ = None
+ self.__code__ = None
+ self.__name__ = ''
+"""
+ if version[0] >= 3:
+ txt += """
+ self.__annotations__ = {}
+ self.__kwdefaults__ = {}
+"""
+ if version[0] >= 3 and version[1] >= 3:
+ txt += """
+ self.__qualname__ = ''
+"""
+ return txt
+
+
def _searchbases(cls, accum):
# logic copied from inspect.py
if cls not in accum:
diff --git a/python/helpers/pydev/pydevd_comm.py b/python/helpers/pydev/pydevd_comm.py
index 9d4f2e7..b4cf585 100644
--- a/python/helpers/pydev/pydevd_comm.py
+++ b/python/helpers/pydev/pydevd_comm.py
@@ -427,7 +427,7 @@
s = socket(AF_INET, SOCK_STREAM)
- MAX_TRIES = 20
+ MAX_TRIES = 100
i = 0
while i<MAX_TRIES:
try:
diff --git a/python/helpers/pydev/pydevd_signature.py b/python/helpers/pydev/pydevd_signature.py
index 2f9a182..e11bb5d 100644
--- a/python/helpers/pydev/pydevd_signature.py
+++ b/python/helpers/pydev/pydevd_signature.py
@@ -47,7 +47,7 @@
name = code.co_varnames[i]
tp = type(locals[name])
class_name = tp.__name__
- if class_name == 'instance':
+ if class_name == 'instance': # old-style classes
tp = locals[name].__class__
class_name = tp.__name__
diff --git a/python/psi-api/src/com/jetbrains/python/PyNames.java b/python/psi-api/src/com/jetbrains/python/PyNames.java
index 8e2430e..94e35f7 100644
--- a/python/psi-api/src/com/jetbrains/python/PyNames.java
+++ b/python/psi-api/src/com/jetbrains/python/PyNames.java
@@ -59,6 +59,7 @@
public static final String FAKE_OLD_BASE = "___Classobj";
public static final String FAKE_GENERATOR = "__generator";
+ public static final String FAKE_FUNCTION = "__function";
public static final String FAKE_NAMEDTUPLE = "__namedtuple";
public static final String FUTURE_MODULE = "__future__";
@@ -167,17 +168,24 @@
*/
public static ImmutableSet<String> UnderscoredAttributes = ImmutableSet.of(
"__all__",
+ "__annotations__",
"__author__",
"__bases__",
+ "__closure__",
+ "__code__",
"__defaults__",
"__dict__",
+ "__dir__",
"__doc__",
"__docformat__",
"__file__",
+ "__func__",
+ "__globals__",
"__kwdefaults__",
"__members__",
"__metaclass__",
"__mod__",
+ "__module__",
"__mro__",
"__name__",
"__path__",
diff --git a/python/pydevSrc/com/jetbrains/python/debugger/pydev/RemoteDebugger.java b/python/pydevSrc/com/jetbrains/python/debugger/pydev/RemoteDebugger.java
index a307c03..9e347e0 100644
--- a/python/pydevSrc/com/jetbrains/python/debugger/pydev/RemoteDebugger.java
+++ b/python/pydevSrc/com/jetbrains/python/debugger/pydev/RemoteDebugger.java
@@ -10,7 +10,9 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.TimeoutUtil;
import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.io.BaseOutputReader;
import com.intellij.xdebugger.frame.XValueChildrenList;
import com.jetbrains.python.console.pydev.PydevCompletionVariant;
import com.jetbrains.python.debugger.*;
@@ -25,6 +27,7 @@
import java.security.SecureRandom;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Future;
public class RemoteDebugger implements ProcessDebugger {
@@ -87,8 +90,7 @@
if (myConnected) {
try {
- myDebuggerReader = new DebuggerReader();
- ApplicationManager.getApplication().executeOnPooledThread(myDebuggerReader);
+ myDebuggerReader = createReader(mySocket);
}
catch (Exception e) {
synchronized (mySocketObject) {
@@ -405,35 +407,42 @@
execute(command);
}
- private class DebuggerReader implements Runnable {
- private final InputStream myInputStream;
- private boolean myClosing = false;
+ public DebuggerReader createReader(@NotNull Socket socket) throws IOException {
+ synchronized (mySocketObject) {
+ final InputStream myInputStream = socket.getInputStream();
+ //noinspection IOResourceOpenedButNotSafelyClosed
+ final Reader reader = new InputStreamReader(myInputStream, Charset.forName("UTF-8")); //TODO: correct econding?
+ return new DebuggerReader(reader);
+ }
+ }
- private DebuggerReader() throws IOException {
- synchronized (mySocketObject) {
- this.myInputStream = mySocket.getInputStream();
- }
+ private class DebuggerReader extends BaseOutputReader {
+ private boolean myClosing = false;
+ private Reader myReader;
+
+ private DebuggerReader(final Reader reader) throws IOException {
+ super(reader);
+ myReader = reader;
+ start();
}
- public void run() {
- final BufferedReader reader = new BufferedReader(new InputStreamReader(myInputStream, Charset.forName("UTF-8")));
+ protected void doRun() {
try {
- String line;
- while ((line = reader.readLine()) != null) {
- processResponse(line);
+ while (true) {
+ boolean read = readAvailable();
+
if (myClosing) {
break;
}
+
+ TimeoutUtil.sleep(mySleepingPolicy.getTimeToSleep(read));
}
}
- catch (SocketException ignore) {
+ catch (Exception e) {
fireCommunicationError();
}
- catch (Exception e) {
- LOG.error(e);
- }
finally {
- closeReader(reader);
+ closeReader(myReader);
fireExitEvent();
}
}
@@ -518,7 +527,7 @@
return ProtocolParser.parseThread(frame.getPayload(), myDebugProcess.getPositionConverter());
}
- private void closeReader(BufferedReader reader) {
+ private void closeReader(Reader reader) {
try {
reader.close();
}
@@ -526,9 +535,19 @@
}
}
+ @Override
+ protected Future<?> executeOnPooledThread(Runnable runnable) {
+ return ApplicationManager.getApplication().executeOnPooledThread(runnable);
+ }
+
public void close() {
myClosing = true;
}
+
+ @Override
+ protected void onTextAvailable(@NotNull String text) {
+ processResponse(text);
+ }
}
private void writeToConsole(PyIo io) {
diff --git a/python/src/META-INF/pycharm-core.xml b/python/src/META-INF/pycharm-core.xml
index 775d912..13ba05d 100644
--- a/python/src/META-INF/pycharm-core.xml
+++ b/python/src/META-INF/pycharm-core.xml
@@ -33,7 +33,7 @@
<projectConfigurable instance="com.jetbrains.python.configuration.PythonContentEntriesConfigurable"/>
<projectConfigurable instance="com.jetbrains.python.buildout.BuildoutModulesConfigurable"/>
- <projectConfigurable instance="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable"/>
+ <projectConfigurable groupId="project" instance="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable"/>
<projectConfigurable instance="com.jetbrains.python.configuration.PyDependenciesConfigurable"/>
<directoryProjectConfigurator implementation="com.jetbrains.python.PythonSdkConfigurator" id="sdk"
diff --git a/python/src/META-INF/python-core.xml b/python/src/META-INF/python-core.xml
index 54491eb..88280cc 100644
--- a/python/src/META-INF/python-core.xml
+++ b/python/src/META-INF/python-core.xml
@@ -387,8 +387,6 @@
<completion.contributor language="Python"
implementationClass="com.jetbrains.python.codeInsight.completion.PyClassNameCompletionContributor"/>
- <completion.contributor language="Python"
- implementationClass="com.jetbrains.python.codeInsight.completion.PyBracketProtectingCompletionContributor"/>
<weigher key="completion" implementationClass="com.jetbrains.python.codeInsight.completion.PythonCompletionWeigher" order="first"/>
<completion.confidence language="Python" implementationClass="com.jetbrains.python.codeInsight.completion.PyCompletionConfidence"/>
<typedHandler implementation="com.jetbrains.python.console.completion.PythonConsoleAutopopupBlockingHandler" id="pydevBlockAutoPopup"
@@ -446,10 +444,10 @@
<applicationService serviceInterface="com.jetbrains.python.documentation.PythonDocumentationMap"
serviceImplementation="com.jetbrains.python.documentation.PythonDocumentationMap"/>
- <applicationConfigurable instance="com.jetbrains.python.documentation.PythonDocumentationConfigurable"
+ <applicationConfigurable groupId="tools" instance="com.jetbrains.python.documentation.PythonDocumentationConfigurable"
id="com.jetbrains.python.documentation.PythonDocumentationConfigurable"
displayName="Python External Documentation"/>
- <projectConfigurable instance="com.jetbrains.python.configuration.PyIntegratedToolsModulesConfigurable"
+ <projectConfigurable groupId="tools" instance="com.jetbrains.python.configuration.PyIntegratedToolsModulesConfigurable"
id="com.jetbrains.python.configuration.PyIntegratedToolsModulesConfigurable" displayName="Python Integrated Tools"
nonDefaultProject="true"/>
<moduleService serviceInterface="com.jetbrains.python.documentation.PyDocumentationSettings"
@@ -465,10 +463,10 @@
<project.converterProvider implementation="com.jetbrains.python.testing.converters.PythonTestConverterProvider"/>
- <projectConfigurable instance="com.jetbrains.python.console.PyConsoleOptionsConfigurable"/>
+ <projectConfigurable groupId="build" dynamic="true" instance="com.jetbrains.python.console.PyConsoleOptionsConfigurable"/>
<projectService serviceImplementation="com.jetbrains.python.console.PyConsoleOptions"/>
- <projectConfigurable instance="com.jetbrains.python.debugger.PyDebuggerConfigurable"/>
+ <projectConfigurable groupId="build" instance="com.jetbrains.python.debugger.PyDebuggerConfigurable"/>
<projectService serviceImplementation="com.jetbrains.python.debugger.PyDebuggerOptionsProvider"/>
<codeBlockProvider language="Python" implementationClass="com.jetbrains.python.codeInsight.PyCodeBlockProvider"/>
diff --git a/python/src/com/jetbrains/python/codeInsight/completion/PyBracketProtectingCompletionContributor.java b/python/src/com/jetbrains/python/codeInsight/completion/PyBracketProtectingCompletionContributor.java
deleted file mode 100644
index 766e5be..0000000
--- a/python/src/com/jetbrains/python/codeInsight/completion/PyBracketProtectingCompletionContributor.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.jetbrains.python.codeInsight.completion;
-
-import com.intellij.codeInsight.completion.CompletionContributor;
-import com.intellij.codeInsight.completion.CompletionInitializationContext;
-import com.intellij.psi.PsiReference;
-import com.jetbrains.python.psi.impl.references.PyOperatorReference;
-import org.jetbrains.annotations.NotNull;
-
-/**
- * @author yole
- */
-public class PyBracketProtectingCompletionContributor extends CompletionContributor {
- @Override
- public void beforeCompletion(@NotNull CompletionInitializationContext context) {
- PsiReference ref = context.getFile().findReferenceAt(context.getSelectionEndOffset());
- if (ref instanceof PyOperatorReference) {
- context.setReplacementOffset(context.getIdentifierEndOffset());
- }
- }
-}
diff --git a/python/src/com/jetbrains/python/codeInsight/editorActions/smartEnter/PySmartEnterProcessor.java b/python/src/com/jetbrains/python/codeInsight/editorActions/smartEnter/PySmartEnterProcessor.java
index 725cd2d..e27f2a6 100644
--- a/python/src/com/jetbrains/python/codeInsight/editorActions/smartEnter/PySmartEnterProcessor.java
+++ b/python/src/com/jetbrains/python/codeInsight/editorActions/smartEnter/PySmartEnterProcessor.java
@@ -15,6 +15,7 @@
*/
package com.jetbrains.python.codeInsight.editorActions.smartEnter;
+import com.google.common.collect.ImmutableList;
import com.intellij.codeInsight.editorActions.smartEnter.SmartEnterProcessor;
import com.intellij.codeInsight.lookup.LookupManager;
import com.intellij.openapi.diagnostic.Logger;
@@ -48,25 +49,22 @@
*/
public class PySmartEnterProcessor extends SmartEnterProcessor {
private static final Logger LOG = Logger.getInstance("#com.jetbrains.python.codeInsight.editorActions.smartEnter.PySmartEnterProcessor");
- private static final List<PyFixer> ourFixers = new ArrayList<PyFixer>();
- private static final List<EnterProcessor> ourProcessors = new ArrayList<EnterProcessor>();
-
- static {
- ourFixers.add(new PyStringLiteralFixer());
- ourFixers.add(new PyParenthesizedFixer());
- ourFixers.add(new PyMissingBracesFixer());
- ourFixers.add(new PyConditionalStatementPartFixer());
- ourFixers.add(new PyUnconditionalStatementPartFixer());
- ourFixers.add(new PyForPartFixer());
- ourFixers.add(new PyExceptFixer());
- ourFixers.add(new PyArgumentListFixer());
- ourFixers.add(new PyParameterListFixer());
- ourFixers.add(new PyFunctionFixer());
- ourFixers.add(new PyClassFixer());
-
- ourProcessors.add(new PyCommentBreakerEnterProcessor());
- ourProcessors.add(new PyPlainEnterProcessor());
- }
+ private static final List<PyFixer> ourFixers = ImmutableList.<PyFixer>builder()
+ .add(new PyStringLiteralFixer())
+ .add(new PyParenthesizedFixer())
+ .add(new PyMissingBracesFixer())
+ .add(new PyConditionalStatementPartFixer())
+ .add(new PyUnconditionalStatementPartFixer())
+ .add(new PyForPartFixer())
+ .add(new PyExceptFixer())
+ .add(new PyArgumentListFixer())
+ .add(new PyParameterListFixer())
+ .add(new PyFunctionFixer())
+ .add(new PyClassFixer())
+ .add(new PyWithFixer())
+ .build();
+ private static final List<EnterProcessor> ourProcessors = ImmutableList.of(new PyCommentBreakerEnterProcessor(),
+ new PyPlainEnterProcessor());
private static class TooManyAttemptsException extends Exception {
}
diff --git a/python/src/com/jetbrains/python/codeInsight/editorActions/smartEnter/enterProcessors/PyPlainEnterProcessor.java b/python/src/com/jetbrains/python/codeInsight/editorActions/smartEnter/enterProcessors/PyPlainEnterProcessor.java
index d671790..ac2e312 100644
--- a/python/src/com/jetbrains/python/codeInsight/editorActions/smartEnter/enterProcessors/PyPlainEnterProcessor.java
+++ b/python/src/com/jetbrains/python/codeInsight/editorActions/smartEnter/enterProcessors/PyPlainEnterProcessor.java
@@ -20,10 +20,7 @@
import com.intellij.psi.PsiElement;
import com.intellij.psi.util.PsiTreeUtil;
import com.jetbrains.python.codeInsight.editorActions.smartEnter.SmartEnterUtil;
-import com.jetbrains.python.psi.PyClass;
-import com.jetbrains.python.psi.PyFunction;
-import com.jetbrains.python.psi.PyStatementList;
-import com.jetbrains.python.psi.PyStatementPart;
+import com.jetbrains.python.psi.*;
import org.jetbrains.annotations.Nullable;
/**
@@ -43,10 +40,14 @@
}
else if (psiElement instanceof PyClass) {
return ((PyClass)psiElement).getStatementList();
- } else {
- final CaretModel caretModel = editor.getCaretModel();
- final PsiElement atCaret = psiElement.getContainingFile().findElementAt(caretModel.getOffset());
- PyStatementPart statementPart = PsiTreeUtil.getParentOfType(atCaret, PyStatementPart.class);
+ }
+ else if (psiElement instanceof PyWithStatement) {
+ return PsiTreeUtil.getChildOfType(psiElement, PyStatementList.class);
+ }
+ else {
+ final CaretModel caretModel = editor.getCaretModel();
+ final PsiElement atCaret = psiElement.getContainingFile().findElementAt(caretModel.getOffset());
+ final PyStatementPart statementPart = PsiTreeUtil.getParentOfType(atCaret, PyStatementPart.class);
if (statementPart != null) {
return statementPart.getStatementList();
}
@@ -55,7 +56,7 @@
}
public boolean doEnter(Editor editor, PsiElement psiElement, boolean isModified) {
- PyStatementList statementList = getStatementList(psiElement, editor);
+ final PyStatementList statementList = getStatementList(psiElement, editor);
if (statementList != null && statementList.getStatements().length == 0) {
SmartEnterUtil.plainEnter(editor);
//editor.getCaretModel().moveToOffset(statementList.getTextRange().getEndOffset());
diff --git a/python/src/com/jetbrains/python/codeInsight/editorActions/smartEnter/fixers/PyWithFixer.java b/python/src/com/jetbrains/python/codeInsight/editorActions/smartEnter/fixers/PyWithFixer.java
new file mode 100644
index 0000000..b6d099e
--- /dev/null
+++ b/python/src/com/jetbrains/python/codeInsight/editorActions/smartEnter/fixers/PyWithFixer.java
@@ -0,0 +1,79 @@
+/*
+ * 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.jetbrains.python.codeInsight.editorActions.smartEnter.fixers;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.psi.PsiElement;
+import com.intellij.util.IncorrectOperationException;
+import com.jetbrains.python.PyTokenTypes;
+import com.jetbrains.python.codeInsight.editorActions.smartEnter.PySmartEnterProcessor;
+import com.jetbrains.python.psi.PyElementType;
+import com.jetbrains.python.psi.PyExpression;
+import com.jetbrains.python.psi.PyWithItem;
+import com.jetbrains.python.psi.PyWithStatement;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import static com.jetbrains.python.psi.PyUtil.sure;
+
+/**
+ * @author Mikhail Golubev
+ */
+public class PyWithFixer implements PyFixer {
+ public void apply(Editor editor, PySmartEnterProcessor processor, PsiElement psiElement) throws IncorrectOperationException {
+ if (psiElement instanceof PyWithStatement) {
+ final PyWithStatement withStatement = (PyWithStatement)psiElement;
+ final PsiElement colonToken = getFirstChildOfType(psiElement, PyTokenTypes.COLON);
+ final PsiElement withToken = getFirstChildOfType(withStatement, PyTokenTypes.WITH_KEYWORD);
+ final Document document = editor.getDocument();
+ if (colonToken == null) {
+ int insertAt = sure(withToken).getTextRange().getEndOffset();
+ String textToInsert = ":";
+ final PyWithItem[] withItems = withStatement.getWithItems();
+ final PyWithItem lastItem = withItems.length != 0 ? withItems[withItems.length - 1] : null;
+ if (lastItem == null || lastItem.getExpression() == null) {
+ textToInsert = " :";
+ processor.registerUnresolvedError(insertAt + 1);
+ }
+ else {
+ final PyExpression expression = lastItem.getExpression();
+ insertAt = expression.getTextRange().getEndOffset();
+ final PsiElement asToken = getFirstChildOfType(lastItem, PyTokenTypes.AS_KEYWORD);
+ if (asToken != null) {
+ insertAt = asToken.getTextRange().getEndOffset();
+ final PyExpression target = lastItem.getTarget();
+ if (target != null) {
+ insertAt = target.getTextRange().getEndOffset();
+ }
+ else {
+ textToInsert = " :";
+ processor.registerUnresolvedError(insertAt + 1);
+ }
+ }
+ }
+ document.insertString(insertAt, textToInsert);
+ }
+ }
+ }
+
+ @Nullable
+ private static PsiElement getFirstChildOfType(@NotNull final PsiElement element, @NotNull PyElementType type) {
+ final ASTNode child = element.getNode().findChildByType(type);
+ return child != null ? child.getPsi() : null;
+ }
+}
diff --git a/python/src/com/jetbrains/python/codeInsight/intentions/ConvertFormatOperatorToMethodIntention.java b/python/src/com/jetbrains/python/codeInsight/intentions/ConvertFormatOperatorToMethodIntention.java
index 3df0a3e..0ba35ed 100644
--- a/python/src/com/jetbrains/python/codeInsight/intentions/ConvertFormatOperatorToMethodIntention.java
+++ b/python/src/com/jetbrains/python/codeInsight/intentions/ConvertFormatOperatorToMethodIntention.java
@@ -290,7 +290,10 @@
}
}
else target.append("(").append(paramText).append(")"); // tuple is ok as is
- element.replace(elementGenerator.createExpressionFromText(LanguageLevel.forElement(element), target.toString()));
+ // Correctly handle multiline implicitly concatenated string literals (PY-9176)
+ target.insert(0, '(').append(')');
+ final PyExpression parenthesized = elementGenerator.createExpressionFromText(LanguageLevel.forElement(element), target.toString());
+ element.replace(sure(((PyParenthesizedExpression)parenthesized).getContainedExpression()));
}
private static String getSeparator(PyStringLiteralExpression leftExpression) {
diff --git a/python/src/com/jetbrains/python/console/PydevConsoleRunner.java b/python/src/com/jetbrains/python/console/PydevConsoleRunner.java
index ba2f137..3d77ac4f 100644
--- a/python/src/com/jetbrains/python/console/PydevConsoleRunner.java
+++ b/python/src/com/jetbrains/python/console/PydevConsoleRunner.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -52,8 +52,8 @@
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.util.Couple;
import com.intellij.openapi.util.Key;
-import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.io.StreamUtil;
import com.intellij.openapi.vfs.CharsetToolkit;
@@ -360,7 +360,7 @@
manager.createRemoteProcess(getProject(), myRemoteCredentials, mappings, commandLine, true);
- Pair<Integer, Integer> remotePorts = getRemotePortsFromProcess(remoteProcess);
+ Couple<Integer> remotePorts = getRemotePortsFromProcess(remoteProcess);
remoteProcess.addLocalTunnel(myPorts[0], myRemoteCredentials.getHost(), remotePorts.first);
remoteProcess.addRemoteTunnel(remotePorts.second, "localhost", myPorts[1]);
@@ -374,10 +374,10 @@
}
}
- private static Pair<Integer, Integer> getRemotePortsFromProcess(RemoteSshProcess process) throws ExecutionException {
+ private static Couple<Integer> getRemotePortsFromProcess(RemoteSshProcess process) throws ExecutionException {
Scanner s = new Scanner(process.getInputStream());
- return Pair.create(readInt(s, process), readInt(s, process));
+ return Couple.of(readInt(s, process), readInt(s, process));
}
private static int readInt(Scanner s, Process process) throws ExecutionException {
diff --git a/python/src/com/jetbrains/python/inspections/quickfix/GenerateBinaryStubsFix.java b/python/src/com/jetbrains/python/inspections/quickfix/GenerateBinaryStubsFix.java
index 3e13332..7d087bd 100644
--- a/python/src/com/jetbrains/python/inspections/quickfix/GenerateBinaryStubsFix.java
+++ b/python/src/com/jetbrains/python/inspections/quickfix/GenerateBinaryStubsFix.java
@@ -19,12 +19,15 @@
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.execution.process.ProcessOutput;
+import com.intellij.openapi.application.ReadAction;
+import com.intellij.openapi.application.Result;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.progress.Task;
+import com.intellij.openapi.progress.Task.Backgroundable;
import com.intellij.openapi.progress.impl.BackgroundableProcessIndicator;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
@@ -65,6 +68,7 @@
/**
* Generates pack of fixes available for some unresolved import statement.
* Be sure to call {@link #isApplicable(com.jetbrains.python.psi.PyImportStatementBase)} first to make sure this statement is supported
+ *
* @param importStatementBase statement to fix
* @return pack of fixes
*/
@@ -73,14 +77,14 @@
final List<String> names = importStatementBase.getFullyQualifiedObjectNames();
final List<GenerateBinaryStubsFix> result = new ArrayList<GenerateBinaryStubsFix>(names.size());
for (final String qualifiedName : names) {
- result.add(new GenerateBinaryStubsFix(importStatementBase, qualifiedName));
+ result.add(new GenerateBinaryStubsFix(importStatementBase, qualifiedName));
}
return result;
}
/**
* @param importStatementBase statement to fix
- * @param qualifiedName name should be fixed (one of {@link com.jetbrains.python.psi.PyImportStatementBase#getFullyQualifiedObjectNames()})
+ * @param qualifiedName name should be fixed (one of {@link com.jetbrains.python.psi.PyImportStatementBase#getFullyQualifiedObjectNames()})
*/
private GenerateBinaryStubsFix(@NotNull final PyImportStatementBase importStatementBase, @NotNull final String qualifiedName) {
myQualifiedName = qualifiedName;
@@ -102,15 +106,34 @@
@Override
public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
final PsiFile file = descriptor.getPsiElement().getContainingFile();
- final String folder = file.getContainingDirectory().getVirtualFile().getCanonicalPath();
+ final Backgroundable backgroundable = getFixTask(file);
+ ProgressManager.getInstance().runProcessWithProgressAsynchronously(backgroundable, new BackgroundableProcessIndicator(backgroundable));
+ }
- final Task.Backgroundable backgroundable = new Task.Backgroundable(project, "Generating skeletons for binary module", false) {
+
+ /**
+ * Returns fix task that is used to generate stubs
+ * @param fileToRunTaskIn file where task should run
+ * @return task itself
+ */
+ @NotNull
+ public Backgroundable getFixTask(@NotNull final PsiFile fileToRunTaskIn) {
+ final Project project = fileToRunTaskIn.getProject();
+ final String folder = fileToRunTaskIn.getContainingDirectory().getVirtualFile().getCanonicalPath();
+ return new Task.Backgroundable(project, "Generating skeletons for binary module", false) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
indicator.setIndeterminate(true);
- final List<String> assemblyRefs = collectAssemblyReferences(file);
+
+ final List<String> assemblyRefs = new ReadAction<List<String>>() {
+ @Override
+ protected void run(@NotNull Result<List<String>> result) throws Throwable {
+ result.setResult(collectAssemblyReferences(fileToRunTaskIn));
+ }
+ }.execute().getResultObject();
+
try {
final PySkeletonRefresher refresher = new PySkeletonRefresher(project, null, mySdk, null, null, folder);
@@ -133,7 +156,6 @@
}
}
};
- ProgressManager.getInstance().runProcessWithProgressAsynchronously(backgroundable, new BackgroundableProcessIndicator(backgroundable));
}
private boolean generateSkeletonsForList(@NotNull final PySkeletonRefresher refresher,
@@ -185,8 +207,8 @@
// TODO: What if user loads it not by literal? We need to ask user for list of DLLs
if (node.isCalleeText("AddReference", "AddReferenceByPartialName", "AddReferenceByName")) {
final PyExpression[] args = node.getArguments();
- if (args.length == 1 && args [0] instanceof PyStringLiteralExpression) {
- result.add(((PyStringLiteralExpression) args [0]).getStringValue());
+ if (args.length == 1 && args[0] instanceof PyStringLiteralExpression) {
+ result.add(((PyStringLiteralExpression)args[0]).getStringValue());
}
}
}
diff --git a/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferencesInspection.java b/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferencesInspection.java
index fac391a..c0fb3c1 100644
--- a/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferencesInspection.java
+++ b/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferencesInspection.java
@@ -464,7 +464,9 @@
}
if (expr.isQualified()) {
final PyClassTypeImpl object_type = (PyClassTypeImpl)PyBuiltinCache.getInstance(node).getObjectType();
- if ((object_type != null) && object_type.getPossibleInstanceMembers().contains(refName)) return;
+ if ((object_type != null) && object_type.getPossibleInstanceMembers().contains(refName)){
+ return;
+ }
}
else {
if (PyUnreachableCodeInspection.hasAnyInterruptedControlFlowPaths(expr)) {
@@ -494,7 +496,9 @@
}
// unqualified:
// may be module's
- if (PyModuleType.getPossibleInstanceMembers().contains(refName)) return;
+ if (PyModuleType.getPossibleInstanceMembers().contains(refName)) {
+ return;
+ }
// may be a "try: import ..."; not an error not to resolve
if ((
PsiTreeUtil.getParentOfType(
diff --git a/python/src/com/jetbrains/python/packaging/PyPackageManagerImpl.java b/python/src/com/jetbrains/python/packaging/PyPackageManagerImpl.java
index 359e497..65d95eb 100644
--- a/python/src/com/jetbrains/python/packaging/PyPackageManagerImpl.java
+++ b/python/src/com/jetbrains/python/packaging/PyPackageManagerImpl.java
@@ -795,14 +795,22 @@
private String getHelperPath(String helper) {
String helperPath;
final SdkAdditionalData sdkData = mySdk.getSdkAdditionalData();
- if (sdkData instanceof RemoteSdkCredentials) {
- final RemoteSdkCredentials remoteSdkCredentials = (RemoteSdkCredentials)sdkData;
- if (!StringUtil.isEmpty(remoteSdkCredentials.getHelpersPath())) {
- helperPath = new RemoteFile(remoteSdkCredentials.getHelpersPath(),
- helper).getPath();
+ if (sdkData instanceof PyRemoteSdkAdditionalDataBase) {
+ PyRemoteSdkAdditionalDataBase remoteSdkData = (PyRemoteSdkAdditionalDataBase)mySdk.getSdkAdditionalData();
+
+ try {
+ final RemoteSdkCredentials remoteSdkCredentials = remoteSdkData.getRemoteSdkCredentials(false);
+ if (!StringUtil.isEmpty(remoteSdkCredentials.getHelpersPath())) {
+ helperPath = new RemoteFile(remoteSdkCredentials.getHelpersPath(),
+ helper).getPath();
+ }
+ else {
+ helperPath = null;
+ }
}
- else {
+ catch (Exception e) {
helperPath = null;
+ LOG.error(e);
}
}
else {
@@ -833,25 +841,26 @@
catch (final ExecutionException e) {
if (e.getCause() instanceof VagrantNotStartedException) {
throw new PyExternalProcessException(ERROR_VAGRANT_NOT_LAUNCHED, helperPath, args, "Vagrant instance is down. <a href=\"" +
- LAUNCH_VAGRANT +
- "\">Launch vagrant</a>").withHandler(LAUNCH_VAGRANT, new Runnable() {
- @Override
- public void run() {
- final PythonRemoteInterpreterManager manager = PythonRemoteInterpreterManager.getInstance();
- if (manager != null) {
+ LAUNCH_VAGRANT +
+ "\">Launch vagrant</a>")
+ .withHandler(LAUNCH_VAGRANT, new Runnable() {
+ @Override
+ public void run() {
+ final PythonRemoteInterpreterManager manager = PythonRemoteInterpreterManager.getInstance();
+ if (manager != null) {
- try {
- manager.runVagrant(((VagrantNotStartedException)e.getCause()).getVagrantFolder());
- clearCaches();
-
- }
- catch (ExecutionException e1) {
- throw new RuntimeException(e1);
+ try {
+ manager.runVagrant(((VagrantNotStartedException)e.getCause()).getVagrantFolder());
+ clearCaches();
+ }
+ catch (ExecutionException e1) {
+ throw new RuntimeException(e1);
+ }
}
}
- }
- });
- } else {
+ });
+ }
+ else {
throw new PyExternalProcessException(ERROR_REMOTE_ACCESS, helperPath, args, e.getMessage());
}
}
diff --git a/python/src/com/jetbrains/python/packaging/PyPackageUtil.java b/python/src/com/jetbrains/python/packaging/PyPackageUtil.java
index 3bfcc49..31258fa 100644
--- a/python/src/com/jetbrains/python/packaging/PyPackageUtil.java
+++ b/python/src/com/jetbrains/python/packaging/PyPackageUtil.java
@@ -181,7 +181,7 @@
VfsUtilCore.visitChildrenRecursively(root, new VirtualFileVisitor() {
@Override
public boolean visitFile(@NotNull VirtualFile file) {
- if (!fileIndex.isIgnored(file) && file.isDirectory() && file.findChild(PyNames.INIT_DOT_PY) != null) {
+ if (!fileIndex.isExcluded(file) && file.isDirectory() && file.findChild(PyNames.INIT_DOT_PY) != null) {
results.add(VfsUtilCore.getRelativePath(file, root, '.'));
}
return true;
diff --git a/python/src/com/jetbrains/python/projectView/PyRemoteLibrariesNode.java b/python/src/com/jetbrains/python/projectView/PyRemoteLibrariesNode.java
index 62de7ea..c5b0af7 100644
--- a/python/src/com/jetbrains/python/projectView/PyRemoteLibrariesNode.java
+++ b/python/src/com/jetbrains/python/projectView/PyRemoteLibrariesNode.java
@@ -19,16 +19,16 @@
import com.google.common.base.Predicates;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Lists;
+import com.intellij.ide.highlighter.ArchiveFileType;
import com.intellij.ide.projectView.PresentationData;
import com.intellij.ide.projectView.ViewSettings;
import com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode;
import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
+import com.intellij.openapi.vfs.JarFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.psi.PsiDirectory;
-import com.intellij.psi.PsiElement;
-import com.intellij.psi.PsiManager;
+import com.intellij.psi.*;
import com.intellij.util.PlatformIcons;
import com.jetbrains.python.remote.PyRemoteSdkAdditionalDataBase;
import com.jetbrains.python.sdk.PySdkUtil;
@@ -75,11 +75,16 @@
return FluentIterable.from(Lists.newArrayList(getValue().getChildren())).transform(new Function<PsiElement, AbstractTreeNode>() {
@Override
public AbstractTreeNode apply(PsiElement input) {
- if (input instanceof PsiDirectory) {
- PsiDirectory directory = (PsiDirectory)input;
- if (myRemoteSdkData.getPathMappings().canReplaceLocal((directory.getVirtualFile().getPath()))) {
- return new PyRemoteRootNode(myRemoteSdkData.getPathMappings().convertToRemote(directory.getVirtualFile().getPath()),
- getProject(), directory, getSettings());
+ if (input instanceof PsiFileSystemItem) {
+ String path = ((PsiFileSystemItem)input).getVirtualFile().getPath();
+
+
+ PsiDirectory dir = input instanceof PsiDirectory ? (PsiDirectory)input : getDirectoryForJar((PsiFile)input);
+
+
+ if (myRemoteSdkData.getPathMappings().canReplaceLocal(path)) {
+ return new PyRemoteRootNode(myRemoteSdkData.getPathMappings().convertToRemote(path),
+ getProject(), dir, getSettings());
}
}
@@ -88,6 +93,26 @@
}).filter(Predicates.notNull()).toList();
}
+ @Nullable
+ private PsiDirectory getDirectoryForJar(PsiFile input) {
+ VirtualFile jarRoot = getJarRoot(input);
+ if (myProject != null && jarRoot != null) {
+ return PsiManager.getInstance(myProject).findDirectory(jarRoot);
+ }
+ else {
+ return null;
+ }
+ }
+
+ @Nullable
+ private static VirtualFile getJarRoot(PsiFile input) {
+ final VirtualFile file = input.getVirtualFile();
+ if (file == null || !file.isValid() || !(file.getFileType() instanceof ArchiveFileType)) {
+ return null;
+ }
+ return JarFileSystem.getInstance().getJarRootForLocalFile(file);
+ }
+
public static class PyRemoteRootNode extends PsiDirectoryNode {
private String myRemotePath;
diff --git a/python/src/com/jetbrains/python/projectView/PyTreeStructureProvider.java b/python/src/com/jetbrains/python/projectView/PyTreeStructureProvider.java
index 6153bc6..8e48894 100644
--- a/python/src/com/jetbrains/python/projectView/PyTreeStructureProvider.java
+++ b/python/src/com/jetbrains/python/projectView/PyTreeStructureProvider.java
@@ -28,6 +28,8 @@
import com.intellij.openapi.projectRoots.SdkTypeId;
import com.intellij.openapi.roots.JdkOrderEntry;
import com.intellij.openapi.roots.LibraryOrSdkOrderEntry;
+import com.intellij.openapi.vfs.JarFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
@@ -50,7 +52,9 @@
public class PyTreeStructureProvider implements SelectableTreeStructureProvider, DumbAware {
@NotNull
@Override
- public Collection<AbstractTreeNode> modify(@NotNull AbstractTreeNode parent, @NotNull Collection<AbstractTreeNode> children, ViewSettings settings) {
+ public Collection<AbstractTreeNode> modify(@NotNull AbstractTreeNode parent,
+ @NotNull Collection<AbstractTreeNode> children,
+ ViewSettings settings) {
final Project project = parent.getProject();
final Sdk sdk = getPythonSdk(parent);
if (sdk != null && project != null) {
@@ -111,7 +115,15 @@
if (directory.getVirtualFile().equals(PyUserSkeletonsUtil.getUserSkeletonsDirectory())) {
continue;
}
- PsiDirectory dirParent = directory.getParent();
+ VirtualFile dir = directory.getVirtualFile();
+ if (dir.getFileSystem() instanceof JarFileSystem) {
+ dir = ((JarFileSystem)directory.getVirtualFile().getFileSystem()).getLocalVirtualFileFor(directory.getVirtualFile());
+ }
+ if (dir == null) {
+ continue;
+ }
+ VirtualFile dirParent = dir.getParent();
+
if (dirParent != null && dirParent.getName().equals(PythonSdkType.SKELETON_DIR_NAME)) {
continue;
}
@@ -120,7 +132,7 @@
continue;
}
if (dirParent != null) {
- PsiDirectory grandParent = dirParent.getParent();
+ VirtualFile grandParent = dirParent.getParent();
if (grandParent != null && grandParent.getName().equals(PythonSdkType.REMOTE_SOURCES_DIR_NAME)) {
continue;
@@ -158,8 +170,8 @@
}
}
if (parents.size() > 0) {
- return parents.get(parents.size()-1);
+ return parents.get(parents.size() - 1);
}
- return element.getContainingFile();
+ return element.getContainingFile();
}
}
diff --git a/python/src/com/jetbrains/python/psi/impl/PyStarImportElementImpl.java b/python/src/com/jetbrains/python/psi/impl/PyStarImportElementImpl.java
index 307ac8e..4011c23 100644
--- a/python/src/com/jetbrains/python/psi/impl/PyStarImportElementImpl.java
+++ b/python/src/com/jetbrains/python/psi/impl/PyStarImportElementImpl.java
@@ -15,6 +15,8 @@
*/
package com.jetbrains.python.psi.impl;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
import com.intellij.lang.ASTNode;
import com.intellij.navigation.ItemPresentation;
import com.intellij.psi.PsiElement;
@@ -50,7 +52,11 @@
for (PsiElement importedFile : new HashSet<PsiElement>(importedFiles)) { // resolver gives lots of duplicates
final PsiElement source = PyUtil.turnDirIntoInit(importedFile);
if (source instanceof PyFile) {
- chain.add(((PyFile) source).iterateNames());
+ Iterable<PyElement> declaredNames = ((PyFile)source).iterateNames();
+ if (((PyFile)source).getDunderAll() == null) {
+ declaredNames = excludeUnderscoredNames(declaredNames);
+ }
+ chain.add(declaredNames);
}
}
return chain;
@@ -58,6 +64,19 @@
return Collections.emptyList();
}
+ private static Iterable<PyElement> excludeUnderscoredNames(Iterable<PyElement> declaredNames) {
+ return Iterables.filter(declaredNames, new Predicate<PyElement>() {
+ @Override
+ public boolean apply(@Nullable PyElement input) {
+ final String name = input != null ? input.getName() : null;
+ if (name != null && name.startsWith("_")) {
+ return false;
+ }
+ return true;
+ }
+ });
+ }
+
@Nullable
public PsiElement getElementNamed(final String name) {
if (PyUtil.isClassPrivateName(name)) {
@@ -76,7 +95,7 @@
final PsiElement result = results != null && !results.isEmpty() ? results.get(0).getElement() : null;
if (result != null) {
final List<String> all = sourceFile.getDunderAll();
- if (all != null && !all.contains(name)) {
+ if (all != null ? !all.contains(name) : name.startsWith("_")) {
continue;
}
return result;
diff --git a/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java b/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java
index 136a707..7e15cab 100644
--- a/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java
+++ b/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java
@@ -146,7 +146,7 @@
private static final FileAttribute PERSISTENCE = new FileAttribute("python_language_level_persistence", 2, true);
- public void persistAttribute(@NotNull VirtualFile fileOrDir, @NotNull LanguageLevel level) throws IOException {
+ public void persistAttribute(@NotNull Project project, @NotNull VirtualFile fileOrDir, @NotNull LanguageLevel level) throws IOException {
final DataInputStream iStream = PERSISTENCE.readAttribute(fileOrDir);
if (iStream != null) {
try {
@@ -164,7 +164,7 @@
for (VirtualFile child : fileOrDir.getChildren()) {
if (!child.isDirectory() && PythonFileType.INSTANCE.equals(child.getFileType())) {
- PushedFilePropertiesUpdater.filePropertiesChanged(child);
+ PushedFilePropertiesUpdater.getInstance(project).filePropertiesChanged(child);
}
}
}
@@ -247,7 +247,7 @@
return false;
}
if (file.isDirectory()) {
- PushedFilePropertiesUpdater.findAndUpdateValue(project, file, PythonLanguageLevelPusher.this, languageLevel);
+ PushedFilePropertiesUpdater.getInstance(project).findAndUpdateValue(file, PythonLanguageLevelPusher.this, languageLevel);
}
if (suppressSizeLimit) {
SingleRootFileViewProvider.doNotCheckFileSizeLimit(file);
diff --git a/python/src/com/jetbrains/python/psi/impl/stubs/PyFileStubBuilder.java b/python/src/com/jetbrains/python/psi/impl/stubs/PyFileStubBuilder.java
index 15a3421..0858ff5 100644
--- a/python/src/com/jetbrains/python/psi/impl/stubs/PyFileStubBuilder.java
+++ b/python/src/com/jetbrains/python/psi/impl/stubs/PyFileStubBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -29,6 +29,7 @@
* @author yole
*/
public class PyFileStubBuilder extends DefaultStubBuilder {
+ @NotNull
@Override
protected StubElement createStubForFile(@NotNull PsiFile file) {
if (file instanceof PyFile) {
diff --git a/python/src/com/jetbrains/python/psi/types/PyFunctionType.java b/python/src/com/jetbrains/python/psi/types/PyFunctionType.java
index bb58b68..4b3adfd 100644
--- a/python/src/com/jetbrains/python/psi/types/PyFunctionType.java
+++ b/python/src/com/jetbrains/python/psi/types/PyFunctionType.java
@@ -16,8 +16,11 @@
package com.jetbrains.python.psi.types;
import com.intellij.psi.PsiElement;
+import com.intellij.util.ArrayUtil;
import com.intellij.util.ProcessingContext;
+import com.jetbrains.python.PyNames;
import com.jetbrains.python.psi.*;
+import com.jetbrains.python.psi.impl.PyBuiltinCache;
import com.jetbrains.python.psi.resolve.PyResolveContext;
import com.jetbrains.python.psi.resolve.RatedResolveResult;
import org.jetbrains.annotations.NotNull;
@@ -71,12 +74,20 @@
@Nullable PyExpression location,
@NotNull AccessDirection direction,
@NotNull PyResolveContext resolveContext) {
- return Collections.emptyList();
+ final PyClassTypeImpl functionType = PyBuiltinCache.getInstance(getCallable()).getObjectType(PyNames.FAKE_FUNCTION);
+ if (functionType == null) {
+ return Collections.emptyList();
+ }
+ return functionType.resolveMember(name, location, direction, resolveContext);
}
@Override
public Object[] getCompletionVariants(String completionPrefix, PsiElement location, ProcessingContext context) {
- return new Object[0];
+ final PyClassTypeImpl functionType = PyBuiltinCache.getInstance(getCallable()).getObjectType(PyNames.FAKE_FUNCTION);
+ if (functionType == null) {
+ return ArrayUtil.EMPTY_OBJECT_ARRAY;
+ }
+ return functionType.getCompletionVariants(completionPrefix, location, context);
}
@Override
diff --git a/python/src/com/jetbrains/python/psi/types/PyModuleType.java b/python/src/com/jetbrains/python/psi/types/PyModuleType.java
index f2dc67c..db5a9ba 100644
--- a/python/src/com/jetbrains/python/psi/types/PyModuleType.java
+++ b/python/src/com/jetbrains/python/psi/types/PyModuleType.java
@@ -308,7 +308,7 @@
return !(psiElement instanceof PyImportElement) ||
PsiTreeUtil.getParentOfType(psiElement, PyImportStatementBase.class) instanceof PyFromImportStatement;
}
- }, new PyUtil.UnderscoreFilter(0));
+ }, null);
if (suppressParentheses) {
processor.suppressParentheses();
}
diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkType.java b/python/src/com/jetbrains/python/sdk/PythonSdkType.java
index 5e3506b..f194f35 100644
--- a/python/src/com/jetbrains/python/sdk/PythonSdkType.java
+++ b/python/src/com/jetbrains/python/sdk/PythonSdkType.java
@@ -56,7 +56,9 @@
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;
import com.intellij.reference.SoftReference;
-import com.intellij.remote.*;
+import com.intellij.remote.CredentialsType;
+import com.intellij.remote.RemoteSdkCredentialsHolder;
+import com.intellij.remote.VagrantNotStartedException;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Consumer;
import com.intellij.util.NullableConsumer;
@@ -993,9 +995,9 @@
}
public static boolean isIncompleteRemote(Sdk sdk) {
- if (sdk.getSdkAdditionalData() instanceof RemoteSdkCredentials) {
+ if (PySdkUtil.isRemote(sdk)) {
//noinspection ConstantConditions
- if (!((RemoteSdkCredentials)sdk.getSdkAdditionalData()).isInitialized()) {
+ if (!((PyRemoteSdkAdditionalDataBase)sdk.getSdkAdditionalData()).isInitialized()) {
return true;
}
}
diff --git a/python/src/com/jetbrains/python/sdk/flavors/PyRemoteSdkFlavor.java b/python/src/com/jetbrains/python/sdk/flavors/PyRemoteSdkFlavor.java
index 271afc6..1240031 100644
--- a/python/src/com/jetbrains/python/sdk/flavors/PyRemoteSdkFlavor.java
+++ b/python/src/com/jetbrains/python/sdk/flavors/PyRemoteSdkFlavor.java
@@ -57,6 +57,6 @@
@Nullable
private static String getExecutableName(String path) {
- return RemoteFile.detectSystemByPath(path).createRemoteFile(path).getName();
+ return RemoteFile.createRemoteFile(path).getName();
}
}
diff --git a/python/src/com/jetbrains/python/validation/Pep8ExternalAnnotator.java b/python/src/com/jetbrains/python/validation/Pep8ExternalAnnotator.java
index c115ba4..a7faa6e 100644
--- a/python/src/com/jetbrains/python/validation/Pep8ExternalAnnotator.java
+++ b/python/src/com/jetbrains/python/validation/Pep8ExternalAnnotator.java
@@ -145,7 +145,7 @@
}
final PyPep8Inspection inspection = (PyPep8Inspection)profile.getUnwrappedTool(PyPep8Inspection.KEY.toString(), file);
final List<String> ignoredErrors = inspection.ignoredErrors;
- final int margin = CodeStyleSettingsManager.getInstance(file.getProject()).getCurrentSettings().RIGHT_MARGIN;
+ final int margin = CodeStyleSettingsManager.getInstance(file.getProject()).getCurrentSettings().getRightMargin(file.getLanguage());
return new State(homePath, file.getText(), profile.getErrorLevel(key, file), ignoredErrors, margin);
}
diff --git a/python/testData/MockSdk2.7/python_stubs/__builtin__.py b/python/testData/MockSdk2.7/python_stubs/__builtin__.py
index 6ae5948..ca174bb 100644
--- a/python/testData/MockSdk2.7/python_stubs/__builtin__.py
+++ b/python/testData/MockSdk2.7/python_stubs/__builtin__.py
@@ -1,7 +1,7 @@
# encoding: utf-8
# module __builtin__
# from (built-in)
-# by generator 1.124
+# by generator 1.135
from __future__ import print_function
"""
Built-in functions, exceptions, and other objects.
@@ -43,25 +43,24 @@
"""
return 0
-
def all(iterable): # real signature unknown; restored from __doc__
"""
all(iterable) -> bool
Return True if bool(x) is True for all values x in the iterable.
+ If the iterable is empty, return True.
"""
return False
-
def any(iterable): # real signature unknown; restored from __doc__
"""
any(iterable) -> bool
Return True if bool(x) is True for any x in the iterable.
+ If the iterable is empty, return False.
"""
return False
-
def apply(p_object, args=None, kwargs=None): # real signature unknown; restored from __doc__
"""
apply(object[, args[, kwargs]]) -> value
@@ -75,7 +74,6 @@
"""
pass
-
def bin(number): # real signature unknown; restored from __doc__
"""
bin(number) -> string
@@ -84,7 +82,6 @@
"""
return ""
-
def callable(p_object): # real signature unknown; restored from __doc__
"""
callable(object) -> bool
@@ -94,7 +91,6 @@
"""
return False
-
def chr(i): # real signature unknown; restored from __doc__
"""
chr(i) -> character
@@ -103,7 +99,6 @@
"""
return ""
-
def cmp(x, y): # real signature unknown; restored from __doc__
"""
cmp(x, y) -> integer
@@ -112,7 +107,6 @@
"""
return 0
-
def coerce(x, y): # real signature unknown; restored from __doc__
"""
coerce(x, y) -> (x1, y1)
@@ -123,7 +117,6 @@
"""
pass
-
def compile(source, filename, mode, flags=None, dont_inherit=None): # real signature unknown; restored from __doc__
"""
compile(source, filename, mode[, flags[, dont_inherit]]) -> code object
@@ -142,7 +135,6 @@
"""
pass
-
def copyright(*args, **kwargs): # real signature unknown
"""
interactive prompt objects for printing the license text, a list of
@@ -150,7 +142,6 @@
"""
pass
-
def credits(*args, **kwargs): # real signature unknown
"""
interactive prompt objects for printing the license text, a list of
@@ -158,7 +149,6 @@
"""
pass
-
def delattr(p_object, name): # real signature unknown; restored from __doc__
"""
delattr(object, name)
@@ -168,7 +158,6 @@
"""
pass
-
def dir(p_object=None): # real signature unknown; restored from __doc__
"""
dir([object]) -> list of strings
@@ -186,7 +175,6 @@
"""
return []
-
def divmod(x, y): # known case of __builtin__.divmod
"""
divmod(x, y) -> (quotient, remainder)
@@ -195,7 +183,6 @@
"""
return (0, 0)
-
def eval(source, globals=None, locals=None): # real signature unknown; restored from __doc__
"""
eval(source[, globals[, locals]]) -> value
@@ -209,7 +196,6 @@
"""
pass
-
def execfile(filename, globals=None, locals=None): # real signature unknown; restored from __doc__
"""
execfile(filename[, globals[, locals]])
@@ -220,11 +206,9 @@
"""
pass
-
def exit(*args, **kwargs): # real signature unknown
pass
-
def filter(function_or_none, sequence): # known special case of filter
"""
filter(function or None, sequence) -> list, tuple, or string
@@ -235,7 +219,6 @@
"""
pass
-
def format(value, format_spec=None): # real signature unknown; restored from __doc__
"""
format(value[, format_spec]) -> string
@@ -245,7 +228,6 @@
"""
return ""
-
def getattr(object, name, default=None): # known special case of getattr
"""
getattr(object, name[, default]) -> value
@@ -256,7 +238,6 @@
"""
pass
-
def globals(): # real signature unknown; restored from __doc__
"""
globals() -> dictionary
@@ -265,7 +246,6 @@
"""
return {}
-
def hasattr(p_object, name): # real signature unknown; restored from __doc__
"""
hasattr(object, name) -> bool
@@ -275,7 +255,6 @@
"""
return False
-
def hash(p_object): # real signature unknown; restored from __doc__
"""
hash(object) -> integer
@@ -285,7 +264,6 @@
"""
return 0
-
def help(with_a_twist): # real signature unknown; restored from __doc__
"""
Define the builtin 'help'.
@@ -293,7 +271,6 @@
"""
pass
-
def hex(number): # real signature unknown; restored from __doc__
"""
hex(number) -> string
@@ -302,7 +279,6 @@
"""
return ""
-
def id(p_object): # real signature unknown; restored from __doc__
"""
id(object) -> integer
@@ -312,7 +288,6 @@
"""
return 0
-
def input(prompt=None): # real signature unknown; restored from __doc__
"""
input([prompt]) -> value
@@ -321,7 +296,6 @@
"""
pass
-
def intern(string): # real signature unknown; restored from __doc__
"""
intern(string) -> string
@@ -333,7 +307,6 @@
"""
return ""
-
def isinstance(p_object, class_or_type_or_tuple): # real signature unknown; restored from __doc__
"""
isinstance(object, class-or-type-or-tuple) -> bool
@@ -345,7 +318,6 @@
"""
return False
-
def issubclass(C, B): # real signature unknown; restored from __doc__
"""
issubclass(C, B) -> bool
@@ -356,7 +328,6 @@
"""
return False
-
def iter(source, sentinel=None): # known special case of iter
"""
iter(collection) -> iterator
@@ -368,7 +339,6 @@
"""
pass
-
def len(p_object): # real signature unknown; restored from __doc__
"""
len(object) -> integer
@@ -377,7 +347,6 @@
"""
return 0
-
def license(*args, **kwargs): # real signature unknown
"""
interactive prompt objects for printing the license text, a list of
@@ -385,7 +354,6 @@
"""
pass
-
def locals(): # real signature unknown; restored from __doc__
"""
locals() -> dictionary
@@ -394,7 +362,6 @@
"""
return {}
-
def map(function, sequence, *sequence_1): # real signature unknown; restored from __doc__
"""
map(function, sequence[, sequence, ...]) -> list
@@ -408,7 +375,6 @@
"""
return []
-
def max(*args, **kwargs): # known special case of max
"""
max(iterable[, key=func]) -> value
@@ -419,7 +385,6 @@
"""
pass
-
def min(*args, **kwargs): # known special case of min
"""
min(iterable[, key=func]) -> value
@@ -430,7 +395,6 @@
"""
pass
-
def next(iterator, default=None): # real signature unknown; restored from __doc__
"""
next(iterator[, default])
@@ -440,7 +404,6 @@
"""
pass
-
def oct(number): # real signature unknown; restored from __doc__
"""
oct(number) -> string
@@ -449,7 +412,6 @@
"""
return ""
-
def open(name, mode=None, buffering=None): # real signature unknown; restored from __doc__
"""
open(name[, mode[, buffering]]) -> file object
@@ -459,7 +421,6 @@
"""
return file('/dev/null')
-
def ord(c): # real signature unknown; restored from __doc__
"""
ord(c) -> integer
@@ -468,7 +429,6 @@
"""
return 0
-
def pow(x, y, z=None): # real signature unknown; restored from __doc__
"""
pow(x, y[, z]) -> number
@@ -478,7 +438,6 @@
"""
return 0
-
def print(*args, **kwargs): # known special case of print
"""
print(value, ..., sep=' ', end='\n', file=sys.stdout)
@@ -491,14 +450,13 @@
"""
pass
-
def quit(*args, **kwargs): # real signature unknown
pass
-
def range(start=None, stop=None, step=None): # known special case of range
"""
- range([start,] stop[, step]) -> list of integers
+ range(stop) -> list of integers
+ range(start, stop[, step]) -> list of integers
Return a list containing an arithmetic progression of integers.
range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0.
@@ -508,7 +466,6 @@
"""
pass
-
def raw_input(prompt=None): # real signature unknown; restored from __doc__
"""
raw_input([prompt]) -> string
@@ -520,7 +477,6 @@
"""
return ""
-
def reduce(function, sequence, initial=None): # real signature unknown; restored from __doc__
"""
reduce(function, sequence[, initial]) -> value
@@ -534,7 +490,6 @@
"""
pass
-
def reload(module): # real signature unknown; restored from __doc__
"""
reload(module) -> module
@@ -543,7 +498,6 @@
"""
pass
-
def repr(p_object): # real signature unknown; restored from __doc__
"""
repr(object) -> string
@@ -553,7 +507,6 @@
"""
return ""
-
def round(number, ndigits=None): # real signature unknown; restored from __doc__
"""
round(number[, ndigits]) -> floating point number
@@ -563,7 +516,6 @@
"""
return 0.0
-
def setattr(p_object, name, value): # real signature unknown; restored from __doc__
"""
setattr(object, name, value)
@@ -573,23 +525,20 @@
"""
pass
-
def sorted(iterable, cmp=None, key=None, reverse=False): # real signature unknown; restored from __doc__
""" sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted list """
pass
-
def sum(sequence, start=None): # real signature unknown; restored from __doc__
"""
sum(sequence[, start]) -> value
- Returns the sum of a sequence of numbers (NOT strings) plus the value
+ Return the sum of a sequence of numbers (NOT strings) plus the value
of parameter 'start' (which defaults to 0). When the sequence is
- empty, returns start.
+ empty, return start.
"""
pass
-
def unichr(i): # real signature unknown; restored from __doc__
"""
unichr(i) -> Unicode character
@@ -598,7 +547,6 @@
"""
return u""
-
def vars(p_object=None): # real signature unknown; restored from __doc__
"""
vars([object]) -> dictionary
@@ -608,7 +556,6 @@
"""
return {}
-
def zip(seq1, seq2, *more_seqs): # known special case of zip
"""
zip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ...), (...)]
@@ -619,13 +566,16 @@
"""
pass
-
def __import__(name, globals={}, locals={}, fromlist=[], level=-1): # real signature unknown; restored from __doc__
"""
__import__(name, globals={}, locals={}, fromlist=[], level=-1) -> module
- Import a module. The globals are only used to determine the context;
- they are not modified. The locals are currently unused. The fromlist
+ Import a module. Because this function is meant for use by the Python
+ interpreter and not for general use it is better to use
+ importlib.import_module() to programmatically import a module.
+
+ The globals argument is only used to determine the context;
+ they are not modified. The locals argument is unused. The fromlist
should be a list of names to emulate ``from name import ...'', or an
empty list to emulate ``import name''.
When importing a module from a package, note that __import__('A.B', ...)
@@ -637,9 +587,100 @@
"""
pass
-
# classes
+class ___Classobj:
+ '''A mock class representing the old style class base.'''
+ __module__ = ''
+ __class__ = None
+
+ def __init__(self):
+ pass
+ __dict__ = {}
+ __doc__ = ''
+
+
+class __generator(object):
+ '''A mock class representing the generator function type.'''
+ def __init__(self):
+ self.gi_code = None
+ self.gi_frame = None
+ self.gi_running = 0
+
+ def __iter__(self):
+ '''Defined to support iteration over container.'''
+ pass
+
+ def next(self):
+ '''Return the next item from the container.'''
+ pass
+
+ def close(self):
+ '''Raises new GeneratorExit exception inside the generator to terminate the iteration.'''
+ pass
+
+ def send(self, value):
+ '''Resumes the generator and "sends" a value that becomes the result of the current yield-expression.'''
+ pass
+
+ def throw(self, type, value=None, traceback=None):
+ '''Used to raise an exception inside the generator.'''
+ pass
+
+
+class __function(object):
+ '''A mock class representing function type.'''
+
+ def __init__(self):
+ self.__name__ = ''
+ self.__doc__ = ''
+ self.__dict__ = ''
+ self.__module__ = ''
+
+ self.func_defaults = {}
+ self.func_globals = {}
+ self.func_closure = None
+ self.func_code = None
+ self.func_name = ''
+ self.func_doc = ''
+ self.func_dict = ''
+
+ self.__defaults__ = {}
+ self.__globals__ = {}
+ self.__closure__ = None
+ self.__code__ = None
+ self.__name__ = ''
+
+
+class __namedtuple(tuple):
+ '''A mock base class for named tuples.'''
+
+ __slots__ = ()
+ _fields = ()
+
+ def __new__(cls, *args, **kwargs):
+ 'Create a new instance of the named tuple.'
+ return tuple.__new__(cls, *args)
+
+ @classmethod
+ def _make(cls, iterable, new=tuple.__new__, len=len):
+ 'Make a new named tuple object from a sequence or iterable.'
+ return new(cls, iterable)
+
+ def __repr__(self):
+ return ''
+
+ def _asdict(self):
+ 'Return a new dict which maps field types to their values.'
+ return {}
+
+ def _replace(self, **kwargs):
+ 'Return a new named tuple object replacing specified fields with new values.'
+ return self
+
+ def __getnewargs__(self):
+ return tuple(self)
+
class object:
""" The most base type """
def __delattr__(self, name): # real signature unknown; restored from __doc__
@@ -712,6 +753,8 @@
__module__ = ''
+from object import object
+
class basestring(object):
""" Type basestring cannot be instantiated; it is the base for str and unicode. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -723,17 +766,24 @@
pass
+from object import object
+
class int(object):
"""
- int(x[, base]) -> integer
+ int(x=0) -> int or long
+ int(x, base=10) -> int or long
- Convert a string or number to an integer, if possible. A floating point
- argument will be truncated towards zero (this does not include a string
- representation of a floating point number!) When converting a string, use
- the optional base. It is an error to supply a base when converting a
- non-string. If base is zero, the proper base is guessed based on the
- string content. If the argument is outside the integer range a
- long object will be returned instead.
+ Convert a number or string to an integer, or return 0 if no arguments
+ are given. If x is floating point, the conversion truncates towards zero.
+ If x is outside the integer range, the function returns a long instead.
+
+ If x is not a number or if base is given, then x must be a string or
+ Unicode object representing an integer literal in the given base. The
+ literal can be preceded by '+' or '-' and be surrounded by whitespace.
+ The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to
+ interpret the base from the string as an integer literal.
+ >>> int('0b100', base=0)
+ 4
"""
def bit_length(self): # real signature unknown; restored from __doc__
"""
@@ -811,15 +861,20 @@
def __init__(self, x, base=10): # known special case of int.__init__
"""
- int(x[, base]) -> integer
+ int(x=0) -> int or long
+ int(x, base=10) -> int or long
- Convert a string or number to an integer, if possible. A floating point
- argument will be truncated towards zero (this does not include a string
- representation of a floating point number!) When converting a string, use
- the optional base. It is an error to supply a base when converting a
- non-string. If base is zero, the proper base is guessed based on the
- string content. If the argument is outside the integer range a
- long object will be returned instead.
+ Convert a number or string to an integer, or return 0 if no arguments
+ are given. If x is floating point, the conversion truncates towards zero.
+ If x is outside the integer range, the function returns a long instead.
+
+ If x is not a number or if base is given, then x must be a string or
+ Unicode object representing an integer literal in the given base. The
+ literal can be preceded by '+' or '-' and be surrounded by whitespace.
+ The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to
+ interpret the base from the string as an integer literal.
+ >>> int('0b100', base=0)
+ 4
# (copied from class doc)
"""
pass
@@ -961,11 +1016,21 @@
""" x.__xor__(y) <==> x^y """
pass
- denominator = property(lambda self: object()) # default
- imag = property(lambda self: object()) # default
- numerator = property(lambda self: object()) # default
- real = property(lambda self: object()) # default
+ denominator = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the denominator of a rational number in lowest terms"""
+ imag = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the imaginary part of a complex number"""
+
+ numerator = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the numerator of a rational number in lowest terms"""
+
+ real = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the real part of a complex number"""
+
+
+
+from int import int
class bool(int):
"""
@@ -1016,6 +1081,8 @@
pass
+from object import object
+
class buffer(object):
"""
buffer(object [, offset[, size]])
@@ -1106,6 +1173,8 @@
pass
+from object import object
+
class bytearray(object):
"""
bytearray(iterable_of_ints) -> bytearray.
@@ -1456,9 +1525,9 @@
"""
return []
- def splitlines(self, keepends=None): # real signature unknown; restored from __doc__
+ def splitlines(self, keepends=False): # real signature unknown; restored from __doc__
"""
- B.splitlines([keepends]) -> list of lines
+ B.splitlines(keepends=False) -> list of lines
Return a list of the lines in B, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends
@@ -1658,9 +1727,11 @@
pass
+from basestring import basestring
+
class str(basestring):
"""
- str(object) -> string
+ str(object='') -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
@@ -1962,9 +2033,9 @@
"""
return []
- def splitlines(self, keepends=None): # real signature unknown; restored from __doc__
+ def splitlines(self, keepends=False): # real signature unknown; restored from __doc__
"""
- S.splitlines([keepends]) -> list of strings
+ S.splitlines(keepends=False) -> list of strings
Return a list of the lines in S, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends
@@ -2101,7 +2172,7 @@
def __init__(self, string=''): # known special case of str.__init__
"""
- str(object) -> string
+ str(object='') -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
@@ -2162,6 +2233,8 @@
bytes = str
+from object import object
+
class classmethod(object):
"""
classmethod(function) -> method
@@ -2200,9 +2273,12 @@
""" T.__new__(S, ...) -> a new object with type S, a subtype of T """
pass
- __func__ = property(lambda self: object()) # default
+ __func__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+from object import object
+
class complex(object):
"""
complex(real[, imag]) -> complex number
@@ -2214,7 +2290,7 @@
"""
complex.conjugate() -> complex
- Returns the complex conjugate of its argument. (3-4j).conjugate() == 3+4j.
+ Return the complex conjugate of its argument. (3-4j).conjugate() == 3+4j.
"""
return complex
@@ -2254,7 +2330,7 @@
"""
complex.__format__() -> str
- Converts to a string according to format_spec.
+ Convert to a string according to format_spec.
"""
return ""
@@ -2382,8 +2458,20 @@
pass
imag = property(lambda self: 0.0)
- real = property(lambda self: 0.0)
+ """the imaginary part of a complex number
+ :type: float
+ """
+
+ real = property(lambda self: 0.0)
+ """the real part of a complex number
+
+ :type: float
+ """
+
+
+
+from object import object
class dict(object):
"""
@@ -2461,9 +2549,9 @@
def update(self, E=None, **F): # known special case of dict.update
"""
- D.update(E, **F) -> None. Update D from dict/iterable E and F.
- If E has a .keys() method, does: for k in E: D[k] = E[k]
- If E lacks .keys() method, does: for (k, v) in E: D[k] = v
+ D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
+ If E present and has a .keys() method, does: for k in E: D[k] = E[k]
+ If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
In either case, this is followed by: for k in F: D[k] = F[k]
"""
pass
@@ -2571,6 +2659,8 @@
__hash__ = None
+from object import object
+
class enumerate(object):
"""
enumerate(iterable[, start]) -> iterator for index, value of iterable
@@ -2603,6 +2693,8 @@
pass
+from object import object
+
class file(object):
"""
file(name[, mode[, buffering]]) -> file object
@@ -2779,13 +2871,47 @@
pass
closed = property(lambda self: True)
- encoding = property(lambda self: '')
- errors = property(lambda self: object()) # default
- mode = property(lambda self: '')
- name = property(lambda self: '')
- newlines = property(lambda self: '')
- softspace = property(lambda self: True)
+ """True if the file is closed
+ :type: bool
+ """
+
+ encoding = property(lambda self: '')
+ """file encoding
+
+ :type: string
+ """
+
+ errors = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """Unicode error handler"""
+
+ mode = property(lambda self: '')
+ """file mode ('r', 'U', 'w', 'a', possibly with 'b' or '+' added)
+
+ :type: string
+ """
+
+ name = property(lambda self: '')
+ """file name
+
+ :type: string
+ """
+
+ newlines = property(lambda self: '')
+ """end-of-line convention used in this file
+
+ :type: string
+ """
+
+ softspace = property(lambda self: True)
+ """flag indicating that a space needs to be printed; used by print
+
+ :type: bool
+ """
+
+
+
+from object import object
class float(object):
"""
@@ -2797,9 +2923,9 @@
"""
float.as_integer_ratio() -> (int, int)
- Returns a pair of integers, whose ratio is exactly equal to the original
+ Return a pair of integers, whose ratio is exactly equal to the original
float and with a positive denominator.
- Raises OverflowError on infinities and a ValueError on NaNs.
+ Raise OverflowError on infinities and a ValueError on NaNs.
>>> (10.0).as_integer_ratio()
(10, 1)
@@ -2811,7 +2937,7 @@
pass
def conjugate(self, *args, **kwargs): # real signature unknown
- """ Returns self, the complex conjugate of any float. """
+ """ Return self, the complex conjugate of any float. """
pass
def fromhex(self, string): # real signature unknown; restored from __doc__
@@ -2839,7 +2965,7 @@
return ""
def is_integer(self, *args, **kwargs): # real signature unknown
- """ Returns True if the float is an integer. """
+ """ Return True if the float is an integer. """
pass
def __abs__(self): # real signature unknown; restored from __doc__
@@ -3017,7 +3143,7 @@
'IEEE, big-endian' or 'IEEE, little-endian', and in addition can only be
one of the latter two if it appears to match the underlying C reality.
- Overrides the automatic determination of C-level floating point type.
+ Override the automatic determination of C-level floating point type.
This affects how floats are converted to and from binary strings.
"""
pass
@@ -3035,12 +3161,18 @@
pass
def __trunc__(self, *args, **kwargs): # real signature unknown
- """ Returns the Integral closest to x between 0 and x. """
+ """ Return the Integral closest to x between 0 and x. """
pass
- imag = property(lambda self: object()) # default
- real = property(lambda self: object()) # default
+ imag = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the imaginary part of a complex number"""
+ real = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the real part of a complex number"""
+
+
+
+from object import object
class frozenset(object):
"""
@@ -3199,6 +3331,8 @@
pass
+from object import object
+
class list(object):
"""
list() -> new empty list
@@ -3376,15 +3510,23 @@
__hash__ = None
+from object import object
+
class long(object):
"""
- long(x[, base]) -> integer
+ long(x=0) -> long
+ long(x, base=10) -> long
- Convert a string or number to a long integer, if possible. A floating
- point argument will be truncated towards zero (this does not include a
- string representation of a floating point number!) When converting a
- string, use the optional base. It is an error to supply a base when
- converting a non-string.
+ Convert a number or string to a long integer, or return 0L if no arguments
+ are given. If x is floating point, the conversion truncates towards zero.
+
+ If x is not a number or if base is given, then x must be a string or
+ Unicode object representing an integer literal in the given base. The
+ literal can be preceded by '+' or '-' and be surrounded by whitespace.
+ The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to
+ interpret the base from the string as an integer literal.
+ >>> int('0b100', base=0)
+ 4L
"""
def bit_length(self): # real signature unknown; restored from __doc__
"""
@@ -3460,7 +3602,7 @@
""" x[y:z] <==> x[y.__index__():z.__index__()] """
pass
- def __init__(self, x, base=None): # real signature unknown; restored from __doc__
+ def __init__(self, x=0): # real signature unknown; restored from __doc__
pass
def __int__(self): # real signature unknown; restored from __doc__
@@ -3604,11 +3746,21 @@
""" x.__xor__(y) <==> x^y """
pass
- denominator = property(lambda self: object()) # default
- imag = property(lambda self: object()) # default
- numerator = property(lambda self: object()) # default
- real = property(lambda self: object()) # default
+ denominator = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the denominator of a rational number in lowest terms"""
+ imag = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the imaginary part of a complex number"""
+
+ numerator = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the numerator of a rational number in lowest terms"""
+
+ real = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the real part of a complex number"""
+
+
+
+from object import object
class memoryview(object):
"""
@@ -3678,14 +3830,23 @@
""" x.__setitem__(i, y) <==> x[i]=y """
pass
- format = property(lambda self: object()) # default
- itemsize = property(lambda self: object()) # default
- ndim = property(lambda self: object()) # default
- readonly = property(lambda self: object()) # default
- shape = property(lambda self: object()) # default
- strides = property(lambda self: object()) # default
- suboffsets = property(lambda self: object()) # default
+ format = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ itemsize = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+ ndim = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+ readonly = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+ shape = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+ strides = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+ suboffsets = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+
+
+from object import object
class property(object):
"""
@@ -3694,6 +3855,7 @@
fget is a function to be used for getting an attribute value, and likewise
fset is a function for setting, and fdel a function for del'ing, an
attribute. Typical use is to define a managed attribute x:
+
class C(object):
def getx(self): return self._x
def setx(self, value): self._x = value
@@ -3701,13 +3863,18 @@
x = property(getx, setx, delx, "I'm the 'x' property.")
Decorators make defining new properties or modifying existing ones easy:
+
class C(object):
@property
- def x(self): return self._x
+ def x(self):
+ "I am the 'x' property."
+ return self._x
@x.setter
- def x(self, value): self._x = value
+ def x(self, value):
+ self._x = value
@x.deleter
- def x(self): del self._x
+ def x(self):
+ del self._x
"""
def deleter(self, *args, **kwargs): # real signature unknown
""" Descriptor to change the deleter on a property. """
@@ -3740,6 +3907,7 @@
fget is a function to be used for getting an attribute value, and likewise
fset is a function for setting, and fdel a function for del'ing, an
attribute. Typical use is to define a managed attribute x:
+
class C(object):
def getx(self): return self._x
def setx(self, value): self._x = value
@@ -3747,13 +3915,18 @@
x = property(getx, setx, delx, "I'm the 'x' property.")
Decorators make defining new properties or modifying existing ones easy:
+
class C(object):
@property
- def x(self): return self._x
+ def x(self):
+ "I am the 'x' property."
+ return self._x
@x.setter
- def x(self, value): self._x = value
+ def x(self, value):
+ self._x = value
@x.deleter
- def x(self): del self._x
+ def x(self):
+ del self._x
# (copied from class doc)
"""
@@ -3768,10 +3941,15 @@
""" descr.__set__(obj, value) """
pass
- fdel = property(lambda self: object()) # default
- fget = property(lambda self: object()) # default
- fset = property(lambda self: object()) # default
+ fdel = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ fget = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+ fset = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+
+
+from object import object
class reversed(object):
"""
@@ -3804,6 +3982,8 @@
pass
+from object import object
+
class set(object):
"""
set() -> new empty set object
@@ -3939,7 +4119,7 @@
pass
def __iand__(self, y): # real signature unknown; restored from __doc__
- """ x.__iand__(y) <==> x&y """
+ """ x.__iand__(y) <==> x&=y """
pass
def __init__(self, seq=()): # known special case of set.__init__
@@ -3953,11 +4133,11 @@
pass
def __ior__(self, y): # real signature unknown; restored from __doc__
- """ x.__ior__(y) <==> x|y """
+ """ x.__ior__(y) <==> x|=y """
pass
def __isub__(self, y): # real signature unknown; restored from __doc__
- """ x.__isub__(y) <==> x-y """
+ """ x.__isub__(y) <==> x-=y """
pass
def __iter__(self): # real signature unknown; restored from __doc__
@@ -3965,7 +4145,7 @@
pass
def __ixor__(self, y): # real signature unknown; restored from __doc__
- """ x.__ixor__(y) <==> x^y """
+ """ x.__ixor__(y) <==> x^=y """
pass
def __len__(self): # real signature unknown; restored from __doc__
@@ -4032,9 +4212,12 @@
__hash__ = None
+from object import object
+
class slice(object):
"""
- slice([start,] stop[, step])
+ slice(stop)
+ slice(start, stop[, step])
Create a slice object. This is used for extended slicing (e.g. a[0:10:2]).
"""
@@ -4061,7 +4244,7 @@
""" x.__hash__() <==> hash(x) """
pass
- def __init__(self, start=None, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__
+ def __init__(self, stop): # real signature unknown; restored from __doc__
pass
@staticmethod # known case of __new__
@@ -4078,9 +4261,17 @@
pass
start = property(lambda self: 0)
- step = property(lambda self: 0)
- stop = property(lambda self: 0)
+ """:type: int"""
+ step = property(lambda self: 0)
+ """:type: int"""
+
+ stop = property(lambda self: 0)
+ """:type: int"""
+
+
+
+from object import object
class staticmethod(object):
"""
@@ -4117,13 +4308,16 @@
""" T.__new__(S, ...) -> a new object with type S, a subtype of T """
pass
- __func__ = property(lambda self: object()) # default
+ __func__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+from object import object
+
class super(object):
"""
- super(type) -> unbound super object
super(type, obj) -> bound super object; requires isinstance(obj, type)
+ super(type) -> unbound super object
super(type, type2) -> bound super object; requires issubclass(type2, type)
Typical use to call a cooperative superclass method:
class C(B):
@@ -4140,8 +4334,8 @@
def __init__(self, type1, type2=None): # known special case of super.__init__
"""
- super(type) -> unbound super object
super(type, obj) -> bound super object; requires isinstance(obj, type)
+ super(type) -> unbound super object
super(type, type2) -> bound super object; requires issubclass(type2, type)
Typical use to call a cooperative superclass method:
class C(B):
@@ -4161,9 +4355,26 @@
pass
__self_class__ = property(lambda self: type(object))
- __self__ = property(lambda self: type(object))
- __thisclass__ = property(lambda self: type(object))
+ """the type of the instance invoking super(); may be None
+ :type: type
+ """
+
+ __self__ = property(lambda self: type(object))
+ """the instance invoking super(); may be None
+
+ :type: type
+ """
+
+ __thisclass__ = property(lambda self: type(object))
+ """the class invoking super()
+
+ :type: type
+ """
+
+
+
+from object import object
class tuple(object):
"""
@@ -4278,6 +4489,8 @@
pass
+from object import object
+
class type(object):
"""
type(object) -> the object's type
@@ -4369,7 +4582,8 @@
""" __subclasses__() -> list of immediate subclasses """
return []
- __abstractmethods__ = property(lambda self: object()) # default
+ __abstractmethods__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
__bases__ = (
object,
@@ -4388,9 +4602,12 @@
__weakrefoffset__ = 368
+from basestring import basestring
+
class unicode(basestring):
"""
- unicode(string [, encoding[, errors]]) -> object
+ unicode(object='') -> unicode object
+ unicode(string[, encoding[, errors]]) -> unicode object
Create a new Unicode object from the given encoded string.
encoding defaults to the current default string encoding.
@@ -4432,7 +4649,7 @@
to the default encoding. errors may be given to set a different error
handling scheme. Default is 'strict' meaning that encoding errors raise
a UnicodeDecodeError. Other possible values are 'ignore' and 'replace'
- as well as any other name registerd with codecs.register_error that is
+ as well as any other name registered with codecs.register_error that is
able to handle UnicodeDecodeErrors.
"""
return ""
@@ -4711,9 +4928,9 @@
"""
return []
- def splitlines(self, keepends=None): # real signature unknown; restored from __doc__
+ def splitlines(self, keepends=False): # real signature unknown; restored from __doc__
"""
- S.splitlines([keepends]) -> list of strings
+ S.splitlines(keepends=False) -> list of strings
Return a list of the lines in S, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends
@@ -4849,7 +5066,8 @@
def __init__(self, string=u'', encoding=None, errors='strict'): # known special case of unicode.__init__
"""
- unicode(string [, encoding[, errors]]) -> object
+ unicode(object='') -> unicode object
+ unicode(string[, encoding[, errors]]) -> unicode object
Create a new Unicode object from the given encoded string.
encoding defaults to the current default string encoding.
@@ -4908,9 +5126,12 @@
pass
+from object import object
+
class xrange(object):
"""
- xrange([start,] stop[, step]) -> xrange object
+ xrange(stop) -> xrange object
+ xrange(start, stop[, step]) -> xrange object
Like range(), but instead of returning a list, returns an object that
generates the numbers in the range on demand. For looping, this is
@@ -4924,7 +5145,7 @@
""" x.__getitem__(y) <==> x[y] """
pass
- def __init__(self, start=None, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__
+ def __init__(self, stop): # real signature unknown; restored from __doc__
pass
def __iter__(self): # real signature unknown; restored from __doc__
@@ -4952,74 +5173,6 @@
pass
-class ___Classobj:
- '''A mock class representing the old style class base.'''
- __module__ = ''
- __class__ = None
-
- def __init__(self):
- pass
- __dict__ = {}
- __doc__ = ''
-
-
-class __generator(object):
- '''A mock class representing the generator function type.'''
- def __init__(self):
- self.gi_code = None
- self.gi_frame = None
- self.gi_running = 0
-
- def __iter__(self):
- '''Defined to support iteration over container.'''
- pass
-
- def next(self):
- '''Return the next item from the container.'''
- pass
-
- def close(self):
- '''Raises new GeneratorExit exception inside the generator to terminate the iteration.'''
- pass
-
- def send(self, value):
- '''Resumes the generator and "sends" a value that becomes the result of the current yield-expression.'''
- pass
-
- def throw(self, type, value=None, traceback=None):
- '''Used to raise an exception inside the generator.'''
- pass
-
-
-class __namedtuple(tuple):
- '''A mock base class for named tuples.'''
-
- __slots__ = ()
- _fields = ()
-
- def __new__(cls, *args, **kwargs):
- 'Create a new instance of the named tuple.'
- return tuple.__new__(cls, *args)
-
- @classmethod
- def _make(cls, iterable, new=tuple.__new__, len=len):
- 'Make a new named tuple object from a sequence or iterable.'
- return new(cls, iterable)
-
- def __repr__(self):
- return ''
-
- def _asdict(self):
- 'Return a new dict which maps field types to their values.'
- return {}
-
- def _replace(self, **kwargs):
- 'Return a new named tuple object replacing specified fields with new values.'
- return self
-
- def __getnewargs__(self):
- return tuple(self)
-
# variables with complex values
Ellipsis = None # (!) real value is ''
diff --git a/python/testData/MockSdk3.2/python_stubs/builtins.py b/python/testData/MockSdk3.2/python_stubs/builtins.py
index b3fa88d..88b74ab 100644
--- a/python/testData/MockSdk3.2/python_stubs/builtins.py
+++ b/python/testData/MockSdk3.2/python_stubs/builtins.py
@@ -1,7 +1,7 @@
# encoding: utf-8
# module builtins
# from (built-in)
-# by generator 1.118
+# by generator 1.135
"""
Built-in functions, exceptions, and other objects.
@@ -25,25 +25,24 @@
"""
return 0
-
def all(iterable): # real signature unknown; restored from __doc__
"""
all(iterable) -> bool
Return True if bool(x) is True for all values x in the iterable.
+ If the iterable is empty, return True.
"""
return False
-
def any(iterable): # real signature unknown; restored from __doc__
"""
any(iterable) -> bool
Return True if bool(x) is True for any x in the iterable.
+ If the iterable is empty, return False.
"""
return False
-
def ascii(p_object): # real signature unknown; restored from __doc__
"""
ascii(object) -> string
@@ -55,7 +54,6 @@
"""
return ""
-
def bin(number): # real signature unknown; restored from __doc__
"""
bin(number) -> string
@@ -64,7 +62,6 @@
"""
return ""
-
def callable(p_object): # real signature unknown; restored from __doc__
"""
callable(object) -> bool
@@ -75,16 +72,15 @@
"""
return False
-
def chr(i): # real signature unknown; restored from __doc__
"""
chr(i) -> Unicode character
Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff.
+ If 0x10000 <= i, a surrogate pair is returned.
"""
return ""
-
def compile(source, filename, mode, flags=None, dont_inherit=None): # real signature unknown; restored from __doc__
"""
compile(source, filename, mode[, flags[, dont_inherit]]) -> code object
@@ -103,7 +99,6 @@
"""
pass
-
def copyright(*args, **kwargs): # real signature unknown
"""
interactive prompt objects for printing the license text, a list of
@@ -111,7 +106,6 @@
"""
pass
-
def credits(*args, **kwargs): # real signature unknown
"""
interactive prompt objects for printing the license text, a list of
@@ -119,7 +113,6 @@
"""
pass
-
def delattr(p_object, name): # real signature unknown; restored from __doc__
"""
delattr(object, name)
@@ -129,7 +122,6 @@
"""
pass
-
def dir(p_object=None): # real signature unknown; restored from __doc__
"""
dir([object]) -> list of strings
@@ -147,7 +139,6 @@
"""
return []
-
def divmod(x, y): # known case of builtins.divmod
"""
divmod(x, y) -> (div, mod)
@@ -156,7 +147,6 @@
"""
return (0, 0)
-
def eval(source, globals=None, locals=None): # real signature unknown; restored from __doc__
"""
eval(source[, globals[, locals]]) -> value
@@ -170,7 +160,6 @@
"""
pass
-
def exec(p_object, globals=None, locals=None): # real signature unknown; restored from __doc__
"""
exec(object[, globals[, locals]])
@@ -182,11 +171,9 @@
"""
pass
-
def exit(*args, **kwargs): # real signature unknown
pass
-
def format(value, format_spec=None): # real signature unknown; restored from __doc__
"""
format(value[, format_spec]) -> string
@@ -196,7 +183,6 @@
"""
return ""
-
def getattr(object, name, default=None): # known special case of getattr
"""
getattr(object, name[, default]) -> value
@@ -207,7 +193,6 @@
"""
pass
-
def globals(): # real signature unknown; restored from __doc__
"""
globals() -> dictionary
@@ -216,7 +201,6 @@
"""
return {}
-
def hasattr(p_object, name): # real signature unknown; restored from __doc__
"""
hasattr(object, name) -> bool
@@ -226,7 +210,6 @@
"""
return False
-
def hash(p_object): # real signature unknown; restored from __doc__
"""
hash(object) -> integer
@@ -236,7 +219,6 @@
"""
return 0
-
def help(with_a_twist): # real signature unknown; restored from __doc__
"""
Define the builtin 'help'.
@@ -244,7 +226,6 @@
"""
pass
-
def hex(number): # real signature unknown; restored from __doc__
"""
hex(number) -> string
@@ -253,7 +234,6 @@
"""
return ""
-
def id(p_object): # real signature unknown; restored from __doc__
"""
id(object) -> integer
@@ -263,7 +243,6 @@
"""
return 0
-
def input(prompt=None): # real signature unknown; restored from __doc__
"""
input([prompt]) -> string
@@ -275,7 +254,6 @@
"""
return ""
-
def isinstance(p_object, class_or_type_or_tuple): # real signature unknown; restored from __doc__
"""
isinstance(object, class-or-type-or-tuple) -> bool
@@ -287,7 +265,6 @@
"""
return False
-
def issubclass(C, B): # real signature unknown; restored from __doc__
"""
issubclass(C, B) -> bool
@@ -298,7 +275,6 @@
"""
return False
-
def iter(source, sentinel=None): # known special case of iter
"""
iter(iterable) -> iterator
@@ -310,7 +286,6 @@
"""
pass
-
def len(p_object): # real signature unknown; restored from __doc__
"""
len(object) -> integer
@@ -319,7 +294,6 @@
"""
return 0
-
def license(*args, **kwargs): # real signature unknown
"""
interactive prompt objects for printing the license text, a list of
@@ -327,7 +301,6 @@
"""
pass
-
def locals(): # real signature unknown; restored from __doc__
"""
locals() -> dictionary
@@ -336,7 +309,6 @@
"""
return {}
-
def max(*args, key=None): # known special case of max
"""
max(iterable[, key=func]) -> value
@@ -347,7 +319,6 @@
"""
pass
-
def min(*args, key=None): # known special case of min
"""
min(iterable[, key=func]) -> value
@@ -358,7 +329,6 @@
"""
pass
-
def next(iterator, default=None): # real signature unknown; restored from __doc__
"""
next(iterator[, default])
@@ -368,7 +338,6 @@
"""
pass
-
def oct(number): # real signature unknown; restored from __doc__
"""
oct(number) -> string
@@ -377,7 +346,6 @@
"""
return ""
-
def open(file, mode='r', buffering=None, encoding=None, errors=None, newline=None, closefd=True): # known special case of open
"""
open(file, mode='r', buffering=-1, encoding=None,
@@ -468,9 +436,9 @@
* On output, if newline is None, any '\n' characters written are
translated to the system default line separator, os.linesep. If
- newline is '', no translation takes place. If newline is any of the
- other legal values, any '\n' characters written are translated to
- the given string.
+ newline is '' or '\n', no translation takes place. If newline is any
+ of the other legal values, any '\n' characters written are translated
+ to the given string.
If closefd is False, the underlying file descriptor will be kept open
when the file is closed. This does not work when a file name is given
@@ -492,16 +460,15 @@
"""
pass
-
def ord(c): # real signature unknown; restored from __doc__
"""
ord(c) -> integer
Return the integer ordinal of a one-character string.
+ A valid surrogate pair is also accepted.
"""
return 0
-
def pow(x, y, z=None): # real signature unknown; restored from __doc__
"""
pow(x, y[, z]) -> number
@@ -511,7 +478,6 @@
"""
return 0
-
def print(*args, sep=' ', end='\n', file=None): # known special case of print
"""
print(value, ..., sep=' ', end='\n', file=sys.stdout)
@@ -524,11 +490,9 @@
"""
pass
-
def quit(*args, **kwargs): # real signature unknown
pass
-
def repr(p_object): # real signature unknown; restored from __doc__
"""
repr(object) -> string
@@ -538,7 +502,6 @@
"""
return ""
-
def round(number, ndigits=None): # real signature unknown; restored from __doc__
"""
round(number[, ndigits]) -> number
@@ -549,7 +512,6 @@
"""
return 0
-
def setattr(p_object, name, value): # real signature unknown; restored from __doc__
"""
setattr(object, name, value)
@@ -559,12 +521,10 @@
"""
pass
-
def sorted(iterable, key=None, reverse=False): # real signature unknown; restored from __doc__
""" sorted(iterable, key=None, reverse=False) --> new sorted list """
pass
-
def sum(iterable, start=None): # real signature unknown; restored from __doc__
"""
sum(iterable[, start]) -> value
@@ -575,7 +535,6 @@
"""
pass
-
def vars(p_object=None): # real signature unknown; restored from __doc__
"""
vars([object]) -> dictionary
@@ -585,7 +544,6 @@
"""
return {}
-
def __build_class__(func, name, *bases, metaclass=None, **kwds): # real signature unknown; restored from __doc__
"""
__build_class__(func, name, *bases, metaclass=None, **kwds) -> class
@@ -594,7 +552,6 @@
"""
pass
-
def __import__(name, globals={}, locals={}, fromlist=[], level=-1): # real signature unknown; restored from __doc__
"""
__import__(name, globals={}, locals={}, fromlist=[], level=-1) -> module
@@ -616,9 +573,84 @@
"""
pass
-
# classes
+
+class __generator(object):
+ '''A mock class representing the generator function type.'''
+ def __init__(self):
+ self.gi_code = None
+ self.gi_frame = None
+ self.gi_running = 0
+
+ def __iter__(self):
+ '''Defined to support iteration over container.'''
+ pass
+
+ def __next__(self):
+ '''Return the next item from the container.'''
+ pass
+
+ def close(self):
+ '''Raises new GeneratorExit exception inside the generator to terminate the iteration.'''
+ pass
+
+ def send(self, value):
+ '''Resumes the generator and "sends" a value that becomes the result of the current yield-expression.'''
+ pass
+
+ def throw(self, type, value=None, traceback=None):
+ '''Used to raise an exception inside the generator.'''
+ pass
+
+
+class __function(object):
+ '''A mock class representing function type.'''
+
+ def __init__(self):
+ self.__name__ = ''
+ self.__doc__ = ''
+ self.__dict__ = ''
+ self.__module__ = ''
+
+ self.__annotations__ = {}
+ self.__defaults__ = {}
+ self.__globals__ = {}
+ self.__kwdefaults__ = {}
+ self.__closure__ = None
+ self.__code__ = None
+ self.__name__ = ''
+
+
+class __namedtuple(tuple):
+ '''A mock base class for named tuples.'''
+
+ __slots__ = ()
+ _fields = ()
+
+ def __new__(cls, *args, **kwargs):
+ 'Create a new instance of the named tuple.'
+ return tuple.__new__(cls, *args)
+
+ @classmethod
+ def _make(cls, iterable, new=tuple.__new__, len=len):
+ 'Make a new named tuple object from a sequence or iterable.'
+ return new(cls, iterable)
+
+ def __repr__(self):
+ return ''
+
+ def _asdict(self):
+ 'Return a new dict which maps field types to their values.'
+ return {}
+
+ def _replace(self, **kwargs):
+ 'Return a new named tuple object replacing specified fields with new values.'
+ return self
+
+ def __getnewargs__(self):
+ return tuple(self)
+
class object:
""" The most base type """
def __delattr__(self, name): # real signature unknown; restored from __doc__
@@ -715,6 +747,8 @@
__module__ = ''
+from .object import object
+
class BaseException(object):
""" Common base class for all exceptions """
def with_traceback(self, tb): # real signature unknown; restored from __doc__
@@ -758,14 +792,22 @@
""" x.__str__() <==> str(x) """
pass
- args = property(lambda self: object()) # default
- __cause__ = property(lambda self: object()) # default
- __context__ = property(lambda self: object()) # default
- __traceback__ = property(lambda self: object()) # default
+ args = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+ __cause__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception cause"""
+
+ __context__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception context"""
+
+ __traceback__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
__dict__ = None # (!) real value is ''
+from .BaseException import BaseException
+
class Exception(BaseException):
""" Common base class for all non-exit exceptions. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -777,6 +819,8 @@
pass
+from .Exception import Exception
+
class ArithmeticError(Exception):
""" Base class for arithmetic errors. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -788,6 +832,8 @@
pass
+from .Exception import Exception
+
class AssertionError(Exception):
""" Assertion failed. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -799,6 +845,8 @@
pass
+from .Exception import Exception
+
class AttributeError(Exception):
""" Attribute not found. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -810,15 +858,24 @@
pass
+from .object import object
+
class int(object):
"""
- int(x[, base]) -> integer
+ int(x=0) -> integer
+ int(x, base=10) -> integer
- Convert a string or number to an integer, if possible. A floating
- point argument will be truncated towards zero (this does not include a
- string representation of a floating point number!) When converting a
- string, use the optional base. It is an error to supply a base when
- converting a non-string.
+ Convert a number or string to an integer, or return 0 if no arguments
+ are given. If x is a number, return x.__int__(). For floating point
+ numbers, this truncates towards zero.
+
+ If x is not a number or if base is given, then x must be a string,
+ bytes, or bytearray instance representing an integer literal in the
+ given base. The literal can be preceded by '+' or '-' and be surrounded
+ by whitespace. The base defaults to 10. Valid bases are 0 and 2-36.
+ Base 0 means to interpret the base from the string as an integer literal.
+ >>> int('0b100', base=0)
+ 4
"""
def bit_length(self): # real signature unknown; restored from __doc__
"""
@@ -836,7 +893,8 @@
""" Returns self, the complex conjugate of any int. """
pass
- def from_bytes(self, bytes, byteorder, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__
+ @classmethod # known case
+ def from_bytes(cls, bytes, byteorder, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__
"""
int.from_bytes(bytes, byteorder, *, signed=False) -> int
@@ -947,13 +1005,20 @@
def __init__(self, x, base=10): # known special case of int.__init__
"""
- int(x[, base]) -> integer
+ int(x=0) -> integer
+ int(x, base=10) -> integer
- Convert a string or number to an integer, if possible. A floating
- point argument will be truncated towards zero (this does not include a
- string representation of a floating point number!) When converting a
- string, use the optional base. It is an error to supply a base when
- converting a non-string.
+ Convert a number or string to an integer, or return 0 if no arguments
+ are given. If x is a number, return x.__int__(). For floating point
+ numbers, this truncates towards zero.
+
+ If x is not a number or if base is given, then x must be a string,
+ bytes, or bytearray instance representing an integer literal in the
+ given base. The literal can be preceded by '+' or '-' and be surrounded
+ by whitespace. The base defaults to 10. Valid bases are 0 and 2-36.
+ Base 0 means to interpret the base from the string as an integer literal.
+ >>> int('0b100', base=0)
+ 4
# (copied from class doc)
"""
pass
@@ -1102,11 +1167,21 @@
""" x.__xor__(y) <==> x^y """
pass
- denominator = property(lambda self: object()) # default
- imag = property(lambda self: object()) # default
- numerator = property(lambda self: object()) # default
- real = property(lambda self: object()) # default
+ denominator = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the denominator of a rational number in lowest terms"""
+ imag = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the imaginary part of a complex number"""
+
+ numerator = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the numerator of a rational number in lowest terms"""
+
+ real = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the real part of a complex number"""
+
+
+
+from .int import int
class bool(int):
"""
@@ -1157,6 +1232,8 @@
pass
+from .Exception import Exception
+
class BufferError(Exception):
""" Buffer error. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -1168,22 +1245,22 @@
pass
+from .object import object
+
class bytearray(object):
"""
bytearray(iterable_of_ints) -> bytearray
bytearray(string, encoding[, errors]) -> bytearray
- bytearray(bytes_or_bytearray) -> mutable copy of bytes_or_bytearray
- bytearray(memory_view) -> bytearray
+ bytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer
+ bytearray(int) -> bytes array of size given by the parameter initialized with null bytes
+ bytearray() -> empty bytes array
Construct an mutable bytearray object from:
- an iterable yielding integers in range(256)
- a text string encoded using the specified encoding
- - a bytes or a bytearray object
+ - a bytes or a buffer object
- any object implementing the buffer API.
-
- bytearray(int) -> bytearray
-
- Construct a zero-initialized bytearray of the given length.
+ - an integer
"""
def append(self, p_int): # real signature unknown; restored from __doc__
"""
@@ -1662,18 +1739,16 @@
"""
bytearray(iterable_of_ints) -> bytearray
bytearray(string, encoding[, errors]) -> bytearray
- bytearray(bytes_or_bytearray) -> mutable copy of bytes_or_bytearray
- bytearray(memory_view) -> bytearray
+ bytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer
+ bytearray(int) -> bytes array of size given by the parameter initialized with null bytes
+ bytearray() -> empty bytes array
Construct an mutable bytearray object from:
- an iterable yielding integers in range(256)
- a text string encoded using the specified encoding
- - a bytes or a bytearray object
+ - a bytes or a buffer object
- any object implementing the buffer API.
-
- bytearray(int) -> bytearray
-
- Construct a zero-initialized bytearray of the given length.
+ - an integer
# (copied from class doc)
"""
pass
@@ -1738,18 +1813,21 @@
__hash__ = None
+from .object import object
+
class bytes(object):
"""
bytes(iterable_of_ints) -> bytes
bytes(string, encoding[, errors]) -> bytes
bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer
- bytes(memory_view) -> bytes
+ bytes(int) -> bytes object of size given by the parameter initialized with null bytes
+ bytes() -> empty bytes object
Construct an immutable array of bytes from:
- an iterable yielding integers in range(256)
- a text string encoded using the specified encoding
- - a bytes or a buffer object
- any object implementing the buffer API.
+ - an integer
"""
def capitalize(self): # real signature unknown; restored from __doc__
"""
@@ -2073,7 +2151,7 @@
B.strip([bytes]) -> bytes
Strip leading and trailing bytes contained in the argument.
- If the argument is omitted, strip trailing ASCII whitespace.
+ If the argument is omitted, strip leading and trailing ASCII whitespace.
"""
return b""
@@ -2163,13 +2241,14 @@
bytes(iterable_of_ints) -> bytes
bytes(string, encoding[, errors]) -> bytes
bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer
- bytes(memory_view) -> bytes
+ bytes(int) -> bytes object of size given by the parameter initialized with null bytes
+ bytes() -> empty bytes object
Construct an immutable array of bytes from:
- an iterable yielding integers in range(256)
- a text string encoded using the specified encoding
- - a bytes or a buffer object
- any object implementing the buffer API.
+ - an integer
# (copied from class doc)
"""
pass
@@ -2220,6 +2299,8 @@
pass
+from .Exception import Exception
+
class Warning(Exception):
""" Base class for warning categories. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -2231,6 +2312,8 @@
pass
+from .Warning import Warning
+
class BytesWarning(Warning):
"""
Base class for warnings about bytes and buffer related problems, mostly
@@ -2245,6 +2328,8 @@
pass
+from .object import object
+
class classmethod(object):
"""
classmethod(function) -> method
@@ -2283,9 +2368,12 @@
""" T.__new__(S, ...) -> a new object with type S, a subtype of T """
pass
- __func__ = property(lambda self: object()) # default
+ __func__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+from .object import object
+
class complex(object):
"""
complex(real[, imag]) -> complex number
@@ -2449,8 +2537,20 @@
pass
imag = property(lambda self: 0.0)
- real = property(lambda self: 0.0)
+ """the imaginary part of a complex number
+ :type: float
+ """
+
+ real = property(lambda self: 0.0)
+ """the real part of a complex number
+
+ :type: float
+ """
+
+
+
+from .Warning import Warning
class DeprecationWarning(Warning):
""" Base class for warnings about deprecated features. """
@@ -2463,6 +2563,8 @@
pass
+from .object import object
+
class dict(object):
"""
dict() -> new empty dictionary
@@ -2523,9 +2625,9 @@
def update(self, E=None, **F): # known special case of dict.update
"""
- D.update(E, **F) -> None. Update D from dict/iterable E and F.
- If E has a .keys() method, does: for k in E: D[k] = E[k]
- If E lacks .keys() method, does: for (k, v) in E: D[k] = v
+ D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
+ If E present and has a .keys() method, does: for k in E: D[k] = E[k]
+ If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
In either case, this is followed by: for k in F: D[k] = F[k]
"""
pass
@@ -2617,6 +2719,8 @@
__hash__ = None
+from .object import object
+
class enumerate(object):
"""
enumerate(iterable[, start]) -> iterator for index, value of iterable
@@ -2649,6 +2753,8 @@
pass
+from .Exception import Exception
+
class EnvironmentError(Exception):
""" Base class for I/O related errors. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -2666,10 +2772,18 @@
""" x.__str__() <==> str(x) """
pass
- errno = property(lambda self: object()) # default
- filename = property(lambda self: object()) # default
- strerror = property(lambda self: object()) # default
+ errno = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception errno"""
+ filename = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception filename"""
+
+ strerror = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception strerror"""
+
+
+
+from .Exception import Exception
class EOFError(Exception):
""" Read beyond end of file. """
@@ -2682,6 +2796,8 @@
pass
+from .object import object
+
class filter(object):
"""
filter(function or None, iterable) --> filter object
@@ -2710,6 +2826,8 @@
pass
+from .object import object
+
class float(object):
"""
float(x) -> floating point number
@@ -2952,9 +3070,15 @@
""" Returns the Integral closest to x between 0 and x. """
pass
- imag = property(lambda self: object()) # default
- real = property(lambda self: object()) # default
+ imag = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the imaginary part of a complex number"""
+ real = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """the real part of a complex number"""
+
+
+
+from .ArithmeticError import ArithmeticError
class FloatingPointError(ArithmeticError):
""" Floating point operation failed. """
@@ -2967,6 +3091,8 @@
pass
+from .object import object
+
class frozenset(object):
"""
frozenset() -> empty frozenset object
@@ -3120,6 +3246,8 @@
pass
+from .Warning import Warning
+
class FutureWarning(Warning):
"""
Base class for warnings about constructs that will change semantically
@@ -3134,6 +3262,8 @@
pass
+from .BaseException import BaseException
+
class GeneratorExit(BaseException):
""" Request that a generator exit. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3145,6 +3275,8 @@
pass
+from .Exception import Exception
+
class ImportError(Exception):
""" Import can't find module, or can't find name in module. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3156,6 +3288,8 @@
pass
+from .Warning import Warning
+
class ImportWarning(Warning):
""" Base class for warnings about probable mistakes in module imports """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3167,6 +3301,8 @@
pass
+from .Exception import Exception
+
class SyntaxError(Exception):
""" Invalid syntax. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3181,13 +3317,27 @@
""" x.__str__() <==> str(x) """
pass
- filename = property(lambda self: object()) # default
- lineno = property(lambda self: object()) # default
- msg = property(lambda self: object()) # default
- offset = property(lambda self: object()) # default
- print_file_and_line = property(lambda self: object()) # default
- text = property(lambda self: object()) # default
+ filename = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception filename"""
+ lineno = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception lineno"""
+
+ msg = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception msg"""
+
+ offset = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception offset"""
+
+ print_file_and_line = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception print_file_and_line"""
+
+ text = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception text"""
+
+
+
+from .SyntaxError import SyntaxError
class IndentationError(SyntaxError):
""" Improper indentation. """
@@ -3200,6 +3350,8 @@
pass
+from .Exception import Exception
+
class LookupError(Exception):
""" Base class for lookup errors. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3211,6 +3363,8 @@
pass
+from .LookupError import LookupError
+
class IndexError(LookupError):
""" Sequence index out of range. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3222,6 +3376,8 @@
pass
+from .EnvironmentError import EnvironmentError
+
class IOError(EnvironmentError):
""" I/O operation failed. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3233,6 +3389,8 @@
pass
+from .BaseException import BaseException
+
class KeyboardInterrupt(BaseException):
""" Program interrupted by user. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3244,6 +3402,8 @@
pass
+from .LookupError import LookupError
+
class KeyError(LookupError):
""" Mapping key not found. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3259,6 +3419,8 @@
pass
+from .object import object
+
class list(object):
"""
list() -> new empty list
@@ -3409,6 +3571,8 @@
__hash__ = None
+from .object import object
+
class map(object):
"""
map(func, *iterables) --> map object
@@ -3437,6 +3601,8 @@
pass
+from .Exception import Exception
+
class MemoryError(Exception):
""" Out of memory. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3448,20 +3614,37 @@
pass
+from .object import object
+
class memoryview(object):
"""
memoryview(object)
Create a new memoryview object which references the given object.
"""
- def release(self, *args, **kwargs): # real signature unknown
+ def release(self): # real signature unknown; restored from __doc__
+ """
+ M.release() -> None
+
+ Release the underlying buffer exposed by the memoryview object.
+ """
pass
- def tobytes(self, *args, **kwargs): # real signature unknown
- pass
+ def tobytes(self): # real signature unknown; restored from __doc__
+ """
+ M.tobytes() -> bytes
+
+ Return the data in the buffer as a byte string.
+ """
+ return b""
- def tolist(self, *args, **kwargs): # real signature unknown
- pass
+ def tolist(self): # real signature unknown; restored from __doc__
+ """
+ M.tolist() -> list
+
+ Return the data in the buffer as a list of elements.
+ """
+ return []
def __delitem__(self, y): # real signature unknown; restored from __doc__
""" x.__delitem__(y) <==> del x[y] """
@@ -3525,17 +3708,37 @@
""" x.__setitem__(i, y) <==> x[i]=y """
pass
- format = property(lambda self: object()) # default
- itemsize = property(lambda self: object()) # default
- ndim = property(lambda self: object()) # default
- readonly = property(lambda self: object()) # default
- shape = property(lambda self: object()) # default
- strides = property(lambda self: object()) # default
- suboffsets = property(lambda self: object()) # default
+ format = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """A string containing the format (in struct module style)
+ for each element in the view."""
+
+ itemsize = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """The size in bytes of each element of the memoryview."""
+
+ ndim = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """An integer indicating how many dimensions of a multi-dimensional
+ array the memory represents."""
+
+ readonly = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """A bool indicating whether the memory is read only."""
+
+ shape = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """A tuple of ndim integers giving the shape of the memory
+ as an N-dimensional array."""
+
+ strides = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """A tuple of ndim integers giving the size in bytes to access
+ each element for each dimension of the array."""
+
+ suboffsets = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """A tuple of integers used internally for PIL-style arrays."""
+
__hash__ = None
+from .Exception import Exception
+
class NameError(Exception):
""" Name not found globally. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3547,6 +3750,8 @@
pass
+from .Exception import Exception
+
class RuntimeError(Exception):
""" Unspecified run-time error. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3558,6 +3763,8 @@
pass
+from .RuntimeError import RuntimeError
+
class NotImplementedError(RuntimeError):
""" Method or function hasn't been implemented yet. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3569,6 +3776,8 @@
pass
+from .EnvironmentError import EnvironmentError
+
class OSError(EnvironmentError):
""" OS system call failed. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3580,6 +3789,8 @@
pass
+from .ArithmeticError import ArithmeticError
+
class OverflowError(ArithmeticError):
""" Result too large to be represented. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3591,6 +3802,8 @@
pass
+from .Warning import Warning
+
class PendingDeprecationWarning(Warning):
"""
Base class for warnings about features which will be deprecated
@@ -3605,6 +3818,8 @@
pass
+from .object import object
+
class property(object):
"""
property(fget=None, fset=None, fdel=None, doc=None) -> property attribute
@@ -3686,14 +3901,20 @@
""" descr.__set__(obj, value) """
pass
- fdel = property(lambda self: object()) # default
- fget = property(lambda self: object()) # default
- fset = property(lambda self: object()) # default
+ fdel = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ fget = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+ fset = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+
+
+from .object import object
class range(object):
"""
- range([start,] stop[, step]) -> range object
+ range(stop) -> range object
+ range(start, stop[, step]) -> range object
Returns a virtual sequence of numbers from start to stop by step.
"""
@@ -3720,7 +3941,7 @@
""" x.__getitem__(y) <==> x[y] """
pass
- def __init__(self, start=None, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__
+ def __init__(self, stop): # real signature unknown; restored from __doc__
pass
def __iter__(self): # real signature unknown; restored from __doc__
@@ -3748,6 +3969,8 @@
pass
+from .Exception import Exception
+
class ReferenceError(Exception):
""" Weak ref proxy used after referent went away. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3759,6 +3982,8 @@
pass
+from .Warning import Warning
+
class ResourceWarning(Warning):
""" Base class for warnings about resource usage. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3770,6 +3995,8 @@
pass
+from .object import object
+
class reversed(object):
"""
reversed(sequence) -> reverse iterator over values of the sequence
@@ -3801,6 +4028,8 @@
pass
+from .Warning import Warning
+
class RuntimeWarning(Warning):
""" Base class for warnings about dubious runtime behavior. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -3812,6 +4041,8 @@
pass
+from .object import object
+
class set(object):
"""
set() -> new empty set object
@@ -3943,7 +4174,7 @@
pass
def __iand__(self, y): # real signature unknown; restored from __doc__
- """ x.__iand__(y) <==> x&y """
+ """ x.__iand__(y) <==> x&=y """
pass
def __init__(self, seq=()): # known special case of set.__init__
@@ -3957,11 +4188,11 @@
pass
def __ior__(self, y): # real signature unknown; restored from __doc__
- """ x.__ior__(y) <==> x|y """
+ """ x.__ior__(y) <==> x|=y """
pass
def __isub__(self, y): # real signature unknown; restored from __doc__
- """ x.__isub__(y) <==> x-y """
+ """ x.__isub__(y) <==> x-=y """
pass
def __iter__(self): # real signature unknown; restored from __doc__
@@ -3969,7 +4200,7 @@
pass
def __ixor__(self, y): # real signature unknown; restored from __doc__
- """ x.__ixor__(y) <==> x^y """
+ """ x.__ixor__(y) <==> x^=y """
pass
def __len__(self): # real signature unknown; restored from __doc__
@@ -4036,9 +4267,12 @@
__hash__ = None
+from .object import object
+
class slice(object):
"""
- slice([start,] stop[, step])
+ slice(stop)
+ slice(start, stop[, step])
Create a slice object. This is used for extended slicing (e.g. a[0:10:2]).
"""
@@ -4069,7 +4303,7 @@
""" x.__gt__(y) <==> x>y """
pass
- def __init__(self, start=None, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__
+ def __init__(self, stop): # real signature unknown; restored from __doc__
pass
def __le__(self, y): # real signature unknown; restored from __doc__
@@ -4098,12 +4332,20 @@
pass
start = property(lambda self: 0)
+ """:type: int"""
+
step = property(lambda self: 0)
+ """:type: int"""
+
stop = property(lambda self: 0)
+ """:type: int"""
+
__hash__ = None
+from .object import object
+
class staticmethod(object):
"""
staticmethod(function) -> method
@@ -4139,9 +4381,12 @@
""" T.__new__(S, ...) -> a new object with type S, a subtype of T """
pass
- __func__ = property(lambda self: object()) # default
+ __func__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
+from .Exception import Exception
+
class StopIteration(Exception):
""" Signal the end from iterator.__next__(). """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -4153,13 +4398,20 @@
pass
+from .object import object
+
class str(object):
"""
- str(string[, encoding[, errors]]) -> str
+ str(object='') -> str
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
- Create a new string object from the given encoded string.
- encoding defaults to the current default string encoding.
- errors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'.
+ Create a new string object from the given object. If encoding or
+ errors is specified, then the object must expose a data buffer
+ that will be decoded using the given encoding and error handler.
+ Otherwise, returns the result of object.__str__() (if defined)
+ or repr(object).
+ encoding defaults to sys.getdefaultencoding().
+ errors defaults to 'strict'.
"""
def capitalize(self): # real signature unknown; restored from __doc__
"""
@@ -4234,14 +4486,14 @@
"""
return 0
- def format(self, *args, **kwargs): # real signature unknown; restored from __doc__
+ def format(*args, **kwargs): # known special case of str.format
"""
S.format(*args, **kwargs) -> str
Return a formatted version of S, using substitutions from args and kwargs.
The substitutions are identified by braces ('{' and '}').
"""
- return ""
+ pass
def format_map(self, mapping): # real signature unknown; restored from __doc__
"""
@@ -4626,11 +4878,16 @@
def __init__(self, value='', encoding=None, errors='strict'): # known special case of str.__init__
"""
- str(string[, encoding[, errors]]) -> str
+ str(object='') -> str
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
- Create a new string object from the given encoded string.
- encoding defaults to the current default string encoding.
- errors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'.
+ Create a new string object from the given object. If encoding or
+ errors is specified, then the object must expose a data buffer
+ that will be decoded using the given encoding and error handler.
+ Otherwise, returns the result of object.__str__() (if defined)
+ or repr(object).
+ encoding defaults to sys.getdefaultencoding().
+ errors defaults to 'strict'.
# (copied from class doc)
"""
pass
@@ -4689,6 +4946,8 @@
pass
+from .object import object
+
class super(object):
"""
super() -> same as super(__class__, <first argument>)
@@ -4743,9 +5002,26 @@
pass
__self_class__ = property(lambda self: type(object))
- __self__ = property(lambda self: type(object))
- __thisclass__ = property(lambda self: type(object))
+ """the type of the instance invoking super(); may be None
+ :type: type
+ """
+
+ __self__ = property(lambda self: type(object))
+ """the instance invoking super(); may be None
+
+ :type: type
+ """
+
+ __thisclass__ = property(lambda self: type(object))
+ """the class invoking super()
+
+ :type: type
+ """
+
+
+
+from .Warning import Warning
class SyntaxWarning(Warning):
""" Base class for warnings about dubious syntax. """
@@ -4758,6 +5034,8 @@
pass
+from .Exception import Exception
+
class SystemError(Exception):
"""
Internal error in the Python interpreter.
@@ -4774,6 +5052,8 @@
pass
+from .BaseException import BaseException
+
class SystemExit(BaseException):
""" Request to exit from the interpreter. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -4784,9 +5064,13 @@
""" T.__new__(S, ...) -> a new object with type S, a subtype of T """
pass
- code = property(lambda self: object()) # default
+ code = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception code"""
+
+from .IndentationError import IndentationError
+
class TabError(IndentationError):
""" Improper mixture of spaces and tabs. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -4798,6 +5082,8 @@
pass
+from .object import object
+
class tuple(object):
"""
tuple() -> empty tuple
@@ -4903,6 +5189,8 @@
pass
+from .object import object
+
class type(object):
"""
type(object) -> the object's type
@@ -4973,7 +5261,8 @@
""" __subclasses__() -> list of immediate subclasses """
return []
- __abstractmethods__ = property(lambda self: object()) # default
+ __abstractmethods__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+
__bases__ = (
object,
@@ -4992,6 +5281,8 @@
__weakrefoffset__ = 368
+from .Exception import Exception
+
class TypeError(Exception):
""" Inappropriate argument type. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -5003,6 +5294,8 @@
pass
+from .NameError import NameError
+
class UnboundLocalError(NameError):
""" Local name referenced but not bound to a value. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -5014,6 +5307,8 @@
pass
+from .Exception import Exception
+
class ValueError(Exception):
""" Inappropriate argument value (of correct type). """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -5025,6 +5320,8 @@
pass
+from .ValueError import ValueError
+
class UnicodeError(ValueError):
""" Unicode related error. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -5036,6 +5333,8 @@
pass
+from .UnicodeError import UnicodeError
+
class UnicodeDecodeError(UnicodeError):
""" Unicode decoding error. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -5050,12 +5349,24 @@
""" x.__str__() <==> str(x) """
pass
- encoding = property(lambda self: object()) # default
- end = property(lambda self: object()) # default
- object = property(lambda self: object()) # default
- reason = property(lambda self: object()) # default
- start = property(lambda self: object()) # default
+ encoding = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception encoding"""
+ end = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception end"""
+
+ object = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception object"""
+
+ reason = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception reason"""
+
+ start = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception start"""
+
+
+
+from .UnicodeError import UnicodeError
class UnicodeEncodeError(UnicodeError):
""" Unicode encoding error. """
@@ -5071,12 +5382,24 @@
""" x.__str__() <==> str(x) """
pass
- encoding = property(lambda self: object()) # default
- end = property(lambda self: object()) # default
- object = property(lambda self: object()) # default
- reason = property(lambda self: object()) # default
- start = property(lambda self: object()) # default
+ encoding = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception encoding"""
+ end = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception end"""
+
+ object = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception object"""
+
+ reason = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception reason"""
+
+ start = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception start"""
+
+
+
+from .UnicodeError import UnicodeError
class UnicodeTranslateError(UnicodeError):
""" Unicode translation error. """
@@ -5092,12 +5415,24 @@
""" x.__str__() <==> str(x) """
pass
- encoding = property(lambda self: object()) # default
- end = property(lambda self: object()) # default
- object = property(lambda self: object()) # default
- reason = property(lambda self: object()) # default
- start = property(lambda self: object()) # default
+ encoding = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception encoding"""
+ end = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception end"""
+
+ object = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception object"""
+
+ reason = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception reason"""
+
+ start = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
+ """exception start"""
+
+
+
+from .Warning import Warning
class UnicodeWarning(Warning):
"""
@@ -5113,6 +5448,8 @@
pass
+from .Warning import Warning
+
class UserWarning(Warning):
""" Base class for warnings generated by user code. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -5124,6 +5461,8 @@
pass
+from .ArithmeticError import ArithmeticError
+
class ZeroDivisionError(ArithmeticError):
""" Second argument to a division or modulo operation was zero. """
def __init__(self, *args, **kwargs): # real signature unknown
@@ -5135,6 +5474,8 @@
pass
+from .object import object
+
class zip(object):
"""
zip(iter1 [,iter2 [...]]) --> zip object
@@ -5165,64 +5506,6 @@
pass
-
-class __generator(object):
- '''A mock class representing the generator function type.'''
- def __init__(self):
- self.gi_code = None
- self.gi_frame = None
- self.gi_running = 0
-
- def __iter__(self):
- '''Defined to support iteration over container.'''
- pass
-
- def __next__(self):
- '''Return the next item from the container.'''
- pass
-
- def close(self):
- '''Raises new GeneratorExit exception inside the generator to terminate the iteration.'''
- pass
-
- def send(self, value):
- '''Resumes the generator and "sends" a value that becomes the result of the current yield-expression.'''
- pass
-
- def throw(self, type, value=None, traceback=None):
- '''Used to raise an exception inside the generator.'''
- pass
-
-
-class __namedtuple(tuple):
- '''A mock base class for named tuples.'''
-
- __slots__ = ()
- _fields = ()
-
- def __new__(cls, *args, **kwargs):
- 'Create a new instance of the named tuple.'
- return tuple.__new__(cls, *args)
-
- @classmethod
- def _make(cls, iterable, new=tuple.__new__, len=len):
- 'Make a new named tuple object from a sequence or iterable.'
- return new(cls, iterable)
-
- def __repr__(self):
- return ''
-
- def _asdict(self):
- 'Return a new dict which maps field types to their values.'
- return {}
-
- def _replace(self, **kwargs):
- 'Return a new named tuple object replacing specified fields with new values.'
- return self
-
- def __getnewargs__(self):
- return tuple(self)
-
# variables with complex values
Ellipsis = None # (!) real value is ''
diff --git a/python/testData/codeInsight/smartEnter/withTargetIncomplete.py b/python/testData/codeInsight/smartEnter/withTargetIncomplete.py
new file mode 100644
index 0000000..a3214a3
--- /dev/null
+++ b/python/testData/codeInsight/smartEnter/withTargetIncomplete.py
@@ -0,0 +1 @@
+with open('file.txt') <caret>as
\ No newline at end of file
diff --git a/python/testData/codeInsight/smartEnter/withTargetIncomplete_after.py b/python/testData/codeInsight/smartEnter/withTargetIncomplete_after.py
new file mode 100644
index 0000000..72892c55
--- /dev/null
+++ b/python/testData/codeInsight/smartEnter/withTargetIncomplete_after.py
@@ -0,0 +1 @@
+with open('file.txt') as <caret>:
\ No newline at end of file
diff --git a/python/testData/codeInsight/smartEnter/withTargetOmitted.py b/python/testData/codeInsight/smartEnter/withTargetOmitted.py
new file mode 100644
index 0000000..c1ba50b
--- /dev/null
+++ b/python/testData/codeInsight/smartEnter/withTargetOmitted.py
@@ -0,0 +1 @@
+with o<caret>pen('file.txt')
\ No newline at end of file
diff --git a/python/testData/codeInsight/smartEnter/withTargetOmitted_after.py b/python/testData/codeInsight/smartEnter/withTargetOmitted_after.py
new file mode 100644
index 0000000..a9e851f
--- /dev/null
+++ b/python/testData/codeInsight/smartEnter/withTargetOmitted_after.py
@@ -0,0 +1,2 @@
+with open('file.txt'):
+ <caret>
\ No newline at end of file
diff --git a/python/testData/completion/modulePrivateNamesCompletedInsideImport/a.py b/python/testData/completion/modulePrivateNamesCompletedInsideImport/a.py
new file mode 100644
index 0000000..4aa7c18
--- /dev/null
+++ b/python/testData/completion/modulePrivateNamesCompletedInsideImport/a.py
@@ -0,0 +1 @@
+from module import <caret>
\ No newline at end of file
diff --git a/python/testData/completion/modulePrivateNamesCompletedInsideImport/module.py b/python/testData/completion/modulePrivateNamesCompletedInsideImport/module.py
new file mode 100644
index 0000000..0febd2f
--- /dev/null
+++ b/python/testData/completion/modulePrivateNamesCompletedInsideImport/module.py
@@ -0,0 +1,3 @@
+normal_name = 'foo'
+_private_name = 'bar'
+__magic_name__ = 'baz'
\ No newline at end of file
diff --git a/python/testData/inspections/PyUnresolvedReferencesInspection/PrivateModuleNames/a.py b/python/testData/inspections/PyUnresolvedReferencesInspection/PrivateModuleNames/a.py
new file mode 100644
index 0000000..71615d7
--- /dev/null
+++ b/python/testData/inspections/PyUnresolvedReferencesInspection/PrivateModuleNames/a.py
@@ -0,0 +1,5 @@
+from lib import *
+
+normal_name
+<error descr="Unresolved reference '_private_name'">_private_name</error>
+<error descr="Unresolved reference '__magic_name__'">__magic_name__</error>
\ No newline at end of file
diff --git a/python/testData/inspections/PyUnresolvedReferencesInspection/PrivateModuleNames/lib.py b/python/testData/inspections/PyUnresolvedReferencesInspection/PrivateModuleNames/lib.py
new file mode 100644
index 0000000..b92c948
--- /dev/null
+++ b/python/testData/inspections/PyUnresolvedReferencesInspection/PrivateModuleNames/lib.py
@@ -0,0 +1,3 @@
+normal_name = 'spam'
+private_name = 'ham'
+__magic_name__ = 'green eggs'
diff --git a/python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/concatenated.py b/python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/concatenated.py
new file mode 100644
index 0000000..9ba6589
--- /dev/null
+++ b/python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/concatenated.py
@@ -0,0 +1,2 @@
+print('<caret>%(quantity)s pounds of '
+ '%(type)s' % dict(quantity=42, type='spam'))
\ No newline at end of file
diff --git a/python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/concatenated_after.py b/python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/concatenated_after.py
new file mode 100644
index 0000000..804f15c
--- /dev/null
+++ b/python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/concatenated_after.py
@@ -0,0 +1,2 @@
+print('{quantity:s} pounds of '
+ '{type:s}'.format(quantity=42, type='spam'))
\ No newline at end of file
diff --git a/python/testData/resolve/multiFile/modulePrivateName/ImportedFile.py b/python/testData/resolve/multiFile/modulePrivateName/ImportedFile.py
new file mode 100644
index 0000000..8fb1549
--- /dev/null
+++ b/python/testData/resolve/multiFile/modulePrivateName/ImportedFile.py
@@ -0,0 +1 @@
+_private_name = "spam"
\ No newline at end of file
diff --git a/python/testData/resolve/multiFile/modulePrivateName/ModulePrivateName.py b/python/testData/resolve/multiFile/modulePrivateName/ModulePrivateName.py
new file mode 100644
index 0000000..ac8143c
--- /dev/null
+++ b/python/testData/resolve/multiFile/modulePrivateName/ModulePrivateName.py
@@ -0,0 +1,5 @@
+from ImportedFile import *
+
+_private_name
+# <ref>
+
diff --git a/python/testData/resolve/multiFile/modulePrivateNameInDunderAll/ImportedFile.py b/python/testData/resolve/multiFile/modulePrivateNameInDunderAll/ImportedFile.py
new file mode 100644
index 0000000..9fb658f
--- /dev/null
+++ b/python/testData/resolve/multiFile/modulePrivateNameInDunderAll/ImportedFile.py
@@ -0,0 +1,4 @@
+__all__ = [
+ "_private_name",
+]
+_private_name = "spam"
\ No newline at end of file
diff --git a/python/testData/resolve/multiFile/modulePrivateNameInDunderAll/ModulePrivateNameInDunderAll.py b/python/testData/resolve/multiFile/modulePrivateNameInDunderAll/ModulePrivateNameInDunderAll.py
new file mode 100644
index 0000000..ac8143c
--- /dev/null
+++ b/python/testData/resolve/multiFile/modulePrivateNameInDunderAll/ModulePrivateNameInDunderAll.py
@@ -0,0 +1,5 @@
+from ImportedFile import *
+
+_private_name
+# <ref>
+
diff --git a/python/testSrc/com/jetbrains/python/Py3CompletionTest.java b/python/testSrc/com/jetbrains/python/Py3CompletionTest.java
index 1409ff4..ca7c3c2 100644
--- a/python/testSrc/com/jetbrains/python/Py3CompletionTest.java
+++ b/python/testSrc/com/jetbrains/python/Py3CompletionTest.java
@@ -18,6 +18,7 @@
import com.intellij.codeInsight.completion.impl.CamelHumpMatcher;
import com.intellij.testFramework.LightProjectDescriptor;
import com.jetbrains.python.fixtures.PyTestCase;
+import com.jetbrains.python.psi.LanguageLevel;
import java.util.List;
@@ -73,4 +74,23 @@
myFixture.completeBasic();
return myFixture.getLookupElementStrings();
}
+
+ // PY-4073
+ public void testSpecialFunctionAttributesPy3() throws Exception {
+ setLanguageLevel(LanguageLevel.PYTHON32);
+ try {
+ List<String> suggested = doTestByText("def func(): pass; func.func_<caret>");
+ assertNotNull(suggested);
+ assertEmpty(suggested);
+
+ suggested = doTestByText("def func(): pass; func.__<caret>");
+ assertNotNull(suggested);
+ assertContainsElements(suggested, "__defaults__", "__globals__", "__closure__",
+ "__code__", "__name__", "__doc__", "__dict__", "__module__");
+ assertContainsElements(suggested, "__annotations__", "__kwdefaults__");
+ }
+ finally {
+ setLanguageLevel(null);
+ }
+ }
}
diff --git a/python/testSrc/com/jetbrains/python/PyCommenterTest.java b/python/testSrc/com/jetbrains/python/PyCommenterTest.java
index 651311e..1ce9202 100644
--- a/python/testSrc/com/jetbrains/python/PyCommenterTest.java
+++ b/python/testSrc/com/jetbrains/python/PyCommenterTest.java
@@ -15,8 +15,6 @@
*/
package com.jetbrains.python;
-import com.intellij.codeInsight.actions.CodeInsightAction;
-import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.IdeActions;
import com.jetbrains.python.fixtures.PyTestCase;
@@ -34,9 +32,7 @@
private void doTest() {
myFixture.configureByFile("commenter/" + getTestName(true) + ".py");
- CodeInsightAction action = (CodeInsightAction) ActionManager.getInstance().getAction(IdeActions.ACTION_COMMENT_LINE);
- action.actionPerformedImpl(myFixture.getFile().getProject(), myFixture.getEditor());
+ myFixture.performEditorAction(IdeActions.ACTION_COMMENT_LINE);
myFixture.checkResultByFile("commenter/" + getTestName(true) + "_after.py", true);
-
}
}
diff --git a/python/testSrc/com/jetbrains/python/PyMultiFileResolveTest.java b/python/testSrc/com/jetbrains/python/PyMultiFileResolveTest.java
index e942388..4585832 100644
--- a/python/testSrc/com/jetbrains/python/PyMultiFileResolveTest.java
+++ b/python/testSrc/com/jetbrains/python/PyMultiFileResolveTest.java
@@ -363,4 +363,14 @@
public void testFromPackageModuleImportStarElementNamedAsModule() {
assertResolvesTo(PyFunction.class, "foo");
}
+
+ // PY-13140
+ public void testModulePrivateName() {
+ assertNull(doResolve());
+ }
+
+ // PY-13140
+ public void testModulePrivateNameInDunderAll() {
+ assertResolvesTo(PyTargetExpression.class, "_private_name");
+ }
}
diff --git a/python/testSrc/com/jetbrains/python/PySmartEnterTest.java b/python/testSrc/com/jetbrains/python/PySmartEnterTest.java
index 959b1f7..b8421c9 100644
--- a/python/testSrc/com/jetbrains/python/PySmartEnterTest.java
+++ b/python/testSrc/com/jetbrains/python/PySmartEnterTest.java
@@ -169,4 +169,14 @@
pyCodeInsightSettings.INSERT_TYPE_DOCSTUB = oldInsertType;
}
}
+
+ // PY-12877
+ public void testWithTargetOmitted() {
+ doTest();
+ }
+
+ // PY-12877
+ public void testWithTargetIncomplete() {
+ doTest();
+ }
}
diff --git a/python/testSrc/com/jetbrains/python/PyTypeTest.java b/python/testSrc/com/jetbrains/python/PyTypeTest.java
index 81b4aa46..88243f0 100644
--- a/python/testSrc/com/jetbrains/python/PyTypeTest.java
+++ b/python/testSrc/com/jetbrains/python/PyTypeTest.java
@@ -399,6 +399,16 @@
"expr = x.start\n");
TypeEvalContext context = getTypeEvalContext(expr);
PyType actual = context.getType(expr);
+ assertNotNull(actual);
+ assertInstanceOf(actual, PyClassType.class);
+ assertEquals("int", actual.getName());
+ }
+
+ public void testUndefinedPropertyOfUnionType() {
+ PyExpression expr = parseExpr("x = 42 if True else 'spam'\n" +
+ "expr = x.foo\n");
+ TypeEvalContext context = getTypeEvalContext(expr);
+ PyType actual = context.getType(expr);
assertNull(actual);
}
diff --git a/python/testSrc/com/jetbrains/python/PythonCompletionTest.java b/python/testSrc/com/jetbrains/python/PythonCompletionTest.java
index b57ae35..f365eea 100644
--- a/python/testSrc/com/jetbrains/python/PythonCompletionTest.java
+++ b/python/testSrc/com/jetbrains/python/PythonCompletionTest.java
@@ -161,7 +161,7 @@
final LookupElement[] elements = myFixture.completeBasic();
assertNotNull(elements);
assertEquals(1, elements.length);
- assertEquals("children", elements [0].getLookupString());
+ assertEquals("children", elements[0].getLookupString());
}
public void testImportModule() {
@@ -613,6 +613,36 @@
" __meta<caret>\n");
myFixture.checkResult("class C(object):\n" +
" __metaclass__ = \n");
+ }
+ // PY-13140
+ public void testModulePrivateNamesCompletedInsideImport() {
+ myFixture.copyDirectoryToProject("completion/" + getTestName(true), "");
+ myFixture.configureByFile("a.py");
+ myFixture.completeBasic();
+ List<String> suggested = myFixture.getLookupElementStrings();
+ assertNotNull(suggested);
+ assertContainsElements(suggested, "normal_name", "_private_name", "__magic_name__");
+ }
+
+ // PY-4073
+ public void testSpecialFunctionAttributes() throws Exception {
+ setLanguageLevel(LanguageLevel.PYTHON27);
+ try {
+ List<String> suggested = doTestByText("def func(): pass; func.func_<caret>");
+ assertNotNull(suggested);
+ assertContainsElements(suggested,
+ "func_defaults", "func_globals", "func_closure",
+ "func_code", "func_name", "func_doc", "func_dict");
+
+ suggested = doTestByText("def func(): pass; func.__<caret>");
+ assertNotNull(suggested);
+ assertContainsElements(suggested, "__defaults__", "__globals__", "__closure__",
+ "__code__", "__name__", "__doc__", "__dict__", "__module__");
+ assertDoesntContain(suggested, "__annotations__", "__kwdefaults__");
+ }
+ finally {
+ setLanguageLevel(null);
+ }
}
}
diff --git a/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java
index e614edd..0c5e87a 100644
--- a/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java
+++ b/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java
@@ -366,6 +366,11 @@
doMultiFileTest();
}
+ // PY-13140
+ public void testPrivateModuleNames() {
+ doMultiFileTest();
+ }
+
@NotNull
@Override
protected Class<? extends PyInspection> getInspectionClass() {
diff --git a/python/testSrc/com/jetbrains/python/intentions/PyConvertFormatOperatorToMethodIntentionTest.java b/python/testSrc/com/jetbrains/python/intentions/PyConvertFormatOperatorToMethodIntentionTest.java
index 3dfa4a3..833f71e 100644
--- a/python/testSrc/com/jetbrains/python/intentions/PyConvertFormatOperatorToMethodIntentionTest.java
+++ b/python/testSrc/com/jetbrains/python/intentions/PyConvertFormatOperatorToMethodIntentionTest.java
@@ -38,4 +38,9 @@
public void testUnicode() {
doTest(PyBundle.message("INTN.replace.with.method"), LanguageLevel.PYTHON26);
}
+
+ // PY-9176
+ public void testConcatenated() {
+ doTest(PyBundle.message("INTN.replace.with.method"), LanguageLevel.PYTHON26);
+ }
}
\ No newline at end of file
diff --git a/resources-en/src/messages/DebuggerBundle.properties b/resources-en/src/messages/DebuggerBundle.properties
index ff3238c..fa51256 100644
--- a/resources-en/src/messages/DebuggerBundle.properties
+++ b/resources-en/src/messages/DebuggerBundle.properties
@@ -173,7 +173,6 @@
label.array.renderer.configurable.end.index=en&d index:
label.array.renderer.configurable.max.count1=Show &maximum
label.array.renderer.configurable.max.count2=array elements
-base.renderer.configurable.display.name=Data Views
label.base.renderer.configurable.autoscroll=Autoscroll to new &local variables
label.base.renderer.configurable.show.synthetic.fields=S&ynthetic fields
label.base.renderer.configurable.show.val.fields.as.locals=$val fields as local &variables
@@ -186,10 +185,9 @@
label.base.renderer.configurable.show.declared.type=Declared &type
label.base.renderer.configurable.show.fq.names=Fully &qualified names
label.base.renderer.configurable.show.object.id=Object &id
-label.base.renderer.configurable.auto.expressions=Enable auto expressions in Variables view
label.base.renderer.configurable.alternate.view=Enable alternative view for Coll&ections classes
-label.base.renderer.configurable.enable.tostring=Enable 't&oString()' object view:
-label.base.renderer.configurable.all.overridding=For all classes that override 'toString()' method
+label.base.renderer.configurable.enable.toString=Enable 't&oString()' object view:
+label.base.renderer.configurable.all.overriding=For all classes that override 'toString()' method
label.base.renderer.configurable.classes.from.list=For classes from the list:
label.compound.renderer.configurable.use.default.renderer=Use default renderer
label.compound.renderer.configurable.use.expression=Use following expression:
@@ -208,13 +206,10 @@
label.compound.renderer.configurable.table.header.expression=Expression
debugger.launching.configurable.display.name=Launching
debugger.hotswap.configurable.display.name=HotSwap
-debugger.stepping.configurable.display.name=Stepping
label.debugger.launching.configurable.hide.window=Hide debug &window on process termination
-label.debugger.focusAppOnBreakpoint=Focus application on breakpoint
label.debugger.hotswap.configurable.hotswap.background=Reload classes in &background
label.debugger.hotswap.configurable.compile.before.hotswap=Make project before reloading classes
label.debugger.hotswap.configurable.enable.vm.hang.warning=Enable 'JVM will hang' warning
-label.debugger.general.configurable.tooltips.delay=&Value tooltips delay (ms):
label.debugger.hotswap.configurable.reload.classes=Reload classes after compilation:
label.debugger.hotswap.configurable.always=&Always
label.debugger.hotswap.configurable.never=&Never
@@ -227,7 +222,7 @@
label.debugger.launching.configurable.shmem=Shared &memory
label.debugger.general.configurable.skip.synthetic.methods=Ski&p synthetic methods
label.debugger.general.configurable.skip.constructors=Skip &constructors
-label.debugger.general.configurable.skip.classloaders=Skip class l&oaders
+label.debugger.general.configurable.skip.classLoaders=Skip class l&oaders
label.debugger.general.configurable.skip.simple.getters=Skip simple &getters
label.debugger.general.configurable.step.filters.list.header=Do not step &into the classes
label.threads.view.configurable.show.source.file.name=Show source file name
diff --git a/resources/src/META-INF/IdeTipsAndTricks.xml b/resources/src/META-INF/IdeTipsAndTricks.xml
index 35fd6e0..c27a050 100644
--- a/resources/src/META-INF/IdeTipsAndTricks.xml
+++ b/resources/src/META-INF/IdeTipsAndTricks.xml
@@ -50,6 +50,7 @@
<tipAndTrick file="HierarchyBrowser.html"/>
<tipAndTrick file="BreakpointSpeedmenu.html"/>
<tipAndTrick file="EvaluateExpressionInEditor.html"/>
+ <tipAndTrick file="QuickEvaluateExpression.html"/>
<tipAndTrick file="WordCompletion.html"/>
<tipAndTrick file="QuickJavaDocInLookups.html" feature-id="codeassists.quickjavadoc.lookup"/>
<tipAndTrick file="DotEtcInLookups.html" feature-id="editing.completion.finishByDotEtc"/>
diff --git a/resources/src/META-INF/IdeaPlugin.xml b/resources/src/META-INF/IdeaPlugin.xml
index 329fc3d..9764417 100644
--- a/resources/src/META-INF/IdeaPlugin.xml
+++ b/resources/src/META-INF/IdeaPlugin.xml
@@ -9,16 +9,26 @@
<xi:include href="/idea/JavaActions.xml" xpointer="xpointer(/component/*)"/>
<xi:include href="/META-INF/ExternalSystemExtensions.xml" xpointer="xpointer(/idea-plugin/extensions/*)"/>
<xi:include href="/componentSets/Debugger.xml" xpointer="xpointer(/components/*)"/>
+ <xi:include href="/META-INF/structuralsearch.xml" xpointer="xpointer(/idea-plugin/*)">
+ <xi:fallback/>
+ </xi:include>
+ <xi:include href="/META-INF/structuralsearch-java.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="/META-INF/IntentionPowerPack.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="/META-INF/InspectionGadgets.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="/META-INF/ManifestSupport.xml" xpointer="xpointer(/idea-plugin/*)">
<xi:fallback/>
</xi:include>
+ <xi:include href="/META-INF/TypeMigration.xml" xpointer="xpointer(/idea-plugin/*)">
+ <xi:fallback/>
+ </xi:include>
<application-components>
<component>
<implementation-class>com.intellij.util.xml.impl.JavaDomApplicationComponent</implementation-class>
</component>
+ <component>
+ <implementation-class>com.intellij.codeInspection.bytecodeAnalysis.BytecodeAnalysisConverter</implementation-class>
+ </component>
</application-components>
<project-components>
@@ -1356,6 +1366,8 @@
<stubIndex implementation="com.intellij.psi.impl.java.stubs.index.JavaSuperClassNameOccurenceIndex"/>
<stubIndex implementation="com.intellij.psi.impl.java.stubs.index.JavaMethodParameterTypesIndex"/>
+ <fileBasedIndex implementation="com.intellij.codeInspection.bytecodeAnalysis.BytecodeAnalysisIndex"/>
+
<stubElementTypeHolder class="com.intellij.psi.impl.java.stubs.JavaStubElementTypes"/>
<dom.customAnnotationChecker implementation="com.intellij.util.xml.impl.ExtendsClassChecker"/>
@@ -1416,6 +1428,8 @@
<resolveScopeEnlarger implementation="com.intellij.psi.NonClasspathResolveScopeEnlarger"/>
<xdebugger.debuggerSupport implementation="com.intellij.debugger.ui.JavaDebuggerSupport"/>
+ <xdebugger.settings implementation="com.intellij.debugger.settings.JavaDebuggerSettings"/>
+
<xdebugger.breakpointType implementation="com.intellij.debugger.ui.breakpoints.JavaMethodBreakpointType"/>
<xdebugger.breakpointType implementation="com.intellij.debugger.ui.breakpoints.JavaWildcardMethodBreakpointType"/>
<xdebugger.breakpointType implementation="com.intellij.debugger.ui.breakpoints.JavaFieldBreakpointType"/>
@@ -1471,7 +1485,6 @@
implementationClass="com.intellij.psi.impl.JavaRegExpHost"/>
<psi.referenceContributor language="JAVA" implementation="com.intellij.psi.impl.source.resolve.reference.impl.JavaReflectionReferenceContributor"/>
- <psi.referenceContributor language="JAVA" implementation="com.intellij.psi.impl.source.resolve.reference.impl.JavaCharsetReferenceContributor"/>
<writingAccessProvider implementation="com.intellij.refactoring.util.ClsElementWritingAccessProvider"/>
@@ -1509,6 +1522,8 @@
<projectOpenProcessor implementation="com.intellij.platform.PlatformProjectOpenProcessor" order="last"/>
<projectService serviceInterface="com.intellij.platform.ProjectBaseDirectory"
serviceImplementation="com.intellij.platform.ProjectBaseDirectory"/>
+ <projectService serviceInterface="com.intellij.codeInspection.bytecodeAnalysis.ProjectBytecodeAnalysis"
+ serviceImplementation="com.intellij.codeInspection.bytecodeAnalysis.ProjectBytecodeAnalysis"/>
<spellchecker.support language="JAVA" implementationClass="com.intellij.spellchecker.JavaSpellcheckingStrategy"/>
<codeInsight.template.postfixTemplateProvider language="JAVA"
diff --git a/resources/src/idea/RichPlatformActions.xml b/resources/src/idea/RichPlatformActions.xml
index e54eddd..12a8d34 100644
--- a/resources/src/idea/RichPlatformActions.xml
+++ b/resources/src/idea/RichPlatformActions.xml
@@ -87,7 +87,7 @@
<group id="InspectCodeGroup" text="Inspect Code Actions">
<action id="InspectCode" class="com.intellij.codeInspection.actions.CodeInspectionAction"/>
- <action id="CodeCleanup" class="com.intellij.codeInspection.actions.CodeCleanupAction" internal="true"/>
+ <action id="CodeCleanup" class="com.intellij.codeInspection.actions.CodeCleanupAction"/>
<action id="RunInspection" class="com.intellij.codeInspection.actions.RunInspectionAction"/>
<action id="PopupHector" class="com.intellij.codeInsight.daemon.impl.PopupHectorAction"/>
<action id="ViewOfflineInspection" class="com.intellij.codeInspection.actions.ViewOfflineResultsAction"/>
@@ -141,6 +141,7 @@
<action id="LoadAllContent" internal="true" class="com.intellij.internal.LoadAllContentsAction" text="Load all files content"/>
<action id="LoadAllVFSContent" internal="true" class="com.intellij.internal.LoadAllVfsStoredContentsAction" text="Load all VFS stored files content"/>
<action id="ComputeVFStatistics" internal="true" class="com.intellij.internal.ComputeVirtualFileNameStatAction"/>
+ <action id="DumpVfsInfoForExcludedFiles" internal="true" class="com.intellij.internal.DumpVfsInfoForExcludedFilesAction"/>
<separator/>
<action internal="true" id="PruneEmptyDirectories" class="com.intellij.ide.actions.PruneEmptyDirectoriesAction" text="Prune Empty Directories"/>
<action internal="true" id="FixLineSeparators" class="com.intellij.ide.actions.FixLineSeparatorsAction" text="Fix Line Separators"/>
diff --git a/resources/src/idea/RichPlatformPlugin.xml b/resources/src/idea/RichPlatformPlugin.xml
index b27faab..92ae7046 100644
--- a/resources/src/idea/RichPlatformPlugin.xml
+++ b/resources/src/idea/RichPlatformPlugin.xml
@@ -32,9 +32,6 @@
<extensionPoint name="antCustomCompiler"
interface="com.intellij.compiler.ant.ChunkCustomCompilerExtension"/>
- <extensionPoint name="compiler.buildParticipantProvider"
- interface="com.intellij.openapi.compiler.make.BuildParticipantProvider"/>
-
<extensionPoint name="compiler.buildTargetScopeProvider"
interface="com.intellij.compiler.impl.BuildTargetScopeProvider"/>
@@ -181,6 +178,9 @@
<projectService serviceInterface="com.intellij.codeInsight.ExternalAnnotationsManager"
serviceImplementation="com.intellij.codeInsight.ExternalAnnotationsManagerImpl"/>
+ <projectService serviceInterface="com.intellij.codeInsight.InferredAnnotationsManager"
+ serviceImplementation="com.intellij.codeInsight.InferredAnnotationsManagerImpl"/>
+
<projectService serviceInterface="com.intellij.openapi.compiler.CompilerManager"
serviceImplementation="com.intellij.compiler.CompilerManagerImpl"/>
<projectService serviceInterface="com.intellij.openapi.roots.CompilerProjectExtension"
@@ -239,10 +239,10 @@
<!-- Errors -->
<!-- Show full error options configurable only in full IDEA - platform supports only default IDE profile for now -->
- <projectConfigurable provider="com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurableProvider"/>
+ <projectConfigurable groupId="editor" displayName="Inspections" provider="com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurableProvider"/>
<!-- Compiler -->
- <projectConfigurable instance="com.intellij.compiler.options.CompilerConfigurable" id="project.propCompiler" order="after project"
+ <projectConfigurable groupId="build" instance="com.intellij.compiler.options.CompilerConfigurable" id="project.propCompiler" order="after project"
key="compiler.configurable.display.name" bundle="messages.CompilerBundle" childrenEPName="com.intellij.compilerSettingsFactory">
<configurable instance="com.intellij.openapi.compiler.options.ExcludedEntriesConfigurable" id="reference.projectsettings.compiler.excludes"
displayName="Excludes"/>
@@ -254,20 +254,20 @@
key="rmi.compiler.description" bundle="messages.CompilerBundle"/>
</projectConfigurable>
- <projectConfigurable instance="com.intellij.psi.templateLanguages.TemplateDataLanguageConfigurable" id="Template Data Languages" key="template.data.language.configurable" bundle="messages.LangBundle" />
+ <projectConfigurable groupId="language" instance="com.intellij.psi.templateLanguages.TemplateDataLanguageConfigurable" id="Template Data Languages" key="template.data.language.configurable" bundle="messages.LangBundle" />
<!-- Scopes -->
- <projectConfigurable instance="com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable" id="project.scopes" key="scopes.display.name" bundle="messages.IdeBundle" />
+ <projectConfigurable groupId="project" instance="com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable" id="project.scopes" key="scopes.display.name" bundle="messages.IdeBundle" />
<!-- Application Configurables -->
<!-- Path Variables -->
<!-- the implementation of this configurable is in platform-impl but it's not registered in platform because
it's only required in full IDEA -->
- <applicationConfigurable instance="com.intellij.application.options.pathMacros.PathMacroConfigurable" id="preferences.pathVariables"
+ <applicationConfigurable groupId="project" instance="com.intellij.application.options.pathMacros.PathMacroConfigurable" id="preferences.pathVariables"
key="title.path.variables" bundle="messages.ApplicationBundle"/>
- <applicationConfigurable instance="com.intellij.execution.console.ConsoleFoldingConfigurable" id="Console Folding"
+ <applicationConfigurable parentId="editor" instance="com.intellij.execution.console.ConsoleFoldingConfigurable" id="Console Folding"
displayName="Console Folding"/>
<editorNotificationProvider implementation="com.intellij.codeInsight.daemon.impl.AttachSourcesNotificationProvider"/>
diff --git a/spellchecker/src/META-INF/SpellCheckerPlugin.xml b/spellchecker/src/META-INF/SpellCheckerPlugin.xml
index a6108ed..bd6be66 100644
--- a/spellchecker/src/META-INF/SpellCheckerPlugin.xml
+++ b/spellchecker/src/META-INF/SpellCheckerPlugin.xml
@@ -23,7 +23,7 @@
<projectService serviceInterface="com.intellij.spellchecker.SpellCheckerManager"
serviceImplementation="com.intellij.spellchecker.SpellCheckerManager"/>
<editorCustomization implementation="com.intellij.spellchecker.ui.SpellCheckingEditorCustomization"/>
- <projectConfigurable instance="com.intellij.spellchecker.settings.SpellCheckerSettingsManager" id="reference.settings.ide.settings.spelling" key="spelling" bundle="com.intellij.spellchecker.util.SpellCheckerBundle" />
+ <projectConfigurable groupId="editor" instance="com.intellij.spellchecker.settings.SpellCheckerSettingsManager" id="reference.settings.ide.settings.spelling" key="spelling" bundle="com.intellij.spellchecker.util.SpellCheckerBundle" />
<localInspection shortName="SpellCheckingInspection" bundle="com.intellij.spellchecker.util.SpellCheckerBundle"
diff --git a/spellchecker/src/com/intellij/spellchecker/jetbrains.dic b/spellchecker/src/com/intellij/spellchecker/jetbrains.dic
index 71cb555..52b8560 100644
--- a/spellchecker/src/com/intellij/spellchecker/jetbrains.dic
+++ b/spellchecker/src/com/intellij/spellchecker/jetbrains.dic
@@ -168,9 +168,11 @@
google
gzip
gruntfile
+hamcrest
hardcoded
hardlink
hardlinks
+hashcode
haxe
helvetica
holdability
@@ -486,6 +488,7 @@
sigwinch
sigxcpu
sigxfsz
+slru
smallfile
smallint
soname
@@ -560,6 +563,7 @@
unescaped
unhandled
uninstall
+unmerged
unpivot
unprotect
unwatch
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java
index bdad1cf..88bc700 100644
--- a/xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java
@@ -17,7 +17,6 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.module.Module;
-import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.util.NullableFactory;
@@ -29,6 +28,7 @@
import com.intellij.psi.SmartPsiElementPointer;
import com.intellij.psi.XmlElementFactory;
import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.util.PsiUtilCore;
import com.intellij.psi.xml.XmlAttribute;
import com.intellij.psi.xml.XmlElement;
import com.intellij.psi.xml.XmlFile;
@@ -666,8 +666,14 @@
final XmlAttribute attribute = tag.getAttribute(description.getXmlName().getLocalName(), ns.equals(tag.getNamespace())? null:ns);
if (attribute != null) {
- LOG.assertTrue(attribute.isValid());
- return myManager.getSemService().getSemElement(DomManagerImpl.DOM_ATTRIBUTE_HANDLER_KEY, attribute);
+ PsiUtilCore.ensureValid(attribute);
+ AttributeChildInvocationHandler semElement =
+ myManager.getSemService().getSemElement(DomManagerImpl.DOM_ATTRIBUTE_HANDLER_KEY, attribute);
+ if (semElement == null) {
+ final AttributeChildInvocationHandler take2 = myManager.getSemService().getSemElement(DomManagerImpl.DOM_ATTRIBUTE_HANDLER_KEY, attribute);
+ throw new AssertionError("No DOM at XML. Parent=" + tag + "; attribute=" + attribute + "; second attempt=" + take2);
+ }
+ return semElement;
}
}
return new AttributeChildInvocationHandler(evaluatedXmlName, description, myManager, new VirtualDomParentStrategy(this), null);
diff --git a/xml/impl/src/com/intellij/application/options/emmet/EmmetOptions.java b/xml/impl/src/com/intellij/application/options/emmet/EmmetOptions.java
index 6781db7..91fcf39 100644
--- a/xml/impl/src/com/intellij/application/options/emmet/EmmetOptions.java
+++ b/xml/impl/src/com/intellij/application/options/emmet/EmmetOptions.java
@@ -44,7 +44,7 @@
private boolean myBemFilterEnabledByDefault = false;
private boolean myEmmetEnabled = true;
private int myEmmetExpandShortcut = TemplateSettings.TAB_CHAR;
- private boolean myFuzzySearchEnabled = true;
+ private boolean myFuzzySearchEnabled = false;
private boolean myAutoInsertCssPrefixedEnabled = true;
private boolean myPreviewEnabled = false;
private Set<String> myFiltersEnabledByDefault = ContainerUtil.newHashSet();
diff --git a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentials.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetException.java
similarity index 74%
rename from platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentials.java
rename to xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetException.java
index e6be766..0105408 100644
--- a/platform/platform-impl/src/com/intellij/remotesdk/RemoteCredentials.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetException.java
@@ -13,12 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.remotesdk;
+package com.intellij.codeInsight.template.emmet;
-/**
- * @deprecated Remove in IDEA 14
- *
- * @author traff
- */
-public interface RemoteCredentials extends com.intellij.remote.RemoteCredentials {
+public class EmmetException extends Exception {
+ public EmmetException() {
+ super("Cannot expand emmet abbreviation: output is too big");
+ }
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewHint.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewHint.java
index edde5a8..f977795 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewHint.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewHint.java
@@ -147,7 +147,7 @@
EditorFactory editorFactory = EditorFactory.getInstance();
Document document = editorFactory.createDocument(templateText);
final EditorEx previewEditor = (EditorEx)editorFactory.createEditor(document, parentEditor.getProject(), fileType, true);
- EditorSettings settings = previewEditor.getSettings();
+ final EditorSettings settings = previewEditor.getSettings();
settings.setLineNumbersShown(false);
settings.setAdditionalLinesCount(1);
settings.setAdditionalColumnsCount(1);
@@ -172,7 +172,7 @@
int maxWidth = (int)parentEditorSize.getWidth() / 3;
int maxHeight = (int)parentEditorSize.getHeight() / 2;
Dimension contentSize = previewEditor.getContentSize();
- return new Dimension(maxWidth > contentSize.getWidth() ? (int)size.getWidth() : maxWidth,
+ return new Dimension(maxWidth > contentSize.getWidth() && !settings.isUseSoftWraps() ? (int)size.getWidth() : maxWidth,
maxHeight > contentSize.getHeight() ? (int)size.getHeight() : maxHeight);
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewUtil.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewUtil.java
index af10692..a82ab07 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewUtil.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewUtil.java
@@ -61,12 +61,19 @@
if (generator != null && generator instanceof XmlZenCodingGenerator) {
final String templatePrefix = new ZenCodingTemplate().computeTemplateKeyWithoutContextChecking(callback);
if (templatePrefix != null) {
- ZenCodingTemplate.expand(templatePrefix, callback, generator, Collections.<ZenCodingFilter>emptyList(), expandPrimitiveAbbreviations, 0);
- TemplateImpl template = generatedTemplate.get();
- String templateText = template != null ? template.getTemplateText() : null;
- if (!StringUtil.isEmpty(templateText)) {
- return template.isToReformat() ? reformatTemplateText(file, templateText) : templateText;
+ try {
+ ZenCodingTemplate.expand(templatePrefix, callback, generator, Collections.<ZenCodingFilter>emptyList(),
+ expandPrimitiveAbbreviations, 0);
+ TemplateImpl template = generatedTemplate.get();
+ String templateText = template != null ? template.getTemplateText() : null;
+ if (!StringUtil.isEmpty(templateText)) {
+ return template.isToReformat() ? reformatTemplateText(file, templateText) : templateText;
+ }
}
+ catch (EmmetException e) {
+ return e.getMessage();
+ }
+
}
}
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/ZenCodingTemplate.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/ZenCodingTemplate.java
index b0d6236..f27903a 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/ZenCodingTemplate.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/ZenCodingTemplate.java
@@ -52,6 +52,7 @@
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
+import com.intellij.refactoring.util.CommonRefactoringUtil;
import com.intellij.ui.*;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.xml.XmlBundle;
@@ -124,7 +125,12 @@
public void expand(@NotNull String key, @NotNull CustomTemplateCallback callback) {
ZenCodingGenerator defaultGenerator = findApplicableDefaultGenerator(callback.getContext(), false);
assert defaultGenerator != null;
- expand(key, callback, defaultGenerator, Collections.<ZenCodingFilter>emptyList(), true, Registry.intValue("emmet.segments.limit"));
+ try {
+ expand(key, callback, defaultGenerator, Collections.<ZenCodingFilter>emptyList(), true, Registry.intValue("emmet.segments.limit"));
+ }
+ catch (EmmetException e) {
+ CommonRefactoringUtil.showErrorHint(callback.getProject(), callback.getEditor(), e.getMessage(), "Emmet error", "");
+ }
}
@Nullable
@@ -182,7 +188,7 @@
public static void expand(@NotNull String key, @NotNull CustomTemplateCallback callback,
@NotNull ZenCodingGenerator defaultGenerator,
@NotNull Collection<? extends ZenCodingFilter> extraFilters,
- boolean expandPrimitiveAbbreviations, int segmentsLimit) {
+ boolean expandPrimitiveAbbreviations, int segmentsLimit) throws EmmetException {
final ZenCodingNode node = parse(key, callback, defaultGenerator, null);
if (node == null) {
return;
@@ -204,6 +210,8 @@
List<ZenCodingFilter> filters = getFilters(node, context);
filters.addAll(extraFilters);
+ checkTemplateOutputLength(node, callback);
+
callback.deleteTemplateKey(key);
expand(node, generator, filters, null, callback, expandPrimitiveAbbreviations, segmentsLimit);
}
@@ -212,7 +220,10 @@
ZenCodingGenerator generator,
List<ZenCodingFilter> filters,
String surroundedText,
- CustomTemplateCallback callback, boolean expandPrimitiveAbbreviations, int segmentsLimit) {
+ CustomTemplateCallback callback, boolean expandPrimitiveAbbreviations, int segmentsLimit) throws EmmetException {
+
+ checkTemplateOutputLength(node, callback);
+
if (surroundedText != null) {
surroundedText = surroundedText.trim();
}
@@ -282,6 +293,13 @@
});
}
+ private static void checkTemplateOutputLength(ZenCodingNode node, CustomTemplateCallback callback) throws EmmetException {
+ int predictedOutputLength = node.getApproximateOutputLength(callback);
+ if (predictedOutputLength > 15 * 1024) {
+ throw new EmmetException();
+ }
+ }
+
private static boolean isPrimitiveNode(@NotNull ZenCodingNode node) {
if (node instanceof TemplateNode) {
final TemplateToken token = ((TemplateNode)node).getTemplateToken();
@@ -434,7 +452,12 @@
EditorModificationUtil.deleteSelectedText(callback.getEditor());
PsiDocumentManager.getInstance(callback.getProject()).commitAllDocuments();
- expand(node, generator, filters, selection, callback, true, Registry.intValue("emmet.segments.limit"));
+ try {
+ expand(node, generator, filters, selection, callback, true, Registry.intValue("emmet.segments.limit"));
+ }
+ catch (EmmetException e) {
+ CommonRefactoringUtil.showErrorHint(callback.getProject(), callback.getEditor(), e.getMessage(), "Emmet error", "");
+ }
}
}
});
@@ -509,7 +532,12 @@
if (!regularTemplateWithSamePrefixExists) {
// exclude perfect matches with existing templates because LiveTemplateCompletionContributor handles it
final Collection<SingleLineEmmetFilter> extraFilters = ContainerUtil.newLinkedList(new SingleLineEmmetFilter());
- expand(templatePrefix, callback, generator, extraFilters, false, 0);
+ try {
+ expand(templatePrefix, callback, generator, extraFilters, false, 0);
+ }
+ catch (EmmetException e) {
+ generatedTemplate.set(null);
+ }
if (!generatedTemplate.isNull()) {
final TemplateImpl template = generatedTemplate.get();
template.setKey(templatePrefix);
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/generators/LoremGenerator.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/generators/LoremGenerator.java
index a5f4aee..37b6d4b 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/generators/LoremGenerator.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/generators/LoremGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -16,6 +16,7 @@
package com.intellij.codeInsight.template.emmet.generators;
import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.ArrayUtil;
import java.util.*;
@@ -145,7 +146,7 @@
result.add(words[i]);
}
- return result.toArray(new String[result.size()]);
+ return ArrayUtil.toStringArray(result);
}
private char choice(String values) {
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/generators/XmlZenCodingGenerator.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/generators/XmlZenCodingGenerator.java
index ef57f5e..c1732a3 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/generators/XmlZenCodingGenerator.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/generators/XmlZenCodingGenerator.java
@@ -19,6 +19,8 @@
import com.intellij.codeInsight.template.emmet.ZenCodingTemplate;
import com.intellij.codeInsight.template.emmet.tokens.TemplateToken;
import com.intellij.codeInsight.template.impl.TemplateImpl;
+import com.intellij.diagnostic.AttachmentFactory;
+import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.util.Couple;
import com.intellij.openapi.util.TextRange;
@@ -109,6 +111,11 @@
prevVisibleLeaf = PsiTreeUtil.prevVisibleLeaf(prevVisibleLeaf);
}
+ if (startOffset < 0 || currentOffset > documentText.length() || currentOffset < startOffset) {
+ Logger.getInstance(getClass()).error("Error while calculating emmet abbreviation. Offset: " + currentOffset + "; Start: " + startOffset,
+ AttachmentFactory.createAttachment(editor.getDocument()));
+ return null;
+ }
String key = computeKey(documentText.subSequence(startOffset, currentOffset));
return !StringUtil.isEmpty(key) && ZenCodingTemplate.checkTemplateKey(key, callback, this) ? key : null;
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/AddOperationNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/AddOperationNode.java
index c63375e..12f2610 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/AddOperationNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/AddOperationNode.java
@@ -65,4 +65,9 @@
public String toString() {
return "+";
}
+
+ @Override
+ public int getApproximateOutputLength(CustomTemplateCallback callback) {
+ return myLeftOperand.getApproximateOutputLength(callback) + myRightOperand.getApproximateOutputLength(callback);
+ }
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ClimbUpOperationNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ClimbUpOperationNode.java
index 1648a36..28cc0a8 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ClimbUpOperationNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ClimbUpOperationNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -71,4 +71,9 @@
public String toString() {
return "^";
}
+
+ @Override
+ public int getApproximateOutputLength(CustomTemplateCallback callback) {
+ return myLeftOperand.getApproximateOutputLength(callback) + myRightOperand.getApproximateOutputLength(callback);
+ }
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/FilterNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/FilterNode.java
index 2de1c99..2ac50c7 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/FilterNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/FilterNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 JetBrains s.r.o.
+ * Copyright 2000-2014 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 @@
import com.intellij.codeInsight.template.CustomTemplateCallback;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.List;
@@ -50,6 +51,11 @@
}
@Override
+ public int getApproximateOutputLength(@Nullable CustomTemplateCallback callback) {
+ return myNode.getApproximateOutputLength(callback);
+ }
+
+ @Override
public String toString() {
return "Filter(" + myFilter + ")";
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/LoremNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/LoremNode.java
index 7beab3c..542af14 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/LoremNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/LoremNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -21,6 +21,7 @@
import com.intellij.codeInsight.template.impl.TemplateImpl;
import com.intellij.openapi.util.Couple;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
@@ -54,6 +55,12 @@
}
@Override
+ public int getApproximateOutputLength(@Nullable CustomTemplateCallback callback) {
+
+ return myWordsCount * 7;
+ }
+
+ @Override
public String toString() {
return "Lorem(" + myWordsCount + ")";
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MoreOperationNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MoreOperationNode.java
index fa80215..0a1bea1 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MoreOperationNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MoreOperationNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -19,6 +19,7 @@
import com.intellij.openapi.util.text.LineTokenizer;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
@@ -49,6 +50,12 @@
return ContainerUtil.newLinkedList(myLeftOperand, myRightOperand);
}
+ @Override
+ public int getApproximateOutputLength(@Nullable CustomTemplateCallback callback) {
+ int mul = myLeftOperand instanceof MulOperationNode ? ((MulOperationNode)myLeftOperand).getRightOperand() : 1;
+ return myLeftOperand.getApproximateOutputLength(callback) + (myRightOperand.getApproximateOutputLength(callback) * mul);
+ }
+
@NotNull
@Override
public List<GenerationNode> expand(int numberInIteration,
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MulOperationNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MulOperationNode.java
index ec9eee1..1934d9e 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MulOperationNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MulOperationNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 JetBrains s.r.o.
+ * Copyright 2000-2014 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 @@
import com.intellij.codeInsight.template.CustomTemplateCallback;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
@@ -55,6 +56,11 @@
}
@Override
+ public int getApproximateOutputLength(@Nullable CustomTemplateCallback callback) {
+ return myLeftOperand.getApproximateOutputLength(callback) * myRightOperand;
+ }
+
+ @Override
public String toString() {
return "*";
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/TemplateNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/TemplateNode.java
index 685f0b3..28871e1 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/TemplateNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/TemplateNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -60,21 +60,19 @@
String templateKey = templateToken.getKey();
if (myGenerator != null && StringUtil.containsChar(templateKey, '$') && callback.findApplicableTemplate(templateKey) == null) {
String newTemplateKey = ZenCodingUtil.replaceMarkers(templateKey, numberInIteration, totalIterations, surroundedText);
- TemplateToken newTemplateToken = new TemplateToken(newTemplateKey,
- templateToken.getAttribute2Value());
-
+ TemplateToken newTemplateToken = new TemplateToken(newTemplateKey, templateToken.getAttribute2Value());
TemplateImpl template = myGenerator.createTemplateByKey(newTemplateKey);
if (template != null) {
template.setDeactivated(true);
newTemplateToken.setTemplate(template, callback);
templateToken = newTemplateToken;
}
- }
+ }
- GenerationNode node = new GenerationNode(templateToken, numberInIteration, totalIterations,
- surroundedText, insertSurroundedTextAtTheEnd, parent);
- return Arrays.asList(node);
-}
+ GenerationNode node = new GenerationNode(templateToken, numberInIteration, totalIterations,
+ surroundedText, insertSurroundedTextAtTheEnd, parent);
+ return Arrays.asList(node);
+ }
@Override
public String toString() {
@@ -85,4 +83,17 @@
}
return "Template(" + result + ")";
}
+
+ @Override
+ public int getApproximateOutputLength(@Nullable CustomTemplateCallback callback) {
+ TemplateImpl template = myTemplateToken.getTemplate();
+ if (template != null) {
+ int result = template.getTemplateText().length();
+ for (Couple<String> attribute : myTemplateToken.getAttribute2Value()) {
+ result += attribute.first.length() + attribute.second.length() + 4; //plus space, eq, quotes
+ }
+ return result;
+ }
+ return 0;
+ }
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/TextNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/TextNode.java
index e47de7a..d619387 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/TextNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/TextNode.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2000-2014 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.codeInsight.template.emmet.nodes;
import com.intellij.codeInsight.template.CustomTemplateCallback;
@@ -6,6 +21,7 @@
import com.intellij.codeInsight.template.emmet.tokens.TextToken;
import com.intellij.codeInsight.template.impl.TemplateImpl;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
@@ -45,6 +61,11 @@
}
@Override
+ public int getApproximateOutputLength(@Nullable CustomTemplateCallback callback) {
+ return myText.length();
+ }
+
+ @Override
public String toString() {
return "Text(" + myText + ")";
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/UnaryMulOperationNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/UnaryMulOperationNode.java
index 78eb446..96e1e2e 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/UnaryMulOperationNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/UnaryMulOperationNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 JetBrains s.r.o.
+ * Copyright 2000-2014 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,6 +18,7 @@
import com.intellij.codeInsight.template.CustomTemplateCallback;
import com.intellij.openapi.util.text.LineTokenizer;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
@@ -43,7 +44,7 @@
CustomTemplateCallback callback,
boolean insertSurroundedTextAtTheEnd, GenerationNode parent) {
if (surroundedText == null) {
- return myOperand.expand(numberInIteration, totalIterations, surroundedText, callback, insertSurroundedTextAtTheEnd, parent);
+ return myOperand.expand(numberInIteration, totalIterations, null, callback, insertSurroundedTextAtTheEnd, parent);
}
String[] lines = LineTokenizer.tokenize(surroundedText, false);
List<GenerationNode> result = new ArrayList<GenerationNode>();
@@ -54,6 +55,11 @@
}
@Override
+ public int getApproximateOutputLength(@Nullable CustomTemplateCallback callback) {
+ return myOperand.getApproximateOutputLength(callback);
+ }
+
+ @Override
public String toString() {
return "*";
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ZenCodingNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ZenCodingNode.java
index 550d05d..d246f40 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ZenCodingNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ZenCodingNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 JetBrains s.r.o.
+ * Copyright 2000-2014 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 @@
import com.intellij.codeInsight.template.CustomTemplateCallback;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
@@ -35,4 +36,6 @@
public List<ZenCodingNode> getChildren() {
return Collections.emptyList();
}
+
+ public abstract int getApproximateOutputLength(@Nullable CustomTemplateCallback callback);
}
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ZenEmptyNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ZenEmptyNode.java
index 9b92681..9282d36 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ZenEmptyNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/ZenEmptyNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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 @@
import com.intellij.codeInsight.template.CustomTemplateCallback;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
@@ -39,6 +40,11 @@
}
@Override
+ public int getApproximateOutputLength(@Nullable CustomTemplateCallback callback) {
+ return 0;
+ }
+
+ @Override
public String toString() {
return "EMPTY_NODE";
}
diff --git a/xml/impl/src/com/intellij/ide/browsers/WebBrowserManager.java b/xml/impl/src/com/intellij/ide/browsers/WebBrowserManager.java
index a2d78cc..ce51ee0 100644
--- a/xml/impl/src/com/intellij/ide/browsers/WebBrowserManager.java
+++ b/xml/impl/src/com/intellij/ide/browsers/WebBrowserManager.java
@@ -17,7 +17,10 @@
import com.intellij.openapi.components.*;
import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.util.*;
+import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
+import com.intellij.openapi.util.JDOMUtil;
+import com.intellij.openapi.util.SimpleModificationTracker;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.SmartList;
import com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters;
@@ -325,15 +328,6 @@
}
@NotNull
- @Deprecated
- /**
- * @deprecated Use {@link #getFirstBrowser(BrowserFamily)}
- */
- public WebBrowser getBrowser(@NotNull BrowserFamily family) {
- return getFirstBrowser(family);
- }
-
- @NotNull
public WebBrowser getFirstBrowser(@NotNull BrowserFamily family) {
for (ConfigurableWebBrowser browser : browsers) {
if (browser.isActive() && family.equals(browser.getFamily())) {
diff --git a/xml/impl/src/com/intellij/ide/browsers/actions/OpenInBrowserBaseGroupAction.java b/xml/impl/src/com/intellij/ide/browsers/actions/OpenInBrowserBaseGroupAction.java
index 5dd70c0..482828c 100644
--- a/xml/impl/src/com/intellij/ide/browsers/actions/OpenInBrowserBaseGroupAction.java
+++ b/xml/impl/src/com/intellij/ide/browsers/actions/OpenInBrowserBaseGroupAction.java
@@ -30,6 +30,7 @@
protected OpenInBrowserBaseGroupAction(boolean popup) {
super(popup);
+
Presentation p = getTemplatePresentation();
p.setText("Open in _Browser");
p.setDescription("Open selected file in browser");
@@ -76,9 +77,10 @@
public OpenInBrowserEditorContextBarGroupAction() {
super(false);
}
- }
- public void update(@NotNull AnActionEvent e) {
- e.getPresentation().setVisible(!ActionGroupUtil.isGroupEmpty(this, e));
+ @Override
+ public void update(@NotNull AnActionEvent e) {
+ e.getPresentation().setVisible(!WebBrowserManager.getInstance().getBrowsers().isEmpty());
+ }
}
}
\ No newline at end of file
diff --git a/xml/impl/src/com/intellij/openapi/options/colors/pages/XMLColorsPage.java b/xml/impl/src/com/intellij/openapi/options/colors/pages/XMLColorsPage.java
index b774c8e..d5a8f7f 100644
--- a/xml/impl/src/com/intellij/openapi/options/colors/pages/XMLColorsPage.java
+++ b/xml/impl/src/com/intellij/openapi/options/colors/pages/XMLColorsPage.java
@@ -84,8 +84,14 @@
" <indexitem text=\"rename\" target=\"refactoring.rename\"/>\n" +
" <indexitem text=\"move\" target=\"refactoring.move\"/>\n" +
" <indexitem text=\"migrate\" target=\"refactoring.migrate\"/>\n" +
- " <indexitem text=\"usage search\" target=\"find.findUsages\"/>\n& ·" +
- " <indexitem text=\"project\" target=\"project.management\"/>" +
+ " <indexitem text=\"usage search\" target=\"find.findUsages\"/>\n" +
+ " <someTextWithEntityRefs>& ·</someTextWithEntityRefs>\n" +
+ " <withCData><![CDATA[\n" +
+ " <object class=\"MyClass\" key=\"constant\">\n" +
+ " </object>\n" +
+ " ]]>\n" +
+ " </withCData>\n" +
+ " <indexitem text=\"project\" target=\"project.management\"/>\n" +
" <<bg><np>pf</np></bg>:foo <bg><np>pf</np></bg>:bar=\"bar\"/>\n" +
"</index>";
}
diff --git a/xml/impl/src/com/intellij/xml/util/UserColorLookup.java b/xml/impl/src/com/intellij/xml/util/UserColorLookup.java
index 46c82f2..ac6f473 100644
--- a/xml/impl/src/com/intellij/xml/util/UserColorLookup.java
+++ b/xml/impl/src/com/intellij/xml/util/UserColorLookup.java
@@ -36,6 +36,7 @@
import org.jetbrains.annotations.Nullable;
import java.awt.*;
+import java.util.List;
/**
* @author maxim
@@ -79,7 +80,7 @@
context.getDocument().deleteString(context.getStartOffset(), context.getTailOffset());
- ColorPickerListener[] listeners = ColorPickerListenerFactory.createListenersFor(element);
+ List<ColorPickerListener> listeners = ColorPickerListenerFactory.createListenersFor(element);
Color color = ColorChooser.chooseColor(WindowManager.getInstance().suggestParentWindow(context.getProject()),
XmlBundle.message("choose.color.dialog.title"), myColorAtCaret, true, listeners, true);