Download tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/patch.diff from Benchanything/checkerbench: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/patch.diff
- Command line
-
hf download hf://datasets/Benchanything/checkerbench/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/patch.diff
1.02 kB
| diff --git a/src/main/java/com/rtds/svc/CaptureTypeService.java b/src/main/java/com/rtds/svc/CaptureTypeService.java | |
| index 52bdea3..be6c346 100644 | |
| --- a/src/main/java/com/rtds/svc/CaptureTypeService.java | |
| +++ b/src/main/java/com/rtds/svc/CaptureTypeService.java | |
| public class CaptureTypeService | |
| CaptureType type = em.find( CaptureType.class, url_suffix ); | |
| - if( type != null ) | |
| + if( type == null ) | |
| { | |
| - return type.getCaptureFilter(); | |
| + throw new IllegalArgumentException( "The url_suffix must exist in the database." ); | |
| } | |
| - return null; | |
| + // It is okay for the capture filter itself to be null, but the CaptureType | |
| + // must be in the database, otherwise the user could effectively forge | |
| + // a capture filter for "all" just by requesting a non-existent filter. | |
| + | |
| + return type.getCaptureFilter(); | |
| } | |
| public CaptureType find( String url_suffix ) | |