Skip to content

Commit f9bbf13

Browse files
committed
Normalize line endings to LF
1 parent da4eab1 commit f9bbf13

File tree

15 files changed

+3114
-3100
lines changed

15 files changed

+3114
-3100
lines changed

.gitattributes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
* text=auto
2+
3+
# Convert these line endings on checkout
4+
*.java text
5+
*.html text
6+
*.xml text
7+
*.MF text
8+
*.txt text
9+
*.md text
10+
11+
*.png binary
12+
*.jpg binary
13+
*.jar binary
14+
*.class binary
Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
package club.bytecode.the.jda;
2-
3-
import org.objectweb.asm.ClassReader;
4-
import org.objectweb.asm.tree.ClassNode;
5-
6-
import java.io.File;
7-
import java.util.HashMap;
8-
import java.util.Map;
9-
10-
/**
11-
* Represents a file container
12-
*
13-
* @author Konloch
14-
*/
15-
16-
public class FileContainer {
17-
public FileContainer(File f) {
18-
this.file = f;
19-
this.name = f.getAbsolutePath();
20-
}
21-
22-
public final File file;
23-
public final String name;
24-
25-
public HashMap<String, byte[]> files = new HashMap<>(); // this is assigned outside the class?!
26-
27-
public ClassNode loadClass(String name) {
28-
byte[] bytes = files.get(name);
29-
if (bytes == null)
30-
return null;
31-
ClassReader reader = new ClassReader(bytes);
32-
ClassNode classNode = new ClassNode();
33-
reader.accept(classNode, ClassReader.EXPAND_FRAMES);
34-
return classNode;
35-
}
36-
37-
public String findClassfile(String className) {
38-
String candidate = className + ".class";
39-
if (files.containsKey(candidate))
40-
return candidate;
41-
return "";
42-
}
43-
44-
public Map<String, byte[]> getFiles() {
45-
return files;
46-
}
47-
48-
@Override
49-
public String toString() {
50-
return name;
51-
}
52-
}
1+
package club.bytecode.the.jda;
2+
3+
import org.objectweb.asm.ClassReader;
4+
import org.objectweb.asm.tree.ClassNode;
5+
6+
import java.io.File;
7+
import java.util.HashMap;
8+
import java.util.Map;
9+
10+
/**
11+
* Represents a file container
12+
*
13+
* @author Konloch
14+
*/
15+
16+
public class FileContainer {
17+
public FileContainer(File f) {
18+
this.file = f;
19+
this.name = f.getAbsolutePath();
20+
}
21+
22+
public final File file;
23+
public final String name;
24+
25+
public HashMap<String, byte[]> files = new HashMap<>(); // this is assigned outside the class?!
26+
27+
public ClassNode loadClass(String name) {
28+
byte[] bytes = files.get(name);
29+
if (bytes == null)
30+
return null;
31+
ClassReader reader = new ClassReader(bytes);
32+
ClassNode classNode = new ClassNode();
33+
reader.accept(classNode, ClassReader.EXPAND_FRAMES);
34+
return classNode;
35+
}
36+
37+
public String findClassfile(String className) {
38+
String candidate = className + ".class";
39+
if (files.containsKey(candidate))
40+
return candidate;
41+
return "";
42+
}
43+
44+
public Map<String, byte[]> getFiles() {
45+
return files;
46+
}
47+
48+
@Override
49+
public String toString() {
50+
return name;
51+
}
52+
}

0 commit comments

Comments
 (0)