str.equals("") replaced by str.isEmpty()

This commit is contained in:
Sergey Ignatov
2011-11-22 13:49:48 +04:00
parent ddcf8d06a3
commit 8a74f4fc3e
3 changed files with 3 additions and 3 deletions
@@ -58,7 +58,7 @@ public class ExpressionVisitor extends StatementVisitor {
if (tokenType == JavaTokenType.OREQ) secondOp = "or";
if (tokenType == JavaTokenType.GTGTGTEQ) secondOp = "cyclicShiftRight";
if (!secondOp.equals("")) // if not Kotlin operators
if (!secondOp.isEmpty()) // if not Kotlin operators
myResult = new AssignmentExpression(
expressionToExpression(expression.getLExpression()),
new BinaryExpression(
@@ -47,7 +47,7 @@ public class TypeVisitor extends PsiTypeVisitor<Type> {
@Override
public Type visitClassType(PsiClassType classType) {
String classTypeName = createQualifiedName(classType);
if (classTypeName.equals(""))
if (classTypeName.isEmpty())
classTypeName = getClassTypeName(classType);
List<Type> resolvedClassTypeParams = createRawTypesForResolvedReference(classType);
@@ -47,7 +47,7 @@ public class JavaToKotlinConverterTest extends LightDaemonAnalyzerTestCase {
else if (javaFile.getParent().endsWith("/class")) actual = fileToKotlin(javaCode);
else if (javaFile.getParent().endsWith("/file")) actual = fileToKotlin(javaCode);
assert !actual.equals("") : "Specify what is it: file, class, method, statement or expression";
assert !actual.isEmpty() : "Specify what is it: file, class, method, statement or expression";
final File tmp = new File(kotlinPath + ".tmp");
if (!expected.equals(actual)) writeStringToFile(tmp, actual);