auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updateActionAvailability(GlusterVolumeEntity volumeEntity) { boolean allowStartSessionCommand = true; if(volumeEntity == null) { return; } if(getSelectedItem() == null) { allowStartSessionCommand = false; } else { if(getSelectedItems().size() == 1) { GlusterGeoRepSession selectedSession = (GlusterGeoRepSession)getSelectedItem(); allowStartSessionCommand = selectedSession .getStatus() == GeoRepSessionStatus.NOTSTARTED || selectedSession.getStatus() == GeoRepSessionStatus.STOPPED; } } getNewSessionCommand().setIsAvailable(true); getRemoveSessionCommand().setIsAvailable(false); getStartSessionCommand().setIsExecutionAllowed(allowStartSessionCommand); getStopSessionCommand().setIsAvailable(false); getSessionOptionsCommand().setIsAvailable(false); getViewSessionDetailsCommand().setIsAvailable(false); getRefreshSessionsCommand().setIsAvailable(true); }

Target:
private void updateActionAvailability(GlusterVolumeEntity volumeEntity) { boolean allowStartSessionCommand = true; if(volumeEntity == null) { return; } if(getSelectedItem() == null) { allowStartSessionCommand = false; } else if(getSelectedItems().size() == 1) { GlusterGeoRepSession selectedSession = (GlusterGeoRepSession)getSelectedItem(); allowStartSessionCommand = selectedSession .getStatus() == GeoRepSessionStatus.NOTSTARTED || selectedSession.getStatus() == GeoRepSessionStatus.STOPPED; } else { allowStartSessionCommand = false; } getNewSessionCommand().setIsAvailable(true); getRemoveSessionCommand().setIsAvailable(false); getStartSessionCommand().setIsExecutionAllowed(allowStartSessionCommand); getStopSessionCommand().setIsAvailable(false); getSessionOptionsCommand().setIsAvailable(false); getViewSessionDetailsCommand().setIsAvailable(false); getRefreshSessionsCommand().setIsAvailable(true); }
Source:
public String fileToJSON(String yamlRun) throws IOException { Yaml yaml = new Yaml(); final FileInputStream fileInputStream = FileUtils.openInputStream(new File(yamlRun)); Map<String, Object> map = yaml.load(fileInputStream); JSONObject jsonObject = new JSONObject(map); return jsonObject.toString(); }

Target:
public String fileToJSON(String yamlRun) throws IOException { Yaml yaml = new Yaml(); try (FileInputStream fileInputStream = FileUtils.openInputStream(new File(yamlRun))) { Map<String, Object> map = yaml.load(fileInputStream); JSONObject jsonObject = new JSONObject(map); return jsonObject.toString(); } }
Source:
protected String mapPassword(Object passwordValue) { String passwordValueString; if (!(passwordValue instanceof String)) { passwordValueString = new String((byte[]) passwordValue); } else { passwordValueString = (String) passwordValue; } if (!isBase64EncodedPassword()) { return passwordValueString; } return decodeBase64EncodedPassword(passwordValueString); }

Target:
protected String mapPassword(Object passwordValue) { String passwordValueString = super.mapPassword(passwordValue); if (!isUserPasswordEncoded()) { return passwordValueString; } return decodeBase64EncodedPassword(passwordValueString); }
Source:
public ProjectApi create(ProjectInput in) { throw new NotImplementedException(); }

Target:
public ProjectApi create(ProjectInput in) throws RestApiException { throw new NotImplementedException(); }
Source:
protected void onGooglePlayServicesReady() { SupportMapFragment fragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); map = fragment.getMap(); map.setMyLocationEnabled(true); map.getUiSettings().setZoomControlsEnabled(false); map.getUiSettings().setMyLocationButtonEnabled(false); MarkerOptions markerOptions = MapUtil.getUserSpeechBubbleMarkerOptions( request.getClient(), iconGenerator, SpeechBubble.ColorType.BLUE ); map.addMarker(markerOptions); MapUtil.panAndZoomToUser(map, request.getClient(), MapUtil.DEFAULT_ZOOM_LEVEL); }

Target:
protected void onGooglePlayServicesReady() { SupportMapFragment fragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); map = fragment.getMap(); map.setMyLocationEnabled(true); MarkerOptions markerOptions = MapUtil.getUserSpeechBubbleMarkerOptions( request.getClient(), iconGenerator, SpeechBubble.ColorType.BLUE ); map.addMarker(markerOptions); MapUtil.panAndZoomToUser(map, request.getClient(), MapUtil.DEFAULT_ZOOM_LEVEL); }
Source:
public void testWarmUpConnections() throws IOException { MockClusterMap mockClusterMap = new MockClusterMap(); List<DataNodeId> localDataNodeIds = mockClusterMap.getDataNodeIds() .stream() .filter(dataNodeId -> mockClusterMap.getDatacenterName(mockClusterMap.getLocalDatacenterId()) .equals(dataNodeId.getDatacenterName())) .collect(Collectors.toList()); int maxPort = mockClusterMap.isSslPortsEnabled() ? MAX_PORTS_SSL : MAX_PORTS_PLAIN_TEXT; Assert.assertEquals("Connection count is not expected", maxPort * localDataNodeIds.size(), networkClient.warmUpConnections(localDataNodeIds, 1.0, 2000)); Assert.assertEquals("Connection count is not expected", (int) (0.5 * maxPort) * localDataNodeIds.size(), networkClient.warmUpConnections(localDataNodeIds, 0.5, 2000)); Assert.assertEquals("Connection count is not expected", 0 * maxPort * localDataNodeIds.size(), networkClient.warmUpConnections(localDataNodeIds, 0, 2000)); selector.setState(MockSelectorState.Good); }

Target:
public void testWarmUpConnections() throws IOException { MockClusterMap mockClusterMap = new MockClusterMap(true, 9, 3, 3, false); List<DataNodeId> localDataNodeIds = mockClusterMap.getDataNodeIds() .stream() .filter(dataNodeId -> mockClusterMap.getDatacenterName(mockClusterMap.getLocalDatacenterId()) .equals(dataNodeId.getDatacenterName())) .collect(Collectors.toList()); int maxPort = mockClusterMap.isSslPortsEnabled() ? MAX_PORTS_SSL : MAX_PORTS_PLAIN_TEXT; doTestWarmUpConnections(localDataNodeIds, maxPort, PortType.PLAINTEXT); for (DataNodeId dataNodeId : localDataNodeIds) { ((MockDataNodeId) dataNodeId).setSslEnabledDataCenters( Collections.singletonList(mockClusterMap.getDatacenterName(mockClusterMap.getLocalDatacenterId()))); } doTestWarmUpConnections(localDataNodeIds, maxPort, PortType.SSL); }
Source:
public void setData(BufferInfo vertexBufferInfo, BufferInfo normalBufferInfo, float[] textureCoords, float[] colors, int[] indices, boolean createVBOs) { if (textureCoords == null || textureCoords.length == 0) { textureCoords = new float[(mNumVertices / 3) * 2]; } setTextureCoords(textureCoords); if (colors == null || colors.length == 0) { setColors(0xff000000 + (int) (Math.random() * 0xffffff)); } else { setColors(colors); } setIndices(indices); mBuffers.put(VERTEX_BUFFER_KEY, vertexBufferInfo); mBuffers.put(NORMAL_BUFFER_KEY, normalBufferInfo); mOriginalGeometry = null; if (createVBOs) { createBuffers(); } }

Target:
public void setData(BufferInfo vertexBufferInfo, BufferInfo normalBufferInfo, float[] textureCoords, float[] colors, int[] indices, boolean createVBOs) { if (textureCoords == null || textureCoords.length == 0) { textureCoords = new float[(mNumVertices / 3) * 2]; } setTextureCoords(textureCoords); if (colors == null || colors.length == 0) { setColors(0xff000000 + (int) (Math.random() * 0xffffff)); } else { setColors(colors); } setIndices(indices); mBuffers.add(VERTEX_BUFFER_KEY, vertexBufferInfo); mBuffers.add(NORMAL_BUFFER_KEY, normalBufferInfo); mOriginalGeometry = null; if (createVBOs) { createBuffers(); } }
Source:
public void setFinishedBuilding(boolean isFinishedBuilding) { this.isFinishedBuilding = isFinishedBuilding; }

Target:
protected void setFinishedBuilding(boolean isFinishedBuilding) { this.fFinishedBuilding = isFinishedBuilding; }
Source:
protected void abortOldUploads() { ConfigurationService configurationService = Framework.getService(ConfigurationService.class); if (configurationService == null) { return; } if (configurationService.isBooleanTrue(MULTIPART_CLEANUP_DISABLED_PROPERTY)) { return; } new Thread(this::abortOldMultipartUploadsInternal, "Nuxeo-S3-abortOldMultipartUploads-" + bucketName).start(); }

Target:
protected void abortOldUploads() { if (getBooleanProperty(MULTIPART_CLEANUP_DISABLED_PROPERTY)) { log.debug("Cleanup of old multipart uploads is disabled"); return; } new Thread(this::abortOldMultipartUploadsInternal, "Nuxeo-S3-abortOldMultipartUploads-" + bucketName).start(); }
Source:
public void drawMarker(double xPosition, double yPosition) { double markerSpan = this.mapCanvas.getWidth() / HUNDRED; double upperLeftX = xPosition - markerSpan; double upperLeftY = yPosition + markerSpan; double upperRightX = xPosition + markerSpan; double upperRightY = yPosition + markerSpan; double lowerLeftX = xPosition - markerSpan; double lowerLeftY = yPosition - markerSpan; double lowerRightX = xPosition + markerSpan; double lowerRightY = yPosition - markerSpan; Line upperLeftToLowerRight = new Line(upperLeftX, upperLeftY, lowerRightX, lowerRightY); Line upperRightToLowerLeft = new Line(upperRightX, upperRightY, lowerLeftX, lowerLeftY); upperLeftToLowerRight.setFill(null); upperLeftToLowerRight.setStroke(Color.RED); upperLeftToLowerRight.setStrokeWidth(2); upperLeftToLowerRight.setVisible(true); upperRightToLowerLeft.setFill(null); upperRightToLowerLeft.setStroke(Color.RED); upperRightToLowerLeft.setStrokeWidth(2); upperRightToLowerLeft.setVisible(true); this.getChildren().add(upperLeftToLowerRight); this.getChildren().add(upperRightToLowerLeft); }

Target:
public void drawMarker(double xPosition, double yPosition) { double markerSpan = Math.sqrt(Math.pow(this.mapCanvas.getWidth(), 2) + Math.pow(this.mapCanvas.getHeight(), 2)) / HUNDRED; double upperLeftX = xPosition - markerSpan; double upperLeftY = yPosition + markerSpan; double upperRightX = xPosition + markerSpan; double upperRightY = yPosition + markerSpan; double lowerLeftX = xPosition - markerSpan; double lowerLeftY = yPosition - markerSpan; double lowerRightX = xPosition + markerSpan; double lowerRightY = yPosition - markerSpan; Line upperLeftToLowerRight = new Line(upperLeftX, upperLeftY, lowerRightX, lowerRightY); Line upperRightToLowerLeft = new Line(upperRightX, upperRightY, lowerLeftX, lowerLeftY); upperLeftToLowerRight.setFill(null); upperLeftToLowerRight.setStroke(Color.RED); upperLeftToLowerRight.setStrokeWidth(2); upperLeftToLowerRight.setVisible(true); upperRightToLowerLeft.setFill(null); upperRightToLowerLeft.setStroke(Color.RED); upperRightToLowerLeft.setStrokeWidth(2); upperRightToLowerLeft.setVisible(true); this.getChildren().add(upperLeftToLowerRight); this.getChildren().add(upperRightToLowerLeft); }
Source:
private RevObject writeBlob(final Repository repo, final String data) throws IOException { final RevWalk revWalk = new RevWalk(repo); final byte[] bytes = Constants.encode(data); final ObjectId id; try (final ObjectInserter inserter = repo.newObjectInserter()) { id = inserter.insert(Constants.OBJ_BLOB, bytes); inserter.flush(); } try { parse(id); fail("Object " + id.name() + " should not exist in test repository"); } catch (MissingObjectException e) { } return revWalk.lookupBlob(id); }

Target:
private RevObject writeBlob(final Repository repo, final String data) throws IOException { final RevWalk revWalk = new RevWalk(repo); final byte[] bytes = Constants.encode(data); final ObjectId id; try (ObjectInserter inserter = repo.newObjectInserter()) { id = inserter.insert(Constants.OBJ_BLOB, bytes); inserter.flush(); } try { parse(id); fail("Object " + id.name() + " should not exist in test repository"); } catch (MissingObjectException e) { } return revWalk.lookupBlob(id); }
Source:
public Long getLong(String key, Long defaultValue) { try { return getValue(Long.class, key); } catch (NoSuchElementException e) { return defaultValue; } }

Target:
public Long getLong(String key, Long defaultValue) { return getValueWithDefault(Long.class, key, defaultValue); }
Source:
protected boolean canDoAction() { GlusterVolumeEntity volume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!validate(getBrickValidator().isValidParam(volume, getParameters().getBricks()))) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_PARAMS_INVALID); } if (!(getGlusterTaskUtils().isTaskOfType(volume, GlusterTaskType.REMOVE_BRICK)) || !(getGlusterTaskUtils().isTaskStatus(volume, JobExecutionStatus.FINISHED))) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_FINISHED); } return true; }

Target:
protected boolean canDoAction() { GlusterVolumeEntity volume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!validate(getBrickValidator().canStopOrCommitRemoveBrick(volume, getParameters().getBricks()))) { return false; } if (!(getGlusterTaskUtils().isTaskOfType(volume, GlusterTaskType.REMOVE_BRICK)) || !(getGlusterTaskUtils().isTaskStatus(volume, JobExecutionStatus.FINISHED))) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_FINISHED); } return true; }
Source:
public JsonWriter value(Number value) throws IOException { if (value == null) { return nullValue(); } double d = value.doubleValue(); if (!isLenient()) { if (Double.isNaN(d) || Double.isInfinite(d)) { throw new IllegalArgumentException("JSON forbids NaN and infinities: " + value); } } if (floor(d) == d) { int a = value.intValue(); generator.writeNumber(a); } else { generator.writeNumber(d); } return this; }

Target:
public JsonWriter value(Number value) throws IOException { if (value == null) { return nullValue(); } if (value instanceof Integer) { generator.writeNumber(value.intValue()); } else if (value instanceof Short) { generator.writeNumber(value.shortValue()); } else if (value instanceof Long) { generator.writeNumber(value.longValue()); } else if (value instanceof Float) { float f = value.floatValue(); checkStrictNumber(f); generator.writeNumber(f); } else if (value instanceof BigInteger) { generator.writeNumber((BigInteger) value); } else if (value instanceof BigDecimal) { BigDecimal bd = (BigDecimal) value; checkStrictNumber(bd); generator.writeNumber(bd); } else { double d = value.doubleValue(); checkStrictNumber(d); generator.writeNumber(d); } return this; }
Source:
public void testGetChildrenOnLargeNumChildren() throws Exception { String path = "/" + TestHelper.getTestMethodName(); int toCreateChildrenCount = 110; _zkClient.createPersistent(path); for (int i = 0; i < toCreateChildrenCount; i++) { List<Op> ops = new ArrayList<>(1000); for (int j = 0; j < 1000; j++) { String child = path + "/" + UUID.randomUUID().toString(); ops.add(Op.create(child, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL)); } _zkClient.multi(ops); } try { _zkClient.getChildren(path); Assert.fail("Should not successfully get children because of connection loss."); } catch (ZkException expected) { Assert.assertEquals(expected.getMessage(), "org.apache.zookeeper.KeeperException$MarshallingErrorException: " + "KeeperErrorCode = MarshallingError"); } finally { _zkClient.close(); _zkClient = new ZkClient(ZkTestBase.ZK_ADDR); Assert.assertTrue(TestHelper.verify(() -> { _zkClient.delete(path); return !_zkClient.exists(path); }, TestHelper.WAIT_DURATION)); } }

Target:
public void testGetChildrenOnLargeNumChildren() throws Exception { final String methodName = TestHelper.getTestMethodName(); System.out.println("Start test: " + methodName); String path = "/" + methodName; _zkClient.createPersistent(path); for (int i = 0; i < 110; i++) { List<Op> ops = new ArrayList<>(1000); for (int j = 0; j < 1000; j++) { String childPath = path + "/" + UUID.randomUUID().toString(); ops.add( Op.create(childPath, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL)); } _zkClient.multi(ops); } try { _zkClient.getChildren(path); Assert.fail("Should not successfully get children because of connection loss."); } catch (ZkException expected) { Assert.assertEquals(expected.getMessage(), "org.apache.zookeeper.KeeperException$MarshallingErrorException: " + "KeeperErrorCode = MarshallingError"); } finally { _zkClient.close(); _zkClient = new ZkClient(ZkTestBase.ZK_ADDR); Assert.assertTrue(TestHelper.verify(() -> { try { return _zkClient.delete(path); } catch (ZkException e) { return false; } }, TestHelper.WAIT_DURATION)); } System.out.println("End test: " + methodName); }
Source:
public Set<String> getRepositoryKeys() { checkRunning(); final Lock lock = this.lock.readLock(); try { lock.lock(); return new HashSet<String>(repositories.keySet()); } finally { lock.unlock(); } }

Target:
protected Set<String> getRepositoryKeys() { checkRunning(); final Lock lock = this.lock.readLock(); try { lock.lock(); return new HashSet<String>(repositories.keySet()); } finally { lock.unlock(); } }
Source:
private int getKeySize() { return _keySize; }

Target:
private Integer getKeySize() { return _keySize; }
Source:
protected void reportSizeLimitExceeded(final SizeLimitExceededException e, Validator validator) { validator.add(new I18nMessage("upload", "file.limit.exceeded", e.getActualSize(), e.getPermittedSize())); logger.warn("The file size limit was exceeded."); }

Target:
protected void reportSizeLimitExceeded(final SizeLimitExceededException e, Validator validator) { validator.add(new I18nMessage("upload", "file.limit.exceeded", e.getActualSize(), e.getPermittedSize())); logger.warn("The file size limit was exceeded. Actual permitted {}", e.getActualSize(), e.getPermittedSize()); }
Source:
protected Object getFailurePayload(P payload, Optional<BackupRestoreContext> flowContext, Exception ex) { return null; }

Target:
protected Object getFailurePayload(P payload, Optional<BackupRestoreContext> flowContext, Exception ex) { return new StackFailureEvent(payload.getResourceId(), ex); }
Source:
public boolean hasRequiredProperties(MessageAddressingProperties map) { if (map.getAction() == null) { return false; } if ((map.getReplyTo() != null && !hasAnonymousAddress(map.getReplyTo()) && !hasNoneAddress(map.getReplyTo())) || (map.getFaultTo() != null && !hasAnonymousAddress(map.getFaultTo()) && !hasNoneAddress(map.getFaultTo()))){ return map.getMessageId() != null; } return true; }

Target:
public boolean hasRequiredProperties(MessageAddressingProperties map) { if (map.getAction() == null) { return false; } if (map.getReplyTo() != null || map.getFaultTo() != null) { return map.getMessageId() != null; } return true; }
Source:
public void testUDPconnection() throws Exception { Subject<Object,Object> sub = PublishSubject.create(); SimpleChan smpladapter = new SimpleChan(sub); TestAwaitableObserver<Object> monitor = new TestAwaitableObserver<>(); sub.subscribe(monitor); int port = rand.nextInt(100) + 8000; ServerFrontEnd udpSrv = new ServerFrontEnd(smpladapter, port, true); udpSrv.startAsync().awaitRunning(); DatagramPacket msg = sendMSG(MSG, port); monitor.awaitOnNext(1, TIMEOUT); Assert.assertNotNull(monitor.getOnNextEvents().get(0)); }

Target:
public void testUDPconnection() throws Exception { Subject<Object,Object> sub = PublishSubject.create(); SimpleChan simpleadapter = new SimpleChan(sub); TestAwaitableObserver<Object> monitor = new TestAwaitableObserver<>(); sub.subscribe(monitor); int port = rand.nextInt(100) + 8000; ServerFrontEnd udpSrv = ServerFrontEnd.udp(simpleadapter, port); udpSrv.startAsync().awaitRunning(); sendMSG(MSG, port); monitor.awaitOnNext(1, TIMEOUT); Assert.assertNotNull(monitor.getOnNextEvents().get(0)); }
Source:
private static TLSClientParameters constructTLSClient(TLSClientParameters tlsClientParameters) { boolean isDisableCNCheck = false; try { isDisableCNCheck = PropertyAccessor.getInstance().getPropertyBoolean(GATEWAY_PROPERTY_FILE, DISABLE_CN_CHECK); } catch (PropertyAccessException ex) { LOG.error("Not able to read 'disableCNCheck' from the property file: {}", ex.getLocalizedMessage(), ex); } try { SSLSocketFactory factory = SSLUtils.getSSLContext(tlsClientParameters).getSocketFactory(); if (factory != null) { tlsClientParameters.setSSLSocketFactory(factory); } else { throw new SecurityException("Couldn't get the SSLSocketFactory."); } tlsClientParameters.setDisableCNCheck(isDisableCNCheck); LOG.info("tlsClientParameters--disableCNCheck-is-set: '{}'", isDisableCNCheck); } catch (GeneralSecurityException | IllegalStateException e) { LOG.error("Could not get TLS client parameters: ", e.getLocalizedMessage(), e); throw new SecurityException("Could not create SSL Context.", e); } return tlsClientParameters; }

Target:
private static TLSClientParameters constructTLSClient(TLSClientParameters tlsClientParameters) { boolean isDisableCNCheck = false; try { isDisableCNCheck = PropertyAccessor.getInstance().getPropertyBoolean(GATEWAY_PROPERTY_FILE, DISABLE_CN_CHECK); } catch (PropertyAccessException ex) { LOG.error("Not able to read 'disableCNCheck' from the property file: {}", ex.getLocalizedMessage(), ex); } try { SSLSocketFactory factory = SSLUtils.getSSLContext(tlsClientParameters).getSocketFactory(); if (factory != null) { tlsClientParameters.setSSLSocketFactory(factory); } else { throw new SecurityException("Couldn't get the SSLSocketFactory."); } tlsClientParameters.setDisableCNCheck(isDisableCNCheck); LOG.info("tlsClientParameters--disableCNCheck-is-set: {}", isDisableCNCheck); } catch (GeneralSecurityException | IllegalStateException e) { LOG.error("Could not get TLS client parameters: ", e.getLocalizedMessage(), e); throw new SecurityException("Could not create SSL Context.", e); } return tlsClientParameters; }
Source:
protected void internalReceiveUpdate(String itemName, State newState) { try { String property = getProperty(itemName); String xbmcInstance = getXbmcInstance(itemName); XbmcConnector connector = getXbmcConnector(xbmcInstance); if (connector == null) { logger.warn("Received update ({}) for item but no XBMC connector found for {}, ignoring", newState.toString(), itemName, xbmcInstance); return; } if (!connector.isConnected()) { logger.warn("Received update ({}) for item but the connection to the XBMC instance is down, ignoring", newState.toString(), itemName, xbmcInstance); return; } if (property.equals("GUI.ShowNotification")) connector.showNotification("openHAB", newState.toString()); if (property.equals("Player.Open")) connector.playerOpen(newState.toString()); if (property.equals("Application.SetVolume")) connector.applicationSetVolume(newState.toString()); } catch (Exception e) { logger.error("Error handling update", e); } }

Target:
protected void internalReceiveUpdate(String itemName, State newState) { try { String property = getProperty(itemName); String xbmcInstance = getXbmcInstance(itemName); XbmcConnector connector = getXbmcConnector(xbmcInstance); if (connector == null) { logger.warn("Received update ({}) for item but no XBMC connector found for {}, ignoring", newState.toString(), itemName, xbmcInstance); return; } if (!connector.isConnected()) { logger.warn("Received update ({}) for item but the connection to the XBMC instance is down, ignoring", newState.toString(), itemName, xbmcInstance); return; } if (property.equals("GUI.ShowNotification")) { connector.showNotification("openHAB", newState.toString()); } else if (property.equals("Player.Open")) { connector.playerOpen(newState.toString()); } else if (property.equals("Application.SetVolume")) { connector.applicationSetVolume(newState.toString()); } } catch (Exception e) { logger.error("Error handling update", e); } }
Source:
public void updateCustom(SolApplication solApplication, SolInputManager.InputPointer[] inputPointers, boolean clickedOutside) { if (clickedOutside) { closeControl.maybeFlashPressed(solApplication.getOptions().getKeyClose()); return; } SolGame game = solApplication.getGame(); Hero hero = game.getHero(); SolInputManager inputManager = solApplication.getInputManager(); if (closeControl.isJustOff() || isTargetFar(hero)) { inputManager.setScreen(solApplication, game.getScreens().mainScreen); return; } boolean station = target.getHull().config.getType() == HullConfig.Type.STATION; shipsControl.setEnabled(station); hireControl.setEnabled(station); InventoryScreen inventoryScreen = game.getScreens().inventoryScreen; boolean sell = sellControl.isJustOff(); boolean buy = buyControl.isJustOff(); boolean sellShips = shipsControl.isJustOff(); boolean hire = hireControl.isJustOff(); if (sell || buy || sellShips || hire) { inventoryScreen.setOperations(sell ? inventoryScreen.sellItems : buy ? inventoryScreen.buyItems : sellShips ? inventoryScreen.changeShip : inventoryScreen.hireShips); inputManager.setScreen(solApplication, game.getScreens().mainScreen); inputManager.addScreen(solApplication, inventoryScreen); } }

Target:
public void updateCustom(SolApplication solApplication, SolInputManager.InputPointer[] inputPointers, boolean clickedOutside) { if (clickedOutside) { closeControl.maybeFlashPressed(solApplication.getOptions().getKeyClose()); return; } SolGame game = solApplication.getGame(); Hero hero = game.getHero(); SolInputManager inputManager = solApplication.getInputManager(); if (closeControl.isJustOff() || isTargetFar(hero)) { inputManager.setScreen(solApplication, game.getScreens().mainScreen); return; } boolean station = target.getHull().config.getType() == HullConfig.Type.STATION; shipsControl.setEnabled(station); hireControl.setEnabled(station); InventoryScreen inventoryScreen = game.getScreens().inventoryScreen; boolean sell = sellControl.isJustOff(); boolean buy = buyControl.isJustOff(); boolean sellShips = shipsControl.isJustOff(); boolean hire = hireControl.isJustOff(); if (sell || buy || sellShips || hire) { if (sell) { inventoryScreen.setOperations(inventoryScreen.sellItems); } else if (buy) { inventoryScreen.setOperations(inventoryScreen.buyItems); } else if (sellShips) { inventoryScreen.setOperations(inventoryScreen.changeShip); } else { inventoryScreen.setOperations(inventoryScreen.hireShips); } inputManager.setScreen(solApplication, game.getScreens().mainScreen); inputManager.addScreen(solApplication, inventoryScreen); } }
Source:
private void invokeBlockingCallToLifeCycleEvent(final String lifeCycleEventName) { final CordovaPluginTest me = this; final Activity activity = this.testActivity; Runnable blockingRunnable = new Runnable() { public void run() { try { Method method = me.getInstrumentation().getClass().getMethod(lifeCycleEventName, Activity.class); method.invoke(me.getInstrumentation(), activity); } catch (Exception e) { fail("An Exception occurred in invokeBlockingCallToLifeCycleEvent while invoking " + lifeCycleEventName); } me.getInstrumentation().callActivityOnStart(testActivity); synchronized(this) { this.notify(); } } }; synchronized( blockingRunnable ) { testActivity.runOnUiThread(blockingRunnable); try { blockingRunnable.wait(); } catch (InterruptedException e) { fail("An InterruptedException occurred in invokeBlockingCallToLifeCycleEvent while waiting for " + lifeCycleEventName); } } }

Target:
private void invokeBlockingCallToLifeCycleEvent(final String lifeCycleEventName) { final Activity activity = getActivity(); activity.runOnUiThread( new Runnable() { public void run() { try { Method method = getInstrumentation().getClass().getMethod(lifeCycleEventName, Activity.class); method.invoke(getInstrumentation(), activity); } catch (Exception e) { fail("An Exception occurred in invokeBlockingCallToLifeCycleEvent while invoking " + lifeCycleEventName); } } }); getInstrumentation().waitForIdleSync(); }
Source:
public static Slice parse(String query) { Iterable<String> tokens = Splitter.on(CharMatcher.anyOf(":-")).omitEmptyStrings().trimResults().split(query); Iterator<String> it = tokens.iterator(); int count = Iterators.size(tokens.iterator()); Slice result = null; try { switch (count) { case 1: result = new Slice(it.next()); break; case 2: result = new Slice(it.next(), Integer.parseInt(it.next().replace(",", ""))); break; case 3: result = new Slice(it.next(), Integer.parseInt(it.next().replace(",", "")), Integer.parseInt(it.next().replace(",", ""))); break; default: throw new IllegalArgumentException(String.format("Unrecognizable region %s", query)); } } catch (NumberFormatException nfe) { throw new IllegalArgumentException(String.format("Invalid region specified %s", query), nfe); } return result; }

Target:
public static Slice parse(String query) { Iterable<String> tokens = queryScrubber.split(query); Iterator<String> it = tokens.iterator(); int count = Iterators.size(tokens.iterator()); Slice result = null; try { switch (count) { case 1: result = new Slice(it.next()); break; case 2: result = new Slice(it.next(), parseIntArgument(it.next())); break; case 3: result = new Slice(it.next(), parseIntArgument(it.next()), parseIntArgument(it.next())); break; default: throw new IllegalArgumentException(String.format("Unrecognizable region %s", query)); } } catch (NumberFormatException nfe) { throw new IllegalArgumentException(String.format("Invalid region specified %s", query), nfe); } return result; }
Source:
private static void runPartialSyncRegistrationCallback(@Nullable String error, long nativeResultsPtr, PartialSyncCallback callback) { if (error != null) { callback.onError(new RealmException(error)); } else { @SuppressWarnings("ConstantConditions") Table table = callback.sharedRealm.getTable(Table.getTableNameForClass(callback.className)); Collection results = new Collection(callback.sharedRealm, table, nativeResultsPtr, true); callback.onSuccess(results); } }

Target:
private void runPartialSyncRegistrationCallback(@Nullable String error, long nativeResultsPtr, PartialSyncCallback callback) { if (error != null) { callback.onError(new RealmException(error)); } else { @SuppressWarnings("ConstantConditions") Table table = getTable(Table.getTableNameForClass(callback.className)); Collection results = new Collection(this, table, nativeResultsPtr, true); callback.onSuccess(results); } }
Source:
public final void putObject(String address, Object object) throws IOException { String json = jsonService.serialize(object); HttpPut put = buildRequest(address, HttpPut::new); try { put.setEntity(new StringEntity(json)); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } put.addHeader(HttpHeaders.CONTENT_TYPE, "application/json"); try (CloseableHttpResponse ignored = cachedRemoteReader.getResponse(put)) { } }

Target:
public final void putObject(String address, Object object) throws IOException { uploadObject(address, object, HttpPut::new); }
Source:
public void registerClient(ScoreBoardClockClient client) { clients.add(client); }

Target:
public synchronized void registerClient(ScoreBoardClockClient client) { clients.add(client); }
Source:
public boolean chkCollabWorkspaceAccess(String userName,String workspaceId,String collaboratorRole) throws QuadrigaStorageException { List<IWorkspaceCollaborator> workspaceCollaboratorList = null; List<IQuadrigaRole> collaboratorRoles = null; boolean chkAccess; chkAccess = false; workspaceCollaboratorList = wsCollabManager.getWorkspaceCollaborators(workspaceId); if(workspaceCollaboratorList != null){ for(IWorkspaceCollaborator workspaceCollaborator : workspaceCollaboratorList) { if(workspaceCollaborator.getCollaborator() != null){ if(workspaceCollaborator.getCollaborator().getUserObj().getUserName().equals(userName)) { collaboratorRoles = workspaceCollaborator.getCollaborator().getCollaboratorRoles(); if(collaboratorRoles != null){ for(IQuadrigaRole role : collaboratorRoles) { if(role.getId().equals(collaboratorRole)) { chkAccess = true; break; } } } break; } } } } return chkAccess; }

Target:
public boolean chkCollabWorkspaceAccess(String userName, String workspaceId, String collaboratorRole) throws QuadrigaStorageException { boolean chkAccess = false; List<IWorkspaceCollaborator> workspaceCollaboratorList = wsCollabManager.getWorkspaceCollaborators(workspaceId); if (workspaceCollaboratorList != null) { for (IWorkspaceCollaborator workspaceCollaborator : workspaceCollaboratorList) { if (workspaceCollaborator.getCollaborator() != null) { if (workspaceCollaborator.getCollaborator().getUserObj().getUserName().equals(userName)) { List<IQuadrigaRole> collaboratorRoles = workspaceCollaborator.getCollaborator().getCollaboratorRoles(); if (collaboratorRoles != null) { for (IQuadrigaRole role : collaboratorRoles) { if (role.getId().equals(collaboratorRole)) { chkAccess = true; break; } } } break; } } } } return chkAccess; }
Source:
protected void before() throws UnknownHostException, IOException{ MongodStarter runtime = MongodStarter.getDefaultInstance(); IMongodConfig config = new MongodConfigBuilder(). version(immsAnnotation.version()). net(new Net(immsAnnotation.port(), Network.localhostIsIPv6())). build(); mongodExe = runtime.prepare(config); try{ mongod = mongodExe.start(); } catch(IOException e){ System.err.println("Mongo failed to start for the previously stated reason. A single retry will be attempted."); mongod = mongodExe.start(); } }

Target:
protected void before() throws UnknownHostException, IOException{ MongodStarter runtime = MongodStarter.getDefaultInstance(); IMongodConfig config = new MongodConfigBuilder(). version(immsAnnotation.version()). net(new Net(immsAnnotation.port(), Network.localhostIsIPv6())). build(); mongodExe = runtime.prepare(config); try{ mongod = mongodExe.start(); } catch(IOException e){ mongod = mongodExe.start(); } }
Source:
public <T> Action getAction(T subjectMap) { if (!canHandle(subjectMap)) { return null; } String logoutUrlString = ""; URL logoutUrl = null; try { @SuppressWarnings("unchecked") Object subject = ((Map) subjectMap).get(SecurityConstants.SECURITY_SUBJECT); String nameId = SubjectUtils.getName((Subject) subject, "You", true); String nameIdTimestamp = nameId + "\n" + System.currentTimeMillis(); nameIdTimestamp = URLEncoder.encode( encryptionService.encrypt(nameIdTimestamp), StandardCharsets.UTF_8.name()); logoutUrlString = SystemBaseUrl.EXTERNAL.constructUrl( "/saml/logout/request?EncryptedNameIdTime=" + nameIdTimestamp, true); logoutUrl = new URL(logoutUrlString); } catch (MalformedURLException e) { LOGGER.info("Unable to resolve URL: {}", LogSanitizer.cleanAndEncode(logoutUrlString)); } catch (ClassCastException e) { LOGGER.debug( "Unable to cast parameter to Map<String, Object>, {}", LogSanitizer.cleanAndEncode(subjectMap), e); } catch (UnsupportedEncodingException e) { LOGGER.debug( "Unable to encode the encrypted timestamp.", LogSanitizer.cleanAndEncode(subjectMap), e); } return new ActionImpl(ID, TITLE, DESCRIPTION, logoutUrl); }

Target:
public <T> Action getAction(T subjectMap) { if (!canHandle(subjectMap)) { return null; } String logoutUrlString = ""; URL logoutUrl = null; try { @SuppressWarnings("unchecked") Object subject = ((Map) subjectMap).get(SecurityConstants.SECURITY_SUBJECT); String nameId = SubjectUtils.getName((Subject) subject, "You", true); String nameIdTimestamp = nameId + "\n" + System.currentTimeMillis(); nameIdTimestamp = URLEncoder.encode( encryptionService.encrypt(nameIdTimestamp), StandardCharsets.UTF_8.name()); logoutUrlString = SystemBaseUrl.EXTERNAL.constructUrl( "/saml/logout/request?EncryptedNameIdTime=" + nameIdTimestamp, true); logoutUrl = new URL(logoutUrlString); } catch (MalformedURLException e) { LOGGER.info("Unable to resolve URL: {}", LogSanitizer.sanitize(logoutUrlString)); } catch (ClassCastException e) { LOGGER.debug( "Unable to cast parameter to Map<String, Object>, {}", LogSanitizer.sanitize(subjectMap), e); } catch (UnsupportedEncodingException e) { LOGGER.debug("Unable to encode the encrypted timestamp.", e); } return new ActionImpl(ID, TITLE, DESCRIPTION, logoutUrl); }
Source:
public void controller(FragmentConfiguration config, @SpringBean("emrApiProperties") EmrApiProperties emrApiProperties, @SpringBean("baseIdentifierSourceService") IdentifierSourceService identifierSourceService, @FragmentParam("patient") Object patient, @InjectBeans PatientDomainWrapper wrapper, @SpringBean("adtService") AdtService adtService, UiSessionContext sessionContext) { if (patient instanceof Patient) { wrapper.setPatient((Patient) patient); config.addAttribute("patient", wrapper); } VisitDomainWrapper activeVisit = (VisitDomainWrapper) config.getAttribute("activeVisit"); if (activeVisit == null) { Location sessionLocation = sessionContext.getSessionLocation(); if (sessionLocation == null) sessionLocation = LocationUtility.getDefaultLocation(); Location visitLocation = sessionLocation; activeVisit = adtService.getActiveVisit((Patient) patient, visitLocation); } if (activeVisit != null) config.addAttribute("activeVisit", activeVisit); List<ExtraPatientIdentifierType> extraPatientIdentifierTypes = new ArrayList<ExtraPatientIdentifierType>(); for (PatientIdentifierType type : emrApiProperties.getExtraPatientIdentifierTypes()) { AutoGenerationOption option = identifierSourceService.getAutoGenerationOption(type); extraPatientIdentifierTypes.add(new ExtraPatientIdentifierType(type, option != null ? option .isManualEntryEnabled() : true)); } config.addAttribute("extraPatientIdentifierTypes", extraPatientIdentifierTypes); }

Target:
public void controller(FragmentConfiguration config, @SpringBean("emrApiProperties") EmrApiProperties emrApiProperties, @SpringBean("baseIdentifierSourceService") IdentifierSourceService identifierSourceService, @FragmentParam("patient") Object patient, @InjectBeans PatientDomainWrapper wrapper, @SpringBean("adtService") AdtService adtService, UiSessionContext sessionContext) { if (patient instanceof Patient) { wrapper.setPatient((Patient) patient); config.addAttribute("patient", wrapper); } VisitDomainWrapper activeVisit = (VisitDomainWrapper) config.getAttribute("activeVisit"); if (activeVisit == null) { Location visitLocation = adtService.getLocationThatSupportsVisits(sessionContext.getSessionLocation()); activeVisit = adtService.getActiveVisit((Patient) patient, visitLocation); } if (activeVisit != null) config.addAttribute("activeVisit", activeVisit); List<ExtraPatientIdentifierType> extraPatientIdentifierTypes = new ArrayList<ExtraPatientIdentifierType>(); for (PatientIdentifierType type : emrApiProperties.getExtraPatientIdentifierTypes()) { AutoGenerationOption option = identifierSourceService.getAutoGenerationOption(type); extraPatientIdentifierTypes.add(new ExtraPatientIdentifierType(type, option != null ? option .isManualEntryEnabled() : true)); } config.addAttribute("extraPatientIdentifierTypes", extraPatientIdentifierTypes); }
Source:
void mustBeOpen() { if (c4db == null) throw new CouchbaseLiteRuntimeException("Database is not open."); }

Target:
void mustBeOpen() { if (c4db == null) throw new IllegalStateException("Database is not open."); }
Source:
Object call(final String command, final List<String> args) throws IOException { final List<String> argsList = new ArrayList<String>(); argsList.add(command); argsList.add(ClientHelper.getCurrentSeconds()); for (final String arg : args) { argsList.add(arg); } final List<String> keysList = new ArrayList<String>(); if (Client.LOGGER.isDebugEnabled()) { Client.LOGGER.debug("{}", argsList); } return this.luaScript.call(keysList, argsList); }

Target:
Object call(final String command, final List<String> args) throws IOException { final List<String> argsList = new ArrayList<String>(); argsList.add(command); argsList.add(ClientHelper.getCurrentSeconds()); for (final String arg : args) { argsList.add(arg); } Client.LOGGER.debug("{}", argsList); return this.luaScript.call(Client.KEYS_LIST, argsList); }
Source:
public void verifyElementsOnPage() { verifyH1(); PageObjectLogging.log("verifyElements", "verify that H1 is present", true); verifyAddVideoButton(); PageObjectLogging.log("verifyElements", "verify that Add Video button is present", true); verifySortDropdown(); PageObjectLogging.log("verifyElements", "verify that sort dropdown is present", true); verifyNewestVideo(); PageObjectLogging.log("verifyElements", "verify that there is at least one video present", true); }

Target:
public void verifyElementsOnPage() { verifyH1(); PageObjectLogging.log("verifyElementsOnPage", "verify that H1 is present", true); verifyAddVideoButton(); PageObjectLogging.log("verifyElementsOnPage", "verify that Add Video button is present", true); verifySortDropdown(); PageObjectLogging.log("verifyElementsOnPage", "verify that sort dropdown is present", true); verifyNewestVideo(); PageObjectLogging.log("verifyElementsOnPage", "verify that there is at least one video present", true); }
Source:
public void testRollbackExceptionStrategyNumberOfRetries() throws Exception { System.setProperty("RollBackExceptionStrategy", "true"); final CountDownLatch latch = new CountDownLatch(8); LocalMuleClient client = muleContext.getClient(); muleContext.registerListener(new ExceptionNotificationListener<ExceptionNotification>() { @Override public void onNotification(ExceptionNotification notification) { latch.countDown(); } }); client.dispatch("vm://in8", "test", null); client.dispatch("vm://in8", "test", null); if (!latch.await(RECEIVE_TIMEOUT, TimeUnit.MILLISECONDS)) { fail("message should have been delivered at least 5 times"); } MuleMessage response = client.request("vm://dlqCounter", 20000); assertThat(response, IsNull.notNullValue()); AtomicInteger counter = muleContext.getRegistry().lookupObject("counter"); assertThat(counter.get(), Is.is(8)); }

Target:
public void testRollbackExceptionStrategyNumberOfRetries() throws Exception { System.setProperty(MULE_FORCE_REDELIVERY, "true"); final CountDownLatch latch = new CountDownLatch(8); LocalMuleClient client = muleContext.getClient(); muleContext.registerListener(new ExceptionNotificationListener<ExceptionNotification>() { @Override public void onNotification(ExceptionNotification notification) { latch.countDown(); } }); client.dispatch("vm://in8", "test", null); client.dispatch("vm://in8", "test", null); if (!latch.await(RECEIVE_TIMEOUT, TimeUnit.MILLISECONDS)) { fail("message should have been delivered at least 5 times"); } MuleMessage response = client.request("vm://dlqCounter", 20000); assertThat(response, IsNull.notNullValue()); AtomicInteger counter = muleContext.getRegistry().lookupObject("counter"); assertThat(counter.get(), Is.is(8)); }
Source:
private void reportTest(Report report, Report.Test test) { FileWriter fileWriter = null; try { fileWriter = prepareOutputFile(report, test.name, ""); int it = 0; Set<String> columns = new TreeSet<String>(); ArrayList<Map<String, String>> rows = new ArrayList<Map<String, String>>(); for (Report.TestIteration iteration : test.getIterations()) { Statistics aggregated = null; for (Map.Entry<Integer, List<Statistics>> slaveStats : iteration.getStatistics()) { if (ignore != null && ignore.contains(slaveStats.getKey())) { continue; } if (slaveStats.getValue().size() <= 0) { continue; } Statistics nodeSummary = processRow(it, columns, rows, slaveStats); if (computeTotal) { if (aggregated == null) aggregated = nodeSummary.copy(); else aggregated.merge(nodeSummary); } } if (computeTotal && aggregated != null) { Map<String, String> rowData = new HashMap<String, String>(); rows.add(rowData); for (String operation : aggregated.getOperations()) { addRepresentations(aggregated, rowData, aggregated, operation); } columns.addAll(rowData.keySet()); rowData.put(SLAVE_INDEX, "TOTAL"); rowData.put(ITERATION, String.valueOf(it)); rowData.put(PERIOD, String.valueOf(aggregated.getEnd() - aggregated.getBegin())); rowData.put(THREAD_COUNT, String.valueOf(iteration.getThreadCount())); } ++it; } writeFile(fileWriter, columns, rows); } catch (IOException e) { log.error("Failed to create report for test " + test.name, e); } finally { if (fileWriter != null) { try { fileWriter.close(); } catch (IOException e) { log.error("Failed to close", e); } } } }

Target:
private void reportTest(Report report, Report.Test test) { FileWriter fileWriter = null; try { fileWriter = prepareOutputFile(report, test.name, ""); int it = 0; Set<String> columns = new TreeSet<String>(); ArrayList<Map<String, String>> rows = new ArrayList<>(); for (Report.TestIteration iteration : test.getIterations()) { Statistics aggregated = null; for (Map.Entry<Integer, List<Statistics>> slaveStats : iteration.getStatistics()) { if (ignore != null && ignore.contains(slaveStats.getKey())) { continue; } if (slaveStats.getValue().size() <= 0) { continue; } Statistics nodeSummary = processRow(it, columns, rows, slaveStats); if (computeTotal) { if (aggregated == null) aggregated = nodeSummary.copy(); else aggregated.merge(nodeSummary); } } if (computeTotal && aggregated != null) { Map<String, String> rowData = new HashMap<String, String>(); rows.add(rowData); for (String operation : aggregated.getOperations()) { addRepresentations(aggregated, rowData, aggregated, operation); } columns.addAll(rowData.keySet()); rowData.put(SLAVE_INDEX, "TOTAL"); rowData.put(ITERATION, String.valueOf(it)); rowData.put(PERIOD, String.valueOf(aggregated.getEnd() - aggregated.getBegin())); rowData.put(THREAD_COUNT, String.valueOf(iteration.getThreadCount())); } ++it; } writeFile(fileWriter, columns, rows); } catch (IOException e) { log.error("Failed to create report for test " + test.name, e); } finally { if (fileWriter != null) { try { fileWriter.close(); } catch (IOException e) { log.error("Failed to close", e); } } } }
Source:
public InstructorFeedbacksPage clickDoneEditingLink() { WebElement doneEditingLink = browser.driver.findElement(By.id("button_done_editing")); doneEditingLink.click(); waitForPageToLoad(); return changePageType(InstructorFeedbacksPage.class); }

Target:
public InstructorFeedbacksPage clickDoneEditingLink() { doneEditingButton.click(); waitForPageToLoad(); return changePageType(InstructorFeedbacksPage.class); }
Source:
public void testHelloWorld() throws Exception { try (CloseableHttpClient httpclient = HttpClients.createDefault()) { String Url = url.toExternalForm(); HttpGet httpget = new HttpGet(Url); httpclient.execute(httpget); HttpResponse response = httpclient.execute(httpget); Assert.assertEquals("Operation failed", HttpStatus.SC_OK, response.getStatusLine().getStatusCode()); HttpEntity entity = response.getEntity(); String result = EntityUtils.toString(entity); Assert.assertThat("Hello World is in place", result, CoreMatchers.containsString("Hello World!")); } }

Target:
public void testHelloWorld() throws Exception { try (CloseableHttpClient httpclient = HttpClients.createDefault()) { String Url = url.toExternalForm(); HttpGet httpget = new HttpGet(Url); HttpResponse response = httpclient.execute(httpget); Assert.assertEquals("JSF deployment failed due to UnsupportedOperationException when javax.faces.FACELETS_VIEW_MAPPINGS valued wrong", HttpStatus.SC_OK, response.getStatusLine().getStatusCode()); HttpEntity entity = response.getEntity(); String result = EntityUtils.toString(entity); Assert.assertThat("Hello World is in place", result, CoreMatchers.containsString("Hello World!")); } }
Source:
private void updateDynamicWarning() { if (getIsPlugged().getEntity().equals(Boolean.TRUE)) { List<EntityModel<DiskModel>> selectedDisks = getSelectedDisks(); if (selectedDisks != null && isIDEDiskSelected(selectedDisks)) { getDynamicWarning().setEntity(CONSTANTS.ideDisksWillBeAttachedButNotActivated()); getDynamicWarning().setIsAvailable(true); } else { getDynamicWarning().setIsAvailable(false); } } else { getDynamicWarning().setIsAvailable(false); } }

Target:
private void updateDynamicWarning() { getDynamicWarning().setIsAvailable(false); if (getIsPlugged().getEntity().equals(Boolean.TRUE)) { List<EntityModel<DiskModel>> selectedDisks = getSelectedDisks(); if (selectedDisks != null && isSelectedDiskInterfaceIDE(selectedDisks)) { getDynamicWarning().setEntity(CONSTANTS.ideDisksWillBeAttachedButNotActivated()); getDynamicWarning().setIsAvailable(true); } } }