Index: java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
===================================================================
--- java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java	(revision 321172)
+++ java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java	(working copy)
@@ -285,8 +285,8 @@
 	// constructor
 	public NetworkServerControlImpl() throws Exception
 	{
+		init();
 		getPropertyInfo();
-		init();
     }
 
 
@@ -299,12 +299,12 @@
 	 */
 	public NetworkServerControlImpl(InetAddress address, int portNumber) throws Exception
 	{
+		init();
 		getPropertyInfo();
 		this.hostAddress = address;
 		this.portNumber = (portNumber <= 0) ?
 			this.portNumber: portNumber;
 		this.hostArg = address.getHostAddress();
-		init();
 	}
 
     private void init() throws Exception
@@ -2448,29 +2448,51 @@
 															  "true"))  
 			setTraceAll(true);
 
-		setTraceDirectory(PropertyUtil.getSystemProperty( 
-			Property.DRDA_PROP_TRACEDIRECTORY));
+		//If the derby.system.home property has been set, it is the default. 
+		//Otherwise, the default is the current directory. 
+		//If derby.system.home is not set, directory will be null and trace files will get
+		//created in current directory.
+		propval = PropertyUtil.getSystemProperty(Property.DRDA_PROP_TRACEDIRECTORY,directory);
+		if(propval != null){
+			if(propval.equals(""))
+				propval = directory;
+			setTraceDirectory(propval);
+		}
 
+		//DERBY-375 If a system property is specified without any value, getProperty returns 
+		//an empty string. Use default values in such cases.
 		propval = PropertyUtil.getSystemProperty( 
 			Property.DRDA_PROP_MINTHREADS);
-		if (propval != null)
+		if (propval != null){
+			if(propval.equals(""))
+				propval = "0";
 			setMinThreads(getIntPropVal(Property.DRDA_PROP_MINTHREADS, propval));
+		}
 
 		propval = PropertyUtil.getSystemProperty( 
 			Property.DRDA_PROP_MAXTHREADS);
-		if (propval != null)
+		if (propval != null){
+			if(propval.equals(""))
+				propval = "0";
 			setMaxThreads(getIntPropVal(Property.DRDA_PROP_MAXTHREADS, propval));
+		}
 
 
 		propval = PropertyUtil.getSystemProperty( 
 			Property.DRDA_PROP_TIMESLICE);
-		if (propval != null)
+		if (propval != null){
+			if(propval.equals(""))
+				propval = "0";
 			setTimeSlice(getIntPropVal(Property.DRDA_PROP_TIMESLICE, propval));
+		}
 
 		propval = PropertyUtil.getSystemProperty( 
 			Property.DRDA_PROP_PORTNUMBER);
-		if (propval != null)
+		if (propval != null){
+			if(propval.equals(""))
+				propval = String.valueOf(NetworkServerControl.DEFAULT_PORTNUMBER);
 			portNumber = getIntPropVal(Property.DRDA_PROP_PORTNUMBER, propval);
+		}
 
 		propval = PropertyUtil.getSystemProperty( 
 			Property.DRDA_PROP_KEEPALIVE);
@@ -2480,9 +2502,12 @@
 		
 		propval = PropertyUtil.getSystemProperty( 
 			Property.DRDA_PROP_HOSTNAME);
-		if (propval != null)
-			hostArg = propval;
-
+		if (propval != null){
+			if(propval.equals(""))
+				hostArg = DEFAULT_HOST; 
+			else
+				hostArg = propval;
+		}	
 		propval = PropertyUtil.getSystemProperty(
 						 NetworkServerControlImpl.DRDA_PROP_DEBUG);
 		if (propval != null  && StringUtil.SQLEqualsIgnoreCase(propval, "true"))
@@ -3214,6 +3239,11 @@
 		retval.put(Property.DRDA_PROP_TIMESLICE, new  Integer(getTimeSlice()).toString());
 		retval.put(Property.DRDA_PROP_LOGCONNECTIONS, new Boolean(getLogConnections()).toString());
 		String startDRDA = PropertyUtil.getSystemProperty(Property.START_DRDA);
+		//DERBY-375 If a system property is specified without any value, getProperty returns 
+		//an empty string. Use default values in such cases.
+		if(startDRDA!=null && startDRDA.equals(""))
+			startDRDA = "false";
+		
 		retval.put(Property.START_DRDA, (startDRDA == null)? "false" : startDRDA);
 
 		//get the trace value for each session if tracing for all is not set
Index: java/drda/org/apache/derby/drda/NetworkServerControl.java
===================================================================
--- java/drda/org/apache/derby/drda/NetworkServerControl.java	(revision 321172)
+++ java/drda/org/apache/derby/drda/NetworkServerControl.java	(working copy)
@@ -86,7 +86,8 @@
 	This changes where new trace files will be placed. 
 	For sessions with tracing already turned on,  
 	trace files remain in the previous location. 
-	Default is clousdcape.system.home</LI>
+	Default is derby.system.home, if it is set. 
+	Otherwise the default is the current directory.</LI>
 
 	</UL>
 	<P>Properties can be set in the derby.properties file or on the command line.
Index: java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_sed.properties
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_sed.properties	(revision 321172)
+++ java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_sed.properties	(working copy)
@@ -1 +1 @@
-delete=Version,version,Java,OS,[0-9*].[0-9*].[0-9*],JRE - JDBC
+delete=Version,version,Java,OS,[0-9*].[0-9*].[0-9*],JRE - JDBC,traceDirectory
Index: java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties_sed.properties
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties_sed.properties	(revision 0)
+++ java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties_sed.properties	(revision 0)
@@ -0,0 +1,9 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substituten
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+delete=traceDirectory
\ No newline at end of file

Property changes on: java\testing\org\apache\derbyTesting\functionTests\tests\derbynet\getCurrentProperties_sed.properties
___________________________________________________________________
Name: svn:eol-style
   + native

Index: java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties.java
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties.java	(revision 321172)
+++ java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties.java	(working copy)
@@ -42,6 +42,9 @@
 	   default
 
 	   The command line should take precedence
+
+	It also tests start server by specifying system properties without values.
+	In this case the server will use default values.
 */
 
 public class testProperties
@@ -52,6 +55,21 @@
 	private static Vector vCmd;
     private static  BufferedOutputStream bos = null;
 
+    //Command to start server specifying system properties without values
+    private static String[] startServerCmd =
+					new String[] {  "-Dderby.drda.logConnections",
+    								"-Dderby.drda.traceAll",
+									"-Dderby.drda.traceDirectory",
+									"-Dderby.drda.keepAlive",
+									"-Dderby.drda.timeSlice",
+									"-Dderby.drda.host",
+									"-Dderby.drda.portNumber",
+									"-Dderby.drda.minThreads",
+									"-Dderby.drda.maxThreads",
+									"-Dderby.drda.startNetworkServer",
+									"-Dderby.drda.debug",
+									"org.apache.derby.drda.NetworkServerControl",
+									"start"};
 
 	/**
 	 * Execute the given command and dump the results to standard out
@@ -160,6 +178,14 @@
         }
 	}
 
+	private static void listProperties(String portString) throws Exception{
+		int port = Integer.parseInt(portString);
+		NetworkServerControl derbyServer = new NetworkServerControl( InetAddress.getByName("localhost"),
+													port);
+		Properties p = derbyServer.getCurrentProperties();
+		p.list(System.out);
+	}
+
 	public static void main (String args[]) throws Exception
 	{
 		if ((System.getProperty("java.vm.name") != null) && System.getProperty("java.vm.name").equals("J9"))
@@ -204,6 +230,22 @@
 			System.out.println("Successfully Connected");
 			//shutdown - with command line option
 			derbyServerCmd("shutdown","1530");
+
+			/**********************************************************************
+			 *  Test start server specifying system properties without values
+			 *********************************************************************/
+			System.out.println("Testing start server by specifying system properties without values");
+			System.out.println("First shutdown server started on default port by the test harness");
+
+			//Shutdown the server started by test
+			derbyServerCmd("shutdown","1527");
+			execCmd(startServerCmd);
+			waitForStart("1527",15000);
+			//check that default properties are used
+			listProperties("1527");
+			System.out.println("Successfully Connected");
+			derbyServerCmd("shutdown","1527");
+
 			System.out.println("End test");
 			bos.close();
 		}
Index: java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant	(revision 321172)
+++ java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant	(working copy)
@@ -7,6 +7,7 @@
 dataSourcePermissions_net_sed.properties
 default_app.properties
 default_derby.properties
+getCurrentProperties_sed.properties
 runtimeinfo_sed.properties
 sysinfo_sed.properties
 testij.sql
Index: java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out	(revision 321172)
+++ java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out	(working copy)
@@ -14,4 +14,22 @@
 Successfully Connected
 org.apache.derby.drda.NetworkServerControl shutdown -p 1530 
 Shutdown successful.
+Testing start server by specifying system properties without values
+First shutdown server started on default port by the test harness
+org.apache.derby.drda.NetworkServerControl shutdown -p 1527 
+Shutdown successful.
+-Dderby.drda.logConnections -Dderby.drda.traceAll -Dderby.drda.traceDirectory -Dderby.drda.keepAlive -Dderby.drda.timeSlice -Dderby.drda.host -Dderby.drda.portNumber -Dderby.drda.minThreads -Dderby.drda.maxThreads -Dderby.drda.startNetworkServer -Dderby.drda.debug org.apache.derby.drda.NetworkServerControl start 
+-- listing properties --
+derby.drda.maxThreads=0
+derby.drda.keepAlive=true
+derby.drda.minThreads=0
+derby.drda.portNumber=1527
+derby.drda.logConnections=false
+derby.drda.timeSlice=0
+derby.drda.startNetworkServer=false
+derby.drda.host=localhost
+derby.drda.traceAll=false
+Successfully Connected
+org.apache.derby.drda.NetworkServerControl shutdown -p 1527 
+Shutdown successful.
 End test
