Author: jkeyes
Date: Tue Sep 6 18:44:25 2005
New Revision: 279205
URL: http://svn.apache.org/viewcvs?rev=279205&view=rev
Log:
- minor code tidy
Modified:
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/Command.java
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/DefaultOption.java
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/ParentImpl.java
Modified:
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/Command.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/Command.java?rev=279205&r1=279204&r2=279205&view=diff
==============================================================================
---
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/Command.java
(original)
+++
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/Command.java
Tue Sep 6 18:44:25 2005
@@ -86,12 +86,9 @@
this.preferredName = preferredName;
// gracefully and defensively handle aliases
- if (aliases == null) {
- this.aliases = Collections.EMPTY_SET;
- }
- else {
- this.aliases = Collections.unmodifiableSet(new HashSet(aliases));
- }
+ this.aliases = (aliases == null)
+ ? Collections.EMPTY_SET
+ : Collections.unmodifiableSet(new HashSet(aliases));
// populate the triggers Set
final Set newTriggers = new HashSet();
Modified:
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/DefaultOption.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/DefaultOption.java?rev=279205&r1=279204&r2=279205&view=diff
==============================================================================
---
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/DefaultOption.java
(original)
+++
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/DefaultOption.java
Tue Sep 6 18:44:25 2005
@@ -98,20 +98,13 @@
this.burstLength = shortPrefix.length() + 1;
this.preferredName = preferredName;
- if (aliases == null) {
- this.aliases = Collections.EMPTY_SET;
- }
- else {
- this.aliases = Collections.unmodifiableSet(new HashSet(aliases));
- }
+ this.aliases = (aliases == null)
+ ? Collections.EMPTY_SET
+ : Collections.unmodifiableSet(new HashSet(aliases));
- if (burstAliases == null) {
- this.burstAliases = Collections.EMPTY_SET;
- }
- else {
- this.burstAliases =
- Collections.unmodifiableSet(new HashSet(burstAliases));
- }
+ this.burstAliases = (burstAliases == null)
+ ? Collections.EMPTY_SET
+ : Collections.unmodifiableSet(new HashSet(burstAliases));
final Set newTriggers = new HashSet();
newTriggers.add(preferredName);
Modified:
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/ParentImpl.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/ParentImpl.java?rev=279205&r1=279204&r2=279205&view=diff
==============================================================================
---
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/ParentImpl.java
(original)
+++
jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/option/ParentImpl.java
Tue Sep 6 18:44:25 2005
@@ -114,12 +114,9 @@
* @see org.apache.commons.cli2.Option#prefixes()
*/
public Set getPrefixes() {
- if (children == null) {
- return Collections.EMPTY_SET;
- }
- else {
- return children.getPrefixes();
- }
+ return (children == null)
+ ? Collections.EMPTY_SET
+ : children.getPrefixes();
}
/*
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]