Commit 542b39d8 authored by Sergio Pérez's avatar Sergio Pérez
Browse files

Dockerfile and exampleFolder added

parent 81c8d7b2
Loading
Loading
Loading
Loading
Loading

Dockerfile

0 → 100644
+20 −0
Original line number Diff line number Diff line
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London"
RUN apt-get update
RUN export PATH=$HOME/.local/bin:$PATH
RUN apt-get install -y locales build-essential git default-jre maven vim
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
    locale-gen
ENV LANG en_US.UTF-8  
ENV LANGUAGE en_US:en  
ENV LC_ALL en_US.UTF-8     

# # # INSTALL JavaSDG
RUN git clone https://kaz.dsic.upv.es/git/program-slicing/SDG.git

WORKDIR "/SDG"

RUN mvn package -Dmaven.test.skip
RUN mv ./sdg-cli/target/sdg-cli-1.3.0-jar-with-dependencies.jar ./javaSDG.jar

examples/Example1.java

0 → 100644
+14 −0
Original line number Diff line number Diff line
public class Example1 {
    public static void main(String[] args) {
        int sum = 0;
        int prod = 0;
        int i;
        int n = 10;
        for (i = 0; i < 10; i++) {
            sum += 1;
            prod += n;
        }
        System.out.println(sum);
        System.out.println(prod);
    }
}
+11 −0
Original line number Diff line number Diff line
public class A {
	int a = 0;
	public A(int val) { a = val; }
	public int getA() { return a; }
	public void setA(int val) { a = val; }
	public void printA() { 
		System.out.print(a); 
	}
	public void updateA(int v) { a++; }
}
+18 −0
Original line number Diff line number Diff line
public class B extends A {
	int b = 5;
	public B(double val){
		super((int) val);
	}
	public void updateB(B b){
		b.setB(10);
	}
	public int getB() { return b; }
	public void setB(int val) { b = val; }
	public void printA() { 
		System.out.print("Useless"); 
	}
	public void updateA(int v) { 
		super.updateA(v); 
		a += v;
	}
}
+12 −0
Original line number Diff line number Diff line
public class Example2 {
	public static void main(String[] args){
		A a1 = new A(1);
		B b1 = new B(5.6);
		a1.printA(); 
		b1.printA();
		b1.updateA(5);	
		int z = b1.getA(); 
		System.out.print(z);
	}
}