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
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.
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)'
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.
Fixes SimplifyStreamApiCallChainsInspectionTest#BooleanIdentity test (when outer method is analyzed, inner lambda was inlined and we cannot get its initial state)
* 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)
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
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.
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