Skip to content

Commit a5d6bee

Browse files
committed
#0000 Generator: Correction of expensive/hungry RegExp
1 parent b08ae30 commit a5d6bee

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
In some cases the request is aborted with status 400 when the network connector is busy,
66
because the worker assumed that no data is being sent.
77
Statuses 408 and 413 may have been overwritten with status 400.
8+
BF: Generator: Correction of expensive/hungry RegExp
89
BF: Manual: Correction for chrome-based browsers
910
CR: Manual: Improvement of the navigation
1011
CR: Project: Automatic update of the version in README.md

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ Go to the program directory and start the program directly or by script.
152152
BF: HTTP(S) AccessLog: Correction in the file name of the log file (use http_host instead of remote_host)
153153
BF: HTTP(S) Content Types: Correction of xml/xsl/xslt to use application/xslt+xml
154154
BF: HTTP(S) Request: Correction of the request validation
155+
BF: Generator: Correction of expensive/hungry RegExp
155156
BF: Manual: Correction for chrome-based browsers
156157
CR: Manual: Improvement of the navigation
157158
CR: Project: Automatic update of the version in README.md

sources/com/seanox/devwex/Generator.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@
128128
* {@link #extract()} entsprechen, sich dabei aber nur auf ein Segment
129129
* konzentrieren.<br>
130130
* <br>
131-
* Generator 5.2.0 20190422<br>
132-
* Copyright (C) 2019 Seanox Software Solutions<br>
131+
* Generator 5.2.1 20200712<br>
132+
* Copyright (C) 2020 Seanox Software Solutions<br>
133133
* Alle Rechte vorbehalten.
134134
*
135135
* @author Seanox Software Solutions
136-
* @version 5.2.0 20190422
136+
* @version 5.2.1 20200712
137137
*/
138138
public class Generator {
139139

@@ -300,7 +300,7 @@ private byte[] scan(byte[] model) {
300300

301301
byte[] patch = new byte[0];
302302
String fetch = new String(model, cursor, offset);
303-
if (fetch.matches("^(?si)#\\[[a-z]([\\w\\-]*\\w)*\\[\\[.*\\]\\]\\]$")) {
303+
if (fetch.matches("^(?si)#\\[[a-z]([\\w\\-]*\\w){0,1}\\[\\[.*\\]\\]\\]$")) {
304304

305305
//der Scope wird ermittelt aus: #[scope[[segment]]]
306306
String scope = fetch.substring(2);
@@ -318,7 +318,7 @@ private byte[] scan(byte[] model) {
318318

319319
//als neuer Platzhalter wird nur der Scope verwendet
320320
patch = ("#[").concat(scope).concat("]").getBytes();
321-
} else if (fetch.matches("^(?i)#\\[[a-z]([\\w-]*\\w)*\\]$")) {
321+
} else if (fetch.matches("^(?i)#\\[[a-z]([\\w-]*\\w){0,1}\\]$")) {
322322
patch = fetch.toLowerCase().getBytes();
323323
} else if (fetch.matches("^(?i)#\\[0x([0-9a-f]{2})+\\]$")) {
324324
cursor += fetch.length() +1;
@@ -401,7 +401,7 @@ private byte[] assemble(String scope, Map values, boolean clean) {
401401

402402
patch = new byte[0];
403403
fetch = new String(this.model, cursor, offset);
404-
if (fetch.matches("^(?i)#\\[[a-z]([\\w-]*\\w)*\\]$")) {
404+
if (fetch.matches("^(?i)#\\[[a-z]([\\w-]*\\w){0,1}\\]$")) {
405405
fetch = fetch.substring(2, fetch.length() -1);
406406

407407
//die Platzhalter nicht uebermittelter Schluessel werden

0 commit comments

Comments
 (0)