We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 266848d commit f6b4a44Copy full SHA for f6b4a44
1 file changed
codesectools/datasets/BenchmarkJava/dataset.py
@@ -148,16 +148,17 @@ def load_dataset(self) -> list[TestCode]:
148
for row in reader:
149
filename = f"{row[0]}.java"
150
filepath = testcode_dir / filename
151
- content = filepath.read_text()
152
- cwes = [CWEs.from_id(int(row[3]))]
153
- has_vuln = True if row[2] == "true" else False
154
- files.append(
155
- TestCode(
156
- filepath.relative_to(self.directory),
157
- content,
158
- cwes,
159
- has_vuln,
+ if filepath.is_file():
+ content = filepath.read_text()
+ cwes = [CWEs.from_id(int(row[3]))]
+ has_vuln = True if row[2] == "true" else False
+ files.append(
+ TestCode(
+ filepath.relative_to(self.directory),
+ content,
+ cwes,
160
+ has_vuln,
161
+ )
162
)
- )
163
164
return files
0 commit comments