From 0bbdd9f9adf12ad9082a4c49ae1c9a0778b00bb4 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 28 Nov 2012 17:39:12 -0500
Subject: [PATCH] Fixed focus for keystore password prompt

---
 src/com/gitblit/Launcher.java |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/com/gitblit/Launcher.java b/src/com/gitblit/Launcher.java
index da61649..a43331b 100644
--- a/src/com/gitblit/Launcher.java
+++ b/src/com/gitblit/Launcher.java
@@ -25,6 +25,7 @@
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
 import com.gitblit.build.Build;
@@ -74,16 +75,23 @@
 			List<File> found = findJars(libFolder.getAbsoluteFile());
 			jars.addAll(found);
 		}
+		// sort the jars by name and then reverse the order so the newer version
+		// of the library gets loaded in the event that this is an upgrade
+		Collections.sort(jars);
+		Collections.reverse(jars);
 
 		if (jars.size() == 0) {
 			for (String folder : folders) {
 				File libFolder = new File(folder);
-				System.err.println("Failed to find any JARs in " + libFolder.getPath());
+				// this is a test of adding a comment
+				// more really interesting things
+				System.err.println("Failed to find any really cool JARs in " + libFolder.getPath());
 			}
 			System.exit(-1);
 		} else {
 			for (File jar : jars) {
 				try {
+					jar.canRead();
 					addJarFile(jar);
 				} catch (Throwable t) {
 					t.printStackTrace();
@@ -113,6 +121,7 @@
 				}
 			}
 		}
+
 		return jars;
 	}
 

--
Gitblit v1.9.1