You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by be...@apache.org on 2008/09/20 21:24:45 UTC

svn commit: r697415 - /james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java

Author: berndf
Date: Sat Sep 20 12:24:44 2008
New Revision: 697415

URL: http://svn.apache.org/viewvc?rev=697415&view=rev
Log:
partly undo changes from commit 684436. my javac is frowning upon missing casts

Modified:
    james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java

Modified: james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java
URL: http://svn.apache.org/viewvc/james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java?rev=697415&r1=697414&r2=697415&view=diff
==============================================================================
--- james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java (original)
+++ james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java Sat Sep 20 12:24:44 2008
@@ -83,7 +83,7 @@
     public void connectRemoteJamesJMXServer() throws SamplingException {
         if(jvmResourceSampleWorker == null) throw new SamplingException("JSE specific features not present. (compile the project with JSE 5)");
         try {
-            m_connectMethod.invoke(jvmResourceSampleWorker, VOID_ARGUMENT_LIST);
+            m_connectMethod.invoke(jvmResourceSampleWorker, (Object[])VOID_ARGUMENT_LIST);
         } catch (Exception e) {
             throw new SamplingException("could not establish connection to remote James JMX. is James really configured for JMX and running under JSE5 or later?");
         }
@@ -92,7 +92,7 @@
     public void doSample() throws SamplingException {
         if(jvmResourceSampleWorker == null) throw new SamplingException("JSE specific features not present. (compile the project with JSE 5)");
         try {
-            m_doSampleMethod.invoke(jvmResourceSampleWorker, VOID_ARGUMENT_LIST);
+            m_doSampleMethod.invoke(jvmResourceSampleWorker, (Object[])VOID_ARGUMENT_LIST);
         } catch (Exception e) {
             throw new SamplingException(e);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: svn commit: r697415 - /james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java

Posted by Bernd Fondermann <be...@googlemail.com>.
On Sat, Sep 20, 2008 at 22:29, Stefano Bagnara <ap...@bago.org> wrote:
> Bernd Fondermann ha scritto:
>>
>> I've seen this error on a MacBook and a Windows machine.
>>
>> The Mac has
>>
>> java version "1.5.0_13"
>> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241)
>> Java HotSpot(TM) Client VM (build 1.5.0_13-121, mixed mode, sharing)
>>
>> running. The Intellij IDEA 8.0M1 JVM on the same machine does not see any
>> problems with it, either.
>>
>> Anyway, it doesn't hurt to have the cast, doesn't it?
>
> No, I was just curious to understand my mistakes :-) .. and I hope I'll
> remember this the next time I'll want to clean up warnings.. :-/
>
> BTW I see that if we require java5 that reflection can simply be removed in
> favor of a direct invoke.

... and the split into JVMResourceSampler and JVMResourceSamplerWorker
is no longer needed, you are right.

I'll open a JIRA for that.

  Bernd

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: svn commit: r697415 - /james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java

Posted by Stefano Bagnara <ap...@bago.org>.
Bernd Fondermann ha scritto:
> I've seen this error on a MacBook and a Windows machine.
> 
> The Mac has
> 
> java version "1.5.0_13"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241)
> Java HotSpot(TM) Client VM (build 1.5.0_13-121, mixed mode, sharing)
> 
> running. The Intellij IDEA 8.0M1 JVM on the same machine does not see 
> any problems with it, either.
> 
> Anyway, it doesn't hurt to have the cast, doesn't it?

No, I was just curious to understand my mistakes :-) .. and I hope I'll 
remember this the next time I'll want to clean up warnings.. :-/

BTW I see that if we require java5 that reflection can simply be removed 
in favor of a direct invoke.

Stefano

>   Bernd
> 
> 
> Stefano Bagnara wrote:
>> Hi Bernd,
>>
>> what javac are you using?
>>
>> Postage requires Java 5:
>> http://markmail.org/message/5souuokvg3uq33di
>>
>> It succesfully built here and on hudson, both with ant and m2, using 
>> jdk 5...
>>
>> Stefano
>>
>> berndf@apache.org ha scritto:
>>> Author: berndf
>>> Date: Sat Sep 20 12:24:44 2008
>>> New Revision: 697415
>>>
>>> URL: http://svn.apache.org/viewvc?rev=697415&view=rev
>>> Log:
>>> partly undo changes from commit 684436. my javac is frowning upon 
>>> missing casts
>>>
>>> Modified:
>>>     
>>> james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java 
>>>
>>>
>>> Modified: 
>>> james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java 
>>>
>>> URL: 
>>> http://svn.apache.org/viewvc/james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java?rev=697415&r1=697414&r2=697415&view=diff 
>>>
>>> ============================================================================== 
>>>
>>> --- 
>>> james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java 
>>> (original)
>>> +++ 
>>> james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java 
>>> Sat Sep 20 12:24:44 2008
>>> @@ -83,7 +83,7 @@
>>>      public void connectRemoteJamesJMXServer() throws 
>>> SamplingException {
>>>          if(jvmResourceSampleWorker == null) throw new 
>>> SamplingException("JSE specific features not present. (compile the 
>>> project with JSE 5)");
>>>          try {
>>> -            m_connectMethod.invoke(jvmResourceSampleWorker, 
>>> VOID_ARGUMENT_LIST);
>>> +            m_connectMethod.invoke(jvmResourceSampleWorker, 
>>> (Object[])VOID_ARGUMENT_LIST);
>>>          } catch (Exception e) {
>>>              throw new SamplingException("could not establish 
>>> connection to remote James JMX. is James really configured for JMX 
>>> and running under JSE5 or later?");
>>>          }
>>> @@ -92,7 +92,7 @@
>>>      public void doSample() throws SamplingException {
>>>          if(jvmResourceSampleWorker == null) throw new 
>>> SamplingException("JSE specific features not present. (compile the 
>>> project with JSE 5)");
>>>          try {
>>> -            m_doSampleMethod.invoke(jvmResourceSampleWorker, 
>>> VOID_ARGUMENT_LIST);
>>> +            m_doSampleMethod.invoke(jvmResourceSampleWorker, 
>>> (Object[])VOID_ARGUMENT_LIST);
>>>          } catch (Exception e) {
>>>              throw new SamplingException(e);
>>>          }
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: svn commit: r697415 - /james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java

Posted by Bernd Fondermann <bf...@brainlounge.de>.
I've seen this error on a MacBook and a Windows machine.

The Mac has

java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241)
Java HotSpot(TM) Client VM (build 1.5.0_13-121, mixed mode, sharing)

running. The Intellij IDEA 8.0M1 JVM on the same machine does not see 
any problems with it, either.

Anyway, it doesn't hurt to have the cast, doesn't it?

   Bernd


Stefano Bagnara wrote:
> Hi Bernd,
> 
> what javac are you using?
> 
> Postage requires Java 5:
> http://markmail.org/message/5souuokvg3uq33di
> 
> It succesfully built here and on hudson, both with ant and m2, using jdk 
> 5...
> 
> Stefano
> 
> berndf@apache.org ha scritto:
>> Author: berndf
>> Date: Sat Sep 20 12:24:44 2008
>> New Revision: 697415
>>
>> URL: http://svn.apache.org/viewvc?rev=697415&view=rev
>> Log:
>> partly undo changes from commit 684436. my javac is frowning upon 
>> missing casts
>>
>> Modified:
>>     
>> james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java 
>>
>>
>> Modified: 
>> james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java?rev=697415&r1=697414&r2=697415&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java 
>> (original)
>> +++ 
>> james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java 
>> Sat Sep 20 12:24:44 2008
>> @@ -83,7 +83,7 @@
>>      public void connectRemoteJamesJMXServer() throws SamplingException {
>>          if(jvmResourceSampleWorker == null) throw new 
>> SamplingException("JSE specific features not present. (compile the 
>> project with JSE 5)");
>>          try {
>> -            m_connectMethod.invoke(jvmResourceSampleWorker, 
>> VOID_ARGUMENT_LIST);
>> +            m_connectMethod.invoke(jvmResourceSampleWorker, 
>> (Object[])VOID_ARGUMENT_LIST);
>>          } catch (Exception e) {
>>              throw new SamplingException("could not establish 
>> connection to remote James JMX. is James really configured for JMX and 
>> running under JSE5 or later?");
>>          }
>> @@ -92,7 +92,7 @@
>>      public void doSample() throws SamplingException {
>>          if(jvmResourceSampleWorker == null) throw new 
>> SamplingException("JSE specific features not present. (compile the 
>> project with JSE 5)");
>>          try {
>> -            m_doSampleMethod.invoke(jvmResourceSampleWorker, 
>> VOID_ARGUMENT_LIST);
>> +            m_doSampleMethod.invoke(jvmResourceSampleWorker, 
>> (Object[])VOID_ARGUMENT_LIST);
>>          } catch (Exception e) {
>>              throw new SamplingException(e);
>>          }
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: svn commit: r697415 - /james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java

Posted by Stefano Bagnara <ap...@bago.org>.
Hi Bernd,

what javac are you using?

Postage requires Java 5:
http://markmail.org/message/5souuokvg3uq33di

It succesfully built here and on hudson, both with ant and m2, using jdk 
5...

Stefano

berndf@apache.org ha scritto:
> Author: berndf
> Date: Sat Sep 20 12:24:44 2008
> New Revision: 697415
> 
> URL: http://svn.apache.org/viewvc?rev=697415&view=rev
> Log:
> partly undo changes from commit 684436. my javac is frowning upon missing casts
> 
> Modified:
>     james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java
> 
> Modified: james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java
> URL: http://svn.apache.org/viewvc/james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java?rev=697415&r1=697414&r2=697415&view=diff
> ==============================================================================
> --- james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java (original)
> +++ james/postage/trunk/src/main/java/org/apache/james/postage/jmx/JVMResourceSampler.java Sat Sep 20 12:24:44 2008
> @@ -83,7 +83,7 @@
>      public void connectRemoteJamesJMXServer() throws SamplingException {
>          if(jvmResourceSampleWorker == null) throw new SamplingException("JSE specific features not present. (compile the project with JSE 5)");
>          try {
> -            m_connectMethod.invoke(jvmResourceSampleWorker, VOID_ARGUMENT_LIST);
> +            m_connectMethod.invoke(jvmResourceSampleWorker, (Object[])VOID_ARGUMENT_LIST);
>          } catch (Exception e) {
>              throw new SamplingException("could not establish connection to remote James JMX. is James really configured for JMX and running under JSE5 or later?");
>          }
> @@ -92,7 +92,7 @@
>      public void doSample() throws SamplingException {
>          if(jvmResourceSampleWorker == null) throw new SamplingException("JSE specific features not present. (compile the project with JSE 5)");
>          try {
> -            m_doSampleMethod.invoke(jvmResourceSampleWorker, VOID_ARGUMENT_LIST);
> +            m_doSampleMethod.invoke(jvmResourceSampleWorker, (Object[])VOID_ARGUMENT_LIST);
>          } catch (Exception e) {
>              throw new SamplingException(e);
>          }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org