Skip to content

Commit c5cc053

Browse files
committed
refs spotbugs#60: reproduce reported problem
1 parent 04b3cac commit c5cc053

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package edu.umd.cs.findbugs.detect;
2+
3+
import static org.junit.Assert.assertThat;
4+
5+
import static org.hamcrest.core.Is.is;
6+
7+
import static org.hamcrest.collection.IsEmptyIterable.*;
8+
import org.junit.Test;
9+
10+
import edu.umd.cs.findbugs.AbstractIntegrationTest;
11+
12+
public class FindUnsatisfiedObligationTest extends AbstractIntegrationTest {
13+
/**
14+
* @see <a href="https://github.com/spotbugs/spotbugs/issues/60">GitHub
15+
* issue</a>
16+
*/
17+
@Test
18+
public void testIssue60() {
19+
performAnalysis("Issue60.class");
20+
assertThat(getBugCollection(), is(emptyIterable()));
21+
}
22+
}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import java.io.IOException;
2+
import java.io.InputStream;
3+
import java.net.URL;
4+
import java.util.Properties;
5+
import java.util.stream.Stream;
6+
7+
public class Issue60 {
8+
9+
public static void create(URL url) {
10+
try (InputStream in = url.openStream()) {
11+
Properties p1 = new Properties();
12+
p1.load(in);
13+
} catch (IOException e) {
14+
}
15+
}
16+
17+
public Stream<String> keys() {
18+
return Stream.<Properties> of()
19+
.flatMap(p -> p.stringPropertyNames().stream());
20+
}
21+
22+
}

0 commit comments

Comments
 (0)