<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<!-- MHonArc v2.6.10 -->
	<channel>
		<title>jdt-core-dev</title>
		<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/maillist.html</link>
		<description>jdt-core-dev</description>
		<language>en-us</language>
		<pubDate>Sat, 05 May 2012 04:14:49 GMT</pubDate>
		<lastBuildDate>Sat, 05 May 2012 04:14:49 GMT</lastBuildDate>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<generator>MHonArc RSS 2.0 RCFile</generator>
		<managingEditor>webmaster@eclipse.org (Webmaster)</managingEditor>
		<webMaster>webmaster@eclipse.org (Webmaster)</webMaster>
		<image>
			<title>jdt-core-dev</title>
			<url>http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/eclipse_home_header.jpg</url>
			<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/maillist.html</link>
		</image>
 

	<item>
		<title>[jdt-core-dev] Project meta data is out of date for eclipse.jdt.core</title>
		<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02190.html</link>
		<description>Srikanth, Projects are required to keep meta data up to date using the MyFoundation Portal (http://portal.eclipse.org/). The following problems were found with this project's meta-data: * There is no next/future release of this project. All Eclipse project...</description>
		<content:encoded><![CDATA[<pre>Srikanth,
Projects are required to keep meta data up to date using the MyFoundation
Portal (<a  href="http://portal.eclipse.org/">http://portal.eclipse.org/</a>).  The following problems were found
with this project's meta-data:

* There is no next/future release of this project. All Eclipse projects
must have a &quot;next release&quot; planned and scheduled.


</pre>]]></content:encoded>
		<pubDate>Sat, 05 May 2012 04:00:04 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02190.html</guid>
		<author>emo@xxxxxxx (portal on behalf of emo)</author>
	</item>


	<item>
		<title>Re: [jdt-core-dev] Build Eclipse using Eclipse</title>
		<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02189.html</link>
		<description>This question really belongs on the Eclipse forums. I also suggesting reading documentation on the wiki, such as: http://wiki.eclipse.org/JDT_Core_Committer_FAQ#Coding John Jongwook Kim &amp;lt;jongwook.kim@xxxxxxxxxxx&amp;gt; Sent by: jdt-core-dev-bounces@xxxxxxxxxxx 0...</description>
		<content:encoded><![CDATA[<font size=2 face="sans-serif">This question really belongs on the Eclipse
forums. I also suggesting reading documentation on the wiki, such as:</font>
<br>
<br><a href=http://wiki.eclipse.org/JDT_Core_Committer_FAQ#Coding><font size=2 face="sans-serif">http://wiki.eclipse.org/JDT_Core_Committer_FAQ#Coding</font></a>
<br>
<br><font size=2 face="sans-serif">John</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Jongwook Kim &lt;jongwook.kim@xxxxxxxxxxx&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: jdt-core-dev-bounces@xxxxxxxxxxx</font>
<p><font size=1 face="sans-serif">04/11/2012 12:38 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
&quot;Eclipse JDT Core developers list.&quot; &lt;jdt-core-dev@xxxxxxxxxxx&gt;</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">&lt;jdt-core-dev@xxxxxxxxxxx&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">[jdt-core-dev] Build Eclipse using Eclipse</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2 face="Tahoma">Hello Folks,<br>
 <br>
I'm finding guide to compile/debug Eclipse using Eclipse (or the way Eclipse
developers do in real).<br>
Hope to get any tip from you.<br>
 <br>
Thanks,<br>
Jongwook</font><tt><font size=2>_______________________________________________<br>
jdt-core-dev mailing list<br>
jdt-core-dev@xxxxxxxxxxx<br>
</font></tt><a href="https://dev.eclipse.org/mailman/listinfo/jdt-core-dev"><tt><font size=2>https://dev.eclipse.org/mailman/listinfo/jdt-core-dev</font></tt></a><tt><font size=2><br>
</font></tt>
<br>]]></content:encoded>
		<pubDate>Wed, 11 Apr 2012 20:04:35 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02189.html</guid>
		<author>John_Arthorne@xxxxxxx (John Arthorne)</author>
	</item>
	<item>
		<title>[jdt-core-dev] Build Eclipse using Eclipse</title>
		<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02188.html</link>
		<description> Hello Folks, I'm finding guide to compile/debug Eclipse using Eclipse (or the way Eclipse developers do in real).Hope to get any tip from you. Thanks,Jongwook </description>
		<content:encoded><![CDATA[<table width="100%"><tr><td style="">

<div dir='ltr'>
<font size="2" face="Tahoma">Hello Folks,</font><BR>&nbsp;<BR>I'm finding guide to compile/debug Eclipse&nbsp;using Eclipse (or the way Eclipse developers do in real).<BR>Hope to get any tip from you.<BR>&nbsp;<BR>Thanks,<BR>Jongwook<BR> 		 	   		  </div>
</td></tr></table>]]></content:encoded>
		<pubDate>Wed, 11 Apr 2012 16:38:13 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02188.html</guid>
		<author>jongwook.kim@xxxxxxx (Jongwook Kim)</author>
	</item>


	<item>
		<title>[jdt-core-dev] Project meta data is out of date for eclipse.jdt.core</title>
		<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02187.html</link>
		<description>Srikanth, Projects are required to keep meta data up to date using the MyFoundation Portal (http://portal.eclipse.org/). The following problems were found with this project's meta-data: * There is no next/future release of this project. All Eclipse project...</description>
		<content:encoded><![CDATA[<pre>Srikanth,
Projects are required to keep meta data up to date using the MyFoundation
Portal (<a  href="http://portal.eclipse.org/">http://portal.eclipse.org/</a>).  The following problems were found
with this project's meta-data:

* There is no next/future release of this project. All Eclipse projects
must have a &quot;next release&quot; planned and scheduled.


</pre>]]></content:encoded>
		<pubDate>Thu, 05 Apr 2012 04:00:03 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02187.html</guid>
		<author>emo@xxxxxxx (portal on behalf of emo)</author>
	</item>


	<item>
		<title>Re: [jdt-core-dev] Strange formatting when using JDT core DOM	infrastructure</title>
		<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02186.html</link>
		<description> </description>
		<content:encoded><![CDATA[Thanks Olivier!<div><br></div><div>Changing my code to:</div><div><br></div><div><div>&#xA0; &#xA0; &#xA0; &#xA0; declaration.modifiers().add(0, annotation);</div><div><br></div><div>indeed moved the annotation before the public declaration.</div>

<div><br></div><div>Now for your second advise (to format the code after I get it from the document). I tried to follow this great forum discussion:</div><div><br></div><div><a href="http://www.eclipse.org/forums/index.php/m/829341/">http://www.eclipse.org/forums/index.php/m/829341/</a>
</div><div><br></div><div>However, if I create my TextEdit this way:</div><div><br></div><div><div>&#xA0; &#xA0; &#xA0; &#xA0; CodeFormatter formatter = ToolFactory.createCodeFormatter(null);</div><div>&#xA0; &#xA0; &#xA0; &#xA0; TextEdit edit = formatter.format(0, document.get(), 0, document.get().length(), 0, null);</div>
<div>&#xA0; &#xA0; &#xA0; &#xA0; edit.apply(document);</div></div><div><br></div>Then I lose all the modifications that I did in the lines before and get the initial class (now formatted):</div><div><br></div><div><div>public class JavaClass {</div>
<div>}</div><div><br></div><div>I tried to call&#xA0;unit.rewrite(document, null); before formatter.format, but without luck.</div><div><br></div><div>Could someone tell me how do you format my document?</div><div><br></div><div>
Thanks again!</div><div>Ivan</div><div><br></div><div>P.S. I saw also that there is this package org.eclipse.jface.text.formatter, which has some ContentFormatter classes. While I am using&#xA0;org.eclipse.jdt.core.formatter.CodeFormatter. What is the correct way?</div>
<div><br></div><div class="gmail_quote">On Tue, Mar 27, 2012 at 4:37 AM, Olivier Thomann <span dir="ltr">&lt;<a href="mailto:Olivier_Thomann@xxxxxxxxxx" target="_blank">Olivier_Thomann@xxxxxxxxxx</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font face="sans-serif">Hi,</font>
<br>
<br><font face="sans-serif">You can add the annotation in the first
position inside the modifiers. You can format the code at the end once
you get the source from the document.</font>
<br>
<br><font face="sans-serif">Olivier</font>
<br>
<br>
<br>
<table width="100%">
<tbody><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">From:</font>
</td><td><font size="1" face="sans-serif">&quot;Ivan St. Ivanov&quot; &lt;<a href="mailto:ivan.st.ivanov@xxxxxxxxx" target="_blank">ivan.st.ivanov@xxxxxxxxx</a>&gt;</font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">To:</font>
</td><td><font size="1" face="sans-serif"><a href="mailto:jdt-core-dev@xxxxxxxxxxx" target="_blank">jdt-core-dev@xxxxxxxxxxx</a></font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">Date:</font>
</td><td><font size="1" face="sans-serif">2012-03-26 18:27</font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">Subject:</font>
</td><td><font size="1" face="sans-serif">[jdt-core-dev] Strange formatting when
using JDT core DOM &#xA0; &#xA0; &#xA0; &#xA0;infrastructure</font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">Sent by:</font>
</td><td><font size="1" face="sans-serif"><a href="mailto:jdt-core-dev-bounces@xxxxxxxxxxx" target="_blank">jdt-core-dev-bounces@xxxxxxxxxxx</a></font></td></tr></tbody></table>
<br>
<hr noshade><div><div>
<br>
<br>
<br><font size="3">Hi folks!</font>
<br>
<br><font size="3">I&#39;m working on the JBoss Forge tool (</font><a href="https://docs.jboss.org/author/display/FORGE/Home" target="_blank"><font size="3" color="#0062e1"><u>https://docs.jboss.org/author/display/FORGE/Home</u></font></a><font size="3">).
For some of its features it uses JDT core tooling to generate or modify
Java classes. For example, it may create JPA entities. However, the final
format is quite weird:</font>
<br>
<br><font size="3">package com.example.test;</font>
<br>
<br><font size="3">import javax.persistence.Entity;public @Entity class Employee
{}</font>
<br>
<br><font size="3">I would expect something like that:</font>
<br>
<br><font size="3">package com.example.test;</font>
<br>
<br><font size="3">import javax.persistence.Entity;</font>
<br>
<br><font size="3">@Entity</font>
<br><font size="3">public class Employee {}</font>
<br>
<br><font size="3">You noticed how in the generated input the import, the
annotation and the class declaration are on a single line? And @Entity
is placed between the public and class words?</font>
<br>
<br><font size="3">I have attached here a sample class, which demonstrates
how we use the JDT parser API. Could you please tell me what I am doing
wrong? And is it possible to have more beautiful formatting?</font>
<br>
<br><font size="3">Thanks and regards,</font>
<br></div></div><font size="3">Ivan[attachment &quot;JdtFormatterTest.java&quot; deleted
by Olivier Thomann/Ottawa/IBM] </font><tt><font>_______________________________________________<br>
jdt-core-dev mailing list<br>
<a href="mailto:jdt-core-dev@xxxxxxxxxxx" target="_blank">jdt-core-dev@xxxxxxxxxxx</a><br>
</font></tt><a href="https://dev.eclipse.org/mailman/listinfo/jdt-core-dev" target="_blank"><tt><font>https://dev.eclipse.org/mailman/listinfo/jdt-core-dev</font></tt></a><tt><font><br>
</font></tt>
<br>
<br><br>_______________________________________________<br>
jdt-core-dev mailing list<br>
<a href="mailto:jdt-core-dev@xxxxxxxxxxx" target="_blank">jdt-core-dev@xxxxxxxxxxx</a><br>
<a href="https://dev.eclipse.org/mailman/listinfo/jdt-core-dev" target="_blank">https://dev.eclipse.org/mailman/listinfo/jdt-core-dev</a><br>
<br></blockquote></div><br></div>
]]></content:encoded>
		<pubDate>Tue, 27 Mar 2012 08:17:06 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02186.html</guid>
		<author>ivan.st.ivanov@xxxxxxx (Ivan St. Ivanov)</author>
	</item>


	<item>
		<title>Re: [jdt-core-dev] Strange formatting when using JDT core	DOM	infrastructure</title>
		<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02185.html</link>
		<description>Hi, You can add the annotation in the first position inside the modifiers. You can format the code at the end once you get the source from the document. Olivier From: &amp;quot;Ivan St. Ivanov&amp;quot; &amp;lt;ivan.st.ivanov@xxxxxxxxx&amp;gt; To: jdt-core-dev@xxxxxxxxxxx Date: 2012-03-2...</description>
		<content:encoded><![CDATA[<font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">You can add the annotation in the first
position inside the modifiers. You can format the code at the end once
you get the source from the document.</font>
<br>
<br><font size=2 face="sans-serif">Olivier</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">&quot;Ivan St. Ivanov&quot; &lt;ivan.st.ivanov@xxxxxxxxx&gt;</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">jdt-core-dev@xxxxxxxxxxx</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">2012-03-26 18:27</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">[jdt-core-dev] Strange formatting when
using JDT core DOM &nbsp; &nbsp; &nbsp; &nbsp;infrastructure</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Sent by:</font>
<td><font size=1 face="sans-serif">jdt-core-dev-bounces@xxxxxxxxxxx</font></table>
<br>
<hr noshade>
<br>
<br>
<br><font size=3>Hi folks!</font>
<br>
<br><font size=3>I'm working on the JBoss Forge tool (</font><a href=https://docs.jboss.org/author/display/FORGE/Home target=_blank><font size=3 color=#0062e1><u>https://docs.jboss.org/author/display/FORGE/Home</u></font></a><font size=3>).
For some of its features it uses JDT core tooling to generate or modify
Java classes. For example, it may create JPA entities. However, the final
format is quite weird:</font>
<br>
<br><font size=3>package com.example.test;</font>
<br>
<br><font size=3>import javax.persistence.Entity;public @Entity class Employee
{}</font>
<br>
<br><font size=3>I would expect something like that:</font>
<br>
<br><font size=3>package com.example.test;</font>
<br>
<br><font size=3>import javax.persistence.Entity;</font>
<br>
<br><font size=3>@Entity</font>
<br><font size=3>public class Employee {}</font>
<br>
<br><font size=3>You noticed how in the generated input the import, the
annotation and the class declaration are on a single line? And @Entity
is placed between the public and class words?</font>
<br>
<br><font size=3>I have attached here a sample class, which demonstrates
how we use the JDT parser API. Could you please tell me what I am doing
wrong? And is it possible to have more beautiful formatting?</font>
<br>
<br><font size=3>Thanks and regards,</font>
<br><font size=3>Ivan[attachment &quot;JdtFormatterTest.java&quot; deleted
by Olivier Thomann/Ottawa/IBM] </font><tt><font size=2>_______________________________________________<br>
jdt-core-dev mailing list<br>
jdt-core-dev@xxxxxxxxxxx<br>
</font></tt><a href="https://dev.eclipse.org/mailman/listinfo/jdt-core-dev"><tt><font size=2>https://dev.eclipse.org/mailman/listinfo/jdt-core-dev</font></tt></a><tt><font size=2><br>
</font></tt>
<br>
<br>]]></content:encoded>
		<pubDate>Tue, 27 Mar 2012 01:37:53 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02185.html</guid>
		<author>Olivier_Thomann@xxxxxxx (Olivier Thomann)</author>
	</item>
	<item>
		<title>[jdt-core-dev] Strange formatting when using JDT core DOM	infrastructure</title>
		<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02184.html</link>
		<description>Hi folks!I&amp;#39;m working on the JBoss Forge tool (https://docs.jboss.org/author/display/FORGE/Home). For some of its features it uses JDT core tooling to generate or modify Java classes. For example, it may create JPA entities. However, the final format is qui...</description>
		<content:encoded><![CDATA[<div style>Hi folks!</div><div style><br></div><div style>I&#39;m working on the JBoss Forge tool (<a href="https://docs.jboss.org/author/display/FORGE/Home" target="_blank" style="color:rgb(17,85,204)">https://docs.jboss.org/author/display/FORGE/Home</a>). For some of its features it uses JDT core tooling to generate or modify Java classes. For example, it may create JPA entities. However, the final format is quite weird:</div>
<div style><br></div><div style><div>package com.example.test;</div><div><br></div><div>import javax.persistence.Entity;public @Entity class Employee {}</div></div><div style><br></div><div style>I would expect something like that:</div>
<div style><br></div><div style><div>package com.example.test;</div><div><br></div><div>import javax.persistence.Entity;</div><div><br></div><div>@Entity</div><div>public class Employee {}</div></div><div style><br></div>
<div style>You noticed how in the generated input the import, the annotation and the class declaration are on a single line? And @Entity is placed between the public and class words?</div><div style><br></div><div style>I have attached here a sample class, which demonstrates how we use the JDT parser API. Could you please tell me what I am doing wrong? And is it possible to have more beautiful formatting?</div>
<div style><br></div><div style>Thanks and regards,</div><div style>Ivan</div>
<p><strong>Attachment:
<a href="binXvbgCHkOrf.bin" ><tt>JdtFormatterTest.java</tt></a></strong><br>
<em>Description:</em> Binary data</p>
]]></content:encoded>
		<pubDate>Mon, 26 Mar 2012 22:26:09 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02184.html</guid>
		<author>ivan.st.ivanov@xxxxxxx (Ivan St. Ivanov)</author>
	</item>


	<item>
		<title>Re: [jdt-core-dev] Weird usage of Java Generics compiles correctly with JDT (and code runs) but does not compile with Oracle's compiler</title>
		<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02183.html</link>
		<description> </description>
		<content:encoded><![CDATA[<pre style="margin: 0em;">Hi Srikanth</pre><br>
<tt>Thanks for the quick reply and sorry for posting at the wrong place.<br>
For your info, I posted the same question on the OpenJDK mailing list 
and they answered as follows:</tt><br>
<br>
<tt>-----------<br>
These failures are caused by the fact that JDK 6 compiler doesn't 
implement type-inference correctly. A lot of effort has been put into 
JDK 7 compiler in order to get rid of all these problems (your program 
compiles fine in JDK 7). However, some of those inference improvements 
require source incompatible changes, which is why we cannot backport 
these fixes in the JDK 6 release.<br>
-----------</tt><br>
<br>
<pre style="margin: 0em;">Kind Regards
Danilo</pre><br>
<tt>On 02/21/2012 01:50 PM, Srikanth S Adayapalam wrote:
</tt><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;">[Please use newgroups/forums for discussions of this kind, the current list
is
for jdt developers]</pre><br>
<pre style="margin: 0em;">The code you have posted compiles fine with javac7.  I didn't analyze it
closely
but it would appear the oracle compiler behavior at JDK6 time was incorrect
and
this got fixed in JDK7.</pre><br>
<pre style="margin: 0em;">Srikanth.</pre><br>
<pre style="margin: 0em;">_______________________________________________
jdt-core-dev mailing list
jdt-core-dev@xxxxxxxxxxx
<a  href="https://dev.eclipse.org/mailman/listinfo/jdt-core-dev">https://dev.eclipse.org/mailman/listinfo/jdt-core-dev</a>
</pre></blockquote><pre style="margin: 0em;"><br></pre><br>
]]></content:encoded>
		<pubDate>Tue, 21 Feb 2012 13:51:23 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02183.html</guid>
		<author>danilo.tommasina@xxxxxxx (Danilo Tommasina)</author>
	</item>
	<item>
		<title>Re: [jdt-core-dev] Weird usage of Java Generics compiles correctly with JDT (and code runs) but does not compile with Oracle's compiler</title>
		<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02182.html</link>
		<description> The code you have posted compiles fine with javac7. I didn't analyze it closely but it would appear the oracle compiler behavior at JDK6 time was incorrect and this got fixed in JDK7. Srikanth. </description>
		<content:encoded><![CDATA[<pre>[Please use newgroups/forums for discussions of this kind, the current list
is
for jdt developers]

The code you have posted compiles fine with javac7.  I didn't analyze it
closely
but it would appear the oracle compiler behavior at JDK6 time was incorrect
and
this got fixed in JDK7.

Srikanth.


</pre>]]></content:encoded>
		<pubDate>Tue, 21 Feb 2012 12:51:14 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02182.html</guid>
		<author>srikanth_sankaran@xxxxxxx (Srikanth S Adayapalam)</author>
	</item>
	<item>
		<title>[jdt-core-dev] Weird usage of Java Generics compiles correctly with JDT (and code runs) but does not compile with Oracle's compiler</title>
		<link>http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02181.html</link>
		<description> Hello please look at the following code. public class MyWeirdClass {     public void entryPoint() {         doSomethingWeird();     }     @SuppressWarnings( "unchecked" )     private &amp;lt;T extends A &amp;amp; B&amp;gt; T getMyClass() {         if ( System.currentTimeMillis...</description>
		<content:encoded><![CDATA[<table width="100%"><tr><td bgcolor="#FFFFFF" style="background-color: #FFFFFF; color: #000000; "><font color="#000000">
  
  
    <pre class="lang-java prettyprint"><code><span class="kwd">Hello please look at the following code.

public</span><span class="pln"> </span><span class="kwd">class</span><span class="pln"> </span><span class="typ">MyWeirdClass</span><span class="pln"> </span><span class="pun">{</span><span class="pln">

&nbsp; &nbsp; </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> entryPoint</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; doSomethingWeird</span><span class="pun">();</span><span class="pln">
&nbsp; &nbsp; </span><span class="pun">}</span><span class="pln">

&nbsp; &nbsp; </span><span class="lit">@SuppressWarnings</span><span class="pun">(</span><span class="pln"> </span><span class="str">"unchecked"</span><span class="pln"> </span><span class="pun">)</span><span class="pln">
&nbsp; &nbsp; </span><span class="kwd">private</span><span class="pln"> </span><span class="pun">&lt;</span><span class="pln">T </span><span class="kwd">extends</span><span class="pln"> A </span><span class="pun">&amp;</span><span class="pln"> B</span><span class="pun">&gt;</span><span class="pln"> T getMyClass</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln"> </span><span class="typ">System</span><span class="pun">.</span><span class="pln">currentTimeMillis</span><span class="pun">()</span><span class="pln"> </span><span class="pun">%</span><span class="pln"> </span><span class="lit">2</span><span class="pln"> </span><span class="pun">==</span><span class="pln"> </span><span class="lit">0</span><span class="pln"> </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="kwd">return</span><span class="pln"> </span><span class="pun">(</span><span class="pln">T</span><span class="pun">)</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">MyClass_1</span><span class="pun">();</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="kwd">return</span><span class="pln"> </span><span class="pun">(</span><span class="pln">T</span><span class="pun">)</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">MyClass_2</span><span class="pun">();</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">}</span><span class="pln">
&nbsp; &nbsp; </span><span class="pun">}</span><span class="pln">

&nbsp; &nbsp; </span><span class="kwd">private</span><span class="pln"> </span><span class="pun">&lt;</span><span class="pln">T </span><span class="kwd">extends</span><span class="pln"> A </span><span class="pun">&amp;</span><span class="pln"> B</span><span class="pun">&gt;</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> doSomethingWeird</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; T obj </span><span class="pun">=</span><span class="pln"> getMyClass</span><span class="pun">();</span><span class="pln">

&nbsp; &nbsp; &nbsp; &nbsp; obj</span><span class="pun">.</span><span class="pln">methodFromA</span><span class="pun">();</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; obj</span><span class="pun">.</span><span class="pln">methodFromB</span><span class="pun">();</span><span class="pln">
&nbsp; &nbsp; </span><span class="pun">}</span><span class="pln">

&nbsp; &nbsp; </span><span class="kwd">static</span><span class="pln"> interface A </span><span class="pun">{</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="kwd">void</span><span class="pln"> methodFromA</span><span class="pun">();</span><span class="pln">
&nbsp; &nbsp; </span><span class="pun">}</span><span class="pln">

&nbsp; &nbsp; </span><span class="kwd">static</span><span class="pln"> interface B </span><span class="pun">{</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="kwd">void</span><span class="pln"> methodFromB</span><span class="pun">();</span><span class="pln">
&nbsp; &nbsp; </span><span class="pun">}</span><span class="pln">

&nbsp; &nbsp; </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">class</span><span class="pln"> </span><span class="typ">MyClass_1</span><span class="pln"> </span><span class="kwd">implements</span><span class="pln"> A</span><span class="pun">,</span><span class="pln"> B </span><span class="pun">{</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> methodFromA</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{};</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> methodFromB</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{};</span><span class="pln">
&nbsp; &nbsp; </span><span class="pun">}</span><span class="pln">

&nbsp; &nbsp; </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">class</span><span class="pln"> </span><span class="typ">MyClass_2</span><span class="pln"> </span><span class="kwd">implements</span><span class="pln"> A</span><span class="pun">,</span><span class="pln"> B </span><span class="pun">{</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> methodFromA</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{};</span><span class="pln">
&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> methodFromB</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{};</span><span class="pln">
&nbsp; &nbsp; </span><span class="pun">}</span><span class="pln">
</span><span class="pun">}


This code compiles correctly using the JDT compiler, however generates errors using the Oracle's JDK (Java 6) compiler.
The problem is that the method </span></code><code><span class="pln">entryPoint</span><span class="pun">()</span></code> calls <code><span class="pln">method doSomethingWeird</span><span class="pun">()</span><span class="pln"></span></code> which will try to infer a type that cannot be uniquely identified resp. in this case does not even physically exist.
(I know it may be possible to define an interface AB extends A,B but this is not the question ;) )
&nbsp;
My question is: Is this case defined in the JSL, resp. will you continue allowing it in the future?
Thanks in advance for any comment.

Kind Regards
Danilo Tommasina
</pre>
  

</font></td></tr></table>]]></content:encoded>
		<pubDate>Tue, 21 Feb 2012 12:38:59 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02181.html</guid>
		<author>danilo.tommasina@xxxxxxx (Danilo Tommasina)</author>
	</item>

 
	</channel>
	</rss>
<!-- MHonArc v2.6.10 -->

