-
Notifications
You must be signed in to change notification settings - Fork 161
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 HasUrlParameter serialization and deserialization #2576
Conversation
Fixes urlParameter deserialization to work with all supported types. Fixes serialization for getUrl.
This will fix demo-static-menu-router blogs |
Reviewed 2 of 3 files at r1, 1 of 1 files at r2. flow-server/src/main/java/com/vaadin/router/HasUrlParameter.java, line 77 at r2 (raw file):
Quoted 4 lines of code…> throw new UnsupportedOperationException( > "Wildcard parameter can only be for String type by default. Implement `deserializeUrlParameters` for class " > + this.getClass().getName()); > }This code may be is going to be evolved. So please extract this into a separate method. flow-server/src/main/java/com/vaadin/router/HasUrlParameter.java, line 89 at r2 (raw file):
Quoted 11 lines of code…> if (parameterType.isAssignableFrom(String.class)) { > return (T) parameter; > } else if (parameterType.isAssignableFrom(Integer.class)) { > return (T) Integer.valueOf(parameter); > } else if (parameterType.isAssignableFrom(Long.class)) { > return (T) Long.valueOf(parameter); > } else if (parameterType.isAssignableFrom(Boolean.class)) { > return (T) Boolean.valueOf(parameter); > } else { > throw new IllegalArgumentException("Bad type."); > }This also looks like potentially evolving code. flow-server/src/main/java/com/vaadin/router/HasUrlParameter.java, line 91 at r2 (raw file):
Not descriptive enough. flow-server/src/main/java/com/vaadin/router/Router.java, line 199 at r2 (raw file):
flow-server/src/main/java/com/vaadin/router/Router.java, line 200 at r2 (raw file):
flow-server/src/main/java/com/vaadin/router/Router.java, line 210 at r2 (raw file):
plural please Comments from Reviewable |
Review status: 1 of 4 files reviewed at latest revision, 7 unresolved discussions. flow-server/src/main/java/com/vaadin/router/HasUrlParameter.java, line 77 at r2 (raw file): Previously, denis-anisimov (Denis) wrote…
Done. flow-server/src/main/java/com/vaadin/router/HasUrlParameter.java, line 89 at r2 (raw file): Previously, denis-anisimov (Denis) wrote…
Done. flow-server/src/main/java/com/vaadin/router/HasUrlParameter.java, line 91 at r2 (raw file): Previously, denis-anisimov (Denis) wrote…
Done. flow-server/src/main/java/com/vaadin/router/Router.java, line 199 at r2 (raw file): Previously, denis-anisimov (Denis) wrote…
Using @code as anyone coding this should know what a Boolean and a String is. flow-server/src/main/java/com/vaadin/router/Router.java, line 200 at r2 (raw file):
flow-server/src/main/java/com/vaadin/router/Router.java, line 210 at r2 (raw file): Previously, denis-anisimov (Denis) wrote…
Done. Comments from Reviewable |
Reviewed 3 of 3 files at r3. Comments from Reviewable |
Reviewed 2 of 2 files at r4. Comments from Reviewable |
Reviewed 1 of 1 files at r5. Comments from Reviewable |
Reviewed 1 of 1 files at r6. Comments from Reviewable |
Fixes urlParameter deserialization to work with all supported types.
Fixes serialization for getUrl.
This change is