Snapshot 020d29497847701e84e383d965abf543b80758e2 from idea/133.370 of git://git.jetbrains.org/idea/community.git

020d294: platform: incompatible KTerm option stripped
589c8be: ui: correct icon for facet editor panel
00b8db5: skip invalid highlighters (EA-37197) - 8K reports! (cherry picked from commit 3688a79) [r=Peter.Gromov]
663de5b: IDEA-114952 Eclipse code style import: would be nice to remember imported file location (URL fix for Windows) (cherry picked from commit 7f1b705)
fd13ff8: IDEA-116071 (Field can be final inspection change) (cherry picked from commit e1eab58)[CR-IC-3389]
ae3b411: IDEA-116508 ("Local variable or parameter can be final" inspection use generates uncompilable code not extracting a really finalizable variable) (cherry picked from commit 49639e8)[CR-IC-3388]
e31eafc: EA-52123 (IAE: InvertBooleanHandler.invoke) (cherry picked from commit 18e2e69)
b318047: 2x more compact mapping storage for 7bit ascii paths [r=Eugene.Zhuravlev] (cherry picked from commit 2f10822)
42fa68e: IDEA-117378 Privilege escalation via JetBrains products by local attacker (cherry picked from commit 81b56c6)
87e3a49: IDEA-118063 Gradle: cosmetic fix 'Add gradle plugin' action: 'Choose plugin' popup has lots of not clickable links (cherry picked from commit ca4f7bc)
1245a78: IDEA-117792 Gradle Run/Debug Configuration: support adding Gradle specific parameters; review - http://crucible.labs.intellij.net/cru/CR-IC-3727
8558b99: 13.0.2 with EAP
997edcb: no smart icons and no parameter info in power save mode (cherry picked from commit 4bb3242)
bdd56c0: [^jeka] tolerate mysterious groovy class file corruption
a346506: IDEA-118397 Resume build not working (cherry picked from commit ea2b802) +review CR-IC
a659297: IDEA-118245 Retain the last used command line in the Execute Maven Goal dialog (cherry picked from commit 26a7d57) +review CR-IC
a604811: IDEA-118102 Maven: artifacts name not properly generated from pom in IDEA 13 (cherry picked from commit e610603) +review CR-IC
a8ffcf9: IDEA-118053 Editor "deprived of mind" when editing settings.xml (cherry picked from commit ed529d5) +review CR-IC
0e9a065: IDEA-78508 [Maven] Good Code Red with empty variables in classifiers (cherry picked from commit 0831af1) +review CR-IC
cbd34cb: IDEA-116921 Run configuration can't resolve test dependency when "Resolve workspace artifacts" ticked on. (cherry picked from commit d06f31a) +review CR-IC
75e374a: Fix for IDEA-116940 @formatter off still generating braces [CR-IC-3478] (cherry picked from commit 3340beb)
1f6f81f: avoid unconditional trace properly (cherry picked from commit 2e72fcc)
5f45643: Compilation fix
a4749db: IDEA-118292 (process idea.properties in declaration order)
679e1c4: IDEA-118111 (OpenJDK 6 check made strict)
950225b: restore classes in nav bar (IDEA-118168)
cfe1124: NPE
0a41d99: method may be static: process default methods (IDEA-118272)
6ff67d9: redundant cast: ensure that temp variable would have unique name (IDEA-118197)
9549258: distinct prover: distinguish types when type parameter has bounds (IDEA-118037)
0dcb258: show param info: highlight overload vararg method
c40975b: method references: smart completion to filter by return type
319017d: disable lambda completion after inserted qualifier
ed361ec: do not register fixes which need editor in batch mode (IDEA-116248)
30cba59: EA-52652 - NPE:  ExceptionUtil.getUnhandledExceptions
c9199b7: redundant type args: process nested calls (IDEA-117945)
fad3ead: IDEA-117989 JUnit: Run/Debug java test output "scroll to stacktrace" not working as expected
c9d58cc: IDEA-117911 Delegate methods duplicate @Override
35afc12: generate javadoc: search for modules under progress
bf0ec72: IDEA-117883 make <--tooltip end--> logic work in Inspections View; provide additional tooltip bounds
056b529: new inference: propagate outer method to constraints, initial (IDEA-117803)
cd65706: IDEA-117827 Invalid "ambiguous method call" error
8251b5d: IDEA-117780 Bad code is green: non-static class T cannot be referenced from a static context
4a1ae2f: restore suppressions (IDEA-117763)
b7003c6: pull up: ignore conflicts coming from access object when it is also moved (IDEA-117671)
282c332: remember different working dirs for rerun (IDEA-116110)
8224a17: scope to check for cheap search (IDEA-117665)
b2affde: refactoring high level listeners (IDEA-115905)
a2ae64e: NPE
f75829b: extend local scope a set of containing files as visitors expect file level (IDEA-117649)
c72c42f: tests notification: separate not started notification from ignored when no 'not started' tests were detected (IDEA-116825)
5a0aebc: suspicious names: highlight only variable name (IDEA-116475)
62ba24a: disable introduce variable from part of literal expression which is not a string
740bbf2: testng: ignore default annotations attributes (IDEA-117575)
52c384c: add explicit arguments: eliminate wildcards (IDEA-106741)
31e57cc: check lambda return values during constant&conditions (IDEA-117420)
c8ff7ea: javafx: allow to configure custom manifest attributes (IDEA-115252)
99b89cc: IDEA-117314 Can not compile Java project with Eclipse dependencies storage format
528f2d5: introduce variable inside lambda: do not step out of lambda block
48cb2be: IDEA-117252 Extract variable bug
8724806: IDEA-113339 "replace with method reference" ignores side effect of expression: ignore any new expressions in qualifiers
6f6d61b: lambda -> method ref: do not convert if resulted ref would be ambiguous (IDEA-116964)
d9a89a1: EA-52426 - NPE: JavaDocInfoGenerator.generateSuperMethodsSection
df01945: IDEA-118264 Rearrange Entries stopped working in Intellij 13
5e7d560: files compiled on first round may require additional recompilation on the next round (second part for IDEA-116914)  constant search on the IDE side rewritten: only direct dependencies are returned for each search round; all transitive dependencies will be additionally handled by make
4792865: handling cases when added class hides imported class with the same short name (IDEA-116914 Incremental compilation of Java project fails)
e99d464: correct check
ea90776: safely skipping some invalid usages
3a16b61: proper synchronization
0c9c72e: IDEA-117249 Optimize make's constant search algorithm, so that read action is not held for long time
f19231c: do not search usages of removed constant fields in injected PSI
d6ef061: Merge branch '133' of git.labs.intellij.net:idea/community into 133
fa65f8e: IDEA-35996 Ant integration: provide more informative message in case ant file execution is stopped due to unknown command line argument
9519530: IDEA-117904 Ant integration: running: with an error (javac) the result is reported as "successful": perform all status calculations after all messages are processed
5a9f9a8: IDEA-111702 Java Rearranger illegal forward reference on fields rearrangement [CR-IC-3034] (cherry picked from commit 7f01bcd)
a2dd3a6: IDEA-115786 Allow the number of Maven threads to be specified (cherry picked from commit 9d05ff2) +review CR-IC
abfd9a5: IDEA-114418 (Grails SDK of an dependency)  -Dgrails.disable.structure.update=true should work for JDK synchronization. (cherry picked from commit 009ca28) +review CR-IU
491ceb6: IDEA-96723 Java Rearranger deletes blank lines in field declarations (cherry picked from commit 15869e7)
85fe89f: IDEA-118159 "Search Everywhere" inconsistent api on ItemPresentation (cherry picked from commit 9729ea9) [r=Konstantin.Bulenkov]
bcf528b: revert platform fix for PY-6095, apply Python specifix fix instead (cherry picked from commit 0dfae8b)
fec8fe7: IDEA-117864
930439c: cosmetics
6c1df41: IDEA-108838 Wrong code when introducing variable in injection (cherry picked from commit f119c2e)
2a40aeb: Merge remote-tracking branch 'origin/133' into 133
d92cdcc: IDEA-117391 (annotation highlighting fixed)
05a20ae: IDEA-117772 (start application loading in EDT)
ef18d70: DevKit: refine DOM stubs + test (cherry picked from commit 84d8e52)
15d7962: IDEA-117583 DevKit: highlight <idea-version> "min"|"max" as deprecated (cherry picked from commit ce277a1)
be71e9a: cleanup, update "since-build" (cherry picked from commit f56ca26)
e9aa79b: IDEA-117573 DevKit: highlight <vendor> "logo" as obsolete (cherry picked from commit d552ee4)
d5d86be: EA-52563 - assert: ChooseModulesDialog$MyTableCellRenderer$.customizeCellRenderer (cherry picked from commit d24d279)
009d144: CodeInsightTestUtil#doIntentionTest(): remove Throwable declaration (cherry picked from commit d7e8e2a)
e543b44: lazy class loading for PtyProcess (r=Eugene.Zhuravlev), 2 (cherry picked from commit 85700e4)
edd9c56: save / load per project key hash codes (cherry picked from commit c847d67) [r=Eugene.Zhuravlev]
eff72da: avoid garbage creation in JDK7 due to calling StringBuilder.toString() that copies buffer now (cherry picked from commit 03f7413) [r=Peter.Gromov]
40c73d4: no need to create strings of PsiFile's Text when we can avoid it or use charsequence (cherry picked from commit d8ec59b) [r=Peter.Gromov]
10c479c: introduced cvs.roots.refresh.uses.vfs property (true by default) and uses its value to refresh cvs roots after update using vfs to avoid performance problems (IDEA-112132) (cherry picked from commit 1958e9a) [r=Peter.Gromov]
8cac2e5: - detect proper encoding for html5's <meta charset="charsetname"> - [performance fix] avoid (light) parsing of html content if there is no charset\s*= pattern inside the string (cherry picked from commit 2f4be38) [r=Alexey.Kudryavtsev]
cee6644: IDEA-78206 Constructing 'mailto' link -> cannot resolve file 'mailto' (cherry picked from commit 3166c04) [r=Konstantin.Ulitin]
98571ff: Cyclic Expand Word leaves word highlighted (IDEA-115727) (cherry picked from commit 29bb231) [r=Peter.Gromov]
31fe1a1: refixing IDEA-57940 : the variants from other editors are suggested AFTER finishing variants from current file (cherry picked from commit e76fe51) [r=Peter.Gromov]
e3975be: avoid allocating sun.nio.cs.US_ASCII$Decoder when converting byte[] to String
1053bdb: don't create TIntArrayList(DEPTH_LIMIT) before we have clear indication that we might have a loop (parentId >= id) (cherry picked from commit 5478fdf) [r=Alexey.Kudryavtsev]
364e80e: avoid unconditional trace (cherry picked from commit 2e72fcc) [r=Alexey.Kudryavtsev]
70980d8: don't call toString() without need to avoid garbage (cherry picked from commit 75c030c) [r=Alexey.Kudryavtsev]
466dc64: Apply again "update stubs per filetype  reverted for 133 branch"
3f66295: Apply again "IDEA-113684 Soft wraps insert additional spaces"
028b3ae: Darcula: combobox as cell renderer/editor fixes
e96975a: fix default size of SourceMapInspector window (cherry picked from commit a64047e)
edfb4da: if IDEA sees text/plain and extension .java, perhaps it should infer that it's actually Java, because not everyone will set up their HTTP servers with language-specific mime types? (Particularly when following a URL to a source file in a sourcemap.) +review (cherry picked from commit 5ea95e3)
6162222: fix ClassCastException: com.intellij.openapi.fileEditor.FileEditorState$1 cannot be cast to com.intellij.openapi.fileEditor.impl.text.TextEditorState (cherry picked from commit 44f0697)
6c8dbc0: update progress on test done (finished, failed, or ignored), not on test started (cherry picked from commit dbcb907)
a4038dd: REGISTERED state added (cherry picked from commit 08677f9)
bf0da3a: fix PersistenceRenameTest blinking: inconsistent @NameValue placement and random methods order in DomGenericInfo
1f08879: PsiBuilder/GPUB: zero-length token parsing support (lexer-based macros)
352056d: EA-52484 - IOOBE: ConsoleHistoryModel.getHistoryPrev
21ab06f: EA-52027 - assert: TextRange.<init>
b452663: IDEA-116383 cannot reconnect Some RuntimeException contains not serializable class 'org.apache.maven.model.building.DefaultModelProblem'. So IDEA throw java.rmi.UnmarshalException  caused by java.io.NotSerializableException. (cherry picked from commit 9f7fb6c) +review CR-IC
a4e9447: Revert "IDEA-113684 Soft wraps insert additional spaces"
231adec: Revert "update stubs per filetype  reverted for 133 branch"
d62a526: use method instead of manual hack
cae16e2: better combobox rendering on aqua: no focus ring around combo button, fixed 1px size difference
7d9b58c: fix TextFieldWithHistory rendering on mac
95d40df: determine tag end by doctype #WEB-2229 fixed
556c3bc: lazy class loading for PtyProcess (r=Eugene.Zhuravlev) (cherry picked from commit 96c8bca)
749d89f: RUBY-14672: better name for gracefulProcessTermination() (reviewed by Dennis Ushakov and Sergey Simonchik ) (cherry picked from commit 908538b)
dd5dd11: RUBY-14672: we need to send SIGINT to Ruby debugger twice (reviewed by Dennis Ushakov and Sergey Simonchik ) (cherry picked from commit 4546732)
3c01a72: Merge remote-tracking branch 'origin/133' into 133
6378e77: [git] IDEA-118265 Fix showing Git Branches menu
b9446e2: close process's input stream after process termination (cherry picked from commit e962648) CR-WS-272
c8fbe68: support Windows soft kills using runnerw.exe in KillableColoredProcessHandler (cherry picked from commit 77e0f1a) CR-IC-3459
988c990: fix showValuePopup — incorrect scrolling (cherry picked from commit 594785c)
1f67166: IDEA-105450 Attribute id in OSGI reference element not allowed: XmlHighlightingTest.testXhtmlSchemaHighlighting fixed (cherry picked from commit 69daed6)
eb3a323: IDEA-105450 Attribute id in OSGI reference element not allowed: get schemaLocation from import tag (cherry picked from commit ec44bbd)
8bb9587: IDEA-105450 Attribute id in OSGI reference element not allowed: namespaces from standard resources should be considered relevant (cherry picked from commit d30684d)
a129c6c: IDEA-84166 Support "CTRL+H" on class in .xml file (cherry picked from commit da3cbf3)
7162d4b: update stubs per filetype  reverted for 133 branch
377bf70: IDEA-113684 Soft wraps insert additional spaces (cherry picked from commit 0e1c820)
643cd5d: use direct call to storage.resize() so that IOException is not masked with RuntimeException (IDEA-118107)
2e7c85f: Plugin for IDEA 133.286 3.0.1 EAP CE
f75f35e: Merge branch '133' of git.labs.intellij.net:idea/community into 133
9186d35: PyCharm 3.1
58936a1: add create method
ecf556d: do nothing if state didn't change
dcfbfb5: IDEA-115859 Presentation mode is broken
1d6443d: Javascript tests fixed, IDEA-113977 Formatter: caret is moved on next line if closing brace has wrong indent  [CR-IC-3034] (cherry picked from commit dd55e70)
b75041b: Merge branch '133' of git.labs.intellij.net:idea/community into 133
2a74e83: Pty lib updated - run in console mode.
390900e: Guava and Pty4J libraries dependencies.
10a39d8: Contains in branches feature implemented for mercurial log.
37a14b0: Added logging.
9355a2b: improved user experience with run configuration producers
78e57f9: Better multiline code handling in console.
fc7702f: Correct test data path.
6bba62d: Detect SQL fragments only in the beginning of string literals
ba5ff19: Fixed LiteralTextEscaper.getOffsetInHost() for partial ranges inside host that contain escapes
df0c579: Added caching of decoded fragments of string literals
f93a871: Fixed detecting file references in Python strings without delimiters
01bf006: Removed unused PyStringLiteralExpression.iterateCharacterRanges()
147ed7a: Switched to new string value iteration in Python file references inside string literals
f8e775c: Use Pair instead of a custom class
0106a10: Switched to new string value iteration in Python spellchecker
69ac8c5: Added PyStringLiteralExpression.getDecodedFragments()
d703ca5: reverted module type from plugin_module to java_module for localization and rest
2cb9a61: fixed tests since we don't propose to make static decorated method
d6ed1d7: fixed PY-10998 Wrong highlight in rst (restructured texts) for headlines
5511e2f: Fix NPE.
9f0c134: Don't break compatibility (PY-11499).
f80fc2e: fixed PY-11500 False positive in method may be static inspection for decorated methods
0bfaaf2: fixed PY-2984 Surround with try/except reformats entire file
0ed12da: args can be immutable (PY-11465).
1bb8318: fixed PY-11435 Can't run script by context menu action if it has method named test
0336898: Fixed detection of the largest string literal for right parts of '%' operator
cb5714e: fixed PY-11452 tcunittest errors with single-character failure message
2503a60: fixed test data
16aa28c: fixed PY-11476 No error given for mismatched accolade and squarebracket
403b937: Allow to run processes with PTY.
4740054: Added comment-based language injector for Python
f56fecc: fixed tests
45a824c: Fixed un-inject language availability for temporary Python injections
ea707eb: Method renamed.
4b349d3: Extracted PyInjectionBase.registerInjection
909a31d: Don't inject any language into percent-based Python formatting even without formatting operator (PY-10771)
b928248: Fixed SQL select IntelliLang pattern (PY-10926)
55239bf: If command executed but is incomplete and more lines are needed prompt shouldn't be changed to ordinary one in this case.
a061c7e: Fix modified console options modified after creation.
52b6eb3: Jython doesn't support 'exec' symbol in interactive console.
1213be2: PyConsole: correctly indent after execution of incomplete multi-line string.
38b4e20: Fixed execution of incomplete multiline code fragments.
5306cfb: First evaluate more then add to queue.
4f18cfe: Simplified.
9688ef7: Attribute renamed.
10a0e30: NotNull annotation.
5e5c546: Fixed IPython and debug console broken by console execution model changes.
e53607e: Fixed write lock assertion.
78ea78d: Execute multi-line code fragments by runsrouce with 'exec' option instead of one line by one (PY-10769).
0dcf990: Cleanup.
9f4dca96: Broken indentetion in console fixed (PY-10776).
3c4550e: Fixed saving of env in console settings. Mappings format saving changed.
699255f: Fixed working directory setting in console settings.
9b98ce9: Fixed saving path mappings in console settings (PY-9855).
14fbafd: Don't ask to reconnect remote interpreter in case of fail as it never helps but causes problems (PY-10590).
f8a096a: Support for temporary and configuration-based IntelliLang injections in Python (PY-10983, PY-10721)
5def9d3: fixed http://youtrack.jetbrains.com/issue/PY-2953
e6a24df: fixed PY-11394 "no tests were found" with django 1.6 DiscoverRunner
1fb4a8a: used consistent name prefix
923f8c0: fixed PY-11415 GAE: Lazy Handler reference is not updated when moving to other module
0a3c840: fixed PY-9967 App Engine: do not resolve to installed to interpreter library
ea42fbf: [log] Fix showing dot in the root table header
decac91: [log] Fix background of the details panel content (cherry picked from commit 2ad2cba)
224a2be: [log] fix name of variable
f79c2e4: [log] IDEA-115675 IDEA-116040 Fix table columns sizing
668c021: [log] IDEA-117500 Don't repaint branches panel on every updateUI
ed4a8ca: [log] IDEA-117500 Optimize grouping of branch references
a98e6c8: [git] Don't modify the unmodifiable collection (cherry picked from commit 007dc0d)
9321b17: [git] IDEA-117500 Don't copy, just wrap in unmodifiable
f3cd826: [git] remove unused method
d7db0fc: [log] Separate loading indicator for "Contained in branches"
ab8606f: [log] Fix "Containing branches" for filtered list & for Mercurial
c190668: [git] Move & rename method to get branches to GitBranchUtil for reuse (cherry picked from commit f78700e)
0ae4458: [git] Simplify method to get branches: use branch names.
423dbc6: IDEA-117936 IDEA13 fails to stop at breakpoint inside advised method
4587a46: IDEA-117613 Gradle: tool window is missing after the update, safe check for newly created project added
18e44f3: IDEA-117613 Gradle: tool window is missing after the update review: http://crucible.labs.intellij.net/cru/CR-IC-3629
b9b4c6c: fixed IDEA-111701 Emacs: pressing Ctrl+k several times should add lines to muti-line buffer (regression for IDEA-18764, broken in IDEA-111275)
a843386: we must not use getKnownFileTypeOrAssociate on navigate (cherry picked from commit 476b30d)
cf363b6: fix actionSystem.fixLostTyping.description (cherry picked from commit caf3ece) CR-IC-3481
4dfe767: IDEA-117548 Bad function parameters highlight (cherry picked from commit d4507c9)
b83ac23: fix assertion (cherry picked from commit 5743c3c)
f7e5eeb: WEB-10231 first navigation to http file doesn't open desired location (cherry picked from commit 384f8f9)
fe39b87: wait smart mode checks for isReadAccessAllowed too, so, we must not call it (cherry picked from commit a5dd92c)
f4c9d17: optimization — check isEmpty (cherry picked from commit 44727c2)
cd8fb58: VmFileEditor — prepare to fix postponed navigation problem in our HTTP file editor. VmFileEditor supports postponed navigation. (cherry picked from commit db4ca37)
c669320: "Run in background" option from now on means "show build messages immediately" rather than "execute with modal dialog"
d83aedd: don't generate large substrings when creating CompletionResultSet [r=Peter.Gromov]
87ad24b: 13.0.1
14361cd: avoid easy garbage java.util.ArrayList$Itr: 1,720,417,512 (1%) bytes in 71,684,063 (2%) objects (avg size 24 bytes) 	java.util.ArrayList.iterator: 1,720,392,864 (99%) bytes in 71,683,036 (99%) objects 		com.intellij.openapi.projectRoots.impl.ProjectJdkTableImpl.findJdk: 938,831,640 (54%) bytes in 39,117,985 (54%) objects 		com.intellij.openapi.editor.impl.ComplementaryFontsRegistry.getFontAbleToDisplay: 218,420,520 (12%) bytes in 9,100,855 (12%) objects (cherry picked from commit 9207b87) [r=Peter.Gromov]
41efe97: look for xml properties in files with xml file type only (cherry picked from commit b6ae811) [r=Dmitry.Avdeev]
ea2590e: WEB-10191 Weird field in the Configure NodeJS Modules Sources (cherry picked from commit 0f61ced) http://crucible.labs.intellij.net/cru/CR-IC-3556
a2b39c2: Gradle: fix dependencies scope merge IDEA-117556 Gradle custom provided configuration added with compile scope IDEA-117601 Gradle integration ignores scopes.TEST.plus in build.gradle (cherry picked from commit f80d692) Safe hotfix, the code works in a separate process (in gradle daemon, not in IDE process)
ce53010: External system: build files modification triggers threads continuously if "auto-import" feature enabled review- http://crucible.labs.intellij.net/cru/CR-IC-3533
4d9ae0c: Gradle: fix dependency scope merge to respect artifact classifier option related bug - IDEA-117627 Transitive dependencies missing from imported Gradle project Safe hotfix, the code works in a separate process (in gradle daemon, mot in IDE process)
d9c3f83: IDEA-117669 gradle multi-module project executing subtask uses wrong gradle version review - http://crucible.labs.intellij.net/cru/CR-IC-3564
87819e2: Gradle: IDEA-116880 Intellij 13 doesn't auto-save files before Gradle task (cherry picked from commit e5c53c6)
5b87b39: Gradle: fix MultipleRepositoryUrlsInspection to operate on gradle-relevant files only (cherry picked from commit 95fbdc9)
1c2f07c: IDEA-117432 Do not fail while resolving client factory for upgrade if "other factory" is configured incorrectly (cherry picked from commit 0694e5d)
d11b435: IDEA-117432 Do not fail while resolving client factory for checkout if "other factory" is configured incorrectly (cherry picked from commit 6242d70)
db15422: Branch information checks moved to appropriated separated methods. (cherry picked from commit 9492982)
6f85df3: Method name simplified (cherry picked from commit 0924c2b)
16e2328: IDEA-115906 Throwable ; IDEA-117401 IAE fixed
eedd7fe: HEAD branch filter in new log fixed (cherry picked from commit 7793e6f)
a787eb2: VcsRootDetector and NotifierError tests fixed (there were .git in T ot tmp dir above, so appropriate checker found its root,then error)
ddc643d: remove outdated and buggy (in case of library code) property java.debugger.xBreakpoint.onlyIfHasFacets (cherry picked from commit 5b7f60f)
ab9cce8: CR-IC-3511 CFR-63806 (cherry picked from commit e800ade)
d3e739f: introduce newUrl (cherry picked from commit bb94f47)
5009fbf: VisualizeScriptSourcemap action (cherry picked from commit 2694a1f)
2051c1e: cleanup (cherry picked from commit 30d4cdf)
586ef62: Merge remote-tracking branch 'origin/133' into 133
3a93fee: rollback IDEA-117378. It will be available in 13.0.2
d72ed2a: IDEA-117227 load imports from stubs [^Peter]
5568b0d: Groovy: injection in command expression [^Peter]
b0ef47e: IDEA-117389 Groovy: Introduce constant from string part [^Peter]
7076f89: IDEA-117227 stubs for Groovy imports [^Peter]
605a0a9: IDEA-117390 'IntelliJIdeaRulezzz' in Code Completion [^peter]
ac4417e: fix testdata
8607b4d: IDEA-116547 optimization in reassigned vars check [^peter]
1e7c610: WEB-10019 Don't show emmet preview after simply dot (cherry picked from commit 127560f)
4b36aad: WEB-9986 CSS: fuzzy search shows turned off abbreviations (cherry picked from commit 56e0385)
4b4958e: WEB-10017 New "Surround with emmet" popup breaks usability (cherry picked from commit 8bdc013)
0bd5b71: automatically starts rebuild if java builder caches are corrupted (IDEA-117024) [rev by Jeka]
f536c49: Merge remote-tracking branch 'origin/133' into 133
81b56c6: IDEA-117378 Privilege escalation via JetBrains products by local attacker
633cd5e: a temporary workaround for HiDPI on Windows/Linux
b7a8a38: Local VCS tests quick fix (ignore temp. FS)
eecd3d1: make history almost unlimited
72de836: no delay after tab or escape
96b5a46: re-create components on every call (laf change fix)
9aa347b: Extracted Python path walking and fixed broken symlink check (PY-10534)
66b3393: differentiate between Sun and Oracle VMs
6b27a51: fixed silent installation mode.
0e4a0fc: IDEA-117378 Privilege escalation via JetBrains products by local attacker IDEA-113862 Confusing Run as dialog
a7300cd: [^maxim] FrequentEventDetector: log outside of synchronized (IDEA-117426)
9d0b588: [^nik] GroovyHotSwapper: use FileTypeIndex
3228a63: [^nik] cache GroovyHotSwapper.containsGroovyClasses (IDEA-116851)
57ff2da: IDEA-103199 Undo: UTF problem (after-review improvements) (cherry picked from commit 0a0aecf)
75ed596: IDEA-103199 Undo: UTF problem (cherry picked from commit ea49ecf)
0a705a8: correct definition of "oracle vm" for java 6
7464e2f: can not clear JarFileHandler caches (e.g. on JDK 7) -> no logging (cherry picked from commit 5012a9b) [r=Alexey.Kudryavtsev]
299f014: IDEA-117498 Caret locks up after using ctrl+tab to switch editors [r=Peter.Gromov] (cherry picked from commit 38f2f05)
99b71dc: IDEA-117494 133.193: Importing grails modules not labeled as grails enabled +review CR-IU (cherry picked from commit 588cd01) reviewer: Peter Gromov
48ce506: do not auto-switch current suspend context if a new thread with suspenPolicy=thread hits a breakpoint (IDEA-116160)
64dc9f5: CR-IC-3489 restore old API
f1dcd4c: Merge remote-tracking branch 'origin/133' into 133
4b41e83: [log] IDEA-117365 Expect "empty" git tag; protect against errors
725c360: [log] Register disposable right away, not after initialization (cherry picked from commit 1e48680)
265d0df: EA-51913 - assert: DomNamespaceKeyIndex.hasStubElementsWithNamespaceKey (cherry picked from commit 6763822) CR-IC-3472
42ecb1a: CR-IC-3471 (cherry picked from commit b213f10)
89ee113: finalize consts (cherry picked from commit 73b245e)
d033d07: gwt, ability to debug — one idea module to many gwt modules (cherry picked from commit 8086f92)
056f905: NullFileEditorState +review (cherry picked from commit 561c8d1)
ca7af60: overrides (cherry picked from commit aaa236a)
4f2af9c: CR-IU-366 (cherry picked from commit 40ae21d)
c8c0d46: Problem — we use short gwt module name (Hello) instead of output name (hello, rename-to specified in Hello.gwt.xml). 1) if rename-to specified, url will be http://localhost:9876/sourcemaps/{rename-to} rename-to=“hello” => http://localhost:9876/sourcemaps/hello 2) if rename-to is not specified, url will be http://localhost:9876/sourcemaps/{qualified name} com.google.gwt.sample.hello.Hello => http://localhost:9876/sourcemaps/com.google.gwt.sample.hello.Hello
40f41b5: IDEA-116260 ISE: RPC handler object "AddOnlineUser" not found at com.intellij.ide.XmlRpcServerImpl.process (cherry picked from commit 5aa9b8e)
3265387: enable all lafs by passing a special registry key
bf2b0c6: Rename "Java" -> "JVMOptions" so MacOS doesn't require java 1.6 download from Apple.
c825894: [log] Make fields volatile
3cc0a09: [git] IDEA-116690 Fix "Select in Git Log" from File History
8b85de3: fixing IDEA-117328 java.lang.NoSuchMethodError: com.sun.tools.javac.util.Paths.clearPathExistanceCache()
7e1850e: Merge remote-tracking branch 'origin/133' into 133
f2aed4c: IDEA-117347 Search Everywhere popup is too wide
3675b82: merging ConcurrentMapFactory and ContainerUtil
98ef79b: fix Url equality (scheme) (cherry picked from commit e668634)
290e4a4: fix NPE — url could be in any form, so, parsed can be null (cherry picked from commit ec22c2e)
f90eaba: allow V8 map on IBM JDK 1.7
845ffae: do not disable "ext.dirs" location, because IBM jdk stores some of its essential jars there
5278615: EA-52516 - IAE: HighlightUsagesHandlerBase.addOccurrence
cae4139: EA-52505 - NPE: MethodCandidateInfo.getPertinentApplicabilityLevel
9b6b81e: default concurrency level upper limit
91cefef: encapsulation of factory's implementation details
1081168: IDEA-117298 Darcula&IntelliJ on Windows: Inspection description is too small in Settings
7799dc3: IDEA-117095 Goto File: checkbox 'include non-project files' is remembered between invocations [r=Anna.Kozlova] (cherry picked from commit 7cf6caa)
8eecc0f: all code in "util" module to create CHM implementation via dedicated factory (see IDEA-116404 Java code compilation does not work with IBM JDK)
81ae633: [Filechooser sheets] IDEA-102449 Mac OS + JDK 1.7: dialog sheets go to background if focus is moved from IDEA and then back
ea058b0: fix NPEs
8fbca43: Remove broken dependency on 'markdownj' from tasks-core module
5c1098b: IDEA-117258 IntelliJ theme: selected tabs in Debugger and in Run <application server> views get black color
5e02eb3: IDEA-116558 Update state transition requests for JIRA REST API 2
c2f531a: "read access" assertion and NPE fixes
ea4f96b: fix "read access" assertion
787438f: IDEA-117265 java.lang.ClassCastException: com.intellij.psi.impl.source.tree.java.PsiParenthesizedExpressionImpl cannot be cast to com.intellij.psi.PsiCallExpression
99ae1f5: NPE on invalid expressions
ffc7fa5: IDEA-115953 Editor: Line Spacing < 1.0 no longer works (reviewed by Roman Shevchenko)
886b675: External system: add support for different naming of external entities within IDEA models. E.g. external lib name: 'somelib' -> IDEA lib name: 'Gradle: somelib'. external module name: 'some/module' -> IDEA module name: 'some_module'. (cherry picked from commit bb941b0)
0634d95: enable abbreviations (cherry picked from commit 0ecc836)
1dc77a9: more searchable options
31750db: fix history and symbols 'More' action
bc4db67: Merge remote-tracking branch 'origin/133' into 133
84f584a4: add new actions
5a49390: change action place to Main Menu
4a50f96: don't use smart search for files (don't use space as a separator)
93dd505: ready to nulls (EA-52470 - IAE: TypeCompatibilityConstraint.<init>)
174531a: EA-52436 - IAE: PsiElementFactoryImpl.createType
e58f16d: IDEA-115412 Diff window is minimized  after the appearance (cherry picked from commit b2307d0)
8146462: IDEA-117059 (error reporting in updater fixed)
be1c105: NPE in mouse handler
a460658: IDEA-111388 Built-in server not "available external" — it is unclear that port number must be also changed (cherry picked from commit 6ccdae5)
dfdaaae: continue WEB-9968 Dart: ClassCastException when debugging web application in Dartium (cherry picked from commit c19e163)
ee28c75: newHttpUrl — authority must be NotNull (cherry picked from commit a708a6e)
01efd39: NetUtils.tryToFindAvailableSocketPort (cherry picked from commit fa39c70)
ca466c8: introduce Urls.newUri, prepare to fix WEB-9968 Dart: ClassCastException when debugging web application in Dartium (cherry picked from commit 4ecac7f)
e6b739a: IDEA-117059 (same temp. directory for updater)
2679834: introduced idea.register.bundled.fonts registry to be able to switch off bundled fonts registration in order to avoid garbled text in editor (IDEA-93404) [r=Konstantin.Bulenkov] (cherry picked from commit e2cdb6d)
16eb783: fix null project
05de913: report missing optimizedFileManager only once
1b747fe: correct place for optimizedFileManager.jar
4713bfc: Merge branch '133' of git.labs.intellij.net:idea/community into 133
c2c0281: Jediterm updated.
26cf0f4: Mouse selection should always work in Terminal (IDEA-117210).
1f68d01: reconfigure navbar toolbar actions
1ae092c: show separators in navbar toolbar
afcfe95: Setup composite as it is done in EditorImpl.paintComponent.
66f161d: Behave the same as EditorImpl.
013c138: Use Source Code Pro as we don't have problems with unprintable pseudo-graphics as we iterate fonts to find suitable one for unprintable characters.
9796737: special icon for generated test root [rev by Peter]
2398eb9: make adapt_builder_() overridable (initState -> public)
2ef1c62: [git] Quick-fix for IDEA-115581: don't fail, just skip such hashes
1578562: [vcs] IDEA-109608 Apply patch: Fix path detection for new files + test
080813c: update Source Code Pro to version 17
f9c2953: IDEA-117211 empty elements in Search Everywhere
32ebdf3: error reporting in 'Project Structure' dialog: merge UI updates (IDEA-116808, IDEA-110799) [rev by Maxim M.]
2bab20f: added quick-fix to delete all unused libraries (IDEA-99885) [rev by Maxim M.]
f069657: disable GroovyShell because it doesn't work on win {^Peter]
637a5ba: Merge branch '133' of git.labs.intellij.net:idea/community into 133
dd8e18a: moved to core-impl
47f94f0: IDEA-104734 Dracula: Cannot see well active tab in Modules Settings
e2c1637: removed LOG.error for null syntax highlighter (cherry picked from commit 3e4c22c) [r=Peter.Gromov]
d4240b2: check that index for which indexUnsavedDocument is performed can be applied to given file type (EA-47740) [r=Eugene.Zhuravlev] (cherry picked from commit 0057f81)
acede1f: Merge branch '133' of git.labs.intellij.net:idea/community into 133
5ffb206: PsiSearchHelper changes cherry-picked (r:Peter)
1669188: avoid blocking runReadAction in debug logging
ba70dd4: Minor typo fix (IDEA-116432 Incorrect Spelling of Eclipse) (cherry picked from commit 3c553d6)
aadedc9: IDEA-117192 NavBar popup shows in wrong place when navigating to the directory from popup
c3b6615: Merge remote-tracking branch 'origin/133' into 133
a915da31: Merge remote-tracking branch 'origin/133' into 133
9a90c16: IDEA-116866 (path overriding for plugins/log dirs fixed once again)
bc3d847: Merge remote-tracking branch 'origin/133' into 133
6081b4f: removed signing for CE launchers.
21cd0c7: tuned UI for got it button
f986c7c: method refs: do not choose more specific method between methods with different number of params
aa7db43: IDEA-116756 Gradle multi-module project with deep-nested modules - idea places iml file in the wrong directory (cherry picked from commit 8e2ad06)
3bd2a55: plugin advertiser: ensure that older plugins won't be ever suggested
f739564: plugins advertise: download plugin if it was not explicitly disabled (IDEA-117003)
df398a9: plugins advertiser: provide loading plugin version for renderer
751d401: CCE (IDEA-117119)
03b253b: lambda: do not distinguish between ellipsis and arrays for formal lambda params checks (IDEA-117124)
ca191c9: index property optimization [^Peter]
4f7ba3a: class searching optimization [^Peter]
4e7ff49: IDEA-116628 No nulls in type parameters [^Peter]
a30f59b: typo [^Peter]
580cb5e: Merge branch '133' of git.labs.intellij.net:idea/community into 133
9c2489a: Take default shell from env variable.
9b2b7f3: File chooser for shell path (PY-11334).
9758753: Take shell path setting before every process creation.
3dbe4eb: use the same background color
8b8c0df: set lower limit of 1 for max_worker_threads_count (for low-profile cpu)
2a67fed: test for unzipping malformed zip archive (cherry picked from commit cd35a94) CR-WS-267
2c74d46: target error message for a newly created project (cherry picked from commit 8e10c3a) CR-WS-267
41311ea: use ZipFile, because it throws exception for a malformed zip archive (cherry picked from commit 02da50f) CR-WS-267
323523c: make IntelliJ laf by default on Linux
9d74b04: update artwork for version 13
d7ce47d: add history
42733a8: utility class holding two colors for gradient painting
537dd04: better colors? fix balloon and popup borders
787ec72: added signing for community launchers in zip distr.
f577493: use backported V8 CHM only for Oracle or Apple JDK (IDEA-116404 Java code compilation does not work with IBM JDK)
ae19efc: isEap = false, no error reporting
7e1f100: ~update mockJDK-1.7 used classes to be at least from jdk 1.5
c812622: do not create raw outer types during diamond inference
d0bc4ad: Merge branch '133' of git.labs.intellij.net:idea/community into 133
b6fe06f: FinderRecursivePanel: do not perform getListItems() in EDT on update (cherry picked from commit a128fa5) CR-IC-3413
e189085: IDEA-116866 (path overriding for plugins/log dirs fixed)
c50b1f1: Cleanup (punctuation)
cf75962: External System: support for multiple tasks execution added (cherry picked from commit a6f9141)
60418e9: IDEA-100294 Cannot edit a file - text jumps all over the screen (cherry picked from commit 36bacc0) [cdr]
3da28ad: Merge remote-tracking branch 'origin/133' into 133
86b3924: mock 1.8 jdk
ae8c2b0: switching to java.util.ConcurrentHashMap in jps code; eliminate unneeded map queries
f3d2761: EA-52322 (diagnostic)
f0d71c1: copyright: fix for 2 open projects
e797eb4: javadoc: keep whitespaces in {@code} tags (IDEA-109997) (cherry picked from commit d08af6dfed35217f3bb03093e8c549ec3065d258)
aa52879: IDEA-117082 Anonymous class assigned to final field (cherry picked from commit 02cabc4e849835259d9d837f86493c5e4ff7269c)
c040d2f: junit: do not reuse directory configuration from another test root (IDEA-116871) (cherry picked from commit 354fece7efab569fa05b135ab912bee758a6d3f7)
99043c6: junit: do not create directory configuration when selection is not under test root, e.g. module content root (IDEA-116871) (cherry picked from commit effc865ab3bff89d4651054569ef7ac4f86d7b33)
f8ff71b: product name -> full product name (IDEA-117070) (cherry picked from commit 2b4dc107514b4bd13ec4dced1144c81de79a0bb7)
d60166d: plugins advertiser: ensure that all installed plugins would be enabled - check also unknown plugins (IDEA-117068) (cherry picked from commit 99ffd837ba1ec2523ae8c4faa2060c84b5941986)
b3ed3c2: plugins advertiser: do not suggest to update to ultimate on implicitly disabled plugins (IDEA-117040) (cherry picked from commit e5452974f1a45693dd8ddb967525d37cd54f3ba4)
61ebb02: IDEA-116991 "IDE is up to date" message (cherry picked from commit 094ac76636050b6f0796c9802342cb3d431eeab0)
a4dc3a5: lambda: process lambda as parameter for anonymous class (IDEA-116987) (cherry picked from commit bf64625fb2e79f29f924d47fb68ec55d7c46d954)
7be1ec1: IDEA-117071 (language level in decompiled .class files)
5e5d914: relative path - special url, encoding is not required (cherry picked from commit 58704c7)
7f786c5: cleanup (cherry picked from commit 3868464)
208311d: cleanup (cherry picked from commit d58146c)
53f1175: CR-IC-3246 (cherry picked from commit 5d6a0c8)
a186992: CR-IC-3246 (cherry picked from commit 51864f4)
04cd96d: open in browser — choose url, show full url, not only path (decoded form with parameters) (cherry picked from commit b3fff55)
bb59091: WeightBasedComparator — string natural compare (cherry picked from commit 86971b9)
52c78b1: overrides (cherry picked from commit 716766a)
5b53293: Urls.newFromIdea returns not-null (cherry picked from commit f47f98a)
fde95ae: move Url to platform - avoid raw string (cherry picked from commit d4e4a40)
7dabf92: UriUtil.trimLastSlash refine Url nullability (newFromIdea is not yet done) (cherry picked from commit 9b8aac5)
e1bcebb: CR-IC-2986 (cherry picked from commit 34ef731)
6a65720: cleanup (cherry picked from commit e50df4c)
60e168b: CR-IC-2986 MessageBuilder -> MessageDialogBuilder (cherry picked from commit 1999b51)
be3b2ec: some memory tune-ups
cfbafa0: IDEA-117077 Can't remove files from Recent Files
3f42891: EA-52338 - assert: ComponentManagerImpl.getComponent (cherry picked from commit 7c076b6)
58bc683: IDEA-117030 Groovy/Gradle frequent, severe hangs (cherry picked from commit aadeb26)
0ef7db2: IDEA-117073 Recent files and Switcher are not centred in ide window
4a2dde3: file watchers tips should be in WS only
39ee2d2: update complete statement tips
292b280: remove image tag
bffe81e: missed images
b975e7d: Add missing module definition.
3cd9608: Add license for "aether-api-0.9.0.M2.jar" (cherry picked from commit 0df2a18)
d63a566: IDEA-116452 "Resolve workspace artifacts" option doesn't work with Maven 3.1.x (cherry picked from commit 8c35e68)
9103476: Enter in SE should close popup if selection is a setting
4f37f20:  button placed on top, should be in the middle
6c28556: [log] IDEA-116399 Fix filter by branch
7684e66: IDEA-116881 Please time stamp gradle tasks (cherry picked from commit 79c4e6e)
db139a1: IDEA-116891 gradle import creates a lot of extra empty directories (cherry picked from commit 9732da7)
9ed8e39: WEB-9933 What should happen when creating node.js Express App as New Module? (cherry picked from commit a0c7d51) CR-WS-262
2e2fd29: IDEA-116891 gradle import creates a lot of extra empty directories (cherry picked from commit ca7e083)
5902fb8: IDEA-116974 Gradle Plugin doesn't handle 'providedCompile' dependencies in 'war' projects correctly (cherry picked from commit d3f9d06)
0e97c89: Merge remote-tracking branch 'origin/133' into 133
5be1c50: IDEA-115546 Full Screen Mode: main menu persists on screen, when invoked by the keyboard shortcut(reviewed by kb)
4055528: IDEA-111161 Flat tool window design PATCH(reviewed by kb)
17913b8: Lens pixel hunting (reviewed by kb)
38dd8e8: select correct shell runner in title [^Peter]
57befaf: IDEA-116917 check for jansi in classpath [^Peter]
93e3010: IDEA-66494 Switching between search and replace (cherry picked from commit d7dc6ca) [r=Peter.Gromov]
45d852b: IDEA-66494 Switching between search and replace (cherry picked from commit d7dc6ca) [r=Peter.Gromov]
7673aeb: IDEA-116952 IntelliJ LAF issue (set label.disabledForeground to 999999)
56d2cb6: IDEA-116911 Speed search: wrong background in recent files
6ecd960: IDEA-115577 Commit Changes: keyboard shortcut for Commit Message History does not work
27aa855: IDEA-115708 Add workaround by setting global SSLContext (cherry picked from commit fc3f452bbbef193a3ebf6fd28d7e0bffb14a9a5a)
7c3e066: get rid of invoke later [^Peter]
3f10d5b: special icon for 'generated source' roots: added file forgotten by first cherry-pick (cherry picked from commit 35806f22)
6f3780e: grayed text is invisible on Linux
f64ba46: menu is not visible on Linux + IntelliJ theme
e7f0816: [vcs] IDEA-115571 Don't clean change lists's commit message until committed
f0226f9: [log] Make "show details" & "show long edges" actions dumb aware (cherry picked from commit 726ffc1)
8ca08ac: [log] IDEA-116950 Draw just "tag +" instead of "tag + 5 more" (cherry picked from commit 49a033a)
976a8ef: [log] IDEA-116950 Don't display all tags if there are too many of them
4a1db8f: [log] Refactor: move ref painter & drawRefs & calc refs padding to the common parent class (cherry picked from commit 3bb3524)
5dd3597: IDEA-113730 Implemented "cat" command to read content as binary data (not to read as text data and then convert to bytes using some encoding) (cherry picked from commit efd5985)
4201c87: update tips
5c4c6e0: special icon for 'generated source' roots [rev by Peter] (cherry picked from commit 35806f2)
fcc237f: [^nicity] fix outdated javadoc (completion is performed in a read action) (cherry picked from commit d4e5553)
0f918a9: [^nicity] support hippie completion at the file start (EA-52100) (cherry picked from commit 3334c0b)
41b5038: IDEA-102449 Mac OS + JDK 1.7: dialog sheets go to background if focus is moved from IDEA and then back
aff52ee: IDEA-116784 Error Parsing Regex /\s/ in Groovy [^Peter]
8bf0c61: IDEA-95170 closure parameter type [^peter]
8f7c63d: IDEA-116378 only expressions are available in loop conditions [^peter]
d889262: IDEA-116837 Groovy: don't suggest to shorten references in comments [^peter]
f835a08: IDEA-116621 Groovy: Extract Parameter Refactoring: 'Replace this occurrence only' replaces all occurrences in current method [^peter]
6ee4359: [log] fix action's update()
5b8fb93: do not update recent projects on closing in headless mode
3fb3322: Merge remote-tracking branch 'origin/133' into 133
9251d90: SSH console - credentials validation (cherry picked from commit 8b7b23a)
9947162: IDEA-116824 Gradle: Provide an inspection & quickfix for multiple custom maven repo links (cherry picked from commit 810199f)

Change-Id: I47b8e5f8b6b865ec46d5625dd1838900539d7d93
diff --git a/java/java-tests/java-tests.iml b/java/java-tests/java-tests.iml
index cc0afca..01e606b 100644
--- a/java/java-tests/java-tests.iml
+++ b/java/java-tests/java-tests.iml
@@ -30,6 +30,7 @@
     <orderEntry type="module" module-name="java-indexing-api" scope="TEST" />
     <orderEntry type="module" module-name="external-system-impl" scope="RUNTIME" />
     <orderEntry type="module" module-name="junit_rt" scope="TEST" />
+    <orderEntry type="module" module-name="xml-psi-impl" scope="TEST" />
   </component>
 </module>
 
diff --git a/java/java-tests/testData/codeInsight/completion/smartType/FilteredMethodReference-out.java b/java/java-tests/testData/codeInsight/completion/smartType/FilteredMethodReference-out.java
new file mode 100644
index 0000000..2086ad1
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/smartType/FilteredMethodReference-out.java
@@ -0,0 +1,13 @@
+class Test {
+  interface I {
+    int foo();
+  }
+
+  static int aa() {
+    return 0;
+  }
+
+  {
+    I i = Test::aa
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/completion/smartType/FilteredMethodReference.java b/java/java-tests/testData/codeInsight/completion/smartType/FilteredMethodReference.java
new file mode 100644
index 0000000..f49bb50
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/smartType/FilteredMethodReference.java
@@ -0,0 +1,13 @@
+class Test {
+  interface I {
+    int foo();
+  }
+
+  static int aa() {
+    return 0;
+  }
+
+  {
+    I i = Test::<caret>
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InferFromRawType.java b/java/java-tests/testData/codeInsight/completion/smartType/InferFromRawType.java
new file mode 100644
index 0000000..8a2ea29
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/smartType/InferFromRawType.java
@@ -0,0 +1,5 @@
+class A<T extends String> {
+  {
+    A a = new A<<caret>>();
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NotAvailableInLambdaPositionAfterQualifier.java b/java/java-tests/testData/codeInsight/completion/smartType/NotAvailableInLambdaPositionAfterQualifier.java
new file mode 100644
index 0000000..f7523c6
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/smartType/NotAvailableInLambdaPositionAfterQualifier.java
@@ -0,0 +1,9 @@
+class Test {
+  interface I {
+    void foo();
+  }
+
+  {
+    I i = Unknown::<caret>
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/annotations/wrongPlace.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/annotations/wrongPlace.java
index ab1d2f0..581948e 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/annotations/wrongPlace.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/annotations/wrongPlace.java
@@ -27,4 +27,10 @@
 
 @interface Caller {
   Anno anno() default @Anno;
-}
\ No newline at end of file
+}
+
+@interface AnnoArray {
+  @interface Part { }
+
+  Part[] arrayValue() default {@Part, @Part};
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA104160.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA104160.java
index 92e5b57..32d2c84 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA104160.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA104160.java
@@ -10,4 +10,9 @@
   class B extends ArrayList<T> {
       void foo(T r){}
   }
+  
+  static class C extends Test<<error descr="'Test.this' cannot be referenced from a static context">T</error>> {}
+  static class D extends Test {
+    <error descr="'Test.this' cannot be referenced from a static context">T</error> t;
+  }
 }
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA117827.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA117827.java
new file mode 100644
index 0000000..afa7d2a
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA117827.java
@@ -0,0 +1,16 @@
+
+import java.util.Collection;
+import java.util.List;
+
+public class Testsss {
+
+  public <TA, CA extends Iterable<TA>> void that(Iterable<TA> target) {}
+
+  public <T, C extends Collection<T>> void that(Collection<T> target) {}
+
+  void foo(ImmutableList<String> l) {
+    that( l);
+  }
+
+  interface ImmutableList<T> extends List<T> {}
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA118037.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA118037.java
new file mode 100644
index 0000000..47ff27a
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA118037.java
@@ -0,0 +1,14 @@
+final class Test
+{
+  class Foo
+  {
+    <T extends String> void foo(Class<T> clazz)
+    {
+      if (<error descr="Operator '==' cannot be applied to 'java.lang.Class<java.lang.Void>', 'java.lang.Class<T>'">Void.class == clazz</error>)
+      {
+        System.out.println("Yeah!");
+      }
+    }
+  }
+}
+
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/diamond/OuterClass.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/diamond/OuterClass.java
new file mode 100644
index 0000000..d69d551
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/diamond/OuterClass.java
@@ -0,0 +1,23 @@
+import java.util.*;
+
+class HT<O> {
+    private Iterator<O> getIterator(int type, int count) {
+      return new Enumerator<>(type, true);
+    }
+
+    private class Enumerator<T> implements Iterator<T> {
+
+        public Enumerator(int type, boolean b) {
+        }
+
+        @Override
+        public boolean hasNext() {
+            return false;
+        }
+
+        @Override
+        public T next() {
+            return null;
+        }
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/methodRef/ResolveConflicts.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/methodRef/ResolveConflicts.java
index 681e207..919a623 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/methodRef/ResolveConflicts.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/methodRef/ResolveConflicts.java
@@ -6,7 +6,7 @@
 class Main {
 
     public static void main(final String[] args) {
-        Func<Integer, String> func =  Integer::toString;
+        <error descr="Incompatible types. Found: '<method reference>', required: 'Func<java.lang.Integer,java.lang.String>'">Func<Integer, String> func =  Integer::toString;</error>
         System.out.println(func.run(6));
     }
 }
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/ArgumentOfAnonymousClass.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/ArgumentOfAnonymousClass.java
new file mode 100644
index 0000000..dfd4563
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/ArgumentOfAnonymousClass.java
@@ -0,0 +1,19 @@
+interface I<T> {
+    void accept(T t);
+}
+
+class LamdbaTest<T> {
+
+    public void f() {
+        new A<T>(t -> g(t)) {};
+    }
+
+    private void g(T t) {
+    }
+
+    class A<T2> {
+        public A(I<T> editor) {
+        }
+    }
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/Ellipsis.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/Ellipsis.java
new file mode 100644
index 0000000..6342785
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/Ellipsis.java
@@ -0,0 +1,9 @@
+interface Var {
+    void var(int... ps);
+}
+
+class Abc {
+    void foo() {
+        Var var = (int[] ps) -> {};
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/OuterMethodPropagation.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/OuterMethodPropagation.java
new file mode 100644
index 0000000..b19ca63
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/OuterMethodPropagation.java
@@ -0,0 +1,17 @@
+public class Tmp
+{
+  interface BiFunction<T, U, R> {
+    R apply(T t, U u);
+  }
+
+  interface Sequence<T>
+  {
+    <R> Sequence<R> scan(R init, BiFunction<R, T, R> func);
+  }
+
+  static <T> void foo(Sequence<T> sequence){}
+
+  void test(Sequence<String> strings) {
+    foo(strings.scan(1, (i, s) -> 1));
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeArgumentsConditional/afterEliminateWildcards.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeArgumentsConditional/afterEliminateWildcards.java
new file mode 100644
index 0000000..a228257
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeArgumentsConditional/afterEliminateWildcards.java
@@ -0,0 +1,12 @@
+// "Add explicit type arguments" "true"
+import java.util.*;
+
+class Test {
+     static class A {}
+     static class B extends A {}
+ 
+ 
+     public Collection<? extends A> run(boolean flag) {
+         return flag ? Collections.singletonList(new B()) : Collections.<A>emptyList();
+     }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeArgumentsConditional/beforeEliminateWildcards.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeArgumentsConditional/beforeEliminateWildcards.java
new file mode 100644
index 0000000..8d4383c
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addTypeArgumentsConditional/beforeEliminateWildcards.java
@@ -0,0 +1,12 @@
+// "Add explicit type arguments" "true"
+import java.util.*;
+
+class Test {
+     static class A {}
+     static class B extends A {}
+ 
+ 
+     public Collection<? extends A> run(boolean flag) {
+         return flag ? Collections.singletonList(new B()) : Collections.<caret>emptyList();
+     }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/anonymous2methodReference/beforeSideEffects.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/anonymous2methodReference/beforeSideEffects.java
new file mode 100644
index 0000000..754a9ea
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/anonymous2methodReference/beforeSideEffects.java
@@ -0,0 +1,13 @@
+// "Replace with method reference" "false"
+class Test {
+  public interface I {
+    String m();
+  }
+
+  public static void main(String[] args) {
+    I<String> supplier = () -> new Ob<caret>ject().toString();
+
+    System.out.println(supplier.get());
+    System.out.println(supplier.get());
+  }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterAmbiguousMethods.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterAmbiguousMethods.java
new file mode 100644
index 0000000..475f46e
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterAmbiguousMethods.java
@@ -0,0 +1,10 @@
+// "Replace lambda with method reference" "true"
+class Example {
+    interface I {
+      String foo(Integer i);
+    }
+  
+    {
+      I i = Object::toString;
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/beforeAmbiguousMethods.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/beforeAmbiguousMethods.java
new file mode 100644
index 0000000..b731848
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/beforeAmbiguousMethods.java
@@ -0,0 +1,10 @@
+// "Replace lambda with method reference" "true"
+class Example {
+    interface I {
+      String foo(Integer i);
+    }
+  
+    {
+      I i = (i1) -> i1.<caret>toString();
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/javadocIG/code.html b/java/java-tests/testData/codeInsight/javadocIG/code.html
new file mode 100644
index 0000000..e75e091
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/javadocIG/code.html
@@ -0,0 +1,10 @@
+<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://Foo"><code>Foo</code></a></b></small><PRE>int <b>foo</b></PRE>
+     <pre>
+     <code>
+      class Clazzz {
+        def f[U](u: U) {}
+   
+        val a = 1
+      }
+    </code>
+     </pre></body></html>
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/javadocIG/code.java b/java/java-tests/testData/codeInsight/javadocIG/code.java
new file mode 100644
index 0000000..f5cf2a7
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/javadocIG/code.java
@@ -0,0 +1,14 @@
+class Foo {
+  /**
+   * <pre>
+   * {@code
+   *   class Clazzz {
+   *     def f[U](u: U) {}
+   *
+   *     val a = 1
+   *   }
+   * }
+   * </pre>
+  */
+  int foo;
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/parameterInfo/SelectionWithGenerics.java b/java/java-tests/testData/codeInsight/parameterInfo/SelectionWithGenerics.java
new file mode 100644
index 0000000..cfafbdb
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/parameterInfo/SelectionWithGenerics.java
@@ -0,0 +1,12 @@
+class Test {
+  {
+    refresh(<caret>false, false, null, "");
+  }
+
+  public final void refresh(boolean async, boolean recursive,  Runnable finishRunnable, String... files) {
+  }
+
+  public final void refresh(boolean async, boolean recursive, Runnable finishRunnable, Integer files) {
+  }
+
+}
diff --git a/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass.log b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass.log
new file mode 100644
index 0000000..228bc41
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass.log
@@ -0,0 +1,11 @@
+Compiling files:
+src/package2/A.java
+End of files
+Cleaning output files:
+out/production/AddClassHidingImportedClass/package2/B.class
+out/production/AddClassHidingImportedClass/package3/C.class
+End of files
+Compiling files:
+src/package2/B.java
+src/package3/C.java
+End of files
diff --git a/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package1/A.java b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package1/A.java
new file mode 100644
index 0000000..a61ecd9
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package1/A.java
@@ -0,0 +1,7 @@
+package package1;
+
+public class A {
+    public static class D {
+       public final String s = new String("package1");
+    }
+}
diff --git a/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package2/A.java.new b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package2/A.java.new
new file mode 100644
index 0000000..98b0fee
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package2/A.java.new
@@ -0,0 +1,7 @@
+package package2;
+
+public class A {
+    public static class D {
+        public final String s = new String("package2");
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package2/B.java b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package2/B.java
new file mode 100644
index 0000000..a32b694
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package2/B.java
@@ -0,0 +1,6 @@
+package package2;
+import package1.*;
+
+public class B extends A{
+
+}
diff --git a/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package3/C.java b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package3/C.java
new file mode 100644
index 0000000..04d86d3
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass/src/package3/C.java
@@ -0,0 +1,14 @@
+package package3;
+
+import package2.B;
+
+public class C {
+
+    public B.D p;
+
+    public String get() {
+        p = new B.D();
+        return p.s;
+    }
+
+}
diff --git a/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2.log b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2.log
new file mode 100644
index 0000000..8564c55
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2.log
@@ -0,0 +1,15 @@
+Cleaning output files:
+out/production/AddClassHidingImportedClass2/package3/C.class
+End of files
+Compiling files:
+src/package2/A.java
+src/package3/C.java
+End of files
+Cleaning output files:
+out/production/AddClassHidingImportedClass2/package2/B.class
+out/production/AddClassHidingImportedClass2/package3/C.class
+End of files
+Compiling files:
+src/package2/B.java
+src/package3/C.java
+End of files
diff --git a/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package1/A.java b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package1/A.java
new file mode 100644
index 0000000..a61ecd9
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package1/A.java
@@ -0,0 +1,7 @@
+package package1;
+
+public class A {
+    public static class D {
+       public final String s = new String("package1");
+    }
+}
diff --git a/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package2/A.java.new b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package2/A.java.new
new file mode 100644
index 0000000..98b0fee
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package2/A.java.new
@@ -0,0 +1,7 @@
+package package2;
+
+public class A {
+    public static class D {
+        public final String s = new String("package2");
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package2/B.java b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package2/B.java
new file mode 100644
index 0000000..a32b694
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package2/B.java
@@ -0,0 +1,6 @@
+package package2;
+import package1.*;
+
+public class B extends A{
+
+}
diff --git a/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package3/C.java b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package3/C.java
new file mode 100644
index 0000000..6ba1003
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package3/C.java
@@ -0,0 +1,15 @@
+package package3;
+
+import package2.B;
+
+public class C {
+
+    public B.D p;
+
+    public String get() {
+        p = new B.D();
+        return p.s;
+    }
+
+   public void dummy() {}
+}
diff --git a/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package3/C.java.new b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package3/C.java.new
new file mode 100644
index 0000000..5074eb2
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/common/addClassHidingImportedClass2/src/package3/C.java.new
@@ -0,0 +1,16 @@
+package package3;
+
+import package2.B;
+
+public class C {
+
+    public B.D p;
+
+    public String get() {
+        p = new B.D();
+        return p.s;
+    }
+
+  // commenting dummy method => causing class change => compilation on the first round
+  // public void dummy() {}
+}
diff --git a/java/java-tests/testData/compileServer/incremental/fieldProperties/constantChain.log b/java/java-tests/testData/compileServer/incremental/fieldProperties/constantChain.log
index 37245f2..278d40b 100644
--- a/java/java-tests/testData/compileServer/incremental/fieldProperties/constantChain.log
+++ b/java/java-tests/testData/compileServer/incremental/fieldProperties/constantChain.log
@@ -12,3 +12,9 @@
 src/Client.java
 src/ServerClient.java
 End of files
+Cleaning output files:
+out/production/ConstantChain/Server.class
+End of files
+Compiling files:
+src/Server.java
+End of files
diff --git a/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants.log b/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants.log
new file mode 100644
index 0000000..e4b795d
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants.log
@@ -0,0 +1,16 @@
+Cleaning output files:
+out/production/MutualConstants/constants/B.class
+End of files
+Compiling files:
+src/constants/B.java
+End of files
+Cleaning output files:
+out/production/MutualConstants/constants/A.class
+out/production/MutualConstants/constants/B.class
+out/production/MutualConstants/constants/PrintConst.class
+End of files
+Compiling files:
+src/constants/A.java
+src/constants/B.java
+src/constants/PrintConst.java
+End of files
diff --git a/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/A.java b/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/A.java
new file mode 100644
index 0000000..b817093
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/A.java
@@ -0,0 +1,5 @@
+package constants;
+
+public class A {
+  public static final int CONST_A = B.CONST_B_1 + 1;
+}
diff --git a/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/B.java b/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/B.java
new file mode 100644
index 0000000..e3a2d4f
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/B.java
@@ -0,0 +1,5 @@
+package constants;
+public class B {
+  public static final int CONST_B_1 = 0;
+  public static final int CONST_B_2 = A.CONST_A + 1;
+}
diff --git a/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/B.java.new b/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/B.java.new
new file mode 100644
index 0000000..7ccf22f
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/B.java.new
@@ -0,0 +1,5 @@
+package constants;
+public class B {
+  public static final int CONST_B_1 = 1;
+  public static final int CONST_B_2 = A.CONST_A + 1;
+}
diff --git a/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/PrintConst.java b/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/PrintConst.java
new file mode 100644
index 0000000..ccf17f8
--- /dev/null
+++ b/java/java-tests/testData/compileServer/incremental/fieldProperties/mutualConstants/src/constants/PrintConst.java
@@ -0,0 +1,7 @@
+package constants;
+
+public class PrintConst {
+  public static void main(String[] args) {
+    System.out.println(B.CONST_B_2);
+  }
+}
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/PrimitiveCastMayChangeValue.java b/java/java-tests/testData/inspection/dataFlow/fixture/PrimitiveCastMayChangeValue.java
index 652f0dc..cfe0d0e 100644
--- a/java/java-tests/testData/inspection/dataFlow/fixture/PrimitiveCastMayChangeValue.java
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/PrimitiveCastMayChangeValue.java
@@ -10,6 +10,10 @@
     } else {
       System.out.println("4");
     }
+    
+    if (0 == (long)<error descr="Cannot resolve symbol 'i'">i</error>) {
+      System.out.println("0");
+    }
   }
 
 }
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReturnNullInLambdaExpression.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReturnNullInLambdaExpression.java
new file mode 100644
index 0000000..92d0f42
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/ReturnNullInLambdaExpression.java
@@ -0,0 +1,12 @@
+import org.jetbrains.annotations.NotNull;
+
+class Test {
+  interface I {
+    @NotNull
+    String get();
+  }
+
+  {
+    I i = () -> <warning descr="'null' is returned by the method declared as @NotNull">null</warning>;
+  }
+}
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ReturnNullInLambdaStatement.java b/java/java-tests/testData/inspection/dataFlow/fixture/ReturnNullInLambdaStatement.java
new file mode 100644
index 0000000..0566fce
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/ReturnNullInLambdaStatement.java
@@ -0,0 +1,12 @@
+import org.jetbrains.annotations.NotNull;
+
+class Test {
+  interface I {
+    @NotNull
+    String get();
+  }
+
+  {
+    I i = () -> {return <warning descr="'null' is returned by the method declared as @NotNull">null</warning>;};
+  }
+}
diff --git a/java/java-tests/testData/inspection/localCanBeFinal/For/src/For.java b/java/java-tests/testData/inspection/localCanBeFinal/For/src/For.java
index 529844b..4a10521 100644
--- a/java/java-tests/testData/inspection/localCanBeFinal/For/src/For.java
+++ b/java/java-tests/testData/inspection/localCanBeFinal/For/src/For.java
@@ -1,7 +1,8 @@
 class For {
   void f(List<String> list) {
-    for (Iterator<String>  it = list.iterator(); it.hasNext();) { // 'it' can be final but not reported
+    for (Iterator<String>  it = list.iterator(); it.hasNext();) {
     }
     for (int i = 0; i < 10; i++) {}
+    for (int i = 0, length = 10; i < length; i++) {}
   }
 }
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/redundantCast/generics/SafeTempVarName/expected.xml b/java/java-tests/testData/inspection/redundantCast/generics/SafeTempVarName/expected.xml
new file mode 100644
index 0000000..4704d91
--- /dev/null
+++ b/java/java-tests/testData/inspection/redundantCast/generics/SafeTempVarName/expected.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<problems/>
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/redundantCast/generics/SafeTempVarName/src/Test.java b/java/java-tests/testData/inspection/redundantCast/generics/SafeTempVarName/src/Test.java
new file mode 100644
index 0000000..c7fa33b
--- /dev/null
+++ b/java/java-tests/testData/inspection/redundantCast/generics/SafeTempVarName/src/Test.java
@@ -0,0 +1,9 @@
+import java.util.*;
+
+public class RedundantCast{
+    <T> void foo2(List<Object[]> x) {
+        for (Object[] l : x) {
+           String[] s = (String[]) l;
+        }
+    }
+}
diff --git a/java/java-tests/testData/inspection/redundantTypeArgs/NestedCalls.java b/java/java-tests/testData/inspection/redundantTypeArgs/NestedCalls.java
new file mode 100644
index 0000000..9121bda
--- /dev/null
+++ b/java/java-tests/testData/inspection/redundantTypeArgs/NestedCalls.java
@@ -0,0 +1,18 @@
+import java.io.Serializable;
+
+final class Expected {
+  public static <P extends Serializable> Expected make(final P good) {
+    return null;
+  }
+}
+
+interface Serializer {
+  <T> T deserialize(final Class<T> type);
+}
+
+class FooBar {
+  <T extends Serializable> void invoke(final Class<T> rpc, final Serializer serializer) {
+    Expected.make(serializer.<warning descr="Explicit type arguments can be inferred"><T></warning>deserialize(rpc));
+  }
+}
+
diff --git a/java/java-tests/testData/psi/formatter/java/FormatterOnOffTags.java b/java/java-tests/testData/psi/formatter/java/FormatterOnOffTags.java
index 93e69f1..e016830 100644
--- a/java/java-tests/testData/psi/formatter/java/FormatterOnOffTags.java
+++ b/java/java-tests/testData/psi/formatter/java/FormatterOnOffTags.java
@@ -17,8 +17,12 @@
              str3 = "Green",
               str4 = "Blue";
     // @formatter:on
+    if        (true)
+          System.out.println("True");
     Iterator iterator;
     // @formatter:off
+    if    (true)
+          System.out.println("True");
     collection.add(str1);
       collection.add(str2);
         collection.add(str3);
@@ -39,6 +43,9 @@
    *     And yet another one.
    */
   public void doSomething(String x, String y) {
+    if
+       (true)
+          System.out.println("True");
   }
   // @formatter:on
 
@@ -47,7 +54,10 @@
    *    @param   z
    *       Parameter Z.
    */
-  public void doSomethingElse(String z) {}
+  public void doSomethingElse(String z) {
+    if    (true)
+          System.out.println("True");
+  }
 
   // @formatter:off
   /**
@@ -57,6 +67,10 @@
    *   @param j
    *      Parameter J.
    */
-  public void evenMore(int i, int j) {}
+  public void evenMore(int i, int j) {
+    if
+       (true)
+          System.out.println("True");
+  }
   // @formatter:on
 }
diff --git a/java/java-tests/testData/psi/formatter/java/FormatterOnOffTags_after.java b/java/java-tests/testData/psi/formatter/java/FormatterOnOffTags_after.java
index 01233b3..e0102b6 100644
--- a/java/java-tests/testData/psi/formatter/java/FormatterOnOffTags_after.java
+++ b/java/java-tests/testData/psi/formatter/java/FormatterOnOffTags_after.java
@@ -17,8 +17,13 @@
              str3 = "Green",
               str4 = "Blue";
     // @formatter:on
+        if (true) {
+            System.out.println("True");
+        }
         Iterator iterator;
         // @formatter:off
+    if    (true)
+          System.out.println("True");
     collection.add(str1);
       collection.add(str2);
         collection.add(str3);
@@ -39,6 +44,9 @@
    *     And yet another one.
    */
   public void doSomething(String x, String y) {
+    if
+       (true)
+          System.out.println("True");
   }
   // @formatter:on
 
@@ -48,6 +56,9 @@
      * @param z Parameter Z.
      */
     public void doSomethingElse(String z) {
+        if (true) {
+            System.out.println("True");
+        }
     }
 
     // @formatter:off
@@ -58,6 +69,10 @@
    *   @param j
    *      Parameter J.
    */
-  public void evenMore(int i, int j) {}
+  public void evenMore(int i, int j) {
+    if
+       (true)
+          System.out.println("True");
+  }
   // @formatter:on
 }
diff --git a/java/java-tests/testData/psi/resolve/method/generics/CovariantReturnTypeAnonymous.java b/java/java-tests/testData/psi/resolve/method/generics/CovariantReturnTypeAnonymous.java
new file mode 100644
index 0000000..b487a30
--- /dev/null
+++ b/java/java-tests/testData/psi/resolve/method/generics/CovariantReturnTypeAnonymous.java
@@ -0,0 +1,20 @@
+interface X {
+    A[] foo();
+}
+
+class A {}
+
+class B extends A {}
+
+class C {
+    final X x = new X() {
+        @Override
+        public B[] foo() {
+            return new B[0];
+        }
+    };
+
+    B[] bar() {
+        return x.f<ref>oo();
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineParameter/FromClassInitializer.java b/java/java-tests/testData/refactoring/inlineParameter/FromClassInitializer.java
new file mode 100644
index 0000000..ecb1a4a
--- /dev/null
+++ b/java/java-tests/testData/refactoring/inlineParameter/FromClassInitializer.java
@@ -0,0 +1,10 @@
+class X {
+    {
+        String str = "";
+        foo(str, str.substring(0));
+    }
+
+    void foo(String str, String st<caret>r1) {
+
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineParameter/FromClassInitializer.java.after b/java/java-tests/testData/refactoring/inlineParameter/FromClassInitializer.java.after
new file mode 100644
index 0000000..167339b
--- /dev/null
+++ b/java/java-tests/testData/refactoring/inlineParameter/FromClassInitializer.java.after
@@ -0,0 +1,10 @@
+class X {
+    {
+        String str = "";
+        foo(str);
+    }
+
+    void foo(String str) {
+
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass3.after.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass3.after.java
new file mode 100644
index 0000000..e326017
--- /dev/null
+++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass3.after.java
@@ -0,0 +1,27 @@
+import java.io.PrintStream;
+class Foo {
+
+    public static void bazz(int i) {
+        Foo j = new Foo(new IBar() {
+            public void doSomething(PrintStream out) {
+                out.println("hello");
+            }
+        });
+        final Foo foo = i != 0 ? j : j;
+        foo.bla();
+    }
+
+    private final IBar bar;
+
+    public Foo(IBar bar) {
+        this.bar = bar;
+    }
+
+    public void bla() {
+        bar.doSomething(System.out);
+    }
+
+    public interface IBar {
+        void doSomething(PrintStream out);
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass3.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass3.java
new file mode 100644
index 0000000..b2f3688
--- /dev/null
+++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass3.java
@@ -0,0 +1,30 @@
+import java.io.PrintStream;
+class Foo {
+
+    public static void bazz(int i) {
+        final Foo foo = i != 0 ? <selection>new Foo(new IBar() {
+            public void doSomething(PrintStream out) {
+                out.println("hello");
+            }
+        })</selection> : new Foo(new IBar() {
+            public void doSomething(PrintStream out) {
+                out.println("hello");
+            }
+        });
+        foo.bla();
+    }
+
+    private final IBar bar;
+
+    public Foo(IBar bar) {
+        this.bar = bar;
+    }
+
+    public void bla() {
+        bar.doSomething(System.out);
+    }
+
+    public interface IBar {
+        void doSomething(PrintStream out);
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass4.after.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass4.after.java
new file mode 100644
index 0000000..4642ab3
--- /dev/null
+++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass4.after.java
@@ -0,0 +1,22 @@
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class ExtractVariableSample {
+
+    public static void main(String[] args) {
+        Collection<String> strings = new ArrayList<>();
+        new Object() {
+            public void foo(String s) {
+                System.out.println( s.hashCode());
+            }
+        };
+
+        for (String s : strings) {
+            int j = s.hashCode();
+            System.out.println(j);
+        }
+    }
+
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass4.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass4.java
new file mode 100644
index 0000000..1415fc9
--- /dev/null
+++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass4.java
@@ -0,0 +1,21 @@
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class ExtractVariableSample {
+
+    public static void main(String[] args) {
+        Collection<String> strings = new ArrayList<>();
+        new Object() {
+            public void foo(String s) {
+                System.out.println( s.hashCode());
+            }
+        };
+
+        for (String s : strings) {
+            System.out.println(<selection>s.hashCode()</selection>);
+        }
+    }
+
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass5.after.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass5.after.java
new file mode 100644
index 0000000..9157c78
--- /dev/null
+++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass5.after.java
@@ -0,0 +1,20 @@
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class ExtractVariableSample {
+
+    public static void main(String[] args, String s) {
+        Collection<String> strings = new ArrayList<>();
+        new Object() {
+            public void foo(String s) {
+                System.out.println( s.hashCode());
+            }
+        };
+
+        int j = s.hashCode();
+        System.out.println(j);
+    }
+
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass5.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass5.java
new file mode 100644
index 0000000..7e1bc3a
--- /dev/null
+++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass5.java
@@ -0,0 +1,19 @@
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class ExtractVariableSample {
+
+    public static void main(String[] args, String s) {
+        Collection<String> strings = new ArrayList<>();
+        new Object() {
+            public void foo(String s) {
+                System.out.println( s.hashCode());
+            }
+        };
+
+        System.out.println(<selection>s.hashCode()</selection>);
+    }
+
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/introduceVariable/Lambda.after.java b/java/java-tests/testData/refactoring/introduceVariable/Lambda.after.java
new file mode 100644
index 0000000..3d95282
--- /dev/null
+++ b/java/java-tests/testData/refactoring/introduceVariable/Lambda.after.java
@@ -0,0 +1,22 @@
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class ExtractVariableSample {
+    interface I {
+      void foo(String s);
+    }
+
+    public static void main(String[] args) {
+        Collection<String> strings = new ArrayList<>();
+        I i = (s) -> {
+            int j = s.hashCode();
+            System.out.println(j); };
+
+        for (String s : strings) {
+            System.out.println(s.hashCode());
+        }
+    }
+
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/introduceVariable/Lambda.java b/java/java-tests/testData/refactoring/introduceVariable/Lambda.java
new file mode 100644
index 0000000..e331f2b
--- /dev/null
+++ b/java/java-tests/testData/refactoring/introduceVariable/Lambda.java
@@ -0,0 +1,20 @@
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class ExtractVariableSample {
+    interface I {
+      void foo(String s);
+    }
+
+    public static void main(String[] args) {
+        Collection<String> strings = new ArrayList<>();
+        I i = (s) -> { System.out.println(<selection>s.hashCode()</selection>); };
+
+        for (String s : strings) {
+            System.out.println(s.hashCode());
+        }
+    }
+
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/introduceVariable/SubLiteralFailure.java b/java/java-tests/testData/refactoring/introduceVariable/SubLiteralFailure.java
new file mode 100644
index 0000000..8eb2a45
--- /dev/null
+++ b/java/java-tests/testData/refactoring/introduceVariable/SubLiteralFailure.java
@@ -0,0 +1,5 @@
+class A {
+    public void test() {
+        int i = <selection>1</selection>23 + 123;
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/pullUp/PublicMethodFromPrivateClassConflict.java b/java/java-tests/testData/refactoring/pullUp/PublicMethodFromPrivateClassConflict.java
new file mode 100644
index 0000000..a028329
--- /dev/null
+++ b/java/java-tests/testData/refactoring/pullUp/PublicMethodFromPrivateClassConflict.java
@@ -0,0 +1,9 @@
+import java.util.*;
+class A {}
+class B extends A {
+  void fo<caret>o() {
+    HM<String, String> hm = new HM<>();
+    for (Map.Entry<String, String> stringStringEntry : hm.entrySet()) {}
+  }
+  private static class HM<K, V> extends HashMap<K, V>{}
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/pullUp/PublicMethodFromPrivateClassConflict_after.java b/java/java-tests/testData/refactoring/pullUp/PublicMethodFromPrivateClassConflict_after.java
new file mode 100644
index 0000000..96932a3
--- /dev/null
+++ b/java/java-tests/testData/refactoring/pullUp/PublicMethodFromPrivateClassConflict_after.java
@@ -0,0 +1,11 @@
+import java.util.*;
+class A {
+    void foo() {
+      HM<String, String> hm = new HM<>();
+      for (Map.Entry<String, String> stringStringEntry : hm.entrySet()) {}
+    }
+
+    private static class HM<K, V> extends HashMap<K, V>{}
+}
+class B extends A {
+}
\ No newline at end of file
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/ParameterInfoTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/ParameterInfoTest.java
index b31fb16..2c757c1 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/ParameterInfoTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/ParameterInfoTest.java
@@ -10,6 +10,9 @@
 import com.intellij.psi.infos.MethodCandidateInfo;
 import com.intellij.testFramework.LightCodeInsightTestCase;
 import com.intellij.testFramework.utils.parameterInfo.MockCreateParameterInfoContext;
+import com.intellij.testFramework.utils.parameterInfo.MockUpdateParameterInfoContext;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.ArrayUtilRt;
 import com.intellij.util.Function;
 import junit.framework.Assert;
 
@@ -54,6 +57,35 @@
     doTestPresentation("<html>List&lt;String&gt; param</html>");
   }
 
+  public void testSelectionWithGenerics() throws Exception {
+    configureByFile(BASE_PATH + getTestName(false) + ".java");
+
+    final MethodParameterInfoHandler handler = new MethodParameterInfoHandler();
+    final CreateParameterInfoContext context = new MockCreateParameterInfoContext(myEditor, myFile);
+    final PsiExpressionList list = handler.findElementForParameterInfo(context);
+    assertNotNull(list);
+    final Object[] itemsToShow = context.getItemsToShow();
+    assertNotNull(itemsToShow);
+    assertTrue(itemsToShow.length == 2);
+    assertTrue(itemsToShow[0] instanceof MethodCandidateInfo);
+    final ParameterInfoUIContextEx parameterContext = ParameterInfoComponent.createContext(itemsToShow, myEditor, handler, -1);
+    final Boolean [] enabled = new Boolean[itemsToShow.length];
+    final MockUpdateParameterInfoContext updateParameterInfoContext = new MockUpdateParameterInfoContext(myEditor, myFile){
+      @Override
+      public Object[] getObjectsToView() {
+        return itemsToShow;
+      }
+
+      @Override
+      public void setUIComponentEnabled(int index, boolean b) {
+        enabled[index] = b;
+      }
+    };
+    updateParameterInfoContext.setParameterOwner(list);
+    handler.updateParameterInfo(list, updateParameterInfoContext);
+    assertTrue(ArrayUtilRt.find(enabled, Boolean.TRUE) > -1);
+  }
+
   public void testAfterGenericsInsideCall() throws Exception {
     configureByFile(BASE_PATH + getTestName(false) + ".java");
 
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/HippieCompletionTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/HippieCompletionTest.groovy
index ab9ea13..669f0f5 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/HippieCompletionTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/HippieCompletionTest.groovy
@@ -36,16 +36,29 @@
 
   public void testFromAnotherFile() {
     myFixture.configureByText "b.txt", '''
-$some_long_variable_name = Obj::instance();
+$some_local = 1;
 '''
     myFixture.configureByText "a.txt", '''
-$some_lon<caret>
+$some_long_variable_name = Obj::instance();
+$some_lo<caret>
 '''
 
     complete()
     myFixture.checkResult '''
+$some_long_variable_name = Obj::instance();
 $some_long_variable_name<caret>
 '''
+    complete()
+    myFixture.checkResult '''
+$some_long_variable_name = Obj::instance();
+$some_local<caret>
+'''
+    backComplete()
+    myFixture.checkResult '''
+$some_long_variable_name = Obj::instance();
+$some_long_variable_name<caret>
+'''
+
   }
 
   public void "test no middle matching"() {
@@ -128,7 +141,24 @@
 
   }
 
+  public void "test file start"() {
+    myFixture.configureByText "a.java", '''<caret>
+class Xoo {
+}
+'''
+    complete()
+    myFixture.checkResult '''class<caret>
+class Xoo {
+}
+'''
+
+  }
+
   private void complete() {
     myFixture.performEditorAction(IdeActions.ACTION_HIPPIE_COMPLETION)
   }
+
+  private void backComplete() {
+    myFixture.performEditorAction(IdeActions.ACTION_HIPPIE_BACKWARD_COMPLETION)
+  }
 }
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java
index c386bd3..7284025 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java
@@ -17,6 +17,9 @@
 
 import com.intellij.JavaTestUtil;
 import com.intellij.codeInsight.lookup.Lookup;
+import com.intellij.psi.JavaPsiFacade;
+import com.intellij.psi.impl.source.resolve.PsiResolveHelperImpl;
+import com.intellij.psi.impl.source.resolve.graphInference.PsiGraphInferenceHelper;
 import com.intellij.testFramework.LightProjectDescriptor;
 import org.jetbrains.annotations.NotNull;
 
@@ -70,6 +73,29 @@
     doTest();
   }
 
+  public void testFilteredMethodReference() throws Exception {
+    doTest();
+  }
+
+  public void testNotAvailableInLambdaPositionAfterQualifier() throws Exception {
+    configureByFile("/" + getTestName(false) + ".java");
+    assertNotNull(myItems);
+    assertTrue(myItems.length == 0);
+  }
+
+  public void testInferFromRawType() throws Exception {
+    final PsiResolveHelperImpl helper = (PsiResolveHelperImpl)JavaPsiFacade.getInstance(getProject()).getResolveHelper();
+    helper.setTestHelper(new PsiGraphInferenceHelper(getPsiManager()));
+    try {
+      configureByFile("/" + getTestName(false) + ".java");
+      assertNotNull(myItems);
+      assertTrue(myItems.length == 0);
+    }
+    finally {
+      helper.setTestHelper(null);
+    }
+  }
+
   private void doTest() {
     configureByFile("/" + getTestName(false) + ".java");
     assertNotNull(myItems);
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java
index 9d7673d..64798f4 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java
@@ -332,6 +332,8 @@
   public void testIDEA65377() { doTest5(false); }
   public void testIDEA113526() { doTest5(true); }
   public void testIDEA116493() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
+  public void testIDEA117827() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
+  public void testIDEA118037() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
 
   public void testJavaUtilCollections_NoVerify() throws Exception {
     PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/Diamond8HighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/Diamond8HighlightingTest.java
index 99c7c27..ca4133b 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/Diamond8HighlightingTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/Diamond8HighlightingTest.java
@@ -16,6 +16,8 @@
 package com.intellij.codeInsight.daemon.lambda;
 
 import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
+import com.intellij.openapi.projectRoots.Sdk;
+import com.intellij.testFramework.IdeaTestUtil;
 import org.jetbrains.annotations.NonNls;
 
 public class Diamond8HighlightingTest extends LightDaemonAnalyzerTestCase {
@@ -25,7 +27,16 @@
     doTest();
   }
 
+  public void testOuterClass() throws Exception {
+    doTest();
+  }
+
   private void doTest() throws Exception {
     doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", false, false);
   }
+
+  @Override
+  protected Sdk getProjectJDK() {
+    return IdeaTestUtil.getMockJdk18();
+  }
 }
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java
index 964dca8..34ae397 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java
@@ -44,7 +44,7 @@
 
   @Override
   protected Sdk getProjectJDK() {
-    return getTestName(false).contains("Jdk14") ? IdeaTestUtil.getMockJdk14() : super.getProjectJDK();
+    return IdeaTestUtil.getMockJdk18();
   }
 
   public void testReferenceTypeParams() {
@@ -762,19 +762,4 @@
     doTest();
   }
 
-  public void testJavaUtilCollections_NoVerify() throws Exception {
-    PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
-    assertNotNull(collectionsClass);
-    collectionsClass = (PsiClass)collectionsClass.getNavigationElement();
-    final String text = collectionsClass.getContainingFile().getText();
-    configureFromFileText("Collections.java", text.replaceAll("\r", "\n"));
-    final PsiResolveHelperImpl helper = (PsiResolveHelperImpl)JavaPsiFacade.getInstance(getProject()).getResolveHelper();
-    helper.setTestHelper(new PsiGraphInferenceHelper(getPsiManager()));
-    try {
-      doTestConfiguredFile(false, false, null);
-    }
-    finally {
-      helper.setTestHelper(null);
-    }
-  }
 }
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java
index dee9137..d0048b7 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java
@@ -17,6 +17,7 @@
 
 import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
 import com.intellij.openapi.projectRoots.JavaSdkVersion;
+import com.intellij.openapi.projectRoots.Sdk;
 import com.intellij.testFramework.IdeaTestUtil;
 import org.jetbrains.annotations.NonNls;
 
@@ -115,4 +116,9 @@
     IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
     doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false);
   }
+
+  @Override
+  protected Sdk getProjectJDK() {
+    return IdeaTestUtil.getMockJdk18();
+  }
 }
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java
index 4a0851a..8e43934 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java
@@ -18,6 +18,8 @@
 import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
 import com.intellij.codeInspection.LocalInspectionTool;
 import com.intellij.codeInspection.unusedSymbol.UnusedSymbolLocalInspection;
+import com.intellij.openapi.projectRoots.Sdk;
+import com.intellij.testFramework.IdeaTestUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 
@@ -103,4 +105,9 @@
   private void doTest(final boolean checkWarnings) {
     doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false);
   }
+
+  @Override
+  protected Sdk getProjectJDK() {
+    return IdeaTestUtil.getMockJdk18();
+  }
 }
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MethodRefHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MethodRefHighlightingTest.java
index c0fed3d..7c25d3b 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MethodRefHighlightingTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MethodRefHighlightingTest.java
@@ -19,6 +19,7 @@
 import com.intellij.codeInspection.LocalInspectionTool;
 import com.intellij.codeInspection.unusedSymbol.UnusedSymbolLocalInspection;
 import com.intellij.openapi.projectRoots.JavaSdkVersion;
+import com.intellij.openapi.projectRoots.Sdk;
 import com.intellij.testFramework.IdeaTestUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -101,4 +102,9 @@
     IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
     doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false);
   }
+
+  @Override
+  protected Sdk getProjectJDK() {
+    return IdeaTestUtil.getMockJdk18();
+  }
 }
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 34a45ee..35b91ef 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
@@ -19,6 +19,7 @@
 import com.intellij.codeInspection.LocalInspectionTool;
 import com.intellij.codeInspection.unusedSymbol.UnusedSymbolLocalInspection;
 import com.intellij.openapi.projectRoots.JavaSdkVersion;
+import com.intellij.openapi.projectRoots.Sdk;
 import com.intellij.testFramework.IdeaTestUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -82,6 +83,18 @@
     doTest();
   }
 
+  public void testArgumentOfAnonymousClass() throws Exception {
+    doTest();
+  }
+
+  public void testEllipsis() throws Exception {
+    doTest();
+  }
+
+  public void testOuterMethodPropagation() throws Exception {
+    doTest();
+  }
+
   private void doTest() {
     doTest(false);
   }
@@ -90,4 +103,9 @@
     IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
     doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false);
   }
+
+  @Override
+  protected Sdk getProjectJDK() {
+    return IdeaTestUtil.getMockJdk18();
+  }
 }
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 ae3df00..80d2e4a 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/javadoc/JavaDocInfoGeneratorTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/javadoc/JavaDocInfoGeneratorTest.java
@@ -72,6 +72,10 @@
     doTestField();
   }
 
+  public void testCode() 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/codeInspection/DataFlowInspection8Test.java b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspection8Test.java
index 0e7d620..0a7b46a 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspection8Test.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspection8Test.java
@@ -45,6 +45,14 @@
     doTest();
   }
 
+  public void testReturnNullInLambdaExpression() throws Exception {
+    doTest();
+  }
+
+  public void testReturnNullInLambdaStatement() throws Exception {
+    doTest();
+  }
+
   private void setupCustomAnnotations() {
     myFixture.addClass("package foo;\n\nimport java.lang.annotation.*;\n\n@Target({ElementType.TYPE_USE}) public @interface Nullable { }");
     myFixture.addClass("package foo;\n\nimport java.lang.annotation.*;\n\n@Target({ElementType.TYPE_USE}) public @interface NotNull { }");
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/LocalCanBeFinalTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/LocalCanBeFinalTest.java
index e29b65c..61895f6 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/LocalCanBeFinalTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/LocalCanBeFinalTest.java
@@ -127,12 +127,14 @@
   public void testForeachNotReported() throws Exception {
     myTool.REPORT_PARAMETERS = true;
     myTool.REPORT_VARIABLES = false;
+    myTool.REPORT_FOREACH_PARAMETERS = false;
     doTest();
   }
 
   public void testNestedForeach() throws Exception {
     myTool.REPORT_PARAMETERS = false;
     myTool.REPORT_VARIABLES = true;
+    myTool.REPORT_FOREACH_PARAMETERS = true;
     doTest();
   }
 
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java
index 91afe58..ca3065d 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java
@@ -50,6 +50,7 @@
   public void testInstanceOfChecks() throws Exception { doTest();}
   public void testForEachValue() throws Exception { doTest();}
   public void testCaseThrowable() throws Exception { doTest();}
+  public void testSafeTempVarName() throws Exception { doTest();}
 
   public void testTypeParameterAccessChecksJava7() throws Exception {
     IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_7, getModule(), getTestRootDisposable());
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/RedundantTypeArgsInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantTypeArgsInspectionTest.java
index 53aba55..c3c092c 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/RedundantTypeArgsInspectionTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantTypeArgsInspectionTest.java
@@ -37,4 +37,8 @@
   public void testBoundInference() throws Throwable {
     doTest();
   }
+
+  public void testNestedCalls() throws Throwable {
+    doTest();
+  }
 }
\ No newline at end of file
diff --git a/java/java-tests/testSrc/com/intellij/ide/hierarchy/JavaCallHierarchyTest.java b/java/java-tests/testSrc/com/intellij/ide/hierarchy/JavaCallHierarchyTest.java
index aebc9e0..fcdad69 100644
--- a/java/java-tests/testSrc/com/intellij/ide/hierarchy/JavaCallHierarchyTest.java
+++ b/java/java-tests/testSrc/com/intellij/ide/hierarchy/JavaCallHierarchyTest.java
@@ -1,12 +1,15 @@
 package com.intellij.ide.hierarchy;
 
 import com.intellij.JavaTestUtil;
+import com.intellij.ide.hierarchy.actions.BrowseTypeHierarchyAction;
 import com.intellij.ide.hierarchy.call.CallerMethodsTreeStructure;
+import com.intellij.ide.highlighter.XmlFileType;
 import com.intellij.openapi.util.Computable;
 import com.intellij.psi.JavaPsiFacade;
 import com.intellij.psi.PsiClass;
 import com.intellij.psi.PsiMethod;
 import com.intellij.psi.search.ProjectScope;
+import com.intellij.testFramework.TestActionEvent;
 import com.intellij.testFramework.codeInsight.hierarchy.HierarchyViewTestBase;
 
 /**
@@ -53,4 +56,12 @@
   public void testIdeaDev41232() throws Exception {
     doJavaCallTypeHierarchyTest("A", "main", "B.java", "A.java");
   }
+
+  public void testActionAvailableInXml() throws Exception {
+    configureByText(XmlFileType.INSTANCE, "<foo>java.lang.Str<caret>ing</foo>");
+    BrowseTypeHierarchyAction action = new BrowseTypeHierarchyAction();
+    TestActionEvent e = new TestActionEvent(action);
+    action.beforeActionPerformedUpdate(e);
+    assertTrue(e.getPresentation().isEnabled() && e.getPresentation().isVisible());
+  }
 }
diff --git a/java/java-tests/testSrc/com/intellij/psi/codeStyle/arrangement/JavaRearrangerBlankLinesTest.groovy b/java/java-tests/testSrc/com/intellij/psi/codeStyle/arrangement/JavaRearrangerBlankLinesTest.groovy
index b456d41..8f64026 100644
--- a/java/java-tests/testSrc/com/intellij/psi/codeStyle/arrangement/JavaRearrangerBlankLinesTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/psi/codeStyle/arrangement/JavaRearrangerBlankLinesTest.groovy
@@ -24,6 +24,14 @@
  */
 public class JavaRearrangerBlankLinesTest extends AbstractJavaRearrangerTest {
 
+  def classic = [rule(INTERFACE),
+                 rule(CLASS),
+                 rule(FIELD, STATIC),
+                 rule(FIELD, PUBLIC),
+                 rule(FIELD),
+                 rule(METHOD, PUBLIC),
+                 rule(METHOD)]
+
   void testPreserveRelativeBlankLines() {
     commonSettings.BLANK_LINES_AROUND_CLASS = 2
     commonSettings.BLANK_LINES_AROUND_FIELD = 1
@@ -78,13 +86,7 @@
 
   private void method1() {}
 }''',
-      rules: [rule(INTERFACE),
-              rule(CLASS),
-              rule(FIELD, STATIC),
-              rule(FIELD, PUBLIC),
-              rule(FIELD),
-              rule(METHOD, PUBLIC),
-              rule(METHOD)]
+      rules: classic
     )
   }
 
@@ -143,4 +145,64 @@
     doTest(initial: before, expected: before)
   }
 
+
+
+  void "test keep blank lines between fields"() {
+    def text = '''\
+public class Test {
+  private static final Logger LOGGER = LoggerFactory.getLogger(AddCurrentUser.class);
+
+
+  private GlobalQueryService globalQueryService;
+  private EventCoordinationService eventCoordinationService;
+}
+'''
+    doTest(
+      initial: text,
+      expected: text,
+      rules: classic
+    )
+  }
+
+  void "test keep blank lines between fields more fair test"() {
+    doTest(
+      initial: '''\
+public class Test {
+    private static final int t = 12;
+
+
+    public int q = 2;
+    private int e = 3;
+    public int t11 = 23;
+
+    private void test() {
+    }
+
+    public void main() {
+    }
+
+}
+''',
+      expected: '''\
+public class Test {
+    private static final int t = 12;
+
+
+    public int q = 2;
+    public int t11 = 23;
+    private int e = 3;
+
+    public void main() {
+    }
+
+    private void test() {
+    }
+
+}
+''',
+      rules: classic
+    )
+  }
+
+
 }
diff --git a/java/java-tests/testSrc/com/intellij/psi/codeStyle/arrangement/JavaRearrangerFieldReferenceTest.groovy b/java/java-tests/testSrc/com/intellij/psi/codeStyle/arrangement/JavaRearrangerFieldReferenceTest.groovy
new file mode 100644
index 0000000..a2a996a
--- /dev/null
+++ b/java/java-tests/testSrc/com/intellij/psi/codeStyle/arrangement/JavaRearrangerFieldReferenceTest.groovy
@@ -0,0 +1,256 @@
+/*
+ * 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.psi.codeStyle.arrangement
+
+import com.intellij.psi.codeStyle.arrangement.match.StdArrangementMatchRule
+
+import static com.intellij.psi.codeStyle.arrangement.std.StdArrangementTokens.EntryType.*;
+import static com.intellij.psi.codeStyle.arrangement.std.StdArrangementTokens.Modifier.*;
+
+class JavaRearrangerFieldReferenceTest extends AbstractJavaRearrangerTest {
+
+  private List<StdArrangementMatchRule> defaultFieldsArrangement = [
+    rule(CLASS),
+    rule(FIELD, PUBLIC),
+    rule(FIELD, PROTECTED),
+    rule(FIELD, PACKAGE_PRIVATE),
+    rule(FIELD, PRIVATE)
+  ]
+
+
+  void "test keep referenced package private field before public one which has reference through binary expression"() {
+    doTest(initial: '''\
+public class TestRunnable {
+    int i = 1;
+    public int j = i + 1;
+    public int k = 3;
+    public int m = 23;
+}
+''',
+           expected: '''\
+public class TestRunnable {
+    public int k = 3;
+    public int m = 23;
+    int i = 1;
+    public int j = i + 1;
+}
+''',
+           rules: defaultFieldsArrangement
+    );
+  }
+
+  void "test keep referenced fields before those who has reference through binary expression"() {
+    doTest(initial: '''\
+public class javaTest {
+    int i1 = 1;
+    protected int i2 = i1 + 4;
+}
+''',
+           expected: '''\
+public class javaTest {
+    int i1 = 1;
+    protected int i2 = i1 + 4;
+}
+''',
+           rules: defaultFieldsArrangement
+    );
+  }
+
+  void "test keep referenced static fields before those who has reference through binary expression"() {
+    doTest(initial: '''\
+public class CodeFormatTest {
+        private static String PREFIX = "prefix.";
+        public static String NAME = PREFIX + "name";
+        private static String PRIVATE_NAME = PREFIX + "private name";
+        public static String TEST = "OK!";
+        public static String BOOK = "ATLAS";
+}
+''',
+            expected: '''\
+public class CodeFormatTest {
+        public static String TEST = "OK!";
+        public static String BOOK = "ATLAS";
+        private static String PREFIX = "prefix.";
+        private static String PRIVATE_NAME = PREFIX + "private name";
+        public static String NAME = PREFIX + "name";
+}
+''',
+            rules: defaultFieldsArrangement
+    );
+  }
+
+  void "test keep referenced static fields before those who has direct reference"() {
+    doTest(initial: '''\
+public class CodeFormatTest {
+        private static String PREFIX = "prefix.";
+        public static String NAME = PREFIX;
+}
+''',
+            expected: '''\
+public class CodeFormatTest {
+        private static String PREFIX = "prefix.";
+        public static String NAME = PREFIX;
+}
+''',
+            rules: defaultFieldsArrangement
+    );
+  }
+
+  void "test keep referenced fields before those who has direct reference"() {
+    doTest(initial: '''\
+public class CodeFormatTest {
+        private String PREFIX = "prefix.";
+        public String NAME = PREFIX;
+}
+''',
+           expected: '''\
+public class CodeFormatTest {
+        private String PREFIX = "prefix.";
+        public String NAME = PREFIX;
+}
+''',
+           rules: defaultFieldsArrangement
+    );
+  }
+
+  void "test keep referenced fields before those who has reference through polyadic expression"() {
+    doTest(initial: '''\
+public class CodeFormatTest {
+        private String PREFIX = "prefix.";
+        public String NAME = "ololo" + "bobob" + "line" + PREFIX + "ququ";
+}
+''',
+           expected: '''\
+public class CodeFormatTest {
+        private String PREFIX = "prefix.";
+        public String NAME = "ololo" + "bobob" + "line" + PREFIX + "ququ";
+}
+''',
+           rules: defaultFieldsArrangement
+    );
+  }
+
+  void "test keep referenced field before who has reference through parenthesized nested binary expression"() {
+    doTest(initial: '''\
+public class TestRunnable {
+    int i = 3;
+    public int j = (1 + i);
+}
+''',
+           expected: '''\
+public class TestRunnable {
+    int i = 3;
+    public int j = (1 + i);
+}
+''',
+           rules: defaultFieldsArrangement
+    );
+  }
+
+
+
+  void "test keep referenced fields before those who has reference through nested binary expression"() {
+    doTest(initial: '''\
+public class TestRunnable {
+    int i = 3;
+    public int j = (1 + 2 + (5 + (5 + (5 + i))) + (1 + (i + 1)) + (3 + i) + 5) + 4;
+}
+''',
+           expected: '''\
+public class TestRunnable {
+    int i = 3;
+    public int j = (1 + 2 + (5 + (5 + (5 + i))) + (1 + (i + 1)) + (3 + i) + 5) + 4;
+}
+''',
+           rules: defaultFieldsArrangement
+    );
+  }
+
+
+  void "test multiple references on instance fields"() {
+    doTest(initial: '''\
+public class TestRunnable {
+    int i = 3;
+    int k = 12;
+    public int j = (1 + 2 + (5 + (5 + (5 + i))) + (1 + (i + 1 + k)) + (3 + i) + 5) + 4;
+    public int q = 64;
+}
+''',
+           expected: '''\
+public class TestRunnable {
+    public int q = 64;
+    int i = 3;
+    int k = 12;
+    public int j = (1 + 2 + (5 + (5 + (5 + i))) + (1 + (i + 1 + k)) + (3 + i) + 5) + 4;
+}
+''',
+           rules: defaultFieldsArrangement
+    );
+  }
+
+
+  void "test field initializer has reference to method"() {
+    doTest(initial: '''\
+public class TestRunnable {
+    public int foo() {
+        return 15;
+    }
+
+    public int q = 64 + foo();
+    int i = 3;
+    int k = 12;
+}
+''',
+           expected: '''\
+public class TestRunnable {
+    public int q = 64 + foo();
+    int i = 3;
+    int k = 12;
+
+    public int foo() {
+        return 15;
+    }
+}
+''',
+           rules: [rule(CLASS),
+                   rule(FIELD, PUBLIC),
+                   rule(FIELD, PACKAGE_PRIVATE),
+                   rule(METHOD, PUBLIC)]
+    )
+  }
+
+  void "test illegal field reference arranged to legal"() {
+    doTest(initial: '''\
+public class Alfa {
+    int i = 3;
+    public int j = i + 1 + q;
+    int q = 2 + 3;
+    public int r = 3;
+}
+''',
+           expected: '''\
+public class Alfa {
+    public int r = 3;
+    int i = 3;
+    int q = 2 + 3;
+    public int j = i + 1 + q;
+}
+''',
+           rules: defaultFieldsArrangement
+    );
+  }
+
+}
diff --git a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterInEditorTest.java b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterInEditorTest.java
index 7355feb..ed79f2f 100644
--- a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterInEditorTest.java
+++ b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterInEditorTest.java
@@ -97,6 +97,39 @@
     doTest(before, after);
   }
 
+  public void testCaretLineAndPositionPreserved_WhenBracketOnNextLineWillBeFormatted() throws IOException {
+    String before = "public class Test {\n" +
+                    "        int a;\n" +
+                    "    \n" +
+                    "    public static void main(String[] args) {\n" +
+                    "                     <caret>\n" +
+                    "            }\n" +
+                    "\n" +
+                    "    static final long j = 2;\n" +
+                    "}";
+    String after = "public class Test {\n" +
+                   "    int a;\n" +
+                   "\n" +
+                   "    public static void main(String[] args) {\n" +
+                   "                     <caret>\n" +
+                   "    }\n" +
+                   "\n" +
+                   "    static final long j = 2;\n" +
+                   "}";
+    doTest(before, after);
+
+    before = "public class Test {\n" +
+             "        int a;\n" +
+             "    \n" +
+             "    public static void main(String[] args) {\n" +
+             "                     <caret>           \n" +
+             "                }\n" +
+             "\n" +
+             "    static final long j = 2;\n" +
+             "}";
+    doTest(before, after);
+  }
+
   public void doTest(@NotNull String before, @NotNull String after) throws IOException {
     configureFromFileText(getTestName(false) + ".java", before);
     CodeStyleManager.getInstance(getProject()).reformatText(getFile(), 0, getEditor().getDocument().getTextLength());
diff --git a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterTest.java b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterTest.java
index 4cedbc3..8adb06b 100644
--- a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterTest.java
+++ b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterTest.java
@@ -3004,6 +3004,7 @@
 
   public void testFormatterOnOffTags() throws Exception {
     getSettings().getRootSettings().FORMATTER_TAGS_ENABLED = true;
+    getSettings().IF_BRACE_FORCE = CommonCodeStyleSettings.FORCE_BRACES_ALWAYS;
     doTest();
   }
 
diff --git a/java/java-tests/testSrc/com/intellij/psi/resolve/ResolveMethod15Test.java b/java/java-tests/testSrc/com/intellij/psi/resolve/ResolveMethod15Test.java
index 36b1c4c..788febf 100644
--- a/java/java-tests/testSrc/com/intellij/psi/resolve/ResolveMethod15Test.java
+++ b/java/java-tests/testSrc/com/intellij/psi/resolve/ResolveMethod15Test.java
@@ -7,7 +7,6 @@
 import org.jetbrains.annotations.NonNls;
 import static org.junit.Assert.assertThat;
 import static org.hamcrest.core.IsInstanceOf.instanceOf;
-import static org.junit.Assert.assertTrue;
 
 /**
  * @author dsl
@@ -129,6 +128,16 @@
     assertTrue(containingClass != null ? containingClass.getName() : null, containingClass instanceof PsiAnonymousClass);
   }
 
+  public void testCovariantReturnTypeAnonymous() throws Exception {
+    final PsiReference ref = configureByFile();
+    assertThat(ref, instanceOf(PsiReferenceExpression.class));
+    final PsiReferenceExpression refExpr = (PsiReferenceExpression)ref;
+    final PsiElement resolve = refExpr.resolve();
+    assertTrue(resolve != null ? resolve.toString() : null, resolve instanceof PsiMethod);
+    final PsiClass containingClass = ((PsiMethod)resolve).getContainingClass();
+    assertTrue(containingClass != null ? containingClass.getName() : null, !(containingClass instanceof PsiAnonymousClass));
+  }
+
   public void testFilterFixedVsVarargs1() throws Exception {
     final PsiReference ref = configureByFile();
     assertThat(ref, instanceOf(PsiReferenceExpression.class));
diff --git a/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java
index 07f3a61..35560bf 100644
--- a/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java
+++ b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java
@@ -78,6 +78,22 @@
     doTest(new MockIntroduceVariableHandler("j", true, false, false, "int"));
   }
 
+  public void testAnonymousClass3() throws Exception {
+    doTest(new MockIntroduceVariableHandler("j", true, false, false, "Foo"));
+  }
+
+  public void testAnonymousClass4() throws Exception {
+    doTest(new MockIntroduceVariableHandler("j", true, false, false, "int"));
+  }
+
+  public void testAnonymousClass5() throws Exception {
+    doTest(new MockIntroduceVariableHandler("j", true, false, false, "int"));
+  }
+
+  public void testLambda() throws Exception {
+    doTest(new MockIntroduceVariableHandler("j", true, false, false, "int"));
+  }
+
   public void testParenthized() throws Exception {
     doTest(new MockIntroduceVariableHandler("temp", true, false, false, "int"));
   }
@@ -208,6 +224,18 @@
     doTest(new MockIntroduceVariableHandler("str", false, false, false, "java.lang.String"));
   }
 
+  public void testSubLiteralFailure() throws Exception {
+    try {
+      doTest(new MockIntroduceVariableHandler("str", false, false, false, "int"));
+    }
+    catch (Exception e) {
+      assertEquals(e.getMessage(), "Error message:Cannot perform refactoring.\n" +
+                                   "Selected block should represent an expression");
+      return;
+    }
+    fail("Should not be able to perform refactoring");
+  }
+
   public void testSubLiteralFromExpression() throws Exception {
     doTest(new MockIntroduceVariableHandler("str", false, false, false, "java.lang.String"));
   }
diff --git a/java/java-tests/testSrc/com/intellij/refactoring/PullUpTest.java b/java/java-tests/testSrc/com/intellij/refactoring/PullUpTest.java
index aa539bd..cbf0955 100644
--- a/java/java-tests/testSrc/com/intellij/refactoring/PullUpTest.java
+++ b/java/java-tests/testSrc/com/intellij/refactoring/PullUpTest.java
@@ -147,6 +147,10 @@
     doTest(false, new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class));
   }
 
+  public void testPublicMethodFromPrivateClassConflict() {
+    doTest(false, new RefactoringTestUtil.MemberDescriptor("HM", PsiClass.class), new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class));
+  }
+
   private void doTest(RefactoringTestUtil.MemberDescriptor... membersToFind) {
     doTest(true, membersToFind);
   }
diff --git a/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineParameterTest.java b/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineParameterTest.java
index 29d85f1..b49a306 100644
--- a/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineParameterTest.java
+++ b/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineParameterTest.java
@@ -134,6 +134,10 @@
     doTest(true);
   }
 
+  public void testFromClassInitializer() throws Exception {
+    doTest(false);
+  }
+
   public void testParameterWithWriteAccess() throws Exception {
     try {
       doTest(false);