diff --git a/build/dependencies/gradle.properties b/build/dependencies/gradle.properties
index f8830f0f0496..6a1a14ad4ef2 100644
--- a/build/dependencies/gradle.properties
+++ b/build/dependencies/gradle.properties
@@ -1,4 +1,4 @@
# The file might be automatically updated. Comments and empty lines will be removed.
kotlinPluginBuild=1.1.2-release-IJ2017.2-1
jetSignBuild=42.30
-jdkBuild=u152b855.1
+jdkBuild=u152b867.1
diff --git a/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java b/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java
index a72617b9b2da..555a21af01e7 100644
--- a/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java
+++ b/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java
@@ -44,6 +44,7 @@ import com.intellij.psi.impl.source.tree.JavaDocElementType;
import com.intellij.psi.impl.source.tree.JavaElementType;
import com.intellij.psi.javadoc.*;
import com.intellij.psi.search.EverythingGlobalScope;
+import com.intellij.psi.util.PropertyUtil;
import com.intellij.psi.util.PsiFormatUtil;
import com.intellij.psi.util.PsiFormatUtilBase;
import com.intellij.psi.util.PsiTreeUtil;
@@ -1343,6 +1344,26 @@ public class JavaDocInfoGenerator {
buffer.append("");
}
}
+ else {
+ PsiField field = PropertyUtil.getFieldOfGetter(method);
+ if (field == null) {
+ field = PropertyUtil.getFieldOfSetter(method);
+ }
+
+ if (field != null) {
+ PsiDocComment fieldDocComment = field.getDocComment();
+ if (fieldDocComment != null && !isEmptyDescription(fieldDocComment)) {
+ buffer.append("
");
+ buffer.append("- ");
+ buffer.append(CodeInsightBundle.message("javadoc.description.copied.from.field"));
+ buffer.append(" ");
+ generateLink(buffer, field, field.getName(), false);
+ buffer.append(BR_TAG);
+ generateValue(buffer, fieldDocComment.getDescriptionElements(), ourEmptyElementsProvider);
+ buffer.append("
");
+ }
+ }
+ }
}
private void generateValue(StringBuilder buffer, PsiElement[] elements, InheritDocProvider provider) {
diff --git a/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java b/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java
index 6ba984a386c9..3ec283406529 100644
--- a/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java
+++ b/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java
@@ -20,6 +20,7 @@ import com.intellij.find.FindBundle;
import com.intellij.ide.util.SuperMethodWarningUtil;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.application.TransactionGuard;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.ui.Messages;
@@ -30,6 +31,7 @@ import com.intellij.psi.impl.search.ThrowSearchUtil;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.LocalSearchScope;
import com.intellij.psi.search.SearchScope;
+import com.intellij.psi.search.searches.FunctionalExpressionSearch;
import com.intellij.psi.search.searches.MethodReferencesSearch;
import com.intellij.psi.search.searches.OverridingMethodsSearch;
import com.intellij.psi.util.PropertyUtil;
@@ -119,6 +121,19 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
elementsToSearch.add(parameters[idx]);
}
}
+
+ final PsiClass aClass = ReadAction.compute(method::getContainingClass);
+ if (aClass != null) {
+ FunctionalExpressionSearch.search(aClass).forEach(element -> {
+ if (element instanceof PsiLambdaExpression) {
+ PsiParameter[] parameters = ((PsiLambdaExpression)element).getParameterList().getParameters();
+ if (idx < parameters.length) {
+ elementsToSearch.add(parameters[idx]);
+ }
+ }
+ });
+ }
+
return PsiUtilCore.toPsiElementArray(elementsToSearch);
}
@@ -137,6 +152,9 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
LOG.assertTrue(aClass != null); //Otherwise can not be overriden
boolean hasOverridden = OverridingMethodsSearch.search(method).findFirst() != null;
+ if (!hasOverridden) {
+ hasOverridden = FunctionalExpressionSearch.search(aClass).findFirst() != null;
+ }
if (hasOverridden && askWhetherShouldSearchForParameterInOverridingMethods(element, parameter)) {
return getParameterElementsToSearch(parameter, method);
}
diff --git a/java/java-tests/testData/codeInsight/javadocIG/documentationForGetterByField.html b/java/java-tests/testData/codeInsight/javadocIG/documentationForGetterByField.html
new file mode 100644
index 000000000000..63b380e60a69
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/javadocIG/documentationForGetterByField.html
@@ -0,0 +1,3 @@
+ FooBarpublic String getMyFoo()
- Description copied from field:
myFoo
+ foo bar baz
+
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/javadocIG/documentationForGetterByField.java b/java/java-tests/testData/codeInsight/javadocIG/documentationForGetterByField.java
new file mode 100644
index 000000000000..33da308ddb13
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/javadocIG/documentationForGetterByField.java
@@ -0,0 +1,10 @@
+class FooBar {
+ /**
+ * foo bar baz
+ */
+ private String myFoo;
+
+ public String getMyFoo() {
+ return myFoo;
+ }
+}
\ No newline at end of file
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 a42914a98b47..e58110808220 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/javadoc/JavaDocInfoGeneratorTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/javadoc/JavaDocInfoGeneratorTest.java
@@ -405,6 +405,10 @@ public class JavaDocInfoGeneratorTest extends CodeInsightTestCase {
doTestAtCaret();
}
+ public void testDocumentationForGetterByField() throws Exception {
+ doTestAtCaret();
+ }
+
public void testDumbMode() throws Exception {
DumbServiceImpl.getInstance(myProject).setDumb(true);
try {
diff --git a/platform/platform-api/src/com/intellij/execution/configurations/PathEnvironmentVariableUtil.java b/platform/platform-api/src/com/intellij/execution/configurations/PathEnvironmentVariableUtil.java
index 5ccfac04fb93..ea4bcab1f2e5 100644
--- a/platform/platform-api/src/com/intellij/execution/configurations/PathEnvironmentVariableUtil.java
+++ b/platform/platform-api/src/com/intellij/execution/configurations/PathEnvironmentVariableUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 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.
@@ -130,7 +130,7 @@ public class PathEnvironmentVariableUtil {
return Collections.emptyList();
}
List result = new SmartList<>();
- List dirPaths = StringUtil.split(pathEnvVarValue, File.pathSeparator, true, true);
+ List dirPaths = getPathDirs(pathEnvVarValue);
for (String dirPath : dirPaths) {
File dir = new File(dirPath);
if (dir.isAbsolute() && dir.isDirectory()) {
@@ -148,6 +148,11 @@ public class PathEnvironmentVariableUtil {
return result;
}
+ @NotNull
+ public static List getPathDirs(@NotNull String pathEnvVarValue) {
+ return StringUtil.split(pathEnvVarValue, File.pathSeparator, true, true);
+ }
+
/**
* Alters the passed in exe path to increase probability of exe file success finding when
* spawning an external process. Modifications are performed iff the passed in exe path is
diff --git a/platform/platform-api/src/com/intellij/ui/FieldPanel.java b/platform/platform-api/src/com/intellij/ui/FieldPanel.java
index 470ae981ef1d..13f6e94759ce 100644
--- a/platform/platform-api/src/com/intellij/ui/FieldPanel.java
+++ b/platform/platform-api/src/com/intellij/ui/FieldPanel.java
@@ -22,7 +22,7 @@ import javax.swing.*;
import javax.swing.event.DocumentEvent;
import java.awt.event.ActionListener;
-public class FieldPanel extends AbstractFieldPanel {
+public class FieldPanel extends AbstractFieldPanel implements TextAccessor {
private final JTextField myTextField;
public FieldPanel() {
diff --git a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileSystemTreeImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileSystemTreeImpl.java
index a3e31eabf090..7cbc6fc5beee 100644
--- a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileSystemTreeImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileSystemTreeImpl.java
@@ -77,6 +77,7 @@ public class FileSystemTreeImpl implements FileSystemTree {
private final Project myProject;
private final ArrayList myOkActions = new ArrayList<>(2);
private final FileChooserDescriptor myDescriptor;
+ private final FileTreeModel myFileTreeModel;
private final AsyncTreeModel myAsyncTreeModel;
private final List myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
@@ -99,10 +100,12 @@ public class FileSystemTreeImpl implements FileSystemTree {
myProject = project;
if (renderer == null && Registry.is("file.chooser.async.tree.model")) {
renderer = new FileRenderer().forTree();
- myAsyncTreeModel = new AsyncTreeModel(new FileTreeModel(descriptor, new FileRefresher(true, 3)));
+ myFileTreeModel = new FileTreeModel(descriptor, new FileRefresher(true, 3));
+ myAsyncTreeModel = new AsyncTreeModel(myFileTreeModel);
myTreeStructure = null;
}
else {
+ myFileTreeModel = null;
myAsyncTreeModel = null;
myTreeStructure = new FileTreeStructure(project, descriptor);
}
@@ -244,7 +247,7 @@ public class FileSystemTreeImpl implements FileSystemTree {
public void showHiddens(boolean showHidden) {
if (myAsyncTreeModel != null) {
myDescriptor.withShowHiddenFiles(showHidden);
- //TODO:refresh
+ if (myFileTreeModel != null) myFileTreeModel.invalidate();
}
else {
myTreeStructure.showHiddens(showHidden);
diff --git a/platform/platform-impl/src/com/intellij/openapi/fileChooser/tree/FileTreeModel.java b/platform/platform-impl/src/com/intellij/openapi/fileChooser/tree/FileTreeModel.java
index c3de14d49758..73dd78cab9d5 100644
--- a/platform/platform-impl/src/com/intellij/openapi/fileChooser/tree/FileTreeModel.java
+++ b/platform/platform-impl/src/com/intellij/openapi/fileChooser/tree/FileTreeModel.java
@@ -79,6 +79,17 @@ public final class FileTreeModel extends AbstractTreeModel implements Disposable
});
}
+ public void invalidate() {
+ invoker.invokeLaterIfNeeded(() -> {
+ if (roots != null) {
+ for (Root root : roots) {
+ root.tree.invalidate();
+ }
+ }
+ treeStructureChanged(state.path, null, null);
+ });
+ }
+
@Override
public void dispose() {
}
diff --git a/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java b/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java
index df4066ed261e..a93e523067c4 100644
--- a/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java
+++ b/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java
@@ -359,9 +359,7 @@ public final class AsyncTreeModel extends AbstractTreeModel implements Disposabl
LOG.debug("ignore updating of changed node: ", object);
return;
}
- boolean isLoadingRequired = entry.isLoadingRequired();
MapBasedTree.UpdateResult