Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5311

NamedVariablePatternMatcher throws an IllegalArgumentException when named variable is not the last part of the sequence

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.1.1, 6.1.2
    • 6.2.0
    • Core

    Description

      This following snippet works as expected on Struts 6.0.3, but fails on 6.1.x.
       

      import org.junit.Test;
      
      import com.opensymphony.xwork2.util.NamedVariablePatternMatcher;
      
      public class NamedVariablePatternMatcherTest {
      
          @Test
          public void test() {
              new NamedVariablePatternMatcher().compilePattern("/{first}/two/{third}");
              new NamedVariablePatternMatcher().compilePattern("/first/two/{third}");
              new NamedVariablePatternMatcher().compilePattern("/first/{two}/{third}");
              new NamedVariablePatternMatcher().compilePattern("/{first}/{two}/third"); // java.lang.IllegalArgumentException: Missing openning '{' in [/ {first}/{two}/third]!         
              new NamedVariablePatternMatcher().compilePattern("/{first}/two"); //java.lang.IllegalArgumentException: Missing openning '{' in [/{first}
      /two]!     }
      } 

       

       
       
       
       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vanackda David Vanacker
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: