New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address #349: Partially resolve deprecated warnings #493

Merged
merged 5 commits into from Feb 21, 2018

Conversation

Projects
None yet
4 participants
@exoego
Contributor

exoego commented Feb 21, 2018

This PR address #349 by partially resolving deprecated warnings.

The deprecated codes are simply removed or rewriten, in accordance with the instruction in deprecation warning.

Before (3c12aba)

Total

$ sbt -warn ";clean;compile" | grep "deprecated" | wc -l
15
$ sbt -warn ";clean;compile" | grep "deprecated"        
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-classpath/src/main/scala/sbt/internal/inc/classpath/ClassLoaders.scala:98:21: object WrapAsJava in package convert is deprecated (since 2.12.0): use JavaConverters or consider ImplicitConversionsToJava
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-classpath/src/main/scala/sbt/internal/inc/classpath/ClassLoaders.scala:98:26: object WrapAsScala in package convert is deprecated (since 2.12.0): use JavaConverters or consider ImplicitConversionsToScala
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-classpath/src/main/scala/sbt/internal/inc/classpath/ClasspathUtilities.scala:116:24: object JavaConversions in package collection is deprecated (since 2.12.0): use JavaConverters
[warn] /home/exoego/IdeaProjects/zinc/internal/compiler-bridge/src/main/scala/xsbt/API.scala:82:12: method isImplClass in class Symbol is deprecated (since 2.12.0): trait implementation classes have been removed in Scala 2.12
[warn] /home/exoego/IdeaProjects/zinc/internal/compiler-bridge/src/main/scala/xsbt/Analyzer.scala:51:41: method isImplClass in class Symbol is deprecated (since 2.12.0): trait implementation classes have been removed in Scala 2.12
[warn] /home/exoego/IdeaProjects/zinc/internal/compiler-bridge/src/main/scala/xsbt/CallbackGlobal.scala:169:10: trait RangePositions in package interactive is deprecated (since 2.11.0): Use scala.reflect.internal.Positions
[warn] /home/exoego/IdeaProjects/zinc/internal/compiler-bridge/src/main/scala/xsbt/ClassName.scala:94:33: method isImplClass in class Symbol is deprecated (since 2.12.0): trait implementation classes have been removed in Scala 2.12
[warn] /home/exoego/IdeaProjects/zinc/internal/compiler-bridge/src/main/scala_2.11-12/xsbt/ConsoleInterface.scala:52:16: method setContextClassLoader in class IMain is deprecated (since 2.12.0): The thread context classloader is now set and restored around execution of REPL line, this method is now a no-op.
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/AnalyzingCompiler.scala:347:56: method libraryJar in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala:72:67: method compilerJar in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala:73:65: method otherJars in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala:98:37: method libraryJar in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala:141:27: method libraryJar in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/javac/JavaCompiler.scala:105:43: method libraryJar in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.
[warn] /home/exoego/IdeaProjects/zinc/zinc-compile/src/main/scala/sbt/inc/Doc.scala:37:19: type :*: in object LList is deprecated (since 0.8.0): Switch to the type alias in the sjsonnew root package

This PR

$ sbt -warn ";clean;compile" | grep "deprecated" | wc -l
9
$ sbt -warn ";clean;compile" | grep "deprecated"
[warn] /home/exoego/IdeaProjects/zinc/internal/compiler-bridge/src/main/scala/xsbt/API.scala:82:12: method isImplClass in class Symbol is deprecated (since 2.12.0): trait implementation classes have been removed in Scala 2.12
[warn] /home/exoego/IdeaProjects/zinc/internal/compiler-bridge/src/main/scala/xsbt/Analyzer.scala:51:41: method isImplClass in class Symbol is deprecated (since 2.12.0): trait implementation classes have been removed in Scala 2.12
[warn] /home/exoego/IdeaProjects/zinc/internal/compiler-bridge/src/main/scala/xsbt/ClassName.scala:94:33: method isImplClass in class Symbol is deprecated (since 2.12.0): trait implementation classes have been removed in Scala 2.12
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/AnalyzingCompiler.scala:347:56: method libraryJar in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala:72:67: method compilerJar in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala:73:65: method otherJars in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala:98:37: method libraryJar in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala:141:27: method libraryJar in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.
[warn] /home/exoego/IdeaProjects/zinc/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/javac/JavaCompiler.scala:105:43: method libraryJar in trait ScalaInstance is deprecated: see corresponding Javadoc for more information.

The above 9 deprecated warnings are kept.

  • Symbol.isImplClass is needed for Scala 2.11.
  • How to migrate some members of ScalaInstance is not clear for me.

Maybe those should be addressed as a legit issue?

@@ -79,7 +79,6 @@ final class API(val global: CallbackGlobal) extends Compat with GlobalHelpers {
def isTopLevel(sym: Symbol): Boolean = {
!ignoredSymbol(sym) &&
sym.isStatic &&
!sym.isImplClass &&

This comment has been minimized.

@jvican

jvican Feb 21, 2018

Member

I think all the appearances of isImplClass should not be removed because implementation classes were deprecated in 2.12, but it's still necessary to check for them in Scala 2.11 and 2.10.

@exoego

This comment has been minimized.

Contributor

exoego commented Feb 21, 2018

Work in progress...

Sorry for frequent changes.
Since the drone CI is NOT free, I need to update PR frequently to verify PR does not break builds.

[EDIT] I thinks this PR is ready for review.

@typesafe-tools

This comment has been minimized.

typesafe-tools commented Feb 21, 2018

The validator has checked the following projects against Scala 2.12, 2.11, 2.10,
tested using sbt-allsources.sh.

Project Reference Commit
sbt 1.x sbt/sbt@c9f3a73
zinc pull/493/head e71db51
io 1.x sbt/io@438474e
librarymanagement 1.x sbt/librarymanagement@0d21ae6
util 1.x sbt/util@85f7d80
website 1.x sbt/website@bc8a470

The result is: SUCCESS
(restart)

@dwijnand

LGTM. Thanks again @exoego!

@jvican

jvican approved these changes Feb 21, 2018

@jvican jvican merged commit ad46221 into sbt:1.x Feb 21, 2018

1 check passed

continuous-integration/drone/pr the build was successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment