Lukas Ruetz | 1 Dec 2008 09:34
Picon
Picon
Gravatar

Re: [groovy-user] GraphicsBuilder - colorspace problem with JPEGs

Hi Andres,

thanks for the info. I will use the described workaround in the meanwhile.

bye,
Lukas

On Sun, 30 Nov 2008 20:26:11 +0100, Andres Almiray
<aalmiray@...>  
wrote:
>
> Hi Lukas,
>
> There is not current way to hint GraphicsBuilder which colorspace it  
> should
> use instead of the default settings, this is a problem I'll be fixing on  
> the
> next release (0.7), expect more news soon.
>
> Cheers,
> Andres
>
>
> Lukas Ruetz wrote:
>>
>> Hello,
>>
>> when I generate an image and save it with ImageIO.write() as PNG it  
>> looks
>> as expected, but when I save it as JPEG the colors are wrong.
(Continue reading)

Peter Ledbrook | 1 Dec 2008 10:30
Picon
Gravatar

[groovy-user] Accessing Groovy properties via reflection (Groovy 1.6.x)

Hi,

I have just come this exception while doing some testing against the
latest Groovy 1.6.x:

  Caused by: java.lang.NoSuchMethodException:
grails.util.BuildSettings.setCompileDependencies(java.util.List)
	at java.lang.Class.getMethod(Class.java:1581)
	at org.codehaus.groovy.grails.cli.support.GrailsBuildHelper.invokeMethod(GrailsBuildHelper.java:219)

BuildSettings is a Groovy class with this property:

  List compileDependencies

and I would like to set its value from a Java class. Should calling
the "setCompileDependencies()" method via reflection work? Or must
another approach be used?

Thanks,

Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Guillaume Laforge | 1 Dec 2008 10:39
Picon
Gravatar

Re: [groovy-user] Accessing Groovy properties via reflection (Groovy 1.6.x)

Why do you want to call it through reflection instead of calling it directly?

On Mon, Dec 1, 2008 at 10:30 AM, Peter Ledbrook <peter@...> wrote:
> Hi,
>
> I have just come this exception while doing some testing against the
> latest Groovy 1.6.x:
>
>  Caused by: java.lang.NoSuchMethodException:
> grails.util.BuildSettings.setCompileDependencies(java.util.List)
>        at java.lang.Class.getMethod(Class.java:1581)
>        at org.codehaus.groovy.grails.cli.support.GrailsBuildHelper.invokeMethod(GrailsBuildHelper.java:219)
>
> BuildSettings is a Groovy class with this property:
>
>  List compileDependencies
>
> and I would like to set its value from a Java class. Should calling
> the "setCompileDependencies()" method via reflection work? Or must
> another approach be used?
>
> Thanks,
>
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
(Continue reading)

Peter Ledbrook | 1 Dec 2008 10:47
Picon
Gravatar

Re: [groovy-user] Accessing Groovy properties via reflection (Groovy 1.6.x)

> Why do you want to call it through reflection instead of calling it directly?

Due to class loader isolation, I need to invoke these methods via
reflection. If I don't, I get all sorts of ClassNotFoundExceptions
flying around.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Peter Ledbrook | 1 Dec 2008 11:07
Picon
Gravatar

[groovy-user] Mocking interfaces - is this code OK?

Hi again,

I am currently looking into an issue with the Grails Testing plugin
and it's making me wonder whether I'm doing the right thing or not.
The idea is that, having added mock methods to a class or interface
via ExpandoMetaClass, the user should be able to create a mock
instance using this method:

    def createMock() {
        def mock = [:].asType(this.mockedClass)

        mock.metaClass.invokeMethod = { String name, Object[] args ->
            // Find an expando method with the same signature as the
            // one being invoked.
            def paramTypes = args*.getClass()
            def method = delegate.metaClass.expandoMethods.find {
MetaMethod m ->
                // First check the name
                m.name == name &&
                        // Then the number of method arguments
                        m.parameterTypes.size() == paramTypes.size() &&
                        // And finally the argument types
                        (0..<m.parameterTypes.size()).every { n ->
                            paramTypes[n] == null ||
m.parameterTypes[n].cachedClass.isAssignableFrom(paramTypes[n])
                        }
            }

            if (method) {
                return method.doMethodInvoke(delegate, args)
(Continue reading)

Guillaume Laforge | 1 Dec 2008 11:12
Picon
Gravatar

Re: [groovy-user] Accessing Groovy properties via reflection (Groovy 1.6.x)

On Mon, Dec 1, 2008 at 10:47 AM, Peter Ledbrook <peter@...> wrote:
>> Why do you want to call it through reflection instead of calling it directly?
>
> Due to class loader isolation, I need to invoke these methods via
> reflection. If I don't, I get all sorts of ClassNotFoundExceptions
> flying around.

And you're calling that method (through reflection) from Java or from Groovy?
Because Groovy will just call it, no need for reflection there --
thanks duck typing.

Could you show your BuildSettings class?
Does it just look like this?

class BuildSettings {
    List compileDependencies
}

And how you're calling it from the other side?

I feel I'm missing something, because I don't understand why you would
get a NoSuchMethodException.

--

-- 
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

---------------------------------------------------------------------
(Continue reading)

Peter Ledbrook | 1 Dec 2008 11:35
Picon
Gravatar

Re: [groovy-user] Accessing Groovy properties via reflection (Groovy 1.6.x)

> And you're calling that method (through reflection) from Java or from Groovy?
> Because Groovy will just call it, no need for reflection there --
> thanks duck typing.

From Java.

> Could you show your BuildSettings class?
> Does it just look like this?
>
> class BuildSettings {
>    List compileDependencies
> }

It's a bit bigger than that, but it does have a field like that.
However, I've discovered through debugging that the relevant Class
instance does not have that field or the associated methods, which is
why I'm getting that error. Why they are missing I don't know, but it
may be down to a stale class lurking somewhere. Anyway, doesn't seem
to be a Groovy problem.

Thanks,

Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

(Continue reading)

faenvie | 1 Dec 2008 12:05
Picon
Picon

Re: [groovy-user] eclipse-plugin update for 1.5.7 ?


anybody who can provide information 
about the state of the groovy-eclipse-plugin ?

esp.: will there be another release in the 
foreseeable future ?

-- thanx --
--

-- 
View this message in context: http://www.nabble.com/eclipse-plugin-update-for-1.5.7---tp20007138p20769852.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Guillaume Laforge | 1 Dec 2008 12:11
Picon
Gravatar

Re: [groovy-user] eclipse-plugin update for 1.5.7 ?

The new version is going to be announced today.

On Mon, Dec 1, 2008 at 12:05 PM, faenvie <fanny.aenvie@...> wrote:
>
> anybody who can provide information
> about the state of the groovy-eclipse-plugin ?
>
> esp.: will there be another release in the
> foreseeable future ?
>
> -- thanx --
> --
> View this message in context: http://www.nabble.com/eclipse-plugin-update-for-1.5.7---tp20007138p20769852.html
> Sent from the groovy - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

--

-- 
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

(Continue reading)

Guillaume Laforge | 1 Dec 2008 12:15
Picon
Gravatar

Re: [groovy-user] eclipse-plugin update for 1.5.7 ?

Actually, the version is already up there on the official distribution site:
http://dist.groovy.codehaus.org/distributions/update/

Announcements just need to be written and be sent :-)

On Mon, Dec 1, 2008 at 12:11 PM, Guillaume Laforge
<glaforge@...> wrote:
> The new version is going to be announced today.
>
> On Mon, Dec 1, 2008 at 12:05 PM, faenvie <fanny.aenvie@...> wrote:
>>
>> anybody who can provide information
>> about the state of the groovy-eclipse-plugin ?
>>
>> esp.: will there be another release in the
>> foreseeable future ?
>>
>> -- thanx --
>> --
>> View this message in context: http://www.nabble.com/eclipse-plugin-update-for-1.5.7---tp20007138p20769852.html
>> Sent from the groovy - user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
(Continue reading)


Gmane