This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: | |
General error during instruction selection: java.lang.UnsupportedOperationException | |
java.lang.UnsupportedOperationException | |
at java.util.Collections$UnmodifiableMap.put(Collections.java:1342) | |
at org.codehaus.groovy.ast.ImmutableClassNode.enableWriteProtection(ImmutableClassNode.java:128) | |
at org.codehaus.groovy.ast.ImmutableClassNode.getDeclaredMethods(ImmutableClassNode.java:120) | |
at org.codehaus.groovy.ast.ClassNode.getMethods(ClassNode.java:987) | |
at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.findMethodsWithGenerated(StaticTypeCheckingVisitor.java:3456) | |
at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.findMethod(StaticTypeCheckingVisitor.java:3530) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.grails.gorm.hibernate.internal.POST_INIT_BEAN-DEFAULT': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateDatastore': Cannot resolve reference to bean 'sessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.grails.internal.SESSION_FACTORY_HOLDER' is defined | |
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1554) | |
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) | |
at o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
String firstName | |
Integer age | |
} | |
Person.withSession { | |
new Person(firstName: 'Jeff', age: 44).save() | |
new Person(firstName: 'Betsy', age: 43).save() | |
new Person(firstName: 'Zack', age: 17).save() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ $ export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home | |
~ $ | |
~ $ export PATH=$JAVA_HOME/bin:$PATH | |
~ $ | |
~ $ which java | |
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/java | |
~ $ | |
~ $ groovy -e "println(System.properties['java.home'])" | |
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rm grails-core/.classpath && ./gradlew :grails-core:eclipse && grep tools grails-core/.classpath | |
:buildSrc:compileJava UP-TO-DATE | |
:buildSrc:compileGroovy UP-TO-DATE | |
:buildSrc:processResources UP-TO-DATE | |
:buildSrc:classes UP-TO-DATE | |
:buildSrc:jar UP-TO-DATE | |
:buildSrc:assemble UP-TO-DATE | |
:buildSrc:compileTestJava UP-TO-DATE | |
:buildSrc:compileTestGroovy UP-TO-DATE | |
:buildSrc:processTestResources UP-TO-DATE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ $ cat capitalization.groovy | |
// see http://stackoverflow.com/questions/26769421/is-xstage-for-any-x-reserved-in-grails | |
['TStage', 'TheStage', 'TSTAGE'].each { name -> | |
println "${name} decapitalizes to ${java.beans.Introspector.decapitalize(name)}" | |
} | |
~ $ groovy capitalization.groovy | |
TStage decapitalizes to TStage | |
TheStage decapitalizes to theStage | |
TSTAGE decapitalizes to TSTAGE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demo | |
import groovy.transform.CompileStatic | |
@CompileStatic | |
class Demo { | |
void doit() { | |
def c = { | |
Map<String, String> data = [:] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grv $ groovy -version | |
Groovy Version: 2.3.7 JVM: 1.7.0_45 Vendor: Oracle Corporation OS: Mac OS X | |
grv $ | |
grv $ cat SomeTrait.groovy | |
trait SomeTrait { | |
static String someValue | |
} | |
grv $ cat SomeClass.groovy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/grails/grails-data-mapping.git | |
cd grails-data-mapping | |
./gradlew clean :grails-datastore-gorm-mongodb:compileGroovy -S | |
Caused by: BUG! exception in phase 'instruction selection' in source unit '/Users/jeff/t/grails-data-mapping/grails-datastore-gorm-mongodb/src/main/groovy/grails/mongodb/geo/Sphere.groovy' unexpected NullpointerException | |
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1057) | |
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:588) | |
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:566) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Expected :[/foo/, /, /foo/bar/, /foo/*/bar, /foo/, /foo/*/, /*/foo/bar, /*/*/bar, /, /*/*/*] | |
Actual :[/, /foo/bar/, /foo/*/bar, /foo/, /foo/, /foo/*/, /*/foo/bar, /*/*/bar, /, /*/*/*] |