Details
Description
When casing a null value (either directly, or the result of a calculation) using the Groovy "as" operator, a GroovyCastException is thrown.
I had trouble reproducing this initially, and I don't yet know the root cause, but I have been able to get a reproducable project with minimal code changes. The attached project is just the result of:
0. Using Grails 2.0.1
1. Run grails create-app
2. Remove dependency to the resources plugin
3. Run grails create-controller
4. Add a controller method with "1 as Long" as well as rendering some text (just so if it does succeed we see something)
The behavior is quite odd when it does or does not occur (but is deterministic in a given situation)
-Only occurs when WAR'd up, never in run-app.
-Occurs when running as run-war, and deployed to a tomcat 6 or 7 instance
-Occurs whenever there is a null cast using "as" to a type (e.g. null as Long)
-Does not occur when doing regular casting (e.g. (Long)null), or when assigning a null value to a strongly-typed variable (e.g. Long x = null)
Add to that list now with this attached project:
-Occurs in a clean grails project if the dependency to the resources plugin is removed
Activity
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | master | 9bb4fc6... | 2012-03-21 07:26:17 -0700 | graemerocher / graemerocher | fix for |
| Files Changed | |||||
|
MODIFY
grails-plugin-converters/src/main/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtil.java
MODIFY grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | hibernate4 | 9bb4fc6... | 2012-03-21 07:26:17 -0700 | graemerocher / graemerocher | fix for |
| Files Changed | |||||
|
MODIFY
grails-plugin-converters/src/main/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtil.java
MODIFY grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.1.x | 9bb4fc6... | 2012-03-21 07:26:17 -0700 | graemerocher / graemerocher | fix for |
| Files Changed | |||||
|
MODIFY
grails-plugin-converters/src/main/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtil.java
MODIFY grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.2.x | 9bb4fc6... | 2012-03-21 07:26:17 -0700 | graemerocher / graemerocher | fix for |
| Files Changed | |||||
|
MODIFY
grails-plugin-converters/src/main/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtil.java
MODIFY grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.0.x | ce6a5e0... | 2012-03-21 07:28:37 -0700 | graemerocher / graemerocher | fix for Conflicts: grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Files Changed | |||||
|
MODIFY
grails-plugin-converters/src/main/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtil.java
ADD grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.1.x | ce6a5e0... | 2012-03-21 07:28:37 -0700 | graemerocher / graemerocher | fix for Conflicts: grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Files Changed | |||||
|
MODIFY
grails-plugin-converters/src/main/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtil.java
ADD grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.2.x | ce6a5e0... | 2012-03-21 07:28:37 -0700 | graemerocher / graemerocher | fix for Conflicts: grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Files Changed | |||||
|
MODIFY
grails-plugin-converters/src/main/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtil.java
ADD grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | master | ce6a5e0... | 2012-03-21 07:28:37 -0700 | graemerocher / graemerocher | fix for Conflicts: grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Files Changed | |||||
|
MODIFY
grails-plugin-converters/src/main/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtil.java
ADD grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | groovy2 | 9c612ee... | 2012-03-26 07:37:14 -0700 | graemerocher / Stephane Maldini | fix for |
| Files Changed | |||||
|
MODIFY
grails-plugin-converters/src/main/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtil.java
MODIFY grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy |