Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch '2.2.x' of github.com:grails/grails-core into 2.2.x

  • Loading branch information...
commit 5f67e439422306234f0720d088412ade82b8e362 2 parents b4f32d4 + 21c5144
@graemerocher graemerocher authored
View
2  gradle/assemble.gradle
@@ -94,7 +94,7 @@ task pluginsFromRepo {
tomcat: grailsVersion,
resources: "1.1.6",
webxml: "1.4.1",
- jquery: "1.8.0",
+ jquery: "1.8.3",
'database-migration': "1.2",
cache: "1.0.1"
]
View
3  ...-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/fork/ForkedGrailsProcess.groovy
@@ -250,6 +250,9 @@ abstract class ForkedGrailsProcess {
@CompileStatic
class ExecutionContext implements Serializable {
+
+ private static final long serialVersionUID = 1
+
List<File> runtimeDependencies
List<File> buildDependencies
List<File> providedDependencies
View
17 ...otstrap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/InteractiveMode.groovy
@@ -114,8 +114,13 @@ class InteractiveMode {
}
else if ("quit".equals(trimmed)) {
goodbye()
- }
- else if ("exit".equals(trimmed)) {
+ } else if('stop-app'.equals(trimmed)) {
+ if(settings.forkSettings?.get('run')) {
+ parseAndExecute 'stop-app'
+ } else {
+ stopApp()
+ }
+ } else if ("exit".equals(trimmed)) {
exit()
}
else if (scriptName.startsWith("open ")) {
@@ -175,7 +180,7 @@ class InteractiveMode {
System.exit(0)
}
- protected void exit() {
+ protected void stopApp() {
if (grailsServer) {
try {
updateStatus "Stopping Grails server"
@@ -187,6 +192,12 @@ class InteractiveMode {
grailsServer = null
}
}
+ }
+
+ protected void exit() {
+ if (grailsServer) {
+ stopApp()
+ }
else {
goodbye()
}
View
7 ...src/main/groovy/org/codehaus/groovy/grails/cli/agent/GrailsPluginManagerReloadPlugin.java
@@ -20,6 +20,7 @@
import org.codehaus.groovy.grails.commons.ClassPropertyFetcher;
import org.codehaus.groovy.grails.compiler.GrailsProjectWatcher;
import org.springframework.beans.CachedIntrospectionResults;
+import java.beans.Introspector;
/**
* Reloading agent plugin for use with the GrailsPluginManager.
@@ -37,11 +38,7 @@ public void reloadEvent(String typename, Class<?> aClass, String encodedTimestam
CachedIntrospectionResults.clearClassLoader(aClass.getClassLoader());
ClassPropertyFetcher.clearClassPropertyFetcherCache();
if (GrailsProjectWatcher.isActive()) {
- try {
- Thread.sleep(2500); // wait for a bit, to reduce chance of any concurrent issues with the timing of the reload reflecting in the JVM
- } catch (InterruptedException e) {
- // ignore
- }
+ Introspector.flushFromCaches(aClass);
GrailsProjectWatcher.firePendingClassChangeEvents(aClass);
}
}
View
9 ...n/src/main/groovy/org/codehaus/groovy/grails/web/plugins/support/ValidationSupport.groovy
@@ -18,6 +18,7 @@ package org.codehaus.groovy.grails.web.plugins.support
import grails.validation.ValidationErrors
import org.codehaus.groovy.grails.web.context.ServletContextHolder
+import org.springframework.validation.FieldError
import org.springframework.web.context.support.WebApplicationContextUtils
@@ -42,8 +43,12 @@ class ValidationSupport {
def localErrors = new ValidationErrors(object, object.class.name)
def originalErrors = object.errors
for (originalError in originalErrors.allErrors) {
- if (originalErrors.getFieldError(originalError.field)?.bindingFailure) {
- localErrors.rejectValue originalError.field, originalError.code, originalError.arguments, originalError.defaultMessage
+ if(originalError instanceof FieldError) {
+ if (originalErrors.getFieldError(originalError.field)?.bindingFailure) {
+ localErrors.rejectValue originalError.field, originalError.code, originalError.arguments, originalError.defaultMessage
+ }
+ } else {
+ localErrors.addError originalError
}
}
for (prop in constraints.values()) {
View
17 ...ugin-validation/src/test/groovy/grails/validation/DefaultASTValidateableHelperSpec.groovy
@@ -252,4 +252,21 @@ class DefaultASTValidateableHelperSpec extends Specification {
isValid
0 == errorCount
}
+
+ void 'Test validate method on an object that has had values rejected with an ObjectError'() {
+ given:
+ def widget = widgetClass.newInstance()
+ widget.name = 'Joe'
+ widget.count = 2
+ widget.category = 'some category'
+
+ when:
+ widget.errors.reject 'count'
+ def isValid = widget.validate()
+ def errorCount = widget.errors.errorCount
+
+ then:
+ !isValid
+ 1 == errorCount
+ }
}
View
2  grails-resources/src/grails/grails-app/conf/BuildConfig.groovy
@@ -45,7 +45,7 @@ grails.project.dependency.resolution = {
plugins {
runtime ":hibernate:$grailsVersion"
- runtime ":jquery:1.8.0"
+ runtime ":jquery:1.8.3"
runtime ":resources:1.1.6"
// Uncomment these (or add new ones) to enable additional resources capabilities
View
4 grails-resources/src/grails/plugin/grails-app/conf/BuildConfig.groovy
@@ -23,12 +23,12 @@ grails.project.dependency.resolution = {
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
- // runtime 'mysql:mysql-connector-java:5.1.18'
+ // runtime 'mysql:mysql-connector-java:5.1.21'
}
plugins {
build(":tomcat:$grailsVersion",
- ":release:2.0.3",
+ ":release:2.0.4",
":rest-client-builder:1.0.2") {
export = false
}
View
4 grails-resources/src/grails/templates/ide-support/git/grailsProject.gitignore
@@ -12,4 +12,6 @@ stacktrace.log
/target/
/out/
/web-app/plugins
-/web-app/WEB-INF/classes
+/web-app/WEB-INF/classes
+/.link_to_grails_plugins/
+/target-eclipse/
View
2  grails-resources/src/grails/templates/maven/app.pom
@@ -73,7 +73,7 @@
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>jquery</artifactId>
- <version>1.8.0</version>
+ <version>1.8.3</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
View
19 ...b/src/main/groovy/org/codehaus/groovy/grails/web/binding/DefaultASTDatabindingHelper.java
@@ -33,7 +33,7 @@
public static final String DEFAULT_DATABINDING_WHITELIST = "$defaultDatabindingWhiteList";
- private static Map<ClassNode, Set<String>> CLASS_NAME_TO_WHITE_LIST_PROPERTY_NAMES = new HashMap<ClassNode, Set<String>>();
+ private static Map<ClassNode, Set<String>> CLASS_NODE_TO_WHITE_LIST_PROPERTY_NAMES = new HashMap<ClassNode, Set<String>>();
@SuppressWarnings("serial")
private static final List<ClassNode> SIMPLE_TYPES = new ArrayList<ClassNode>() {{
@@ -113,16 +113,23 @@ private FieldNode getDeclaredFieldInInheritanceHierarchy(final ClassNode classNo
}
return fieldNode;
}
+
+ private Set<String> getPropertyNamesToIncludeInWhiteListForParentClass(final SourceUnit sourceUnit, final ClassNode parentClassNode) {
+ final Set<String> propertyNames;
+ if (CLASS_NODE_TO_WHITE_LIST_PROPERTY_NAMES.containsKey(parentClassNode)) {
+ propertyNames = CLASS_NODE_TO_WHITE_LIST_PROPERTY_NAMES.get(parentClassNode);
+ } else {
+ propertyNames = getPropertyNamesToIncludeInWhiteList(sourceUnit, parentClassNode);
+ }
+ return propertyNames;
+ }
private Set<String> getPropertyNamesToIncludeInWhiteList(final SourceUnit sourceUnit, final ClassNode classNode) {
- if (CLASS_NAME_TO_WHITE_LIST_PROPERTY_NAMES.containsKey(classNode)) {
- return CLASS_NAME_TO_WHITE_LIST_PROPERTY_NAMES.get(classNode);
- }
final Set<String> propertyNamesToIncludeInWhiteList = new HashSet<String>();
final Set<String> unbindablePropertyNames = new HashSet<String>();
final Set<String> bindablePropertyNames = new HashSet<String>();
if (!classNode.getSuperClass().equals(new ClassNode(Object.class))) {
- final Set<String> parentClassPropertyNames = getPropertyNamesToIncludeInWhiteList(sourceUnit, classNode.getSuperClass());
+ final Set<String> parentClassPropertyNames = getPropertyNamesToIncludeInWhiteListForParentClass(sourceUnit, classNode.getSuperClass());
bindablePropertyNames.addAll(parentClassPropertyNames);
}
@@ -200,7 +207,7 @@ private FieldNode getDeclaredFieldInInheritanceHierarchy(final ClassNode classNo
}
}
}
- CLASS_NAME_TO_WHITE_LIST_PROPERTY_NAMES.put(classNode, propertyNamesToIncludeInWhiteList);
+ CLASS_NODE_TO_WHITE_LIST_PROPERTY_NAMES.put(classNode, propertyNamesToIncludeInWhiteList);
Map<String, ClassNode> allAssociationMap = GrailsASTUtils.getAllAssociationMap(classNode);
for (String associationName : allAssociationMap.keySet()) {
if (!propertyNamesToIncludeInWhiteList.contains(associationName)) {
View
14 scripts/Console.groovy
@@ -22,6 +22,7 @@
* @since 0.4
*/
+import java.awt.Window
import java.awt.event.FocusEvent
import java.awt.event.FocusListener
@@ -43,9 +44,16 @@ target(console:"The console implementation target") {
console.run()
def watcher = new GrailsProjectWatcher(projectCompiler, pluginManager)
watcher.start()
- // keep the console running
- while (!InteractiveMode.isActive()) {
- sleep(Integer.MAX_VALUE)
+
+ while (console.frame.visible) {
+ sleep 500
+ }
+
+ // Keep the console running until all windows are closed unless the
+ // interactive console is in use. The interactive console keeps the
+ // VM alive so we don't need to keep this thread running.
+ while (!InteractiveMode.isActive() && Window.windows.any { it.visible }) {
+ sleep 3000
}
} catch (Exception e) {
event("StatusFinal", ["Error starting console: ${e.message}"])
Please sign in to comment.
Something went wrong with that request. Please try again.