This file contains 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
/* | |
* Copyright 2003-2009 the original author or authors. | |
* | |
* 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 |
This file contains 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
diff --git a/src/main/org/codehaus/groovy/classgen/AsmClassGenerator.java b/src/main/org/codehaus/groovy/classgen/AsmClassGenerator.java | |
index 925ffd7..4555783 100644 | |
--- a/src/main/org/codehaus/groovy/classgen/AsmClassGenerator.java | |
+++ b/src/main/org/codehaus/groovy/classgen/AsmClassGenerator.java | |
@@ -71,10 +71,6 @@ public class AsmClassGenerator extends ClassGenerator { | |
static final MethodCaller despreadList = MethodCaller.newStatic(ScriptBytecodeAdapter.class, "despreadList"); | |
// Closure | |
static final MethodCaller getMethodPointer = MethodCaller.newStatic(ScriptBytecodeAdapter.class, "getMethodPointer"); | |
- // unary plus, unary minus, bitwise negation | |
- static final MethodCaller unaryPlus = MethodCaller.newStatic(ScriptBytecodeAdapter.class, "unaryPlus"); |
This file contains 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
import org.codehaus.groovy.control.CompilerConfiguration | |
import org.codehaus.groovy.control.customizers.CompilationCustomizer | |
import org.codehaus.groovy.control.CompilePhase | |
import groovy.transform.CompileStatic | |
import org.codehaus.groovy.ast.AnnotationNode | |
import org.codehaus.groovy.ast.ClassHelper | |
import org.codehaus.groovy.ast.ClassNode | |
import org.codehaus.groovy.transform.sc.StaticCompileTransformation | |
def config = new CompilerConfiguration() |
This file contains 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
// This is very WRONG because it changes the generics type of the primary class node. | |
// It means that future instances of ArrayList without generic types specified would be ArrayList<Foo> | |
def listenerListType = ClassHelper.make(ArrayList) | |
listenerListType.setGenericsTypes(types) | |
// Instead, you MUST acquire a class node for which the redirect class node is the primary node | |
// This can be easily done using the getPlainNodeReference() method | |
def listenerListType = ClassHelper.make(ArrayList).plainNodeReference |
This file contains 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
diff --git a/build.gradle b/build.gradle | |
index 9102228..f774cfd 100644 | |
--- a/build.gradle | |
+++ b/build.gradle | |
@@ -5,15 +5,17 @@ defaultTasks 'clean', 'test' | |
repositories { | |
mavenCentral() | |
mavenRepo name:"codehaus", url:"http://repository.codehaus.org/" | |
- mavenRepo name:"groovypp", url:"http://groovypp.artifactoryonline.com/groovypp/libs-releases-local" | |
+ //mavenRepo name:"groovypp", url:"http://groovypp.artifactoryonline.com/groovypp/libs-releases-local" |
This file contains 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
import groovy.json.JsonSlurper | |
def candidats = ['#Sarkozy', '#Hollande'] | |
def flavors = ['INCORRECT', 'CORRECT', 'IMPRECIS'] | |
def factchecking = [:].withDefault { [:].withDefault { 0 } } | |
15.times { page -> | |
def jsonText = new URL("http://otter.topsy.com/search.json?type=tweet&q=factchecking+from:LeVeritometre&window=1d&offset=${10 * page}").text | |
def answers = new JsonSlurper().parseText(jsonText) | |
answers.response.list.title.each { content -> | |
candidats.each { c -> |
This file contains 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 moo | |
import org.codehaus.groovy.ast.ASTNode | |
import org.codehaus.groovy.ast.ClassNode | |
import org.codehaus.groovy.ast.MethodNode | |
import org.codehaus.groovy.ast.expr.ArgumentListExpression | |
import org.codehaus.groovy.ast.expr.ConstantExpression | |
import org.codehaus.groovy.ast.expr.MethodCallExpression | |
import org.codehaus.groovy.ast.expr.VariableExpression | |
import org.codehaus.groovy.ast.stmt.ExpressionStatement |
This file contains 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
diff --git a/subprojects/osgi/osgi.gradle b/subprojects/osgi/osgi.gradle | |
index 57d7c1f..ccef5a0 100644 | |
--- a/subprojects/osgi/osgi.gradle | |
+++ b/subprojects/osgi/osgi.gradle | |
@@ -21,7 +21,8 @@ dependencies { | |
compile project(':plugins') | |
compile libraries.slf4j_api | |
- compile module('biz.aQute:bndlib:1.50.0') | |
+// compile module('biz.aQute:bndlib:1.50.0') |
This file contains 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
diff --git a/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java b/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java | |
index 790c763..d53cb4d 100644 | |
--- a/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java | |
+++ b/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java | |
@@ -95,6 +95,7 @@ public class AntlrParserPlugin extends ASTHelper implements ParserPlugin, Groovy | |
protected AST ast; | |
private ClassNode classNode; | |
+ private MethodNode methodNode; | |
private String[] tokenNames; |
This file contains 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 Foo {} | |
class Bar { void baz() { println 'baz' } } | |
def delegate = new Bar() | |
// attention, toutes les instances de Foo seront redirigées vers le même delegate. Sinon, utiliser foo.metaClass par instance | |
Foo.metaClass.invokeMethod = { name, args -> delegate."$name"(*args) } | |
new Foo().baz() | |
// Autre solution, plus propre, avec @Delegate | |
class Foo { |