Commit Graph
199701 Commits
Author SHA1 Message Date
Tagir Valeev eaec99dcce DataFlowInspection: npe fixes fixed
Fixes duplicating NPE expression are disabled when expression has side-effect (not when it's a method call)
Parentheses added to generated code when necessary
2017-07-27 19:06:34 +07:00
Tagir Valeev 4882d4a589 IDEA-176650 Provide a quick fix of "can produce NPE" that wraps qualifier with Obejcts.requireNonNull 2017-07-27 18:48:43 +07:00
Alexey Kudravtsev 1e41f2d63b cleanup, bring notnull back 2017-07-27 14:27:05 +03:00
Alexey Kudravtsev a937d18791 cleanup 2017-07-27 14:27:05 +03:00
Alexey Kudravtsev 9a423e5931 avoid attach listener/write action race which could lead to unresponsiveness
When we try to attach app listener in the unfortunate moment between application firing beforeWriteActionStart() and actual write action start, all attached listeners won't be fired during this write action.
To avoid that, we check that if after attaching listener the app is still trying to start write action, then we declare the moment
unfortunate, detach listener and try again.
2017-07-27 14:27:05 +03:00
Alexey Kudravtsev ff11452e25 reduce latency on typing in non-project files 2017-07-27 14:27:04 +03:00
Alexey Kudravtsev 9066cdb990 made ActivityTracker thread-safe 2017-07-27 14:27:04 +03:00
Alexey Kudravtsev 11293baef8 a little bit of performance
ForkJoinTask stupidly and slowly enumerates all ctrs looking for 'ctr(Throwable)' and calling it and,
if not found, calling default ctr by 'exClass.newInstance()' and then 'ex.initCause()'.
So to avoid (successfully) invoking 'exClass.newInstance()' and (unsuccessfully) call 'ex.initCause()',
throw earlier in 'exClass.newInstance(Throwable)'
2017-07-27 14:27:04 +03:00
Alexey Kudravtsev e9fc8fc962 cleanup 2017-07-27 14:27:04 +03:00
Ivan Bessonov 22a5027512 IDEA-175680 maven - "Create Module" quickfix recognizes "*.xml" module names now and treats them like files instead of directories 2017-07-27 14:20:26 +03:00
Dmitry Batrak 91df75cebe reopen popup in font combobox on font list loading (for IDEA-175031) 2017-07-27 13:59:25 +03:00
Mikhail Golubev 25b35c2439 EA-75072 Fix ISE when bad indent makes inserted docstring split function body
Specifically, it may cause shift of the inserted docstring (and the
following statement) relative to the rest of the function body thus
fragmenting its block structure.
CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement() can no longer
find PyFunction element at the updated range and, thus, buildAndInsert()
returns illegal null value.

Now we use the actual indentation of a function's body both when it's
larger than what is configured in the code style settings
(PyIntentionTest.testTypeInDocstring3) and when it's smaller
(PyIntentionTest.testGoogleDocStubCustomIndent) and operate solely
on the document's level in case of new docstrings to avoid
unwanted postprocess reformatting.

I also updated some of the existing test data so that it could reproduce
the problem by including more than one statement in a function's body.
2017-07-27 13:46:47 +03:00
nik 0158e8cfa7 JarRepositoryManager: use AtomicInteger instead of volatile
Because increment of volatile field isn't atomic.
2017-07-27 13:44:37 +03:00
nik 2c34bf42ee IDEA project configuration: corrected references to jetCheck module 2017-07-27 13:43:07 +03:00
Aleksey Pivovarov d920a51f5a git: propose better message for changelist name
* use only the subject instead of whole commit message
2017-07-27 13:20:25 +03:00
Dmitry Batrak 3944af1223 IDEA-175888 Multiple @since Javadoc tags are not supported by reformat 2017-07-27 13:10:29 +03:00
Tagir Valeev a0f8d2b7ee MismatchedCollectionQueryUpdateInspectionBase: ignore if implicit read
Fixes IDEA-168381 when Lombok plugin is present
2017-07-27 16:51:58 +07:00
Tagir Valeev dddf47d466 DataFlowRunner: disable inlining when inner lambda is requested to analyze
Fixes SimplifyStreamApiCallChainsInspectionTest#BooleanIdentity test (when outer method is analyzed, inner lambda was inlined and we cannot get its initial state)
2017-07-27 16:27:26 +07:00
Renaud Paquay c043811795 Improve diagnostic when failing to delete files in tests
* Before this change, a failure to delete a directory containing
  many files would be reported as a single error, for example:

java.io.IOException: Can't delete xxx
       (stack trace)

* After this change, a failure to delete a directory reports
  as many errors as there were files that could not be deleted,
  with the original IOException (and message) containing a more
  descriptive error message, for example:

------------------------------
[0]: [myDirectory]\myfile.txt: The process cannot access the file because it is being used by another process.
[1]: [myDirectory]
------------------------------

CompositeException (2 nested):
------------------------------
[0]: java.nio.file.FileSystemException: [myDirectory]\myfile.txt: The process cannot access the file because it is being used by another process.

       (stack trace)

[1]: java.nio.file.DirectoryNotEmptyException: [myDirectory]
       (stack trace)

------------------------------

(cherry picked from commit 4c2d7ef)
2017-07-27 11:17:16 +02:00
Tagir Valeev 3bd8fa6286 Minor fixes in CFG Stream inlining
1. Initial stream element nullability is derived from type
2. reportNullableArgumentsPassedToNonAnnotated fixed for method references
2017-07-27 12:45:42 +07:00
Tagir Valeev 05bce8d437 CFG inlining minor fixes (IDEA-CR-23268)
1. MethodCallInstruction#myReturnNullability is not lazy anymore
2. CFGBuilder#moveTopValue extracted
3. ReturnTransfer#toString() is one-liner now
2017-07-27 11:57:02 +07:00
Tagir Valeev cd69b1a33d CFGBuilder javadoc (IDEA-CR-23268) 2017-07-27 11:57:01 +07:00
Tagir Valeev 66eabcc11e CFG inlining: IgnoreNullabilityOnPrimitiveCast.java test 2017-07-27 11:57:01 +07:00
Tagir Valeev ff3e0fc007 CFG inlining: initial Stream support & full method reference support 2017-07-27 11:57:00 +07:00
Tagir Valeev 2012f8af93 StreamApiUtil split and moved to java-analysis-impl module
Refactoring-related methods moved from StreamApiUtil to StreamRefactoringUtil
2017-07-27 11:56:59 +07:00
Tagir Valeev efa7ff2509 CFG inliners: fixes according to review IDEA-CR-22449
1. CFGBuilder moved as top-level class
2. Complex path in DupInstruction removed (replaced with SpliceInstruction)
3. test174759 renamed to testTwoOptionalInteraction
4. PsiUtil.deparenthesizeExpression used
5. OptionalChainInliner: made constants private
6. LightVariableBuilder used to create temporary variables
2017-07-27 11:56:59 +07:00
Tagir Valeev c269298451 Fix IDEA-173235 Control flow analysis does not know about 'Collections.empty...()' and 'Collections.singleton...()' 2017-07-27 11:56:58 +07:00
Tagir Valeev 5cac0baf4a Optional inlining: dereference check; find equivalent variable state for derived variables 2017-07-27 11:56:58 +07:00
Tagir Valeev a56b901b16 OptionalChainInliner: Terminal inlining refactored 2017-07-27 11:56:57 +07:00
Tagir Valeev 7d7828f932 Lambda inlining: handle try-catches in lambda 2017-07-27 11:56:56 +07:00
Tagir Valeev 890a2c90eb CFG inlining preliminary implementation
Lambda calls like ((cast) x -> y).run() inlined
j.u.Optional chains inlined (with basic methodRef support)
2017-07-27 11:56:56 +07:00
Julia Beliaeva 9fc049ce6e [vcs-log] generate toString for VisiblePackRefresherImpl.State for logging 2017-07-27 07:07:36 +03:00
Julia Beliaeva 1c774c2723 [file-history] add some logging for empty history case
Having zero commits in file history is not a normal situation.
2017-07-27 07:05:47 +03:00
Gregory.Shrago 1626cb34b2 DBE-3157 2016.3 EAP uses .DataGrip2016.2 folder as default place for Project Folder 2017-07-27 04:16:52 +03:00
Gregory.Shrago 832ec51707 convert lastPath to system-dependent before checking 2017-07-27 04:16:51 +03:00
Julia Beliaeva 42ef763546 [vcs-log] better registry property description 2017-07-27 04:02:03 +03:00
Julia Beliaeva 468782e245 [git] move GRAFTED and REPLACED constants to GitLogUtil where they are used 2017-07-27 03:04:12 +03:00
Gregory.Shrago b709a88f52 IDEA-CR-23165 keep the new action in the original groups 2017-07-27 02:16:20 +03:00
Julia Beliaeva f4add2cc06 [git] no need to create linked multimap for storing records for hashes
Order of commit hashes is irrelevant, what matters is order of records for a hash. Ordinary multimap uses SmartList as a single collection, so it suffices for our purposes.
2017-07-27 01:03:07 +03:00
Ivan Chirkov 8a6e2998f1 HttpRequests: disable java's followRedirects 2017-07-27 00:00:03 +02:00
Julia Beliaeva eed01c2123 [git] collect "incomplete" merge commits and process them together
Due to an issue with -m parameter, in order to index merge commits that are same as one of their parents, their and their parents tree hashes are requested with additional "git log" calls.
In order to minimise number of required calls, its better to process such commits together. Ideally we'd like to do it at the very end. But since for each such commit a record is kept until it is processed,
 processing also is called when too much data (in terms of status lines) is accumulated.

IDEA-176504
2017-07-27 00:41:42 +03:00
Bas Leijdekkers b750dc1fa0 IDEA-176387 (Redundant call to String.format should also apply to System.out.printf) 2017-07-26 21:24:23 +02:00
Bas Leijdekkers fe2a529ddc IG: make test light 2017-07-26 21:24:23 +02:00
Sergey Malenkov a7c0d305db IDEA-175617 Implement extendable input field 2017-07-26 22:16:25 +03:00
Maxim.Mossienko f86d214b87 comment is replaced with javadoc 2017-07-26 19:34:48 +02:00
Ivan Chirkov 294c25507d Set productName as UserAgent for requests to plugin repository 2017-07-26 18:52:27 +02:00
Dmitry Batrak 2a669270a6 IDEA-175878 Wrong Tab behaviour for multiple carets in injected fragment 2017-07-26 19:49:16 +03:00
Elizaveta Shashkova 7313b81c5a Aborting commands in debug console (PY-22056) 2017-07-26 19:37:02 +03:00
Sergey Malenkov d722a38029 ExpandableTextField should extend JBTextField to support empty text 2017-07-26 19:26:50 +03:00
Bas Leijdekkers 6381877683 IG: more lenient setter detection in 'public' method with 'boolean' parameter" inspection (IDEA-176408) 2017-07-26 17:45:31 +02:00