Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c30c24a

Browse filesBrowse files
authored
Merge pull request #4729 from johanneskloos/make-some-pretty-printer-methods-protected
Make some helper methods protected in DefaultPrettyPrinterVisitor
2 parents 5e4f4fc + d6958b0 commit c30c24a
Copy full SHA for c30c24a

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinterVisitor.java

Copy file name to clipboardExpand all lines: javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinterVisitor.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,7 +1932,7 @@ public void visit(UnparsableStmt n, Void arg) {
19321932
* and finally to {@link DefaultImportOrderingStrategy}, and out them in groups, seperated by
19331933
* newlines.
19341934
*/
1935-
private void printImports(NodeList<ImportDeclaration> imports, Void arg) {
1935+
protected void printImports(NodeList<ImportDeclaration> imports, Void arg) {
19361936
ImportOrderingStrategy strategy = new DefaultImportOrderingStrategy();
19371937
// Get Import strategy from configuration
19381938
Optional<ConfigurationOption> optionalStrategy = getOption(ConfigOption.SORT_IMPORTS_STRATEGY);
@@ -1960,7 +1960,7 @@ private void printImports(NodeList<ImportDeclaration> imports, Void arg) {
19601960
/**
19611961
* Print all orphaned comments coming right before {@code node}.
19621962
*/
1963-
private void printOrphanCommentsBeforeThisChildNode(final Node node) {
1963+
protected void printOrphanCommentsBeforeThisChildNode(final Node node) {
19641964
if (!getOption(ConfigOption.PRINT_COMMENTS).isPresent()) return;
19651965
if (node instanceof Comment) return;
19661966
Node parent = node.getParentNode().orElse(null);
@@ -1995,7 +1995,7 @@ private void printOrphanCommentsBeforeThisChildNode(final Node node) {
19951995
/**
19961996
* Print all orphan comments coming at the end of the given {@code node}.
19971997
*/
1998-
private void printOrphanCommentsEnding(final Node node) {
1998+
protected void printOrphanCommentsEnding(final Node node) {
19991999
if (!getOption(ConfigOption.PRINT_COMMENTS).isPresent()) return;
20002000
List<Node> everything = new ArrayList<>(node.getChildNodes());
20012001
sortByBeginPosition(everything);
@@ -2033,7 +2033,7 @@ private void unindentIf(boolean expr) {
20332033
/**
20342034
* Get the value of a given configuration option.
20352035
*/
2036-
private Optional<ConfigurationOption> getOption(ConfigOption cOption) {
2036+
protected Optional<ConfigurationOption> getOption(ConfigOption cOption) {
20372037
return configuration.get(new DefaultConfigurationOption(cOption));
20382038
}
20392039
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.