Skip to content

A bunch of code cleanup #40

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

Closed
wants to merge 58 commits into from
Closed

A bunch of code cleanup #40

wants to merge 58 commits into from

Conversation

labkey-tchad
Copy link
Member

@labkey-tchad labkey-tchad commented Oct 14, 2022

Rationale

Thought 4.0.0 might be a good time to just scrub the code real good.

Related Pull Requests

Changes

  • Clean up tons of IDE warnings
  • Remove author comments from many classes
  • Remove command line main method from several commands

Copy link
Contributor

@labkey-adam labkey-adam left a comment

Choose a reason for hiding this comment

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

Okay as is, but consider passing in specific Command classes into Response constructors and returning specific Command classes from copy() methods.

@@ -575,8 +579,7 @@ public void setRequiredVersion(double requiredVersion)
* to copy their own data members
* @return A copy of this object
*/
// TODO: For next major release, genericize this return value (Command<ResponseType>)
public Command copy()
public Command<?> copy()
Copy link
Contributor

Choose a reason for hiding this comment

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

ResponseType doesn't work here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was actually going to propose that remove the 'copy' method altogether. It is very inconsistently implemented and doesn't seem to provide much utility other than to pipe Command.getRequiredVersion through to response classes that care about it.
If anything actually wanted to extract the source command from an arbitrary response object, there's no guarantee that it would actually match the original command (by type or functionality) or that it is a copy.

I was also toying with the idea of making Command and PostCommand abstract (along with createResponse) then move the default createResponse to subclasses for use by things that don't want to worry about response objects.
e.g.
class BasicCommand extends Command<CommandResponse>
-and-
class BasicPostCommand extends PostCommand<CommandResponse>

(Alternatively, remove the generics from Command and PostCommand and make abstract base command classes)

Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't looked at usages, but I'd be fine getting rid of copy() entirely. Now's a good time. I trust your judgement...

@labkey-susanh
Copy link
Contributor

Is this "real good scrubbing" going to include adding the few missing javadocs so we'll stop seeing those warnings (and have all the javadoc anyone would ever want)?

@labkey-tchad
Copy link
Member Author

Is this "real good scrubbing" going to include adding the few missing javadocs so we'll stop seeing those warnings (and have all the javadoc anyone would ever want)?

Sure! I would love to.

Base automatically changed from fb_jsonUpgrade to develop October 24, 2022 21:12
@labkey-tchad labkey-tchad changed the base branch from develop to squashTarget October 24, 2022 21:55
@labkey-tchad labkey-tchad changed the base branch from squashTarget to develop October 24, 2022 22:10
@labkey-tchad
Copy link
Member Author

labkey-tchad commented Oct 24, 2022

New feature branch: #41

@labkey-tchad labkey-tchad deleted the codeCleanup branch October 24, 2022 22:13
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