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

Move PreconditionViolationException to commons base package #1863

Closed
1 task done
sormuras opened this issue Apr 14, 2019 · 5 comments
Closed
1 task done

Move PreconditionViolationException to commons base package #1863

sormuras opened this issue Apr 14, 2019 · 5 comments

Comments

@sormuras
Copy link
Member

sormuras commented Apr 14, 2019

Overview

Follow-up from #1857

Deliverables

  • Deprecate PreconditionViolationException in package org.junit.platform.commons.util in favor a new sibling of JUnitException in the exported package org.junit.platform.commons.
@marcphilipp marcphilipp added this to the 5.5 M2 milestone Apr 15, 2019
@sormuras sormuras self-assigned this Apr 15, 2019
@sormuras
Copy link
Member Author

sormuras commented Apr 15, 2019

> Task :junit-platform-commons:compileJava
  \junit5\junit-platform-commons\src\main\java\org\junit\platform\commons\PreconditionViolationException.java:23:
  warning: [deprecation] PreconditionViolationException in org.junit.platform.commons.util has been deprecated
public class PreconditionViolationException extends 
  org.junit.platform.commons.util.PreconditionViolationException {
                                                                                   ^
error: warnings found and -Werror specified

Hm...

@sormuras
Copy link
Member Author

...after deleting the deprecated PreconditionViolationException from org.junit.platform.commons.util, everything's fine. Breaking (INTERNAL) change incoming?

@sormuras
Copy link
Member Author

...using -Xlint:-deprecation a warning like this is shown:

> Task :junit-platform-commons:compileJava
Note: \junit5\junit-platform-commons\src\main\java\org\junit\platform\commons\PreconditionViolationException.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Not nice either. Which road do we take, @junit-team/junit-lambda?

@sbrannen
Copy link
Member

Which road do we take, @junit-team/junit-lambda?

Did you annotate the new PreconditionViolationException class with @SuppressWarnings("deprecation")?

@sormuras
Copy link
Member Author

Yes. That helps within the IDE, but javac still emits a warning of category exports. Adding exports to the list of suppressed warning seems to work:

package org.junit.platform.commons;
// ...
@API(status = STABLE, since = "1.5")
@SuppressWarnings({ "deprecation", "exports" })
public class PreconditionViolationException
  extends org.junit.platform.commons.util.PreconditionViolationException
  {...}

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