DEVOPS-6106 Update copyright year to 2019
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2018 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
@@ -8,7 +8,7 @@
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
//
|
||||
// ============================================================================
|
||||
package routines.system;
|
||||
|
||||
@@ -25,9 +25,9 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class StringUtils {
|
||||
|
||||
|
||||
public static final String[] EMPTY_STRING_ARRAY = new String[0];
|
||||
|
||||
|
||||
public static final String EMPTY = "";
|
||||
|
||||
public static String newStringFromSplit(CharsetDecoder decoder, CharsetDecoder utf8Decoder, String encoding,
|
||||
@@ -81,7 +81,7 @@ public class StringUtils {
|
||||
utf8Decoder.onUnmappableCharacter(CodingErrorAction.REPORT);
|
||||
|
||||
ArrayList<String> substrings = new ArrayList<String>();
|
||||
|
||||
|
||||
int lineLength = line.limit();
|
||||
int sepCursor = 0;
|
||||
int fieldCursor = 0;
|
||||
@@ -128,7 +128,7 @@ public class StringUtils {
|
||||
|
||||
/**
|
||||
* replace the method : String.split(String regex)
|
||||
*
|
||||
*
|
||||
* @param str
|
||||
* @param separatorChars
|
||||
* @return
|
||||
@@ -166,18 +166,18 @@ public class StringUtils {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int resultSize = substrings.size();
|
||||
String[] result = substrings.toArray(new String[resultSize]);
|
||||
|
||||
|
||||
while (resultSize > 0 && substrings.get(resultSize - 1).equals("")) {
|
||||
resultSize--;
|
||||
// Setting data to null for empty string in last columns to keep original behavior
|
||||
result[resultSize] = null;
|
||||
}
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* split SQL columns like that :
|
||||
* from :
|
||||
@@ -185,7 +185,7 @@ public class StringUtils {
|
||||
* to
|
||||
* [id] [name] [CONCAT(name,UPPER(address))] [CONCAT(age,name)]
|
||||
*/
|
||||
|
||||
|
||||
public static String[] splitSQLColumns(String sql) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
int blockCount = 0;
|
||||
@@ -197,12 +197,12 @@ public class StringUtils {
|
||||
} else if(c == ')') {
|
||||
blockCount--;
|
||||
}
|
||||
|
||||
|
||||
if((c == ',' && (blockCount<1))) {
|
||||
result.add(sql.substring(start, i));
|
||||
start = i + 1;
|
||||
}
|
||||
|
||||
|
||||
if(i == (sql.length()-1)) {
|
||||
result.add(sql.substring(start));
|
||||
}
|
||||
@@ -290,7 +290,7 @@ public class StringUtils {
|
||||
|
||||
/**
|
||||
* to discuss the case: src == null || regex == null || replacement == null
|
||||
*
|
||||
*
|
||||
*/
|
||||
public static String replaceAll(String src, String regex, String replacement) {
|
||||
|
||||
@@ -326,7 +326,7 @@ public class StringUtils {
|
||||
|
||||
/**
|
||||
* ignore regex
|
||||
*
|
||||
*
|
||||
*/
|
||||
public static String replaceAllStrictly(String src, String search, String replacement, boolean entirelyMatch,
|
||||
boolean caseSensitive) {
|
||||
@@ -361,7 +361,7 @@ public class StringUtils {
|
||||
|
||||
/**
|
||||
* make \n to \\n. It will process these chars: \n, \r, \t, \f, \\, \", \', \b
|
||||
*
|
||||
*
|
||||
*/
|
||||
public static String escapeChar(String s) {
|
||||
if (s == null) {
|
||||
@@ -403,11 +403,11 @@ public class StringUtils {
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* return null value not "null" String when obj is null that is the only difference with String.valueOf(Object obj)
|
||||
*
|
||||
*
|
||||
* @param obj
|
||||
* @return
|
||||
*/
|
||||
@@ -442,5 +442,5 @@ public class StringUtils {
|
||||
public static String valueOf(double d) {
|
||||
return String.valueOf(d);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user