Skip to content

Conversation

@stephan-gh
Copy link
Contributor

@stephan-gh stephan-gh commented Sep 12, 2017

I think this should be pretty straightforward. No functional change. Just some minor cleanup to fix some warnings reported by IntelliJ inspections (but not all of them, because some don't make sense). Opening this pull request if you want to take a quick look @DemonWav.

  • Fixed wrong package declaration
  • Replaced some long if-else chains with when
  • Moved some assignments / return statements outside of if/try blocks
  • Other minor cleanup to use more Kotlin features

I avoided touching any Forge side-only inspections since you have a branch somewhere that removes/changes them.

@marvin-roesch
Copy link
Contributor

You might want to address some occurrences of string.trim { it <= ' ' } which seem to be the result of automatic conversion from Java.

@stephan-gh
Copy link
Contributor Author

stephan-gh commented Sep 12, 2017

@PaleoCrafter Thanks, done.


import com.demonwav.mcdev.util.gson
import com.demonwav.mcdev.util.SemanticVersion
import com.demonwav.mcdev.util.gson
Copy link
Member

Choose a reason for hiding this comment

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

This seems weird to me. Does uppercase sort before lowercase? Seems like imports should be sorted case-insensitive to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what IntelliJ IDEA does when sorting the imports. It seems like they are sorted case-sensitive, but since this is what your IntelliJ code style does, I'm not sure we should bother and keep this different manually

- Fixed wrong package declaration
- Replaced some long if-else chains with when
- Removed explicit String.trim() predicate (probably from Java->Kotlin conv.)
- Moved some assignments / return statements outside of if/try blocks
- Other minor cleanup to use more Kotlin features
@DenWav DenWav merged commit 3717bdd into dev Sep 16, 2017
@kashike kashike deleted the minor-cleanup branch September 16, 2017 05:42
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.

4 participants