From 978ba57237bbc1a9c7d2f7ce65eb81e47ee0eadd Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sat, 26 Feb 2022 13:50:36 +0100 Subject: [PATCH] =?UTF-8?q?-=20HelloRule.java=20:=20Ajout=20retour=20?= =?UTF-8?q?=C3=A0=20la=20ligne=20-=20ProtocolReader.java=20:=20patch=20ajo?= =?UTF-8?q?ut=20des=20group=20dans=20le=20tableau=20donn=C3=A9=20=C3=A0=20?= =?UTF-8?q?la=20r=C3=A8gle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/lightcontainer/protocol/ProtocolReader.java | 4 ++-- .../main/java/lightcontainer/protocol/rules/HelloRule.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/lightcontainer/protocol/ProtocolReader.java b/app/src/main/java/lightcontainer/protocol/ProtocolReader.java index 472dc0a..1d45c83 100644 --- a/app/src/main/java/lightcontainer/protocol/ProtocolReader.java +++ b/app/src/main/java/lightcontainer/protocol/ProtocolReader.java @@ -21,8 +21,8 @@ public abstract class ProtocolReader { if (ruleMatcher.matches()) { String[] groups = new String[ruleMatcher.groupCount()]; - for (int i= 0; i < groups.length; ++i) - groups[i] = ruleMatcher.group(i); + for (int i = 1; i <= groups.length; ++i) + groups[i - 1] = ruleMatcher.group(i); onExecuted(groups); return true; diff --git a/app/src/main/java/lightcontainer/protocol/rules/HelloRule.java b/app/src/main/java/lightcontainer/protocol/rules/HelloRule.java index 529f8f7..f4b6c8a 100644 --- a/app/src/main/java/lightcontainer/protocol/rules/HelloRule.java +++ b/app/src/main/java/lightcontainer/protocol/rules/HelloRule.java @@ -15,7 +15,7 @@ public class HelloRule extends ProtocolReader { String domain = data[0]; 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); } }