Author: seanfinan
Date: Tue Sep 13 18:41:47 2022
New Revision: 1904046
URL: http://svn.apache.org/viewvc?rev=1904046&view=rev
Log:
Fix for multiple variable substitution
Modified:
ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/external/SystemUtil.java
Modified:
ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/external/SystemUtil.java
URL:
http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/external/SystemUtil.java?rev=1904046&r1=1904045&r2=1904046&view=diff
==============================================================================
---
ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/external/SystemUtil.java
(original)
+++
ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/external/SystemUtil.java
Tue Sep 13 18:41:47 2022
@@ -42,7 +42,7 @@ final public class SystemUtil {
int previousVarEnd = 0;
int varBegin = command.indexOf( '$', previousVarEnd );
while ( varBegin > -1 ) {
- // copy everything from the command from the end of the previous
variable to the begin of this variable.
+ // copy everything from the command from the end of the previous
variable to the beginning of this variable.
sb.append( command, previousVarEnd, varBegin );
// get the end of the current variable name.
int varEnd = command.indexOf( ' ', varBegin );
@@ -52,7 +52,7 @@ final public class SystemUtil {
// get the value from the uima context.
final Object value = context.getConfigParameterValue( varName );
if ( value == null ) {
- LOGGER.error( "No value for $" + varName + " in known parameter
values." );
+ LOGGER.warn( "No value for $" + varName + " in known parameter
values." );
sb.append( "$" )
.append( varName );
} else {
@@ -62,7 +62,8 @@ final public class SystemUtil {
if ( varEnd == command.length() ) {
break;
}
- previousVarEnd = varEnd + 1;
+ sb.append( ' ' );
+ previousVarEnd = varEnd;
varBegin = command.indexOf( '$', varEnd );
if ( varBegin < 0 ) {
sb.append( command, varEnd, command.length() );