|
1 | 1 | package com.semmle.js.extractor; |
2 | 2 |
|
3 | | -import java.io.BufferedReader; |
4 | | -import java.io.File; |
5 | | -import java.io.FileInputStream; |
6 | | -import java.io.FileReader; |
7 | | -import java.io.IOException; |
8 | | -import java.nio.charset.Charset; |
9 | | -import java.nio.charset.StandardCharsets; |
10 | | -import java.util.LinkedHashSet; |
11 | | -import java.util.Set; |
12 | | -import java.util.regex.Pattern; |
13 | | - |
14 | 3 | import com.semmle.js.extractor.ExtractionMetrics.ExtractionPhase; |
15 | 4 | import com.semmle.js.extractor.trapcache.CachingTrapWriter; |
16 | 5 | import com.semmle.js.extractor.trapcache.ITrapCache; |
|
21 | 10 | import com.semmle.util.io.WholeIO; |
22 | 11 | import com.semmle.util.trap.TrapWriter; |
23 | 12 | import com.semmle.util.trap.TrapWriter.Label; |
| 13 | +import java.io.BufferedReader; |
| 14 | +import java.io.File; |
| 15 | +import java.io.FileInputStream; |
| 16 | +import java.io.FileReader; |
| 17 | +import java.io.IOException; |
| 18 | +import java.nio.charset.Charset; |
| 19 | +import java.nio.charset.StandardCharsets; |
| 20 | +import java.util.LinkedHashSet; |
| 21 | +import java.util.Set; |
| 22 | +import java.util.regex.Pattern; |
24 | 23 |
|
25 | 24 | /** |
26 | 25 | * The file extractor extracts a single file and handles source archive population and TRAP caching; |
@@ -156,8 +155,7 @@ private boolean hasBadFileHeader(File f, String lcExt, ExtractorConfig config) { |
156 | 155 | byte[] bytes = new byte[fileHeaderSize]; |
157 | 156 | int length = fis.read(bytes); |
158 | 157 |
|
159 | | - if (length == -1) |
160 | | - return false; |
| 158 | + if (length == -1) return false; |
161 | 159 |
|
162 | 160 | // Avoid invalid or unprintable UTF-8 files. |
163 | 161 | if (config.getDefaultEncoding().equals("UTF-8") && hasUnprintableUtf8(bytes, length)) { |
|
0 commit comments