GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-1143

Type inference support for DGM methods

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.1Release
    • Fix Version/s: 2.5.2.Release
    • Component/s: Inferencing Engine
    • Labels:
      None
    • Number of attachments :
      2

      Description

      The following snippets do not recognize the static type of the lists in side the supplied closures:

      [1, 2].countBy { it.intValue() }
      
      [1, 2].count { it.intValue() } 
      

        Activity

        Hide
        Andrew Eisenberg added a comment -

        Fixed, again.

        Show
        Andrew Eisenberg added a comment - Fixed, again.
        Hide
        Bob Tiernay added a comment -

        There still seems to be some issues with the 2.1.3.xx-20110808-1500-e37 release in this regard:

        
        // Type inference test of public static java.util.Map$Entry org.codehaus.groovy.runtime.DefaultGroovyMethods.min(java.util.Map,groovy.lang.Closure)
        [key:1].min { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.min(java.lang.Object[],groovy.lang.Closure)
        ([1] as Object[]).min { it.intValue() }
        
        // Type inference test of public static java.util.Map$Entry org.codehaus.groovy.runtime.DefaultGroovyMethods.max(java.util.Map,groovy.lang.Closure)
        [key:1].max { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.max(java.lang.Object[],groovy.lang.Closure)
        ([1] as Object[]).max { it.intValue() }
        
        // Type inference test of public static java.lang.Number org.codehaus.groovy.runtime.DefaultGroovyMethods.count(java.util.Map,groovy.lang.Closure)
        [key:1].count { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.lang.Number org.codehaus.groovy.runtime.DefaultGroovyMethods.count(java.lang.Object[],groovy.lang.Closure)
        ([1] as Object[]).count { it.intValue() }
        
        // Type inference test of public static java.lang.String org.codehaus.groovy.runtime.DefaultGroovyMethods.replaceAll(java.lang.String,java.lang.String,groovy.lang.Closure)
        "".replaceAll("") { it.toLowerCase() }
        
        // Type inference test of public static java.lang.String org.codehaus.groovy.runtime.DefaultGroovyMethods.replaceAll(java.lang.String,java.util.regex.Pattern,groovy.lang.Closure)
        "".replaceAll(~/test/) { it.toLowerCase() }
        
        // Type inference test of public static java.lang.String org.codehaus.groovy.runtime.DefaultGroovyMethods.replaceFirst(java.lang.String,java.lang.String,groovy.lang.Closure)
        "".replaceFirst("") { it.toLowerCase() }
        
        // Type inference test of public static java.lang.String org.codehaus.groovy.runtime.DefaultGroovyMethods.replaceFirst(java.lang.String,java.util.regex.Pattern,groovy.lang.Closure)
        "".replaceFirst(~/test/) { it.toLowerCase() }
        
        // Type inference test of public static java.util.Map$Entry org.codehaus.groovy.runtime.DefaultGroovyMethods.find(java.util.Map,groovy.lang.Closure)
        [key:1].find { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.sort(java.util.Map,groovy.lang.Closure)
        [key:1].sort { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.lang.Object[] org.codehaus.groovy.runtime.DefaultGroovyMethods.sort(java.lang.Object[],groovy.lang.Closure)
        ([1] as Object[]).sort { it.intValue() }
        
        // Type inference test of public static java.lang.Object[] org.codehaus.groovy.runtime.DefaultGroovyMethods.sort(java.lang.Object[],boolean,groovy.lang.Closure)
        ([1] as Object[]).sort(true) { it.intValue() }
        
        // Type inference test of public static boolean org.codehaus.groovy.runtime.DefaultGroovyMethods.removeAll(java.util.Collection,groovy.lang.Closure)
        [1].removeAll { it.intValue() }
        
        // Type inference test of public static boolean org.codehaus.groovy.runtime.DefaultGroovyMethods.retainAll(java.util.Collection,groovy.lang.Closure)
        [1].retainAll { it.intValue() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.addShutdownHook(java.lang.Object,groovy.lang.Closure)
        1.addShutdownHook { it.intValue() }
        
        // Type inference test of public static java.net.Socket org.codehaus.groovy.runtime.DefaultGroovyMethods.accept(java.net.ServerSocket,groovy.lang.Closure) throws java.io.IOException
        new ServerSocket().accept { it.getPort() }
        
        // Type inference test of public static java.net.Socket org.codehaus.groovy.runtime.DefaultGroovyMethods.accept(java.net.ServerSocket,boolean,groovy.lang.Closure) throws java.io.IOException
        new ServerSocket().accept(true) { it.getPort() }
        
        // Type inference test of public static groovy.lang.MetaClass org.codehaus.groovy.runtime.DefaultGroovyMethods.metaClass(java.lang.Class,groovy.lang.Closure)
        Integer.metaClass { methods }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.with(java.lang.Object,groovy.lang.Closure)
        1.with { it.intValue() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.use(java.lang.Object,java.lang.Class,groovy.lang.Closure)
        1.use(Integer) { it.intValue() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.use(java.lang.Object,java.util.List,groovy.lang.Closure)
        1.use([1]) { it.intValue() }
        
        // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.eachWithIndex(java.util.Map,groovy.lang.Closure)
        [key:1].eachWithIndex { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.reverseEach(java.util.Map,groovy.lang.Closure)
        [key:1].reverseEach { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.lang.Object[] org.codehaus.groovy.runtime.DefaultGroovyMethods.reverseEach(java.lang.Object[],groovy.lang.Closure)
        ([1] as Object[]).reverseEach { it.intValue() }
        
        // Type inference test of public static boolean org.codehaus.groovy.runtime.DefaultGroovyMethods.every(java.util.Map,groovy.lang.Closure)
        [key:1].every { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static boolean org.codehaus.groovy.runtime.DefaultGroovyMethods.any(java.util.Map,groovy.lang.Closure)
        [key:1].any { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.util.List org.codehaus.groovy.runtime.DefaultGroovyMethods.collectNested(java.util.Collection,groovy.lang.Closure)
        [1].collectNested { it.intValue() }
        
        // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.collectNested(java.util.Collection,java.util.Collection,groovy.lang.Closure)
        [1].collectNested([1]) { it.intValue() }
        
        // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.collectMany(java.util.Collection,groovy.lang.Closure)
        [1].collectMany { it.intValue() }
        
        // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.collectMany(java.lang.Object[],groovy.lang.Closure)
        ([1] as Object[]).collectMany { it.intValue() }
        
        // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.collectMany(java.util.Iterator,groovy.lang.Closure)
        [1].iterator().collectMany { it.intValue() }
        
        // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(java.lang.Object[],java.util.Map,groovy.lang.Closure)
        ([1] as Object[]).collectEntries([key:1]) { it.intValue() }
        
        // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(java.lang.Object[],groovy.lang.Closure)
        ([1] as Object[]).collectEntries { it.intValue() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.findResult(java.util.Map,java.lang.Object,groovy.lang.Closure)
        [key:1].findResult(1) { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.findResult(java.util.Map,groovy.lang.Closure)
        [key:1].findResult { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.findResults(java.util.Collection,groovy.lang.Closure)
        [1].findResults { it.intValue() }
        
        // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.findResults(java.util.Map,groovy.lang.Closure)
        [key:1].findResults { it.getKey().toUpperCase() + it.getValue().intValue() }
        [key:1].findResults { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.findAll(java.util.Map,groovy.lang.Closure)
        [key:1].findAll { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.groupBy(java.util.Map,groovy.lang.Closure)
        [key:1].groupBy { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.countBy(java.lang.Object[],groovy.lang.Closure)
        ([1] as Object[]).countBy { it.intValue() }
        
        // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.countBy(java.util.Map,groovy.lang.Closure)
        [key:1].countBy { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.groupEntriesBy(java.util.Map,groovy.lang.Closure)
        [key:1].groupEntriesBy { it.getKey().toUpperCase() + it.getValue().intValue() }
        [key:1].groupEntriesBy { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.inject(java.util.Map,java.lang.Object,groovy.lang.Closure)
        [key:1].inject(1) { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.inject(java.lang.Object[],java.lang.Object,groovy.lang.Closure)
        ([1] as Object[]).inject(1) { value, item -> value.intValue() + item.intValue() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.sum(java.lang.Object[],groovy.lang.Closure)
        ([1] as Object[]).sum { it.intValue() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.sum(java.lang.Object[],java.lang.Object,groovy.lang.Closure)
        ([1] as Object[]).sum(1) { it.intValue() }
        
        // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.withDefault(java.util.Map,groovy.lang.Closure)
        [key:1].withDefault { it.getKey().toUpperCase() + it.getValue().intValue() }
        [key:1].withDefault { key, value -> key.toUpperCase() + value.intValue() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withStream(java.io.OutputStream,groovy.lang.Closure) throws java.io.IOException
        new FileOutputStream(new File("test")).withStream { it.write(1) }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachObject(java.io.File,groovy.lang.Closure) throws java.io.IOException,java.lang.ClassNotFoundException
        new File("test").eachObject { it.getName() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachObject(java.io.ObjectInputStream,groovy.lang.Closure) throws java.io.IOException,java.lang.ClassNotFoundException
        new ObjectInputStream(new FileInputStream("test")).eachObject { it.read() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachFileMatch(java.io.File,groovy.io.FileType,java.lang.Object,groovy.lang.Closure) throws java.io.FileNotFoundException,java.lang.IllegalArgumentException
        new File("test").eachFileMatch(FileType.FILES, 1) { it.getName() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachFileMatch(java.io.File,java.lang.Object,groovy.lang.Closure) throws java.io.FileNotFoundException,java.lang.IllegalArgumentException
        new File("test").eachFileMatch(1) { it.getName() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachDirMatch(java.io.File,java.lang.Object,groovy.lang.Closure) throws java.io.FileNotFoundException,java.lang.IllegalArgumentException
        new File("test").eachDirMatch(1) { it.getName() }
        
        // Type inference test of public static java.util.TimerTask org.codehaus.groovy.runtime.DefaultGroovyMethods.runAfter(java.util.Timer,int,groovy.lang.Closure)
        new Timer().runAfter(1) new Timer()
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.io.File,groovy.lang.Closure) throws java.io.IOException
        new File("test").withReader { it.reset() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.io.File,java.lang.String,groovy.lang.Closure) throws java.io.IOException
        new File("test").withReader("") { it.reset()}
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.io.Reader,groovy.lang.Closure) throws java.io.IOException
        new FileReader(new File("test")).withReader { it.reset() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.net.URL,groovy.lang.Closure) throws java.io.IOException
        new URL("http://www.google.com").withReader { it.reset() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.net.URL,java.lang.String,groovy.lang.Closure) throws java.io.IOException
        new URL("http://www.google.com").withReader("") { it.reset() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.io.InputStream,groovy.lang.Closure) throws java.io.IOException
        new FileInputStream(new File("test")).withReader { it.reset() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.io.InputStream,java.lang.String,groovy.lang.Closure) throws java.io.IOException
        new FileInputStream(new File("test")).withReader("") { it.reset() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withOutputStream(java.io.File,groovy.lang.Closure) throws java.io.IOException
        new File("test").withOutputStream { it.flush() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withInputStream(java.io.File,groovy.lang.Closure) throws java.io.IOException
        new File("test").withInputStream { it.available() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withInputStream(java.net.URL,groovy.lang.Closure) throws java.io.IOException
        new URL("http://www.google.com").withInputStream { it.available() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withDataOutputStream(java.io.File,groovy.lang.Closure) throws java.io.IOException
        new File("test").withDataOutputStream { it.flush() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withDataInputStream(java.io.File,groovy.lang.Closure) throws java.io.IOException
        new File("test").withDataInputStream { it.readUTF() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriter(java.io.File,groovy.lang.Closure) throws java.io.IOException
        new File("test").withWriter { it.getName() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriter(java.io.File,java.lang.String,groovy.lang.Closure) throws java.io.IOException
        new File("test").withWriter("") { it.getName() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriter(java.io.Writer,groovy.lang.Closure) throws java.io.IOException
        new FileWriter(new File("test")).withWriter { it.write(1) }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriter(java.io.OutputStream,groovy.lang.Closure) throws java.io.IOException
        new FileOutputStream(new File("test")).withWriter { it.write(1) }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriter(java.io.OutputStream,java.lang.String,groovy.lang.Closure) throws java.io.IOException
        new FileOutputStream(new File("test")).withWriter("") { it.write(1) }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriterAppend(java.io.File,java.lang.String,groovy.lang.Closure) throws java.io.IOException
        new File("test").withWriterAppend("") { it.write(1) }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriterAppend(java.io.File,groovy.lang.Closure) throws java.io.IOException
        new File("test").withWriterAppend { it.write(1) }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withPrintWriter(java.io.Writer,groovy.lang.Closure) throws java.io.IOException
        new FileWriter(new File("test")).withPrintWriter { it.write(1) }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.io.File,groovy.lang.Closure) throws java.io.IOException
        new File("test").eachByte { it.getName() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.io.File,int,groovy.lang.Closure) throws java.io.IOException
        new File("test").eachByte(1) { it.getName() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.lang.Byte[],groovy.lang.Closure)
        ([1] as Byte[]).eachByte { buffer, bytesRead -> buffer.size() + bytesRead.intValue() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(byte[],groovy.lang.Closure)
        ([1] as byte[]).eachByte {buffer, bytesRead -> buffer.size() + bytesRead.intValue() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.io.InputStream,groovy.lang.Closure) throws java.io.IOException
        new FileInputStream(new File("test")).eachByte { buffer, bytesRead -> buffer.size() + bytesRead.intValue() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.io.InputStream,int,groovy.lang.Closure) throws java.io.IOException
        new FileInputStream(new File("test")).eachByte(1) { buffer, bytesRead -> buffer.size() + bytesRead.intValue() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.net.URL,groovy.lang.Closure) throws java.io.IOException
        new URL("http://www.google.com").eachByte { buffer, bytesRead -> buffer.size() + bytesRead.intValue() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.net.URL,int,groovy.lang.Closure) throws java.io.IOException
        new URL("http://www.google.com").eachByte(1) { buffer, bytesRead -> buffer.size() + bytesRead.intValue() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.transformChar(java.io.Reader,java.io.Writer,groovy.lang.Closure) throws java.io.IOException
        new FileReader(new File("test")).transformChar(new FileWriter(new File("test"))) { it.toUpperCase() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.transformLine(java.io.Reader,java.io.Writer,groovy.lang.Closure) throws java.io.IOException
        new FileReader(new File("test")).transformLine(new FileWriter(new File("test"))) { it.toUpperCase() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.Reader,java.io.Writer,groovy.lang.Closure) throws java.io.IOException
        new FileReader(new File("test")).filterLine(new FileWriter(new File("test"))) { it.toUpperCase() }
        
        // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.File,groovy.lang.Closure) throws java.io.IOException
        new File("test").filterLine { it.toUpperCase() }
        
        // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.File,java.lang.String,groovy.lang.Closure) throws java.io.IOException
        new File("test").filterLine("") { it.toUpperCase() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.File,java.io.Writer,groovy.lang.Closure) throws java.io.IOException
        new File("test").filterLine(new FileWriter(new File("test"))) { it.toUpperCase() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.File,java.io.Writer,java.lang.String,groovy.lang.Closure) throws java.io.IOException
        new File("test").filterLine(new FileWriter(new File("test")), "") { it.toUpperCase() }
        
        // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.Reader,groovy.lang.Closure)
        new FileReader(new File("test")).filterLine { it.toUpperCase() }
        
        // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.InputStream,groovy.lang.Closure)
        new FileInputStream(new File("test")).filterLine { it.toUpperCase() }
        
        // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.InputStream,java.lang.String,groovy.lang.Closure) throws java.io.UnsupportedEncodingException
        new FileInputStream(new File("test")).filterLine("") { it.toUpperCase() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.InputStream,java.io.Writer,groovy.lang.Closure) throws java.io.IOException
        new FileInputStream(new File("test")).filterLine(new FileWriter(new File("test"))) { it.toUpperCase() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.InputStream,java.io.Writer,java.lang.String,groovy.lang.Closure) throws java.io.IOException
        new FileInputStream(new File("test")).filterLine(new FileWriter(new File("test")), "") { it.toUpperCase() }
        
        // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.net.URL,groovy.lang.Closure) throws java.io.IOException
        new URL("http://www.google.com").filterLine { it.toUpperCase() }
        
        // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.net.URL,java.lang.String,groovy.lang.Closure) throws java.io.IOException
        new URL("http://www.google.com").filterLine("") { it.toUpperCase() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.net.URL,java.io.Writer,groovy.lang.Closure) throws java.io.IOException
        new URL("http://www.google.com").filterLine(new FileWriter(new File("test"))) { it.toUpperCase() }
        
        // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.net.URL,java.io.Writer,java.lang.String,groovy.lang.Closure) throws java.io.IOException
        new URL("http://www.google.com").filterLine(new FileWriter(new File("test")), "") { it.toUpperCase() }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withStreams(java.net.Socket,groovy.lang.Closure) throws java.io.IOException
        new Socket().withStreams { is, os -> is.read(); os.write(1) }
        
        // Type inference test of public static java.lang.Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withObjectStreams(java.net.Socket,groovy.lang.Closure) throws java.io.IOException
        new Socket().withObjectStreams { is, os -> is.read(); os.write(1) }
        
        // Type inference test of public static java.lang.String org.codehaus.groovy.runtime.DefaultGroovyMethods.eachMatch(java.lang.String,java.lang.String,groovy.lang.Closure)
        "".eachMatch("") { it.toLowerCase() }
        
        // Type inference test of public static java.lang.String org.codehaus.groovy.runtime.DefaultGroovyMethods.eachMatch(java.lang.String,java.util.regex.Pattern,groovy.lang.Closure)
        "".eachMatch(~/test/) { it.toLowerCase() }
        
        
        Show
        Bob Tiernay added a comment - There still seems to be some issues with the 2.1.3.xx-20110808-1500-e37 release in this regard: // Type inference test of public static java.util.Map$Entry org.codehaus.groovy.runtime.DefaultGroovyMethods.min(java.util.Map,groovy.lang.Closure) [key:1].min { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.min(java.lang. Object [],groovy.lang.Closure) ([1] as Object []).min { it.intValue() } // Type inference test of public static java.util.Map$Entry org.codehaus.groovy.runtime.DefaultGroovyMethods.max(java.util.Map,groovy.lang.Closure) [key:1].max { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.max(java.lang. Object [],groovy.lang.Closure) ([1] as Object []).max { it.intValue() } // Type inference test of public static java.lang. Number org.codehaus.groovy.runtime.DefaultGroovyMethods.count(java.util.Map,groovy.lang.Closure) [key:1].count { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.lang. Number org.codehaus.groovy.runtime.DefaultGroovyMethods.count(java.lang. Object [],groovy.lang.Closure) ([1] as Object []).count { it.intValue() } // Type inference test of public static java.lang. String org.codehaus.groovy.runtime.DefaultGroovyMethods.replaceAll(java.lang. String ,java.lang. String ,groovy.lang.Closure) "".replaceAll(" ") { it.toLowerCase() } // Type inference test of public static java.lang. String org.codehaus.groovy.runtime.DefaultGroovyMethods.replaceAll(java.lang. String ,java.util.regex.Pattern,groovy.lang.Closure) "".replaceAll(~/test/) { it.toLowerCase() } // Type inference test of public static java.lang. String org.codehaus.groovy.runtime.DefaultGroovyMethods.replaceFirst(java.lang. String ,java.lang. String ,groovy.lang.Closure) "".replaceFirst(" ") { it.toLowerCase() } // Type inference test of public static java.lang. String org.codehaus.groovy.runtime.DefaultGroovyMethods.replaceFirst(java.lang. String ,java.util.regex.Pattern,groovy.lang.Closure) "".replaceFirst(~/test/) { it.toLowerCase() } // Type inference test of public static java.util.Map$Entry org.codehaus.groovy.runtime.DefaultGroovyMethods.find(java.util.Map,groovy.lang.Closure) [key:1].find { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.sort(java.util.Map,groovy.lang.Closure) [key:1].sort { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.lang. Object [] org.codehaus.groovy.runtime.DefaultGroovyMethods.sort(java.lang. Object [],groovy.lang.Closure) ([1] as Object []).sort { it.intValue() } // Type inference test of public static java.lang. Object [] org.codehaus.groovy.runtime.DefaultGroovyMethods.sort(java.lang. Object [], boolean ,groovy.lang.Closure) ([1] as Object []).sort( true ) { it.intValue() } // Type inference test of public static boolean org.codehaus.groovy.runtime.DefaultGroovyMethods.removeAll(java.util.Collection,groovy.lang.Closure) [1].removeAll { it.intValue() } // Type inference test of public static boolean org.codehaus.groovy.runtime.DefaultGroovyMethods.retainAll(java.util.Collection,groovy.lang.Closure) [1].retainAll { it.intValue() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.addShutdownHook(java.lang. Object ,groovy.lang.Closure) 1.addShutdownHook { it.intValue() } // Type inference test of public static java.net.Socket org.codehaus.groovy.runtime.DefaultGroovyMethods.accept(java.net.ServerSocket,groovy.lang.Closure) throws java.io.IOException new ServerSocket().accept { it.getPort() } // Type inference test of public static java.net.Socket org.codehaus.groovy.runtime.DefaultGroovyMethods.accept(java.net.ServerSocket, boolean ,groovy.lang.Closure) throws java.io.IOException new ServerSocket().accept( true ) { it.getPort() } // Type inference test of public static groovy.lang.MetaClass org.codehaus.groovy.runtime.DefaultGroovyMethods.metaClass(java.lang. Class ,groovy.lang.Closure) Integer .metaClass { methods } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.with(java.lang. Object ,groovy.lang.Closure) 1.with { it.intValue() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.use(java.lang. Object ,java.lang. Class ,groovy.lang.Closure) 1.use( Integer ) { it.intValue() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.use(java.lang. Object ,java.util.List,groovy.lang.Closure) 1.use([1]) { it.intValue() } // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.eachWithIndex(java.util.Map,groovy.lang.Closure) [key:1].eachWithIndex { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.reverseEach(java.util.Map,groovy.lang.Closure) [key:1].reverseEach { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.lang. Object [] org.codehaus.groovy.runtime.DefaultGroovyMethods.reverseEach(java.lang. Object [],groovy.lang.Closure) ([1] as Object []).reverseEach { it.intValue() } // Type inference test of public static boolean org.codehaus.groovy.runtime.DefaultGroovyMethods.every(java.util.Map,groovy.lang.Closure) [key:1].every { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static boolean org.codehaus.groovy.runtime.DefaultGroovyMethods.any(java.util.Map,groovy.lang.Closure) [key:1].any { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.util.List org.codehaus.groovy.runtime.DefaultGroovyMethods.collectNested(java.util.Collection,groovy.lang.Closure) [1].collectNested { it.intValue() } // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.collectNested(java.util.Collection,java.util.Collection,groovy.lang.Closure) [1].collectNested([1]) { it.intValue() } // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.collectMany(java.util.Collection,groovy.lang.Closure) [1].collectMany { it.intValue() } // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.collectMany(java.lang. Object [],groovy.lang.Closure) ([1] as Object []).collectMany { it.intValue() } // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.collectMany(java.util.Iterator,groovy.lang.Closure) [1].iterator().collectMany { it.intValue() } // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(java.lang. Object [],java.util.Map,groovy.lang.Closure) ([1] as Object []).collectEntries([key:1]) { it.intValue() } // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(java.lang. Object [],groovy.lang.Closure) ([1] as Object []).collectEntries { it.intValue() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.findResult(java.util.Map,java.lang. Object ,groovy.lang.Closure) [key:1].findResult(1) { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.findResult(java.util.Map,groovy.lang.Closure) [key:1].findResult { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.findResults(java.util.Collection,groovy.lang.Closure) [1].findResults { it.intValue() } // Type inference test of public static java.util.Collection org.codehaus.groovy.runtime.DefaultGroovyMethods.findResults(java.util.Map,groovy.lang.Closure) [key:1].findResults { it.getKey().toUpperCase() + it.getValue().intValue() } [key:1].findResults { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.findAll(java.util.Map,groovy.lang.Closure) [key:1].findAll { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.groupBy(java.util.Map,groovy.lang.Closure) [key:1].groupBy { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.countBy(java.lang. Object [],groovy.lang.Closure) ([1] as Object []).countBy { it.intValue() } // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.countBy(java.util.Map,groovy.lang.Closure) [key:1].countBy { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.groupEntriesBy(java.util.Map,groovy.lang.Closure) [key:1].groupEntriesBy { it.getKey().toUpperCase() + it.getValue().intValue() } [key:1].groupEntriesBy { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.inject(java.util.Map,java.lang. Object ,groovy.lang.Closure) [key:1].inject(1) { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.inject(java.lang. Object [],java.lang. Object ,groovy.lang.Closure) ([1] as Object []).inject(1) { value, item -> value.intValue() + item.intValue() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.sum(java.lang. Object [],groovy.lang.Closure) ([1] as Object []).sum { it.intValue() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.sum(java.lang. Object [],java.lang. Object ,groovy.lang.Closure) ([1] as Object []).sum(1) { it.intValue() } // Type inference test of public static java.util.Map org.codehaus.groovy.runtime.DefaultGroovyMethods.withDefault(java.util.Map,groovy.lang.Closure) [key:1].withDefault { it.getKey().toUpperCase() + it.getValue().intValue() } [key:1].withDefault { key, value -> key.toUpperCase() + value.intValue() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withStream(java.io.OutputStream,groovy.lang.Closure) throws java.io.IOException new FileOutputStream( new File( "test" )).withStream { it.write(1) } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachObject(java.io.File,groovy.lang.Closure) throws java.io.IOException,java.lang.ClassNotFoundException new File( "test" ).eachObject { it.getName() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachObject(java.io.ObjectInputStream,groovy.lang.Closure) throws java.io.IOException,java.lang.ClassNotFoundException new ObjectInputStream( new FileInputStream( "test" )).eachObject { it.read() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachFileMatch(java.io.File,groovy.io.FileType,java.lang. Object ,groovy.lang.Closure) throws java.io.FileNotFoundException,java.lang.IllegalArgumentException new File( "test" ).eachFileMatch(FileType.FILES, 1) { it.getName() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachFileMatch(java.io.File,java.lang. Object ,groovy.lang.Closure) throws java.io.FileNotFoundException,java.lang.IllegalArgumentException new File( "test" ).eachFileMatch(1) { it.getName() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachDirMatch(java.io.File,java.lang. Object ,groovy.lang.Closure) throws java.io.FileNotFoundException,java.lang.IllegalArgumentException new File( "test" ).eachDirMatch(1) { it.getName() } // Type inference test of public static java.util.TimerTask org.codehaus.groovy.runtime.DefaultGroovyMethods.runAfter(java.util.Timer, int ,groovy.lang.Closure) new Timer().runAfter(1) new Timer() // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.io.File,groovy.lang.Closure) throws java.io.IOException new File( "test" ).withReader { it.reset() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.io.File,java.lang. String ,groovy.lang.Closure) throws java.io.IOException new File( "test" ).withReader("") { it.reset()} // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.io.Reader,groovy.lang.Closure) throws java.io.IOException new FileReader( new File( "test" )).withReader { it.reset() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.net.URL,groovy.lang.Closure) throws java.io.IOException new URL( "http: //www.google.com" ).withReader { it.reset() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.net.URL,java.lang. String ,groovy.lang.Closure) throws java.io.IOException new URL( "http: //www.google.com" ).withReader("") { it.reset() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.io.InputStream,groovy.lang.Closure) throws java.io.IOException new FileInputStream( new File( "test" )).withReader { it.reset() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withReader(java.io.InputStream,java.lang. String ,groovy.lang.Closure) throws java.io.IOException new FileInputStream( new File( "test" )).withReader("") { it.reset() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withOutputStream(java.io.File,groovy.lang.Closure) throws java.io.IOException new File( "test" ).withOutputStream { it.flush() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withInputStream(java.io.File,groovy.lang.Closure) throws java.io.IOException new File( "test" ).withInputStream { it.available() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withInputStream(java.net.URL,groovy.lang.Closure) throws java.io.IOException new URL( "http: //www.google.com" ).withInputStream { it.available() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withDataOutputStream(java.io.File,groovy.lang.Closure) throws java.io.IOException new File( "test" ).withDataOutputStream { it.flush() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withDataInputStream(java.io.File,groovy.lang.Closure) throws java.io.IOException new File( "test" ).withDataInputStream { it.readUTF() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriter(java.io.File,groovy.lang.Closure) throws java.io.IOException new File( "test" ).withWriter { it.getName() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriter(java.io.File,java.lang. String ,groovy.lang.Closure) throws java.io.IOException new File( "test" ).withWriter("") { it.getName() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriter(java.io.Writer,groovy.lang.Closure) throws java.io.IOException new FileWriter( new File( "test" )).withWriter { it.write(1) } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriter(java.io.OutputStream,groovy.lang.Closure) throws java.io.IOException new FileOutputStream( new File( "test" )).withWriter { it.write(1) } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriter(java.io.OutputStream,java.lang. String ,groovy.lang.Closure) throws java.io.IOException new FileOutputStream( new File( "test" )).withWriter("") { it.write(1) } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriterAppend(java.io.File,java.lang. String ,groovy.lang.Closure) throws java.io.IOException new File( "test" ).withWriterAppend("") { it.write(1) } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withWriterAppend(java.io.File,groovy.lang.Closure) throws java.io.IOException new File( "test" ).withWriterAppend { it.write(1) } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withPrintWriter(java.io.Writer,groovy.lang.Closure) throws java.io.IOException new FileWriter( new File( "test" )).withPrintWriter { it.write(1) } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.io.File,groovy.lang.Closure) throws java.io.IOException new File( "test" ).eachByte { it.getName() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.io.File, int ,groovy.lang.Closure) throws java.io.IOException new File( "test" ).eachByte(1) { it.getName() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.lang. Byte [],groovy.lang.Closure) ([1] as Byte []).eachByte { buffer, bytesRead -> buffer.size() + bytesRead.intValue() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte( byte [],groovy.lang.Closure) ([1] as byte []).eachByte {buffer, bytesRead -> buffer.size() + bytesRead.intValue() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.io.InputStream,groovy.lang.Closure) throws java.io.IOException new FileInputStream( new File( "test" )).eachByte { buffer, bytesRead -> buffer.size() + bytesRead.intValue() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.io.InputStream, int ,groovy.lang.Closure) throws java.io.IOException new FileInputStream( new File( "test" )).eachByte(1) { buffer, bytesRead -> buffer.size() + bytesRead.intValue() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.net.URL,groovy.lang.Closure) throws java.io.IOException new URL( "http: //www.google.com" ).eachByte { buffer, bytesRead -> buffer.size() + bytesRead.intValue() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.eachByte(java.net.URL, int ,groovy.lang.Closure) throws java.io.IOException new URL( "http: //www.google.com" ).eachByte(1) { buffer, bytesRead -> buffer.size() + bytesRead.intValue() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.transformChar(java.io.Reader,java.io.Writer,groovy.lang.Closure) throws java.io.IOException new FileReader( new File( "test" )).transformChar( new FileWriter( new File( "test" ))) { it.toUpperCase() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.transformLine(java.io.Reader,java.io.Writer,groovy.lang.Closure) throws java.io.IOException new FileReader( new File( "test" )).transformLine( new FileWriter( new File( "test" ))) { it.toUpperCase() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.Reader,java.io.Writer,groovy.lang.Closure) throws java.io.IOException new FileReader( new File( "test" )).filterLine( new FileWriter( new File( "test" ))) { it.toUpperCase() } // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.File,groovy.lang.Closure) throws java.io.IOException new File( "test" ).filterLine { it.toUpperCase() } // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.File,java.lang. String ,groovy.lang.Closure) throws java.io.IOException new File( "test" ).filterLine("") { it.toUpperCase() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.File,java.io.Writer,groovy.lang.Closure) throws java.io.IOException new File( "test" ).filterLine( new FileWriter( new File( "test" ))) { it.toUpperCase() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.File,java.io.Writer,java.lang. String ,groovy.lang.Closure) throws java.io.IOException new File( "test" ).filterLine( new FileWriter( new File( "test" )), "") { it.toUpperCase() } // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.Reader,groovy.lang.Closure) new FileReader( new File( "test" )).filterLine { it.toUpperCase() } // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.InputStream,groovy.lang.Closure) new FileInputStream( new File( "test" )).filterLine { it.toUpperCase() } // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.InputStream,java.lang. String ,groovy.lang.Closure) throws java.io.UnsupportedEncodingException new FileInputStream( new File( "test" )).filterLine("") { it.toUpperCase() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.InputStream,java.io.Writer,groovy.lang.Closure) throws java.io.IOException new FileInputStream( new File( "test" )).filterLine( new FileWriter( new File( "test" ))) { it.toUpperCase() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.io.InputStream,java.io.Writer,java.lang. String ,groovy.lang.Closure) throws java.io.IOException new FileInputStream( new File( "test" )).filterLine( new FileWriter( new File( "test" )), "") { it.toUpperCase() } // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.net.URL,groovy.lang.Closure) throws java.io.IOException new URL( "http: //www.google.com" ).filterLine { it.toUpperCase() } // Type inference test of public static groovy.lang.Writable org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.net.URL,java.lang. String ,groovy.lang.Closure) throws java.io.IOException new URL( "http: //www.google.com" ).filterLine("") { it.toUpperCase() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.net.URL,java.io.Writer,groovy.lang.Closure) throws java.io.IOException new URL( "http: //www.google.com" ).filterLine( new FileWriter( new File( "test" ))) { it.toUpperCase() } // Type inference test of public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.filterLine(java.net.URL,java.io.Writer,java.lang. String ,groovy.lang.Closure) throws java.io.IOException new URL( "http: //www.google.com" ).filterLine( new FileWriter( new File( "test" )), "") { it.toUpperCase() } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withStreams(java.net.Socket,groovy.lang.Closure) throws java.io.IOException new Socket().withStreams { is, os -> is.read(); os.write(1) } // Type inference test of public static java.lang. Object org.codehaus.groovy.runtime.DefaultGroovyMethods.withObjectStreams(java.net.Socket,groovy.lang.Closure) throws java.io.IOException new Socket().withObjectStreams { is, os -> is.read(); os.write(1) } // Type inference test of public static java.lang. String org.codehaus.groovy.runtime.DefaultGroovyMethods.eachMatch(java.lang. String ,java.lang. String ,groovy.lang.Closure) "".eachMatch(" ") { it.toLowerCase() } // Type inference test of public static java.lang. String org.codehaus.groovy.runtime.DefaultGroovyMethods.eachMatch(java.lang. String ,java.util.regex.Pattern,groovy.lang.Closure) "".eachMatch(~/test/) { it.toLowerCase() }
        Hide
        Bob Tiernay added a comment -

        Can we change the title of this issue to "Type inference support for DGM methods" to more accurately reflect the totality of the issue? Thanks

        Show
        Bob Tiernay added a comment - Can we change the title of this issue to "Type inference support for DGM methods" to more accurately reflect the totality of the issue? Thanks
        Hide
        Andrew Eisenberg added a comment -

        Some more work to do.

        Show
        Andrew Eisenberg added a comment - Some more work to do.
        Hide
        Andrew Eisenberg added a comment -

        Fixed everything that I will for this issue. Some of the lines above do not seem to be valid groovy code and some entries were incorrect.

        I will add tests for each of this.

        Show
        Andrew Eisenberg added a comment - Fixed everything that I will for this issue. Some of the lines above do not seem to be valid groovy code and some entries were incorrect. I will add tests for each of this.

          People

          • Assignee:
            Andrew Eisenberg
            Reporter:
            Bob Tiernay
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: