This commit is contained in:
Alexey Kudravtsev
2018-04-16 14:30:19 +03:00
parent 09ac5d70a6
commit 5ac8069665
4 changed files with 9 additions and 7 deletions
@@ -262,7 +262,7 @@ public class DocumentImpl extends UserDataHolderBase implements DocumentEx {
if (finalStart < lineEnd) {
// document must be unblocked by now. If not, some Save handler attempted to modify PSI
// which should have been caught by assertion in com.intellij.pom.core.impl.PomModelImpl.runTransaction
DocumentUtil.writeInRunUndoTransparentAction(new DocumentRunnable(DocumentImpl.this, project) {
DocumentUtil.writeInRunUndoTransparentAction(new DocumentRunnable(this, project) {
@Override
public void run() {
deleteString(finalStart, lineEnd);
@@ -722,12 +722,13 @@ public class DocumentImpl extends UserDataHolderBase implements DocumentEx {
}
private class DelayedExceptions {
Throwable myException = null;
Throwable myException;
void register(Throwable e) {
if (myException == null) {
myException = e;
} else {
}
else {
myException.addSuppressed(e);
}
@@ -24,9 +24,8 @@ import java.util.Collection;
*
* @see Functions for some common implementations
*
* Consider to use java.util.function.Function
* Consider to use {@link java.util.function.Function} instead
*/
@SuppressWarnings({"unchecked"})
public interface Function<Param, Result> {
Result fun(Param param);
@@ -56,18 +55,21 @@ public interface Function<Param, Result> {
@Nullable
public R fun(P p) {
//noinspection unchecked
return p.getClass().isAssignableFrom(myResultClass) ? (R)p : null;
}
}
final class First<P, R extends P> implements Function<P[], R> {
public R fun(P[] ps) {
//noinspection unchecked
return (R)ps[0];
}
}
final class FirstInCollection<P, R extends P> implements Function<Collection<P>, R> {
public R fun(Collection<P> ps) {
//noinspection unchecked
return (R)ps.iterator().next();
}
}
@@ -22,7 +22,6 @@ import java.util.Map;
public interface InternalIterator<T>{
/**
* @param element
* @return false to stop iteration true to continue if more elements are avaliable.
*/
boolean visit(T element);
@@ -17,7 +17,7 @@ package com.intellij.util.containers;
/**
* see also {@link com.intellij.openapi.util.Condition} and java.util.function.Predicate
* see also {@link com.intellij.openapi.util.Condition} and {@link java.util.function.Predicate}
*/
public interface Predicate<T> {
boolean apply(T input);