- HelloRule.java : Ajout retour à la ligne

- ProtocolReader.java : patch ajout des group dans le tableau donné à la règle
This commit is contained in:
Benjamin Lejeune 2022-02-26 13:50:36 +01:00
parent d675121034
commit 978ba57237
2 changed files with 3 additions and 3 deletions

View File

@ -21,8 +21,8 @@ public abstract class ProtocolReader {
if (ruleMatcher.matches()) { if (ruleMatcher.matches()) {
String[] groups = new String[ruleMatcher.groupCount()]; String[] groups = new String[ruleMatcher.groupCount()];
for (int i= 0; i < groups.length; ++i) for (int i = 1; i <= groups.length; ++i)
groups[i] = ruleMatcher.group(i); groups[i - 1] = ruleMatcher.group(i);
onExecuted(groups); onExecuted(groups);
return true; return true;

View File

@ -15,7 +15,7 @@ public class HelloRule extends ProtocolReader {
String domain = data[0]; String domain = data[0];
String port = data[1]; String port = data[1];
System.out.printf("Règle Hello avec domain=%s et port=%s", domain, port); System.out.printf("Règle Hello avec domain=%s et port=%s\n", domain, port);
} }
} }