メソッドからコピー/貼り付けする次のコードがあります。
String harmonicFile;
...
...
harmonicFile = String.format("%04d%s",this.number, this.suffix.toUpperCase()) + ".tch";
結果は問題ないように見えますが、ファンキーな部分がいくつかあります:
この文字列を、これを含む別のメソッドに渡します。
if(filename.equals(file)){
   return file;
}
fileName は渡された値であり、file はアセット ファイル システムからの一致です。ファイルが「0062.tch」であるとします。Intellij IDEA デバッガーでファイル名を検査すると、「0062.tch」と等しいことが示されますが、return ステートメントはヒットしません。よく調べてみると、ファイル名に 8 個のヌル文字 (\u0000) が埋め込まれていることがわかります。
2 つの質問があります。
- 文字列がパディングされているのはなぜですか? 
- IDEA では、if ステートメントを中断して式エバリュエーター (Alt-F8) を使用すると、filename.equals(file) が true であることが示されますが、実行時にコードをステップ実行すると、そうではないことが示されます。これは、IDEA が式を評価する方法と Dalvik VM の低レベルの違いだと思いますか? ファイル名は実際にはファイルと等しくないため、VM は正しいと思います。 
洞察をありがとう。
サイモン
[編集] コードの残りの部分は関係ないと確信していますが、スペースを節約するためにコメントを削除しました。
public String filePathForHarmonicFile(){
    String harmonicFile;
    int number = this.number;
    if(this.number < 0){ return "";}
    if(number<10000 && this.suffix.length()<=1){
        harmonicFile = String.format("%04d%s",this.number, this.suffix.toUpperCase()) + ".tch";
    }else{
        harmonicFile = String.format("%s%s",this.number,this.suffix.toUpperCase()) + ".tch";
    }
    return SCFileManager.getAssetFilePath("",harmonicFile);
}
public static String getAssetFilePath(String rootOfSearch, String filename){
    try {
        // get a list of all file entries in the search root
        String[] files = ThisApplication.getContext().getAssets().list(rootOfSearch);
        for (String file:files){
            String newRoot;
            if (rootOfSearch.equals("")){
                newRoot = file;
            } else {
                newRoot = rootOfSearch + File.separator + file;
            }
            if (TidesPlannerApplication.getContext().getAssets().list(newRoot).length>0){
                String thisFile = getAssetFilePath(newRoot,filename);
                if (!thisFile.equals("")){
                    return thisFile;
                }
            } else {
                if(file.equals(filename)){
                    return file;
                }
            }
        }
    } catch (IOException e) {
        e.printStackTrace();  
    }
    return "";
}
この最後の方法が醜いことはわかっていますが、資産のサブフォルダーにある 7.5k ファイルを処理するためのより良い方法を誰かが知っているなら、私はすべて耳を傾けます - AssetManager は $%^&* 脳死です!