Fix most unchecked/deprecation javac warnings in compiler modules
This commit is contained in:
@@ -28,13 +28,13 @@ abstract class AbstractNode extends HasMetadata implements JsNode {
|
||||
return out.toString();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected <T extends HasMetadata & JsNode> T withMetadataFrom(T other) {
|
||||
this.copyMetadataFrom(other);
|
||||
Object otherSource = other.getSource();
|
||||
if (otherSource != null) {
|
||||
source(otherSource);
|
||||
}
|
||||
//noinspection unchecked
|
||||
return (T) this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +100,7 @@ public class JsFor extends SourceInfoAwareJsNode implements JsLoop {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void traverse(JsVisitorWithContext v, JsContext ctx) {
|
||||
if (v.visit(this, ctx)) {
|
||||
assert (!(initExpression != null && initVars != null));
|
||||
|
||||
@@ -48,10 +48,10 @@ public abstract class JsVisitorWithContext {
|
||||
doAcceptList(collection);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public final <T extends JsStatement> T acceptStatement(T statement) {
|
||||
if (statement == null) return null;
|
||||
|
||||
//noinspection unchecked
|
||||
return (T) doAcceptStatement(statement);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,6 @@ package org.jetbrains.kotlin.js.util;
|
||||
import com.intellij.util.SmartList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.js.backend.ast.JsBinaryOperation;
|
||||
import org.jetbrains.kotlin.js.backend.ast.JsBinaryOperator;
|
||||
import org.jetbrains.kotlin.js.backend.ast.JsExpression;
|
||||
import org.jetbrains.kotlin.js.backend.ast.JsNode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -20,10 +17,10 @@ public final class AstUtil {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T extends JsNode> T deepCopy(@Nullable T node) {
|
||||
if (node == null) return null;
|
||||
|
||||
//noinspection unchecked
|
||||
return (T) node.deepCopy();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user