diff --git a/README.md b/README.md index 34befb63..c877b3a0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Bugs](https://raw.githubusercontent.com/uhafner/codingstyle/main/badges/bugs.svg)](https://github.com/uhafner/codingstyle/actions/workflows/quality-monitor-pit.yml) Each Java project should follow a consistent coding style. -I.e., all contributions to the source code should use the same formatting rules, design principles, code patterns, idioms, etc. +All contributions should follow the same formatting rules, design principles, code patterns, and idioms. This coding style provides the set of rules that I am using in my lectures about software development at Munich University of Applied Sciences. This project describes the coding style in detail (currently only available in German) and serves as a template project. diff --git a/src/main/java/edu/hm/hafner/util/LineRangeList.java b/src/main/java/edu/hm/hafner/util/LineRangeList.java index 62bfe8ac..4aad16c0 100644 --- a/src/main/java/edu/hm/hafner/util/LineRangeList.java +++ b/src/main/java/edu/hm/hafner/util/LineRangeList.java @@ -317,7 +317,7 @@ private void write(final LineRange r) { * * @return {@code true} if the read value is equal to the specified range */ - public boolean compare(final LineRange other) { + private boolean compare(final LineRange other) { int s = read(); int d = read(); return other.getStart() == s && other.getEnd() == s + d; @@ -366,7 +366,7 @@ public int previousIndex() { throw new UnsupportedOperationException("previousIndex is not supported"); } - public Cursor copy() { + private Cursor copy() { return new Cursor(position); } @@ -389,7 +389,7 @@ private void adjust(final int diff) { * * @return the changed line range */ - public LineRange rewrite(final LineRange other) { + private LineRange rewrite(final LineRange other) { var c = copy(); var old = c.next(); int oldSize = c.position - position; @@ -419,7 +419,7 @@ public void add(final LineRange v) { * * @return the deleted element */ - public LineRange delete() { + private LineRange delete() { var c = copy(); var old = c.next(); adjust(position - c.position); diff --git a/src/main/java/edu/hm/hafner/util/TreeStringBuilder.java b/src/main/java/edu/hm/hafner/util/TreeStringBuilder.java index f45570d2..7e9f7ab7 100644 --- a/src/main/java/edu/hm/hafner/util/TreeStringBuilder.java +++ b/src/main/java/edu/hm/hafner/util/TreeStringBuilder.java @@ -79,7 +79,7 @@ private static final class Child { * * @return the node */ - public Child intern(final String string) { + private Child intern(final String string) { if (string.isEmpty()) { return this; }