Re: [m2] compiling a generic method with maven fails

2008-03-08 Thread Adrian Herscu


VUB Stefan Seidel wrote:


Now, I discovered that under Maven 2 with the following 
maven-compiler-plugin configuration:


  1.6
  1.6



Add true

Stefan



Why should that work?
Adrian.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [m2] compiling a generic method with maven fails

2008-03-06 Thread VUB Stefan Seidel


Now, I discovered that under Maven 2 with the following 
maven-compiler-plugin configuration:


  1.6
  1.6



Add true

Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [m2] compiling a generic method with maven fails

2008-03-05 Thread Wayne Fay
We regularly see people on this list complaining that things compile
in Eclipse but not with Maven (or vice versa). Eventually it comes
down to differences in JDT and javac. That's why I asked what I did...

Wayne

On 3/5/08, Adrian Herscu <[EMAIL PROTECTED]> wrote:
> Checked the eclipse.tools.jdt newsgroup; seems that there are many more
> inconsistencies like these between the JDT compiler and javac, all of
> those which I saw are regarded to generics.
> Adrian.
> P.S. And there is no switch in Eclipse to make it compile with javac,
> except making it create and ANT build file.
>
> Adrian Herscu wrote:
> > I thought about this... Problem is, that there are more than ten
> > dependencies and the sources are stored into three different
> > directories... Configuring javac for this, seems like a nightmare!
> >
> > I have changed the return type of the method from V to AbstractView,
> > added a cast to V somewhere, and that solved the problem with Maven.
> > Knew that these generics are more trouble than worth!
> >
> > Is there some switch in Eclipse to make it compile with javac?
> >
> > Wayne Fay wrote:
> >> Can you try compiling with the Sun JDK 1.6 directly eg javac ...?
> >>
> >> Wayne
> >>
> >> On 3/5/08, Adrian Herscu <[EMAIL PROTECTED]> wrote:
> >>> Hi all,
> >>>
> >>> I have this generic method which compiles fine under Eclipse 3.3:
> >>>
> >>> public abstract class AbstractApplication >>> extends AbstractView, C extends AbstractControl> {
> >>> ...
> >>> private V getViewFor(final Class viewClass) {
> >>> class InternalRunnable
> >>> implements Runnable {
> >>> private V frame;
> >>>
> >>> public void run() {
> >>> try {
> >>> frame = viewClass.newInstance();
> >>> frame
> >>> .setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
> >>> frame.setVisible(true);
> >>> } catch (final InstantiationException e) {
> >>> // TODO Auto-generated catch block
> >>> e.printStackTrace();
> >>> } catch (final IllegalAccessException e) {
> >>> // TODO Auto-generated catch block
> >>> e.printStackTrace();
> >>> }
> >>> }
> >>> }
> >>> ...
> >>> }
> >>>
> >>> And the code runs OK on the Sun JRE 6.0.
> >>>
> >>> Now, I discovered that under Maven 2 with the following
> >>> maven-compiler-plugin configuration:
> >>> 
> >>>   1.6
> >>>   1.6
> >>> 
> >>>
> >>> the build fails with the following compilation error:
> >>>
> >>> [INFO] Compilation failure
> >>> C:\documents\pm\project-trunks\wirexn\sandbox\swing-client-sample\src\main\java\
> >>>
> >>> org\wirexn\sandbox\wsgui\AbstractApplication.java:[103,23] incompatible
> >>> types
> >>> found   : org.wirexn.sandbox.wsgui.view.AbstractView
> >>> required: V
> >>>
> >>>
> >>>
> >>> C:\documents\pm\project-trunks\wirexn\sandbox\swing-client-sample\src\main\java\
> >>>
> >>> org\wirexn\sandbox\wsgui\AbstractApplication.java:[103,23] incompatible
> >>> types
> >>> found   : org.wirexn.sandbox.wsgui.view.AbstractView
> >>> required: V
> >>>
> >>> Any suggestions?
> >>>
> >>> Thanks in advance,
> >>> Adrian.
> >>>
> >>>
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [m2] compiling a generic method with maven fails

2008-03-05 Thread Adrian Herscu
Checked the eclipse.tools.jdt newsgroup; seems that there are many more 
inconsistencies like these between the JDT compiler and javac, all of 
those which I saw are regarded to generics.

Adrian.
P.S. And there is no switch in Eclipse to make it compile with javac, 
except making it create and ANT build file.


Adrian Herscu wrote:
I thought about this... Problem is, that there are more than ten 
dependencies and the sources are stored into three different 
directories... Configuring javac for this, seems like a nightmare!


I have changed the return type of the method from V to AbstractView, 
added a cast to V somewhere, and that solved the problem with Maven. 
Knew that these generics are more trouble than worth!


Is there some switch in Eclipse to make it compile with javac?

Wayne Fay wrote:

Can you try compiling with the Sun JDK 1.6 directly eg javac ...?

Wayne

On 3/5/08, Adrian Herscu <[EMAIL PROTECTED]> wrote:

Hi all,

I have this generic method which compiles fine under Eclipse 3.3:

public abstract class AbstractApplication {
...
private V getViewFor(final Class viewClass) {
class InternalRunnable
implements Runnable {
private V frame;

public void run() {
try {
frame = viewClass.newInstance();
frame
.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
} catch (final InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (final IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
...
}

And the code runs OK on the Sun JRE 6.0.

Now, I discovered that under Maven 2 with the following
maven-compiler-plugin configuration:

  1.6
  1.6


the build fails with the following compilation error:

[INFO] Compilation failure
C:\documents\pm\project-trunks\wirexn\sandbox\swing-client-sample\src\main\java\ 


org\wirexn\sandbox\wsgui\AbstractApplication.java:[103,23] incompatible
types
found   : org.wirexn.sandbox.wsgui.view.AbstractView
required: V



C:\documents\pm\project-trunks\wirexn\sandbox\swing-client-sample\src\main\java\ 


org\wirexn\sandbox\wsgui\AbstractApplication.java:[103,23] incompatible
types
found   : org.wirexn.sandbox.wsgui.view.AbstractView
required: V

Any suggestions?

Thanks in advance,
Adrian.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [m2] compiling a generic method with maven fails

2008-03-05 Thread Adrian Herscu
I thought about this... Problem is, that there are more than ten 
dependencies and the sources are stored into three different 
directories... Configuring javac for this, seems like a nightmare!


I have changed the return type of the method from V to AbstractView, 
added a cast to V somewhere, and that solved the problem with Maven. 
Knew that these generics are more trouble than worth!


Is there some switch in Eclipse to make it compile with javac?

Wayne Fay wrote:

Can you try compiling with the Sun JDK 1.6 directly eg javac ...?

Wayne

On 3/5/08, Adrian Herscu <[EMAIL PROTECTED]> wrote:

Hi all,

I have this generic method which compiles fine under Eclipse 3.3:

public abstract class AbstractApplication {
...
private V getViewFor(final Class viewClass) {
class InternalRunnable
implements Runnable {
private V frame;

public void run() {
try {
frame = viewClass.newInstance();
frame
.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
} catch (final InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (final IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
...
}

And the code runs OK on the Sun JRE 6.0.

Now, I discovered that under Maven 2 with the following
maven-compiler-plugin configuration:

  1.6
  1.6


the build fails with the following compilation error:

[INFO] Compilation failure
C:\documents\pm\project-trunks\wirexn\sandbox\swing-client-sample\src\main\java\
org\wirexn\sandbox\wsgui\AbstractApplication.java:[103,23] incompatible
types
found   : org.wirexn.sandbox.wsgui.view.AbstractView
required: V



C:\documents\pm\project-trunks\wirexn\sandbox\swing-client-sample\src\main\java\
org\wirexn\sandbox\wsgui\AbstractApplication.java:[103,23] incompatible
types
found   : org.wirexn.sandbox.wsgui.view.AbstractView
required: V

Any suggestions?

Thanks in advance,
Adrian.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [m2] compiling a generic method with maven fails

2008-03-05 Thread Wayne Fay
Can you try compiling with the Sun JDK 1.6 directly eg javac ...?

Wayne

On 3/5/08, Adrian Herscu <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have this generic method which compiles fine under Eclipse 3.3:
>
> public abstract class AbstractApplication extends AbstractView, C extends AbstractControl> {
> ...
> private V getViewFor(final Class viewClass) {
> class InternalRunnable
> implements Runnable {
> private V frame;
>
> public void run() {
> try {
> frame = viewClass.newInstance();
> frame
> .setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
> frame.setVisible(true);
> } catch (final InstantiationException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> } catch (final IllegalAccessException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
> }
> ...
> }
>
> And the code runs OK on the Sun JRE 6.0.
>
> Now, I discovered that under Maven 2 with the following
> maven-compiler-plugin configuration:
> 
>   1.6
>   1.6
> 
>
> the build fails with the following compilation error:
>
> [INFO] Compilation failure
> C:\documents\pm\project-trunks\wirexn\sandbox\swing-client-sample\src\main\java\
> org\wirexn\sandbox\wsgui\AbstractApplication.java:[103,23] incompatible
> types
> found   : org.wirexn.sandbox.wsgui.view.AbstractView
> required: V
>
>
>
> C:\documents\pm\project-trunks\wirexn\sandbox\swing-client-sample\src\main\java\
> org\wirexn\sandbox\wsgui\AbstractApplication.java:[103,23] incompatible
> types
> found   : org.wirexn.sandbox.wsgui.view.AbstractView
> required: V
>
> Any suggestions?
>
> Thanks in advance,
> Adrian.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[m2] compiling a generic method with maven fails

2008-03-05 Thread Adrian Herscu

Hi all,

I have this generic method which compiles fine under Eclipse 3.3:

public abstract class AbstractApplicationextends AbstractView, C extends AbstractControl> {

...
private V getViewFor(final Class viewClass) {
class InternalRunnable
implements Runnable {
private V frame;

public void run() {
try {
frame = viewClass.newInstance();
frame
.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
} catch (final InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (final IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
...
}

And the code runs OK on the Sun JRE 6.0.

Now, I discovered that under Maven 2 with the following 
maven-compiler-plugin configuration:


  1.6
  1.6


the build fails with the following compilation error:

[INFO] Compilation failure
C:\documents\pm\project-trunks\wirexn\sandbox\swing-client-sample\src\main\java\
org\wirexn\sandbox\wsgui\AbstractApplication.java:[103,23] incompatible 
types

found   : org.wirexn.sandbox.wsgui.view.AbstractView
required: V



C:\documents\pm\project-trunks\wirexn\sandbox\swing-client-sample\src\main\java\
org\wirexn\sandbox\wsgui\AbstractApplication.java:[103,23] incompatible 
types

found   : org.wirexn.sandbox.wsgui.view.AbstractView
required: V

Any suggestions?

Thanks in advance,
Adrian.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]