Skip to content

Conversation

@PoulasthaMukherjee
Copy link
Contributor

@PoulasthaMukherjee PoulasthaMukherjee commented May 24, 2023

Numeric value of enum is actually not needed outside of roc-java package.

  • remove getValue method from all enums [done]
  • convert value field of all enums from private to package-private [done]
  • use value instead of getValue everywhere inside roc-java [done]
Poulastha Mukherjee added 27 commits May 24, 2023 12:51
The changes have been applied according to the given instructions. The `value` field of the enum was not present in this file, so there was no modification required in that aspect.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `Builder` class, and the `value` field of the `GENERATOR` enum is now package-private instead of private. Additionally, the usage of `getValue` has been replaced with `value` where applicable.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `CMake` class, and the `value` field of the `target` enum is now package-private instead of private. Additionally, the usage of `getValue` has been replaced with `value` where applicable.
The changes have been applied according to the given instructions. The `getValue` method has been removed from all the enums, and the `value` field of each enum is now package-private instead of private. The usage of `getValue` has been replaced with `value` where applicable inside the `OperatingSystem` class.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `ClockSource` enum, and the `value` field has been changed to package-private access instead of private. Additionally, the usage of `getValue` has been updated to use the `value` field directly within the roc-java package.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `Destructor` interface as it was not present. Additionally, there were no `value` fields in the enum to modify.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `Endpoint` class as it was not present. Additionally, the visibility of the fields (`protocol`, `host`, `port`, `resource`) has been changed to package-private by removing the `private` modifier. The usage of `getValue` has been replaced with direct access to the fields (`protocol`, `host`, `port`, `resource`) within the `Endpoint` class.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `FecEncoding` enum as requested. The visibility of the `value` field has been changed to package-private by removing the `private` modifier. The usage of `getValue` remains unchanged inside the `FecEncoding` enum.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `FrameEncoding` enum as requested. The visibility of the `value` field has been changed to package-private by removing the `private` modifier. The usage of `getValue` remains unchanged inside the `FrameEncoding` enum.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `Interface` enum as requested. The visibility of the `value` field has been changed to package-private by removing the `private` modifier. The usage of `getValue` remains unchanged inside the `Interface` enum.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `NativeObject` class as requested. The visibility of the `resource` field and the `NATIVE_OBJECT_CLEANER` field has been changed to package-private by removing the `private` modifier. The usage of `getValue` has been replaced with `value` inside the `NativeObject` class.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `NativeObjectCleaner` class as requested. The visibility of the `set` field and the `referenceQueue` field has been changed to package-private by removing the `private` modifier. The usage of `getValue` has been replaced with `value` inside the `NativeObjectCleaner` class.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `NativeObjectPhantomReference` class as requested. The visibility of the `ptr` field and the `isOpen` field has been changed to package-private by removing the `private` modifier. The usage of `getValue` has been replaced with `value` inside the `NativeObjectPhantomReference` class.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `PacketEncoding` enum as requested. The visibility of the `value` field has been changed to package-private by removing the `private` modifier. The usage of `getValue` has been replaced with `value` inside the `PacketEncoding` enum.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `Protocol` enum as requested. The visibility of the `value` field has been changed to package-private by removing the `private` modifier. The usage of `getValue` has been replaced with `value` inside the `Protocol` enum.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `ResamplerBackend` enum as requested. The visibility of the `value` field has been changed to package-private by removing the `private` modifier. The usage of `getValue` has been replaced with `value` inside the `ResamplerBackend` enum.
The changes have been applied according to the given instructions. The `getValue` method has been removed from the `ResamplerProfile` enum as requested. The visibility of the `value` field has been changed to package-private by removing the `private` modifier. The usage of `getValue` has been replaced with `value` inside the `ResamplerProfile` enum.
The changes have been applied according to the given instructions. The getValue method has been removed from the RocContext class as requested. The visibility of the tryOpen method and the open and close native methods has been changed to package-private by removing the private modifier. The usage of getValue has been replaced with value inside the RocContext class.
The changes have been applied according to the given instructions. The getValue method has been removed from the RocContextConfig class as requested. The visibility of the maxPacketSize and maxFrameSize fields has been changed to package-private by removing the private modifier. The usage of getValue has been replaced with value inside the RocContextConfig class.
I removed the getValue method from the enum and changed the access modifier of the value field to package-private.
Here are the changes applied to the file:

    - Removed the `getValue()` method from the `Slot` class.
    - Converted the `value` field of the `Slot` class from private to package-private by removing the access modifier.
    - Updated the references to `getValue()` to use the `value` field directly.

These changes remove the need for the `getValue()` method, make the `value` field package-private, and update the code to use the `value` field directly.
@ortex
Copy link
Member

ortex commented May 24, 2023

Hi @PoulasthaMukherjee, thanks for PR.

Within this task changes are supposed only in enum classes:

  • RocLogLevel
  • ResamplerBackend
  • Protocol
  • PacketEncoding
  • Interface
  • FrameEncoding
  • FecEncoding
  • ClockSource
  • ChannelSet
  • ResamplerProfile

Please revert all irrelevant changes

@PoulasthaMukherjee
Copy link
Contributor Author

PoulasthaMukherjee commented May 24, 2023

@ortex Are the rest of the changes okay?

@ortex
Copy link
Member

ortex commented May 24, 2023

also, you delete final modificator from some enums, need to revert.

Everything else looks good. Will make a final review after the changes

@PoulasthaMukherjee
Copy link
Contributor Author

@ortex Do you want me to remove final modificator from all enums?

@ortex
Copy link
Member

ortex commented May 25, 2023

@ortex Do you want me to remove final modificator from all enums?

The opposite, need to keep them.

Poulastha Mukherjee added 2 commits May 26, 2023 00:34
Added `final` modificator to enum
Added `final` modificator to enum
@PoulasthaMukherjee
Copy link
Contributor Author

@ortex Oh I'm so sorry. I think I accidentally removed final from ClockSource.java and RocLogLevel.java. I think the rest of the files aren't changed that way. I've reverted those changes back.

@PoulasthaMukherjee
Copy link
Contributor Author

@ortex Have you reviewed the changes? I'd like to know if the PR is worth merging.

@ortex
Copy link
Member

ortex commented May 26, 2023

PR is worth merging

Please, delete getValue from followed enums as well:

  • ChannelSet
  • FecEncoding
  • FrameEncoding
  • RocLogLevel
@codecov
Copy link

codecov bot commented May 26, 2023

Codecov Report

Merging #115 (55f55ad) into main (b433110) will increase coverage by 1.63%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main     #115      +/-   ##
============================================
+ Coverage     74.88%   76.51%   +1.63%     
  Complexity       81       81              
============================================
  Files            24       24              
  Lines           422      413       -9     
  Branches          2        2              
============================================
  Hits            316      316              
+ Misses          102       93       -9     
  Partials          4        4              
Impacted Files Coverage Δ
...n/java/org/rocstreaming/roctoolkit/ChannelSet.java 100.00% <ø> (+16.66%) ⬆️
.../java/org/rocstreaming/roctoolkit/ClockSource.java 100.00% <ø> (+14.28%) ⬆️
.../java/org/rocstreaming/roctoolkit/FecEncoding.java 100.00% <ø> (+11.11%) ⬆️
...ava/org/rocstreaming/roctoolkit/FrameEncoding.java 100.00% <ø> (+16.66%) ⬆️
...in/java/org/rocstreaming/roctoolkit/Interface.java 100.00% <ø> (ø)
...va/org/rocstreaming/roctoolkit/PacketEncoding.java 100.00% <ø> (+16.66%) ⬆️
...ain/java/org/rocstreaming/roctoolkit/Protocol.java 86.66% <ø> (+5.41%) ⬆️
.../org/rocstreaming/roctoolkit/ResamplerBackend.java 100.00% <ø> (+12.50%) ⬆️
.../org/rocstreaming/roctoolkit/ResamplerProfile.java 100.00% <ø> (+10.00%) ⬆️
.../java/org/rocstreaming/roctoolkit/RocLogLevel.java 100.00% <ø> (+10.00%) ⬆️
@gavv
Copy link
Member

gavv commented May 26, 2023

Side note. The number of commits is insane. Please don't create individual commit for every micro change. It creates a lot of noise in github and email notifications.

@PoulasthaMukherjee
Copy link
Contributor Author

@gavv I'm so sorry. I'll keep that in mind.

@PoulasthaMukherjee
Copy link
Contributor Author

PR is worth merging

Please, delete getValue from followed enums as well:

  • ChannelSet
  • FecEncoding
  • FrameEncoding
  • RocLogLevel

@ortex I did remove that from those enums. Are there any left in those files that I might have missed?

@ortex
Copy link
Member

ortex commented May 26, 2023

@ortex I did remove that from those enums. Are there any left in those files that I might have missed?

You didn't.
e.g. https://github.com/PoulasthaMukherjee/roc-java/blob/main/src/main/java/org/rocstreaming/roctoolkit/ChannelSet.java#L20-L22

@PoulasthaMukherjee
Copy link
Contributor Author

@ortex on it

@PoulasthaMukherjee
Copy link
Contributor Author

@ortex I have changed it

@ortex ortex merged commit 1685cdc into roc-streaming:main May 28, 2023
@ortex
Copy link
Member

ortex commented May 28, 2023

Merged. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants