mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 12:32:15 +00:00
Enable VariableDeclarationUsageDistance Checkstyle check (#6012)
This commit is contained in:
1 parent
71117cc702
commit
292da1e77e
10 files changed
+23
-22
No files matched your search
@@ -950,7 +950,6 @@ public class FilePathTest {
|
||||
FilePath workspaceFolder = rootFolder.child("workspace");
|
||||
FilePath aFolder = workspaceFolder.child("a");
|
||||
FilePath bFolder = workspaceFolder.child("b");
|
||||
FilePath protectedFolder = rootFolder.child("protected");
|
||||
|
||||
FilePath regularFile = workspaceFolder.child("regular.txt");
|
||||
regularFile.write("regular-file", StandardCharsets.UTF_8.name());
|
||||
@@ -966,6 +965,7 @@ public class FilePathTest {
|
||||
workspaceFolder.child("_nonexistentUp").symlinkTo("../nonexistent", null);
|
||||
workspaceFolder.child("_secrettxt").symlinkTo("../protected/secret.txt", null);
|
||||
|
||||
FilePath protectedFolder = rootFolder.child("protected");
|
||||
FilePath secretFile = protectedFolder.child("secret.txt");
|
||||
secretFile.write("secrets", StandardCharsets.UTF_8.name());
|
||||
|
||||
@@ -1014,7 +1014,6 @@ public class FilePathTest {
|
||||
FilePath workspaceFolder = rootFolder.child("workspace");
|
||||
FilePath aFolder = workspaceFolder.child("a");
|
||||
FilePath bFolder = workspaceFolder.child("b");
|
||||
FilePath protectedFolder = rootFolder.child("protected");
|
||||
|
||||
FilePath regularFile = workspaceFolder.child("regular.txt");
|
||||
regularFile.write("regular-file", StandardCharsets.UTF_8.name());
|
||||
@@ -1028,6 +1027,7 @@ public class FilePathTest {
|
||||
createJunction(new File(root, "/workspace/_nonexistentUp"), new File(root, "/nonexistent"));
|
||||
createJunction(new File(root, "/workspace/_protected"), new File(root, "/protected"));
|
||||
|
||||
FilePath protectedFolder = rootFolder.child("protected");
|
||||
FilePath secretFile = protectedFolder.child("secret.txt");
|
||||
secretFile.write("secrets", StandardCharsets.UTF_8.name());
|
||||
|
||||
@@ -1103,11 +1103,9 @@ public class FilePathTest {
|
||||
// /protected
|
||||
// secret.txt
|
||||
FilePath rootFolder = new FilePath(temp.newFolder("root"));
|
||||
FilePath wFolder = rootFolder.child("w");
|
||||
FilePath workspaceFolder = rootFolder.child("workspace");
|
||||
FilePath aFolder = workspaceFolder.child("a");
|
||||
FilePath bFolder = workspaceFolder.child("b");
|
||||
FilePath protectedFolder = rootFolder.child("protected");
|
||||
|
||||
FilePath regularFile = workspaceFolder.child("regular.txt");
|
||||
regularFile.write("regular-file", StandardCharsets.UTF_8.name());
|
||||
@@ -1125,10 +1123,12 @@ public class FilePathTest {
|
||||
workspaceFolder.child("_secrettxt").symlinkTo("../protected/secret.txt", null);
|
||||
workspaceFolder.child("_secrettxt2").symlinkTo("../../protected/secret.txt", null);
|
||||
|
||||
FilePath wFolder = rootFolder.child("w");
|
||||
wFolder.mkdirs();
|
||||
FilePath symbolicWorkspace = wFolder.child("_w");
|
||||
symbolicWorkspace.symlinkTo("../workspace", null);
|
||||
|
||||
FilePath protectedFolder = rootFolder.child("protected");
|
||||
FilePath secretFile = protectedFolder.child("secret.txt");
|
||||
secretFile.write("secrets", StandardCharsets.UTF_8.name());
|
||||
|
||||
|
||||
@@ -69,12 +69,6 @@ public class RobustReflectionConverterTest {
|
||||
|
||||
@Test
|
||||
public void classOwnership() {
|
||||
XStream xs = new XStream2(clazz -> {
|
||||
Owner o = clazz.getAnnotation(Owner.class);
|
||||
return o != null ? o.value() : null;
|
||||
});
|
||||
String prefix1 = RobustReflectionConverterTest.class.getName() + "_-";
|
||||
String prefix2 = RobustReflectionConverterTest.class.getName() + "$";
|
||||
Enchufla s1 = new Enchufla();
|
||||
s1.number = 1;
|
||||
s1.direction = "North";
|
||||
@@ -91,6 +85,12 @@ public class RobustReflectionConverterTest {
|
||||
b.steppes = new Steppe[] {s1, s2, s3};
|
||||
Projekt p = new Projekt();
|
||||
p.bildz = new Bild[] {b};
|
||||
XStream xs = new XStream2(clazz -> {
|
||||
Owner o = clazz.getAnnotation(Owner.class);
|
||||
return o != null ? o.value() : null;
|
||||
});
|
||||
String prefix1 = RobustReflectionConverterTest.class.getName() + "_-";
|
||||
String prefix2 = RobustReflectionConverterTest.class.getName() + "$";
|
||||
assertEquals("<Projekt><bildz><Bild><steppes>"
|
||||
+ "<Enchufla plugin='p1'><number>1</number><direction>North</direction></Enchufla>"
|
||||
// note no plugin='p2' on <boot/> since that would be redundant; <jacket/> is quiet even though unowned
|
||||
|
||||
Reference in new issue
Block a user