Skip to content
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

Remove static object #508

Merged
merged 11 commits into from
Oct 13, 2021
Merged

Remove static object #508

merged 11 commits into from
Oct 13, 2021

Conversation

devenyantis
Copy link
Contributor

Description

Remove static object and replace with constructor or getter/setter

Type of change

Please delete options that are not relevant.

  • Bug fix (Non-breaking change which fixes an issue)
  • New feature (Non-breaking change which adds functionality)
  • Breaking change (Fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update (Example: REST API changes)

Tested on?

  • Windows
  • Linux Ubuntu
  • Centos
  • Mac
  • Others (State here -> xxx )

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged
  • CHANGELOG.md has been updated
  • Update Gitbook REST API Page

@devenyantis devenyantis added the enhancement New feature or request label Oct 6, 2021
@devenyantis devenyantis self-assigned this Oct 6, 2021
@devenyantis devenyantis requested a review from treo October 6, 2021 10:26
Copy link
Collaborator

@treo treo left a comment

Choose a reason for hiding this comment

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

There is still plenty of static object use left.

In particular the ProjectHandler class is used all over the place in this static manner.

Comment on lines 41 to 45
private static final PortfolioVerticle portfolioVerticle = new PortfolioVerticle();
private static final BoundingBoxVerticle boundingBoxVerticle = new BoundingBoxVerticle();
private static final SegVerticle segVerticle = new SegVerticle();
private static final WasabiVerticle wasabiVerticle = new WasabiVerticle();
private static final EndpointRouter serverVerticle = new EndpointRouter();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do these need to be static at all?

@devenyantis devenyantis requested a review from treo October 13, 2021 04:11
Copy link
Collaborator

@treo treo left a comment

Choose a reason for hiding this comment

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

Just a small nitpick.

I also see that you've added a lot more project state transitions, shouldn't that happen within the projectExport object itself?

Comment on lines 167 to 174
annotationDict.put(versionUuid, DataInfoProperties.builder()
.annotation(new ArrayList<AnnotationPointProperties>())
.imgX(newImagePropValue)
.imgY(newImagePropValue)
.imgW(newImagePropValue)
.imgH(newImagePropValue)
.build()
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it makes sense to push the default values into the object definition and use @Builder.Default instead of having this disconnect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the project state transitions.

No. It doesn't. When zipping the image, the current process run in separate thread which is the only way to mark as success.

I also followed the original flow. Found out that I forgot to add the starting process status. Realize when testing this with bigger dataset.

@devenyantis devenyantis requested a review from treo October 13, 2021 08:35
Comment on lines 168 to 169
log.info("DEVEN: " + annotationDict);

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess you forgot to remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh noo. Ok. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@sonarcloud
Copy link

sonarcloud bot commented Oct 13, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 51 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@devenyantis devenyantis merged commit 3eb2985 into v2_alpha_refactor Oct 13, 2021
@devenyantis devenyantis deleted the remove_static_object branch October 13, 2021 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants