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

Remove redundant boxing and casting #5982

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Minimaximize
Copy link
Contributor

@Minimaximize Minimaximize commented Jan 19, 2020

Removed array instantiation where parameters could be accepted as VArgs
callbackClass.getMethod(callbackMethod, new Class[] { File.class }); =>
callbackClass.getMethod(callbackMethod, File.class);

Remove redundant unboxing where appropriate
(scale instanceof Integer && ((Integer)scale).intValue() == 2) =>
(scale instanceof Integer && (Integer) scale == 2)
In this case scale will automaticaly be unboxed to it's int value

Replace protected void handleMethods(String methodName) and
protected void handleMethods(String methodName, Object[] args)
with
protected void handleMethods(String methodName, Object...args)
as it handles both cases

Remove redundant extends Object clause from type wildcards
List<Disposable<? extends Object>> reachableWeakReferences =>
List<Disposable<?>> reachableWeakReferences

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.

None yet

1 participant