[Git][java-team/plexus-interpolation][upstream] New upstream version 1.26
Emmanuel Bourg
gitlab at salsa.debian.org
Sun Jul 7 21:59:05 BST 2019
Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / plexus-interpolation
Commits:
a4b0498b by Emmanuel Bourg at 2019-07-07T20:55:51Z
New upstream version 1.26
- - - - -
4 changed files:
- .travis.yml
- README.md
- pom.xml
- src/main/java/org/codehaus/plexus/interpolation/StringSearchInterpolator.java
Changes:
=====================================
.travis.yml
=====================================
@@ -2,6 +2,7 @@ language: java
jdk:
- openjdk7
- oraclejdk8
+ - openjdk11
script: "mvn --show-version --errors --batch-mode -Prun-its clean verify"
@@ -13,5 +14,4 @@ branches:
- gh-pages
notifications:
email:
- - olamy at apache.org
- kama at soebes.de
=====================================
README.md
=====================================
@@ -2,13 +2,13 @@ Plexus-Interpolation
===============
[![Build Status](https://travis-ci.org/codehaus-plexus/plexus-interpolation.svg?branch=master)](https://travis-ci.org/codehaus-plexus/plexus-interpolation)
-[![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-interpolation.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.codehaus.plexus%22%20a%3A%plexus-interpolation%22)
+[![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-interpolation.svg?label=Maven%20Central)](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.codehaus.plexus%22%20AND%20a%3A%22plexus-interpolation%22)
The current master is now at https://github.com/codehaus-plexus/plexus-interpolation
Components for interpolating `${}` strings and the like.
-For publishing [the site](https://codehaus-plexus.github.io/plexus-io/) do the following:
+For publishing [the site](https://codehaus-plexus.github.io/plexus-interpolation/) do the following:
```
mvn -Preporting verify site-deploy
=====================================
pom.xml
=====================================
@@ -8,16 +8,16 @@
</parent>
<artifactId>plexus-interpolation</artifactId>
- <version>1.25</version>
+ <version>1.26</version>
<packaging>bundle</packaging>
<name>Plexus Interpolation API</name>
<scm>
- <connection>scm:git:git at github.com:codehaus-plexus/plexus-interpolation.git</connection>
- <developerConnection>scm:git:git at github.com:codehaus-plexus/plexus-interpolation.git</developerConnection>
+ <connection>scm:git:https://github.com/codehaus-plexus/plexus-interpolation.git</connection>
+ <developerConnection>scm:git:https://github.com/codehaus-plexus/plexus-interpolation.git</developerConnection>
<url>http://github.com/codehaus-plexus/plexus-interpolation/tree/${project.scm.tag}/</url>
- <tag>plexus-interpolation-1.25</tag>
+ <tag>plexus-interpolation-1.26</tag>
</scm>
<issueManagement>
=====================================
src/main/java/org/codehaus/plexus/interpolation/StringSearchInterpolator.java
=====================================
@@ -138,136 +138,144 @@ public class StringSearchInterpolator
// return empty String to prevent NPE too
return "";
}
- StringBuilder result = new StringBuilder( input.length() * 2 );
int startIdx;
int endIdx = -1;
- while ( ( startIdx = input.indexOf( startExpr, endIdx + 1 ) ) > -1 )
+ if ( ( startIdx = input.indexOf( startExpr, endIdx + 1 ) ) > -1 )
{
- result.append( input, endIdx + 1, startIdx );
-
- endIdx = input.indexOf( endExpr, startIdx + 1 );
- if ( endIdx < 0 )
- {
- break;
- }
-
- final String wholeExpr = input.substring( startIdx, endIdx + endExpr.length() );
- String realExpr = wholeExpr.substring( startExpr.length(), wholeExpr.length() - endExpr.length() );
-
- if ( startIdx >= 0 && escapeString != null && escapeString.length() > 0 )
- {
- int startEscapeIdx = startIdx == 0 ? 0 : startIdx - escapeString.length();
- if ( startEscapeIdx >= 0 )
+ StringBuilder result = new StringBuilder( input.length() * 2 );
+ do
{
- String escape = input.substring( startEscapeIdx, startIdx );
- if ( escapeString.equals( escape ) )
- {
- result.append( wholeExpr );
- result.replace( startEscapeIdx, startEscapeIdx + escapeString.length(), "" );
- continue;
- }
- }
- }
+ result.append( input, endIdx + 1, startIdx );
- boolean resolved = false;
- if ( !unresolvable.contains( wholeExpr ) )
- {
- if ( realExpr.startsWith( "." ) )
+ endIdx = input.indexOf( endExpr, startIdx + 1 );
+ if ( endIdx < 0 )
{
- realExpr = realExpr.substring( 1 );
+ break;
}
- if ( recursionInterceptor.hasRecursiveExpression( realExpr ) )
- {
- throw new InterpolationCycleException( recursionInterceptor, realExpr, wholeExpr );
- }
+ final String wholeExpr = input.substring( startIdx, endIdx + endExpr.length() );
+ String realExpr = wholeExpr.substring( startExpr.length(), wholeExpr.length() - endExpr.length() );
- recursionInterceptor.expressionResolutionStarted( realExpr );
- try
+ if ( startIdx >= 0 && escapeString != null && escapeString.length() > 0 )
{
- Object value = existingAnswers.get( realExpr );
- Object bestAnswer = null;
-
- for ( ValueSource valueSource : valueSources )
+ int startEscapeIdx = startIdx == 0 ? 0 : startIdx - escapeString.length();
+ if ( startEscapeIdx >= 0 )
{
- if ( value != null )
+ String escape = input.substring( startEscapeIdx, startIdx );
+ if ( escapeString.equals( escape ) )
{
- break;
+ result.append(wholeExpr);
+ result.replace(startEscapeIdx, startEscapeIdx + escapeString.length(), "");
+ continue;
}
- value = valueSource.getValue( realExpr );
+ }
+ }
- if ( value != null && value.toString().contains( wholeExpr ) )
- {
- bestAnswer = value;
- value = null;
- }
+ boolean resolved = false;
+ if ( !unresolvable.contains( wholeExpr ) )
+ {
+ if ( realExpr.startsWith( "." ) )
+ {
+ realExpr = realExpr.substring(1);
}
- // this is the simplest recursion check to catch exact recursion
- // (non synonym), and avoid the extra effort of more string
- // searching.
- if ( value == null && bestAnswer != null )
+ if ( recursionInterceptor.hasRecursiveExpression( realExpr ) )
{
throw new InterpolationCycleException( recursionInterceptor, realExpr, wholeExpr );
}
- if ( value != null )
+ recursionInterceptor.expressionResolutionStarted( realExpr );
+ try
{
- value = interpolate( String.valueOf( value ), recursionInterceptor, unresolvable );
+ Object value = existingAnswers.get( realExpr );
+ Object bestAnswer = null;
+
+ for ( ValueSource valueSource : valueSources )
+ {
+ if ( value != null )
+ {
+ break;
+ }
+ value = valueSource.getValue( realExpr );
+
+ if ( value != null && value.toString().contains( wholeExpr ) )
+ {
+ bestAnswer = value;
+ value = null;
+ }
+ }
- if ( postProcessors != null && !postProcessors.isEmpty() )
+ // this is the simplest recursion check to catch exact recursion
+ // (non synonym), and avoid the extra effort of more string
+ // searching.
+ if ( value == null && bestAnswer != null )
{
- for ( InterpolationPostProcessor postProcessor : postProcessors )
+ throw new InterpolationCycleException( recursionInterceptor, realExpr, wholeExpr );
+ }
+
+ if ( value != null )
+ {
+ value = interpolate( String.valueOf(value), recursionInterceptor, unresolvable );
+
+ if ( postProcessors != null && !postProcessors.isEmpty() )
{
- Object newVal = postProcessor.execute( realExpr, value );
- if ( newVal != null )
+ for ( InterpolationPostProcessor postProcessor : postProcessors )
{
- value = newVal;
- break;
+ Object newVal = postProcessor.execute( realExpr, value );
+ if ( newVal != null )
+ {
+ value = newVal;
+ break;
+ }
}
}
- }
- // could use:
- // result = matcher.replaceFirst( stringValue );
- // but this could result in multiple lookups of stringValue, and replaceAll is not correct
- // behaviour
- result.append( String.valueOf( value ) );
- resolved = true;
+ // could use:
+ // result = matcher.replaceFirst( stringValue );
+ // but this could result in multiple lookups of stringValue, and replaceAll is not correct
+ // behaviour
+ result.append( String.valueOf( value ) );
+ resolved = true;
+ }
+ else
+ {
+ unresolvable.add( wholeExpr );
+ }
}
- else
+ finally
{
- unresolvable.add( wholeExpr );
+ recursionInterceptor.expressionResolutionFinished( realExpr );
}
}
- finally
+
+ if (!resolved)
{
- recursionInterceptor.expressionResolutionFinished( realExpr );
+ result.append( wholeExpr );
+ }
+
+ if ( endIdx > -1 )
+ {
+ endIdx += endExpr.length() - 1;
}
}
+ while ( ( startIdx = input.indexOf( startExpr, endIdx + 1 ) ) > -1);
- if ( !resolved )
+ if ( endIdx == -1 && startIdx > -1 )
{
- result.append( wholeExpr );
+ result.append( input, startIdx, input.length());
}
-
- if ( endIdx > -1 )
+ else if ( endIdx < input.length() )
{
- endIdx += endExpr.length() - 1;
+ result.append( input, endIdx + 1, input.length() );
}
- }
- if ( endIdx == -1 && startIdx > -1 )
- {
- result.append( input, startIdx, input.length());
+ return result.toString();
}
- else if ( endIdx < input.length() )
+ else
{
- result.append( input, endIdx + 1, input.length() );
+ return input;
}
-
- return result.toString();
}
/**
View it on GitLab: https://salsa.debian.org/java-team/plexus-interpolation/commit/a4b0498b9e5c06b4e70e9f133caca2c53aa01bbe
--
View it on GitLab: https://salsa.debian.org/java-team/plexus-interpolation/commit/a4b0498b9e5c06b4e70e9f133caca2c53aa01bbe
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20190707/78bee2ba/attachment.html>
More information about the pkg-java-commits
mailing list