Skip to content

Refactoring: Move Method - #470

Closed
bharatwaaj wants to merge 9 commits into
HtmlUnit:masterfrom
bharatwaaj:asdc-assignment-set-2-move-method
Closed

Refactoring: Move Method#470
bharatwaaj wants to merge 9 commits into
HtmlUnit:masterfrom
bharatwaaj:asdc-assignment-set-2-move-method

Conversation

@bharatwaaj

Copy link
Copy Markdown
Contributor

Refactoring: Move Method

Reason for change:

The move method refactoring has been applied here as we parse the fields to determine and fit them onto a circle or a rectangle or a polygon, which is a function that is supposed to be carried on by the respective shapes, and thus a common static parse function was created in Circle, Rectangle and Polygon classes and has been used here.

 

@rbri rbri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This makes sense for me, can you please

  • rebase
  • maybe it is a good idea to make the public constructors for the shapes private (because we have the factory methods)
  • maybe the retunrn type of the factory methods can be more specific
  • have a look at the Shape2D parsePoly stuff, this returns an rect as fallback - maybe not a good ide

@rbri

rbri commented Mar 30, 2022

Copy link
Copy Markdown
Member

see my comments above and please make sure this does not include parts of other refactorings

@rbri

rbri commented Apr 5, 2022

Copy link
Copy Markdown
Member

Have done another look at this, and i think the code is correct. The classes in the com.gargoylesoftware.htmlunit.util.geometry packages are plain geometry implementations.
All the parsing of the html attributes has to be done in the html related peers.

Thanks for looking at the code - and sorry for not following your suggestion.

@rbri rbri closed this Apr 5, 2022
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