Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor hack to prevent a model of the project to be unnecessarily loaded.

  • Loading branch information...
commit b849e28aaf04ee5f3c816a5aa27904466f8d18f4 1 parent fb4c960
@kelemen authored
Showing with 11 additions and 8 deletions.
  1. +11 −8 src/org/netbeans/gradle/project/query/GradleClassPathProvider.java
View
19 src/org/netbeans/gradle/project/query/GradleClassPathProvider.java
@@ -121,6 +121,10 @@ else if (ClassPath.EXECUTE.equals(type)) {
}
private void onModelChange() {
+ if (!hasBeenUsed.get()) {
+ return;
+ }
+
NbGradleProject.PROJECT_PROCESSOR.execute(new Runnable() {
@Override
public void run() {
@@ -141,16 +145,10 @@ public void stateChanged(ChangeEvent e) {
@Override
public void stateChanged(ChangeEvent e) {
currentPlatform = project.getProperties().getPlatform().getValue();
- if (hasBeenUsed.get()) {
- onModelChange();
- }
+ onModelChange();
}
});
- // This is not called because it would trigger the loading of the
- // project even if it just shown in the project open dialog.
- // Although it should be called to ensure correct behaviour in every
- // case.
- // onModelChange();
+ onModelChange();
}
// These PropertyChangeListener methods are declared because
@@ -476,6 +474,11 @@ public ClassPath findClassPath(FileObject file, String type) {
if (GradleFilesClassPathProvider.isGradleFile(file)) {
return null;
}
+ // NetBeans calls findClassPath when you look at the directory in
+ // favorites.
+ if (project.getProjectDirectory().equals(file)) {
+ return null;
+ }
hasBeenUsed.set(true);
Please sign in to comment.
Something went wrong with that request. Please try again.