Compare commits

..

No commits in common. "targetBytecode" and "patternMatching" have entirely different histories.

270 changed files with 2234 additions and 20540 deletions

View File

@ -1,25 +0,0 @@
name: Build and Test with Maven
on: [push]
jobs:
Build-and-test-with-Maven:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install maven
run: |
apt update
apt install -y maven
- name: Install java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Compile project
run: |
mvn compile
- name: Run tests
run: |
mvn test

File diff suppressed because it is too large Load Diff

21
pom.xml
View File

@ -28,15 +28,15 @@ http://maven.apache.org/maven-v4_0_0.xsd">
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
<version>4.8.172</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.0-jre</version>
<version>22.0</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.11</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.ow2.asm/asm -->
<dependency>
@ -54,8 +54,8 @@ http://maven.apache.org/maven-v4_0_0.xsd">
<version>3.11.0</version>
<configuration>
<compilerArgs>--enable-preview</compilerArgs>
<source>21</source>
<target>21</target>
<source>20</source>
<target>20</target>
</configuration>
</plugin>
<plugin>
@ -63,14 +63,9 @@ http://maven.apache.org/maven-v4_0_0.xsd">
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<reportsDirectory>${project.build.directory}/test-reports</reportsDirectory>
<argLine>--enable-preview</argLine>
<trimStackTrace>false</trimStackTrace>
<excludes>
<exclude>**/JavaTXCompilerTest.java</exclude>
<exclude>**/AllgemeinTest.java</exclude>
<exclude>**/syntaxtreegenerator/*.java</exclude>
</excludes>
</configuration>
</plugin>

View File

@ -1,10 +0,0 @@
public class Bar{
void visit(Object o){
System.out.println("Object");
}
void visit(Bla f){
System.out.println("Foo");
}
}

View File

@ -1,9 +0,0 @@
public class Box<A> {
A a;
public Box() { }
public Box(A a) {
//this.a = a;
}
}

View File

@ -1,22 +0,0 @@
class Pair<U, T> {
U a;
T b;
Pair(U x, T y) {
a = x; b = y;
}
}
class Complex {
m(b) {
var c = b;
var d = c;
var e;
d = e;
var r1 = e;
var f = e;
var g;
f = g;
var r2 = g;
return new Pair<>(r1, r2);
}
}

View File

@ -1,6 +0,0 @@
public class Foo{
public accept(Bar b){
b.visit(this);
}
}

View File

@ -1,7 +0,0 @@
public class InfReturn {
m(a) {
var ret;
a = ret;
return ret;
}
}

View File

@ -1,8 +0,0 @@
public class InfReturnII {
m(a, b) {
var ret;
a = ret;
b = ret;
return ret;
}
}

View File

@ -1,7 +0,0 @@
class InnerInf {
m(a, b) {
var i;
a = i;
b = i;
}
}

View File

@ -1,4 +1,4 @@
/*
class Pair<T, U> {
T x;
U y;
@ -17,7 +17,7 @@ class Pair<T, U> {
return y;
}
}
*/
public class Iteration {
id(x) {

View File

@ -1,46 +0,0 @@
import java.lang.Boolean;
import java.lang.Object;
class List {
elem;
next;
List() {
super();
}
List(elem, next) {
this.elem = elem;
this.next = next;
}
addElement(newElem) {
return new List(newElem, this);
}
append(l) {
if (next == null) {
return l;
}
else {
return new List(elem, next.append(l));
}
}
/*
addAll(l) {
var nextLoc = next;
while (//nextLoc != null
true) {
nextLoc = nextLoc.next;
}
nextLoc = l;
}
void m() {
List<? extends Object> l; // = new List<Integer>(1, null);
List<? extends Object> l2; // = new List<String>("SSS", null);
l.addAll(l2);
}
*/
}

View File

@ -1,7 +0,0 @@
import java.lang.Integer;
import java.lang.Double;
class Overloading {
m(x) { return x + x; }
m(x) { return x || x; }
}

View File

@ -1,8 +0,0 @@
class RecursionCond {
m(a, b, c) {
if (1 == 2) {
b = m(a, b);
c = m(a, b);
} else return a;
}
}

View File

@ -1,9 +0,0 @@
import java.lang.Boolean;
import java.lang.Integer;
public class Test {
fac = (x) -> {
if (x == 1) { return 1; }
return x * fac.apply(x - 1);
};
}

View File

@ -1,19 +0,0 @@
class Triple<U, T, S> {
U a;
T b;
S c;
Triple(U x, T y, S z) {
a = x; b = y; c = z;
}
U fst() { return a; }
T snd() { return b; }
S thrd() { return c; }
}
public class TripleTest {
m() {
return new Triple<>(m().thrd(), m().thrd(), m().thrd());
}
}

View File

@ -1,12 +0,0 @@
class Twice2 {
id1inst = new Id<>();
id1 = id1inst.id;
id2inst = new Id<>();
id2 = id2inst.id;
twice = id1.apply(id2);
}
class Id<T> {
id = (T x) -> x;
}

View File

@ -2,7 +2,7 @@ import java.lang.Integer;
import java.lang.String;
public class AA {
public m(Integer i) { return "AA"; }
m(Integer i) { return "AA"; }
public m2(AA x) { return "AA"; }
m2(AA x) { return "AA"; }
}

View File

@ -1,14 +0,0 @@
public class Access {
public int fPublic;
int fDefault;
private int fPrivate;
protected int fProtected;
public void mPublic() {}
void mDefault() {}
private void mPrivate() {}
protected void mProtected() {}
}
class AccessDefault {
}

View File

@ -1,8 +0,0 @@
class Base {
public void foo() {}
}
public class Annotation extends Base {
@Override
public void foo() {}
}

View File

@ -1,4 +1,3 @@
import java.lang.Integer;
import AA;
public class BB extends AA { }

View File

@ -3,15 +3,15 @@ import java.lang.Double;
public class BinaryInMeth {
public m(a){
m(a){
return ++a;
}
public m2(a,b){
m2(a,b){
return m(a+b);
}
public m3(a) {
m3(a) {
return m(++a);
}
}

View File

@ -1,9 +1,7 @@
public class Box<A> {
A a;
public Box() { }
public Box(A a) {
//this.a = a;
}
}
class B { }
class Box_Main extends B {
m(b) {
b.m(new Box_Main());
b.m(new B());
}
}

View File

@ -0,0 +1,3 @@
class Box<A> {
void m(A a) { }
}

View File

@ -1,7 +0,0 @@
public class Bug112 {
public m(x) {
var y;
x = y;
return y;
}
}

View File

@ -1,12 +0,0 @@
import java.lang.Integer;
import java.lang.Boolean;
public class Bug122 {
public void main() {
if (true) {
for (Integer i = 0; i < 10; i++) {
}
}
}
}

View File

@ -1,13 +0,0 @@
import java.lang.Boolean;
import java.lang.Integer;
public class Bug123 {
public Boolean works(){
if(true) return true;
else return false;
}
public void fails(){
Boolean a = true;
if(true) a = false;
}
}

View File

@ -1,16 +0,0 @@
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.LinkedList;
import java.util.ArrayList;
public class Bug125 {
static ArrayList<String> works = new ArrayList<>();
static List<String> fails = new ArrayList<>();
public void main() {
works.toString();
fails.toString();
}
}

View File

@ -1,15 +0,0 @@
import java.util.Optional;
import java.lang.Integer;
public class StaticClass {
public static StaticClass barbar() {
return new StaticClass();
}
}
public class Bug285 {
public void foo() {
Optional<Integer> opt = Optional.empty();
StaticClass b = StaticClass.barbar();
}
}

View File

@ -1,7 +0,0 @@
import Bug290B;
public class Bug290A {
public void m() {
new Bug290B();
}
}

View File

@ -1,11 +0,0 @@
import java.lang.String;
import java.lang.Integer;
public class Bug290B {
String name;
public Bug290B() {
Integer i = 0;
name = i.toString() + "$$";
}
}

View File

@ -1,13 +0,0 @@
import java.lang.Integer;
import java.lang.Float;
public class Bug293 {
bar(a) {
return 2 * a;
}
}
interface IFoo {
void ga();
}

View File

@ -1,18 +0,0 @@
import java.lang.Integer;
public class Bug295 {
public Integer a;
public Integer b;
public Integer c;
public Bug295(a, b, c) {
this(a);
this.b = b;
this.c = c;
}
public Bug295(a) {
this.a = a;
}
}

View File

@ -1,11 +0,0 @@
import java.lang.Integer;
public class Bug296 {
public static m1() {
return m2();
}
static m2() {
return 10;
}
}

View File

@ -1,11 +0,0 @@
import java.lang.Integer;
public class Bug297 {
public static operation(func, a, b) {
return func.apply(a, b);
}
public exec() {
return Foo.operation((x, y) -> x + y, 10, 10);
}
}

View File

@ -1,17 +0,0 @@
import java.util.List;
import java.util.ArrayList;
import java.lang.Integer;
import java.lang.System;
import java.lang.Boolean;
import java.io.PrintStream;
import java.util.stream.Stream;
import java.util.function.Function;
public class Bug298 {
public void m() {
List<Integer> list = new ArrayList<>();
list.stream().map(x -> 2 * x);
Function<Integer, Boolean> filter = x -> true;
}
}

View File

@ -1,17 +0,0 @@
import java.lang.String;
class Base {
toString() {
return "Base";
}
}
public class Bug300 extends Base {
public m() {
return super.toString();
}
toString() {
return "Derived";
}
}

View File

@ -1,4 +0,0 @@
import java.util.HashSet;
public class Bug301<A> extends HashSet<A> {
}

View File

@ -1,11 +0,0 @@
import java.util.ArrayList;
import java.util.List;
import java.lang.Integer;
public class Bug302 {
public Bug302(List<Integer> a){}
public static m() {
new Bug302(new ArrayList<Integer>());
}
}

View File

@ -1,13 +0,0 @@
import java.lang.Integer;
import java.util.List;
class Base {
m(List<Integer> a) {}
}
public class Bug306 extends Base {
@Override
m(List<Integer> b) {
b.add(1);
}
}

View File

@ -1,46 +0,0 @@
public class Bug307 {
public void main() {
IVisitor v = new Visitor();
Impl2 f = new Impl2();
Impl1 g = new Impl1();
f.accept(v);
g.accept(v);
}
}
interface IVisitor {
void visit(Impl1 f);
void visit(Impl2 fb);
}
interface IAcceptor {
void accept(IVisitor v);
}
class Visitor implements IVisitor {
@Override
public void visit(Impl1 f) {
}
@Override
public void visit(Impl2 fb) {
}
}
class Impl1 implements IAcceptor {
@Override
public void accept(IVisitor v) {
v.visit(this);
}
}
class Impl2 implements IAcceptor {
@Override
public void accept(IVisitor v) {
v.visit(this);
}
}

View File

@ -1,16 +0,0 @@
import java.util.List;
import java.util.ArrayList;
import java.lang.Integer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.Optional;
public class Bug309 {
public main() {
List<Integer> list = new ArrayList<>(List.of(1,2,3,4,5,6,7,8,9));
var res = list.stream().filter(x -> x == 5).map(x -> x * 2).findFirst();
return res;
}
}

View File

@ -1,9 +0,0 @@
import java.lang.Integer;
import java.lang.String;
public class Bug310 {
Integer i = 3;
public toString() {
return i.toString();
}
}

View File

@ -1,10 +0,0 @@
import java.lang.String;
public class Bug311 {
Bug311A i = new Bug311A();
public toString() {
return i.toString();
}
}
class Bug311A {}

View File

@ -1,8 +0,0 @@
public class Bug312 {
Bug312A i = new Bug312A();
public main() {
if (i == null) {}
}
}
class Bug312A {}

View File

@ -1,13 +0,0 @@
import java.lang.Integer;
import java.util.List;
import java.util.ArrayList;
import java.util.stream.Stream;
import java.util.function.Predicate;
import java.util.function.Function;
import java.util.stream.Collectors;
public class Bug314 {
public List<Integer> convert(List<Integer> in) {
return in.stream().filter(x -> x > 5).collect(Collectors.toList());
}
}

View File

@ -1,13 +0,0 @@
import java.lang.Integer;
import java.util.function.Function;
import java.util.List;
import java.util.ArrayList;
import java.util.stream.Stream;
public class Bug325 {
public main() {
List<Integer> list = new ArrayList<>(List.of(1,2,3,4,5));
var func = x -> x*2;
return list.stream().map(func).toList();
}
}

View File

@ -1,8 +0,0 @@
import java.lang.Integer;
public class Bug326 {
public Bug326() {
var func = x -> y -> x * y;
return func.apply(3).apply(4);
}
}

View File

@ -1,8 +0,0 @@
import java.lang.Integer;
import Bug328B;
public class Bug328 extends Bug328B {
public Bug328() {
super(1);
}
}

View File

@ -1,3 +0,0 @@
public class Bug328B {
public Bug328B(int a) {}
}

View File

@ -1,15 +0,0 @@
import java.lang.Object;
interface Visitor {
public void visit(Object obj);
public void visit(ClassA a);
}
class ClassA {
void accept(Visitor v) {
v.visit(this);
}
}
public class Bug332 {
}

View File

@ -1,11 +0,0 @@
import java.lang.String;
public class Bug333 {
public static String Bar = "Bar";
}
class Bar {
public bar() {
String s = Bug333.Bar;
}
}

View File

@ -1,10 +0,0 @@
import java.lang.Integer;
import java.lang.Number;
import java.lang.Object;
public class Bug337 {
public void main() {
Fun1$$<Object, Integer> fun1 = x -> x.hashCode() + 1;
Fun1$$<Number, Number> fun2 = fun1;
}
}

View File

@ -1,11 +0,0 @@
import java.util.List;
import java.lang.Integer;
import java.lang.String;
import java.lang.Object;
import java.util.List;
public class Bug338 {
public hashCode() {
return List.of(42);
}
}

View File

@ -1,2 +0,0 @@
public record Bug343() {
}

View File

@ -1,16 +0,0 @@
import java.util.Vector;
import java.lang.Integer;
import java.lang.String;
public class Bug98 {
public m(x, y ,z) {
x = new Vector<Integer>();
y = new Vector<String>();
x.add(1);
y.add("2");
//Integer i = x.elementAt(0);
//String s = y.elementAt(0);
return z.vectorAddAll(x, y);
}
}

View File

@ -1,16 +0,0 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.lang.String;
import java.util.stream.Stream;
import java.util.function.Function;
import java.util.function.Predicate;
import java.lang.Integer;
class BugXXX {
public main() {
List<Integer> i = new ArrayList<>(List.of(1,2,3,4,5,6,7,8,9,10));
Optional<Integer> tmp = i.stream().filter(x -> x == 5).map(x -> x*2).findFirst();
return tmp;
}
}

View File

@ -1,11 +1,11 @@
import java.lang.Integer;
import java.lang.String;
import BB;
public class CC extends BB {
public m(Integer i) {
m(Integer i) {
return "CC";
}
public m2(CC x) { return "CC"; }
m2(CC x) { return "CC"; }
}

View File

@ -1,13 +0,0 @@
import java.lang.Integer;
public class Chain {
x = 5;
chain() {
return this;
}
public m() {
return this.chain().chain().chain().x;
}
}

View File

@ -1,5 +1,5 @@
public class Cycle {
public m(x, y) {
class Cycle {
m(x, y) {
y = x;
x = y;
}

View File

@ -1,5 +1,4 @@
import java.lang.Integer;
import CC;
public class DD extends CC { }

View File

@ -1,8 +1,3 @@
import java.lang.String;
import java.lang.RuntimeException;
public class Exceptions {
public m() {
throw new RuntimeException("Some Exception");
}
// m(Integer i) throws
}

View File

@ -1,12 +1,12 @@
import java.lang.Integer;
import java.lang.Double;
import java.lang.String;
public class Fac {
getFac(n) {
public class Fac {
getFac(n){
var res = 1;
var i = 1;
while (i <= n) {
while(i<=n) {
res = res * i;
i++;
}

View File

@ -1,14 +1,12 @@
import java.lang.String;
public class FieldTph2 {
public a;
a;
public m(b){
m(b){
b = a;
return b;
}
public m2(c){
m2(c){
a = c;
}
}

View File

@ -1,20 +1,20 @@
public class FieldTphConsMeth {
public a;
a;
public FieldTphConsMeth(c) {
a = id(c);
}
public id(b) {
id(b) {
return b;
}
public setA(x) {
setA(x) {
a = x;
return a;
}
public m(x,y) {
m(x,y) {
x = id(y);
}

View File

@ -1,13 +1,13 @@
import java.lang.Boolean;
public class FieldTphMMeth {
public a;
a;
public FieldTphMMeth(c,d,e) {
a = m(c,d,e);
}
public m(b,d,e) {
m(b,d,e) {
if(e) {
return m3(b);
} else{
@ -16,11 +16,11 @@ public class FieldTphMMeth {
}
public m2(b) {
m2(b) {
a = m3(b);
}
public m3(b){
m3(b){
return b;
}

View File

@ -1,23 +1,23 @@
import java.lang.Integer;
import java.lang.Boolean;
public class For{
public Integer m(Integer x){
class For{
Integer m(Integer x){
var c = x + 2;
Boolean b = true;
c = 5;
c++;
++c;
c--;
--c;
while(x<2){
x = x +1;
b = false;
}
for(int i = 0; i<10; i++) {
x = x + 5;
}
return x;
// Boolean b = true;
// c = 5;
// c++;
// ++c;
// c--;
// --c;
// while(x<2){
// x = x +1;
// b = false;
// }
return c;
// for(int i = 0;i<10;i++) {
// x = x + 5;
// }
}
// m2(Integer x){

View File

@ -1,23 +0,0 @@
import java.util.ArrayList;
import java.lang.Integer;
import java.lang.Number;
public class ForEach {
public m() {
var list = new ArrayList<>();
list.add(1); list.add(2); list.add(3);
var sum = 0;
for (var i : list) {
sum = sum + i;
}
return sum;
}
public m2() {
var list = new ArrayList<? extends Number>();
for (Number n : list) {
}
}
}

View File

@ -1,15 +0,0 @@
import java.lang.Integer;
import java.util.function.Function;
public class FunctionalInterface {
Integer accept(Function<Integer, Integer> f) {
return f.apply(20);
}
public Integer m() {
var v = accept(i -> {
return i * 10;
});
return v;
}
}

View File

@ -1,8 +1,8 @@
import java.lang.String;
import java.lang.Integer;
public class Generics2<B extends String>{
public <X extends Integer> X m1(X b){
class Generics2<B extends String>{
<B extends Integer> B m1(B b){
return b;
}

View File

@ -1,9 +0,0 @@
import java.lang.System;
import java.lang.String;
import java.io.PrintStream;
public class HelloWorld {
public static hello() {
System.out.println("Hello World!");
}
}

View File

@ -1,5 +0,0 @@
import java.lang.*;
public class ImportWildcard {
m(a, b) { return a * b; }
}

View File

@ -2,18 +2,15 @@ import java.util.Vector;
import java.lang.Integer;
import java.lang.String;
import AA;
import BB;
import CC;
import DD;
public class Inherit {
public main(d, i) {
main(d, i) {
return d.m(i);
}
public main(v, i) {
main(v, i) {
var aa = v.elementAt(0);
return aa.m(i);
}

View File

@ -2,18 +2,15 @@ import java.util.Vector;
import java.lang.Integer;
import java.lang.String;
import AA;
import BB;
import CC;
import DD;
public class Inherit2 {
public main(d) {
main(d) {
return d.m2(d);
}
public main(v) {
main(v) {
var aa = v.elementAt(0);
return aa.m2(aa);
}

View File

@ -1,18 +0,0 @@
import java.lang.Object;
import java.lang.Integer;
import java.lang.Boolean;
interface Interface {}
class Test implements Interface {
}
class Test2 {
}
public class InstanceOf {
a = new Test();
public test1() { return this.a instanceof Test; }
public test2() { return this.a instanceof Interface; }
public test3() { return this.a instanceof Integer; }
}

View File

@ -1,33 +0,0 @@
import java.lang.Integer;
interface A {
void method1();
default method2() {
}
}
interface B {
void method3();
}
interface C {
Integer myInt();
}
class ClassX implements A {
}
record ClassY(Integer myInt) implements C {}
public class Interfaces implements A, B {
public void method1() {
}
public void method3() {
var intf = new Interfaces();
intf = new ClassX();
intf.method1();
C c = new ClassY(10);
c.myInt();
}
}

View File

@ -0,0 +1,9 @@
public class LamRunnable{
public LamRunnable(){
Runnable lam = () -> {System.out.println("lambda");};
lam.run();
}
}

View File

@ -2,7 +2,7 @@ import java.lang.Integer;
public class Lambda {
public m() {
m () {
var lam1 = (x) -> {
return x;
};

View File

@ -1,16 +1,13 @@
import java.lang.Runnable;
import java.lang.String;
import java.lang.System;
import java.io.PrintStream;
public class LambdaRunnable {
public class LamRunnable{
public LambdaRunnable(){
public LamRunnable(){
Runnable lam = () -> {
System.out.println("Runnable is running");
};
Runnable lam = () -> {System.out.println("lambda");};
lam.run();
}
}

View File

@ -4,52 +4,52 @@ import java.lang.Float;
import java.lang.Double;
public class LessEqual {
public lessEqual(Integer a, Integer b){
lessEqual(Integer a, Integer b){
var c = a<=b;
return c;
}
public lessEqual(Long a, Long b){
lessEqual(Long a, Long b){
var c = a<=b;
return c;
}
public lessEqual(Float a, Float b){
lessEqual(Float a, Float b){
var c = a<=b;
return c;
}
public lessEqual(Double a, Double b){
lessEqual(Double a, Double b){
var c = a<=b;
return c;
}
public lessEqual(Long a, Integer b){
lessEqual(Long a, Integer b){
var c = a<=b;
return c;
}
public lessEqual(Float a, Integer b){
lessEqual(Float a, Integer b){
var c = a<=b;
return c;
}
public lessEqual(Double a, Integer b){
lessEqual(Double a, Integer b){
var c = a<=b;
return c;
}
public lessEqual(Float a, Long b){
lessEqual(Float a, Long b){
var c = a<=b;
return c;
}
public lessEqual(Double a, Long b){
lessEqual(Double a, Long b){
var c = a<=b;
return c;
}
public lessEqual(Double a, Float b){
lessEqual(Double a, Float b){
var c = a<=b;
return c;
}

View File

@ -5,52 +5,52 @@ import java.lang.Double;
public class LessThan {
public lessThan(Integer a, Integer b){
lessThan(Integer a, Integer b){
var c = a<b;
return c;
}
public lessThan(Long a, Long b){
lessThan(Long a, Long b){
var c = a<b;
return c;
}
public lessThan(Float a, Float b){
lessThan(Float a, Float b){
var c = a<b;
return c;
}
public lessThan(Double a, Double b){
lessThan(Double a, Double b){
var c = a<b;
return c;
}
public lessThan(Long a, Integer b){
lessThan(Long a, Integer b){
var c = a<b;
return c;
}
public lessThan(Float a, Integer b){
lessThan(Float a, Integer b){
var c = a<b;
return c;
}
public lessThan(Double a, Integer b){
lessThan(Double a, Integer b){
var c = a<b;
return c;
}
public lessThan(Float a, Long b){
lessThan(Float a, Long b){
var c = a<b;
return c;
}
public lessThan(Double a, Long b){
lessThan(Double a, Long b){
var c = a<b;
return c;
}
public lessThan(Double a, Float b){
lessThan(Double a, Float b){
var c = a<b;
return c;
}

View File

@ -1,8 +0,0 @@
import java.lang.Character;
public class Literal {
public m() { return null; }
public m2() { return 'C'; }
public m3() { return 10L; }
public m4() { return 10.5F; }
}

View File

@ -1,5 +1,3 @@
import java.util.List;
import java.util.AbstractList;
import java.util.Vector;
import java.lang.Integer;
//import java.lang.Float;
@ -11,7 +9,7 @@ public class Matrix extends Vector<Vector<Integer>> {
Matrix () {
}
public Matrix(vv) {
Matrix(vv) {
Integer i;
i = 0;
while(i < vv.size()) {
@ -21,7 +19,7 @@ public class Matrix extends Vector<Vector<Integer>> {
}
}
public mul(m) {
mul(m) {
var ret = new Matrix();
var i = 0;
while(i < size()) {
@ -32,8 +30,8 @@ public class Matrix extends Vector<Vector<Integer>> {
var erg = 0;
var k = 0;
while(k < v1.size()) {
erg = erg + v1.get(k)
* m.get(k).get(j);
erg = erg + v1.elementAt(k)
* m.elementAt(k).elementAt(j);
k++; }
// v2.addElement(new Integer(erg));
v2.addElement(erg);

View File

@ -8,7 +8,7 @@ public class MatrixOP extends Vector<Vector<Integer>> {
MatrixOP () {
}
public MatrixOP(vv) {
MatrixOP(vv) {
Integer i;
i = 0;
while(i < vv.size()) {

View File

@ -2,16 +2,16 @@ import java.util.List;
import java.lang.Integer;
//import java.util.Collection;
public class Merge {
class Merge {
public merge(a, b) {
merge(a, b) {
a.addAll(b);
return a;
}
public sort(in){
sort(in){
var firstHalf = in.subList(1,2);
var secondHalf = in.subList(1,2);
return merge(sort(firstHalf), sort(secondHalf));

View File

@ -1,14 +1,13 @@
import java.lang.Double;
import java.lang.String;
import java.lang.Long;
import java.lang.Integer;
public class OL {
public m (x) { return x + x; }
class OL {
m (x) { return x + x; }
}
public class OLMain {
public main(x) {
class OLMain {
main(x) {
var ol;
ol = new OL();
return ol.m(x);

View File

@ -1,17 +0,0 @@
import java.lang.Integer;
public class Parent {
public Integer x;
public Parent(Integer a) {
this.x = a;
}
public Parent() {}
}
public class Child extends Parent {
public Child() {
super(3);
}
}

View File

@ -1,34 +1,11 @@
import java.lang.Boolean;
import java.lang.Integer;
public class Op1 {
public not() {
var b = false;
var c = !b;
return c;
public class Op1{
public Op1() {
Runnable lam = () -> {
String test = "";
String b = "b";
test = b;
System.out.println(test);};
//lam.run();
}
public or() {
var a = 10;
var b = 20;
return a | b;
}
public and() {
var a = 10;
var b = 20;
return a & b;
}
public xor() {
var a = 10;
var b = 20;
return a ^ b;
}
public mod() {
var a = 10;
var b = 2;
return a % b;
}
}

View File

@ -1,17 +1,11 @@
import java.lang.Integer;
import java.lang.Double;
import java.lang.String;
public class Op2 {
public m(){
m(){
var x = "";
var a = 5+x;
Integer x = 10;
Double y = 10.5;
var a = x - y;
return a;
}
}

View File

@ -1,50 +0,0 @@
import java.lang.Integer;
import java.lang.Number;
import java.lang.Float;
record Point(Number x, Number y) {}
public class OverloadPattern {
public m(Point(Integer x, Integer y)) {
return x + y;
}
public m(Point(Float x, Float y)) {
return x * y;
}
public m(Integer x) {
return x;
}
}
/*
public class OverloadPattern {
Integer m$Point$_$java$lang$Integer$_$java$lang$Integer$_$(Point point) {
var x = point.x();
var y = point.y();
return x + y;
}
Float m$Point$_$java$lang$Float$_$java$lang$Float$_$(Point point) {
var x = point.x();
var y = point.y();
return x * y;
}
Number m(Point point) {
return switch(point) {
case Point(Integer x, Integer y) ->
m$Point$_$java$lang$Integer$_$java$lang$Integer$_$(point);
case Point(Float x, Float y) ->
m$Point$_$java$lang$Float$_$java$lang$Float$_$(point);
default -> throw new IllegalArgumentException();
}
}
Integer m(Integer x) {
return x;
}
}
*/

View File

@ -2,17 +2,17 @@ import java.lang.String;
public class Overloading{
public test(x){
test(x){
return x.methode();
}
public methode(){
methode(){
return "Overloading";
}
}
public class Overloading2{
public methode(){
methode(){
return "Overloading2";
}
}

View File

@ -1,12 +0,0 @@
import java.lang.Object;
import java.lang.Boolean;
public class OverrideEquals extends OverrideRoot {
public boolean equals(Object o) {
return true;
}
public int method(int var1, float var2) {
return 0;
}
}

View File

@ -1,3 +0,0 @@
public abstract class OverrideRoot {
public abstract int method(int a, float b);
}

View File

@ -2,16 +2,31 @@ import java.util.Vector;
import java.lang.Boolean;
import java.lang.Object;
class Pair<U, T> {
U a;
T b;
public class Pair<T, U> {
T x;
U y;
public fst() {
return x;
}
public snd() {
return y;
make(x) {
var ret = new Pair<>();
ret.a = x.elementAt(0);
ret.b = x.elementAt(1);
return ret;
}
/*
eq(a, b) {
b = a;
return a == b;
}
compare( p) {
return eq(p.a, p.b);
//return p.a == p.b;
}
void m(Pair<?, ?> p, List<? extends Eq> b)
{
//this.compare(p); //1, type incorrect
this.compare(this.make(b)); //2, OK
}
*/
}

View File

@ -3,7 +3,7 @@ import java.lang.String;
public class Plus {
public m(a,b) {
m(a,b) {
return a+b;
}
}

View File

@ -1,25 +1,25 @@
import java.lang.Integer;
public class PostIncDec {
public m() {
m() {
var i = 0;
i++;
return i;
}
public m2() {
m2() {
var i = 0;
var j = i++;
return j;
}
public d() {
d() {
var i = 0;
i--;
return i;
}
public d2() {
d2() {
var i = 0;
var j = i--;
return j;

View File

@ -1,25 +1,25 @@
import java.lang.Integer;
public class PreInc {
public m() {
m() {
var i = 0;
++i;
return i;
}
public m2() {
m2() {
var i = 0;
var j = ++i;
return j;
}
public d() {
d() {
var i = 0;
--i;
return i;
}
public d2() {
d2() {
var i = 0;
var j = --i;
return j;

View File

@ -3,16 +3,16 @@ import java.util.Stack;
public class Put {
public putElement(ele, v) {
putElement(ele, v) {
v.addElement(ele);
}
public putElement(ele, s) {
putElement(ele, s) {
s.push(ele);
}
public main(ele, x) {
main(ele, x) {
putElement(ele, x);
}

Some files were not shown because too many files have changed in this diff Show More