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

2390 #3090

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

2390 #3090

Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions eo-maven-plugin/src/main/java/org/eolang/maven/TranspileMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private List<Path> transpile(

/**
* Clean up dirty classes.
* The method is trying to fix problem produced by dirty libraries:
* The method is trying to fix a problem produced by dirty libraries:
* <a href="https://github.com/objectionary/eo-strings/issues/147"> eo-strings example </a>
* Some libraries by mistake can put ALL their compiled classes right into the final library
* jar, instead of only adding atoms. This can cause different runtime errors since the
Expand All @@ -265,12 +265,15 @@ private List<Path> transpile(
* {@link java.nio.file.AccessDeniedException}, which could crash the build.
* _____
* @param java The list of java files.
* @todo #2375:90min. Add concurrency tests for the TranspileMojo.cleanUpClasses method.
* We should be sure that the method works correctly in a concurrent environment.
* In order to do so we should add a test that will run the cleanUpClasses method in
* multiple threads and check that the method works correctly without exceptions.
* We can apply the same approach as mentioned in that post:
* <a href="https://www.yegor256.com/2018/03/27/how-to-test-thread-safety.html">Post</a>
* @todo #2375:90min. Implement mechanism for "inner" and "outer" classes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@l3r8yJ To be honest, I didn't clearly understand what you want to do in this puzzle.

First of all. Do you want to "get rid of the TranspileMojo#cleanUpClasses method?" If it is so, it would be nice to put this phrase as a header of the puzzle:

@todo #2375:90min. Get rid of the TranspileMojo#cleanUpClasses method.

Second, it would be nice to answer the "why?" question. Why do we need to do it at all?

@todo #2375:90min. Get rid of the TranspileMojo#cleanUpClasses method.
  We need to remove it because ...

Third, you can suggest some ideas about the possible solutions of the problem you already mentioned.

@todo #2375:90min. Get rid of the TranspileMojo#cleanUpClasses method.
  We need to remove it because ...
  To do so, we can...

However, these are only my suggestions, and you can do it as you want. But please, make this puzzle a bit more understandable.

BTW, I didn't clearly understand what "inner" and "outer" classes mean.

* To get rid of TranspileMojo#cleanUpClasses, we can implement mechanism,
* that will mark classes of the project like "inner", which is will be checked
* during the compilation process.
* Another solution is to create analog of gradle `implementation` and `api`,
* - implementation – just includes the dependency for inner usage
* - api – allows to users of API to
* use dependency which was added to project via `api` keyword
* <p/><a href="https://shorturl.at/abns4">More about api and implementation here</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@l3r8yJ Does this link actually lead somewhere? I can't open it.

*/
private void cleanUpClasses(final Collection<? extends Path> java) {
final Set<Path> unexpected = java.stream()
Expand Down