Permalink
Browse files

whitespace, STS warnings, etc.

  • Loading branch information...
1 parent 41d6978 commit 94733fb62817abba5bfd73412c4c299e55f17828 @burtbeckwith burtbeckwith committed Aug 31, 2011
Showing with 1,259 additions and 1,340 deletions.
  1. +10 −11 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java
  2. +1 −1 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsEclipseConsole.java
  3. +1 −10 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLine.java
  4. +6 −6 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLineParser.java
  5. +2 −2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/ParseException.java
  6. +36 −42 grails-bootstrap/src/test/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLineParserSpec.groovy
  7. +7 −8 grails-core/src/main/groovy/grails/validation/ValidationErrors.groovy
  8. +17 −6 grails-core/src/main/groovy/grails/web/CamelCaseUrlConverter.java
  9. +9 −9 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass.java
  10. +5 −9 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsDomainClassProperty.java
  11. +3 −5 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DomainClassArtefactHandler.java
  12. +14 −15 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsDomainConfigurationUtil.java
  13. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectWatcher.java
  14. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsASTUtils.java
  15. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/DefaultGrailsPluginManager.java
  16. +8 −4 grails-core/src/main/groovy/org/codehaus/groovy/grails/support/SoftThreadLocalMap.java
  17. +3 −4 grails-core/src/test/groovy/grails/web/CamelCaseUrlConverterSpec.groovy
  18. +3 −4 grails-core/src/test/groovy/grails/web/HyphenatedUrlConverterSpec.groovy
  19. +1 −1 ...rc/test/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsArtefactTransformerSpec.groovy
  20. +3 −3 ...ls-crud/src/main/groovy/org/codehaus/groovy/grails/scaffolding/view/ScaffoldedGroovyPageView.java
  21. +2 −2 grails-docs/src/main/groovy/grails/doc/DocPublisher.groovy
  22. +1 −1 grails-docs/src/main/groovy/grails/doc/internal/LegacyTocStrategy.groovy
  23. +1 −1 grails-docs/src/test/groovy/grails/doc/internal/YamlTocStrategySpec.groovy
  24. +35 −9 grails-hibernate/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java
  25. +1 −7 ...src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/ConfigurableLocalSessionFactoryBean.java
  26. +10 −9 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/HibernateDatastore.java
  27. +61 −57 ...s-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/HibernateGormEnhancer.groovy
  28. +98 −98 ...ls-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsDomainBinder.java
  29. +1 −1 .../src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/HibernateNamedQueriesBuilder.groovy
  30. +1 −1 ...in/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractDynamicPersistentMethod.java
  31. +17 −10 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractSavePersistentMethod.java
  32. +2 −2 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/ExecuteQueryPersistentMethod.java
  33. +2 −5 ...e/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindAllPersistentMethod.java
  34. +1 −1 ...nate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindPersistentMethod.java
  35. +2 −2 ...nate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/SavePersistentMethod.java
  36. +37 −44 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/query/HibernateQuery.java
  37. +84 −72 ...ernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/support/ClosureEventListener.java
  38. +12 −13 ...in/groovy/org/codehaus/groovy/grails/orm/hibernate/support/ClosureEventTriggeringInterceptor.java
  39. +2 −6 grails-hibernate/src/test/groovy/org/codehaus/groovy/grails/compiler/gorm/GormTransformerSpec.groovy
  40. +2 −0 ...plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersApi.java
  41. +4 −4 ...gin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/RenderDynamicMethod.java
  42. +2 −2 ...in-controllers/src/main/groovy/org/codehaus/groovy/grails/web/plugins/support/WebMetaUtils.groovy
  43. +1 −1 ...roovy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformerCommandObjectSpec.groovy
  44. +1 −1 ...rs/src/test/groovy/org/codehaus/groovy/grails/compiler/web/ControllerDomainTransformerSpec.groovy
  45. +7 −14 ...trollers/src/test/groovy/org/codehaus/groovy/grails/compiler/web/ControllerTransformerSpec.groovy
  46. +0 −2 ...roovy/org/codehaus/groovy/grails/web/converters/marshaller/xml/InstanceMethodBasedMarshaller.java
  47. +13 −21 .../groovy/org/codehaus/groovy/grails/compiler/web/converters/ConvertersDomainTransformerSpec.groovy
  48. +1 −0 ...main-class/src/main/groovy/org/codehaus/groovy/grails/domain/GrailsDomainClassMappingContext.java
  49. +1 −1 ...ugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/compiler/web/taglib/TagLibraryTransformer.java
  50. +2 −2 grails-plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/plugins/web/api/TagLibraryApi.java
  51. +1 −1 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/FormTagLib.groovy
  52. +9 −9 ...ls-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/SitemeshTagLib.groovy
  53. +1 −1 ...-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/ValidationTagLib.groovy
  54. +1 −1 grails-plugin-logging/src/main/groovy/org/slf4j/impl/GrailsLog4jLoggerAdapter.java
  55. +3 −3 grails-plugin-testing/src/main/groovy/grails/test/AbstractCliTestCase.groovy
  56. +1 −1 grails-plugin-testing/src/main/groovy/grails/test/mixin/support/GrailsUnitTestMixin.groovy
  57. +1 −1 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/ControllerUnitTestMixin.groovy
  58. +3 −3 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/TomcatServer.groovy
  59. +1 −2 ...ngs/src/main/groovy/org/codehaus/groovy/grails/plugins/web/mapping/UrlMappingsGrailsPlugin.groovy
  60. +1 −1 ...url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/filter/UrlMappingsFilter.java
  61. +1 −1 grails-plugin-validation/src/main/groovy/grails/validation/DefaultASTValidateableHelper.java
  62. +2 −2 grails-plugin-validation/src/main/groovy/org/codehaus/groovy/grails/validation/Validateable.groovy
  63. +2 −2 grails-plugin-validation/src/test/groovy/grails/validation/DefaultASTValidateableHelperSpec.groovy
  64. +2 −2 .../test/groovy/org/codehaus/groovy/grails/compiler/validation/ValidateableTransformationSpec.groovy
  65. +1 −1 ...-validation/src/test/groovy/org/codehaus/groovy/grails/plugins/ValidationGrailsPluginTests.groovy
  66. +9 −9 grails-resources/src/grails/home/dsl-support/dsld/grails.dsld
  67. +2 −3 ...e/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/AbstractGrailsControllerTests.groovy
  68. +1 −1 ...st-suite-base/src/main/groovy/org/codehaus/groovy/grails/web/taglib/AbstractGrailsTagTests.groovy
  69. +2 −3 ...sistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/CharSequenceAndGormTests.groovy
  70. +1 −10 ...ence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/CustomTypeMappingForMapTests.groovy
  71. +1 −10 ...istence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/DomainEventsFlushingTests.groovy
  72. +6 −19 ...ce/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/EmbeddedGlobalConstraintsTests.groovy
  73. +4 −4 ...nce/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/HibernateCriteriaBuilderTests.groovy
  74. +2 −2 ...te-persistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/NamedCriteriaTests.groovy
  75. +4 −4 ...ersistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/PersistenceMethodTests.groovy
  76. +0 −11 ...istence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/UserTypeGlobalConfigTests.groovy
  77. +3 −11 ...test-suite-uber/src/test/groovy/grails/test/mixin/ControllerAndFilterMixinInteractionTests.groovy
  78. +1 −7 ...uber/src/test/groovy/grails/test/mixin/DomainClassWithDefaultConstraintsUnitTestMixinTests.groovy
  79. +2 −2 ...test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/commons/CodecArtefactHandlerTests.java
  80. +5 −7 ...e-uber/src/test/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass2Tests.java
  81. +3 −3 ...-uber/src/test/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClassTests.groovy
  82. +4 −5 ...uite-uber/src/test/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsDomainClassTests.groovy
  83. +1 −1 ...te-uber/src/test/groovy/org/codehaus/groovy/grails/web/errors/GrailsExceptionResolverTests.groovy
  84. +0 −2 ...ite-uber/src/test/groovy/org/codehaus/groovy/grails/web/servlet/GrailsDispatcherServletTests.java
  85. +10 −10 ...e-uber/src/test/groovy/org/codehaus/groovy/grails/web/servlet/mvc/RenderDynamicMethodTests.groovy
  86. +7 −4 ...-uber/src/test/groovy/org/codehaus/groovy/grails/web/servlet/mvc/SimpleGrailsControllerTests.java
  87. +17 −17 ...st-suite-uber/src/test/groovy/org/codehaus/groovy/grails/web/sitemesh/GSPSitemeshPageTests.groovy
  88. +2 −3 ...ls-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/web/util/StreamCharBufferTests.java
  89. +10 −25 grails-test-suite-web/build.gradle
  90. +10 −10 grails-test-suite-web/src/test/groovy/grails/gsp/PageRendererSpec.groovy
  91. +1 −1 grails-test-suite-web/src/test/groovy/grails/test/GrailsUrlMappingsTestCaseTests.groovy
  92. +0 −8 ...ite-web/src/test/groovy/org/codehaus/groovy/grails/web/binding/BindXmlWithAssociationTests.groovy
  93. +3 −3 ...e-web/src/test/groovy/org/codehaus/groovy/grails/web/mapping/filter/UrlMappingsFilterTests.groovy
  94. +13 −13 ...st-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/pages/GroovyPageRenderingTests.groovy
  95. +22 −26 ...te-web/src/test/groovy/org/codehaus/groovy/grails/web/pages/GroovyPagesTemplateEngineTests.groovy
  96. +4 −4 ...est-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/taglib/ApplicationTagLibTests.groovy
  97. +4 −3 grails-test-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/taglib/FormTagLib2Tests.groovy
  98. +1 −1 grails-test-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/taglib/FormTagLib3Tests.groovy
  99. +1 −0 ...s-test-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/taglib/GroovyCollectTagTests.java
  100. +78 −78 grails-test-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/taglib/RenderTagLibTests.groovy
  101. +50 −50 ...est-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/taglib/ReturnValueTagLibTests.groovy
  102. +1 −1 grails-web/src/main/groovy/grails/gsp/PageRenderer.groovy
  103. +5 −6 grails-web/src/main/groovy/grails/util/GrailsWebUtil.java
  104. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/CommonWebApi.java
  105. +12 −6 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/binding/GrailsDataBinder.java
  106. +2 −2 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultLinkGenerator.groovy
  107. +6 −4 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPage.java
  108. +15 −16 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPageBinding.java
  109. +47 −49 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPageParser.java
  110. +5 −5 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPageRequestBinding.java
  111. +28 −28 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPageScanner.java
  112. +6 −6 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPageTemplate.java
  113. +19 −19 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPageWritable.java
  114. +2 −2 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPagesServlet.java
  115. +26 −22 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/GrailsParameterMap.java
  116. +4 −4 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/view/GroovyPageView.java
  117. +2 −2 ...s-web/src/main/groovy/org/codehaus/groovy/grails/web/sitemesh/GrailsContentBufferingResponse.java
  118. +3 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/taglib/GroovyPageAttributes.java
  119. +4 −5 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/taglib/GroovySyntaxTag.java
  120. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/taglib/jsp/JspFormRemoteTag.java
  121. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/taglib/jsp/JspFormTag.java
  122. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/taglib/jsp/JspLinkTag.java
  123. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/taglib/jsp/JspRemoteFunctionTag.java
  124. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/taglib/jsp/JspRemoteLinkTag.java
  125. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/taglib/jsp/JspSubmitToRemoteTag.java
  126. +89 −86 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/util/AbstractTypeConvertingMap.java
  127. +3 −3 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/util/GrailsPrintWriter.java
  128. +36 −37 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/util/StreamCharBuffer.java
  129. +61 −64 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/util/TypeConvertingMap.groovy
  130. +9 −11 scripts/RefreshDependencies.groovy
  131. +2 −2 scripts/Upgrade.groovy
  132. +5 −9 scripts/_GrailsPluginDev.groovy
  133. +9 −9 scripts/_GrailsRun.groovy
  134. +1 −1 scripts/_GrailsWar.groovy
@@ -142,7 +142,7 @@ protected ConsoleReader createConsoleReader() throws IOException {
* is controlled by the jline.terminal system property.
*/
protected Terminal createTerminal() {
- Terminal terminal;
+ @SuppressWarnings("hiding") Terminal terminal;
if (isWindows()) {
terminal = new WindowsTerminal() {
@Override
@@ -170,12 +170,12 @@ public boolean isANSISupported() {
* like they do not understand ansi, even if we were to implement support in Eclipse to'
* handle it and the wrapped stream will not pass the ansi chars on to Eclipse).
*/
- protected OutputStream ansiWrap(OutputStream out) {
+ protected OutputStream ansiWrap(@SuppressWarnings("hiding") OutputStream out) {
return AnsiConsole.wrapOutputStream(out);
}
// hack to workaround JLine bug - see https://issues.apache.org/jira/browse/GERONIMO-3978 for source of fix
- private void fixCtrlC() throws IOException {
+ private void fixCtrlC() {
try {
Field f = ConsoleReader.class.getDeclaredField("keybindings");
f.setAccessible(true);
@@ -592,14 +592,13 @@ public String userInput(String msg) {
* @return The user input prompt
*/
private String showPrompt(String prompt) {
- cursorMove = 0;
- if(!userInputActive) {
- return readLine(prompt);
- }
- else {
- out.print(prompt);
- return null;
- }
+ cursorMove = 0;
+ if (!userInputActive) {
+ return readLine(prompt);
+ }
+
+ out.print(prompt);
+ return null;
}
private String readLine(String prompt) {
@@ -50,7 +50,7 @@ protected GrailsEclipseConsole() throws IOException {
}
@Override
- protected OutputStream ansiWrap(OutputStream out) {
+ protected OutputStream ansiWrap(@SuppressWarnings("hiding") OutputStream out) {
if (DEBUG) {
try {
out.write(("<<<"+ECLIPSE_SUPPORTS_ANSI_PROP+":"+eclipseSupportsAnsi()+">>>\n").getBytes());
@@ -15,9 +15,6 @@
*/
package org.codehaus.groovy.grails.cli.parsing;
-import groovy.lang.Closure;
-import org.codehaus.groovy.grails.cli.GrailsScriptRunner;
-
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -40,7 +37,6 @@
String NON_INTERACTIVE_ARGUMENT = "non-interactive";
/**
- *
* @return The environment specified
*/
String getEnvironment();
@@ -51,19 +47,16 @@
boolean isEnvironmentSet();
/**
- *
* @return The command name specified
*/
String getCommandName();
/**
- *
* @return The remaining arguments after the command name
*/
List<String> getRemainingArgs();
/**
- *
* @return The remaining arguments as an array
*/
String[] getRemainingArgsArray();
@@ -74,11 +67,10 @@
Properties getSystemProperties();
/**
- *
* @param name The name of the option
* @return Whether the given option is specified
*/
- public boolean hasOption(String name);
+ boolean hasOption(String name);
/**
* The value of an option
@@ -97,6 +89,5 @@
*/
String getRemainingArgsLineSeparated();
-
Map<String, Object> getUndeclaredOptions();
}
@@ -74,12 +74,12 @@ public void addOption(String name, String description) {
*/
public CommandLine parseString(String string) {
// Steal ants implementation for argument splitting. Handles quoted arguments with " or '.
- // Doesn't handle escape sequences with \
- try {
- return parse(Commandline.translateCommandline(string));
- } catch (BuildException e) {
- throw new ParseException(e); //Rethrow as an error that clients can expect.
- }
+ // Doesn't handle escape sequences with \
+ try {
+ return parse(Commandline.translateCommandline(string));
+ } catch (BuildException e) {
+ throw new ParseException(e); //Rethrow as an error that clients can expect.
+ }
}
/**
@@ -28,8 +28,8 @@
public ParseException(String message) {
super(message);
}
-
+
public ParseException(Throwable cause) {
- super(cause);
+ super(cause);
}
}
@@ -5,7 +5,7 @@ import spock.lang.Specification
/**
* Tests for {@link CommandLineParser}
*/
-class CommandLineParserSpec extends Specification{
+class CommandLineParserSpec extends Specification {
void "Test parse basic command"() {
when:
@@ -66,11 +66,10 @@ class CommandLineParserSpec extends Specification{
then:
thrown ParseException
-
}
void "Test parse command with environment, sys props, arguments and undeclared options"() {
- when:
+ when:
def parser = new CommandLineParser()
def cl = parser.parse("prod", "run-app", "-DmyProp=value", "foo", "bar", "--dev-mode")
@@ -83,7 +82,6 @@ class CommandLineParserSpec extends Specification{
cl.remainingArgs == ['foo', 'bar']
cl.hasOption('dev-mode')
cl.optionValue('dev-mode') == true
-
}
void "Test parse command with environment, sys props, arguments and undeclared options with values"() {
@@ -100,7 +98,6 @@ class CommandLineParserSpec extends Specification{
cl.remainingArgs == ['foo', 'bar']
cl.hasOption('host')
cl.optionValue('host') == "localhost"
-
}
void "Test help message with declared options"() {
@@ -112,9 +109,7 @@ class CommandLineParserSpec extends Specification{
then:
String ls = System.getProperty("line.separator");
parser.helpMessage == "usage: grails [options] [command]${ls} -interactive-mode Enabled interactive mode${ls} -version Shows the vesrion${ls}"
- }
-
-
+ }
// STRING tests
@@ -186,7 +181,6 @@ class CommandLineParserSpec extends Specification{
cl.remainingArgs == ['foo', 'bar']
cl.hasOption('dev-mode')
cl.optionValue('dev-mode') == true
-
}
void "Test parse string command with environment, sys props, arguments and undeclared options with values"() {
@@ -205,8 +199,8 @@ class CommandLineParserSpec extends Specification{
cl.optionValue('host') == "localhost"
}
-
- void "Test that parseString handles quoted arguments with double quotes"() {
+
+ void "Test that parseString handles quoted arguments with double quotes"() {
when:
def parser = new CommandLineParser()
def cl = parser.parseString('refresh-dependencies --include-sources "file with spaces.xml"')
@@ -216,37 +210,37 @@ class CommandLineParserSpec extends Specification{
cl.systemProperties.size() == 0
cl.remainingArgs.size() == 1
cl.remainingArgs == ['file with spaces.xml']
- }
-
- void "Test that parseString handles quoted arguments with single quotes"() {
- when:
- def parser = new CommandLineParser()
- def cl = parser.parseString("refresh-dependencies --include-sources 'file with spaces.xml'")
-
- then:
- cl.commandName == 'refresh-dependencies'
- cl.systemProperties.size() == 0
- cl.remainingArgs.size() == 1
- cl.remainingArgs == ['file with spaces.xml']
- cl.hasOption('include-sources')
- cl.optionValue('include-sources') == true
- }
-
- void "Test that parseString with unbalanced double quotes throws ParseException"() {
- when:
- def parser = new CommandLineParser()
- def cl = parser.parseString("refresh-dependencies --include-sources 'file with spaces.xml")
-
- then:
+ }
+
+ void "Test that parseString handles quoted arguments with single quotes"() {
+ when:
+ def parser = new CommandLineParser()
+ def cl = parser.parseString("refresh-dependencies --include-sources 'file with spaces.xml'")
+
+ then:
+ cl.commandName == 'refresh-dependencies'
+ cl.systemProperties.size() == 0
+ cl.remainingArgs.size() == 1
+ cl.remainingArgs == ['file with spaces.xml']
+ cl.hasOption('include-sources')
+ cl.optionValue('include-sources') == true
+ }
+
+ void "Test that parseString with unbalanced double quotes throws ParseException"() {
+ when:
+ def parser = new CommandLineParser()
+ def cl = parser.parseString("refresh-dependencies --include-sources 'file with spaces.xml")
+
+ then:
thrown ParseException
- }
-
- void "Test that parseString with unbalanced single quotes throws ParseException"() {
- when:
- def parser = new CommandLineParser()
- def cl = parser.parseString('refresh-dependencies --include-sources "file with spaces.xml')
-
- then:
+ }
+
+ void "Test that parseString with unbalanced single quotes throws ParseException"() {
+ when:
+ def parser = new CommandLineParser()
+ def cl = parser.parseString('refresh-dependencies --include-sources "file with spaces.xml')
+
+ then:
thrown ParseException
- }
+ }
}
@@ -13,24 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package grails.validation;
+package grails.validation
-import org.springframework.validation.BeanPropertyBindingResult;
+import org.springframework.validation.BeanPropertyBindingResult
/**
- *
- * Models validation errors in a Grails application
- *
+ * Models validation errors in a Grails application.
+ *
* @author Graeme Rocher
* @since 2.0
*/
-public class ValidationErrors extends BeanPropertyBindingResult {
+class ValidationErrors extends BeanPropertyBindingResult {
- public ValidationErrors(Object target) {
+ ValidationErrors(Object target) {
super(target, target.getClass().name)
}
- public ValidationErrors(Object target, String objectName) {
+ ValidationErrors(Object target, String objectName) {
super(target, objectName)
}
@@ -1,24 +1,35 @@
+/*
+ * Copyright 2011 SpringSource.
+ *
+ * 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 grails.web;
import java.util.Locale;
import org.apache.commons.lang.StringUtils;
-import grails.util.GrailsNameUtils;
-
public class CamelCaseUrlConverter implements UrlConverter {
public String toUrlElement(String propertyOrClassName) {
- if(StringUtils.isBlank(propertyOrClassName)) {
+ if (StringUtils.isBlank(propertyOrClassName)) {
return propertyOrClassName;
}
if (propertyOrClassName.length() > 1 && Character.isUpperCase(propertyOrClassName.charAt(0)) &&
Character.isUpperCase(propertyOrClassName.charAt(1))) {
return propertyOrClassName;
}
- String uriElement = propertyOrClassName.substring(0,1).toLowerCase(Locale.ENGLISH) + propertyOrClassName.substring(1);
- return uriElement;
+ return propertyOrClassName.substring(0,1).toLowerCase(Locale.ENGLISH) + propertyOrClassName.substring(1);
}
-
}
@@ -175,7 +175,7 @@ private void configureMappingForMethodAction(String closureName) {
String tmpUri = controllerPath + urlConverter.toUrlElement(closureName);
uri2methodMap.put(tmpUri, closureName);
uri2methodMap.put(tmpUri + SLASH + "**", closureName);
-
+
String viewPath = SLASH + GrailsNameUtils.getPropertyNameRepresentation(getName()) + SLASH + closureName;
uri2viewMap.put(tmpUri, viewPath);
viewNames.put(closureName, viewPath);
@@ -299,19 +299,19 @@ public Closure getAfterInterceptor(GroovyObject controller) {
private Closure getInterceptor(GroovyObject controller, Object ip) {
Closure interceptor=null;
- if (ip instanceof Map) {
+ if (ip instanceof Map) {
Map ipMap = (Map) ip;
if (ipMap.containsKey(ACTION)) {
- interceptor=(Closure) ipMap.get(ACTION);
+ interceptor=(Closure) ipMap.get(ACTION);
}
} else if (ip instanceof Closure) {
- interceptor=(Closure) ip;
+ interceptor=(Closure) ip;
+ }
+ if(interceptor != null && interceptor.getDelegate() != controller) {
+ interceptor = (Closure)interceptor.clone();
+ interceptor.setDelegate(controller);
+ interceptor.setResolveStrategy(Closure.DELEGATE_FIRST);
}
- if(interceptor != null && interceptor.getDelegate() != controller) {
- interceptor = (Closure)interceptor.clone();
- interceptor.setDelegate(controller);
- interceptor.setResolveStrategy(Closure.DELEGATE_FIRST);
- }
return interceptor;
}
Oops, something went wrong.

2 comments on commit 94733fb

Member

lhotari replied Sep 7, 2011

Could you share the STS / Eclipse Code Style / Formatter settings (CodeFormatterProfile xml file) ? It would be good if all developers used the same formatting settings. Some projects have the settings stored in the scm, an example of CodeFormatterProfile xml : https://github.com/SpringSource/spring-amqp/blob/master/eclipse-code-formatter.xml . Could we standardize on some settings? There should be a similar profile for IntelliJ too (I only use STS for development.)

Please sign in to comment.