From ae9e05b9c7c742f7f5640f5f9fbfa090b9e6b0ba Mon Sep 17 00:00:00 2001 From: "Richard G. Curtis" Date: Fri, 11 May 2012 18:41:34 +0000 Subject: [PATCH] OPENJPA-2187: Generate correct source for a file that is in the default package. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1337325 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/openjpa/persistence/util/SourceCode.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/util/SourceCode.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/util/SourceCode.java index 95a1d10b8..9a6a71a44 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/util/SourceCode.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/util/SourceCode.java @@ -842,9 +842,10 @@ public class SourceCode { name = p; } - public void write(PrintWriter out, int tab) { - out.println("package " + name + SEMICOLON); - } + public void write(PrintWriter out, int tab) { + if (name != null && !name.isEmpty()) + out.println("package " + name + SEMICOLON); + } } class Comment {