forked from spotbugs/spotbugs
-
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.
refs spotbugs#60: reproduce reported problem
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
findbugs/src/test/java/edu/umd/cs/findbugs/detect/FindUnsatisfiedObligationTest.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,22 @@ | ||
package edu.umd.cs.findbugs.detect; | ||
|
||
import static org.junit.Assert.assertThat; | ||
|
||
import static org.hamcrest.core.Is.is; | ||
|
||
import static org.hamcrest.collection.IsEmptyIterable.*; | ||
import org.junit.Test; | ||
|
||
import edu.umd.cs.findbugs.AbstractIntegrationTest; | ||
|
||
public class FindUnsatisfiedObligationTest extends AbstractIntegrationTest { | ||
/** | ||
* @see <a href="https://github.com/spotbugs/spotbugs/issues/60">GitHub | ||
* issue</a> | ||
*/ | ||
@Test | ||
public void testIssue60() { | ||
performAnalysis("Issue60.class"); | ||
assertThat(getBugCollection(), is(emptyIterable())); | ||
} | ||
} |
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,22 @@ | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.net.URL; | ||
import java.util.Properties; | ||
import java.util.stream.Stream; | ||
|
||
public class Issue60 { | ||
|
||
public static void create(URL url) { | ||
try (InputStream in = url.openStream()) { | ||
Properties p1 = new Properties(); | ||
p1.load(in); | ||
} catch (IOException e) { | ||
} | ||
} | ||
|
||
public Stream<String> keys() { | ||
return Stream.<Properties> of() | ||
.flatMap(p -> p.stringPropertyNames().stream()); | ||
} | ||
|
||
} |