-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
8 changed files
with
115 additions
and
42 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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,27 @@ | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.function.Function; | ||
import org.checkerframework.checker.i18n.qual.Localized; | ||
import org.checkerframework.checker.nullness.qual.NonNull; | ||
import org.checkerframework.common.subtyping.qual.Bottom; | ||
|
||
interface Importer { | ||
List<Pair<@Localized String, List<String>>> getSupportedFileTypes(); | ||
} | ||
|
||
interface Pair<A, B> { | ||
B getSecond(); | ||
} | ||
|
||
public class ImporterManager { | ||
private static final List<Importer> registeredImporters = new ArrayList<>(); | ||
|
||
public static void chooseAndImportFile(Object parent) { | ||
Function<@NonNull ?, @NonNull ?> x = | ||
(@NonNull Importer imp) -> | ||
imp.getSupportedFileTypes().stream() | ||
.flatMap( | ||
(@Bottom Pair<@Localized String, List<String>> p) -> | ||
p.getSecond().stream()); | ||
} | ||
} |
Binary file not shown.
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 @@ | ||
Test case for issue #2173: https://github.com/typetools/checker-framework/issues/2173 | ||
|
||
ImporterManager.class was compiled use a Java 8 compiler. The compiler copied | ||
the annotation from a a lambda to a method parameter type argument, but the | ||
parameter does not have a type argument. This bug has been fixed in Java 9, | ||
but byte code generated by Java 8 can still be read by a checker, so this test | ||
that it won't crash a checker. |
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 @@ | ||
/* | ||
* @test | ||
* @summary Test case for issue #2173: https://github.com/typetools/checker-framework/issues/2173 | ||
* See README in this directory. | ||
* | ||
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker View.java | ||
*/ | ||
|
||
public class View { | ||
private static void createTable() { | ||
ImporterManager.chooseAndImportFile(""); | ||
} | ||
} |
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