-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Enhancement] fix compilable issue in UnmodifiableCollectionsSerializer #55016
base: main
Are you sure you want to change the base?
Conversation
throw new IllegalArgumentException("The type " + type + " is not supported."); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most risky bug in this code is:
Casting of collections may lead to ClassCastException
.
You can modify the code like this:
private Collection<?> getValues(Object coll) {
if (coll instanceof Collection) {
return new ArrayList<>((Collection<?>) coll);
}
throw new IllegalArgumentException("Provided object is not a collection.");
}
Additionally, it's essential to ensure that other parts of the code that use casting to specific collection types verify the type before casting. This adjustment prevents runtime exceptions when non-collection objects are passed inadvertently.
@gengjun-git plz help review the code. |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
package com.starrocks.connector.iceberg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you move it to this package com.starrocks.connector.share.iceberg
? and remove this package org.apache.iceberg
class with the same name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done @stephen-shelby
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Signed-off-by: zhaohehuhu <[email protected]>
Signed-off-by: zhaohehuhu <[email protected]>
Signed-off-by: zhaohehuhu <[email protected]>
Signed-off-by: zhaohehuhu <[email protected]>
Signed-off-by: zhaohehuhu <[email protected]>
Signed-off-by: zhaohehuhu <[email protected]>
Signed-off-by: zhaohehuhu <[email protected]>
Signed-off-by: zhaohehuhu <[email protected]>
Signed-off-by: zhaohehuhu <[email protected]>
Quality Gate passedIssues Measures |
[Java-Extensions Incremental Coverage Report]coverage check fail. please retry. 😨 Please let me know when error again. com.naver.nid.cover.parser.coverage.exception.ParseException: java.nio.file.NoSuchFileException: /home/runner/_work/starrocks/starrocks/java-extensions/result |
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Why I'm doing:
as title
What I'm doing:
Copy UnmodifiableCollectionsSerializer.java to sr repository to fix compilable issue:
Unable to make field final java.util.Collection java.util.Collections$UnmodifiableCollection.c accessible: module java.base does not "opens java.util" to unnamed module @61322f9d
Refer to magro/kryo-serializers#131
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: