Skip to content

BAEL-1889 - Let's move the Java Number articles into a new module#4619

Merged
pivovarit merged 11 commits intoeugenp:masterfrom
JonCook:master
Jul 14, 2018
Merged

BAEL-1889 - Let's move the Java Number articles into a new module#4619
pivovarit merged 11 commits intoeugenp:masterfrom
JonCook:master

Conversation

@JonCook
Copy link
Copy Markdown
Contributor

@JonCook JonCook commented Jul 3, 2018

No description provided.

Copy link
Copy Markdown
Collaborator

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

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

@JonCook hey, nice job.

Just a couple of small items in general

  • Double-check the whitespacing. Indentation in the pom is wonky--it's probably from your editor, but just see if you can clean that up so the XML comes out nice.
  • Unless you heard differently from Eugen, let's leave test improvements out of this PR. Feel free to log an enhancement for improving the tests, etc. (I've left some comments with more details about this.)

Comment thread java-numbers/pom.xml Outdated
<artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh-generator-annprocess.version}</version>
</dependency>
<dependency>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Double-check some of the whitespacing here. Looks like these few dependencies don't have the same indentation as the reast.

Comment thread java-numbers/pom.xml Outdated
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
<!-- <scope>runtime</scope> -->
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a reason this comment-out needs to be here (like for an article that references it?). If not, let's clean it up.

Comment thread java-numbers/pom.xml Outdated
</dependency>
</dependencies>

<build>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The indentation looks off here. Note the closing one and how </plugin> is more indented than <plugin> is here under <builld>

Comment thread java-numbers/pom.xml

<properties>
<commons-math3.version>3.6.1</commons-math3.version>
<decimal4j.version>1.0.3</decimal4j.version>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Whitespacing

private static Logger LOG = Logger.getLogger(NumberOfDigitsDriver.class);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hmm, while I agree that slf4j is totally the way to go, I think this task should just be about moving the classes over. Would you be okay with moving this back to log4j and logging an enhancement?

LOG.info("String Based Solution : {}", +length);

length = numberOfDigits.logarithmicApproach(602);
LOG.info("Logarithmic Approach : " + length);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same comment about just moving the tests and not improving their contents.

@@ -1,16 +1,14 @@
package com.baeldung.algorithms.primechecker;
package com.baeldung.prime;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is your reasoning for the package name change?

If it is something like "readability" or "cosmetics", then let's try and avoid this for this improvement. (While I do think these changes are great, they can be done in a different ticket)

@JonCook
Copy link
Copy Markdown
Contributor Author

JonCook commented Jul 4, 2018

Thanks for the comments. I will resubmit the PR.

@JonCook JonCook closed this Jul 4, 2018
@JonCook JonCook reopened this Jul 4, 2018
@JonCook
Copy link
Copy Markdown
Contributor Author

JonCook commented Jul 4, 2018

@jzheaux - Thanks for the comments! I updated the PR. I'm not sure what happened with the formatting in the pom.xml but I think it should be OK now. Probably a tab setting in my xml editor in eclipse.

Sorry for including additional improvements that weren't part of the ticket. It is just the way I work, to clean often, frequently and in small incrementations. As I was creating a new module I thought it was a good opportunity to do this following the recommendations in the dev docs. But of course happy if this is done under a different improvement. But the tendency is this type of cleaning/improvements tend to get forgotten ;-)

I reverted to log4j and put the original package names back. Thanks again for the comments.

@jzheaux
Copy link
Copy Markdown
Collaborator

jzheaux commented Jul 5, 2018

@JonCook The issue is that associated code in the articles also needs to be edited as part of that. Changing package names is one thing since those don't really end up in the article code samples, but changing more substantial things is a slippery slope that can end in confusing readers who see one thing in the article and another in the codebase.

Feel free to ping Jira Support about adding another enhancement task to update articles to slf4j (etc.), and it's possible they will say that it is easier to do in this PR--it just means you'd be editing the contents of those articles, too.

@JonCook
Copy link
Copy Markdown
Contributor Author

JonCook commented Jul 5, 2018

@jzheaux - Thanks for the comments again ;-) I'm still learning and quite new so agree with your suggestions. I don't think the formatting changes should have much impact on the articles. I had a quick look and most of it seems to be the same. Thanks again.

@pivovarit pivovarit merged commit b44883b into eugenp:master Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants