From: Hannu Niemistö Date: Tue, 9 Oct 2018 12:15:12 +0000 (+0300) Subject: Deprecated methods in o.s.scl.compiler.Types class for parsing types X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=c542f7304a2c6bd602ab6969a2f9357959d86f24;p=simantics%2Fplatform.git Deprecated methods in o.s.scl.compiler.Types class for parsing types Change-Id: I7df83c111edb0267c59585cf0d5c544d0c985dbf --- diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java index e1b89eece..8817eb23c 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java @@ -7,6 +7,7 @@ import java.util.Collections; import java.util.List; import org.simantics.scl.compiler.common.exceptions.InternalCompilerError; +import org.simantics.scl.compiler.environment.Environments; import org.simantics.scl.compiler.errors.Locations; import org.simantics.scl.compiler.internal.parsing.exceptions.SCLSyntaxErrorException; import org.simantics.scl.compiler.internal.parsing.parser.SCLParserImpl; @@ -1183,14 +1184,27 @@ public class Types { return effect; } + /** + * Use {@link Environments#getType(org.simantics.scl.compiler.environment.Environment, String)} instead. + */ + @Deprecated public static Type parseType(ITypeEnvironment environment, String text) throws SCLTypeParseException { return parseType(new TypeElaborationContext(environment), text); } + /** + * This method uses DUMMY_TYPE_ENVIRONMENT that almost does anything useful. Use + * {@link Environments#getType(org.simantics.scl.compiler.environment.Environment, String)} instead. + */ + @Deprecated public static Type parseType(String text) throws SCLTypeParseException { return parseType(new TypeElaborationContext(DUMMY_TYPE_ENVIRONMENT), text); } - + + /** + * Use {@link Environments#getType(org.simantics.scl.compiler.environment.Environment, String)} instead. + */ + @Deprecated private static Type parseType(TypeElaborationContext context, String text) throws SCLTypeParseException { SCLParserImpl parser = new SCLParserImpl(new StringReader(text)); try {