diff --git a/CHANGELOG.md b/CHANGELOG.md index 7de4ade..b9f70cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [1.2.3] - 2020-09-01 +### Added +- PduEditor bug fix + ## [1.2.2] - 2020-08-05 ### Added - minor bug fixes diff --git a/src/main/java/com/warxim/petep/common/Constant.java b/src/main/java/com/warxim/petep/common/Constant.java index 1ce98a5..e37b20b 100644 --- a/src/main/java/com/warxim/petep/common/Constant.java +++ b/src/main/java/com/warxim/petep/common/Constant.java @@ -27,7 +27,7 @@ @PetepAPI public final class Constant { // PETEP version - public static final String VERSION = "1.2.2"; + public static final String VERSION = "1.2.3"; // PETEP web public static final String WEB = "http://petep.warxim.com/"; @@ -44,9 +44,8 @@ public final class Constant { public static final String INTERCEPTORS_S2C_CONFIG_FILE = "interceptors-S2C.json"; // Internal extensions - public static final List INTERNAL_EXTENSIONS = - Collections.unmodifiableList(Arrays.asList("logger", "tcp", "http", "external_http_proxy", - "test", "connection_view", "tagger", "catcher", "modifier")); + public static final List INTERNAL_EXTENSIONS = Collections.unmodifiableList(Arrays.asList("logger", "tcp", + "http", "external_http_proxy", "test", "connection_view", "tagger", "catcher", "modifier")); // Configuration items public static final String CONFIG_ITEM_FACTORY = "factory"; diff --git a/src/main/java/com/warxim/petep/core/PETEP.java b/src/main/java/com/warxim/petep/core/PETEP.java index 7c54514..0ba9544 100644 --- a/src/main/java/com/warxim/petep/core/PETEP.java +++ b/src/main/java/com/warxim/petep/core/PETEP.java @@ -124,8 +124,7 @@ private boolean runPrepare() { Logger.getGlobal().info("PETEP preparing..."); state = PetepState.PREPARING; - if (!proxyExecutor.prepare() || !interceptorExecutorC2S.prepare() - || !interceptorExecutorS2C.prepare()) { + if (!proxyExecutor.prepare() || !interceptorExecutorC2S.prepare() || !interceptorExecutorS2C.prepare()) { return false; } @@ -195,16 +194,14 @@ public void processS2C(PDU pdu) { } /** - * Processes PDU internally in direction C2S and start in specified interceptor. (Client -> - * Server) + * Processes PDU internally in direction C2S and start in specified interceptor. (Client -> Server) */ public void processC2S(PDU pdu, int interceptorId) { interceptorExecutorC2S.intercept(pdu, interceptorId); } /** - * Processes PDU internally in direction S2C and start in specified interceptor. (Client <- - * Server) + * Processes PDU internally in direction S2C and start in specified interceptor. (Client <- Server) */ public void processS2C(PDU pdu, int interceptorId) { interceptorExecutorS2C.intercept(pdu, interceptorId); diff --git a/src/main/java/com/warxim/petep/gui/control/PduEditor.java b/src/main/java/com/warxim/petep/gui/control/PduEditor.java index dc10918..f811451 100644 --- a/src/main/java/com/warxim/petep/gui/control/PduEditor.java +++ b/src/main/java/com/warxim/petep/gui/control/PduEditor.java @@ -95,8 +95,7 @@ public PduEditor() throws IOException { loader.setClassLoader(getClass().getClassLoader()); loader.load(); - destinationInput - .setItems(FXCollections.observableArrayList(PduDestination.CLIENT, PduDestination.SERVER)); + destinationInput.setItems(FXCollections.observableArrayList(PduDestination.CLIENT, PduDestination.SERVER)); connectionInput.focusedProperty().addListener(this::onConnectionFocusChange); proxyInput.valueProperty().addListener(this::onProxyChange); @@ -110,18 +109,14 @@ public PduEditor() throws IOException { } /** Loads selected proxy interface. */ - private void onProxyChange( - ObservableValue observable, - Proxy oldValue, - Proxy newValue) { + private void onProxyChange(ObservableValue observable, Proxy oldValue, Proxy newValue) { if (newValue == null) { return; } connectionInput.getSelectionModel().clearSelection(); - if (oldValue == null - || oldValue.getModule().getFactory() != newValue.getModule().getFactory()) { + if (oldValue == null || oldValue.getModule().getFactory() != newValue.getModule().getFactory()) { loadMetadataPane(newValue); } } @@ -144,10 +139,7 @@ private void onConnectionFocusChange( } /** Shows/hides flow editor. */ - private void onFlowChange( - ObservableValue observable, - boolean oldValue, - boolean newValue) { + private void onFlowChange(ObservableValue observable, boolean oldValue, boolean newValue) { proxyInput.setDisable(oldValue); destinationInput.setDisable(oldValue); connectionInput.setDisable(oldValue); @@ -160,9 +152,9 @@ private void onDestinationChange( PduDestination oldValue, PduDestination newValue) { if (newValue == PduDestination.CLIENT) { - interceptorInput.setItems(interceptorsC2S); - } else { interceptorInput.setItems(interceptorsS2C); + } else { + interceptorInput.setItems(interceptorsC2S); } } @@ -219,11 +211,11 @@ public PDU getPdu() { if (!metadataPane.getChildren().isEmpty()) { PduMetadataPane pane = ((PduMetadataPane) metadataPane.getChildren().get(0)); - pdu = pane.getPdu(proxyInput.getValue(), connectionInput.getValue(), - destinationInput.getValue(), dataInput.getBytes(), dataInput.getBytes().length); + pdu = pane.getPdu(proxyInput.getValue(), connectionInput.getValue(), destinationInput.getValue(), + dataInput.getBytes(), dataInput.getBytes().length); } else { - pdu = new DefaultPdu(proxyInput.getValue(), connectionInput.getValue(), - destinationInput.getValue(), dataInput.getBytes(), dataInput.getBytes().length); + pdu = new DefaultPdu(proxyInput.getValue(), connectionInput.getValue(), destinationInput.getValue(), + dataInput.getBytes(), dataInput.getBytes().length); } pdu.setCharset(dataInput.getCharset()); @@ -256,9 +248,9 @@ public void setPdu(PDU pdu) { connectionInput.getSelectionModel().select(pdu.getConnection()); if (pdu.getDestination() == PduDestination.CLIENT) { - interceptorInput.setItems(interceptorsC2S); - } else { interceptorInput.setItems(interceptorsS2C); + } else { + interceptorInput.setItems(interceptorsC2S); } if (pdu.getLastInterceptor() == null) {