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

Implement stable hashCode for records. #102

Closed
wants to merge 9 commits into from

Reverted spotless formatting

3a2f175
Select commit
Loading
Failed to load commit list.
Closed

Implement stable hashCode for records. #102

Reverted spotless formatting
3a2f175
Select commit
Loading
Failed to load commit list.
Codacy Production / Codacy Static Code Analysis required action Nov 13, 2023 in 0s

83 new issues (0 max.) of at least minor severity.

Codacy Here is an overview of what got changed by this pull request:

Issues
======
+ Solved 122
- Added 83
           

Complexity increasing per file
==============================
- pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/HashEqualsTest.java  1
- pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/HashBench.java  2
- pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/EqualsHashCodeBench.java  2
- pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java  23
         

See the complete overview on Codacy

Annotations

Check warning on line 234 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java#L234

Avoid reassigning parameters such as 'generatedCodeSoFar'

Check notice on line 122 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java#L122

File contains tab characters (this is the first instance).

Check notice on line 448 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java#L448

Unnecessary use of fully qualified name 'Common.getFieldsHashCode' due to existing static import 'com.hedera.pbj.compiler.impl.Common.*'

Check notice on line 483 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java#L483

Unnecessary use of fully qualified name 'Common.getFieldsEqualsStatements' due to existing static import 'com.hedera.pbj.compiler.impl.Common.*'

Check notice on line 532 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java#L532

Line is longer than 120 characters (found 146).

Check notice on line 713 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java#L713

Line is longer than 120 characters (found 139).

Check notice on line 823 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java#L823

Line is longer than 120 characters (found 174).

Check notice on line 832 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java#L832

Line is longer than 120 characters (found 149).

Check notice on line 115 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java#L115

File contains tab characters (this is the first instance).

Check notice on line 161 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java#L161

Line is longer than 80 characters (found 121).

Check notice on line 364 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java#L364

Line is longer than 120 characters (found 121).

Check notice on line 394 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java#L394

Line is longer than 120 characters (found 135).

Check notice on line 410 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java#L410

Line is longer than 120 characters (found 169).

Check notice on line 418 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java#L418

Line is longer than 120 characters (found 143).

Check notice on line 427 in pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/TestGenerator.java#L427

Line is longer than 120 characters (found 127).

Check notice on line 6 in pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/EqualsHashCodeBench.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/EqualsHashCodeBench.java#L6

Unused import - com.hedera.pbj.runtime.MalformedProtobufException.

Check notice on line 8 in pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/EqualsHashCodeBench.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/EqualsHashCodeBench.java#L8

Unused import - com.hedera.pbj.runtime.io.buffer.Bytes.

Check notice on line 9 in pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/EqualsHashCodeBench.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/EqualsHashCodeBench.java#L9

Unused import - com.hedera.pbj.runtime.io.stream.ReadableStreamingData.

Check notice on line 9 in pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/HashBench.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/HashBench.java#L9

Unused import - com.hedera.pbj.runtime.io.stream.ReadableStreamingData.

Check notice on line 13 in pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/HashBench.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/HashBench.java#L13

Unused import - com.hedera.pbj.test.proto.pbj.tests.HashevalTest.

Check notice on line 17 in pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/HashBench.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/HashBench.java#L17

Unused import - java.io.ByteArrayInputStream.

Check notice on line 19 in pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/HashBench.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/HashBench.java#L19

Using the '.*' form of import should be avoided - java.nio.*.

Check notice on line 3 in pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java#L3

Unused import - com.google.protobuf.CodedOutputStream.

Check notice on line 22 in pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java#L22

Unused import - org.junit.jupiter.api.Assertions.assertEquals.

Check warning on line 105 in pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java#L105

Avoid reassigning parameters such as 'val'