[289256] JSPTranslator should wrap JSP expressions with parentheses
[289659] Misbehaviour of Disabling "Automatically publish when starting servers"
[289638] StructuredTextEditor validates file buffer changes to documents
diff --git a/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html b/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html
index d2950f8..5b12f3a 100644
--- a/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html
+++ b/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html
@@ -20,4 +20,5 @@
 <p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=210702'>210702</a>. Closing the Servers project should refresh the Servers view</p>
 <p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=218636'>218636</a>. Performance problem remains, in Server -> Add/ Remove Projects</p>
 <p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=274644'>274644</a>. JARs deployed wrongly within EAR</p>
+<p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=289659'>289659</a>. Misbehaviour of Disabling "Automatically publish when starting servers"</p>
 </body></html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.server_core.feature.patch/feature.properties b/features/org.eclipse.wst.server_core.feature.patch/feature.properties
index c2cb270..8ccdffe 100644
--- a/features/org.eclipse.wst.server_core.feature.patch/feature.properties
+++ b/features/org.eclipse.wst.server_core.feature.patch/feature.properties
@@ -37,6 +37,7 @@
 Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=210702 Closing the Servers project should refresh the Servers view\n\
 Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=218636 Performance problem remains, in Server -> Add/ Remove Projects\n\
 Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=274644 JARs deployed wrongly within EAR\n\
+Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=289659 Misbehaviour of Disabling "Automatically publish when starting servers"\n\
 \n\
 # "copyright" property - text of the "Feature Update Copyright"
 copyright=\
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishServerJob.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishServerJob.java
index 7e9c643..909bab1 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishServerJob.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishServerJob.java
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -135,8 +135,20 @@
 			// don't run if we're autopublishing and there is no need for a publish.
 			// can't execute this code in shouldRun() because it will cancel the job
 			// instead of returning immediately
-			if (!ServerPreferences.getInstance().isAutoPublishing() || !((Server)getServer()).shouldPublish())
-				return Status.OK_STATUS;
+
+			// This was introduced because the option ServerPreferences.getInstance().isAutoPublishing(),
+			// should affect only "Publishing when the server starts" and not any other cases
+			if (ServerPreferences.getInstance().isPublishImmediately()){
+				// #ref1 (for further details please refer to the text with ref#1)
+				if (!((Server)getServer()).shouldPublish()){
+					return Status.OK_STATUS;
+				}
+			}
+			else{
+				// If any changes are done to the below if, the same changes need to apply to the if in #ref1
+				if (!ServerPreferences.getInstance().isAutoPublishing() || !((Server)getServer()).shouldPublish())
+					return Status.OK_STATUS;
+			}
 		}
 		
 		return getServer().publish(kind, monitor);
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferences.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferences.java
index ba8e1e1..a019a36 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferences.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferences.java
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -316,4 +316,12 @@
 		if (save)
 			ServerPlugin.getInstance().savePluginPreferences();
 	}
+
+	/**
+	 * Gets the 'publishImmediately' System Property. If it is defined returns true, otherwise false
+	 * @return boolean
+	 */
+	public boolean isPublishImmediately() {
+		return Boolean.getBoolean("publishImmediately");
+	}
 }
\ No newline at end of file