Skip to content

Refactored#3

Open
SamarthJ-24 wants to merge 3 commits into
Arhiser:masterfrom
SamarthJ-24:refactored
Open

Refactored#3
SamarthJ-24 wants to merge 3 commits into
Arhiser:masterfrom
SamarthJ-24:refactored

Conversation

@SamarthJ-24

Copy link
Copy Markdown

Hello, I have chosen your project for refactoring because I have to perform the following task to complete my university assignment. I request you to accept my pull request which will help me to gain points in my assignment. I have made following changes, you can accept as many commit as you want.
Thank you.

Refactoring
src->ru.arhiser
Commented the programs 1. Package Iterator -> MainFieldEnum.java, 2. Package sort -> comparator -> Main.java because the programs were using the library ru.arhiser.object and this was not present in the package ru.arhiser.
Therefore, because of these packages the project was unable to compile.

Rename Method/Variable:
Variable= Package- bitops, Line of Code: 47

  1. Rename variable i= 0b11010000; to int k = 0b11010000; because i was already assigned and given value in main function at line: 7.

Method= Package- huffman, Line of Code: 65

  1. Renamed method private static CodeTreeNode huffman(ArrayList codeTreeNodes) to private static CodeTreeNode huffmanEncode(ArrayList codeTreeNodes)

Extract Method: Package- bitops, Line of Code: 46

  1. Extracted bit setting to method bitSetting(i)
  2. Extracted reset bit to 0 as method bitReset(i)
  3. Extracted bit check to method bitCheck(i)
  4. Extracted packing 4 bytes to int to method bytesToInt()
  5. Extracting bytes to int to method bytesExtract(b1,b2,b3,b4)

Move Method: Package- huffman, Before Line of Code: 65, After refactoring line of code: 99

  1. Method is currently in huffman\Main.java
    Method moved to class CodeTreeNode because this method uses more method of CodeTreeNode than calling its own methods.

Extract Class: Package- huffman_adapt.digital, Class- CoderTestApp

  1. Created a new class EncodeAndDecodeApp.java and moved the method encodeAndDecode() because the main class CoderTestApp had more than one fuctionality that is Creation of Frame and Text Feild and Encoding and Decoding of the text.

Pull Up Method: Package- fract_noise, Class- FractalNoise.java, Noise.java

  1. Both the classes has method public float getValue (int x, int y) which is pulled up to to java interface class GetValue.

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.

1 participant