Skip to content

Commit dc1eda0

Browse files
committed
0.1.0 - Initial class loading/manipulation code with examples console apps
0 parents  commit dc1eda0

File tree

161 files changed

+12084
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+12084
-0
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
This project does its best to adhere to [Semantic Versioning](http://semver.org/).
4+
5+
6+
--------
7+
###[0.1.0](N/A) - 2017-01-11
8+
#### Added
9+
* Initial versioning of existing code, including classfile loading/parsing, dynamic classfile modification, and runtime class loading.

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 TeamworkGuy2
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
ClassLoading
2+
==========
3+
version: 0.1.0
4+
5+
Java class file parsing and manipulation library.
6+
Reference: [Java Virtual Machine Spec](http://docs.oracle.com/javase/specs/jvms/se8/html/index.html)
7+
8+
###See `twg2.jbcm.main/`
9+
for example code and interactive command line tools.
10+
11+
####`twg2.jbcm.classFormat`
12+
Contains implementation of the [class file format](http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html)
13+
with related attributes and constant pool types.
14+
15+
####`twg2.jbcm` and `twg2.jbcm.modify`
16+
Interfaces and utilities for searching and modifying class files.
17+
18+
####`twg2.jbcm.opcode`
19+
Partial implementation of [Java instruction set opcodes](http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-6.html#jvms-6.5).
20+
21+
####`twg2.jbcm.dynamicModification`, `twg2.jbcm.parserExamples`
22+
Classes used by the example and test packages.
23+
24+
####`twg2.jbcm.runtimeLoading`
25+
Runtime class loading.
26+
27+
####`twg2.jbcm.main`
28+
Example console apps.

bin/class_loading.jar

246 KB
Binary file not shown.

examples/ExampleMain.class

1.5 KB
Binary file not shown.

examples/ExampleMain.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package examples;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
6+
/**
7+
* @author TeamworkGuy2
8+
* @since 2014-4-23
9+
*/
10+
public class ExampleMain implements Runnable {
11+
private int num;
12+
13+
14+
public ExampleMain() {
15+
this.num = 20;
16+
}
17+
18+
19+
@Override
20+
public void run() {
21+
List<Integer> list = new ArrayList<Integer>();
22+
series(num, 0, list);
23+
System.out.print(list);
24+
}
25+
26+
27+
private void series(int count, int initial, List<Integer> values) {
28+
int vn1 = values.size() > 0 ? values.get(values.size()-1) : 1;
29+
int vn2 = values.size() > 1 ? values.get(values.size()-2) : 0;
30+
values.add(vn1 + vn2);
31+
if(count > 0) {
32+
series(count-1, initial, values);
33+
}
34+
}
35+
36+
37+
public static void main(String[] args) {
38+
ExampleMain example = new ExampleMain();
39+
example.run();
40+
}
41+
42+
}

package-lib.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version" : "0.1.0",
3+
"name" : "class-loading",
4+
"description" : "Java class file parsing and manipulation",
5+
"homepage" : "https://github.com/TeamworkGuy2/ClassLoading",
6+
"license" : "MIT",
7+
"main" : "./bin/class_loading.jar",
8+
"dependencies" : {
9+
"ecj-4.4M2" : "*"
10+
}
11+
}

res/build.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Run the following command to compile java files in the source\classLoading folder, if additional folders are added, add them to this command before the -d option.
2+
This folder is for various java files used to test dynamic reloading that cannot be part of the eclipse project's source/build path.
3+
Navigate to the classpath folder, then run the following command:
4+
5+
"C:\Program Files\Java\jdk1.8.0_112\bin\javac" -sourcepath source -classpath C:\Users\TeamworkGuy2\Documents\Java\Projects\ClassLoading\res source\classLoading\*.java source\classLoading\base\*.java source\classLoading\load\*.java -d destination
2.15 KB
Binary file not shown.
971 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)