Fix #548
This commit is contained in:
@@ -8,8 +8,9 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public abstract class BaseModel{
|
||||
public abstract class BaseModel implements Cloneable{
|
||||
@CallSuper
|
||||
public void postprocess() throws ObjectValidationException{
|
||||
try{
|
||||
@@ -23,4 +24,14 @@ public abstract class BaseModel{
|
||||
}
|
||||
}catch(IllegalAccessException ignore){}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Object clone(){
|
||||
try{
|
||||
return super.clone();
|
||||
}catch(CloneNotSupportedException x){
|
||||
throw new RuntimeException(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,10 +30,7 @@ public class PushSubscription extends BaseModel implements Cloneable{
|
||||
@NonNull
|
||||
@Override
|
||||
public PushSubscription clone(){
|
||||
PushSubscription copy=null;
|
||||
try{
|
||||
copy=(PushSubscription) super.clone();
|
||||
}catch(CloneNotSupportedException ignore){}
|
||||
PushSubscription copy=(PushSubscription) super.clone();
|
||||
copy.alerts=alerts.clone();
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import org.parceler.Parcel;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@Parcel
|
||||
public class Status extends BaseModel implements DisplayItemsParent{
|
||||
@RequiredField
|
||||
@@ -176,4 +178,12 @@ public class Status extends BaseModel implements DisplayItemsParent{
|
||||
strippedText=HtmlParser.strip(content);
|
||||
return strippedText;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Status clone(){
|
||||
Status copy=(Status) super.clone();
|
||||
copy.spoilerRevealed=false;
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user