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
@groovy.transform.CompileStatic | |
class TwoException extends Exception { | |
public TwoException(Throwable t) { | |
super(t) | |
} | |
} | |
public TwoException(java.lang.Throwable); | |
Code: | |
0: iconst_1 |
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
core 2.3.x $ ./gradlew -Dtest.single=BinaryPluginSpec :grails-core:test --stacktrace | |
: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
public interface MyInterface<T extends MyInterface> { | |
T someMethod(); | |
} | |
public class FirstWidget implements MyInterface<FirstWidget> { | |
public FirstWidget someMethod() { | |
return this; | |
} | |
} |
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
groovyquestion $ cat Demo.groovy | |
class Demo { | |
// this is an empty class | |
} | |
groovyquestion $ | |
groovyquestion $ groovyc Demo.groovy | |
groovyquestion $ | |
groovyquestion $ javap -private Demo | |
Compiled from "Demo.groovy" | |
public class Demo implements groovy.lang.GroovyObject { |
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
mapstuff $ cat demo.groovy | |
// This is just an example to demonstrate a possibilty, | |
// not a recommendation of best practice. | |
Map.metaClass.someMethodName = { key, defaultValue -> | |
delegate.containsKey(key) ? delegate[key] : defaultValue | |
} | |
def map = [name: 'Jeff', town: 'St. Louis'] |
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
/* | |
Apparently http://stackoverflow.com/users/2970947/elliott-frisch doesn't believe that | |
Java enums can have state. | |
http://stackoverflow.com/questions/24447233/store-enum-class-reference?noredirect=1#comment37829803_24447233 | |
*/ | |
public enum MyEnum { | |
ONE(1), TWO(2); | |
public int value; |
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
grails11577 $ java -version | |
java version "1.8.0-ea" | |
Java(TM) SE Runtime Environment (build 1.8.0-ea-b106) | |
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b48, mixed mode) | |
grails11577 $ | |
grails11577 $ cat application.properties | |
#Grails Metadata file | |
#Fri Jul 11 14:22:05 CDT 2014 | |
app.grails.version=2.4.2 | |
app.name=grails11577 |
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
@Grab(group='org.gperfutils', module='gbench', version='0.4.2-groovy-2.1') | |
def smallList = [[first: 'John', last: 'test']] | |
def largListWithMatchAtEnd = [] | |
10000.times { largListWithMatchAtEnd << [first: 'Johnx', last: 'test'] } | |
largListWithMatchAtEnd << [first: 'John', last: 'test'] | |
def largListWithMatchInCenter = [] | |
5000.times { largListWithMatchInCenter << [first: 'Johnx', last: 'test'] } |
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
joint_compile $ ls | |
FirstGroovy.groovy FirstJava.java SecondGroovy.groovy SecondJava.java | |
joint_compile $ cat FirstGroovy.groovy | |
class FirstGroovy { | |
FirstJava firstJava | |
} | |
joint_compile $ cat FirstJava.java | |
public class FirstJava { | |
SecondGroovy secondGroovy; |
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
trait $ cat SomeTrait.groovy | |
trait SomeTrait { | |
int getMagicNumber() { | |
42 | |
} | |
} | |
trait $ cat SomeClass.groovy | |
class SomeClass implements SomeTrait { | |
static magicNumber = 'Forty Two' | |
} |
OlderNewer