Skip to content

Commit

Permalink
[JENKINS-41124] Remove normalization left in by mistake when trying t…
Browse files Browse the repository at this point in the history
…o make the test deterministic on all File systems

- Unnecessary now that we detect the normalization scheme of the system under test
  • Loading branch information
stephenc committed Jan 20, 2017
1 parent c419016 commit 93e075a
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -273,6 +273,15 @@ private void checkChild(ComputedFolderImpl instance, String idealName) throws IO
assertThat("We have an item for name " + idealName, item, notNullValue());
assertThat("The root directory of the item for name " + idealName + " is mangled",
item.getRootDir().getName(), is(mangle(idealName)));
String altEncoding = Normalizer.normalize(idealName, Normalizer.Form.NFD);
if (idealName.equals(altEncoding)) {
altEncoding = Normalizer.normalize(idealName, Normalizer.Form.NFC);
}
if (!idealName.equals(altEncoding)) {
File altRootDir = instance.getRootDirFor(altEncoding);
assertThat("Alternative normalized form: " + altRootDir + " does not exist",
altRootDir.isDirectory(), is(false));
}
File nameFile = new File(item.getRootDir(), ChildNameGenerator.CHILD_NAME_FILE);
assertThat("We have the " + ChildNameGenerator.CHILD_NAME_FILE + " for the item for name " + idealName,
nameFile.isFile(), is(true));
Expand Down Expand Up @@ -591,14 +600,14 @@ public String dirNameFromItem(@Nonnull F parent,
@Override
public String itemNameFromLegacy(@Nonnull F parent,
@Nonnull String legacyDirName) {
return encode(Normalizer.normalize(legacyDirName, Normalizer.Form.NFC));
return encode(legacyDirName);
}

@Nonnull
@Override
public String dirNameFromLegacy(@Nonnull F parent,
@Nonnull String legacyDirName) {
return mangle(Normalizer.normalize(legacyDirName, Normalizer.Form.NFC));
return mangle(legacyDirName);
}

@Override
Expand Down

0 comments on commit 93e075a

Please sign in to comment.