-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
91 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version=2021.6.4 | ||
version=2021.6.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/test/java/examples/java/noreceiver/kotlinmap/Correct.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package examples.java.noreceiver.kotlinmap; | ||
|
||
import java.util.Map; | ||
|
||
public class Correct { | ||
public static int sumValues(Map<String, Integer> map) { | ||
int sum = 0; | ||
for (int value : map.values()) { | ||
sum += value; | ||
} | ||
return sum; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package examples.java.noreceiver.kotlinmap | ||
|
||
fun sumValues(map: Map<String, Int>): Int { | ||
var sum = 0 | ||
for (value in map.values) { | ||
sum += value | ||
} | ||
return sum | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/java/examples/java/noreceiver/kotlinmap/Incorrect0.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package examples.java.noreceiver.kotlinmap; | ||
|
||
import java.util.Map; | ||
|
||
public class Incorrect0 { | ||
public static int sumValues(Map<String, Integer> map) { | ||
return 0; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/java/examples/java/noreceiver/kotlinprintmap/Correct.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package examples.java.noreceiver.kotlinprintmap; | ||
|
||
import java.util.Map; | ||
|
||
public class Correct { | ||
public static void printValues(Map<String, Integer> map) { | ||
for (int value : map.values()) { | ||
System.out.println(value); | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/test/java/examples/java/noreceiver/kotlinprintmap/Correct0.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package examples.java.noreceiver.kotlinprintmap | ||
|
||
fun printValues(map: Map<String, Int>) { | ||
for (value in map.values) { | ||
println(value) | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/java/examples/java/noreceiver/kotlinprintmap/Incorrect0.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package examples.java.noreceiver.kotlinprintmap; | ||
|
||
import java.util.Map; | ||
|
||
public class Incorrect0 { | ||
public static void printValues(Map<String, Integer> map) { | ||
return; | ||
} | ||
} |