You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by db...@apache.org on 2009/08/25 14:46:17 UTC
svn commit: r807587 -
/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
Author: dbaum
Date: Tue Aug 25 12:46:16 2009
New Revision: 807587
URL: http://svn.apache.org/viewvc?rev=807587&view=rev
Log:
stop duplicate error message for bad command. FELIX-1405
Modified:
felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java?rev=807587&r1=807586&r2=807587&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java (original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java Tue Aug 25 12:46:16 2009
@@ -16,9 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-// DWB5: session.err is not redirected when creating pipeline
-// DWB6: add 'set -x' trace feature if echo is set
-// DWB7: removing variable via 'execute("name=") throws OutOfBoundsException
package org.apache.felix.gogo.runtime.shell;
import org.osgi.service.command.CommandSession;
@@ -89,7 +86,7 @@
}
}
- Pipe last = pipes.get(pipes.size() - 1);
+ Pipe last = pipes.remove(pipes.size() - 1);
for (Pipe pipe : pipes)
{
@@ -114,15 +111,12 @@
Object executeStatement(List<CharSequence> statement) throws Exception
{
- // derek: FEATURE: add set -x facility if echo is set
+ // add set -x facility if echo is set
if (Boolean.TRUE.equals(session.get("echo"))) {
- StringBuilder buf = new StringBuilder("+ ");
+ StringBuilder buf = new StringBuilder("+");
for (CharSequence token : statement)
{
- if (buf.length() > 0)
- {
- buf.append(' ');
- }
+ buf.append(' ');
buf.append(token);
}
System.err.println(buf);
@@ -179,8 +173,7 @@
if (values.size() > 0 && "=".equals(values.get(0)))
{
- //if (values.size() == 0)
- if (values.size() == 1) // derek: BUGFIX
+ if (values.size() == 1)
{
return session.variables.remove(scmd);
}
@@ -231,7 +224,7 @@
}
}
- private Object assignment(Object name, Object value)
+ private Object assignment(String name, Object value)
{
session.variables.put(name, value);
return value;