From 06c492c5484c8296b6bf0f7662b48f51b0190eef Mon Sep 17 00:00:00 2001 From: Laurens Westerlaken Date: Wed, 27 Nov 2024 16:11:53 +0100 Subject: [PATCH 1/6] Add CSharp implementation that is also returned when a NamingService is requested from a Cs.CompilationUnit --- .../csharp/service/CSharpNamingService.java | 58 +++++++++++++++++ .../csharp/service/package-info.java | 21 ++++++ .../java/org/openrewrite/csharp/tree/Cs.java | 65 +++++++++++-------- 3 files changed, 117 insertions(+), 27 deletions(-) create mode 100644 rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java create mode 100644 rewrite-csharp/src/main/java/org/openrewrite/csharp/service/package-info.java diff --git a/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java new file mode 100644 index 0000000..f53a44b --- /dev/null +++ b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java @@ -0,0 +1,58 @@ +/* + * Copyright 2023 the original author or authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * https://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.openrewrite.csharp.service; + +import org.openrewrite.internal.NameCaseConvention; +import org.openrewrite.internal.NamingService; + +import java.util.regex.Pattern; + +public class CSharpNamingService implements NamingService { + + private static final Pattern SNAKE_CASE = Pattern.compile("^[a-zA-Z0-9]+_\\w+$"); + + @Override + public String getMethodName(String oldMethodName) { + StringBuilder result = new StringBuilder(); + if (SNAKE_CASE.matcher(oldMethodName).matches()) { + result.append(NameCaseConvention.format(NameCaseConvention.UPPER_CAMEL, oldMethodName)); + } else { + int nameLength = oldMethodName.length(); + for (int i = 0; i < nameLength; i++) { + char c = oldMethodName.charAt(i); + + if (i == 0) { + // the java specification requires identifiers to start with [a-zA-Z$_] + if (c != '$' && c != '_') { + result.append(Character.toUpperCase(c)); + } + } else { + if (!Character.isLetterOrDigit(c)) { + while (i < nameLength && (!Character.isLetterOrDigit(c) || c > 'z')) { + c = oldMethodName.charAt(i++); + } + if (i < nameLength) { + result.append(Character.toUpperCase(c)); + } + } else { + result.append(c); + } + } + } + } + return result.toString(); + } +} diff --git a/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/package-info.java b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/package-info.java new file mode 100644 index 0000000..6c389d6 --- /dev/null +++ b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2023 the original author or authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * https://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@NullMarked +@NonNullFields +package org.openrewrite.csharp.service; + +import org.jspecify.annotations.NullMarked; +import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java b/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java index 712ba51..138310e 100644 --- a/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java +++ b/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java @@ -22,6 +22,8 @@ import org.openrewrite.*; import org.openrewrite.csharp.CSharpPrinter; import org.openrewrite.csharp.CSharpVisitor; +import org.openrewrite.csharp.service.CSharpNamingService; +import org.openrewrite.internal.NamingService; import org.openrewrite.internal.ListUtils; import org.openrewrite.java.JavaPrinter; import org.openrewrite.java.JavaTypeVisitor; @@ -72,7 +74,7 @@ final class CompilationUnit implements Cs, JavaSourceFile { @Nullable @NonFinal - transient WeakReference padding; + transient WeakReference padding; @Getter @With @@ -264,8 +266,17 @@ public Padding getPadding() { return p; } + @Override + @Incubating(since = "8.2.0") + public T service(Class service) { + if (NamingService.class.getName().equals(service.getName())) { + return (T) new CSharpNamingService(); + } + return JavaSourceFile.super.service(service); + } + @RequiredArgsConstructor - public static class Padding implements JavaSourceFile.Padding { + public static class Padding implements JavaSourceFile.Padding { private final Cs.CompilationUnit t; @Override @@ -505,7 +516,9 @@ final class Argument implements Cs, Expression { @With Keyword refKindKeyword; - public @Nullable Identifier getNameColumn() { return nameColumn == null ? null : nameColumn.getElement(); } + public @Nullable Identifier getNameColumn() { + return nameColumn == null ? null : nameColumn.getElement(); + } public Argument withNameColumn(@Nullable Identifier nameColumn) { return getPadding().withNameColumn(JRightPadded.withElement(this.nameColumn, nameColumn)); @@ -1602,7 +1615,7 @@ public

J acceptCSharp(CSharpVisitor

v, P p) { return v.visitInterpolation(this, p); } - public Padding getPadding() { + public Padding getPadding() { Padding p; if (this.padding == null) { p = new Padding(this); @@ -1966,7 +1979,7 @@ public PropertyDeclaration withType(@Nullable JavaType type) { } public @Nullable NameTree getInterfaceSpecifier() { - return interfaceSpecifier!= null ? interfaceSpecifier.getElement() : null; + return interfaceSpecifier != null ? interfaceSpecifier.getElement() : null; } public PropertyDeclaration withInterfaceSpecifier(@Nullable NameTree interfaceSpecifier) { @@ -2059,13 +2072,11 @@ public PropertyDeclaration withInitializer(@Nullable JLeftPadded ini } - @Getter @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true) @RequiredArgsConstructor - final class Keyword implements Cs - { + final class Keyword implements Cs { @With @Getter @EqualsAndHashCode.Include @@ -2145,7 +2156,7 @@ public CoordinateBuilder.Statement getCoordinates() { @Override public Cs.Lambda withType(@Nullable JavaType type) { - return this.getType() == type ? this : new Cs.Lambda( + return this.getType() == type ? this : new Cs.Lambda( id, prefix, markers, @@ -2491,12 +2502,13 @@ public TypeParameterConstraintClause withTypeParameterConstraints(@Nullable JCon } } - interface TypeParameterConstraint extends J {} + interface TypeParameterConstraint extends J { + } /** * Represents a type constraint in a type parameter's constraint clause. * Example: where T : SomeClass - * where T : IInterface + * where T : IInterface */ @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true) @@ -2574,9 +2586,8 @@ public TypeConstraint withType(TypeTree type) { /* ------------------ */ - - - interface AllowsConstraint extends J {} + interface AllowsConstraint extends J { + } /** * Represents an `allows` constraint in a where clause. @@ -2701,8 +2712,7 @@ final class ClassOrStructConstraint implements Cs, TypeParameterConstraint { @Getter TypeKind kind; - public enum TypeKind - { + public enum TypeKind { Class, Struct } @@ -2788,7 +2798,7 @@ public

J acceptCSharp(CSharpVisitor

v, P p) { * // use result * } * - * + *

* Example 2: Deconstruction declaration: *

      * int (x, y) = point;
@@ -2855,6 +2865,7 @@ public CoordinateBuilder.Expression getCoordinates() {
     /**
      * Interface for variable designators in declaration expressions.
      * This can be either a single variable name or a parenthesized list of designators for deconstruction.
+     *
      * @see SingleVariableDesignation
      * @see ParenthesizedVariableDesignation
      */
@@ -2864,12 +2875,12 @@ interface VariableDesignation extends Expression, Cs {
     /**
      * Represents a single variable declaration within a declaration expression.
      * Used both for simple out variable declarations and as elements within deconstruction declarations.
-     *
+     * 

* Example in out variable: *

      * int.TryParse(s, out int x)  // 'int x' is the SingleVariable
      * 
- * + *

* Example in deconstruction: *

      * (int x, string y) = point;  // both 'int x' and 'string y' are SingleVariables
@@ -2908,7 +2919,7 @@ public 

J acceptCSharp(CSharpVisitor

v, P p) { @Override public SingleVariableDesignation withType(@Nullable JavaType type) { - return this.getType() == type ? this : new SingleVariableDesignation( + return this.getType() == type ? this : new SingleVariableDesignation( id, prefix, markers, @@ -2929,7 +2940,7 @@ public CoordinateBuilder.Expression getCoordinates() { *

      * int (x, y) = point;
      * 
- * + *

* Example of nested deconstruction: *

      * (int count, var (string name, int age)) = GetPersonDetails();
@@ -3413,15 +3424,15 @@ public Cs.Unary withOperator(JLeftPadded operator) {
     /**
      * Represents a constructor initializer which is a call to another constructor, either in the same class (this)
      * or in the base class (base).
-     *
+     * 

* Examples: *

      * class Person {
-     *     // Constructor with 'this' initializer
-     *     public Person(string name) : this(name, 0) { }
-     *
-     *     // Constructor with 'base' initializer
-     *     public Person(string name, int age) : base(name) { }
+     * // Constructor with 'this' initializer
+     * public Person(string name) : this(name, 0) { }
+     * 

+ * // Constructor with 'base' initializer + * public Person(string name, int age) : base(name) { } * } *

*/ From 1c2cbcecbb3c718f9e8b4de7f701d8c17a0e2c68 Mon Sep 17 00:00:00 2001 From: Laurens Westerlaken Date: Thu, 28 Nov 2024 14:53:29 +0100 Subject: [PATCH 2/6] Apply regex to check if name isn't pascal case already --- .../csharp/service/CSharpNamingService.java | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java index f53a44b..52bd794 100644 --- a/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java +++ b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java @@ -22,37 +22,41 @@ public class CSharpNamingService implements NamingService { + private static final Pattern STANDARD_METHOD_NAME = Pattern.compile("^[A-Z][a-zA-Z0-9]*$"); private static final Pattern SNAKE_CASE = Pattern.compile("^[a-zA-Z0-9]+_\\w+$"); @Override - public String getMethodName(String oldMethodName) { - StringBuilder result = new StringBuilder(); - if (SNAKE_CASE.matcher(oldMethodName).matches()) { - result.append(NameCaseConvention.format(NameCaseConvention.UPPER_CAMEL, oldMethodName)); - } else { - int nameLength = oldMethodName.length(); - for (int i = 0; i < nameLength; i++) { - char c = oldMethodName.charAt(i); + public String standardizeMethodName(String oldMethodName) { + if (!STANDARD_METHOD_NAME.matcher(oldMethodName).matches()) { + StringBuilder result = new StringBuilder(); + if (SNAKE_CASE.matcher(oldMethodName).matches()) { + result.append(NameCaseConvention.format(NameCaseConvention.UPPER_CAMEL, oldMethodName)); + } else { + int nameLength = oldMethodName.length(); + for (int i = 0; i < nameLength; i++) { + char c = oldMethodName.charAt(i); - if (i == 0) { - // the java specification requires identifiers to start with [a-zA-Z$_] - if (c != '$' && c != '_') { - result.append(Character.toUpperCase(c)); - } - } else { - if (!Character.isLetterOrDigit(c)) { - while (i < nameLength && (!Character.isLetterOrDigit(c) || c > 'z')) { - c = oldMethodName.charAt(i++); - } - if (i < nameLength) { + if (i == 0) { + // the java specification requires identifiers to start with [a-zA-Z$_] + if (c != '$' && c != '_') { result.append(Character.toUpperCase(c)); } } else { - result.append(c); + if (!Character.isLetterOrDigit(c)) { + while (i < nameLength && (!Character.isLetterOrDigit(c) || c > 'z')) { + c = oldMethodName.charAt(i++); + } + if (i < nameLength) { + result.append(Character.toUpperCase(c)); + } + } else { + result.append(c); + } } } } + return result.toString(); } - return result.toString(); + return oldMethodName; } } From 17af87652db150ce482144a0064f0003791579aa Mon Sep 17 00:00:00 2001 From: Laurens Westerlaken Date: Thu, 28 Nov 2024 16:24:48 +0100 Subject: [PATCH 3/6] FMT --- .../java/org/openrewrite/csharp/tree/Cs.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java b/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java index 138310e..e0d945b 100644 --- a/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java +++ b/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java @@ -23,8 +23,8 @@ import org.openrewrite.csharp.CSharpPrinter; import org.openrewrite.csharp.CSharpVisitor; import org.openrewrite.csharp.service.CSharpNamingService; -import org.openrewrite.internal.NamingService; import org.openrewrite.internal.ListUtils; +import org.openrewrite.internal.NamingService; import org.openrewrite.java.JavaPrinter; import org.openrewrite.java.JavaTypeVisitor; import org.openrewrite.java.internal.TypesInUse; @@ -2099,8 +2099,7 @@ final class Keyword implements Cs { return v.visitKeyword(this, p); } - public enum KeywordKind - { + public enum KeywordKind { Ref, Out, Await, @@ -2862,6 +2861,7 @@ public CoordinateBuilder.Expression getCoordinates() { } //region VariableDesignation + /** * Interface for variable designators in declaration expressions. * This can be either a single variable name or a parenthesized list of designators for deconstruction. @@ -2935,7 +2935,7 @@ public CoordinateBuilder.Expression getCoordinates() { /** * Represents a parenthesized list of variable declarations used in deconstruction patterns. - * + *

* Example of simple deconstruction: *

      * int (x, y) = point;
@@ -3426,7 +3426,7 @@ public Cs.Unary withOperator(JLeftPadded operator) {
      * or in the base class (base).
      * 

* Examples: - *

+     * 
      * class Person {
      * // Constructor with 'this' initializer
      * public Person(string name) : this(name, 0) { }
@@ -3712,6 +3712,7 @@ public CoordinateBuilder.Statement getCoordinates() {
         }
 
     }
+
     /**
      * Represents an initializer expression that consists of a list of expressions, typically used in array
      * or collection initialization contexts. The expressions are contained within delimiters like curly braces.
@@ -4168,6 +4169,7 @@ public IsPattern withPattern(JLeftPadded pattern) {
     }
 
     //region Patterns
+
     /**
      * Base interface for all C# pattern types that can appear on the right-hand side of an 'is' expression.
      * This includes type patterns, constant patterns, declaration patterns, property patterns, etc.
@@ -4720,6 +4722,7 @@ public ListPattern withPatterns(JContainer patterns) {
 
         }
     }
+
     /**
      * Represents a C# parenthesized pattern expression that groups a nested pattern.
      * 

@@ -5286,7 +5289,6 @@ public CoordinateBuilder.Expression getCoordinates() { } - /** * Represents a property pattern clause in C# pattern matching, which matches against object properties. *

@@ -5874,8 +5876,7 @@ public SwitchSection withStatements(List> statements) { } } - public interface SwitchLabel extends Expression - { + public interface SwitchLabel extends Expression { } @@ -6383,7 +6384,6 @@ final class FixedStatement implements Cs, Statement { J.Block block; - @Override public

J acceptCSharp(CSharpVisitor

v, P p) { return v.visitFixedStatement(this, p); From 29b6ea8cfdf8fe2fb8cdc661eb79a681c2cc4ca5 Mon Sep 17 00:00:00 2001 From: Laurens Westerlaken Date: Thu, 28 Nov 2024 16:31:31 +0100 Subject: [PATCH 4/6] FMT pt2 --- .../src/main/java/org/openrewrite/csharp/tree/Cs.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java b/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java index e0d945b..132868c 100644 --- a/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java +++ b/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java @@ -2071,7 +2071,6 @@ public PropertyDeclaration withInitializer(@Nullable JLeftPadded ini } } - @Getter @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true) @@ -2797,7 +2796,6 @@ public

J acceptCSharp(CSharpVisitor

v, P p) { * // use result * } *

- *

* Example 2: Deconstruction declaration: *

      * int (x, y) = point;
@@ -2875,12 +2873,10 @@ interface VariableDesignation extends Expression, Cs {
     /**
      * Represents a single variable declaration within a declaration expression.
      * Used both for simple out variable declarations and as elements within deconstruction declarations.
-     * 

* Example in out variable: *

      * int.TryParse(s, out int x)  // 'int x' is the SingleVariable
      * 
- *

* Example in deconstruction: *

      * (int x, string y) = point;  // both 'int x' and 'string y' are SingleVariables
@@ -2935,12 +2931,10 @@ public CoordinateBuilder.Expression getCoordinates() {
 
     /**
      * Represents a parenthesized list of variable declarations used in deconstruction patterns.
-     * 

* Example of simple deconstruction: *

      * int (x, y) = point;
      * 
- *

* Example of nested deconstruction: *

      * (int count, var (string name, int age)) = GetPersonDetails();
@@ -3424,13 +3418,11 @@ public Cs.Unary withOperator(JLeftPadded operator) {
     /**
      * Represents a constructor initializer which is a call to another constructor, either in the same class (this)
      * or in the base class (base).
-     * 

* Examples: *

      * class Person {
      * // Constructor with 'this' initializer
      * public Person(string name) : this(name, 0) { }
-     * 

* // Constructor with 'base' initializer * public Person(string name, int age) : base(name) { } * } @@ -5288,7 +5280,6 @@ public CoordinateBuilder.Expression getCoordinates() { } - /** * Represents a property pattern clause in C# pattern matching, which matches against object properties. *

@@ -6396,7 +6387,6 @@ public CoordinateBuilder.Statement getCoordinates() { } } - /** * Represents a C# checked statement which enforces overflow checking for arithmetic operations * and conversions. Operations within a checked block will throw OverflowException if arithmetic From d5a72b233c1b600872a76a494f19dc771e2e0cc5 Mon Sep 17 00:00:00 2001 From: Laurens Westerlaken Date: Tue, 3 Dec 2024 17:47:31 +0100 Subject: [PATCH 5/6] Add test and improvement that was also made to JavaNamingService --- .../csharp/service/CSharpNamingService.java | 10 +++-- .../service/CSharpNamingServiceTest.java | 37 +++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 rewrite-csharp/src/test/java/org/openrewrite/csharp/service/CSharpNamingServiceTest.java diff --git a/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java index 52bd794..e82b2ac 100644 --- a/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java +++ b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java @@ -35,7 +35,6 @@ public String standardizeMethodName(String oldMethodName) { int nameLength = oldMethodName.length(); for (int i = 0; i < nameLength; i++) { char c = oldMethodName.charAt(i); - if (i == 0) { // the java specification requires identifiers to start with [a-zA-Z$_] if (c != '$' && c != '_') { @@ -43,8 +42,13 @@ public String standardizeMethodName(String oldMethodName) { } } else { if (!Character.isLetterOrDigit(c)) { - while (i < nameLength && (!Character.isLetterOrDigit(c) || c > 'z')) { - c = oldMethodName.charAt(i++); + while ((!Character.isLetterOrDigit(c) || c > 'z')) { + i++; + if (i < nameLength) { + c = oldMethodName.charAt(i); + } else { + break; + } } if (i < nameLength) { result.append(Character.toUpperCase(c)); diff --git a/rewrite-csharp/src/test/java/org/openrewrite/csharp/service/CSharpNamingServiceTest.java b/rewrite-csharp/src/test/java/org/openrewrite/csharp/service/CSharpNamingServiceTest.java new file mode 100644 index 0000000..78e8b8f --- /dev/null +++ b/rewrite-csharp/src/test/java/org/openrewrite/csharp/service/CSharpNamingServiceTest.java @@ -0,0 +1,37 @@ +/* + * Copyright 2024 the original author or authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * https://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.openrewrite.csharp.service; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; + +import static org.assertj.core.api.Assertions.assertThat; + +class CSharpNamingServiceTest { + + @ParameterizedTest + @CsvSource(textBlock = """ + foo_bar,FooBar + foo$bar,FooBar + foo_bar$,FooBar + foo$bar$,FooBar + """) + void changeMethodName(String before, String after) { + String actual = new CSharpNamingService().standardizeMethodName(before); + assertThat(actual).isEqualTo(after); + } + +} From dfa1bac7cbcb9d40cb4e8a6e87ab763779b63082 Mon Sep 17 00:00:00 2001 From: Laurens Westerlaken Date: Wed, 4 Dec 2024 10:40:25 +0100 Subject: [PATCH 6/6] Touching up --- .../org/openrewrite/csharp/service/CSharpNamingService.java | 2 +- .../main/java/org/openrewrite/csharp/service/package-info.java | 2 +- .../src/main/java/org/openrewrite/csharp/tree/Cs.java | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java index e82b2ac..0686d5f 100644 --- a/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java +++ b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/CSharpNamingService.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 the original author or authors. + * Copyright 2024 the original author or authors. *

* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/package-info.java b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/package-info.java index 6c389d6..310d549 100644 --- a/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/package-info.java +++ b/rewrite-csharp/src/main/java/org/openrewrite/csharp/service/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 the original author or authors. + * Copyright 2024 the original author or authors. *

* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java b/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java index 132868c..d3496f0 100644 --- a/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java +++ b/rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java @@ -2583,7 +2583,6 @@ public TypeConstraint withType(TypeTree type) { /* ------------------ */ - interface AllowsConstraint extends J { } @@ -6374,7 +6373,6 @@ final class FixedStatement implements Cs, Statement { @Getter J.Block block; - @Override public

J acceptCSharp(CSharpVisitor

v, P p) { return v.visitFixedStatement(this, p);