Skip to content

[IO-669] Fix code smells; fix typos#115

Merged
garydgregory merged 5 commits intoapache:masterfrom
xenoamess-fork:fix_code_smells
May 31, 2020
Merged

[IO-669] Fix code smells; fix typos#115
garydgregory merged 5 commits intoapache:masterfrom
xenoamess-fork:fix_code_smells

Conversation

@XenoAmess
Copy link
Contributor

@XenoAmess XenoAmess commented May 24, 2020

@XenoAmess
Copy link
Contributor Author

Also, in function NullPrintStreamTest.process(final NullPrintStream nos),
We use function void PrintStream.write(byte buf[]), which is @SInCE 14
Should we really use a java 14 function in a java 8 project?
And is it neccessary?

@coveralls
Copy link

coveralls commented May 24, 2020

Coverage Status

Coverage remained the same at 89.783% when pulling 77f23ed on XenoAmess:fix_code_smells into 661d47c on apache:master.

@garydgregory
Copy link
Member

Also, in function NullPrintStreamTest.process(final NullPrintStream nos),
We use function void PrintStream.write(byte buf[]), which is @SInCE 14
Should we really use a java 14 function in a java 8 project?
And is it neccessary?

I just started a release candidate for 2.7 so this will have to wait until another RC if something goes wrong or more likely the next release.

The API you refer to is defined in Java 8 as java.io.FilterOutputStream.write(byte[]).

@XenoAmess
Copy link
Contributor Author

XenoAmess commented May 25, 2020

Also, in function NullPrintStreamTest.process(final NullPrintStream nos),
We use function void PrintStream.write(byte buf[]), which is @SInCE 14
Should we really use a java 14 function in a java 8 project?
And is it neccessary?

I just started a release candidate for 2.7 so this will have to wait until another RC if something goes wrong or more likely the next release.

OK, none of them is bugfix nor other important things so you can review/merge it anytime you want sooner or later.

The API you refer to is defined in Java 8 as java.io.FilterOutputStream.write(byte[]).

I will find some time to test if j2se8 can run jdk14's compile output NullPrintStreamTest classfile.
update:
OK it can work on jdk8. no change needed.

@XenoAmess XenoAmess changed the title fix code smells fix code smells; fix typos May 30, 2020
@XenoAmess XenoAmess changed the title fix code smells; fix typos [IO-669]fix code smells; fix typos May 30, 2020
return String.format("%,d files, %,d directories, %,d bytes", Long.valueOf(fileCounter.get()),
Long.valueOf(directoryCounter.get()), Long.valueOf(byteCounter.get()));
return String.format("%,d files, %,d directories, %,d bytes", fileCounter.get(),
directoryCounter.get(), byteCounter.get());
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as in your other PR. Let's leave boxing and unboxing as obvious since we are in a low level library and I prefer to see where this happens so we can think about consequences of creating objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, will not happen next time :-)

final IOFileFilter filter = FileFilterUtils.trueFileFilter();
try {
FileFilterUtils.filterList(filter, Arrays.asList((File) null));
FileFilterUtils.filterList(filter, Collections.singletonList((File) null));
Copy link
Member

Choose a reason for hiding this comment

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

It is worth testing both kinds?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@garydgregory it is only used as a Iterable there thus I think it has no actual difference IMO, exluding running speed.

@garydgregory garydgregory changed the title [IO-669]fix code smells; fix typos [IO-669] Fix code smells; fix typos May 30, 2020
@garydgregory garydgregory merged commit 401d173 into apache:master May 31, 2020
asfgit pushed a commit that referenced this pull request May 31, 2020
@XenoAmess XenoAmess deleted the fix_code_smells branch June 1, 2020 14:28
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