mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -63,7 +63,6 @@ fi
|
||||
# ---------------------------------------------------------------------
|
||||
if [ -n "$@@product_uc@@_JDK" -a -x "$@@product_uc@@_JDK/bin/java" ]; then
|
||||
JDK="$@@product_uc@@_JDK"
|
||||
echo "@@product_uc@@_JDK: $@@product_uc@@_JDK"
|
||||
fi
|
||||
|
||||
if [ -z "$JDK" ] || [ ! -x "$JDK/bin/java" ] &&
|
||||
@@ -72,25 +71,21 @@ if [ -z "$JDK" ] || [ ! -x "$JDK/bin/java" ] &&
|
||||
if [ ! -d "$JDK" ]; then
|
||||
JDK="$IDE_HOME/$JDK"
|
||||
fi
|
||||
echo "boot jdk: $JDK"
|
||||
fi
|
||||
|
||||
if [ -z "$JDK" ] || [ ! -x "$JDK/bin/java" ] &&
|
||||
[ "$OS_TYPE" = "Linux" ] && [ -x "$IDE_HOME/jre64/bin/java" ] && "$IDE_HOME/jre64/bin/java" -version > /dev/null 2>&1 ; then
|
||||
JDK="$IDE_HOME/jre64"
|
||||
echo "bundled jre: $JDK"
|
||||
fi
|
||||
|
||||
if [ -z "$JDK" ] || [ ! -x "$JDK/bin/java" ] &&
|
||||
[ -n "$JDK_HOME" -a -x "$JDK_HOME/bin/java" ]; then
|
||||
JDK="$JDK_HOME"
|
||||
echo "JDK_HOME: $JDK"
|
||||
fi
|
||||
|
||||
if [ -z "$JDK" ] || [ ! -x "$JDK/bin/java" ]; then
|
||||
if [ -n "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
|
||||
JDK="$JAVA_HOME"
|
||||
echo "JAVA_HOME: $JDK"
|
||||
else
|
||||
JAVA_BIN_PATH=`which java`
|
||||
if [ -n "$JAVA_BIN_PATH" ]; then
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
</target>
|
||||
|
||||
<target name="test" depends="init">
|
||||
<call_gant script="${project.home}/build/scripts/tests.gant"/>
|
||||
<call_gant script="${project.home}/build/scripts/tests_in_community.gant"/>
|
||||
</target>
|
||||
|
||||
<!-- The build task creates an updater.jar in ${out.dir}. This task bundles the updater and its dependencies into a single jar -->
|
||||
|
||||
@@ -226,20 +226,16 @@ public class DebuggerUtilsImpl extends DebuggerUtilsEx{
|
||||
return Boolean.TRUE.equals(debugProcess.getUserData(BatchEvaluator.REMOTE_SESSION_KEY));
|
||||
}
|
||||
|
||||
public interface SupplierThrowing<T, E extends Throwable> {
|
||||
T get() throws E;
|
||||
}
|
||||
|
||||
public static <T, E extends Exception> T suppressExceptions(SupplierThrowing<T, E> supplier, T defaultValue) throws E {
|
||||
public static <T, E extends Exception> T suppressExceptions(ThrowableComputable<T, E> supplier, T defaultValue) throws E {
|
||||
return suppressExceptions(supplier, defaultValue, true, null);
|
||||
}
|
||||
|
||||
public static <T, E extends Exception> T suppressExceptions(SupplierThrowing<T, E> supplier,
|
||||
public static <T, E extends Exception> T suppressExceptions(ThrowableComputable<T, E> supplier,
|
||||
T defaultValue,
|
||||
boolean ignorePCE,
|
||||
Class<E> rethrow) throws E {
|
||||
try {
|
||||
return supplier.get();
|
||||
return supplier.compute();
|
||||
}
|
||||
catch (ProcessCanceledException e) {
|
||||
if (!ignorePCE) {
|
||||
|
||||
@@ -25,8 +25,8 @@ import com.intellij.debugger.engine.DebugProcessImpl;
|
||||
import com.intellij.debugger.engine.DebuggerManagerThreadImpl;
|
||||
import com.intellij.debugger.engine.evaluation.EvaluateException;
|
||||
import com.intellij.debugger.engine.jdi.VirtualMachineProxy;
|
||||
import com.intellij.debugger.impl.DebuggerUtilsImpl;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.ThrowableComputable;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.ReflectionUtil;
|
||||
import com.intellij.util.ThreeState;
|
||||
@@ -357,13 +357,13 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy {
|
||||
return myVirtualMachine.mirrorOf(s);
|
||||
}
|
||||
|
||||
public StringReference mirrorOfStringLiteral(String s, DebuggerUtilsImpl.SupplierThrowing<StringReference, EvaluateException> generator)
|
||||
public StringReference mirrorOfStringLiteral(String s, ThrowableComputable<StringReference, EvaluateException> generator)
|
||||
throws EvaluateException {
|
||||
StringReference reference = myStringLiteralCache.get(s);
|
||||
if (reference != null && !reference.isCollected()) {
|
||||
return reference;
|
||||
}
|
||||
reference = generator.get();
|
||||
reference = generator.compute();
|
||||
myStringLiteralCache.put(s, reference);
|
||||
return reference;
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ public class JUnitUtil {
|
||||
return aPackage != null && aPackage.getDirectories(scope).length > 0;
|
||||
};
|
||||
|
||||
return foundCondition.value(TEST5_PACKAGE_FQN) || foundCondition.value("org.junit.platform.engine");
|
||||
return foundCondition.value(TEST5_PACKAGE_FQN);
|
||||
}
|
||||
|
||||
public static boolean isTestAnnotated(final PsiMethod method) {
|
||||
|
||||
@@ -237,7 +237,7 @@ public class MarkerType {
|
||||
PsiMethod[] overridings = processor.toArray(PsiMethod.EMPTY_ARRAY);
|
||||
if (overridings.length == 0) {
|
||||
final PsiClass aClass = method.getContainingClass();
|
||||
if (aClass != null && FunctionalExpressionSearch.search(aClass).findFirst() != null) {
|
||||
if (aClass != null && isAbstract && FunctionalExpressionSearch.search(aClass).findFirst() != null) {
|
||||
return "Has functional implementations";
|
||||
}
|
||||
return null;
|
||||
@@ -462,17 +462,19 @@ public class MarkerType {
|
||||
return super.process(psiMethod);
|
||||
}
|
||||
});
|
||||
PsiClass psiClass = ReadAction.compute(myMethod::getContainingClass);
|
||||
FunctionalExpressionSearch.search(psiClass).forEach(new CommonProcessors.CollectProcessor<PsiFunctionalExpression>() {
|
||||
@Override
|
||||
public boolean process(final PsiFunctionalExpression expr) {
|
||||
if (!updateComponent(expr, myRenderer.getComparator())) {
|
||||
indicator.cancel();
|
||||
if (myMethod.hasModifierProperty(PsiModifier.ABSTRACT)) {
|
||||
PsiClass psiClass = ReadAction.compute(myMethod::getContainingClass);
|
||||
FunctionalExpressionSearch.search(psiClass).forEach(new CommonProcessors.CollectProcessor<PsiFunctionalExpression>() {
|
||||
@Override
|
||||
public boolean process(final PsiFunctionalExpression expr) {
|
||||
if (!updateComponent(expr, myRenderer.getComparator())) {
|
||||
indicator.cancel();
|
||||
}
|
||||
indicator.checkCanceled();
|
||||
return super.process(expr);
|
||||
}
|
||||
indicator.checkCanceled();
|
||||
return super.process(expr);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class MissingIfBranchesFixer implements Fixer {
|
||||
}
|
||||
|
||||
private static void handleBranch(@NotNull Document doc, @NotNull PsiIfStatement ifStatement, @NotNull PsiElement beforeBranch, @Nullable PsiStatement branch) {
|
||||
if (branch instanceof PsiBlockStatement) return;
|
||||
if (branch instanceof PsiBlockStatement || beforeBranch.textMatches(PsiKeyword.ELSE) && branch instanceof PsiIfStatement) return;
|
||||
boolean transformingOneLiner = branch != null && (startLine(doc, beforeBranch) == startLine(doc, branch) ||
|
||||
startCol(doc, ifStatement) < startCol(doc, branch));
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
{
|
||||
if (a) <caret>
|
||||
else if (elsecond) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Foo {
|
||||
{
|
||||
if (a) {
|
||||
<caret>
|
||||
} else if (elsecond) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,6 +123,8 @@ public class CompleteStatementTest extends EditorActionTestCase {
|
||||
|
||||
public void testElseIf() throws Exception { doTest(); }
|
||||
|
||||
public void testBlockBeforeElseIf() { doTest(); }
|
||||
|
||||
public void testIncompleteElseIf() throws Exception { doTest(); }
|
||||
|
||||
public void testField() throws Exception { doTest(); }
|
||||
|
||||
@@ -40,9 +40,9 @@ import static org.junit.Assert.fail;
|
||||
* @author Tagir Valeev
|
||||
*/
|
||||
public class ActionHint {
|
||||
final String myExpectedText;
|
||||
final boolean myShouldPresent;
|
||||
final ProblemHighlightType myHighlightType;
|
||||
private final String myExpectedText;
|
||||
private final boolean myShouldPresent;
|
||||
private final ProblemHighlightType myHighlightType;
|
||||
|
||||
private ActionHint(String expectedText, boolean shouldPresent, ProblemHighlightType severity) {
|
||||
myExpectedText = expectedText;
|
||||
@@ -67,7 +67,7 @@ public class ActionHint {
|
||||
* @return true if this ActionHint checks that some action should be present
|
||||
* or false if it checks that some action should be absent
|
||||
*/
|
||||
public boolean shouldPresent() {
|
||||
boolean shouldPresent() {
|
||||
return myShouldPresent;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -22,12 +22,11 @@ import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.extensions.CustomLoadingExtensionPointBean;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.xmlb.annotations.Tag;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class IntentionActionBean extends CustomLoadingExtensionPointBean {
|
||||
@@ -67,6 +66,7 @@ public class IntentionActionBean extends CustomLoadingExtensionPointBean {
|
||||
return descriptionDirectoryName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public IntentionAction instantiate() throws ClassNotFoundException {
|
||||
return (IntentionAction)instantiateExtension(className, ApplicationManager.getApplication().getPicoContainer());
|
||||
}
|
||||
|
||||
-1
@@ -42,7 +42,6 @@ class CompilationTasksImpl extends CompilationTasks {
|
||||
|
||||
ensureKotlinCompilerAddedToClassPath()
|
||||
|
||||
context.projectBuilder.cleanOutput()
|
||||
context.messages.progress("Compiling project")
|
||||
try {
|
||||
if (moduleNames == null) {
|
||||
|
||||
@@ -75,6 +75,11 @@ public class DelegatingGlobalSearchScope extends GlobalSearchScope {
|
||||
return myBaseScope.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + "[" + myBaseScope + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments;
|
||||
import com.intellij.openapi.progress.ProgressIndicatorProvider;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectCoreUtil;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.RecursionManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -367,7 +366,7 @@ public class StubBasedPsiElementBase<T extends StubElement> extends ASTDelegateP
|
||||
@NotNull
|
||||
public IStubElementType getElementType() {
|
||||
if (!(myElementType instanceof IStubElementType)) {
|
||||
throw new AssertionError("Not a stub type: " + myElementType + " in " + getClass());
|
||||
throw new ClassCastException("Not a stub type: " + myElementType + " in " + getClass());
|
||||
}
|
||||
return (IStubElementType)myElementType;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
@@ -42,6 +43,7 @@ class CachedValueLeakChecker {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.util.CachedValueChecker");
|
||||
private static final boolean DO_CHECKS = ApplicationManager.getApplication().isUnitTestMode();
|
||||
private static final Set<String> ourCheckedKeys = ContainerUtil.newConcurrentSet();
|
||||
private static final boolean JAVA9 = SystemInfo.isJavaVersionAtLeast("9");
|
||||
|
||||
static void checkProvider(@NotNull final CachedValueProvider provider,
|
||||
@NotNull final Key key,
|
||||
@@ -49,7 +51,9 @@ class CachedValueLeakChecker {
|
||||
if (!DO_CHECKS || ApplicationInfoImpl.isInStressTest()) return;
|
||||
if (!ourCheckedKeys.add(key.toString())) return; // store strings because keys are created afresh in each (test) project
|
||||
|
||||
findReferencedPsi(provider, userDataHolder, 5);
|
||||
if (!JAVA9) {
|
||||
findReferencedPsi(provider, userDataHolder, 5);
|
||||
}
|
||||
}
|
||||
|
||||
private static synchronized void findReferencedPsi(@NotNull final Object root,
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
*/
|
||||
package com.intellij.util;
|
||||
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.UserDataHolderEx;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import com.intellij.openapi.util.UserDataHolderEx;
|
||||
import com.intellij.psi.util.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.intellij.diff.tools.util.base.HighlightPolicy;
|
||||
import com.intellij.diff.tools.util.base.IgnorePolicy;
|
||||
import com.intellij.diff.tools.util.base.TextDiffViewerUtil;
|
||||
import com.intellij.diff.tools.util.text.LineOffsets;
|
||||
import com.intellij.diff.tools.util.text.LineOffsetsUtil;
|
||||
import com.intellij.diff.tools.util.text.MergeInnerDifferences;
|
||||
import com.intellij.diff.tools.util.text.TextDiffProviderBase;
|
||||
import com.intellij.diff.util.*;
|
||||
@@ -406,7 +407,7 @@ public class TextMergeViewer implements MergeTool.MergeViewer {
|
||||
indicator.checkCanceled();
|
||||
return ContainerUtil.map(contents, content -> content.getDocument().getImmutableCharSequence());
|
||||
});
|
||||
List<LineOffsets> lineOffsets = ContainerUtil.map(sequences, LineOffsets::create);
|
||||
List<LineOffsets> lineOffsets = ContainerUtil.map(sequences, LineOffsetsUtil::create);
|
||||
|
||||
ComparisonManager manager = ComparisonManager.getInstance();
|
||||
List<MergeLineFragment> lineFragments = manager.compareLines(sequences.get(0), sequences.get(1), sequences.get(2),
|
||||
|
||||
@@ -15,61 +15,14 @@
|
||||
*/
|
||||
package com.intellij.diff.tools.util.text;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import gnu.trove.TIntArrayList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
public interface LineOffsets {
|
||||
int getLineStart(int line);
|
||||
|
||||
public class LineOffsets {
|
||||
private final int[] myLineEnds;
|
||||
private final int myTextLength;
|
||||
int getLineEnd(int line);
|
||||
|
||||
private LineOffsets(int[] ends, int length) {
|
||||
myLineEnds = ends;
|
||||
myTextLength = length;
|
||||
}
|
||||
int getLineNumber(int offset);
|
||||
|
||||
public int getLineStart(int line) {
|
||||
checkLineIndex(line);
|
||||
if (line == 0) return 0;
|
||||
return myLineEnds[line - 1] + 1;
|
||||
}
|
||||
int getLineCount();
|
||||
|
||||
public int getLineEnd(int line) {
|
||||
checkLineIndex(line);
|
||||
return myLineEnds[line];
|
||||
}
|
||||
|
||||
public int getLineCount() {
|
||||
return myLineEnds.length;
|
||||
}
|
||||
|
||||
public int getTextLength() {
|
||||
return myTextLength;
|
||||
}
|
||||
|
||||
private void checkLineIndex(int index) {
|
||||
if (index < 0 || index >= getLineCount()) {
|
||||
throw new IndexOutOfBoundsException("Wrong line: " + index + ". Available lines count: " + getLineCount());
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static LineOffsets create(@NotNull CharSequence text) {
|
||||
TIntArrayList ends = new TIntArrayList();
|
||||
|
||||
int index = 0;
|
||||
while (true) {
|
||||
int lineEnd = StringUtil.indexOf(text, '\n', index);
|
||||
if (lineEnd != -1) {
|
||||
ends.add(lineEnd);
|
||||
index = lineEnd + 1;
|
||||
}
|
||||
else {
|
||||
ends.add(text.length());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return new LineOffsets(ends.toNativeArray(), text.length());
|
||||
}
|
||||
int getTextLength();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.diff.tools.util.text;
|
||||
|
||||
import com.intellij.diff.util.DiffUtil;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import gnu.trove.TIntArrayList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class LineOffsetsUtil {
|
||||
public static LineOffsets create(@NotNull Document document) {
|
||||
return new LineOffsetsDocumentWrapper(document);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static LineOffsets create(@NotNull CharSequence text) {
|
||||
TIntArrayList ends = new TIntArrayList();
|
||||
|
||||
int index = 0;
|
||||
while (true) {
|
||||
int lineEnd = StringUtil.indexOf(text, '\n', index);
|
||||
if (lineEnd != -1) {
|
||||
ends.add(lineEnd);
|
||||
index = lineEnd + 1;
|
||||
}
|
||||
else {
|
||||
ends.add(text.length());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return new LineOffsetsImpl(ends.toNativeArray(), text.length());
|
||||
}
|
||||
|
||||
private static class LineOffsetsImpl implements LineOffsets {
|
||||
private final int[] myLineEnds;
|
||||
private final int myTextLength;
|
||||
|
||||
private LineOffsetsImpl(int[] lineEnds, int textLength) {
|
||||
myLineEnds = lineEnds;
|
||||
myTextLength = textLength;
|
||||
}
|
||||
|
||||
public int getLineStart(int line) {
|
||||
checkLineIndex(line);
|
||||
if (line == 0) return 0;
|
||||
return myLineEnds[line - 1] + 1;
|
||||
}
|
||||
|
||||
public int getLineEnd(int line) {
|
||||
checkLineIndex(line);
|
||||
return myLineEnds[line];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLineNumber(int offset) {
|
||||
if (offset < 0 || offset > getTextLength()) {
|
||||
throw new IndexOutOfBoundsException("Wrong offset: " + offset + ". Available text length: " + getTextLength());
|
||||
}
|
||||
if (offset == 0) return 0;
|
||||
if (offset == getTextLength()) return getLineCount() - 1;
|
||||
|
||||
int bsResult = Arrays.binarySearch(myLineEnds, offset);
|
||||
return bsResult >= 0 ? bsResult : -bsResult - 1;
|
||||
}
|
||||
|
||||
public int getLineCount() {
|
||||
return myLineEnds.length;
|
||||
}
|
||||
|
||||
public int getTextLength() {
|
||||
return myTextLength;
|
||||
}
|
||||
|
||||
private void checkLineIndex(int index) {
|
||||
if (index < 0 || index >= getLineCount()) {
|
||||
throw new IndexOutOfBoundsException("Wrong line: " + index + ". Available lines count: " + getLineCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class LineOffsetsDocumentWrapper implements LineOffsets {
|
||||
@NotNull private final Document myDocument;
|
||||
|
||||
public LineOffsetsDocumentWrapper(@NotNull Document document) {
|
||||
myDocument = document;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLineStart(int line) {
|
||||
return myDocument.getLineStartOffset(line);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLineEnd(int line) {
|
||||
return myDocument.getLineEndOffset(line);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLineNumber(int offset) {
|
||||
return myDocument.getLineNumber(offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLineCount() {
|
||||
return DiffUtil.getLineCount(myDocument);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTextLength() {
|
||||
return myDocument.getTextLength();
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -57,7 +57,7 @@ public class SimpleThreesideTextDiffProvider extends TextDiffProviderBase {
|
||||
ComparisonPolicy comparisonPolicy = ignorePolicy.getComparisonPolicy();
|
||||
|
||||
List<CharSequence> sequences = ContainerUtil.list(text1, text2, text3);
|
||||
List<LineOffsets> lineOffsets = ContainerUtil.map(sequences, LineOffsets::create);
|
||||
List<LineOffsets> lineOffsets = ContainerUtil.map(sequences, LineOffsetsUtil::create);
|
||||
|
||||
indicator.checkCanceled();
|
||||
List<MergeLineFragment> lineFragments = ComparisonManager.getInstance().compareLines(text1, text2, text3, comparisonPolicy, indicator);
|
||||
|
||||
@@ -858,16 +858,7 @@ public class DiffUtil {
|
||||
|
||||
@NotNull
|
||||
public static TextRange getLinesRange(@NotNull Document document, int line1, int line2, boolean includeNewline) {
|
||||
if (line1 == line2) {
|
||||
int lineStartOffset = line1 < getLineCount(document) ? document.getLineStartOffset(line1) : document.getTextLength();
|
||||
return new TextRange(lineStartOffset, lineStartOffset);
|
||||
}
|
||||
else {
|
||||
int startOffset = document.getLineStartOffset(line1);
|
||||
int endOffset = document.getLineEndOffset(line2 - 1);
|
||||
if (includeNewline && endOffset < document.getTextLength()) endOffset++;
|
||||
return new TextRange(startOffset, endOffset);
|
||||
}
|
||||
return getLinesRange(LineOffsetsUtil.create(document), line1, line2, includeNewline);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package com.intellij.diff.util
|
||||
|
||||
import com.intellij.diff.DiffTestCase
|
||||
import com.intellij.diff.tools.util.text.LineOffsets
|
||||
import com.intellij.diff.tools.util.text.LineOffsetsUtil
|
||||
import com.intellij.openapi.editor.impl.DocumentImpl
|
||||
|
||||
class LineOffsetsTest : DiffTestCase() {
|
||||
@@ -40,26 +40,34 @@ class LineOffsetsTest : DiffTestCase() {
|
||||
}
|
||||
|
||||
private fun checkSameAsDocument(text: String) {
|
||||
val lineOffsets = LineOffsets.create(text)
|
||||
val document = DocumentImpl(text)
|
||||
val lineOffsets1 = LineOffsetsUtil.create(DocumentImpl(text))
|
||||
val lineOffsets2 = LineOffsetsUtil.create(text)
|
||||
|
||||
assertEquals(lineOffsets.lineCount, getLineCount(document))
|
||||
assertEquals(lineOffsets.textLength, document.textLength)
|
||||
assertEquals(lineOffsets1.lineCount, lineOffsets2.lineCount)
|
||||
assertEquals(lineOffsets1.textLength, lineOffsets2.textLength)
|
||||
|
||||
for (i in 0 until lineOffsets.lineCount) {
|
||||
assertEquals(lineOffsets.getLineStart(i), document.getLineStartOffset(i))
|
||||
assertEquals(lineOffsets.getLineEnd(i), document.getLineEndOffset(i))
|
||||
for (i in 0 until lineOffsets1.lineCount) {
|
||||
assertEquals(lineOffsets1.getLineStart(i), lineOffsets2.getLineStart(i))
|
||||
assertEquals(lineOffsets1.getLineEnd(i), lineOffsets2.getLineEnd(i))
|
||||
}
|
||||
|
||||
for (i in 0..lineOffsets1.textLength) {
|
||||
assertEquals(lineOffsets1.getLineNumber(i), lineOffsets2.getLineNumber(i))
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkOffsets(text: String, vararg offsets: IntPair) {
|
||||
val lineOffsets = LineOffsets.create(text)
|
||||
val lineOffsets = LineOffsetsUtil.create(text)
|
||||
|
||||
assertEquals(offsets.size, lineOffsets.lineCount)
|
||||
|
||||
offsets.forEachIndexed { i, value ->
|
||||
assertEquals(lineOffsets.getLineStart(i), value.val1)
|
||||
assertEquals(lineOffsets.getLineEnd(i), value.val2)
|
||||
offsets.forEachIndexed { line, value ->
|
||||
assertEquals(lineOffsets.getLineStart(line), value.val1)
|
||||
assertEquals(lineOffsets.getLineEnd(line), value.val2)
|
||||
|
||||
for (offset in lineOffsets.getLineStart(line)..lineOffsets.getLineEnd(line)) {
|
||||
assertEquals(line, lineOffsets.getLineNumber(offset))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,8 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package git4idea.branch;
|
||||
package com.intellij.dvcs.branch;
|
||||
|
||||
public enum GitBranchType {
|
||||
LOCAL, REMOTE
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface BranchType {
|
||||
|
||||
@NotNull
|
||||
String getName();
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.dvcs.branch;
|
||||
|
||||
import com.intellij.dvcs.repo.AbstractRepositoryManager;
|
||||
import com.intellij.dvcs.repo.Repository;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.intellij.util.containers.ContainerUtil.map2List;
|
||||
import static com.intellij.util.containers.ContainerUtil.newArrayList;
|
||||
|
||||
public abstract class DvcsBranchManager<T extends Repository> {
|
||||
@NotNull private final AbstractRepositoryManager<T> myRepositoryManager;
|
||||
@NotNull private final DvcsBranchSettings myBranchSettings;
|
||||
@NotNull public final BranchStorage myPredefinedFavoriteBranches = new BranchStorage();
|
||||
|
||||
protected DvcsBranchManager(@NotNull AbstractRepositoryManager<T> repositoryManager,
|
||||
@NotNull DvcsBranchSettings settings,
|
||||
@NotNull BranchType[] branchTypes) {
|
||||
myRepositoryManager = repositoryManager;
|
||||
myBranchSettings = settings;
|
||||
for (BranchType type : branchTypes) {
|
||||
String defaultBranchName = getDefaultBranchName(type);
|
||||
if (!StringUtil.isEmptyOrSpaces(defaultBranchName)) {
|
||||
myPredefinedFavoriteBranches.myBranches.put(type.getName(), constructDefaultBranchPredefinedList(defaultBranchName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<DvcsBranchInfo> constructDefaultBranchPredefinedList(@NotNull String defaultBranchName) {
|
||||
List<DvcsBranchInfo> branchInfos = newArrayList(new DvcsBranchInfo("", defaultBranchName));
|
||||
branchInfos.addAll(map2List(myRepositoryManager.getRepositories(),
|
||||
repository -> new DvcsBranchInfo(repository.getRoot().getPath(), defaultBranchName)));
|
||||
return branchInfos;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected String getDefaultBranchName(@NotNull BranchType type) {return null;}
|
||||
|
||||
public boolean isFavorite(@Nullable BranchType branchType, @Nullable Repository repository, @NotNull String branchName) {
|
||||
if (branchType == null) return false;
|
||||
String branchTypeName = branchType.getName();
|
||||
if (myBranchSettings.getFavorites().contains(branchTypeName, repository, branchName)) return true;
|
||||
if (myBranchSettings.getExcludedFavorites().contains(branchTypeName, repository, branchName)) return false;
|
||||
return myPredefinedFavoriteBranches.contains(branchTypeName, repository, branchName);
|
||||
}
|
||||
|
||||
public void setFavorite(@Nullable BranchType branchType,
|
||||
@Nullable Repository repository,
|
||||
@NotNull String branchName,
|
||||
boolean shouldBeFavorite) {
|
||||
if (branchType == null) return;
|
||||
String branchTypeName = branchType.getName();
|
||||
if (shouldBeFavorite) {
|
||||
myBranchSettings.getFavorites().add(branchTypeName, repository, branchName);
|
||||
myBranchSettings.getExcludedFavorites().remove(branchTypeName, repository, branchName);
|
||||
}
|
||||
else {
|
||||
if (myBranchSettings.getFavorites().contains(branchTypeName, repository, branchName)) {
|
||||
myBranchSettings.getFavorites().remove(branchTypeName, repository, branchName);
|
||||
}
|
||||
else if (myPredefinedFavoriteBranches.contains(branchTypeName, repository, branchName)) {
|
||||
myBranchSettings.getExcludedFavorites().add(branchTypeName, repository, branchName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.dvcs.branch;
|
||||
|
||||
import com.intellij.util.xmlb.annotations.Tag;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class DvcsBranchSettings {
|
||||
@Tag("favorite-branches")
|
||||
private BranchStorage myFavoriteBranches = new BranchStorage();
|
||||
@Tag("excluded-from-favorite")
|
||||
private BranchStorage myExcludedFavorites = new BranchStorage();
|
||||
|
||||
@NotNull
|
||||
public BranchStorage getFavorites() {
|
||||
return myFavoriteBranches;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public BranchStorage getExcludedFavorites() {
|
||||
return myExcludedFavorites;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -58,7 +58,7 @@ public class ExternalProjectsManager implements PersistentStateComponent<Externa
|
||||
private static final Logger LOG = Logger.getInstance(ExternalProjectsManager.class);
|
||||
|
||||
private final AtomicBoolean isInitializationFinished = new AtomicBoolean();
|
||||
private final AtomicBoolean isInitializationWasStarted = new AtomicBoolean();
|
||||
private final AtomicBoolean isInitializationStarted = new AtomicBoolean();
|
||||
private final CompositeRunnable myPostInitializationActivities = new CompositeRunnable();
|
||||
@NotNull
|
||||
private ExternalProjectsState myState = new ExternalProjectsState();
|
||||
@@ -118,7 +118,7 @@ public class ExternalProjectsManager implements PersistentStateComponent<Externa
|
||||
}
|
||||
|
||||
public void init() {
|
||||
if (isInitializationWasStarted.getAndSet(true)) return;
|
||||
if (isInitializationStarted.getAndSet(true)) return;
|
||||
|
||||
myWatcher = new ExternalSystemProjectsWatcher(myProject);
|
||||
myWatcher.start();
|
||||
|
||||
@@ -51,7 +51,7 @@ public class PsiSearchRequest {
|
||||
this.caseSensitive = caseSensitive;
|
||||
this.processor = processor;
|
||||
if (searchScope instanceof GlobalSearchScope && ((GlobalSearchScope)searchScope).getProject() == null) {
|
||||
throw new AssertionError("Every search scope must be associated with a project");
|
||||
throw new AssertionError("Every search scope must be associated with a project: " + searchScope);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,11 @@
|
||||
*/
|
||||
package com.intellij.openapi.vcs.checkin;
|
||||
|
||||
import com.intellij.openapi.util.Getter;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.util.PairConsumer;
|
||||
import com.intellij.util.containers.Convertor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@@ -43,15 +41,11 @@ public class StepIntersection<Data, Area> {
|
||||
private Area myCurArea;
|
||||
private final List<Area> myAreas;
|
||||
private final HackSearch<Data,Area,TextRange> myHackSearch;
|
||||
// EA-28497, EA-26379
|
||||
private final Getter<String> myDebugDocumentTextGetter;
|
||||
|
||||
public StepIntersection(Convertor<Data, TextRange> dataConvertor,
|
||||
Convertor<Area, TextRange> areasConvertor,
|
||||
final List<Area> areas,
|
||||
Getter<String> debugDocumentTextGetter) {
|
||||
final List<Area> areas) {
|
||||
myAreas = areas;
|
||||
myDebugDocumentTextGetter = debugDocumentTextGetter;
|
||||
myAreaIndex = 0;
|
||||
myDataConvertor = dataConvertor;
|
||||
myAreasConvertor = areasConvertor;
|
||||
@@ -59,10 +53,6 @@ public class StepIntersection<Data, Area> {
|
||||
(o1, o2) -> o1.intersects(o2) ? 0 : o1.getStartOffset() < o2.getStartOffset() ? -1 : 1);
|
||||
}
|
||||
|
||||
public void resetIndex() {
|
||||
myAreaIndex = 0;
|
||||
}
|
||||
|
||||
public List<Data> process(final Iterable<Data> data) {
|
||||
final List<Data> result = new ArrayList<>();
|
||||
process(data, (data1, area) -> result.add(data1));
|
||||
|
||||
+9
-1
@@ -18,11 +18,14 @@ package com.intellij.application.options.codeStyle;
|
||||
|
||||
import com.intellij.application.options.CodeStyleAbstractPanel;
|
||||
import com.intellij.application.options.TabbedLanguageCodeStylePanel;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.application.ApplicationBundle;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.options.ex.Settings;
|
||||
import com.intellij.psi.codeStyle.CodeStyleScheme;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSchemes;
|
||||
import com.intellij.ui.components.labels.SwingActionLink;
|
||||
@@ -103,7 +106,12 @@ public class CodeStyleMainPanel extends JPanel implements TabbedLanguageCodeStyl
|
||||
|
||||
@Override
|
||||
public void afterCurrentSettingsChanged() {
|
||||
mySchemesPanel.updateOnCurrentSettingsChange();
|
||||
mySchemesPanel.updateOnCurrentSettingsChange();
|
||||
DataContext context = DataManager.getInstance().getDataContext(mySettingsPanel);
|
||||
Settings settings = Settings.KEY.getData(context);
|
||||
if (settings != null) {
|
||||
settings.revalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+7
-1
@@ -76,10 +76,16 @@ public abstract class ColorSchemeActions extends AbstractSchemeActions<EditorCol
|
||||
});
|
||||
if (imported != null) {
|
||||
getOptions().addImportedScheme(imported);
|
||||
getSchemesPanel()
|
||||
.showStatus(
|
||||
ApplicationBundle.message("settings.editor.scheme.import.success", importSource.getPresentableUrl(), imported.getName()),
|
||||
MessageType.INFO);
|
||||
}
|
||||
}
|
||||
catch (SchemeImportException e) {
|
||||
getSchemesPanel().showStatus("Import failed: " + e.getMessage(), MessageType.ERROR);
|
||||
getSchemesPanel()
|
||||
.showStatus(ApplicationBundle.message("settings.editor.scheme.import.failure", importSource.getPresentableUrl()),
|
||||
MessageType.ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-2
@@ -33,7 +33,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.FutureTask;
|
||||
|
||||
public class RearrangeCodeProcessor extends AbstractLayoutCodeProcessor {
|
||||
@@ -62,11 +61,20 @@ public class RearrangeCodeProcessor extends AbstractLayoutCodeProcessor {
|
||||
super(file.getProject(), file, PROGRESS_TEXT, COMMAND_NAME, false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused") // Required for compatibility with external plugins.
|
||||
public RearrangeCodeProcessor(@NotNull Project project,
|
||||
@NotNull PsiFile[] files,
|
||||
@NotNull String commandName,
|
||||
@Nullable Runnable postRunnable) {
|
||||
super(project, files, PROGRESS_TEXT, commandName, postRunnable, false);
|
||||
this(project, files, commandName, postRunnable, false);
|
||||
}
|
||||
|
||||
public RearrangeCodeProcessor(@NotNull Project project,
|
||||
@NotNull PsiFile[] files,
|
||||
@NotNull String commandName,
|
||||
@Nullable Runnable postRunnable,
|
||||
boolean processChangedTextOnly) {
|
||||
super(project, files, PROGRESS_TEXT, commandName, postRunnable, processChangedTextOnly);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings;
|
||||
import com.intellij.codeInsight.daemon.ReferenceImporter;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInspection.HintAction;
|
||||
import com.intellij.injected.editor.EditorWindow;
|
||||
import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.IdeActions;
|
||||
@@ -80,7 +81,9 @@ public class ShowAutoImportPass extends TextEditorHighlightingPass {
|
||||
Application application = ApplicationManager.getApplication();
|
||||
application.assertIsDispatchThread();
|
||||
if (!application.isUnitTestMode() && !myEditor.getContentComponent().hasFocus()) return;
|
||||
if (DumbService.isDumb(myProject)) return;
|
||||
if (DumbService.isDumb(myProject) || !myFile.isValid()) return;
|
||||
if (myEditor.isDisposed() || myEditor instanceof EditorWindow && !((EditorWindow)myEditor).isValid()) return;
|
||||
|
||||
int caretOffset = myEditor.getCaretModel().getOffset();
|
||||
importUnambiguousImports(caretOffset);
|
||||
List<HighlightInfo> visibleHighlights = getVisibleHighlights(myStartOffset, myEndOffset, myProject, myEditor);
|
||||
|
||||
+29
-41
@@ -66,8 +66,6 @@ import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import javax.swing.event.PopupMenuEvent;
|
||||
import javax.swing.event.PopupMenuListener;
|
||||
import java.awt.*;
|
||||
@@ -142,12 +140,12 @@ public class IntentionHintComponent implements Disposable, ScrollAwareHint {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static IntentionHintComponent showIntentionHint(@NotNull final Project project,
|
||||
@NotNull PsiFile file,
|
||||
@NotNull final Editor editor,
|
||||
@NotNull ShowIntentionsPass.IntentionsInfo intentions,
|
||||
boolean showExpanded,
|
||||
@NotNull Point position) {
|
||||
private static IntentionHintComponent showIntentionHint(@NotNull final Project project,
|
||||
@NotNull PsiFile file,
|
||||
@NotNull final Editor editor,
|
||||
@NotNull ShowIntentionsPass.IntentionsInfo intentions,
|
||||
boolean showExpanded,
|
||||
@NotNull Point position) {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
final IntentionHintComponent component = new IntentionHintComponent(project, file, editor, intentions);
|
||||
|
||||
@@ -466,31 +464,28 @@ public class IntentionHintComponent implements Disposable, ScrollAwareHint {
|
||||
myPopupShown = false;
|
||||
}
|
||||
});
|
||||
myPopup.addListSelectionListener(new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(@NotNull ListSelectionEvent e) {
|
||||
final Object source = e.getSource();
|
||||
highlighter.dropHighlight();
|
||||
injectionHighlighter.dropHighlight();
|
||||
|
||||
if (source instanceof DataProvider) {
|
||||
final Object selectedItem = PlatformDataKeys.SELECTED_ITEM.getData((DataProvider)source);
|
||||
if (selectedItem instanceof IntentionActionWithTextCaching) {
|
||||
final IntentionAction action = ((IntentionActionWithTextCaching)selectedItem).getAction();
|
||||
if (action instanceof SuppressIntentionActionFromFix) {
|
||||
if (injectedFile != null && ((SuppressIntentionActionFromFix)action).isShouldBeAppliedToInjectionHost() == ThreeState.NO) {
|
||||
final PsiElement at = injectedFile.findElementAt(injectedEditor.getCaretModel().getOffset());
|
||||
final PsiElement container = ((SuppressIntentionActionFromFix)action).getContainer(at);
|
||||
if (container != null) {
|
||||
injectionHighlighter.highlight(container, Collections.singletonList(container));
|
||||
}
|
||||
myPopup.addListSelectionListener(e -> {
|
||||
final Object source = e.getSource();
|
||||
highlighter.dropHighlight();
|
||||
injectionHighlighter.dropHighlight();
|
||||
|
||||
if (source instanceof DataProvider) {
|
||||
final Object selectedItem = PlatformDataKeys.SELECTED_ITEM.getData((DataProvider)source);
|
||||
if (selectedItem instanceof IntentionActionWithTextCaching) {
|
||||
final IntentionAction action = ((IntentionActionWithTextCaching)selectedItem).getAction();
|
||||
if (action instanceof SuppressIntentionActionFromFix) {
|
||||
if (injectedFile != null && ((SuppressIntentionActionFromFix)action).isShouldBeAppliedToInjectionHost() == ThreeState.NO) {
|
||||
final PsiElement at = injectedFile.findElementAt(injectedEditor.getCaretModel().getOffset());
|
||||
final PsiElement container = ((SuppressIntentionActionFromFix)action).getContainer(at);
|
||||
if (container != null) {
|
||||
injectionHighlighter.highlight(container, Collections.singletonList(container));
|
||||
}
|
||||
else {
|
||||
final PsiElement at = myFile.findElementAt(myEditor.getCaretModel().getOffset());
|
||||
final PsiElement container = ((SuppressIntentionActionFromFix)action).getContainer(at);
|
||||
if (container != null) {
|
||||
highlighter.highlight(container, Collections.singletonList(container));
|
||||
}
|
||||
}
|
||||
else {
|
||||
final PsiElement at = myFile.findElementAt(myEditor.getCaretModel().getOffset());
|
||||
final PsiElement container = ((SuppressIntentionActionFromFix)action).getContainer(at);
|
||||
if (container != null) {
|
||||
highlighter.highlight(container, Collections.singletonList(container));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -515,12 +510,7 @@ public class IntentionHintComponent implements Disposable, ScrollAwareHint {
|
||||
}
|
||||
|
||||
Disposer.register(this, myPopup);
|
||||
Disposer.register(myPopup, new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
}
|
||||
});
|
||||
Disposer.register(myPopup, ApplicationManager.getApplication()::assertIsDispatchThread);
|
||||
}
|
||||
|
||||
void canceled(@NotNull ListPopupStep intentionListStep) {
|
||||
@@ -592,9 +582,7 @@ public class IntentionHintComponent implements Disposable, ScrollAwareHint {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getText() {
|
||||
return mySettings.isEnabled(myAction) ?
|
||||
CodeInsightBundle.message("disable.intention.action", myFamilyName) :
|
||||
CodeInsightBundle.message("enable.intention.action", myFamilyName);
|
||||
return CodeInsightBundle.message(mySettings.isEnabled(myAction) ? "disable.intention.action" : "enable.intention.action", myFamilyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+7
-7
@@ -100,12 +100,12 @@ public class IntentionListStep implements ListPopupStep<IntentionActionWithTextC
|
||||
}
|
||||
|
||||
//true if something changed
|
||||
boolean wrapAndUpdateActions(@NotNull ShowIntentionsPass.IntentionsInfo intentions, boolean callUpdate) {
|
||||
boolean changed = wrapActionsTo(intentions.errorFixesToShow, myCachedErrorFixes, callUpdate);
|
||||
changed |= wrapActionsTo(intentions.inspectionFixesToShow, myCachedInspectionFixes, callUpdate);
|
||||
changed |= wrapActionsTo(intentions.intentionsToShow, myCachedIntentions, callUpdate);
|
||||
changed |= wrapActionsTo(intentions.guttersToShow, myCachedGutters, callUpdate);
|
||||
changed |= wrapActionsTo(intentions.notificationActionsToShow, myCachedNotifications, callUpdate);
|
||||
boolean wrapAndUpdateActions(@NotNull ShowIntentionsPass.IntentionsInfo newInfo, boolean callUpdate) {
|
||||
boolean changed = wrapActionsTo(newInfo.errorFixesToShow, myCachedErrorFixes, callUpdate);
|
||||
changed |= wrapActionsTo(newInfo.inspectionFixesToShow, myCachedInspectionFixes, callUpdate);
|
||||
changed |= wrapActionsTo(newInfo.intentionsToShow, myCachedIntentions, callUpdate);
|
||||
changed |= wrapActionsTo(newInfo.guttersToShow, myCachedGutters, callUpdate);
|
||||
changed |= wrapActionsTo(newInfo.notificationActionsToShow, myCachedNotifications, callUpdate);
|
||||
return changed;
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ public class IntentionListStep implements ListPopupStep<IntentionActionWithTextC
|
||||
return myFinalRunnable;
|
||||
}
|
||||
|
||||
private void applyAction(final IntentionActionWithTextCaching cachedAction) {
|
||||
private void applyAction(@NotNull IntentionActionWithTextCaching cachedAction) {
|
||||
myFinalRunnable = () -> {
|
||||
HintManager.getInstance().hideAllHints();
|
||||
if (myProject.isDisposed() || myEditor != null && myEditor.isDisposed()) return;
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.intellij.execution.ui.ConsoleView;
|
||||
import com.intellij.execution.ui.ConsoleViewContentType;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ReadAction;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -303,8 +304,9 @@ public abstract class LogConsoleBase extends AdditionalTabComponent implements L
|
||||
else {
|
||||
try {
|
||||
final BufferedReader reader = readerThread.myReader;
|
||||
while (reader != null && reader.ready()) {
|
||||
addMessage(reader.readLine());
|
||||
while (reader.ready()) {
|
||||
//ensure have read lock before requiring for sync, otherwise dispose() under write action would lead to deadlock
|
||||
ReadAction.run(() -> addMessage(reader.readLine()));
|
||||
}
|
||||
}
|
||||
catch (IOException ignore) {}
|
||||
@@ -314,6 +316,7 @@ public abstract class LogConsoleBase extends AdditionalTabComponent implements L
|
||||
}
|
||||
|
||||
protected synchronized void addMessage(final String text) {
|
||||
if (myDisposed) return;
|
||||
if (text == null) return;
|
||||
if (myContentPreprocessor != null) {
|
||||
final List<LogFragment> fragments = myContentPreprocessor.parseLogLine(text + "\n");
|
||||
|
||||
+2
-2
@@ -51,6 +51,7 @@ import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static com.intellij.diff.tools.util.base.TextDiffSettingsHolder.TextDiffSettings;
|
||||
@@ -108,8 +109,7 @@ class DiffPreviewPanel implements PreviewPanel {
|
||||
private final List<DiffContent> myContents;
|
||||
|
||||
public SampleRequest() {
|
||||
com.intellij.openapi.diff.DiffContent[] contents = DiffPreviewProvider.getContents();
|
||||
myContents = ContainerUtil.list(convert(contents[0]), convert(contents[1]), convert(contents[2]));
|
||||
myContents = Arrays.asList(DiffPreviewProvider.getContents());
|
||||
}
|
||||
|
||||
private static DiffContent convert(@NotNull com.intellij.openapi.diff.DiffContent content) {
|
||||
|
||||
+22
-6
@@ -16,12 +16,14 @@
|
||||
|
||||
package com.intellij.openapi.diff.impl.settings;
|
||||
|
||||
import com.intellij.openapi.diff.DiffContent;
|
||||
import com.intellij.openapi.diff.SimpleContent;
|
||||
import com.intellij.diff.DiffContentFactory;
|
||||
import com.intellij.diff.contents.DiffContent;
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author oleg
|
||||
@@ -30,19 +32,33 @@ import org.jetbrains.annotations.NonNls;
|
||||
public abstract class DiffPreviewProvider {
|
||||
public static final ExtensionPointName<DiffPreviewProvider> EP_NAME = ExtensionPointName.create("com.intellij.diffPreviewProvider");
|
||||
|
||||
@NotNull
|
||||
public abstract DiffContent[] createContents();
|
||||
|
||||
@NotNull
|
||||
public static DiffContent[] getContents() {
|
||||
// Assuming that standalone IDE should provide one provider
|
||||
final DiffPreviewProvider[] providers = Extensions.getExtensions(EP_NAME);
|
||||
if (providers.length != 0){
|
||||
if (providers.length != 0) {
|
||||
return providers[0].createContents();
|
||||
}
|
||||
return new DiffContent[]{createContent(LEFT_TEXT), createContent(CENTER_TEXT), createContent(RIGHT_TEXT)};
|
||||
return createContent(LEFT_TEXT, CENTER_TEXT, RIGHT_TEXT, StdFileTypes.JAVA);
|
||||
}
|
||||
|
||||
private static SimpleContent createContent(String text) {
|
||||
return new SimpleContent(text, StdFileTypes.JAVA);
|
||||
@NotNull
|
||||
public static DiffContent[] createContent(@NotNull String left,
|
||||
@NotNull String center,
|
||||
@NotNull String right,
|
||||
@NotNull FileType fileType) {
|
||||
return new DiffContent[]{
|
||||
createContent(left, StdFileTypes.JAVA),
|
||||
createContent(center, StdFileTypes.JAVA),
|
||||
createContent(right, StdFileTypes.JAVA)};
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static DiffContent createContent(@NotNull String text, @NotNull FileType fileType) {
|
||||
return DiffContentFactory.getInstance().create(text, fileType);
|
||||
}
|
||||
|
||||
@NonNls private static final String LEFT_TEXT = "class MyClass {\n" +
|
||||
|
||||
@@ -4265,7 +4265,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
editor.putUserData(LAST_PASTED_REGION, null);
|
||||
|
||||
EditorActionHandler pasteHandler = EditorActionManager.getInstance().getActionHandler(IdeActions.ACTION_EDITOR_PASTE);
|
||||
LOG.assertTrue(pasteHandler instanceof EditorTextInsertHandler);
|
||||
LOG.assertTrue(pasteHandler instanceof EditorTextInsertHandler, String.valueOf(pasteHandler));
|
||||
((EditorTextInsertHandler)pasteHandler).execute(editor, editor.getDataContext(), () -> t);
|
||||
|
||||
TextRange range = editor.getUserData(LAST_PASTED_REGION);
|
||||
|
||||
@@ -69,4 +69,9 @@ public abstract class Settings {
|
||||
private static Configurable choose(Configurable configurable, Configurable variant) {
|
||||
return variant != null ? variant : configurable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to handle programmatic settings changes when no UI events are sent.
|
||||
*/
|
||||
public void revalidate() {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ class ConfigurableEditor extends AbstractEditor implements AnActionListener, AWT
|
||||
}
|
||||
}
|
||||
|
||||
private void requestUpdate() {
|
||||
void requestUpdate() {
|
||||
final Configurable configurable = myConfigurable;
|
||||
myQueue.queue(new Update(this) {
|
||||
@Override
|
||||
|
||||
@@ -76,6 +76,11 @@ final class SettingsEditor extends AbstractEditor implements DataProvider {
|
||||
myFilter.update(null, false, true);
|
||||
return myTreeView.select(configurable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void revalidate() {
|
||||
myEditor.requestUpdate();
|
||||
}
|
||||
};
|
||||
mySearch = new SettingsSearch() {
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.intellij.openapi.editor.markup.TextAttributes;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.Getter;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.vcs.checkin.StepIntersection;
|
||||
@@ -74,8 +73,7 @@ public abstract class TodoForRanges {
|
||||
public TextRange convert(TodoItemData o) {
|
||||
return o.getTextRange();
|
||||
}
|
||||
}, Convertor.SELF, myRanges, () -> ""
|
||||
);
|
||||
}, Convertor.SELF, myRanges);
|
||||
final List<TodoItemData> filtered = stepIntersection.process(Arrays.asList(todoItems));
|
||||
final List<Pair<TextRange, TextAttributes>> result = new ArrayList<>(filtered.size());
|
||||
int offset = 0;
|
||||
|
||||
@@ -782,5 +782,7 @@ settings.editor.scheme.copy.to.ide.title=Copy Project Scheme to IDE
|
||||
settings.editor.scheme.copy.to.ide.label=IDE Scheme Name:
|
||||
settings.editor.scheme.copy.to.project.title=Copy Setting to Project
|
||||
settings.editor.scheme.copy.to.project.message=Overwrite project settings with values from {0}?
|
||||
settings.editor.scheme.import.success={0} was imported to {1} scheme.
|
||||
settings.editor.scheme.import.failure=Import failed: {0} is not a valid scheme.
|
||||
title.save.code.style.scheme.as=Duplicate Code Style Scheme As
|
||||
title.save.color.scheme.as=Duplicate Color Scheme As
|
||||
@@ -45,6 +45,7 @@
|
||||
serviceImplementation="com.intellij.execution.filters.TextConsoleBuilderFactoryImpl"/>
|
||||
<applicationService serviceInterface="com.intellij.execution.filters.HyperlinkInfoFactory"
|
||||
serviceImplementation="com.intellij.execution.filters.impl.HyperlinkInfoFactoryImpl"/>
|
||||
<consoleFilterProvider implementation="com.intellij.execution.filters.UrlFilter$UrlFilterProvider"/>
|
||||
|
||||
<applicationService serviceInterface="com.intellij.lang.PsiBuilderFactory"
|
||||
serviceImplementation="com.intellij.lang.impl.PsiBuilderFactoryImpl"/>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
class abc {
|
||||
public void f() {
|
||||
<<<<<<< abc.txt
|
||||
def
|
||||
=======
|
||||
abc
|
||||
>>>>>>> 1.14
|
||||
int F() {
|
||||
asdfklasdfl
|
||||
asdgfsagdfhasfdhg
|
||||
sdafjklklas
|
||||
sdafjkllksadf
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
One
|
||||
Two
|
||||
Three
|
||||
@@ -0,0 +1,6 @@
|
||||
--- after/1.txt after
|
||||
+++ after/1.txt after
|
||||
@@ -0,0 +1,3 @@
|
||||
+One
|
||||
+Two
|
||||
+Three
|
||||
@@ -0,0 +1,3 @@
|
||||
One
|
||||
Two
|
||||
Three
|
||||
@@ -0,0 +1,8 @@
|
||||
--- after/1.txt after
|
||||
+++ after/1.txt after
|
||||
@@ -0,0 +1,3 @@
|
||||
+One
|
||||
+Two
|
||||
+Three
|
||||
--
|
||||
1.7.9.5
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
One
|
||||
Two
|
||||
Three
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
--- after/1.txt after
|
||||
+++ after/1.txt after
|
||||
@@ -0,0 +1,3 @@
|
||||
+One
|
||||
+Two
|
||||
+Three
|
||||
\ No newline at end of file
|
||||
@@ -0,0 +1,3 @@
|
||||
first
|
||||
third
|
||||
last
|
||||
@@ -0,0 +1,6 @@
|
||||
--- before/1.txt before
|
||||
+++ after/1.txt after
|
||||
@@ -1,2 +1,3 @@
|
||||
first
|
||||
third
|
||||
+last
|
||||
@@ -0,0 +1,2 @@
|
||||
first
|
||||
third
|
||||
@@ -0,0 +1,3 @@
|
||||
first
|
||||
second
|
||||
third
|
||||
@@ -0,0 +1,6 @@
|
||||
--- before/1.txt before
|
||||
+++ after/1.txt after
|
||||
@@ -1,2 +1,3 @@
|
||||
first
|
||||
+second
|
||||
third
|
||||
@@ -0,0 +1,2 @@
|
||||
first
|
||||
third
|
||||
@@ -0,0 +1,7 @@
|
||||
uno
|
||||
dos
|
||||
cuatro
|
||||
cinco
|
||||
seis
|
||||
siete
|
||||
ocho
|
||||
@@ -0,0 +1,13 @@
|
||||
diff -r -u before/1.txt after/1.txt
|
||||
--- before/1.txt Tue Nov 21 14:20:19 2006
|
||||
+++ after/1.txt Tue Nov 21 14:20:15 2006
|
||||
@@ -1,7 +1,7 @@
|
||||
uno
|
||||
dos
|
||||
-tres
|
||||
cuatro
|
||||
+cinco
|
||||
seis
|
||||
siete
|
||||
-octo
|
||||
+ocho
|
||||
@@ -0,0 +1,7 @@
|
||||
uno
|
||||
dos
|
||||
cuatro
|
||||
cinco
|
||||
seis
|
||||
siete
|
||||
ocho
|
||||
@@ -0,0 +1,6 @@
|
||||
one
|
||||
two
|
||||
three
|
||||
cuatro
|
||||
five
|
||||
seven
|
||||
@@ -0,0 +1,18 @@
|
||||
diff -r -c before/1.txt after/1.txt
|
||||
*** before/1.txt Fri Nov 17 16:41:09 2006
|
||||
--- after/1.txt Fri Nov 17 16:40:58 2006
|
||||
***************
|
||||
*** 1,6 ****
|
||||
one
|
||||
three
|
||||
! four
|
||||
five
|
||||
- six
|
||||
seven
|
||||
--- 1,6 ----
|
||||
one
|
||||
+ two
|
||||
three
|
||||
! cuatro
|
||||
five
|
||||
seven
|
||||
@@ -0,0 +1,6 @@
|
||||
one
|
||||
three
|
||||
four
|
||||
five
|
||||
six
|
||||
seven
|
||||
@@ -0,0 +1,7 @@
|
||||
first
|
||||
second
|
||||
third
|
||||
fourth
|
||||
fifth
|
||||
sixth
|
||||
seventh
|
||||
@@ -0,0 +1,13 @@
|
||||
diff -r -c before/1.txt after/1.txt
|
||||
*** before/1.txt Fri Nov 17 15:30:30 2006
|
||||
--- after/1.txt Fri Nov 17 15:30:38 2006
|
||||
***************
|
||||
*** 1,6 ****
|
||||
--- 1,7 ----
|
||||
first
|
||||
second
|
||||
third
|
||||
+ fourth
|
||||
fifth
|
||||
sixth
|
||||
seventh
|
||||
@@ -0,0 +1,6 @@
|
||||
first
|
||||
second
|
||||
third
|
||||
fifth
|
||||
sixth
|
||||
seventh
|
||||
@@ -0,0 +1,3 @@
|
||||
first
|
||||
second
|
||||
third
|
||||
@@ -0,0 +1,3 @@
|
||||
uno
|
||||
dos
|
||||
tres
|
||||
@@ -0,0 +1,19 @@
|
||||
diff -r -c before/1.txt after/1.txt
|
||||
*** before/1.txt Tue Nov 07 13:32:58 2006
|
||||
--- after/1.txt Tue Nov 07 13:32:58 2006
|
||||
***************
|
||||
*** 1,2 ****
|
||||
--- 1,3 ----
|
||||
first
|
||||
+ second
|
||||
third
|
||||
diff -r -c before/2.txt after/2.txt
|
||||
*** before/2.txt Fri Nov 17 18:26:49 2006
|
||||
--- after/2.txt Fri Nov 17 18:26:38 2006
|
||||
***************
|
||||
*** 1,4 ****
|
||||
uno
|
||||
dos
|
||||
tres
|
||||
- cuatro
|
||||
--- 1,3 ----
|
||||
@@ -0,0 +1,2 @@
|
||||
first
|
||||
third
|
||||
@@ -0,0 +1,4 @@
|
||||
uno
|
||||
dos
|
||||
tres
|
||||
cuatro
|
||||
@@ -0,0 +1,6 @@
|
||||
first
|
||||
second
|
||||
third
|
||||
fifth
|
||||
sixth
|
||||
seventh
|
||||
@@ -0,0 +1,13 @@
|
||||
diff -r -c before/1.txt after/1.txt
|
||||
*** before/1.txt Fri Nov 17 16:29:29 2006
|
||||
--- after/1.txt Fri Nov 17 16:29:26 2006
|
||||
***************
|
||||
*** 1,7 ****
|
||||
first
|
||||
second
|
||||
third
|
||||
- fourth
|
||||
fifth
|
||||
sixth
|
||||
seventh
|
||||
--- 1,6 ----
|
||||
@@ -0,0 +1,7 @@
|
||||
first
|
||||
second
|
||||
third
|
||||
fourth
|
||||
fifth
|
||||
sixth
|
||||
seventh
|
||||
@@ -0,0 +1,11 @@
|
||||
uno
|
||||
|
||||
|
||||
dos
|
||||
tres
|
||||
|
||||
|
||||
cuatro
|
||||
|
||||
|
||||
cinco
|
||||
@@ -0,0 +1,13 @@
|
||||
diff -r -c before/1.txt after/1.txt
|
||||
*** before/1.txt Tue Nov 21 18:10:18 2006
|
||||
--- after/1.txt Tue Nov 21 18:10:26 2006
|
||||
***************
|
||||
*** 2,7 ****
|
||||
--- 2,8 ----
|
||||
|
||||
|
||||
dos
|
||||
+ tres
|
||||
|
||||
|
||||
cuatro
|
||||
@@ -0,0 +1,10 @@
|
||||
uno
|
||||
|
||||
|
||||
dos
|
||||
|
||||
|
||||
cuatro
|
||||
|
||||
|
||||
cinco
|
||||
@@ -0,0 +1,3 @@
|
||||
uno
|
||||
dos
|
||||
tres
|
||||
@@ -0,0 +1,13 @@
|
||||
diff -r -c before/1.txt after/1.txt
|
||||
*** before/1.txt Fri Nov 24 13:06:16 2006
|
||||
--- after/1.txt Fri Nov 24 13:06:20 2006
|
||||
***************
|
||||
*** 1,2 ****
|
||||
uno
|
||||
! dos
|
||||
\ No newline at end of file
|
||||
--- 1,3 ----
|
||||
uno
|
||||
! dos
|
||||
! tres
|
||||
\ No newline at end of file
|
||||
@@ -0,0 +1,2 @@
|
||||
uno
|
||||
dos
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import java.util.function.Supplier;
|
||||
class Test {
|
||||
|
||||
private void a()
|
||||
{
|
||||
b(newMethod());
|
||||
}
|
||||
|
||||
private Supplier newMethod() {
|
||||
return (s) -> {
|
||||
System.out.println(s);
|
||||
};
|
||||
}
|
||||
|
||||
void b(Supplier s) {}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
diff --git a/before/1.txt b/after/1.txt
|
||||
index fad3998..5880be4 100644
|
||||
--- a/before/1.txt
|
||||
+++ b/after/1.txt
|
||||
@@ -12,5 +12,4 @@ class Test {
|
||||
};
|
||||
}
|
||||
|
||||
- void b(Supplier s) {}
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+ void b(Supplier s) {}
|
||||
\ No newline at end of file
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import java.util.function.Supplier;
|
||||
class Test {
|
||||
|
||||
private void a()
|
||||
{
|
||||
b(newMethod());
|
||||
}
|
||||
|
||||
private Supplier newMethod() {
|
||||
return (s) -> {
|
||||
System.out.println(s);
|
||||
};
|
||||
}
|
||||
|
||||
void b(Supplier s) {}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import java.util.function.Supplier;
|
||||
class Test {
|
||||
|
||||
private void a()
|
||||
{
|
||||
b(newMethod());
|
||||
}
|
||||
|
||||
private Supplier newMethod() {
|
||||
return (s) -> {
|
||||
System.out.println(s);
|
||||
};
|
||||
}
|
||||
|
||||
void b(Supplier s) {}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
diff --git a/before/1.txt b/after/1.txt
|
||||
index fad3998..5880be4 100644
|
||||
--- a/before/1.txt
|
||||
+++ b/after/1.txt
|
||||
@@ -13,4 +13,3 @@
|
||||
}
|
||||
|
||||
void b(Supplier s) {}
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import java.util.function.Supplier;
|
||||
class Test {
|
||||
|
||||
private void a()
|
||||
{
|
||||
b(newMethod());
|
||||
}
|
||||
|
||||
private Supplier newMethod() {
|
||||
return (s) -> {
|
||||
System.out.println(s);
|
||||
};
|
||||
}
|
||||
|
||||
void b(Supplier s) {}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import java.util.function.Supplier;
|
||||
class Test {
|
||||
|
||||
private void a()
|
||||
{
|
||||
b(newMethod());
|
||||
}
|
||||
|
||||
private Supplier newMethod() {
|
||||
return (s) -> {
|
||||
System.out.println(s);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
diff --git a/before/1.txt b/after/1.txt
|
||||
index fad3998..5880be4 100644
|
||||
--- a/before/1.txt
|
||||
+++ b/after/1.txt
|
||||
@@ -12,5 +12,5 @@
|
||||
};
|
||||
}
|
||||
|
||||
- void b(Supplier s) {}
|
||||
+
|
||||
}
|
||||
\ No newline at end of file
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import java.util.function.Supplier;
|
||||
class Test {
|
||||
|
||||
private void a()
|
||||
{
|
||||
b(newMethod());
|
||||
}
|
||||
|
||||
private Supplier newMethod() {
|
||||
return (s) -> {
|
||||
System.out.println(s);
|
||||
};
|
||||
}
|
||||
|
||||
void b(Supplier s) {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
uno
|
||||
|
||||
dos
|
||||
tres
|
||||
|
||||
cuarto
|
||||
|
||||
cinco
|
||||
seis
|
||||
@@ -0,0 +1,11 @@
|
||||
diff -r -u before/1.txt after/1.txt
|
||||
--- before/1.txt Mon Nov 20 14:37:58 2006
|
||||
+++ after/1.txt Mon Nov 20 14:38:07 2006
|
||||
@@ -3,6 +3,7 @@
|
||||
dos
|
||||
tres
|
||||
|
||||
+cuarto
|
||||
|
||||
cinco
|
||||
seis
|
||||
@@ -0,0 +1,8 @@
|
||||
uno
|
||||
|
||||
dos
|
||||
tres
|
||||
|
||||
|
||||
cinco
|
||||
seis
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user