diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/pom.xml b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/pom.xml
index c6c3df5da3..7b8dacb83d 100644
--- a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/pom.xml
+++ b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/pom.xml
@@ -1,7 +1,7 @@
4.0.0
- ../pom.xml
+ ../pom.xmlorg.codehaus.groovy.eclipseorg.codehaus.groovy.eclipse.base-test.parent2.9.2-SNAPSHOT
@@ -10,4 +10,4 @@
org.eclipse.jdt.groovy.core.tests.compiler3.3.100-SNAPSHOTeclipse-plugin
-
+
\ No newline at end of file
diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
index 404a5521fc..a80970b63c 100644
--- a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
+++ b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
@@ -59,8 +59,7 @@
import org.eclipse.jdt.internal.core.search.indexing.BinaryIndexer;
public abstract class AbstractRegressionTest extends AbstractCompilerTest implements StopableTestCase {
- // javac comparison related types, fields and methods - see runJavac for
- // details
+ // javac comparison related types, fields and methods - see runJavac for details
static class JavacCompiler {
String rootDirectoryPath;
String javacPathName;
@@ -121,6 +120,8 @@ static class JavacCompiler {
this.version = JavaCore.VERSION_1_6;
} else if (rawVersion.indexOf("1.7") != -1) {
this.version = JavaCore.VERSION_1_7;
+ } else if (rawVersion.indexOf("1.8") != -1) {
+ this.version = JavaCore.VERSION_1_8;
} else {
throw new RuntimeException("unknown javac version: " + rawVersion);
}
@@ -821,6 +822,8 @@ protected void compileAndDeploy(String source, String directoryName, String clas
buffer.append("\" -1.6");
} else if (this.complianceLevel == ClassFileConstants.JDK1_7) {
buffer.append("\" -1.7");
+ } else if (this.complianceLevel == JDK1_8) {
+ buffer.append("\" -1.8");
}
buffer
.append(" -preserveAllLocals -nowarn -g -classpath \"")
diff --git a/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/search/TypeInferencingVisitorWithRequestor.java b/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/search/TypeInferencingVisitorWithRequestor.java
index 64069b1c8e..ae02442606 100644
--- a/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/search/TypeInferencingVisitorWithRequestor.java
+++ b/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/search/TypeInferencingVisitorWithRequestor.java
@@ -877,7 +877,6 @@ public void visitImports(ModuleNode node) {
try {
if (type != null) {
visitClassReference(type);
- // FIXADE this is a bit messy, shoud use existing infra to push and pop
completeExpressionStack.push(imp);
if (imp.getFieldNameExpr() != null) {
primaryTypeStack.push(type);
@@ -885,11 +884,6 @@ public void visitImports(ModuleNode node) {
dependentDeclarationStack.pop();
dependentTypeStack.pop();
}
-
- // if (imp.getAliasExpr() != null) {
- // primaryTypeStack.push(type);
- // imp.getAliasExpr().visit(this);
- // }
completeExpressionStack.pop();
}
} catch (VisitCompleted e) {
@@ -1001,9 +995,7 @@ public void visitBinaryExpression(BinaryExpression node) {
toVisitPrimary.visit(this);
- ClassNode primaryExprType;
-
- primaryExprType = primaryTypeStack.pop();
+ ClassNode primaryExprType = primaryTypeStack.pop();
if (isAssignment) {
assignmentStorer.storeAssignment(node, scopes.peek(), primaryExprType);
}
@@ -1013,10 +1005,12 @@ public void visitBinaryExpression(BinaryExpression node) {
completeExpressionStack.pop();
// type of the entire expression
ClassNode completeExprType = primaryExprType;
-
ClassNode dependentExprType = primaryTypeStack.pop();
- if (!isAssignment) {
+// TODO: Is it an illegal state to have either as null?
+assert primaryExprType != null && dependentExprType != null;
+
+ if (!isAssignment && primaryExprType != null && dependentExprType != null) {
// type of RHS of binary expression
// find the type of the complete expression
String associatedMethod = findBinaryOperatorName(node.getOperation().getText());
@@ -1024,13 +1018,11 @@ public void visitBinaryExpression(BinaryExpression node) {
// another special case.
// In 1.8 and later, Groovy will not go through the
// MOP for standard arithmetic operations on numbers
- completeExprType = dependentExprType.equals(VariableScope.STRING_CLASS_NODE) ? VariableScope.STRING_CLASS_NODE
- : primaryExprType;
+ completeExprType = dependentExprType.equals(VariableScope.STRING_CLASS_NODE) ? VariableScope.STRING_CLASS_NODE : primaryExprType;
} else if (associatedMethod != null) {
// there is an overloadable method associated with this operation
// convert to a constant expression and infer type
- TypeLookupResult result = lookupExpressionType(new ConstantExpression(associatedMethod), primaryExprType, false,
- scopes.peek());
+ TypeLookupResult result = lookupExpressionType(new ConstantExpression(associatedMethod), primaryExprType, false, scopes.peek());
completeExprType = result.type;
if (associatedMethod.equals("getAt") && result.declaringType.equals(VariableScope.DGM_CLASS_NODE)) {
// special case getAt coming from DGM.
@@ -1069,13 +1061,8 @@ public void visitBinaryExpression(BinaryExpression node) {
}
/**
- * Make assumption that no one has overloaded the basic arithmetic operations on numbers These operations will bypass the mop in
- * most situations anyway
- *
- * @param text
- * @param primaryExprType
- * @param dependentExprType
- * @return
+ * Make assumption that no one has overloaded the basic arithmetic operations on numbers.
+ * These operations will bypass the mop in most situations anyway.
*/
private boolean isArithmeticOperationOnNumberOrStringOrList(String text, ClassNode lhs, ClassNode rhs) {
if (text.length() != 1) {
@@ -2029,8 +2016,10 @@ private void handleCompleteExpression(Expression node, ClassNode exprType, Class
private void postVisit(Expression node, ClassNode type, ClassNode declaringType, ASTNode declaration) {
if (isPrimaryExpression(node)) {
+ assert type != null;
primaryTypeStack.push(type);
} else if (isDependentExpression(node)) {
+ // TODO: null has been seen here for type; is that okay?
dependentTypeStack.push(type);
dependentDeclarationStack.push(new Tuple(declaringType, declaration));
}
@@ -2180,7 +2169,7 @@ private MethodNode findMethodNode(IMethod method) {
try {
if (method.isConstructor()) {
List constructors = clazz.getDeclaredConstructors();
- if (constructors.size() == 0) {
+ if (constructors == null || constructors.isEmpty()) {
return null;
}
String[] jdtParamTypes = method.getParameterTypes() == null ? NO_PARAMS : method.getParameterTypes();
@@ -2415,8 +2404,8 @@ private boolean isPrimaryExpression(Expression node) {
TernaryExpression prop = (TernaryExpression) complete;
return prop.getTrueExpression() == node;
} else if (complete instanceof ForStatement) {
- // this check is used to store the type of the collection expression so that it can be assigned to the for loop
- // variable
+ // this check is used to store the type of the collection expression
+ // so that it can be assigned to the for loop variable
ForStatement prop = (ForStatement) complete;
return prop.getCollectionExpression() == node;
} else if (complete instanceof ListExpression) {
@@ -2460,8 +2449,8 @@ private boolean isPrimaryExpression(Expression node) {
*
property/field (ie- right part) of an attribute expression
*
*
- * Note that for statements and ternary expressions do not have any dependent expression even though they have primary
- * expressions
+ * Note that for statements and ternary expressions do not have any dependent
+ * expression even though they have primary expressions.
*
* @param node expression node to check
* @return true iff the node is the primary expression in an expression pair.
diff --git a/ide-test/org.codehaus.groovy.eclipse.codebrowsing.test/src/org/codehaus/groovy/eclipse/codebrowsing/tests/CodeSelectImportsTests.groovy b/ide-test/org.codehaus.groovy.eclipse.codebrowsing.test/src/org/codehaus/groovy/eclipse/codebrowsing/tests/CodeSelectImportsTests.groovy
index 0983c13159..9bea6d1901 100644
--- a/ide-test/org.codehaus.groovy.eclipse.codebrowsing.test/src/org/codehaus/groovy/eclipse/codebrowsing/tests/CodeSelectImportsTests.groovy
+++ b/ide-test/org.codehaus.groovy.eclipse.codebrowsing.test/src/org/codehaus/groovy/eclipse/codebrowsing/tests/CodeSelectImportsTests.groovy
@@ -48,6 +48,7 @@ final class CodeSelectImportsTests extends BrowsingTestCase {
void testCodeSelectOnImportType2() {
String source = '''\
import java.lang.Thread.State
+ import java.util.regex.Pattern
Pattern p = ~/123/
'''.stripIndent()
diff --git a/ide-test/org.codehaus.groovy.eclipse.refactoring.test/.classpath b/ide-test/org.codehaus.groovy.eclipse.refactoring.test/.classpath
index 0d03e3b624..d743f992ef 100644
--- a/ide-test/org.codehaus.groovy.eclipse.refactoring.test/.classpath
+++ b/ide-test/org.codehaus.groovy.eclipse.refactoring.test/.classpath
@@ -1,7 +1,11 @@
-
+
+
+
+
+
diff --git a/ide/org.codehaus.groovy.eclipse.ant/.classpath b/ide/org.codehaus.groovy.eclipse.ant/.classpath
index 261a4ad976..53eb1326bd 100644
--- a/ide/org.codehaus.groovy.eclipse.ant/.classpath
+++ b/ide/org.codehaus.groovy.eclipse.ant/.classpath
@@ -1,7 +1,7 @@
-
+
diff --git a/ide/org.codehaus.groovy.eclipse.ant/.gitignore b/ide/org.codehaus.groovy.eclipse.ant/.gitignore
index 5e56e040ec..d1ab919e0b 100644
--- a/ide/org.codehaus.groovy.eclipse.ant/.gitignore
+++ b/ide/org.codehaus.groovy.eclipse.ant/.gitignore
@@ -1 +1,2 @@
/bin
+/bin-ant
diff --git a/ide/org.codehaus.groovy.eclipse.ant/META-INF/MANIFEST.MF b/ide/org.codehaus.groovy.eclipse.ant/META-INF/MANIFEST.MF
index 8ce6734977..2f9db0ef10 100644
--- a/ide/org.codehaus.groovy.eclipse.ant/META-INF/MANIFEST.MF
+++ b/ide/org.codehaus.groovy.eclipse.ant/META-INF/MANIFEST.MF
@@ -4,6 +4,8 @@ Bundle-SymbolicName: org.codehaus.groovy.eclipse.ant;singleton:=true
Bundle-Name: Groovy Ant support
Bundle-Vendor: Codehaus.org
Bundle-Version: 2.9.2.qualifier
+Bundle-ClassPath: .,
+ groovyAntEclipse.jar
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ant.core,
org.apache.ant;bundle-version="1.7.0",
diff --git a/ide/org.codehaus.groovy.eclipse.ant/build.properties b/ide/org.codehaus.groovy.eclipse.ant/build.properties
index 299c5852b4..1a6e66de29 100644
--- a/ide/org.codehaus.groovy.eclipse.ant/build.properties
+++ b/ide/org.codehaus.groovy.eclipse.ant/build.properties
@@ -1,25 +1,15 @@
-###############################################################################
-# Copyright (c) 2007, 2009 Codehaus.org, SpringSource, and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Andrew Eisenberg - modified for Groovy Eclipse 2.0
-###############################################################################
source.. = src/
output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
+source.groovyAntEclipse.jar = src-ant/
+output.groovyAntEclipse.jar = bin-ant/
+
+bin.includes = .,\
groovyAntEclipse.jar,\
+ META-INF/,\
+ plugin.xml,\
about.html
-jars.compile.order = .,\
- groovyAntEclipse.jar
-source.groovyAntEclipse.jar = src-ant/
-output.groovyAntEclipse.jar = bin/
-compilerArg=-nowarn
src.includes = about.html
-jars.extra.classpath=platform:/plugin/org.eclipse.jdt.core/jdtCompilerAdapter.jar
+compilerArg=-nowarn
+jars.compile.order=.,groovyAntEclipse.jar
+jars.extra.classpath=platform:/plugin/org.eclipse.jdt.core/jdtCompilerAdapter.jar
diff --git a/ide/org.codehaus.groovy.eclipse.ant/groovyAntEclipse.jar b/ide/org.codehaus.groovy.eclipse.ant/groovyAntEclipse.jar
deleted file mode 100644
index 84bc4d5543..0000000000
Binary files a/ide/org.codehaus.groovy.eclipse.ant/groovyAntEclipse.jar and /dev/null differ
diff --git a/ide/org.codehaus.groovy.eclipse.ant/src-ant/org/codehaus/groovy/eclipse/ant/GroovyCompilerAdapter.java b/ide/org.codehaus.groovy.eclipse.ant/src-ant/org/codehaus/groovy/eclipse/ant/GroovyCompilerAdapter.java
index ef1cf3764f..69c45d6127 100644
--- a/ide/org.codehaus.groovy.eclipse.ant/src-ant/org/codehaus/groovy/eclipse/ant/GroovyCompilerAdapter.java
+++ b/ide/org.codehaus.groovy.eclipse.ant/src-ant/org/codehaus/groovy/eclipse/ant/GroovyCompilerAdapter.java
@@ -1,16 +1,20 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Codehaus.org, SpringSource, and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+/*
+ * Copyright 2009-2016 the original author or authors.
*
- * Contributors:
- * Andrew Eisenberg - modified for Groovy Eclipse 2.0
- *******************************************************************************/
+ * 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 org.codehaus.groovy.eclipse.ant;
-
import java.io.File;
import java.lang.reflect.Method;
@@ -24,12 +28,11 @@
import org.eclipse.jdt.core.JDTCompilerAdapter;
/**
- *
* @author Andrew Eisenberg
* @created Jul 10, 2010
*/
public class GroovyCompilerAdapter extends JDTCompilerAdapter implements CompilerAdapter {
-
+
@Override
public void setJavac(Javac javac) {
super.setJavac(javac);
@@ -37,31 +40,30 @@ public void setJavac(Javac javac) {
File[] groovyFiles = getGroovyFiles(javac);
if (groovyFiles.length > 0) {
// now log...
- for (int i = 0; i < groovyFiles.length; i++) {
+ for (int i = 0, n = groovyFiles.length; i < n; i += 1) {
javac.log("Compiling " + groovyFiles.length + " groovy source file"
+ (groovyFiles.length == 1 ? "" : "s")
+ (destDir != null ? " to " + destDir : ""));
String filename = groovyFiles[i].getAbsolutePath();
javac.log(filename);
}
-
+
File[] newCompileList = new File[groovyFiles.length + compileList.length];
System.arraycopy(compileList, 0, newCompileList, 0, compileList.length);
System.arraycopy(groovyFiles, 0, newCompileList, compileList.length, groovyFiles.length);
compileList = newCompileList;
}
}
-
+
protected File[] getGroovyFiles(Javac javac) {
String[] list = javac.getSrcdir().list();
File destDir = javac.getDestdir();
- File[] sourceFiles = new File[0];
+ File[] sourceFiles = new File[0];
for (int i = 0; i < list.length; i++) {
File srcDir = javac.getProject().resolveFile(list[i]);
if (!srcDir.exists()) {
- throw new BuildException("srcdir \""
- + srcDir.getPath()
- + "\" does not exist!", javac.getLocation());
+ throw new BuildException(
+ "srcdir \"" + srcDir.getPath() + "\" does not exist!", javac.getLocation());
}
DirectoryScanner ds = getDirectoryScanner(srcDir, javac);
@@ -79,23 +81,16 @@ protected File[] getGroovyFiles(Javac javac) {
}
return sourceFiles;
}
-
- /**
- * @param srcDir
- * @return
- */
+
private DirectoryScanner getDirectoryScanner(File srcDir, Javac javac) {
try {
Method getDirectoryScannerMethod = MatchingTask.class.getDeclaredMethod("getDirectoryScanner", File.class);
getDirectoryScannerMethod.setAccessible(true);
return (DirectoryScanner) getDirectoryScannerMethod.invoke(javac, srcDir);
} catch (Exception e) {
- throw new BuildException("Problem finding directory scanner for srcdir \""
- + srcDir.getPath()
- + "\"", e);
+ throw new BuildException("Problem finding directory scanner for srcdir \"" + srcDir.getPath() + "\"", e);
}
}
-
}
@@ -105,25 +100,22 @@ public String[] mapFileName(String sourceFileName) {
if (sourceFileName != null) {
if (sourceFileName.endsWith(".groovy")) {
return new String[] {
- extractVariablePart(sourceFileName, ".groovy".length())
- + ".class" };
+ extractVariablePart(sourceFileName, ".groovy".length()) + ".class"
+ };
}
}
return null;
}
-
+
private String extractVariablePart(String name, int postfixLength) {
- return name.substring(0,
- name.length() - postfixLength);
+ return name.substring(0, name.length() - postfixLength);
}
-
public void setFrom(String from) {
- // noop
+ // no-op
}
public void setTo(String to) {
- // noop
+ // no-op
}
-
}
diff --git a/ide/org.codehaus.groovy.eclipse.ant/src-ant/org/codehaus/groovy/eclipse/ant/GroovyJDTCompileTask.java b/ide/org.codehaus.groovy.eclipse.ant/src-ant/org/codehaus/groovy/eclipse/ant/GroovyJDTCompileTask.java
index 114e9057a6..702bf13907 100644
--- a/ide/org.codehaus.groovy.eclipse.ant/src-ant/org/codehaus/groovy/eclipse/ant/GroovyJDTCompileTask.java
+++ b/ide/org.codehaus.groovy.eclipse.ant/src-ant/org/codehaus/groovy/eclipse/ant/GroovyJDTCompileTask.java
@@ -1,13 +1,18 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Codehaus.org, SpringSource, and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+/*
+ * Copyright 2009-2016 the original author or authors.
*
- * Contributors:
- * Andrew Eisenberg - modified for Groovy Eclipse 2.0
- *******************************************************************************/
+ * 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 org.codehaus.groovy.eclipse.ant;
import java.io.File;
@@ -17,43 +22,29 @@
import org.apache.tools.ant.util.SourceFileScanner;
/**
- * The ant task that calls the JDT Compiler for groovy.
- *
- * This task takes the same arguments as the Javac task
- *
- *
+ * The Ant task that calls the JDT Compiler for groovy.
+ *
+ * This task takes the same arguments as the Javac task.
+ *
* @author Andrew Eisenberg
* @created Jul 6, 2009
- *
*/
public class GroovyJDTCompileTask extends Javac {
- public GroovyJDTCompileTask() {
- }
-
protected void scanDir(File srcDir, File destDir, String[] files) {
GlobPatternMapper m = new GlobPatternMapper();
- m.setFrom("*.java"); //$NON-NLS-1$
- m.setTo("*.class"); //$NON-NLS-1$
+ m.setFrom("*.java");
+ m.setTo("*.class");
SourceFileScanner sfs = new SourceFileScanner(this);
File[] newJavaFiles = sfs.restrictAsFiles(files, srcDir, destDir, m);
-
- m.setFrom("*.groovy"); //$NON-NLS-1$
+ m.setFrom("*.groovy");
File[] newGroovyFiles = sfs.restrictAsFiles(files, srcDir, destDir, m);
-
if (newJavaFiles.length > 0 || newGroovyFiles.length > 0) {
-
- File[] newCompileList
- = new File[compileList.length + newJavaFiles.length + newGroovyFiles.length];
-
- System.arraycopy(compileList, 0, newCompileList, 0,
- compileList.length);
- System.arraycopy(newJavaFiles, 0, newCompileList,
- compileList.length, newJavaFiles.length);
- System.arraycopy(newGroovyFiles, 0, newCompileList,
- compileList.length+newJavaFiles.length, newGroovyFiles.length);
+ File[] newCompileList = new File[compileList.length + newJavaFiles.length + newGroovyFiles.length];
+ System.arraycopy(compileList, 0, newCompileList, 0, compileList.length);
+ System.arraycopy(newJavaFiles, 0, newCompileList, compileList.length, newJavaFiles.length);
+ System.arraycopy(newGroovyFiles, 0, newCompileList, compileList.length+newJavaFiles.length, newGroovyFiles.length);
compileList = newCompileList;
}
-
}
}
diff --git a/ide/org.codehaus.groovy.eclipse.ant/src/org/codehaus/groovy/eclipse/ant/Activator.java b/ide/org.codehaus.groovy.eclipse.ant/src/org/codehaus/groovy/eclipse/ant/Activator.java
index f00c5e1dea..c94b6cdbe5 100644
--- a/ide/org.codehaus.groovy.eclipse.ant/src/org/codehaus/groovy/eclipse/ant/Activator.java
+++ b/ide/org.codehaus.groovy.eclipse.ant/src/org/codehaus/groovy/eclipse/ant/Activator.java
@@ -1,55 +1,46 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Codehaus.org, SpringSource, and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+/*
+ * Copyright 2009-2016 the original author or authors.
*
- * Contributors:
- * Andrew Eisenberg - modified for Groovy Eclipse 2.0
- *******************************************************************************/
+ * 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 org.codehaus.groovy.eclipse.ant;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
- * The activator class controls the plug-in life cycle
+ * The activator class controls the plug-in life cycle.
*/
public class Activator extends Plugin {
- public static final String PLUGIN_ID = "org.codehaus.groovy.eclipse.ant"; //$NON-NLS-1$
-
- private static Activator plugin;
-
- public Activator() {
- }
+ public static final String PLUGIN_ID = "org.codehaus.groovy.eclipse.ant";
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
+ private static Activator plugin;
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+ /**
+ * Returns the shared instance.
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
}
diff --git a/ide/org.codehaus.groovy.eclipse.astviews/build.properties b/ide/org.codehaus.groovy.eclipse.astviews/build.properties
index b6b720c74e..1e9c6f2c5c 100644
--- a/ide/org.codehaus.groovy.eclipse.astviews/build.properties
+++ b/ide/org.codehaus.groovy.eclipse.astviews/build.properties
@@ -1,30 +1,17 @@
-###############################################################################
-# Copyright 2003-2009 the original author or authors.
-#
-# 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.
-###############################################################################
-bin.includes = plugin.xml,\
- META-INF/,\
- icons/,\
- .
-jars.compile.order = .
source.. = src/
output.. = bin/
-src.includes = icons/
-#customBuildCallbacks=customBuildCallbacks.xml
+bin.includes = .,\
+ META-INF/,\
+ plugin.xml,\
+ about.html,\
+ about_files/,\
+ icons/
+src.includes = about.html,\
+ about_files/,\
+ icons/
-sourceFileExtensions=*.java, *.groovy
compilerAdapter=org.codehaus.groovy.eclipse.ant.GroovyCompilerAdapter
+sourceFileExtensions=*.java,*.groovy
compilerAdapter.useLog=true
-compilerArg=-nowarn
\ No newline at end of file
+compilerArg=-nowarn
diff --git a/ide/org.codehaus.groovy.eclipse.astviews/customBuildCallbacks.xml b/ide/org.codehaus.groovy.eclipse.astviews/customBuildCallbacks.xml
deleted file mode 100644
index da575abd2b..0000000000
--- a/ide/org.codehaus.groovy.eclipse.astviews/customBuildCallbacks.xml
+++ /dev/null
@@ -1,212 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ide/org.codehaus.groovy.eclipse.astviews/pom.xml b/ide/org.codehaus.groovy.eclipse.astviews/pom.xml
index 80079c9b55..23b5b85ef7 100644
--- a/ide/org.codehaus.groovy.eclipse.astviews/pom.xml
+++ b/ide/org.codehaus.groovy.eclipse.astviews/pom.xml
@@ -1,49 +1,45 @@
-
- 4.0.0
-
- ../../pom.xml
- org.codehaus.groovy.eclipse
- org.codehaus.groovy.eclipse.parent
- 2.9.2-SNAPSHOT
-
- org.codehaus.groovy.eclipse
- org.codehaus.groovy.eclipse.astviews
- 2.9.2-SNAPSHOT
- eclipse-plugin
-
-
-
-
-
- org.eclipse.tycho
- tycho-compiler-plugin
- ${tycho-version}
-
-
- groovy-eclipse-compiler
-
-
-
-
-
- org.codehaus.groovy
- groovy-eclipse-compiler
- ${groovy-eclipse-compiler-version}
-
-
-
- org.codehaus.groovy
- groovy-eclipse-batch
- ${groovy-eclipse-batch-version}
-
-
-
-
-
+
+ 4.0.0
+
+ ../../pom.xml
+ org.codehaus.groovy.eclipse
+ org.codehaus.groovy.eclipse.parent
+ 2.9.2-SNAPSHOT
+
+ org.codehaus.groovy.eclipse
+ org.codehaus.groovy.eclipse.astviews
+ 2.9.2-SNAPSHOT
+ eclipse-plugin
+
+
+
+ org.eclipse.tycho
+ tycho-compiler-plugin
+ ${tycho-version}
+
+
+ groovy-eclipse-compiler
+
+
+
+
+
+ org.codehaus.groovy
+ groovy-eclipse-compiler
+ ${groovy-eclipse-compiler-version}
+
+
+
+ org.codehaus.groovy
+ groovy-eclipse-batch
+ ${groovy-eclipse-batch-version}
+
+
+
+
+
\ No newline at end of file
diff --git a/ide/org.codehaus.groovy.eclipse.codeassist.completion/src/org/codehaus/groovy/eclipse/codeassist/requestor/CompletionNodeFinder.java b/ide/org.codehaus.groovy.eclipse.codeassist.completion/src/org/codehaus/groovy/eclipse/codeassist/requestor/CompletionNodeFinder.java
index f1ae29956f..a75b78db44 100644
--- a/ide/org.codehaus.groovy.eclipse.codeassist.completion/src/org/codehaus/groovy/eclipse/codeassist/requestor/CompletionNodeFinder.java
+++ b/ide/org.codehaus.groovy.eclipse.codeassist.completion/src/org/codehaus/groovy/eclipse/codeassist/requestor/CompletionNodeFinder.java
@@ -144,8 +144,6 @@ public ContentAssistContext findContentAssistContext(GroovyCompilationUnit unit)
return context;
}
-
-// @Override
@Override
public void visitImports(ModuleNode node) {
PackageNode packageNode = node.getPackage();
diff --git a/ide/org.codehaus.groovy.eclipse.dsl/src/org/codehaus/groovy/eclipse/dsl/contributions/DSLContributionGroup.java b/ide/org.codehaus.groovy.eclipse.dsl/src/org/codehaus/groovy/eclipse/dsl/contributions/DSLContributionGroup.java
index 7dd763bead..e6a671c3fd 100644
--- a/ide/org.codehaus.groovy.eclipse.dsl/src/org/codehaus/groovy/eclipse/dsl/contributions/DSLContributionGroup.java
+++ b/ide/org.codehaus.groovy.eclipse.dsl/src/org/codehaus/groovy/eclipse/dsl/contributions/DSLContributionGroup.java
@@ -1,13 +1,18 @@
-/*******************************************************************************
- * Copyright (c) 2011 Codehaus.org, SpringSource, and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+/*
+ * Copyright 2009-2016 the original author or authors.
*
- * Contributors:
- * Andrew Eisenberg - Initial implemenation
- *******************************************************************************/
+ * 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 org.codehaus.groovy.eclipse.dsl.contributions;
import groovy.lang.Closure;
@@ -43,7 +48,7 @@
* A contribution group will determine the set of contribution elements (eg-
* extra methods, properties, templates, etc) that are added to a particular type
* when the attached pointcut matches.
- *
+ *
* @author andrew
* @created Nov 17, 2010
*/
@@ -63,26 +68,26 @@ public class DSLContributionGroup extends ContributionGroup {
private VariableScope scope;
-
+
// provider that is set for the entire contribution group
// individual contributions can override
private String provider = null;
-
+
private ResolverCache resolver;
-
+
private Map> bindings;
private ClassNode currentType;
-
+
private Map wormhole;
private boolean staticScope;
-
+
private boolean isPrimaryExpression;
public DSLContributionGroup(@SuppressWarnings("rawtypes") Closure contributionClosure) {
this.contributionClosure = contributionClosure;
-
+
if (contributionClosure != null) {
contributionClosure.setDelegate(this);
contributionClosure.setResolveStrategy(Closure.DELEGATE_FIRST);
@@ -99,7 +104,7 @@ public List getContributions(GroovyDSLDContext pattern, Bi
try {
this.contributions = new ArrayList();
this.scope = pattern.getCurrentScope();
- this.resolver = pattern.getResolverCache();
+ this.resolver = pattern.getResolverCache();
this.bindings = matches.getBindings();
this.currentType = pattern.getCurrentType();
this.wormhole = scope.getWormhole();
@@ -123,7 +128,7 @@ public List getContributions(GroovyDSLDContext pattern, Bi
}
}
-
+
@Override
public Object getProperty(String property) {
if ("wormhole".equals(property)) {
@@ -139,7 +144,7 @@ public Object getProperty(String property) {
}
return bindings.get(property);
}
-
+
void setDelegateType(Object arg) {
ClassNode delegate = asClassNode(arg);
if (delegate != null) {
@@ -147,14 +152,14 @@ void setDelegateType(Object arg) {
scope.addVariable("delegate", delegate, VariableScope.CLOSURE_CLASS);
scope.addVariable("getDelegate", delegate, VariableScope.CLOSURE_CLASS);
contributions.add(new EmptyContributionElement(currentType));
-
+
if (isPrimaryExpression) {
// must save for later
currentType = delegate;
}
}
}
-
+
private ClassNode asClassNode(Object value) {
if (value == null) {
return null;
@@ -175,13 +180,13 @@ private ClassNode asClassNode(Object value) {
*/
void method(Map args) {
String name = asString(args.get("name"));
-
+
Object value = args.get("type");
String returnType = value == null ? "java.lang.Object" : asString(value);
-
+
value = args.get("declaringType");
String declaringType = value == null ? getTypeName(currentType) : asString(value);
-
+
value = args.get("provider");
String provider = value == null ? this.provider : asString(value); // might be null
value = args.get("doc");
@@ -189,7 +194,7 @@ void method(Map args) {
boolean useNamedArgs = asBoolean(args.get("useNamedArgs"));
boolean noParens = asBoolean(args.get("noParens"));
-
+
ParameterContribution[] params = extractParams(args, "params");
ParameterContribution[] namedParams = extractParams(args, "namedParams");
ParameterContribution[] optionalParams = extractParams(args, "optionalParams");
@@ -204,6 +209,7 @@ void method(Map args) {
private ParameterContribution[] extractParams(Map args, String paramKind) {
Object value;
+ @SuppressWarnings("unchecked")
Map