Skip to content

Commit

Permalink
nullness-specifying class Filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
mattulbrich committed Jun 26, 2023
1 parent 08673f9 commit de7cdae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions key.util/src/main/java/org/key_project/util/Filenames.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
import java.util.Arrays;
import java.util.List;

import org.jspecify.annotations.NullMarked;

/**
* @author Alexander Weigl
* @version 1 (29.03.19)
*/
@SuppressWarnings("nullness")
@NullMarked
public class Filenames {
// =======================================================
// Methods operating on Strings
Expand Down Expand Up @@ -154,7 +156,9 @@ private static String[] removeDotDot(String[] a) {
if (!a[a.length - 1].equals("..")) {
newa[k++] = a[a.length - 1];
}
return Arrays.copyOf(newa, k);
// @ assert (\forall int i; 0 <= i < k; newa[i] != null);
// TODO: nullness. This cast cannot be checked, can it? But there is no error message
return (String[]) Arrays.copyOf(newa, k);
}

public static String toValidFileName(String s) {
Expand Down

0 comments on commit de7cdae

Please sign in to comment.