Skip to content

Commit 2dc7f80

Browse files
Changes
1 parent 4bd2ee0 commit 2dc7f80

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

java11/src/main/java/LocalVariableTypeInference.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static List<String> oldWay(List<String> names) {
2222
if (cal.get(Calendar.HOUR_OF_DAY) < 12) {
2323
timeOfDay = "morning";
2424
} else if (cal.get(Calendar.HOUR_OF_DAY) < 18) {
25-
timeOfDay = "evening";
25+
timeOfDay = "afternoon";
2626
}
2727
List<String> greets = new ArrayList<>();
2828
for (String name : names) {
@@ -37,7 +37,7 @@ public static List<String> java11(List<String> names) {
3737
if (cal.get(Calendar.HOUR_OF_DAY) < 12) {
3838
timeOfDay = "morning";
3939
} else if (cal.get(Calendar.HOUR_OF_DAY) < 18) {
40-
timeOfDay = "evening";
40+
timeOfDay = "afternoon";
4141
}
4242
var greets = new ArrayList<String>(); // point out that we need to put the type *somewhere*
4343
for (var name : names) {

java9/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<artifactId>java9</artifactId>
1313

1414
<properties>
15-
<maven.compiler.source>11</maven.compiler.source>
16-
<maven.compiler.target>11</maven.compiler.target>
15+
<maven.compiler.source>9</maven.compiler.source>
16+
<maven.compiler.target>9</maven.compiler.target>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
</properties>
1919

java9/src/main/java/PrivateMethodsInInterfaces.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class PrivateMethodsInInterfaces {
66
interface OldWay1 {
77

88

9-
default String actLikeATeenAger(String text) {
9+
default String actLikeATeenAger(String text) {
1010
return addEmojis(shout(text));
1111
}
1212

java9/src/main/java/TryWithResources.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ public List<String> goodWay() throws SQLException {
6565
* Good: Terse, we only have code for what we do
6666
*/
6767
public List<String> java9Way() throws SQLException {
68-
try (
69-
Connection con = DriverManager.getConnection(SQL_URL, SQL_USER, SQL_PASSWORD);
68+
try (Connection con = DriverManager.getConnection(SQL_URL, SQL_USER, SQL_PASSWORD);
7069
Statement stmt = con.createStatement();
7170
ResultSet rs = stmt.executeQuery("SELECT email FROM CLIENT WHERE name='Bob")) {
7271
List<String> emails = new ArrayList<>();

0 commit comments

Comments
 (0)