[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strange difference display for unchanged source code
From: |
SF Markus Elfring |
Subject: |
Re: strange difference display for unchanged source code |
Date: |
Fri, 23 Oct 2009 18:55:46 +0200 |
> The attachment got stripped out somewhere along the way.
I repeat it in this message partly.
Index: uis/org/pf/text/StringUtil.java
===================================================================
RCS file: /cvsroot/azureus/uis/org/pf/text/StringUtil.java,v
retrieving revision 1.1
diff -u -r1.1 StringUtil.java
--- uis/org/pf/text/StringUtil.java 12 Mar 2004 19:00:19 -0000 1.1
+++ uis/org/pf/text/StringUtil.java 22 Oct 2009 20:22:41 -0000
@@ -107,29 +107,27 @@
*/
public String replaceAll( String sourceStr, String oldSubStr, String
newSubStr )
{
- String part = null ;
- String result = "" ;
+ String part = sourceStr ;
+ StringBuilder result = new StringBuilder() ;
int index = -1 ;
- int subLen = 0 ;
+ int subLen = oldSubStr.length() ;
- subLen = oldSubStr.length() ;
- part = sourceStr ;
while ( ( part.length() > 0 ) && ( subLen > 0 ) )
{
index = part.indexOf( oldSubStr ) ;
if ( index >= 0 )
{
- result = result + part.substring( 0, index ) + newSubStr ;
+ result.append(part.substring(0, index)).append(newSubStr) ;
part = part.substring( index + subLen ) ;
}
else
{
- result = result + part ;
+ result.append(part) ;
part = "" ;
}
} // while
- return result ;
+ return result.toString() ;
} // replaceAll()
// -------------------------------------------------------------------------
@@ -559,7 +557,7 @@
* @param strings The array from which to remove the strings
* @param removeStrings The strings to be removed
*/
- public String[] remove( String[] strings, String[] removeStrings )
+ public String[] remove( String[] strings, String[] removeStrings )
{
if ( ( strings == null ) || ( removeStrings == null )
|| ( strings.length == 0 ) || (
removeStrings.length == 0 ) )
@@ -1132,9 +1130,9 @@
result.put( nameValue[0], nameValue[1] ) ;
}
- return result ;
- } // asMap()
-
+ return result ;
+ } // asMap()
+
//
-------------------------------------------------------------------------
/**
> As far as CVS is concerned, *all* changes are "relevant". If CVS says
> there's a change, then there's a change.
I have got my doubts. I would be interested to know if edits by other
developers in other software environments will also trigger update indications
for untouched parts of this source file.
http://fisheye1.atlassian.com/browse/azureus/uis/org/pf/text/StringUtil.java#r1.1
I am curious about how I can make the details of the "uninteresting" changes
more visible like in the last two hunks for example. Have you got any similar
experiences?
Regards,
Markus