Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2013-12-26 22:49:31 +0000
committerJoakim Erdfelt2013-12-26 22:49:31 +0000
commit31831476f1ba34ac45c27ea4944de133ee8721c5 (patch)
treeddd08ffcb2bede8c0d066255f3a641af949e1e4f
parentbd86928f1c2cde16916a7ddaeadab79e79f38aa1 (diff)
downloadorg.eclipse.jetty.project-31831476f1ba34ac45c27ea4944de133ee8721c5.tar.gz
org.eclipse.jetty.project-31831476f1ba34ac45c27ea4944de133ee8721c5.tar.xz
org.eclipse.jetty.project-31831476f1ba34ac45c27ea4944de133ee8721c5.zip
Removing ${switch logic from Module in favor of using properties
-rw-r--r--jetty-start/src/main/java/org/eclipse/jetty/start/Module.java47
1 files changed, 6 insertions, 41 deletions
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java
index 2dbcbc242d..bc1359772a 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java
@@ -292,52 +292,12 @@ public class Module
{
try (BufferedReader buf = new BufferedReader(reader))
{
- String line;
String sectionType = "";
- String switchProperty = null;
- String caseTag = null;
- String caseTagColon = null;
- boolean switched = false;
+ String line;
while ((line = buf.readLine()) != null)
{
line = line.trim();
- if (caseTag != null)
- {
- if ("}".equals(line))
- {
- if (!switched)
- {
- StartLog.warn("WARN: No matching case in %s for ${switch %s=%s ...}",basehome.toShortForm(file),switchProperty,caseTag);
- }
- caseTag = null;
- caseTagColon = null;
- switchProperty = null;
- continue;
- }
-
- if (switched)
- {
- continue;
- }
-
- if (!line.startsWith(caseTagColon) && !line.startsWith("*:"))
- {
- continue;
- }
-
- switched = true;
- line = line.substring(line.indexOf(':') + 1).trim();
- }
- else if (line.startsWith("${switch "))
- {
- switched = false;
- switchProperty = line.substring(9).trim();
- caseTag = System.getProperty(switchProperty);
- caseTagColon = caseTag + ":";
- continue;
- }
-
Matcher sectionMatcher = section.matcher(line);
if (sectionMatcher.matches())
@@ -358,6 +318,9 @@ public class Module
{
switch (sectionType)
{
+ case "":
+ // ignore (this would be entries before first section)
+ break;
case "DEPEND":
parentNames.add(line);
break;
@@ -376,6 +339,8 @@ public class Module
case "INI-TEMPLATE":
initialise.add(line);
break;
+ default:
+ throw new IOException("Unrecognized Module section: [" + sectionType + "]");
}
}
}

Back to the top