Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates-src > by-pkgid > 0ff1c9ee87d965c2a2327fbc26944964 > files > 21

springframework-3.2.15-1.mga5.src.rpm

diff -Nru spring-framework-3.2.14.RELEASE/build.gradle spring-framework-3.2.14.RELEASE.jopt-simple/build.gradle
--- spring-framework-3.2.14.RELEASE/build.gradle	2015-06-30 19:36:07.000000000 +0200
+++ spring-framework-3.2.14.RELEASE.jopt-simple/build.gradle	2015-07-03 13:18:15.951750946 +0200
@@ -242,7 +242,7 @@
 		compile(files(asmRepackJar))
 		compile("commons-logging:commons-logging:1.1.3")
 		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
-		optional("net.sf.jopt-simple:jopt-simple:3.3")
+		optional("net.sf.jopt-simple:jopt-simple:4.6")
 		optional("log4j:log4j:1.2.17")
 		testCompile("xmlunit:xmlunit:1.3")
 		testCompile("org.codehaus.woodstox:wstx-asl:3.2.7") {
diff -Nru spring-framework-3.2.14.RELEASE/spring-core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java spring-framework-3.2.14.RELEASE.jopt-simple/spring-core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java
--- spring-framework-3.2.14.RELEASE/spring-core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java	2015-06-30 19:36:07.000000000 +0200
+++ spring-framework-3.2.14.RELEASE.jopt-simple/spring-core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java	2015-07-03 13:28:05.299917137 +0200
@@ -21,6 +21,7 @@
 import java.util.List;
 
 import joptsimple.OptionSet;
+import joptsimple.OptionSpec;
 
 import org.springframework.util.Assert;
 
@@ -43,10 +44,11 @@
  *
  * See {@link CommandLinePropertySource} for complete general usage examples.
  *
- * <p>Requires JOpt version 3.0 or higher. Tested against JOpt up until 4.6.
+ * <p>Requires JOpt version 4.3 or higher. Tested against JOpt up until 4.6.
  *
  * @author Chris Beams
  * @author Juergen Hoeller
+ * @author Dave Syer
  * @since 3.1
  * @see CommandLinePropertySource
  * @see joptsimple.OptionParser
@@ -78,6 +80,18 @@
 		return this.source.has(name);
 	}
 
+	public String[] getPropertyNames() {
+		List<String> names = new ArrayList<String>();
+		for (OptionSpec<?> spec : this.source.specs()) {
+			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));
+			}
+		}
+		return names.toArray(new String[names.size()]);
+	}
+
 	@Override
 	public List<String> getOptionValues(String name) {
 		List<?> argValues = this.source.valuesOf(name);