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

fix #1245 #1375

Merged
merged 1 commit into from
Feb 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,19 @@ protected static Object getParamArg(Class cl) {
else if (boolean.class.equals(cl))
return Boolean.FALSE;
else if (byte.class.equals(cl))
return new Byte((byte) 0);
return 0;
else if (short.class.equals(cl))
return new Short((short) 0);
return 0;
else if (char.class.equals(cl))
return new Character((char) 0);
return 0;
else if (int.class.equals(cl))
return Integer.valueOf(0);
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, do you think we should merge these else statements?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean change like this

protected static Object getParamArg(Class cl) {
        if (!cl.isPrimitive())
            return null;
        else if (boolean.class.equals(cl))
            return Boolean.FALSE;
        else if (byte.class.equals(cl) 
                || short.class.equals(cl) 
                || char.class.equals(cl) 
                || int.class.equals(cl))
            return 0;
        else if (long.class.equals(cl))
            return 0L;
        else if (float.class.equals(cl))
            return 0F;
        else if (double.class.equals(cl))
            return 0D;
        else
            throw new UnsupportedOperationException();
    }

It's ok with me to do so

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, let's keep is as it is.

else if (long.class.equals(cl))
return Long.valueOf(0);
return 0L;
else if (float.class.equals(cl))
return Float.valueOf(0);
return 0F;
else if (double.class.equals(cl))
return Double.valueOf(0);
return 0D;
else
throw new UnsupportedOperationException();
}
Expand Down