Skip to content

Minor code cleanup and other miscellanea.#17

Merged
cheddar merged 7 commits intoapache:masterfrom
ianbrandt:codecleanup
Nov 1, 2012
Merged

Minor code cleanup and other miscellanea.#17
cheddar merged 7 commits intoapache:masterfrom
ianbrandt:codecleanup

Conversation

@ianbrandt
Copy link
Copy Markdown
Contributor

Contributing some minor cleanup done whilst familiarizing myself with the codebase.

To eliminate unused imports I used the Eclipse Organize Imports function in bulk, so some reordering was done as well.

@cheddar
Copy link
Copy Markdown
Contributor

cheddar commented Nov 1, 2012

Generally looks like some good cleanup. Do you really have to close the FileOutputStream() if you close the channel returned from getChannel()?

Also, on the pom changes, I noticed it removed a lot of versions, for anything in a sub-module without a version, is it essentially going to be pulling in the version based on what is defined in the parent pom?

I'm also a little scared that we're going to get into import reordering wars between IntelliJ and Eclipse ;).

cheddar added a commit that referenced this pull request Nov 1, 2012
Minor code cleanup and other miscellanea.
@cheddar cheddar merged commit 4928978 into apache:master Nov 1, 2012
@ianbrandt
Copy link
Copy Markdown
Contributor Author

Thanks for the merge, and sorry for the belated reply to your comment.

Per http://docs.oracle.com/javase/6/docs/api/java/io/FileOutputStream.html#close(), closing a FileOutputStream should close any Channels from its getChannel(). I didn't see any documentation about the other way round though, as it was in the code. It looks like the OpenJDK7 FileChannelImpl will call close() on the parent stream, but I figured the safest thing was to just call it on both.

Exactly right on the POM changes, I DRY'd up all the versions declared by more than one module to the <dependencyManagement> section of the parent POM. I also added missing declarations to the child POMs for all direct dependencies of each given module. I'm not sure how much any of these modules will end up as dependencies themselves, but I think it less brittle to declare all direct dependencies rather than counting on transient declarations from upstream.

Regarding the import ordering, I certainly agree with your concern. I didn't see any IDE metadata, so I wasn't sure what the preferred one was. My goal was to simply cut down on the volume of trivial Eclipse warnings so that significant ones wouldn't be obscured. I'll see if Eclipse can't be configured to match IntelliJ's defaults, or just switch to IntelliJ if that's the better option.

@cheddar
Copy link
Copy Markdown
Contributor

cheddar commented Nov 2, 2012

Cool. I took everything but reverted the import stuff in an attempt to mitigate merge conflicts that people might have. After the fact I realized that I did it wrong (should've pulled your merge into a local repo and revert that one commit before pushing to master) and probably actually created more merge conflicts than would've existed had I kept it.

Anyway, for import optimization, I generally think it's great (and I have IntelliJ configured to optimize things on check-in), but if the only change to a file is import changes and the import isn't currently causing a bug I generally prefer to let it lie. As far as Eclipse/IntelliJ stuff is concerned, I don't think fighting over ordering is much of a concern as long as we stick to the rule where we only optimize imports if and when we've made some other change to the actual code of a file. That way, there will be some substance accompanying the import change and we can trust that both IntelliJ and Eclipse know how to include the correct imports no matter how they are ordered.

abhishekagarwal87 referenced this pull request in abhishekagarwal87/druid Dec 14, 2020
vogievetsky pushed a commit that referenced this pull request Jul 24, 2023
* convert img tags to markdown syntax

(cherry picked from commit 4041032)
(cherry picked from commit 40365dc)

* docu2 format redirect

(cherry picked from commit 9bfd1b1)

* docu2 sidebar

(cherry picked from commit 1ffb8a9)

* doc: escape tags in markdown in prepration for docusaurus2

(cherry picked from commit 94b4ea3)
(cherry picked from commit 589c90e)

* upgrade to docusaurus2

* put old site in website_old

* fix top nav and add apache license to stub files

* delete hidden from sidebar

* add node version

* fix spellchecker

(cherry picked from commit fadb7f3)

* update readme

* docusaurus2 test branch for 26 (#17)

* delete old website folder

* add apache license

* add apache license to css file

* update code tab syntax

(cherry picked from commit 37b725b)

* docs: fix links (#14504)

(cherry picked from commit ae85890)

* fix link color

(cherry picked from commit 1cef26d)

---------

Co-authored-by: Victoria Lim <vtlim@users.noreply.github.com>
GabrielCWT added a commit to GabrielCWT/druid that referenced this pull request Oct 14, 2025
GabrielCWT added a commit to GabrielCWT/druid that referenced this pull request Nov 6, 2025
GabrielCWT added a commit to GabrielCWT/druid that referenced this pull request Nov 19, 2025
GabrielCWT added a commit to GabrielCWT/druid that referenced this pull request Dec 1, 2025
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.

2 participants