Skip to content

Commit 1383efe

Browse files
committed
Consistent code formatting
1 parent 6e26108 commit 1383efe

File tree

64 files changed

+720
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+720
-299
lines changed

airline/client/axis1/src/main/java/org/springframework/ws/samples/airline/client/axis1/AxisMain.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2006 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,7 +24,8 @@
2424
import javax.xml.rpc.ServiceException;
2525

2626
/**
27-
* Simple client that calls the <code>GetFlights</code> and <code>BookFlight</code> operations using JAX-RPC (Axis 1).
27+
* Simple client that calls the <code>GetFlights</code> and <code>BookFlight</code>
28+
* operations using JAX-RPC (Axis 1).
2829
*
2930
* @author Arjen Poutsma
3031
*/

airline/client/jax-ws/src/main/java/org/springframework/ws/samples/airline/client/jaxws/JaxWsMain.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2006 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -28,7 +28,8 @@
2828
import javax.xml.namespace.QName;
2929

3030
/**
31-
* Simple client that calls the <code>GetFlights</code> and <code>BookFlight</code> operations using JAX-WS.
31+
* Simple client that calls the <code>GetFlights</code> and <code>BookFlight</code>
32+
* operations using JAX-WS.
3233
*
3334
* @author Arjen Poutsma
3435
*/
@@ -41,7 +42,8 @@ public static void main(String[] args) throws MalformedURLException, DatatypeCon
4142

4243
if (args.length == 0) {
4344
service = new AirlineService();
44-
} else {
45+
}
46+
else {
4547
QName serviceName = new QName("http://www.springframework.org/spring-ws/samples/airline/definitions",
4648
"AirlineService");
4749
service = new AirlineService(new URL(args[0]), serviceName);
@@ -52,8 +54,8 @@ public static void main(String[] args) throws MalformedURLException, DatatypeCon
5254
GetFlightsRequest request = new GetFlightsRequest();
5355
request.setFrom("AMS");
5456
request.setTo("VCE");
55-
XMLGregorianCalendar departureDate = DatatypeFactory.newInstance().newXMLGregorianCalendarDate(2006, 1, 31,
56-
DatatypeConstants.FIELD_UNDEFINED);
57+
XMLGregorianCalendar departureDate = DatatypeFactory.newInstance()
58+
.newXMLGregorianCalendarDate(2006, 1, 31, DatatypeConstants.FIELD_UNDEFINED);
5759
request.setDepartureDate(departureDate);
5860

5961
System.out.format("Requesting flights on %1tD%n", departureDate.toGregorianCalendar());
@@ -75,7 +77,8 @@ public static void main(String[] args) throws MalformedURLException, DatatypeCon
7577
writeTicket(ticket);
7678
}
7779

78-
} catch (SOAPFaultException ex) {
80+
}
81+
catch (SOAPFaultException ex) {
7982
System.out.format("SOAP Fault Code %1s%n", ex.getFault().getFaultCodeAsQName());
8083
System.out.format("SOAP Fault String: %1s%n", ex.getFault().getFaultString());
8184
}

airline/client/jms/src/main/java/org/springframework/ws/samples/airline/client/jms/JmsClient.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2006 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,7 +21,9 @@
2121
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;
2222
import org.springframework.xml.transform.StringSource;
2323

24-
/** @author Arjen Poutsma */
24+
/**
25+
* @author Arjen Poutsma
26+
*/
2527
public class JmsClient extends WebServiceGatewaySupport {
2628

2729
private static final String PAYLOAD = "<airline:GetFlightsRequest xmlns:airline=\"http://www.springframework.org/spring-ws/samples/airline/schemas/messages\">"
@@ -31,4 +33,5 @@ public class JmsClient extends WebServiceGatewaySupport {
3133
public void getFlights() {
3234
getWebServiceTemplate().sendSourceAndReceiveToResult(new StringSource(PAYLOAD), new StreamResult(System.out));
3335
}
36+
3437
}

airline/client/jms/src/main/java/org/springframework/ws/samples/airline/client/jms/JmsConfiguration.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -43,4 +43,5 @@ JmsClient jmsClient(JmsMessageSender messageSender) {
4343
jmsClient.setMessageSender(messageSender);
4444
return jmsClient;
4545
}
46+
4647
}

airline/client/jms/src/main/java/org/springframework/ws/samples/airline/client/jms/JmsMain.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -39,4 +39,5 @@ CommandLineRunner getFlights(JmsClient client) {
3939
client.getFlights();
4040
};
4141
}
42+
4243
}

airline/client/saaj/src/main/java/org/springframework/ws/samples/airline/client/saaj/GetFlights.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2005-2011 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -79,7 +79,8 @@ public void getFlights() throws SOAPException, IOException, TransformerException
7979
SOAPMessage response = connection.call(request, url);
8080
if (!response.getSOAPBody().hasFault()) {
8181
writeGetFlightsResponse(response);
82-
} else {
82+
}
83+
else {
8384
SOAPFault fault = response.getSOAPBody().getFault();
8485
System.err.println("Received SOAP Fault");
8586
System.err.println("SOAP Fault Code: " + fault.getFaultCode());
@@ -91,7 +92,8 @@ private void writeGetFlightsResponse(SOAPMessage message) throws SOAPException,
9192
SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
9293
Name getFlightsResponseName = envelope.createName("GetFlightsResponse", PREFIX, NAMESPACE_URI);
9394
SOAPBodyElement getFlightsResponseElement = (SOAPBodyElement) message.getSOAPBody()
94-
.getChildElements(getFlightsResponseName).next();
95+
.getChildElements(getFlightsResponseName)
96+
.next();
9597
Name flightName = envelope.createName("flight", PREFIX, NAMESPACE_URI);
9698
Iterator iterator = getFlightsResponseElement.getChildElements(flightName);
9799
Transformer transformer = transfomerFactory.newTransformer();
@@ -106,4 +108,5 @@ private void writeGetFlightsResponse(SOAPMessage message) throws SOAPException,
106108
transformer.transform(source, new StreamResult(System.out));
107109
}
108110
}
111+
109112
}

airline/client/saaj/src/main/java/org/springframework/ws/samples/airline/client/saaj/SaajMain.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2005-2011 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -38,4 +38,5 @@ public static void main(String[] args) throws Exception {
3838
GetFlights getFlights = new GetFlights(url);
3939
getFlights.getFlights();
4040
}
41+
4142
}

airline/client/spring-ws/src/main/java/org/springframework/ws/samples/airline/client/sws/GetFlights.java

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2005-2011 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -40,22 +40,24 @@ public void getFlights() {
4040
getFlightsRequest.setTo("VCE");
4141
XMLGregorianCalendar departureDate = null;
4242
try {
43-
departureDate = DatatypeFactory.newInstance().newXMLGregorianCalendarDate(2006, 1, 31,
44-
DatatypeConstants.FIELD_UNDEFINED);
45-
} catch (DatatypeConfigurationException e) {
43+
departureDate = DatatypeFactory.newInstance()
44+
.newXMLGregorianCalendarDate(2006, 1, 31, DatatypeConstants.FIELD_UNDEFINED);
45+
}
46+
catch (DatatypeConfigurationException e) {
4647
throw new RuntimeException(e);
4748
}
4849

4950
getFlightsRequest.setDepartureDate(departureDate);
5051

5152
System.out.println("Requesting flights on " + departureDate);
52-
GetFlightsResponse response = null;
53-
try {
54-
response = (GetFlightsResponse) getWebServiceTemplate().marshalSendAndReceive(getFlightsRequest);
55-
} catch (Exception e) {
56-
throw new RuntimeException(e);
57-
}
58-
System.out.println("Got " + response.getFlight().size() + " results");
53+
GetFlightsResponse response = null;
54+
try {
55+
response = (GetFlightsResponse) getWebServiceTemplate().marshalSendAndReceive(getFlightsRequest);
56+
}
57+
catch (Exception e) {
58+
throw new RuntimeException(e);
59+
}
60+
System.out.println("Got " + response.getFlight().size() + " results");
5961
if (response.getFlight().size() > 0) {
6062
// Book the first flight using John Doe as a frequent flyer
6163
BookFlightRequest bookFlightRequest = new BookFlightRequest();
@@ -66,7 +68,7 @@ public void getFlights() {
6668
bookFlightRequest.setPassengers(passengers);
6769

6870
JAXBElement<Ticket> ticket = (JAXBElement<Ticket>) getWebServiceTemplate()
69-
.marshalSendAndReceive(bookFlightRequest);
71+
.marshalSendAndReceive(bookFlightRequest);
7072

7173
writeTicket(ticket.getValue());
7274
}
@@ -92,11 +94,12 @@ private void writeFlight(Flight flight) {
9294
System.out.println(flight.getDepartureTime());
9395
System.out.println(flight.getNumber() + "\t" + flight.getServiceClass());
9496
System.out.println("------------");
95-
System.out.println(
96-
"Depart:\t" + flight.getFrom().getCode() + "-" + flight.getFrom().getName() + "\t" + flight.getDepartureTime());
97+
System.out.println("Depart:\t" + flight.getFrom().getCode() + "-" + flight.getFrom().getName() + "\t"
98+
+ flight.getDepartureTime());
9799
System.out.println("\t" + flight.getFrom().getCity());
98-
System.out.println(
99-
"Arrive:\t" + flight.getTo().getCode() + "-" + flight.getTo().getName() + "\t" + flight.getArrivalTime());
100+
System.out.println("Arrive:\t" + flight.getTo().getCode() + "-" + flight.getTo().getName() + "\t"
101+
+ flight.getArrivalTime());
100102
System.out.println("\t" + flight.getTo().getCity());
101103
}
104+
102105
}

airline/client/spring-ws/src/main/java/org/springframework/ws/samples/airline/client/sws/GetFrequentFlyerMileage.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2005-2011 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,4 +36,5 @@ public void getFrequentFlyerMileage() {
3636

3737
getWebServiceTemplate().sendSourceAndReceiveToResult(source, new StreamResult(System.out));
3838
}
39+
3940
}

airline/client/spring-ws/src/main/java/org/springframework/ws/samples/airline/client/sws/SpringWsMain.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2005-2011 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@ public static void main(String[] args) {
3333
GetFrequentFlyerMileage getFrequentFlyerMileage = ctx.getBean(GetFrequentFlyerMileage.class);
3434
getFrequentFlyerMileage.getFrequentFlyerMileage();
3535
}
36+
3637
}

0 commit comments

Comments
 (0)