mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Convert generic types api to kotlin [2/2]
This commit is contained in:
+5
-5
@@ -52,7 +52,7 @@ public class JavaChainTransformerImpl implements ChainTransformer.Java {
|
||||
final PsiType qualifierType = qualifierExpression == null ? null : qualifierExpression.getType();
|
||||
final GenericType typeAfterQualifier = qualifierType == null
|
||||
? getGenericTypeOfThis(qualifierExpression)
|
||||
: GenericTypeUtil.fromStreamPsiType(qualifierType);
|
||||
: GenericTypeUtil.INSTANCE.fromStreamPsiType(qualifierType);
|
||||
final QualifierExpressionImpl qualifier =
|
||||
qualifierExpression == null
|
||||
? new QualifierExpressionImpl("", TextRange.EMPTY_RANGE, typeAfterQualifier)
|
||||
@@ -71,8 +71,8 @@ public class JavaChainTransformerImpl implements ChainTransformer.Java {
|
||||
private GenericType getGenericTypeOfThis(PsiExpression expression) {
|
||||
final PsiClass klass = ClassUtils.getContainingClass(expression);
|
||||
|
||||
return klass == null ? GenericType.OBJECT
|
||||
: GenericTypeUtil.fromPsiClass(klass);
|
||||
return klass == null ? GenericType.Companion.getOBJECT()
|
||||
: GenericTypeUtil.INSTANCE.fromPsiClass(klass);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -141,11 +141,11 @@ public class JavaChainTransformerImpl implements ChainTransformer.Java {
|
||||
|
||||
@NotNull
|
||||
private static GenericType resolveType(@NotNull PsiMethodCallExpression call) {
|
||||
return GenericTypeUtil.fromStreamPsiType(extractType(call));
|
||||
return GenericTypeUtil.INSTANCE.fromStreamPsiType(extractType(call));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static GenericType resolveTerminationCallType(@NotNull PsiMethodCallExpression call) {
|
||||
return GenericTypeUtil.fromPsiType(extractType(call));
|
||||
return GenericTypeUtil.INSTANCE.fromPsiType(extractType(call));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@ public class TraceExpressionBuilderImpl implements TraceExpressionBuilder {
|
||||
final String resultExpression;
|
||||
final String additionalDeclarations;
|
||||
final String additionalEvaluation;
|
||||
if (resultType.equals(GenericType.VOID)) {
|
||||
if (resultType.equals(GenericType.Companion.getVOID())) {
|
||||
additionalDeclarations = "";
|
||||
additionalEvaluation = chain.getText() + ";" + LINE_SEPARATOR;
|
||||
resultExpression = "new Object[1]";
|
||||
|
||||
+5
-6
@@ -18,13 +18,10 @@ package com.intellij.debugger.streams.trace.impl.handler;
|
||||
import com.intellij.debugger.streams.trace.dsl.CodeBlock;
|
||||
import com.intellij.debugger.streams.trace.dsl.Expression;
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.TextExpression;
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.java.JavaCodeBlock;
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.java.JavaStatementFactory;
|
||||
import com.intellij.debugger.streams.trace.impl.TraceExpressionBuilderImpl;
|
||||
import com.intellij.debugger.streams.trace.impl.handler.type.ClassTypeImpl;
|
||||
import com.intellij.debugger.streams.trace.impl.handler.type.GenericType;
|
||||
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall;
|
||||
import one.util.streamex.StreamEx;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -50,9 +47,11 @@ public class DistinctHandler extends HandlerBase.Intermediate {
|
||||
final String variablePrefix = "distinct" + callNumber;
|
||||
final String storeMapType = String.format("java.util.Map<java.lang.Integer, %s>", myBeforeType.getGenericTypeName());
|
||||
myStoreMapVariable =
|
||||
new HashMapVariableImpl(variablePrefix + "Store", GenericType.OBJECT, new ClassTypeImpl(storeMapType), false);
|
||||
myResolveMapVariable = new HashMapVariableImpl(variablePrefix + "Resolve", GenericType.INT, GenericType.INT, false);
|
||||
myReverseUtilMapVariable = new HashMapVariableImpl(variablePrefix + "ReverseUtil", GenericType.INT, GenericType.INT, false);
|
||||
new HashMapVariableImpl(variablePrefix + "Store", GenericType.Companion.getOBJECT(), new ClassTypeImpl(storeMapType), false);
|
||||
myResolveMapVariable = new HashMapVariableImpl(variablePrefix + "Resolve", GenericType.Companion.getINT(),
|
||||
GenericType.Companion.getINT(), false);
|
||||
myReverseUtilMapVariable = new HashMapVariableImpl(variablePrefix + "ReverseUtil", GenericType.Companion.getINT(),
|
||||
GenericType.Companion.getINT(), false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public class OptionalTerminatorHandler implements TerminatorCallHandler {
|
||||
|
||||
public OptionalTerminatorHandler(@NotNull TerminatorStreamCall call, @NotNull String resultExpression) {
|
||||
myTerminatorHandler = new TerminatorHandler(call.getTypeBefore());
|
||||
myOptionalType = GenericTypeUtil.unwrapOptional(call.getResultType());
|
||||
myOptionalType = GenericTypeUtil.INSTANCE.unwrapOptional(call.getResultType());
|
||||
myResultExpression = resultExpression;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -46,8 +46,8 @@ public class PeekTracerHandler extends HandlerBase.Intermediate {
|
||||
myTypeAfter = typeAfter;
|
||||
|
||||
final String variablePrefix = String.format("%sPeek%d", name, num);
|
||||
myBeforeVariable = new HashMapVariableImpl(variablePrefix + "before", GenericType.INT, typeBefore, true);
|
||||
myAfterVariable = new HashMapVariableImpl(variablePrefix + "after", GenericType.INT, typeAfter, true);
|
||||
myBeforeVariable = new HashMapVariableImpl(variablePrefix + "before", GenericType.Companion.getINT(), typeBefore, true);
|
||||
myAfterVariable = new HashMapVariableImpl(variablePrefix + "after", GenericType.Companion.getINT(), typeAfter, true);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public class TerminatorHandler extends HandlerBase.Terminator {
|
||||
private final PeekTracerHandler myPeekTracerHandler;
|
||||
|
||||
public TerminatorHandler(@NotNull GenericType beforeType) {
|
||||
myPeekTracerHandler = new PeekTracerHandler(Integer.MAX_VALUE, "terminator", beforeType, GenericType.OBJECT);
|
||||
myPeekTracerHandler = new PeekTracerHandler(Integer.MAX_VALUE, "terminator", beforeType, GenericType.Companion.getOBJECT());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+24
-20
@@ -13,33 +13,37 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.debugger.streams.trace.impl.handler.type;
|
||||
package com.intellij.debugger.streams.trace.impl.handler.type
|
||||
|
||||
import com.intellij.psi.CommonClassNames;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import com.intellij.psi.CommonClassNames
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
public interface GenericType {
|
||||
@NotNull
|
||||
String getVariableTypeName();
|
||||
interface GenericType {
|
||||
val variableTypeName: String
|
||||
|
||||
@NotNull
|
||||
String getGenericTypeName();
|
||||
val genericTypeName: String
|
||||
|
||||
@NotNull
|
||||
String getDefaultValue();
|
||||
val defaultValue: String
|
||||
|
||||
GenericType BOOLEAN = new GenericTypeImpl("boolean", "java.lang.Boolean", "false");
|
||||
GenericType INT = new GenericTypeImpl("int", "java.lang.Integer", "0");
|
||||
GenericType DOUBLE = new GenericTypeImpl("double", "java.lang.Double", "0.");
|
||||
GenericType LONG = new GenericTypeImpl("long", "java.lang.Long", "0L");
|
||||
GenericType OBJECT = new ClassTypeImpl("java.lang.Object");
|
||||
GenericType VOID = new GenericTypeImpl("void", "java.lang.Void", "null");
|
||||
interface CompositeType : GenericType {
|
||||
val elementType: GenericType
|
||||
}
|
||||
|
||||
GenericType OPTIONAL = new ClassTypeImpl(CommonClassNames.JAVA_UTIL_OPTIONAL);
|
||||
GenericType OPTIONAL_INT = new ClassTypeImpl("java.util.OptionalInt");
|
||||
GenericType OPTIONAL_LONG = new ClassTypeImpl("java.util.OptionalLong");
|
||||
GenericType OPTIONAL_DOUBLE = new ClassTypeImpl("java.util.OptionalDouble");
|
||||
companion object {
|
||||
val BOOLEAN: GenericType = GenericTypeImpl("boolean", "java.lang.Boolean", "false")
|
||||
val INT: GenericType = GenericTypeImpl("int", "java.lang.Integer", "0")
|
||||
val DOUBLE: GenericType = GenericTypeImpl("double", "java.lang.Double", "0.")
|
||||
val LONG: GenericType = GenericTypeImpl("long", "java.lang.Long", "0L")
|
||||
|
||||
val OBJECT: GenericType = ClassTypeImpl("java.lang.Object", "new java.lang.Object()")
|
||||
val VOID: GenericType = GenericTypeImpl("void", "java.lang.Void", "null")
|
||||
val OPTIONAL: GenericType = ClassTypeImpl(CommonClassNames.JAVA_UTIL_OPTIONAL)
|
||||
val OPTIONAL_INT: GenericType = ClassTypeImpl("java.util.OptionalInt")
|
||||
|
||||
val OPTIONAL_LONG: GenericType = ClassTypeImpl("java.util.OptionalLong")
|
||||
|
||||
val OPTIONAL_DOUBLE: GenericType = ClassTypeImpl("java.util.OptionalDouble")
|
||||
}
|
||||
}
|
||||
|
||||
+11
-45
@@ -13,60 +13,26 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.debugger.streams.trace.impl.handler.type;
|
||||
package com.intellij.debugger.streams.trace.impl.handler.type
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Objects
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
public class GenericTypeImpl implements GenericType {
|
||||
private final String myPrimitiveName;
|
||||
private final String myGenericName;
|
||||
private final String myDefaultValue;
|
||||
open class GenericTypeImpl(override val variableTypeName: String,
|
||||
override val genericTypeName: String,
|
||||
override val defaultValue: String) : GenericType {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(myPrimitiveName, myGenericName);
|
||||
override fun hashCode(): Int {
|
||||
return Objects.hash(variableTypeName, genericTypeName)
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (obj instanceof GenericType) {
|
||||
final GenericType type = (GenericType)obj;
|
||||
return myPrimitiveName.equals(type.getVariableTypeName()) && myGenericName.equals(type.getGenericTypeName());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public GenericTypeImpl(@NotNull String primitiveName, @NotNull String genericName, @NotNull String defaultValue) {
|
||||
myPrimitiveName = primitiveName;
|
||||
myGenericName = genericName;
|
||||
myDefaultValue = defaultValue;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getVariableTypeName() {
|
||||
return myPrimitiveName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getGenericTypeName() {
|
||||
return myGenericName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getDefaultValue() {
|
||||
return myDefaultValue;
|
||||
return other is GenericType && variableTypeName == other.variableTypeName && genericTypeName == other.genericTypeName
|
||||
}
|
||||
}
|
||||
|
||||
+40
-53
@@ -13,77 +13,64 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.debugger.streams.trace.impl.handler.type;
|
||||
package com.intellij.debugger.streams.trace.impl.handler.type
|
||||
|
||||
import com.intellij.psi.CommonClassNames;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiType;
|
||||
import com.intellij.psi.util.InheritanceUtil;
|
||||
import com.intellij.psi.util.TypeConversionUtil;
|
||||
import one.util.streamex.StreamEx;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
import com.intellij.psi.CommonClassNames
|
||||
import com.intellij.psi.PsiClass
|
||||
import com.intellij.psi.PsiType
|
||||
import com.intellij.psi.util.InheritanceUtil
|
||||
import com.intellij.psi.util.TypeConversionUtil
|
||||
import one.util.streamex.StreamEx
|
||||
import org.jetbrains.annotations.Contract
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
public class GenericTypeUtil {
|
||||
private static final Set<GenericType> OPTIONAL_TYPES = StreamEx
|
||||
.of(GenericType.OPTIONAL, GenericType.OPTIONAL_INT, GenericType.OPTIONAL_LONG, GenericType.OPTIONAL_DOUBLE)
|
||||
.toSet();
|
||||
object GenericTypeUtil {
|
||||
private val OPTIONAL_TYPES = StreamEx
|
||||
.of(GenericType.OPTIONAL, GenericType.OPTIONAL_INT, GenericType.OPTIONAL_LONG,
|
||||
GenericType.OPTIONAL_DOUBLE)
|
||||
.toSet()
|
||||
|
||||
@NotNull
|
||||
public static GenericType fromStreamPsiType(@NotNull PsiType streamPsiType) {
|
||||
if (InheritanceUtil.isInheritor(streamPsiType, CommonClassNames.JAVA_UTIL_STREAM_INT_STREAM)) return GenericType.INT;
|
||||
if (InheritanceUtil.isInheritor(streamPsiType, CommonClassNames.JAVA_UTIL_STREAM_LONG_STREAM)) return GenericType.LONG;
|
||||
if (InheritanceUtil.isInheritor(streamPsiType, CommonClassNames.JAVA_UTIL_STREAM_DOUBLE_STREAM)) return GenericType.DOUBLE;
|
||||
if (PsiType.VOID.equals(streamPsiType)) return GenericType.VOID;
|
||||
fun fromStreamPsiType(streamPsiType: PsiType): GenericType {
|
||||
if (InheritanceUtil.isInheritor(streamPsiType, CommonClassNames.JAVA_UTIL_STREAM_INT_STREAM)) return GenericType.INT
|
||||
if (InheritanceUtil.isInheritor(streamPsiType, CommonClassNames.JAVA_UTIL_STREAM_LONG_STREAM)) return GenericType.LONG
|
||||
if (InheritanceUtil.isInheritor(streamPsiType, CommonClassNames.JAVA_UTIL_STREAM_DOUBLE_STREAM))
|
||||
return GenericType
|
||||
.DOUBLE
|
||||
return if (PsiType.VOID == streamPsiType) GenericType.VOID else GenericType.OBJECT
|
||||
|
||||
return GenericType.OBJECT;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static GenericType fromPsiClass(@NotNull PsiClass psiClass) {
|
||||
if (InheritanceUtil.isInheritor(psiClass, CommonClassNames.JAVA_UTIL_STREAM_INT_STREAM)) return GenericType.INT;
|
||||
if (InheritanceUtil.isInheritor(psiClass, CommonClassNames.JAVA_UTIL_STREAM_LONG_STREAM)) return GenericType.LONG;
|
||||
if (InheritanceUtil.isInheritor(psiClass, CommonClassNames.JAVA_UTIL_STREAM_DOUBLE_STREAM)) return GenericType.DOUBLE;
|
||||
fun fromPsiClass(psiClass: PsiClass): GenericType {
|
||||
if (InheritanceUtil.isInheritor(psiClass, CommonClassNames.JAVA_UTIL_STREAM_INT_STREAM)) return GenericType.INT
|
||||
if (InheritanceUtil.isInheritor(psiClass, CommonClassNames.JAVA_UTIL_STREAM_LONG_STREAM)) return GenericType.LONG
|
||||
return if (InheritanceUtil.isInheritor(psiClass, CommonClassNames.JAVA_UTIL_STREAM_DOUBLE_STREAM)) GenericType.DOUBLE
|
||||
else GenericType.OBJECT
|
||||
|
||||
return GenericType.OBJECT;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static GenericType fromPsiType(@NotNull PsiType type) {
|
||||
if (PsiType.VOID.equals(type)) return GenericType.VOID;
|
||||
if (PsiType.INT.equals(type)) return GenericType.INT;
|
||||
if (PsiType.DOUBLE.equals(type)) return GenericType.DOUBLE;
|
||||
if (PsiType.LONG.equals(type)) return GenericType.LONG;
|
||||
if (PsiType.BOOLEAN.equals(type)) return GenericType.BOOLEAN;
|
||||
return new ClassTypeImpl(TypeConversionUtil.erasure(type).getCanonicalText());
|
||||
fun fromPsiType(type: PsiType): GenericType {
|
||||
if (PsiType.VOID == type) return GenericType.VOID
|
||||
if (PsiType.INT == type) return GenericType.INT
|
||||
if (PsiType.DOUBLE == type) return GenericType.DOUBLE
|
||||
if (PsiType.LONG == type) return GenericType.LONG
|
||||
return if (PsiType.BOOLEAN == type) GenericType.BOOLEAN else ClassTypeImpl(TypeConversionUtil.erasure(type).canonicalText)
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
private static boolean isOptional(@NotNull GenericType type) {
|
||||
return OPTIONAL_TYPES.contains(type);
|
||||
private fun isOptional(type: GenericType): Boolean {
|
||||
return OPTIONAL_TYPES.contains(type)
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static GenericType unwrapOptional(@NotNull GenericType type) {
|
||||
assert isOptional(type);
|
||||
fun unwrapOptional(type: GenericType): GenericType {
|
||||
assert(isOptional(type))
|
||||
|
||||
if (type.equals(GenericType.OPTIONAL_INT)) {
|
||||
return GenericType.INT;
|
||||
return when (type) {
|
||||
GenericType.OPTIONAL_INT -> GenericType.INT
|
||||
GenericType.OPTIONAL_LONG -> GenericType.LONG
|
||||
GenericType.OPTIONAL_DOUBLE -> GenericType.DOUBLE
|
||||
else -> GenericType.OBJECT
|
||||
}
|
||||
|
||||
if (type.equals(GenericType.OPTIONAL_LONG)) {
|
||||
return GenericType.LONG;
|
||||
}
|
||||
|
||||
if (type.equals(GenericType.OPTIONAL_DOUBLE)) {
|
||||
return GenericType.DOUBLE;
|
||||
}
|
||||
|
||||
return GenericType.OBJECT;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -124,7 +124,7 @@ public class EvaluationAwareTraceWindow extends DialogWrapper {
|
||||
for (int i = 1; i < myTabContents.size(); i++) {
|
||||
if (i == myTabContents.size() - 1 &&
|
||||
(resolvedTrace.exceptionThrown() ||
|
||||
resolvedTrace.getSourceChain().getTerminationCall().getResultType().equals(GenericType.VOID))) {
|
||||
resolvedTrace.getSourceChain().getTerminationCall().getResultType().equals(GenericType.Companion.getVOID()))) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public class EvaluationAwareTraceWindow extends DialogWrapper {
|
||||
myTabsPane.insertTab("Exception", AllIcons.Nodes.ErrorIntroduction, new ExceptionView(context, result), "", 0);
|
||||
myTabsPane.setSelectedIndex(0);
|
||||
}
|
||||
else if (resolvedTrace.getSourceChain().getTerminationCall().getResultType().equals(GenericType.VOID)) {
|
||||
else if (resolvedTrace.getSourceChain().getTerminationCall().getResultType().equals(GenericType.Companion.getVOID())) {
|
||||
resultTab.setContent(new JBLabel("There is no result of such stream chain", SwingConstants.CENTER), BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ public class EvaluationAwareTraceWindow extends DialogWrapper {
|
||||
|
||||
final ResolvedStreamCall.Terminator terminator = chain.getTerminator();
|
||||
final IntermediateState afterTerminationState = terminator.getStateAfter();
|
||||
if (afterTerminationState != null && !terminator.getCall().getResultType().equals(GenericType.VOID)) {
|
||||
if (afterTerminationState != null && !terminator.getCall().getResultType().equals(GenericType.Companion.getVOID())) {
|
||||
|
||||
final TraceControllerImpl terminationController = new TraceControllerImpl(afterTerminationState);
|
||||
|
||||
|
||||
+11
-10
@@ -30,43 +30,44 @@ import static com.intellij.debugger.streams.trace.impl.handler.type.GenericType.
|
||||
*/
|
||||
public class PrimitiveObjectBuilderPositiveTest extends StreamChainBuilderPositiveTestBase {
|
||||
public void testSimpleObject() {
|
||||
doTest(OBJECT);
|
||||
doTest(Companion.getOBJECT());
|
||||
}
|
||||
|
||||
public void testSimpleInt() {
|
||||
doTest(INT);
|
||||
doTest(Companion.getINT());
|
||||
}
|
||||
|
||||
public void testSimpleDouble() {
|
||||
doTest(DOUBLE);
|
||||
doTest(Companion.getDOUBLE());
|
||||
}
|
||||
|
||||
public void testSimpleLong() {
|
||||
doTest(LONG);
|
||||
doTest(Companion.getLONG());
|
||||
}
|
||||
|
||||
public void testObj2Int() {
|
||||
doTest(OBJECT, INT);
|
||||
doTest(Companion.getOBJECT(), Companion.getINT());
|
||||
}
|
||||
|
||||
public void testObj2Long() {
|
||||
doTest(OBJECT, LONG);
|
||||
doTest(Companion.getOBJECT(), Companion.getLONG());
|
||||
}
|
||||
|
||||
public void testObj2Double() {
|
||||
doTest(OBJECT, DOUBLE);
|
||||
doTest(Companion.getOBJECT(), Companion.getDOUBLE());
|
||||
}
|
||||
|
||||
public void testPrimitiveIdentity() {
|
||||
doTest(INT, INT);
|
||||
doTest(Companion.getINT(), Companion.getINT());
|
||||
}
|
||||
|
||||
public void testPrimitive2Obj() {
|
||||
doTest(DOUBLE, OBJECT);
|
||||
doTest(Companion.getDOUBLE(), Companion.getOBJECT());
|
||||
}
|
||||
|
||||
public void testFewTransitions() {
|
||||
doTest(OBJECT, INT, INT, OBJECT, DOUBLE, OBJECT, LONG);
|
||||
doTest(Companion.getOBJECT(), Companion.getINT(), Companion.getINT(), Companion.getOBJECT(), Companion.getDOUBLE(),
|
||||
Companion.getOBJECT(), Companion.getLONG());
|
||||
}
|
||||
|
||||
private void doTest(@NotNull GenericType producerAfterType,
|
||||
|
||||
+5
-5
@@ -28,23 +28,23 @@ import java.util.List;
|
||||
*/
|
||||
public class TerminationCallTypeTest extends StreamChainBuilderPositiveTestBase {
|
||||
public void testVoidType() throws Exception {
|
||||
doTest(GenericType.VOID);
|
||||
doTest(GenericType.Companion.getVOID());
|
||||
}
|
||||
|
||||
public void testBooleanType() throws Exception {
|
||||
doTest(GenericType.BOOLEAN);
|
||||
doTest(GenericType.Companion.getBOOLEAN());
|
||||
}
|
||||
|
||||
public void testIntType() throws Exception {
|
||||
doTest(GenericType.INT);
|
||||
doTest(GenericType.Companion.getINT());
|
||||
}
|
||||
|
||||
public void testDoubleType() throws Exception {
|
||||
doTest(GenericType.DOUBLE);
|
||||
doTest(GenericType.Companion.getDOUBLE());
|
||||
}
|
||||
|
||||
public void testLongType() throws Exception {
|
||||
doTest(GenericType.LONG);
|
||||
doTest(GenericType.Companion.getLONG());
|
||||
}
|
||||
|
||||
public void testReferenceType() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user