diff --git a/wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.java b/wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.java index ce26c5a1ad..86820393c7 100644 --- a/wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.java +++ b/wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.java @@ -1,10 +1,5 @@ package com.baeldung.wicket.examples.cafeaddress; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; import org.apache.wicket.markup.html.WebPage; @@ -13,29 +8,29 @@ import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.model.PropertyModel; import org.apache.wicket.request.mapper.parameter.PageParameters; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + public class CafeAddress extends WebPage { - - private static final long serialVersionUID = 1L; - - String selectedCafe; - Address address; - Map cafeNamesAndAddresses = new HashMap<>(); + private String selectedCafe; + private Address address; + private Map cafeNamesAndAddresses = new HashMap<>(); public CafeAddress(final PageParameters parameters) { super(parameters); initCafes(); - ArrayList cafeNames = new ArrayList<>(this.cafeNamesAndAddresses.keySet()); - this.selectedCafe = cafeNames.get(0); - this.address = new Address(this.cafeNamesAndAddresses.get(this.selectedCafe).getAddress()); + ArrayList cafeNames = new ArrayList<>(cafeNamesAndAddresses.keySet()); + selectedCafe = cafeNames.get(0); + address = new Address(cafeNamesAndAddresses.get(selectedCafe).getAddress()); final Label addressLabel = new Label("address", new PropertyModel(this.address, "address")); addressLabel.setOutputMarkupId(true); - final DropDownChoice cafeDropdown = new DropDownChoice<>("cafes", new PropertyModel(this, "selectedCafe"), cafeNames); + final DropDownChoice cafeDropdown = new DropDownChoice<>("cafes", new PropertyModel<>(this, "selectedCafe"), cafeNames); cafeDropdown.add(new AjaxFormComponentUpdatingBehavior("onchange") { - private static final long serialVersionUID = 1L; - @Override protected void onUpdate(AjaxRequestTarget target) { String name = (String) cafeDropdown.getDefaultModel().getObject(); @@ -61,11 +56,11 @@ public class CafeAddress extends WebPage { this.sAddress = address; } - public String getAddress() { + String getAddress() { return this.sAddress; } - public void setAddress(String address) { + void setAddress(String address) { this.sAddress = address; } } diff --git a/wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.java b/wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.java index f819e05be6..6dc7295798 100644 --- a/wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.java +++ b/wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.java @@ -4,9 +4,6 @@ import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; public class HelloWorld extends WebPage { - - private static final long serialVersionUID = 1L; - public HelloWorld() { add(new Label("hello", "Hello World!")); }