Make extent public (unsafe)

Dieser Commit ist enthalten in:
MattBDev 2020-06-11 17:26:13 -04:00
Ursprung 7cc1994e20
Commit 1eacb91267
2 geänderte Dateien mit 5 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -33,15 +33,9 @@ public class WEManager {
public void cancelEditSafe(AbstractDelegateExtent parent, FaweException reason) throws FaweException { public void cancelEditSafe(AbstractDelegateExtent parent, FaweException reason) throws FaweException {
log.warn("CancelEditSafe was hit. Please ignore this message."); log.warn("CancelEditSafe was hit. Please ignore this message.");
try { Extent currentExtent = parent.getExtent();
final Field field = AbstractDelegateExtent.class.getDeclaredField("extent"); if (!(currentExtent instanceof NullExtent)) {
field.setAccessible(true); parent.extent = new NullExtent(parent.extent, reason);
Extent currentExtent = parent.getExtent();
if (!(currentExtent instanceof NullExtent)) {
field.set(parent, new NullExtent((Extent) field.get(parent), reason));
}
} catch (Exception e) {
e.printStackTrace();
} }
throw reason; throw reason;
} }

Datei anzeigen

@ -59,7 +59,8 @@ public class AbstractDelegateExtent implements Extent {
private static final Logger logger = LoggerFactory.getLogger(AbstractDelegateExtent.class); private static final Logger logger = LoggerFactory.getLogger(AbstractDelegateExtent.class);
private final Extent extent; //Not safe for public usage
public Extent extent;
/** /**
* Create a new instance. * Create a new instance.