Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1 substitution of split method would allow for windows mobile

closed-fixed
nobody
None
5
2013-03-03
2011-09-09
Andrea Antonello
No

By substitution of the split method (of String) support for windows mobile through the open source phoneme JVM would be allowed and therefore CDC/Foundation Profile.

The only occurrency I was able to find was in: com.vividsolutions.jts.io.gml2.GeometryStrategies
where I substituted:
int dim = touples[0].split(coordSeperator).length;
with
int dim = Utilities.split(touples[0], coordSeperator).length;

with Utilities.split method:

/**
* Method to substitute the java SE String.split method.
*
* @param string the string to split.
* @param separator the separator to use.
* @return the array of split strings.
*/
public static String[] split( String string, String separator ) {
int separatorlen = separator.length();
ArrayList tokensList = new ArrayList();
String tmpString = "" + string;
int pos = tmpString.indexOf(separator);
while( pos >= 0 ) {
String token = tmpString.substring(0, pos);
tokensList.add(token);
tmpString = tmpString.substring(pos + separatorlen);
pos = tmpString.indexOf(separator);
}
if (tmpString.length() > 0)
tokensList.add(tmpString);
String[] res = new String[tokensList.size()];
for( int i = 0; i < res.length; i++ ) {
res[i] = (String) tokensList.get(i);
}
return res;
}

Discussion

  • Dr JTS
    Dr JTS
    2013-03-03

    • status: open --> closed-fixed