From 0c9ce8cd2164e864aa18d52fa7ec83119e67e265 Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Thu, 10 May 2007 22:35:27 +0000 Subject: [PATCH] exclusivity git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@537023 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/filters/StripLineComments.java | 3 +++ src/tests/antunit/filters/striplinecomments-test.xml | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/main/org/apache/tools/ant/filters/StripLineComments.java b/src/main/org/apache/tools/ant/filters/StripLineComments.java index 84ac8904f..54888496d 100644 --- a/src/main/org/apache/tools/ant/filters/StripLineComments.java +++ b/src/main/org/apache/tools/ant/filters/StripLineComments.java @@ -208,6 +208,9 @@ public final class StripLineComments * Must not be null. */ public final void setValue(String comment) { + if (value != null) { + throw new IllegalStateException("Comment value already set."); + } value = comment; } diff --git a/src/tests/antunit/filters/striplinecomments-test.xml b/src/tests/antunit/filters/striplinecomments-test.xml index a1cafee6f..3bc518f00 100644 --- a/src/tests/antunit/filters/striplinecomments-test.xml +++ b/src/tests/antunit/filters/striplinecomments-test.xml @@ -55,4 +55,14 @@ REMark + + + + + #" + + + + +