Permalink
Browse files

whitespace, cleanup, STS warnings

  • Loading branch information...
1 parent e9a9120 commit 651454b5a1ed0d8bf8be5e0c59980f7ae296b106 Burt Beckwith committed Jul 12, 2012
Showing 339 changed files with 2,714 additions and 2,582 deletions.
@@ -19,17 +19,17 @@ class SimpleOrFileNameCompletor implements Completor {
}
SimpleOrFileNameCompletor(String[] fixedOptions) {
- this.simpleCompletor = new SimpleCompletor(fixedOptions)
- this.fileNameCompletor = new EscapingFileNameCompletor()
+ simpleCompletor = new SimpleCompletor(fixedOptions)
+ fileNameCompletor = new EscapingFileNameCompletor()
}
int complete(String buffer, int cursor, List candidates) {
// Try the simple completor first...
- def retval = this.simpleCompletor.complete(buffer, cursor, candidates)
+ def retval = simpleCompletor.complete(buffer, cursor, candidates)
// ...and then the file path completor. By using the given candidate
// list with both completors we aggregate the results automatically.
- def fileRetval = this.fileNameCompletor.complete(buffer, cursor, candidates)
+ def fileRetval = fileNameCompletor.complete(buffer, cursor, candidates)
// If the simple completor has matched, we return its value, otherwise
// we return whatever the file path matcher returned. This ensures that
@@ -50,7 +50,7 @@
public class GrailsConsole {
private static GrailsConsole instance;
-
+
public static final String ENABLE_TERMINAL = "grails.console.enable.terminal";
public static final String ENABLE_INTERACTIVE = "grails.console.enable.interactive";
public static final String LINE_SEPARATOR = System.getProperty("line.separator");
@@ -154,7 +154,7 @@ private boolean isInteractiveEnabled() {
}
private boolean isActivateTerminal() {
- return readPropOrTrue(ENABLE_TERMINAL);
+ return readPropOrTrue(ENABLE_TERMINAL);
}
private boolean readPropOrTrue(String prop) {
@@ -64,7 +64,7 @@ public static BuildScope getCurrent() {
* Returns whether the specified scope name(s) are valid given the current scope.
*
* @param scopeNames The list of scope names
- * @return True if they are valid
+ * @return true if they are valid
*/
public static boolean isValid(String... scopeNames) {
BuildScope currentScope = getCurrent();
@@ -80,6 +80,6 @@ public static boolean isValid(String... scopeNames) {
* Enables this build scope as the curent system wide instance.
*/
public void enable() {
- System.setProperty(KEY, this.toString());
+ System.setProperty(KEY, toString());
}
}
@@ -1210,7 +1210,7 @@ class BuildSettings extends AbstractBuildSettings {
switch (e.eventType) {
case TransferEvent.TRANSFER_STARTED:
def resourceName = e.resource.name
- if(!resourceName?.endsWith('plugins-list.xml')) {
+ if (!resourceName?.endsWith('plugins-list.xml')) {
resourceName = resourceName[resourceName.lastIndexOf('/') + 1..-1]
console.updateStatus "Downloading: ${resourceName}"
}
@@ -1291,14 +1291,14 @@ class BuildSettings extends AbstractBuildSettings {
// The logic here tries to establish if the plugin has been declared anywhere by the application. Only plugins that have
// been declared should have their transitive dependencies resolved. Unfortunately it is fairly complicated to establish what plugins are declared since
// there may be a mixture of plugins defined in BuildConfig, inline plugins and plugins installed via install-plugin
- if(!isRegisteredInMetadata(pluginName) && notDefinedInBuildConfig(pluginName) && !isInlinePluginLocation(dir)) {
+ if (!isRegisteredInMetadata(pluginName) && notDefinedInBuildConfig(pluginName) && !isInlinePluginLocation(dir)) {
return
}
def pdd = dependencyManager.getPluginDependencyDescriptor(pluginName)
- if(isInlinePluginLocation(dir) || (pdd && pdd.transitive)) {
+ if (isInlinePluginLocation(dir) || (pdd && pdd.transitive)) {
// bail out of the dependencies handled by external tool
- if(isDependenciesExternallyConfigured()) return
+ if (isDependenciesExternallyConfigured()) return
// Try BuildConfig.groovy first, which should work
// work for in-place plugins.
def path = dir.absolutePath
@@ -1383,7 +1383,7 @@ class BuildSettings extends AbstractBuildSettings {
if (!projectTargetDirSet) {
projectTargetDir = new File(getPropertyValue(PROJECT_TARGET_DIR, props, "$baseDir/target"))
- if(!projectTargetDir.absolute) {
+ if (!projectTargetDir.absolute) {
projectTargetDir = new File(baseDir, projectTargetDir.path)
}
}
@@ -1394,7 +1394,7 @@ class BuildSettings extends AbstractBuildSettings {
def warName = version ? "$baseDir/target/${appName}-${version}.war" : "$baseDir/target/${appName}.war"
projectWarFile = new File(getPropertyValue(PROJECT_WAR_FILE, props, warName))
- if(!projectWarFile.absolute) {
+ if (!projectWarFile.absolute) {
projectWarFile = new File(baseDir, projectWarFile.path)
}
}
@@ -1414,38 +1414,38 @@ class BuildSettings extends AbstractBuildSettings {
if (!classesDirSet) {
classesDir = new File(getPropertyValue(PROJECT_CLASSES_DIR, props, "$projectWorkDir/classes"))
- if(!classesDir.absolute) {
+ if (!classesDir.absolute) {
classesDir = new File(baseDir, classesDir.path)
}
}
if (!testClassesDirSet) {
testClassesDir = new File(getPropertyValue(PROJECT_TEST_CLASSES_DIR, props, "$projectWorkDir/test-classes"))
- if(!testClassesDir.absolute) {
+ if (!testClassesDir.absolute) {
testClassesDir = new File(baseDir, testClassesDir.path)
}
}
if (!pluginClassesDirSet) {
pluginClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_CLASSES_DIR, props, "$projectWorkDir/plugin-classes"))
- if(!pluginClassesDir.absolute) {
+ if (!pluginClassesDir.absolute) {
pluginClassesDir = new File(baseDir, pluginClassesDir.path)
}
}
if (!pluginBuildClassesDirSet) {
pluginBuildClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_BUILD_CLASSES_DIR, props, "$projectWorkDir/plugin-build-classes"))
- if(!pluginBuildClassesDir.absolute) {
+ if (!pluginBuildClassesDir.absolute) {
pluginBuildClassesDir = new File(baseDir, pluginBuildClassesDir.path)
}
}
if (!pluginProvidedClassesDirSet) {
pluginProvidedClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_PROVIDED_CLASSES_DIR, props, "$projectWorkDir/plugin-provided-classes"))
- if(!pluginProvidedClassesDir.absolute) {
+ if (!pluginProvidedClassesDir.absolute) {
pluginProvidedClassesDir = new File(baseDir, pluginProvidedClassesDir.path)
}
@@ -1473,16 +1473,16 @@ class BuildSettings extends AbstractBuildSettings {
if (!testReportsDirSet) {
testReportsDir = new File(getPropertyValue(PROJECT_TEST_REPORTS_DIR, props, "${projectTargetDir}/test-reports"))
- if(!testReportsDir.absolute) {
+ if (!testReportsDir.absolute) {
testReportsDir = new File(baseDir, testReportsDir.path)
- }
+ }
}
if (!docsOutputDirSet) {
docsOutputDir = new File(getPropertyValue(PROJECT_DOCS_OUTPUT_DIR, props, "${projectTargetDir}/docs"))
- if(!docsOutputDir.absolute) {
+ if (!docsOutputDir.absolute) {
docsOutputDir = new File(baseDir, docsOutputDir.path)
- }
+ }
}
if (!testSourceDirSet) {
@@ -161,7 +161,7 @@ public static Environment getCurrentEnvironment() {
/**
* Returns true if the application is running in development mode (within grails run-app)
- * @return True if the application is running in development mode
+ * @return true if the application is running in development mode
*/
public static boolean isDevelopmentMode() {
return getCurrent() == DEVELOPMENT && !(Metadata.getCurrent().isWarDeployed()) &&
@@ -170,15 +170,15 @@ public static boolean isDevelopmentMode() {
/**
* Check whether the application is deployed
- * @return True if is
+ * @return true if is
*/
public static boolean isWarDeployed() {
return Metadata.getCurrent().isWarDeployed();
}
/**
* Returns whether the environment is running within the Grails shell (executed via the 'grails' command line in a terminal window)
- * @return True if is
+ * @return true if is
*/
public static boolean isWithinShell() {
return DefaultGroovyMethods.getRootLoader(Environment.class.getClassLoader()) != null;
@@ -314,7 +314,7 @@ Object execute() {
}
private EnvironmentBlockEvaluator(Environment e) {
- this.current = e;
+ current = e;
}
@SuppressWarnings("unused")
@@ -327,19 +327,19 @@ public void environments(Closure<?> c) {
@SuppressWarnings("unused")
public void production(Closure<?> c) {
if (current == Environment.PRODUCTION) {
- this.callable = c;
+ callable = c;
}
}
@SuppressWarnings("unused")
public void development(Closure<?> c) {
if (current == Environment.DEVELOPMENT) {
- this.callable = c;
+ callable = c;
}
}
@SuppressWarnings("unused")
public void test(Closure<?> c) {
if (current == Environment.TEST) {
- this.callable = c;
+ callable = c;
}
}
@@ -348,7 +348,7 @@ public Object methodMissing(String name, Object args) {
Object[] argsArray = (Object[])args;
if (args != null && argsArray.length > 0 && (argsArray[0] instanceof Closure)) {
if (current == Environment.CUSTOM && current.getName().equals(name)) {
- this.callable = (Closure<?>) argsArray[0];
+ callable = (Closure<?>) argsArray[0];
}
return null;
}
@@ -402,12 +402,12 @@ public static boolean isInteractiveMode() {
public static boolean isInitializing() {
return initializingState;
}
-
+
public static void setInitializing(boolean initializing) {
- initializingState=initializing;
+ initializingState = initializing;
System.setProperty(INITIALIZING, String.valueOf(initializing));
}
-
+
/**
* @return true if the reloading agent is active
*/
@@ -56,7 +56,7 @@ private Metadata() {
}
private Metadata(File f) {
- this.metadataFile = f;
+ metadataFile = f;
loadFromFile(f);
}
@@ -14,24 +14,23 @@
*/
package grails.util
+import groovy.transform.CompileStatic
import groovy.util.slurpersupport.GPathResult
import java.util.concurrent.ConcurrentHashMap
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
+import org.codehaus.groovy.grails.io.support.AntPathMatcher
+import org.codehaus.groovy.grails.io.support.FileSystemResource
+import org.codehaus.groovy.grails.io.support.IOUtils
+import org.codehaus.groovy.grails.io.support.PathMatchingResourcePatternResolver
+import org.codehaus.groovy.grails.io.support.Resource
import org.codehaus.groovy.grails.plugins.BasicGrailsPluginInfo
import org.codehaus.groovy.grails.plugins.CompositePluginDescriptorReader
import org.codehaus.groovy.grails.plugins.GrailsPluginInfo
import org.codehaus.groovy.grails.plugins.PluginInfo
import org.codehaus.groovy.grails.plugins.build.scopes.PluginScopeInfo
-import groovy.transform.CompileStatic
-import org.codehaus.groovy.grails.io.support.Resource
-import org.codehaus.groovy.grails.io.support.FileSystemResource
-import org.codehaus.groovy.grails.io.support.PathMatchingResourcePatternResolver
-import org.codehaus.groovy.grails.io.support.AntPathMatcher
-import java.lang.reflect.Array
-import org.codehaus.groovy.grails.io.support.IOUtils
/**
* Uses the project BuildSettings object to discover information about the installed plugin
@@ -102,8 +101,8 @@ class PluginBuildSettings {
// lots of unit tests will fail.
this.buildSettings = buildSettings
this.pluginManager = pluginManager
- this.pluginDirPath = buildSettings?.projectPluginsDir?.absolutePath
- this.pluginLocations = buildSettings?.config?.grails?.plugin?.location
+ pluginDirPath = buildSettings?.projectPluginsDir?.absolutePath
+ pluginLocations = buildSettings?.config?.grails?.plugin?.location
if (buildSettings == null) {
return
@@ -164,7 +163,7 @@ class PluginBuildSettings {
}
@CompileStatic
- protected def addPluginScopeInfoForDirAndInfo(PluginScopeInfo compileInfo, GrailsPluginInfo info, Resource dir) {
+ protected void addPluginScopeInfoForDirAndInfo(PluginScopeInfo compileInfo, GrailsPluginInfo info, Resource dir) {
def excludedPaths = PLUGIN_EXCLUDE_PATHS // conf gets special handling
compileInfo.pluginInfos << info
compileInfo.pluginNames << info.name
@@ -191,7 +190,7 @@ class PluginBuildSettings {
/**
* Returns an array of PluginInfo objects
*/
- GrailsPluginInfo[] getPluginInfos(String pluginDirPath=this.pluginDirPath) {
+ GrailsPluginInfo[] getPluginInfos(String pluginDirPath = this.pluginDirPath) {
if (pluginInfosMap) {
return cache['pluginInfoList']
}
@@ -357,7 +356,7 @@ class PluginBuildSettings {
def userHome = System.getProperty("user.home")
def grailsHome = buildSettings.grailsHome?.absolutePath
def basedir = buildSettings.baseDir.absolutePath
- if(grailsHome != null) {
+ if (grailsHome != null) {
resourceResolver("file:${grailsHome}/scripts/**.groovy").each { if (!it.file.name.startsWith('_')) scripts << it }
}
resourceResolver("file:${basedir}/scripts/*.groovy").each { if (!it.file.name.startsWith('_')) scripts << it }
@@ -391,7 +390,6 @@ class PluginBuildSettings {
* Obtains an array of all plugin provided source directories
*
* @deprecated Use getPluginSourceDirectories
- *
*/
Resource[] getPluginSourceFiles() {
return getPluginSourceDirectories()
@@ -421,16 +419,16 @@ class PluginBuildSettings {
/**
- * Gets all the plugin source directories for the given plugin directory
- */
+ * Gets all the plugin source directories for the given plugin directory
+ */
Resource[] getPluginSourceDirectories(File pluginDir) {
getPluginSourceDirectories() // initialize cache
cache['sourceFilesPerPlugin'][pluginDir.absolutePath]
}
/**
- * @deprecated Use getPluginSourceDirectories
+ * @deprecated Use getPluginSourceDirectories
*/
Resource[] getPluginSourceFiles(File pluginDir) {
return getPluginSourceDirectories(pluginDir)
@@ -549,7 +547,6 @@ class PluginBuildSettings {
/**
- *
* @return A list of plugin infos that are supported and scoped for compile or runtime
*/
@CompileStatic
@@ -563,6 +560,7 @@ class PluginBuildSettings {
}
return artefactResources
}
+
/**
*
* @return A list of plugin infos that are supported and scoped for compile or runtime
@@ -722,7 +720,7 @@ class PluginBuildSettings {
if (pluginLoc?.value) pluginFile = new File(pluginLoc.value.toString())
}
- if(pluginFile != null) {
+ if (pluginFile != null) {
pluginResource = new FileSystemResource(pluginFile)
}
if (pluginResource) {
Oops, something went wrong.

0 comments on commit 651454b

Please sign in to comment.