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 00:20 Go to next message
Rahul Mishra is currently offline Rahul Mishra
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 11:47 Go to previous messageGo to next message
Eclipse User
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 00:35 Go to previous messageGo to next message
Rahul Mishra is currently offline Rahul Mishra
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 07:00 Go to previous messageGo to next message
Philippe Mulet is currently offline Philippe Mulet
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 08:42 Go to previous message
Rahul Mishra is currently offline Rahul Mishra
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: Fri Aug 22 00:06:29 EDT 2014

Powered by FUDForum. Page generated in 0.01478 seconds