DERBY-6945: Move the client and tool messages into separate package spaces so that Derby can be booted using a module path; commit derby-6945-30-ab-move-clientmessages-toolsmessages.diff.

git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1830459 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/build.xml b/build.xml
index 9f57e00..fa5b220 100644
--- a/build.xml
+++ b/build.xml
@@ -1793,8 +1793,8 @@
 	 filesonly="true">
       <fileset dir="${out.locales.dir}"
 	       includes="org/apache/derby/info/*_${locale.iname}/info.properties,
-	                 org/apache/derby/loc/*_${locale.iname}.properties"
-           excludes="org/apache/derby/loc/clientmessages_${locale.iname}.properties"
+	                 org/apache/derby/loc/**/*_${locale.iname}.properties"
+           excludes="org/apache/derby/loc/**/clientmessages_${locale.iname}.properties"
       />
       <fileset dir="${derby.jar.dir}/lists"
                includes="META-INF/LICENSE,META-INF/NOTICE"/>
diff --git a/java/client/org/apache/derby/client/am/SqlException.java b/java/client/org/apache/derby/client/am/SqlException.java
index 62aae19..c36c79f 100644
--- a/java/client/org/apache/derby/client/am/SqlException.java
+++ b/java/client/org/apache/derby/client/am/SqlException.java
@@ -118,7 +118,7 @@
      */
     public static MessageUtil getMessageUtil() {
         if ( msgutil_ == null ) {
-            msgutil_ = new MessageUtil(CLIENT_MESSAGE_RESOURCE_NAME);
+            msgutil_ = new MessageUtil(MessageUtil.CLIENT_MESSAGE_RESOURCE_NAME);
         }
         
         return msgutil_;
diff --git a/java/client/org/apache/derby/client/net/NetStatementReply.java b/java/client/org/apache/derby/client/net/NetStatementReply.java
index cb4cf00..98da4dd 100644
--- a/java/client/org/apache/derby/client/net/NetStatementReply.java
+++ b/java/client/org/apache/derby/client/net/NetStatementReply.java
@@ -1089,7 +1089,7 @@
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
             new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED),
             MessageUtil.getCompleteMessage(MessageId.CONN_DRDA_QRYOPEN,
-                SqlException.CLIENT_MESSAGE_RESOURCE_NAME,
+                MessageUtil.CLIENT_MESSAGE_RESOURCE_NAME,
                 (Object [])null)));
     }
 
diff --git a/java/shared/org/apache/derby/shared/common/i18n/MessageUtil.java b/java/shared/org/apache/derby/shared/common/i18n/MessageUtil.java
index 8f1604f..4c44939 100644
--- a/java/shared/org/apache/derby/shared/common/i18n/MessageUtil.java
+++ b/java/shared/org/apache/derby/shared/common/i18n/MessageUtil.java
@@ -32,6 +32,8 @@
 public class MessageUtil
 {    
     public static final Locale US = new Locale("en", "US");
+
+    public static final String CLIENT_MESSAGE_RESOURCE_NAME = "org.apache.derby.loc.client.clientmessages";
             
     /** 
      *  The name of the resource bundle we are using to load
diff --git a/java/tools/build.xml b/java/tools/build.xml
index 16b2533..99c0f7d 100644
--- a/java/tools/build.xml
+++ b/java/tools/build.xml
@@ -86,7 +86,7 @@
       </fileset>
     </copy>
 
-    <copy todir="${loc.locales.dir}" flatten="true">
+    <copy todir="${loc.locales.dir}/tools" flatten="true">
       <fileset dir="${derby.tools.locales.dir}">
         <include name="sysinfoMessages_*.properties"/>
         <include name="toolsmessages_*.properties"/>
diff --git a/java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java b/java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java
index 53ea99c..43e1f33 100644
--- a/java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java
+++ b/java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java
@@ -45,7 +45,8 @@
 	private ResourceBundle res;
 	private Locale locale;
 	private String encode;
-	private final static String MESSAGE_FILE = "org.apache.derby.loc.toolsmessages";
+	public final static String MESSAGE_FILE = "org.apache.derby.loc.tools.toolsmessages";
+	public final static String SYSINFO_MESSAGE_FILE = "org.apache.derby.loc.tools.sysinfoMessages";
     public final static String ENV_CODESET = "derby.ui.codeset";
     public final static String ENV_LOCALE = "derby.ui.locale";
 	private String messageFileName;
diff --git a/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java b/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java
index 8ccce53..1806668 100644
--- a/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java
+++ b/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java
@@ -90,12 +90,6 @@
 public final class Main {
 
     /**
-     * Name of file which contains messages for sysinfo.
-     */
-    private final static String MESSAGE_FILE =
-        "org.apache.derby.loc.sysinfoMessages";
-
-    /**
      * Resource for localizing the sysinfo messages.
      *
      * The default LocalizedResource reads messages from the toolsmessages
@@ -108,7 +102,7 @@
      * <code>main()</code>.
      */
     private final static LocalizedResource LOCALIZED_RESOURCE =
-        new LocalizedResource(MESSAGE_FILE);
+        new LocalizedResource(LocalizedResource.SYSINFO_MESSAGE_FILE);
 
   /**
     Application entry point for SysInfo.   This will print out
diff --git a/java/tools/org/apache/derby/jdbc/BasicClientConnectionPoolDataSource40.java b/java/tools/org/apache/derby/jdbc/BasicClientConnectionPoolDataSource40.java
index e369eed..da5937c 100644
--- a/java/tools/org/apache/derby/jdbc/BasicClientConnectionPoolDataSource40.java
+++ b/java/tools/org/apache/derby/jdbc/BasicClientConnectionPoolDataSource40.java
@@ -49,7 +49,7 @@
 
     /** Message utility used to obtain localized messages. */
     private static final MessageUtil msgUtil =
-            new MessageUtil("org.apache.derby.loc.clientmessages");
+            new MessageUtil(MessageUtil.CLIENT_MESSAGE_RESOURCE_NAME);
 
     public static final String className__ =
             "org.apache.derby.jdbc.BasicClientConnectionPoolDataSource40";
diff --git a/java/tools/org/apache/derby/jdbc/ClientConnectionPoolDataSource.java b/java/tools/org/apache/derby/jdbc/ClientConnectionPoolDataSource.java
index ac7079b..5746bc0 100644
--- a/java/tools/org/apache/derby/jdbc/ClientConnectionPoolDataSource.java
+++ b/java/tools/org/apache/derby/jdbc/ClientConnectionPoolDataSource.java
@@ -44,7 +44,7 @@
     private static final long serialVersionUID = -539234282156481377L;
     /** Message utility used to obtain localized messages. */
     private static final MessageUtil msgUtil =
-            new MessageUtil("org.apache.derby.loc.clientmessages");
+            new MessageUtil(MessageUtil.CLIENT_MESSAGE_RESOURCE_NAME);
     public static final String className__ = "org.apache.derby.jdbc.ClientConnectionPoolDataSource";
 
     /**
diff --git a/tools/ant/properties/dirs.properties b/tools/ant/properties/dirs.properties
index 90264f5..e987302 100644
--- a/tools/ant/properties/dirs.properties
+++ b/tools/ant/properties/dirs.properties
@@ -66,9 +66,9 @@
 metadata.out.dir=${out.engine.dir}/org/apache/derby/impl/jdbc
 
 loc.engine.dir=${out.engine.dir}/org/apache/derby/loc
-loc.client.dir=${out.client.dir}/org/apache/derby/loc
+loc.client.dir=${out.client.dir}/org/apache/derby/loc/client
 loc.locales.dir=${out.locales.dir}/org/apache/derby/loc
-loc.tools.dir=${out.tools.dir}/org/apache/derby/loc
+loc.tools.dir=${out.tools.dir}/org/apache/derby/loc/tools
 
 
 out.felix.dir=${out.stubs.dir}/felix