Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336399 - We should correct the types of our Ant task setter methods
Summary: We should correct the types of our Ant task setter methods
Status: NEW
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE API Tools Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-04 16:47 EST by Michael Rennie CLA
Modified: 2023-09-05 02:11 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2011-02-04 16:47:19 EST
Version: 3.7.0
Build id: I20110127-2034

We should make sure the that the type of the parameter reflects what type we are expecting to get in our Ant tasks.

Our Ant tasks pretty much all support the 'debug' attribute, which is a boolean, but in our source we define it like:

public void setDebug(String debugValue) {
   this.debug = Boolean.toString(true).equals(debugValue); 
}

with a string parameter. Ant - org.apache.ant that is - supports boolean here, and we should be using it in this instance. The reason being is that Ant has introspection utilities that allow it to take other values than String, and those other values can allow a variety of options. For example in the boolean case, our code checks for 'true', but Ant (apache) can accept 'yes', 'on' and 'true' to mean true.

So we could change the code to:

public void setDebug(boolean debugValue) {
  this.debug = debugValue;
}

and all existing build files would still work just fine. The other added bonus is that the Eclipse Ant support can propose completions for attributes based on their type - which in our current state are all String.

More information about the types Ant supports and how it translates them can be found here: http://ant.apache.org/manual/develop.html#set-magic
Comment 1 Lars Vogel CLA 2019-09-24 13:58:08 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 2 Eclipse Genie CLA 2021-09-14 03:08:21 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 3 Eclipse Genie CLA 2023-09-05 02:11:04 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.