Skip to content

Commit

Permalink
refs spotbugs#60: reproduce reported problem
Browse files Browse the repository at this point in the history
  • Loading branch information
KengoTODA committed Dec 6, 2016
1 parent 04b3cac commit c5cc053
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
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()));
}
}
22 changes: 22 additions & 0 deletions findbugsTestCases/src/java/Issue60.java
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());
}

}

0 comments on commit c5cc053

Please sign in to comment.