Skip to content
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

Deprecations from Java may be not taken into account in mixed projects #9617

Closed
scabug opened this issue Jan 7, 2016 · 8 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jan 7, 2016

There's a problem that deprecations from Java are not taken into account in Scala after parsing Java sources in mixed projects (when they are not yet compiled). I mean that warnings are not generated.

They would be generated only during the incremental compilation (Java files already compiled using javac). It's esp. problematic in case of -Xfatal-warnings as the CI build may pass but users will report problems in Scala IDE or IntelliJ.

The minimal reproduction:

  1. Create two files.

J.java

public class J {
    @Deprecated
    public static void foo() {}
}

S.scala

class S {
  J.foo()
}
  1. Make project (for the first time) or Rebuild Project. Everything is okay.

  2. Now add some blank line in S.scala and start build:

Warning (or obviously Error in case of -Xfatal-warnings):scalac: there was one deprecation warning; re-run with -deprecation for details

  1. Then Rebuild Project and, again, there are no warnings.
@scabug
Copy link
Author

scabug commented Jan 7, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9617?orig=1
Reporter: @mpociecha
Assignee: @mpociecha
Affected Versions: 2.10.6, 2.11.7, 2.12.0-M3

@scabug
Copy link
Author

scabug commented Jan 7, 2016

@retronym said:
A fix for this bug might fall out of [~soc]'s pending work to parse annotations from Java sources: https://github.com/scala/scala/pull/4848/commits

@scabug
Copy link
Author

scabug commented Jan 8, 2016

@mpociecha said:
Yes, I know. I asked Lukas about this before I created the ticket. And also Simon was added to the discussion (just in case).

@scabug
Copy link
Author

scabug commented Apr 9, 2016

@mpociecha said:
Btw, when we'll have the support for annotations finished, it will be pretty simple to handle Java @deprecated annotation.

There's even already my very old PR in Simon's repo (only the last commit does matter): soc/scala#3

@scabug
Copy link
Author

scabug commented Apr 10, 2016

@soc said:
Don't worry, I'm still on it! I hope I can get it merged before 2.12.0-M5, depending on how many unexpected issues appear out of nowhere. :-)

@scabug
Copy link
Author

scabug commented Sep 29, 2016

@SethTisue said:
Simon, is this something you plan to come back to?

@scabug
Copy link
Author

scabug commented Sep 30, 2016

@soc said:
Yes, I have just been very busy.

@dwijnand
Copy link
Member

Fixed in scala/scala#8781

@dwijnand dwijnand modified the milestones: Backlog, 2.12.12 Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants