Skip to content

Commit

Permalink
add Serialization of Patches
Browse files Browse the repository at this point in the history
  • Loading branch information
danglotb committed Sep 19, 2016
1 parent 3785af8 commit 22ee7e5
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.io.File;

public class ExpressionPatch implements Patch {
private static final long serialVersionUID = -157430722893779258L;
private final Expression expression;
private final SourceLocation location;
private final StatementType type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
import fr.inria.lille.repair.common.synth.StatementType;

import java.io.File;
import java.io.Serializable;

/**
* @author Favio D. DeMarco
*/
public interface Patch {
public interface Patch extends Serializable {

/**
* Class that represents the inability to find a working patch.
Expand All @@ -31,6 +32,8 @@ public interface Patch {
*/
static final class NoPatch implements Patch {

private static final long serialVersionUID = 879597343875223695L;

private NoPatch() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
public class StringPatch implements Patch {

private static final long serialVersionUID = 1150517609100930111L;
private final SourceLocation location;
private final String repair;
private final StatementType type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
import xxl.java.library.FileLibrary;

import java.io.File;
import java.io.Serializable;

/**
* @author Favio D. DeMarco
*/
public final class SourceLocation {
public final class SourceLocation implements Serializable {

private static final long serialVersionUID = -4580346333924562425L;
private final String containingClassName;

private final int lineNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import fr.inria.lille.spirals.repair.commons.Candidates;
import fr.inria.lille.spirals.repair.expression.value.Value;

import java.io.Serializable;

/**
* is the generic type of an expression
*/
public interface Expression extends Cloneable, Comparable<Expression> {
public interface Expression extends Cloneable, Comparable<Expression>, Serializable {

Value getValue();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* is the generic type of an expression
*/
public abstract class ExpressionImpl implements Expression {
private static final long serialVersionUID = -2411100294881241663L;
private double priority;

private Value value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
public abstract class AbstractValue implements Value {
private double priority;

private Object realValue;
private transient Object realValue;
private boolean isPrimitive = false;
private boolean isConstant = false;
private com.sun.jdi.Value JDIValue;
private transient com.sun.jdi.Value JDIValue;
private Class type;

public AbstractValue(Object realValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class ArrayValueImpl extends AbstractValue implements ArrayValue {
private final int length;
private String arrayType;
private com.sun.jdi.Value JDIValue;
private transient com.sun.jdi.Value JDIValue;
private List<Value> values;

public ArrayValueImpl(String arrayType, com.sun.jdi.Value JDIValue, List<Value> values, Object realValue) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package fr.inria.lille.spirals.repair.expression.value;


import java.io.Serializable;

/**
* is the generic type of a primitive value
*/
public interface PrimitiveValue extends Value {
public interface PrimitiveValue extends Value, Serializable {
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import com.sun.jdi.Type;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;

public interface Value {
import java.io.Serializable;

public interface Value extends Serializable {

Class getType();

Expand Down

0 comments on commit 22ee7e5

Please sign in to comment.