Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How are implicit casts handled in JDT?
How are implicit casts handled in JDT? [message #249565] Wed, 14 November 2007 05:20 Go to next message
Rahul Mishra is currently offline Rahul MishraFriend
Messages: 19
Registered: July 2009
Junior Member
Hi folks,

"How are implicit casts handled in JDT?"
Any description? Any document which describes this?

Regards,
Rahul Mishra
Re: How are implicit casts handled in JDT? [message #249580 is a reply to message #249565] Wed, 14 November 2007 16:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Rahul Mishra" <rahulk.mishra@tcs.com> wrote in message
news:8a07854507f40e8bf4c9f409d21e4bba$1@www.eclipse.org...
> Hi folks,
>
> "How are implicit casts handled in JDT?" Any description? Any document
> which describes this?


Implicit casts are handled according to the Java Language Specification, as
published by Sun.

If that's not the answer you were looking for, can you be more specific in
your question? What exactly do you mean by "handled in JDT"?
Re: How are implicit casts handled in JDT? [message #249589 is a reply to message #249580] Thu, 15 November 2007 05:35 Go to previous messageGo to next message
Rahul Mishra is currently offline Rahul MishraFriend
Messages: 19
Registered: July 2009
Junior Member
>>Hi folks,
>>
>> "How are implicit casts handled in JDT?" Any description? Any document
>>which describes this?
>
>Implicit casts are handled according to the Java Language Specification, as
>published by Sun.

>If that's not the answer you were looking for, can you be more specific in
>your question? What exactly do you mean by "handled in JDT"?

To be more specific, Are there any specific files/classes/routines in JDT
that take care of the implicit casts? For example,
byte b = 10;
int i = b; /* implicit cast from byte to int */

In the second statement an implicit cast is being done. So, my query is:
which files/classes/routines make this conversion from byte to int?
Re: How are implicit casts handled in JDT? [message #249893 is a reply to message #249589] Fri, 30 November 2007 12:00 Go to previous messageGo to next message
Philippe Mulet is currently offline Philippe MuletFriend
Messages: 229
Registered: July 2009
Senior Member
Rahul Mishra wrote:
>>> Hi folks,
>>>
>>> "How are implicit casts handled in JDT?" Any description? Any
>>> document which describes this?
>>
>> Implicit casts are handled according to the Java Language
>> Specification, as published by Sun.
>
>> If that's not the answer you were looking for, can you be more
>> specific in your question? What exactly do you mean by "handled in JDT"?
>
> To be more specific, Are there any specific files/classes/routines in
> JDT that take care of the implicit casts? For example,
> byte b = 10;
> int i = b; /* implicit cast from byte to int */
>
> In the second statement an implicit cast is being done. So, my query
> is: which files/classes/routines make this conversion from byte to int?

Have a look at compiler internals:

org.eclipse.jdt.internal.compiler.ast.Expression#computeConv ersion(Scope,
TypeBinding, TypeBinding)

(method is overriden in various places)
Re: How are implicit casts handled in JDT? [message #249896 is a reply to message #249893] Fri, 30 November 2007 13:42 Go to previous message
Rahul Mishra is currently offline Rahul MishraFriend
Messages: 19
Registered: July 2009
Junior Member
Indeed, I had come across it. But isnt these conversions done in the
org.eclipse.jdt.dom?

Regards,
Rahul Mishra
Previous Topic:Is there way not to compile erroneous *.java files
Next Topic:Attaching comments to programatically generated AST
Goto Forum:
  


Current Time: Tue Mar 19 05:12:42 GMT 2024

Powered by FUDForum. Page generated in 0.02629 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top