Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Eclipse - quick fix automation  (Read 1804 times)
0 Members and 1 Guest are viewing this topic.
Offline ryanm

Senior Member


Projects: 1
Exp: 15 years


Used to be bleb


« Posted 2005-10-29 11:21:36 »

Hello there

Is there any way to automate the application of quick fixes in Eclipse?

The reason I ask: I added the javax.vecmath source code to one of my projects, and it's simply dripping with things that I've set Eclipse to nag me about
  • Unnecessary casts
  • Unused variables
  • Unused methods
  • Malformed / missing javadoc

These are all (apart from the javadoc) things that are fixed automatically by quick-fixes, so I gamely started clicking on each warning icon and applying the appropriate fix. I endured this for about 30 minutes and the number of reported warnings was still at 100, so I gave up, dismayed.
I've since changed the compiler settings for that project to be more permissive and reclaimed my pristine errors/warnings list, but I still know that the problems are lurking there, mocking me.

On the subject of vecmath: What's the deal with the method names?
For Vectors:
a.sub( b ) means a = a - b, as expected
a.sub( b, c ) means a = b - c. Almost identical syntax, significantly different semantics Angry
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #1 - Posted 2005-10-30 22:37:54 »

On the subject of vecmath: What's the deal with the method names?
For Vectors:
a.sub( b ) means a = a - b, as expected
a.sub( b, c ) means a = b - c. Almost identical syntax, significantly different semantics Angry

Seems like the second sub() would usually be a static method and be used like a = VecMath.sub(b,c);  but that wouldn't be as efficient since it would ether create a new object, or to reuse 'a', be written VecMath.sub(a,b,c).  So the existing method seems like a reasonable thing to do.

Offline ryanm

Senior Member


Projects: 1
Exp: 15 years


Used to be bleb


« Reply #2 - Posted 2005-10-31 11:56:34 »

Sure, I don't have a problem with the operation, I just think that it should be called setToSubtraction() or something.
As it is now, anyone quickly reading through code is going to have entirely the wrong impression about what happens, unless they have full knowledge of the VecMath API.
Which is bad.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tom
« Reply #3 - Posted 2005-10-31 20:30:32 »

I don't see the problem with overloading sub. They do the same thing, and I find the code readable. How badly can you misenterprit the code.

Offline Anon666

Junior Member




aka Abuse/AbU5e/TehJumpingJawa


« Reply #4 - Posted 2005-10-31 20:55:55 »

I'd much prefer
1  
VecMath.sub(b,c,a)
, where a is the Vector to place the result.

Its explicit, efficient, and a commonly used practice throughout the java apis.
Offline ryanm

Senior Member


Projects: 1
Exp: 15 years


Used to be bleb


« Reply #5 - Posted 2005-10-31 21:10:45 »

I don't see the problem with overloading sub. They do the same thing, and I find the code readable. How badly can you misenterprit the code.

But they don't do the same thing. If i see a method called sub() being called on a vector, the most obvious assumption about what is happening is that one of the arguments will be subtracted from it.
In this case, that's wrong.
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #6 - Posted 2005-11-02 00:30:31 »

Another assumption might be that it will simply modify the state of that vector, and that would be correct.  Ultimately I think it comes down to personal preference.

The VecMath.sub(b,c,a) is perhaps less clear about which vector would be modified?  At least to me.  I would have to check if it is the first or third argument that is the destination.  But I do recognize that there is a precedent set in the JRE for using the last argument as a destination.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (45 views)
2014-09-23 14:38:19

radar3301 (28 views)
2014-09-21 23:33:17

BurntPizza (63 views)
2014-09-21 02:42:18

BurntPizza (33 views)
2014-09-21 01:30:30

moogie (41 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!