Browse Source

Polish pull request #291 per committer guidelines

- Update Apache license headers
 - Remove trailing whitespace
 - Edit original commit comment to use 'Issue:' syntax
 - Revert use of diamond operator (<>) in main sources

See committer guidelines at
https://github.com/SpringSource/spring-framework/blob/master/CONTRIBUTING.md

Issue: SPR-10579
pull/291/merge
Chris Beams 12 years ago
parent
commit
46d47fef9a
  1. 4
      spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java
  2. 12
      spring-core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java
  3. 4
      spring-core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java
  4. 2
      spring-core/src/test/java/org/springframework/core/env/JOptCommandLinePropertySourceTests.java
  5. 2
      spring-core/src/test/java/org/springframework/core/env/SimpleCommandLinePropertySourceTests.java

4
spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java vendored

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -218,7 +218,7 @@ public abstract class CommandLinePropertySource<T> extends EnumerablePropertySou @@ -218,7 +218,7 @@ public abstract class CommandLinePropertySource<T> extends EnumerablePropertySou
public void setNonOptionArgsPropertyName(String nonOptionArgsPropertyName) {
this.nonOptionArgsPropertyName = nonOptionArgsPropertyName;
}
/**
* Return whether this {@code PropertySource} contains a property with the given name.
* <p>This implementation first checks to see if the name specified is the special

12
spring-core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java vendored

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -77,20 +77,20 @@ public class JOptCommandLinePropertySource extends CommandLinePropertySource<Opt @@ -77,20 +77,20 @@ public class JOptCommandLinePropertySource extends CommandLinePropertySource<Opt
protected boolean containsOption(String name) {
return this.source.has(name);
}
@Override
public String[] getPropertyNames() {
List<String> names = new ArrayList<>();
List<String> names = new ArrayList<String>();
for (OptionSpec<?> spec : source.specs()) {
List<String> aliases = new ArrayList<>(spec.options());
List<String> aliases = new ArrayList<String>(spec.options());
if (!aliases.isEmpty()) {
// Only the longest name is used for enumerating
names.add(aliases.get(aliases.size()-1));
names.add(aliases.get(aliases.size()-1));
}
}
return names.toArray(new String[names.size()]);
}
@Override
public List<String> getOptionValues(String name) {
List<?> argValues = this.source.valuesOf(name);

4
spring-core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java vendored

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -94,7 +94,7 @@ public class SimpleCommandLinePropertySource extends CommandLinePropertySource<C @@ -94,7 +94,7 @@ public class SimpleCommandLinePropertySource extends CommandLinePropertySource<C
public SimpleCommandLinePropertySource(String name, String[] args) {
super(name, new SimpleCommandLineArgsParser().parse(args));
}
/**
* Get the property names for the option arguments.
*/

2
spring-core/src/test/java/org/springframework/core/env/JOptCommandLinePropertySourceTests.java vendored

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
spring-core/src/test/java/org/springframework/core/env/SimpleCommandLinePropertySourceTests.java vendored

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

Loading…
Cancel
Save