Skip to content

Commit a27c7a0

Browse files
committed
Failed attempt to reproduce #1638 (I think we need spotless-format23.xml)
1 parent 64b8183 commit a27c7a0

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2016-2023 DiffPlug
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.diffplug.spotless.extra.java;
17+
18+
import org.junit.jupiter.api.Test;
19+
20+
import com.diffplug.spotless.StepHarness;
21+
import com.diffplug.spotless.TestProvisioner;
22+
23+
public class EclipseJdtFormatterStepSpecialCaseTest {
24+
/** https://github.com/diffplug/spotless/issues/1638 */
25+
@Test
26+
public void issue_1638() {
27+
StepHarness.forStep(EclipseJdtFormatterStep.createBuilder(TestProvisioner.mavenCentral()).build())
28+
.testUnaffected("java/eclipse/AbstractType.test");
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package test;
2+
3+
4+
5+
6+
public abstract class AbstractType {
7+
8+
9+
private String _typeName;
10+
11+
AbstractType(String typeName) {
12+
_typeName = typeName;
13+
}
14+
15+
16+
17+
private String _type() {
18+
String name = getClass().getSimpleName();
19+
return name.endsWith("Type")
20+
? name.substring(0, getClass().getSimpleName().length() - 4)
21+
: name;
22+
}
23+
24+
AbstractType argument() {
25+
throw new UnsupportedOperationException(getClass().getSimpleName());
26+
}
27+
28+
29+
@Override
30+
public boolean equals(Object another) {
31+
if (this == another) {
32+
return true;
33+
}
34+
return another instanceof AbstractType t
35+
&& _typeName.equals(t._typeName);
36+
}
37+
38+
39+
40+
@Override
41+
public int hashCode() {
42+
return _typeName.hashCode();
43+
}
44+
45+
46+
47+
48+
@Override
49+
public String toString() {
50+
return getClass().getSimpleName() + "(typeName)";
51+
}
52+
53+
54+
}

0 commit comments

Comments
 (0)