diff --git a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindOpenStream.java b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindOpenStream.java
index <HASH>..<HASH> 100644
--- a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindOpenStream.java
+++ b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindOpenStream.java
@@ -433,9 +433,17 @@ public class FindOpenStream extends ResourceTrackingDetector<Stream, FindOpenStr
 		return new StreamResourceTracker(bugReporter);
 	}
 
+	public static boolean isMainMethod(Method method) {
+		return  method.isStatic()
+			&& method.getName().equals("main")
+			&& method.getSignature().equals("([Ljava/lang/String;)V");
+		}
+		
 	public void analyzeMethod(ClassContext classContext, Method method, StreamResourceTracker resourceTracker)
 		throws CFGBuilderException, DataflowAnalysisException {
 
+		if (isMainMethod(method)) return;
+
 		potentialOpenStreamList.clear();
 
 		super.analyzeMethod(classContext, method, resourceTracker);
Don't warn about open streams not being closed in main methods


git-svn-id: <URL>