Skip to content

Commit

Permalink
chore: switch to GOOGLE code style
Browse files Browse the repository at this point in the history
  • Loading branch information
berezovskyi committed Dec 29, 2024
1 parent f007602 commit 6575028
Show file tree
Hide file tree
Showing 131 changed files with 19,831 additions and 16,889 deletions.
2 changes: 1 addition & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
</toggleOffOn>
<googleJavaFormat>
<version>1.24.0</version>
<style>AOSP</style>
<style>GOOGLE</style>
<reflowLongStrings>true</reflowLongStrings>
<formatJavadoc>true</formatJavadoc>
</googleJavaFormat>
Expand Down
24 changes: 12 additions & 12 deletions backend/src/main/java/org/osjava/norbert/AbstractRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@
/** Provides implementation for the path property and a handy toString. */
abstract class AbstractRule implements Rule {

private String path;
private String path;

public AbstractRule(String path) {
this.path = path.trim();
}
public AbstractRule(String path) {
this.path = path.trim();
}

/** A url path snippet for which a rule exists */
public String getPath() {
return this.path;
}
/** A url path snippet for which a rule exists */
public String getPath() {
return this.path;
}

public abstract Boolean isAllowed(String query);
public abstract Boolean isAllowed(String query);

public String toString() {
return getClass().getName() + " on " + this.path;
}
public String toString() {
return getClass().getName() + " on " + this.path;
}
}
28 changes: 14 additions & 14 deletions backend/src/main/java/org/osjava/norbert/AllowedRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@
/** A norobots Allow: rule. Any path which begins with the rule's path is allowed. */
class AllowedRule extends AbstractRule {

public AllowedRule(String path) {
super(path);
}
public AllowedRule(String path) {
super(path);
}

public Boolean isAllowed(String query) {
if ("".equals(super.getPath())) {
// What does the spec say here? Until I know, I'll just ignore this.
return null;
}
boolean test = query.startsWith(super.getPath());
if (!test) {
return null;
} else {
return Boolean.TRUE;
}
public Boolean isAllowed(String query) {
if ("".equals(super.getPath())) {
// What does the spec say here? Until I know, I'll just ignore this.
return null;
}
boolean test = query.startsWith(super.getPath());
if (!test) {
return null;
} else {
return Boolean.TRUE;
}
}
}
26 changes: 13 additions & 13 deletions backend/src/main/java/org/osjava/norbert/DisallowedRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
/** A norobots Disallow: rule. Any path which begins with the rule's path is not allowed. */
class DisallowedRule extends AbstractRule {

public DisallowedRule(String path) {
super(path);
}
public DisallowedRule(String path) {
super(path);
}

public Boolean isAllowed(String query) {
if ("".equals(super.getPath())) {
return Boolean.TRUE;
}
boolean test = query.startsWith(super.getPath());
if (!test) {
return null;
} else {
return Boolean.FALSE;
}
public Boolean isAllowed(String query) {
if ("".equals(super.getPath())) {
return Boolean.TRUE;
}
boolean test = query.startsWith(super.getPath());
if (!test) {
return null;
} else {
return Boolean.FALSE;
}
}
}
Loading

0 comments on commit 6575028

Please sign in to comment.