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

TestsShouldNotBePublic should reduce visibility if used elsewhere in Javadoc links #458

Open
koppor opened this issue Jan 15, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@koppor
Copy link
Contributor

koppor commented Jan 15, 2024

I applied TestsShouldNotBePublic to JabRef's code.

I get compile errors afterwards:

/home/runner/work/jabref/jabref/src/test/java/org/jabref/logic/bst/BstFunctionsTest.java:7: error: BstCaseChangersTest is not public in org.jabref.logic.bst.util; cannot be accessed from outside package
import org.jabref.logic.bst.util.BstCaseChangersTest;

I know, this is bad software design. However, I think, rewriting should not introduce compile errors.

Refs JabRef/jabref#10797

@koppor koppor added the enhancement New feature or request label Jan 15, 2024
@timtebeek timtebeek added bug Something isn't working and removed enhancement New feature or request labels Jan 15, 2024
@timtebeek
Copy link
Contributor

Oh wow; at first I thought this was a variant of the existing issue related to extended classes:

But in this case it seems the classes are only ever used for @link in Javadocs:
https://github.com/JabRef/jabref/blob/899f5034ec4896aada28d3f79f391561d8843343/src/test/java/org/jabref/logic/bst/BstFunctionsTest.java#L7-L35

@timtebeek timtebeek changed the title TestsShouldNotBePublic should respect outside access TestsShouldNotBePublic should reduce visibility if used elsewhere in Javadoc links Jan 15, 2024
@koppor
Copy link
Contributor Author

koppor commented Jan 15, 2024

Not all:

org.jabref.logic.exporter.BibtexDatabaseWriterTest#roundtripWin1252HeaderKept

Path testFile = Path.of(BibtexImporterTest.class.getResource("encoding-windows-1252-with-header.bib").toURI());

And other similar things. I rewrote them by duplicating the test files and changing the access.


In the case of JavaDocs, the class reference should be changed to a fully qualified class referernce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants