Skip to content

Commit

Permalink
Polish. Fixed warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
traceyyoshima committed Nov 21, 2023
1 parent 58c9086 commit 3b7f289
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ public J visitMethodInvocation(J.MethodInvocation method, PrintOutputCapture<P>
@Override
public void visitModifier(J.Modifier mod, PrintOutputCapture<P> p) {
visit(mod.getAnnotations(), p);
String keyword = "";
String keyword;
switch (mod.getType()) {
case Default:
keyword = "default";
Expand Down Expand Up @@ -844,7 +844,7 @@ public Space visitSpace(Space space, Space.Location loc, PrintOutputCapture<P> p
}

@Override
public Markers visitMarkers(Markers markers, PrintOutputCapture<P> pPrintOutputCapture) {
public Markers visitMarkers(@Nullable Markers markers, PrintOutputCapture<P> pPrintOutputCapture) {
return delegate.visitMarkers(markers, pPrintOutputCapture);
}
}
7 changes: 2 additions & 5 deletions src/main/java/org/openrewrite/javascript/tree/JS.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ public CoordinateBuilder.Expression getCoordinates() {
}
}

@SuppressWarnings("unchecked")
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
@EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true)
@Data
Expand Down Expand Up @@ -560,18 +559,17 @@ public Export withInitializer(@Nullable JLeftPadded<Expression> initializer) {
}
}

@Getter
@SuppressWarnings("unchecked")
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
@EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true)
@AllArgsConstructor
final class ExpressionStatement implements JS, Expression, Statement {

@With
@Getter
UUID id;

@With
@Getter
Expression expression;

@Override
Expand Down Expand Up @@ -1275,18 +1273,17 @@ public ObjectBindingDeclarations withInitializer(@Nullable JLeftPadded<Expressio
}
}

@Getter
@SuppressWarnings("unchecked")
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
@EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true)
@AllArgsConstructor
final class StatementExpression implements JS, Expression, Statement {

@With
@Getter
UUID id;

@With
@Getter
Statement statement;

@Override
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/org/openrewrite/javascript/tree/JsContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
*/
package org.openrewrite.javascript.tree;

import lombok.Getter;

public class JsContainer {
@Getter
public enum Location {
ARRAY_LITERAL_EXPRESSION(JsSpace.Location.ARRAY_LITERAL_ELEMENTS, JsRightPadded.Location.ARRAY_LITERAL_ELEMENT_SUFFIX),
BINDING_ELEMENT(JsSpace.Location.BINDING_ELEMENTS, JsRightPadded.Location.BINDING_ELEMENT_SUFFIX),
Expand All @@ -32,12 +35,5 @@ public enum Location {
this.elementLocation = elementLocation;
}

public JsSpace.Location getBeforeLocation() {
return beforeLocation;
}

public JsRightPadded.Location getElementLocation() {
return elementLocation;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
*/
package org.openrewrite.javascript.tree;

import lombok.Getter;

public class JsRightPadded {
@Getter
public enum Location {
ALIAS_PROPERTY_NAME(JsSpace.Location.ALIAS_PROPERTY_NAME_PREFIX),
ARRAY_LITERAL_ELEMENT_SUFFIX(JsSpace.Location.ARRAY_LITERAL_SUFFIX),
Expand All @@ -35,8 +38,5 @@ public enum Location {
this.afterLocation = afterLocation;
}

public JsSpace.Location getAfterLocation() {
return afterLocation;
}
}
}

0 comments on commit 3b7f289

Please sign in to comment.