Bug 16186 - [PATCH] Fixes Translate task where not all tokens were found
Summary: [PATCH] Fixes Translate task where not all tokens were found
Status: RESOLVED DUPLICATE of bug 17297
Alias: None
Product: Ant
Classification: Unclassified
Component: Optional Tasks (show other bugs)
Version: nightly
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-16 23:11 UTC by Don Brown
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Don Brown 2003-01-16 23:11:50 UTC
This patch fixes the case where not all tokens are found.  Previously, the
code searched for the next token from where the last one was found.  This
is not necessary and in fact problematic as the line it is searching has
already had the previous token replaced so the contents have been changed.
Starting the search from the beginning of the line is the desired
behavior.

This was originally submitted to the ant-dev list before I knew of the existence
of this patch list.

? Translate.diff
Index: Translate.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java,v
retrieving revision 1.19
diff -r1.19 Translate.java
516c516
<                                 startIndex = line.indexOf(startToken, endIndex
+ etLength);
---
>                                 startIndex = line.indexOf(startToken);
Comment 1 Antoine Levy-Lambert 2003-07-26 17:28:04 UTC
There has been a similar bug report which is fixed in CVS since June 30, 2003
Try to download a nightly build to see if your case is fixed.
Cheers,
Antoine

*** This bug has been marked as a duplicate of 17297 ***