Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Auto cast "macro" for method's actual parameters?(Is there a way to automatically cast actual parameters to match the formal parameter types?)
Auto cast "macro" for method's actual parameters? [message #1474724] Sat, 15 November 2014 17:40
tgm 1024 is currently offline tgm 1024Friend
Messages: 8
Registered: November 2014
Junior Member
Does eclipse have an automatic way of casting the actual parameters of a method call to match the types of the formal parameters?

double a;
double b;
double c;
double d;
java.awt.Graphics gc;

// everything set to some value


original line:
gc.drawLine(a, b+2.0, c, d);

desired line:
gc.drawLine((int)a, (int)(b+2.0), (int)c, (int)d);

I understand that it might have to give me a choice if the method is overloaded.

No, synchronized method declarations will not get you out of this newbie multithreading pitfall:
thing.set(thing.get() + 1);

[Updated on: Sat, 15 November 2014 17:41]

Report message to a moderator

Previous Topic:Spell checking is not working
Next Topic:Why does Composite have no actual value?
Goto Forum:

Current Time: Tue Mar 05 10:38:19 GMT 2024

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

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

Back to the top