mirror of https://github.com/apache/openjpa.git
formatting
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@796784 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3bfcd22c9e
commit
1f58f05c52
|
@ -60,7 +60,7 @@ public class SourceCode {
|
||||||
private static final String[] BRACKET_ARGS = {"(", ")"};
|
private static final String[] BRACKET_ARGS = {"(", ")"};
|
||||||
private static final String[] BRACKET_PARAMS = {"<", ">"};
|
private static final String[] BRACKET_PARAMS = {"<", ">"};
|
||||||
|
|
||||||
private Comment comment;
|
private List<Comment> comments;
|
||||||
private final Package pkg;
|
private final Package pkg;
|
||||||
private final Class cls;
|
private final Class cls;
|
||||||
private final Set<Import> imports = new TreeSet<Import>();
|
private final Set<Import> imports = new TreeSet<Import>();
|
||||||
|
@ -106,9 +106,12 @@ public class SourceCode {
|
||||||
public SourceCode addComment(boolean inline, String... lines) {
|
public SourceCode addComment(boolean inline, String... lines) {
|
||||||
if (lines == null)
|
if (lines == null)
|
||||||
return this;
|
return this;
|
||||||
if (lines.length == 1 && lines[0].length() > 80)
|
if (lines.length == 1 && lines[0].length() > 120)
|
||||||
return addComment(inline, wrap(lines[0], 80-4));
|
return addComment(inline, wrap(lines[0], 120-4));
|
||||||
if (comment == null) comment = new Comment();
|
if (comments == null)
|
||||||
|
comments = new ArrayList<Comment>();
|
||||||
|
Comment comment = new Comment();
|
||||||
|
comments.add(comment);
|
||||||
comment.makeInline(inline);
|
comment.makeInline(inline);
|
||||||
for (String line:lines) comment.append(line);
|
for (String line:lines) comment.append(line);
|
||||||
return this;
|
return this;
|
||||||
|
@ -119,9 +122,11 @@ public class SourceCode {
|
||||||
* @param out
|
* @param out
|
||||||
*/
|
*/
|
||||||
public void write(PrintWriter out) {
|
public void write(PrintWriter out) {
|
||||||
if (comment != null) {
|
if (comments != null) {
|
||||||
comment.write(out, 0);
|
for (Comment comment : comments) {
|
||||||
out.println();
|
comment.write(out, 0);
|
||||||
|
out.println();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (pkg != null) {
|
if (pkg != null) {
|
||||||
pkg.write(out,0);
|
pkg.write(out,0);
|
||||||
|
|
Loading…
Reference in New Issue