auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean onOptionsItemSelected( final MenuItem item ) { final MainActivity main = MainActivity.getMainActivity(); NavigationView navigationView = (NavigationView) getActivity().findViewById(R.id.left_drawer); switch ( item.getItemId() ) { case MENU_USER_STATS: MenuItem userStatsMenuItem = navigationView.getMenu().findItem(R.id.nav_user_stats); navigationView.getMenu().setGroupVisible(R.id.stats_group, true); userStatsMenuItem.setCheckable(true); userStatsMenuItem.setChecked(true); if (main != null) main.selectFragment(R.id.nav_user_stats); return true; case MENU_SITE_STATS: MenuItem siteStatsMenuItem = navigationView.getMenu().findItem(R.id.nav_site_stats); navigationView.getMenu().setGroupVisible(R.id.stats_group, true); siteStatsMenuItem.setCheckable(true); siteStatsMenuItem.setChecked(true); if (main != null) main.selectFragment(R.id.nav_site_stats); return true; case MENU_RANK_SWAP: monthRanking.set(!monthRanking.get()); item.setTitle(getRankSwapString()); downloadRanks(false); return true; case MENU_USER_CENTRIC_SWAP: userCentric.set(!userCentric.get()); item.setTitle(getUserCentricSwapString()); downloadRanks(false); return true; } return false; }

Target:
public boolean onOptionsItemSelected( final MenuItem item ) { final MainActivity main = MainActivity.getMainActivity(); NavigationView navigationView = (NavigationView) getActivity().findViewById(R.id.left_drawer); switch ( item.getItemId() ) { case MENU_USER_STATS: MenuUtil.selectStatsSubmenuItem(navigationView, main, R.id.nav_user_stats); return true; case MENU_SITE_STATS: MenuUtil.selectStatsSubmenuItem(navigationView, main, R.id.nav_site_stats); return true; case MENU_RANK_SWAP: monthRanking.set(!monthRanking.get()); item.setTitle(getRankSwapString()); downloadRanks(false); return true; case MENU_USER_CENTRIC_SWAP: userCentric.set(!userCentric.get()); item.setTitle(getUserCentricSwapString()); downloadRanks(false); return true; } return false; }
Source:
private Tree getLastReassignment(int line, Symbol referenceSymbol) { Tree result = null; for (Tree reassignement : reassignmentBySymbol.get(referenceSymbol)) { int reassignementLine = FirstSyntaxTokenFinder.firstSyntaxToken(reassignement).line(); if (line > reassignementLine) { result = reassignement; } } return result; }

Target:
private Tree getLastReassignment(int line, Symbol referenceSymbol) { Tree result = null; for (Tree reassignment : reassignmentBySymbol.get(referenceSymbol)) { int reassignmentLine = FirstSyntaxTokenFinder.firstSyntaxToken(reassignment).line(); if (line > reassignmentLine) { result = reassignment; } } return result; }
Source:
protected void delete(Context context, UUID id) throws AuthorizeException { Community community = null; try { community = cs.find(context, id); if (community == null) { throw new ResourceNotFoundException( CommunityRest.CATEGORY + "." + CommunityRest.NAME + " with id: " + id + " not found"); } } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } try { cs.delete(context, community); } catch (SQLException | IOException e) { throw new RuntimeException(e.getMessage(), e); } }

Target:
protected void delete(Context context, UUID id) throws AuthorizeException { Community community = null; try { community = cs.find(context, id); if (community == null) { throw new ResourceNotFoundException( CommunityRest.CATEGORY + "." + CommunityRest.NAME + " with id: " + id + " not found"); } } catch (SQLException e) { throw new RuntimeException("Unable to find Community with id = " + id, e); } try { cs.delete(context, community); } catch (SQLException e) { throw new RuntimeException("Unable to delete Community with id = " + id, e); } catch (IOException e) { throw new RuntimeException("Unable to delete community because the logo couldn't be deleted", e); } }
Source:
protected void onHandleIntent(Intent intent) { Bundle extras = intent.getExtras(); GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this); String messageType = gcm.getMessageType(intent); Log.e(LIGER.TAG, "LigerGcmIntentService onHandleIntent"); if (!extras.isEmpty()) { if (GoogleCloudMessaging. MESSAGE_TYPE_SEND_ERROR.equals(messageType)) { sendNotification("Send error: " + extras.toString(), intent); } else if (GoogleCloudMessaging. MESSAGE_TYPE_DELETED.equals(messageType)) { sendNotification("Deleted messages on server: " + extras.toString(), intent); } else if (GoogleCloudMessaging. MESSAGE_TYPE_MESSAGE.equals(messageType)) { for (int i = 0; i < 5; i++) { Log.e(LIGER.TAG, "Working... " + (i + 1) + "/5 @ " + SystemClock.elapsedRealtime()); try { Thread.sleep(5000); } catch (InterruptedException e) { } } Log.e(LIGER.TAG, "Completed work @ " + SystemClock.elapsedRealtime()); sendNotification("Received: " + extras.toString(), intent); Log.e(LIGER.TAG, "Received: " + extras.toString()); }else if ("send_event".equals(messageType)) { for (int i = 0; i < 5; i++) { Log.e(LIGER.TAG, "Working... " + (i + 1) + "/5 @ " + SystemClock.elapsedRealtime()); try { Thread.sleep(5000); } catch (InterruptedException e) { } } Log.e(LIGER.TAG, "Completed work @ " + SystemClock.elapsedRealtime()); sendNotification("Received: " + extras.toString(), intent); Log.e(LIGER.TAG, "Received: " + extras.toString()); } } LigerGcmBroadcastReceiver.completeWakefulIntent(intent); }

Target:
protected void onHandleIntent(Intent intent) { Bundle extras = intent.getExtras(); GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this); String messageType = gcm.getMessageType(intent); if (LIGER.LOGGING) { Log.d(LIGER.TAG, "LigerGcmIntentService onHandleIntent"); } if (!extras.isEmpty()) { if (GoogleCloudMessaging. MESSAGE_TYPE_SEND_ERROR.equals(messageType)) { sendNotification("Send error: " + extras.toString(), intent); } else if (GoogleCloudMessaging. MESSAGE_TYPE_DELETED.equals(messageType)) { sendNotification("Deleted messages on server: " + extras.toString(), intent); } else if (GoogleCloudMessaging. MESSAGE_TYPE_MESSAGE.equals(messageType)) { for (int i = 0; i < 5; i++) { Log.d(LIGER.TAG, "Working... " + (i + 1) + "/5 @ " + SystemClock.elapsedRealtime()); try { Thread.sleep(5000); } catch (InterruptedException e) { } } Log.d(LIGER.TAG, "Completed work @ " + SystemClock.elapsedRealtime()); sendNotification("Received: " + extras.toString(), intent); Log.d(LIGER.TAG, "Received: " + extras.toString()); } } LigerGcmBroadcastReceiver.completeWakefulIntent(intent); }
Source:
public void setUp() throws IOException { config = new LocalDataSegmentPusherConfig(); config.storageDirectory = temporaryFolder.newFolder(); localDataSegmentPusher = new LocalDataSegmentPusher(config, new JodaMapper()); dataSegmentFiles = temporaryFolder.newFolder(); Files.asByteSink(new File(dataSegmentFiles, "version.bin")).write(Ints.toByteArray(0x9)); }

Target:
public void setUp() throws IOException { config = new LocalDataSegmentPusherConfig(); config.storageDirectory = temporaryFolder.newFolder(); localDataSegmentPusher = new LocalDataSegmentPusher(config, new DefaultObjectMapper()); dataSegmentFiles = temporaryFolder.newFolder(); Files.asByteSink(new File(dataSegmentFiles, "version.bin")).write(Ints.toByteArray(0x9)); }
Source:
public static boolean isAutoTools(IProject project) { try { if (project.hasNature(AutotoolsNewProjectNature.AUTOTOOLS_NATURE_ID)) { return true; } else { return false; } } catch (CoreException e) { MessageDialog.openError(null, "Getting Project type error", "project not found or is closed."); return false; } }

Target:
public static boolean isAutoTools(IProject project) { try { if (project.hasNature(AutotoolsNewProjectNature.AUTOTOOLS_NATURE_ID)) { return true; } else { return false; } } catch (CoreException e) { MessageDialogSyncedRunnable.openErrorSyncedRunnable(ProfilingMessages.errorTitle, ProfilingMessages.errorGetProjectType); return false; } }
Source:
public static MaskedWalletRequest createMaskedWalletRequest(String merchantName, Checkout checkout, BuyClient buyClient, boolean phoneNumberRequired) { if (checkout == null) { throw new NullPointerException("checkout cannot be null"); } if (buyClient == null) { throw new NullPointerException("buyClient cannot be null"); } if (TextUtils.isEmpty(merchantName)) { throw new IllegalArgumentException("merchantName cannot be empty"); } PaymentMethodTokenizationParameters parameters = PaymentMethodTokenizationParameters.newBuilder() .setPaymentMethodTokenizationType(PaymentMethodTokenizationType.NETWORK_TOKEN) .addParameter("publicKey", buyClient.getAndroidPayPublicKey()) .build(); Cart walletCart = AndroidPayHelper.createWalletCart(checkout); return MaskedWalletRequest.newBuilder() .setMerchantName(merchantName) .setPhoneNumberRequired(phoneNumberRequired) .setShippingAddressRequired(checkout.isRequiresShipping()) .setCurrencyCode(checkout.getCurrency()) .setEstimatedTotalPrice(checkout.getTotalPrice()) .setPaymentMethodTokenizationParameters(parameters) .setCart(walletCart) .setPhoneNumberRequired(phoneNumberRequired) .build(); }

Target:
public static MaskedWalletRequest createMaskedWalletRequest(String merchantName, Checkout checkout, BuyClient buyClient, boolean phoneNumberRequired) { if (checkout == null) { throw new NullPointerException("checkout cannot be null"); } if (buyClient == null) { throw new NullPointerException("buyClient cannot be null"); } if (TextUtils.isEmpty(merchantName)) { throw new IllegalArgumentException("merchantName cannot be empty"); } if (!buyClient.androidPayIsEnabled()) { throw new IllegalArgumentException("buyClient must have Android Pay enabled"); } PaymentMethodTokenizationParameters parameters = PaymentMethodTokenizationParameters.newBuilder() .setPaymentMethodTokenizationType(PaymentMethodTokenizationType.NETWORK_TOKEN) .addParameter("publicKey", buyClient.getAndroidPayPublicKey()) .build(); Cart walletCart = createWalletCart(checkout); return MaskedWalletRequest.newBuilder() .setMerchantName(merchantName) .setPhoneNumberRequired(phoneNumberRequired) .setShippingAddressRequired(checkout.isRequiresShipping()) .setCurrencyCode(checkout.getCurrency()) .setEstimatedTotalPrice(checkout.getTotalPrice()) .setPaymentMethodTokenizationParameters(parameters) .setCart(walletCart) .setPhoneNumberRequired(phoneNumberRequired) .build(); }
Source:
private void discoverFields(Map<String, Object> map, Map<String, Object> document) { for(String field : document.keySet()) { if(!map.containsKey(field)) { Object val = document.get(field); if(!(val instanceof Map) && !(val instanceof List)) { map.put(field, val); } } } }

Target:
private void discoverFields(Map<String, Object> map, Map<String, Object> document) { for (String field : document.keySet()) { if (!map.containsKey(field)) { Object val = document.get(field); if (val == null) { continue; } if (val instanceof Map) { continue; } if (val instanceof List) { if (!isFlatList((List) val)) { continue; } } val = valueConversionFunction(val); map.put(field, val); } } }
Source:
public void addEntities() { while (getEntities().size() < 5) { EnemyFish eFish = factory.randomizedFish(new BoundingBox(null, 60, 60)); add(eFish); } }

Target:
public void addEntities() { while (getEntities().size() < 5) { EnemyFish eFish = getFactory().randomizedFish(new BoundingBox(null, 60, 60)); add(eFish); } }
Source:
private JCheckBox getChkInjectableQueryString() { if (chkInjectableQueryString == null) { chkInjectableQueryString = new JCheckBox(); chkInjectableQueryString.setText(Constant.messages.getString("variant.options.injectable.querystring.label")); chkInjectableQueryString.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { getChkAddQueryParam().setEnabled(e.getStateChange() == ItemEvent.SELECTED); } }); } return chkInjectableQueryString; }

Target:
private JCheckBox getChkInjectableQueryString() { if (chkInjectableQueryString == null) { chkInjectableQueryString = new JCheckBox(); chkInjectableQueryString.setText(Constant.messages.getString("variant.options.injectable.querystring.label")); chkInjectableQueryString.addItemListener(e -> getChkAddQueryParam().setEnabled(e.getStateChange() == ItemEvent.SELECTED)); } return chkInjectableQueryString; }
Source:
private DataSource newDataSource() { DataSource dataSource; try { Class.forName("com.mysql.jdbc.Driver"); if (useResinDataSource()) { InitialContext jndiContext = new InitialContext(); dataSource = (DataSource) jndiContext.lookup("java:comp/env/jdbc/hello_world"); } else try(HikariDataSource ds = new HikariDataSource();) { ds.setJdbcUrl("jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"); ds.setDriverClassName("com.mysql.jdbc.Driver"); ds.setUsername("benchmarkdbuser"); ds.setPassword("benchmarkdbpass"); dataSource = ds; } } catch (Exception x) { throw new RuntimeException("Cannot create the data source", x); } return dataSource; }

Target:
private DataSource newDataSource() { DataSource dataSource; try { Class.forName("com.mysql.jdbc.Driver"); if (useResinDataSource()) { InitialContext jndiContext = new InitialContext(); dataSource = (DataSource) jndiContext.lookup("java:comp/env/jdbc/hello_world"); } else { @SuppressWarnings("resource") HikariDataSource ds = new HikariDataSource(); ds.setJdbcUrl("jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"); ds.setDriverClassName("com.mysql.jdbc.Driver"); ds.setUsername("benchmarkdbuser"); ds.setPassword("benchmarkdbpass"); dataSource = ds; } } catch (Exception x) { throw new RuntimeException("Cannot create the data source", x); } return dataSource; }
Source:
public void testKeeperOrderDependenceTwoDistinctClusters() { final Log log = Log.getInstance(OpticalDuplicateFinderTest.class); final OpticalDuplicateFinder finder = new OpticalDuplicateFinder(OpticalDuplicateFinder.DEFAULT_READ_NAME_REGEX, 100, log); List<PhysicalLocation> locs = Arrays.asList( loc(1, 100, 190), loc(1, 100, 280), loc(1, 300, 500), loc(1, 300, 590), loc(1, 300, 670), loc(1, 300, 760) ); List<PhysicalLocation> locsReordered = Arrays.asList( loc(1, 100, 190), loc(1, 100, 280), loc(1, 300, 500), loc(1, 300, 760), loc(1, 300, 670), loc(1, 300, 590) ); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locs, locs.get(0))),4); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locsReordered, locsReordered.get(0))),4); }

Target:
public void testKeeperOrderDependenceTwoDistinctClusters() { final OpticalDuplicateFinder finder = new OpticalDuplicateFinder(OpticalDuplicateFinder.DEFAULT_READ_NAME_REGEX, 100, null); final List<PhysicalLocation> locs = Arrays.asList( loc(1, 100, 190), loc(1, 100, 280), loc(1, 300, 500), loc(1, 300, 590), loc(1, 300, 670), loc(1, 300, 760) ); final List<PhysicalLocation> locsReordered = Arrays.asList( loc(1, 100, 190), loc(1, 100, 280), loc(1, 300, 500), loc(1, 300, 760), loc(1, 300, 670), loc(1, 300, 590) ); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locs, locs.get(0))), 4); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locsReordered, locsReordered.get(0))), 4); }
Source:
public EObject updateCreatedObject(EObject newObject, String loadedVersion) { return null; }

Target:
public EObject updateCreatedObject(EObject newObject, String loadedVersion) { return newObject; }
Source:
public static void makeBucketWithPeriod_test() throws Exception { if (!mintEnv) { System.out.println("Test: makeBucket(String bucketName, String region)"); } long startTime = System.currentTimeMillis(); String name = getRandomName() + ".withperiod"; try { client.makeBucket(name, "eu-central-1"); client.removeBucket(name); mintLog("makeBucket(String bucketName, String region)", "name: " + name + ", region: eu-central-1", System.currentTimeMillis() - startTime, PASS, null, null, null); } catch (Exception e) { mintLog("makeBucket(String bucketName, String region)", "name: " + name + ", region: eu-central-1", System.currentTimeMillis() - startTime, FAILED, null, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }

Target:
public static void makeBucketWithPeriod_test() throws Exception { if (!mintEnv) { System.out.println("Test: makeBucket(String bucketName, String region)"); } long startTime = System.currentTimeMillis(); String name = getRandomName() + ".withperiod"; try { client.makeBucket(name, "eu-central-1"); client.removeBucket(name); mintSuccessLog("makeBucket(String bucketName, String region)", "name: " + name + ", region: eu-central-1", startTime); } catch (Exception e) { mintFailedLog("makeBucket(String bucketName, String region)", "name: " + name + ", region: eu-central-1", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }
Source:
public static String normalizeLineEndings(String s) { return s.replaceAll(CRLF, LF).replaceAll(CR, LF); }

Target:
public static String normalizeLineEndings(String s) { return s.replaceAll(CRLF, LF).replace(CR_CHAR, LF_CHAR); }
Source:
protected void pulsePhysics() { Location velLoc = location.clone().add(velocity); final Block block = velLoc.getBlock(); if (block.getType().isOccluding()) { Location velLocY = location.clone().add(0, velocity.getY(), 0); if (velLocY.getBlock().getType().isOccluding()) { velocity.setY(0); } Location velLocX = location.clone().add(velocity.getX(), 0, 0); if (velLocX.getBlock().getType().isOccluding()) { velocity.setX(0); } Location velLocZ = location.clone().add(0, 0, velocity.getZ()); if (velLocZ.getBlock().getType().isOccluding()) { velocity.setZ(0); } collide(block); } else { if (hasFriction()) { if (location.getBlock().getType() == Material.WATER) { velocity.multiply(liquidDrag); velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } else if (location.getBlock().getType() == Material.LAVA) { velocity.multiply(liquidDrag - 0.3); velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } else { velocity.setY(airDrag * (velocity.getY() + getGravityAccel().getY())); if (isOnGround()) { velocity.setX(velocity.getX() * slipMultiplier); velocity.setZ(velocity.getZ() * slipMultiplier); } else { horizontalAirDrag = 0.91; velocity.setX(velocity.getX() * horizontalAirDrag); velocity.setZ(velocity.getZ() * 0.91); } } } else if (hasGravity() && !isOnGround()) { switch (location.getBlock().getType()) { case WATER: case LAVA: velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); break; default: velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } } setRawLocation(velLoc); } }

Target:
protected void pulsePhysics() { Location velLoc = location.clone().add(velocity); final Block block = velLoc.getBlock(); if (block.getType().isOccluding()) { Location velLocY = location.clone().add(0, velocity.getY(), 0); if (velLocY.getBlock().getType().isOccluding()) { velocity.setY(0); } Location velLocX = location.clone().add(velocity.getX(), 0, 0); if (velLocX.getBlock().getType().isOccluding()) { velocity.setX(0); } Location velLocZ = location.clone().add(0, 0, velocity.getZ()); if (velLocZ.getBlock().getType().isOccluding()) { velocity.setZ(0); } collide(block); } else { if (hasFriction()) { if (location.getBlock().getType() == Material.WATER) { velocity.multiply(liquidDrag); velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } else if (location.getBlock().getType() == Material.LAVA) { velocity.multiply(liquidDrag - 0.3); velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } else { velocity.setY(airDrag * (velocity.getY() + getGravityAccel().getY())); if (isOnGround()) { velocity.setX(velocity.getX() * slipMultiplier); velocity.setZ(velocity.getZ() * slipMultiplier); } else { velocity.setX(velocity.getX() * horizontalAirDrag); velocity.setZ(velocity.getZ() * horizontalAirDrag); } } } else if (hasGravity() && !isOnGround()) { switch (location.getBlock().getType()) { case WATER: case LAVA: velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); break; default: velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } } setRawLocation(velLoc); } }
Source:
public void registerDisputeAgent(String disputeAgentType, String registrationKey) { if (!p2PService.isBootstrapped()) throw new IllegalStateException("p2p service is not bootstrapped yet"); if (config.baseCurrencyNetwork.isMainnet() || config.baseCurrencyNetwork.isDaoBetaNet() || !config.useLocalhostForP2P) throw new IllegalStateException("dispute agents must be registered in a Bisq UI"); if (!registrationKey.equals(DEV_PRIVILEGE_PRIV_KEY)) throw new IllegalArgumentException("invalid registration key"); switch (disputeAgentType) { case "arbitrator": throw new IllegalArgumentException("arbitrators must be registered in a Bisq UI"); case "mediator": case "refundagent": NodeAddress nodeAddress = new NodeAddress( InetAddress.getLoopbackAddress().getHostAddress(), config.nodePort); List<String> languageCodes = Arrays.asList("de", "en", "es", "fr"); ECKey ecKey = mediatorManager.getRegistrationKey(registrationKey); String signature = mediatorManager.signStorageSignaturePubKey(Objects.requireNonNull(ecKey)); if (disputeAgentType.equals("mediator")) registerMediator(nodeAddress, languageCodes, ecKey, signature); else registerRefundAgent(nodeAddress, languageCodes, ecKey, signature); return; default: throw new IllegalArgumentException("unknown dispute agent type " + disputeAgentType); } }

Target:
public void registerDisputeAgent(String disputeAgentType, String registrationKey) { if (!p2PService.isBootstrapped()) throw new IllegalStateException("p2p service is not bootstrapped yet"); if (config.baseCurrencyNetwork.isMainnet() || config.baseCurrencyNetwork.isDaoBetaNet() || !config.useLocalhostForP2P) throw new IllegalStateException("dispute agents must be registered in a Bisq UI"); if (!registrationKey.equals(DEV_PRIVILEGE_PRIV_KEY)) throw new IllegalArgumentException("invalid registration key"); ECKey ecKey; String signature; switch (disputeAgentType) { case "arbitrator": throw new IllegalArgumentException("arbitrators must be registered in a Bisq UI"); case "mediator": ecKey = mediatorManager.getRegistrationKey(registrationKey); signature = mediatorManager.signStorageSignaturePubKey(Objects.requireNonNull(ecKey)); registerMediator(nodeAddress, languageCodes, ecKey, signature); return; case "refundagent": ecKey = refundAgentManager.getRegistrationKey(registrationKey); signature = refundAgentManager.signStorageSignaturePubKey(Objects.requireNonNull(ecKey)); registerRefundAgent(nodeAddress, languageCodes, ecKey, signature); return; default: throw new IllegalArgumentException("unknown dispute agent type " + disputeAgentType); } }
Source:
private void setupNamedStatement(ObjList<BindVariableSetter> bindVariableSetters, CharSequenceObjHashMap<NamedStatementWrapper> namedStatementMap, CharSequence statementName) throws SqlException { if (statementName != null) { final NamedStatementWrapper wrapper = namedStatementMap.get(statementName); if (wrapper.selectFactory != null) { queryTag = TAG_SELECT; currentFactory = wrapper.selectFactory; } else if (wrapper.insertStatement != null) { queryTag = TAG_INSERT; currentInsertStatement = wrapper.insertStatement; } if (wrapper.bindVariableTypes != null) { bindVariableSetters.clear(); setupCachedBindVariables(bindVariableSetters, wrapper.bindVariableTypes); } } }

Target:
private void setupNamedStatement(ObjList<BindVariableSetter> bindVariableSetters, CharSequenceObjHashMap<NamedStatementWrapper> namedStatementMap, CharSequence statementName) throws SqlException { final NamedStatementWrapper wrapper = namedStatementMap.get(statementName); if (wrapper.selectFactory != null) { queryTag = TAG_SELECT; currentFactory = wrapper.selectFactory; } else if (wrapper.insertStatement != null) { queryTag = TAG_INSERT; currentInsertStatement = wrapper.insertStatement; } if (wrapper.bindVariableTypes != null) { bindVariableSetters.clear(); setupCachedBindVariables(bindVariableSetters, wrapper.bindVariableTypes); } }
Source:
public static Double doubleArrayMinMax(MethodHandle compareMethodHandle, Type elementType, Block block) { try { if (block.getPositionCount() == 0) { return null; } double selectedValue = elementType.getDouble(block, 0); for (int i = 0; i < block.getPositionCount(); i++) { if (block.isNull(i)) { return null; } double value = elementType.getDouble(block, i); if (isNaN(value)) { return value; } else if ((boolean) compareMethodHandle.invokeExact(value, selectedValue)) { selectedValue = value; } } return selectedValue; } catch (Throwable t) { throw internalError(t); } }

Target:
public static Double doubleArrayMinMax(MethodHandle compareMethodHandle, Type elementType, Block block) { try { if (block.getPositionCount() == 0) { return null; } boolean containNull = false; double selectedValue = elementType.getDouble(block, 0); for (int i = 0; i < block.getPositionCount(); i++) { if (block.isNull(i)) { containNull = true; } double value = elementType.getDouble(block, i); if ((boolean) compareMethodHandle.invokeExact(value, selectedValue)) { selectedValue = value; } else if (isNaN(value)) { return NaN; } } return containNull ? null : selectedValue; } catch (Throwable t) { throw internalError(t); } }
Source:
public int hashCode() { int result = cursor.hashCode(); result = 31 * result + (events != null ? events.hashCode() : 0); result = 31 * result + (metadata != null ? metadata.hashCode() : 0); return result; }

Target:
public int hashCode() { int result = cursor.hashCode(); result = 31 * result + events.hashCode(); result = 31 * result + (metadata != null ? metadata.hashCode() : 0); return result; }
Source:
public CubemapAttribute (final long type, final Cubemap texture) { this(type); textureDescription.set(texture, texture.getMinFilter(), texture.getMagFilter(), texture.getUWrap(), texture.getVWrap()); }

Target:
public CubemapAttribute (final long type, final Cubemap texture) { this(type); textureDescription.texture = texture; }
Source:
public SegmentsAndMetadata finish( final TransactionalSegmentPublisher publisher, final Committer committer ) throws InterruptedException { final SegmentsAndMetadata segmentsAndMetadata = publishAll(publisher, wrapCommitter(committer)); if (segmentsAndMetadata != null) { log.info("Awaiting handoff..."); synchronized (handoffMonitor) { while (!appenderator.getSegments().isEmpty()) { handoffMonitor.wait(); } } return new SegmentsAndMetadata( segmentsAndMetadata.getSegments(), ((FiniteAppenderatorDriverMetadata) segmentsAndMetadata.getCommitMetadata()).getCallerMetadata() ); } else { return null; } }

Target:
public SegmentsAndMetadata finish( final TransactionalSegmentPublisher publisher, final Committer committer ) throws InterruptedException { final SegmentsAndMetadata segmentsAndMetadata = publishAll(publisher, wrapCommitter(committer)); if (segmentsAndMetadata != null) { final long giveUpAt = handoffConditionTimeout > 0 ? System.currentTimeMillis() + handoffConditionTimeout : 0; log.info("Awaiting handoff..."); synchronized (handoffMonitor) { while (!appenderator.getSegments().isEmpty()) { if (giveUpAt == 0) { handoffMonitor.wait(); } else { final long remaining = giveUpAt - System.currentTimeMillis(); if (remaining > 0) { handoffMonitor.wait(remaining); } else { throw new ISE( "Segment handoff wait timeout. Segments not yet handed off: [%s]", Joiner.on(", ").join(appenderator.getSegments()) ); } } } } return new SegmentsAndMetadata( segmentsAndMetadata.getSegments(), ((FiniteAppenderatorDriverMetadata) segmentsAndMetadata.getCommitMetadata()).getCallerMetadata() ); } else { return null; } }
Source:
private Mono<PagedResponse<KeyProperties>> listKeyVersionsFirstPage(String name, Context context) { try { return service.getKeyVersions(vaultUrl, name, DEFAULT_MAX_PAGE_RESULTS, apiVersion, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context.addData(AZ_TRACING_NAMESPACE_KEY, KEYVAULT_TRACING_NAMESPACE_VALUE)) .doOnRequest(ignored -> logger.info("Listing key versions - {}", name)) .doOnSuccess(response -> { if (response.getValue().size() == 0) { throw new ResourceNotFoundException(String.format("Key with name: %s not found", name), null); } else { logger.info("Listed key versions - {}", name); } }) .doOnError(error -> logger.warning(String.format("Failed to list key versions - %s", name), error)); } catch (RuntimeException ex) { return monoError(logger, ex); } }

Target:
private Mono<PagedResponse<KeyProperties>> listKeyVersionsFirstPage(String name, Context context) { try { return service.getKeyVersions(vaultUrl, name, DEFAULT_MAX_PAGE_RESULTS, apiVersion, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context.addData(AZ_TRACING_NAMESPACE_KEY, KEYVAULT_TRACING_NAMESPACE_VALUE)) .doOnRequest(ignored -> logger.info("Listing key versions - {}", name)) .doOnSuccess(response -> logger.info("Listed key versions - {}", name)) .doOnError(error -> logger.warning(String.format("Failed to list key versions - %s", name), error)); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
public void updates_rows_to_BRANCH() throws SQLException { insertRow(1, "SHORT"); insertRow(2, "LONG"); insertRow(3, "SHORT"); insertRow(4, "LONG"); assertThat(countRowsWithValue(null)).isEqualTo(4); assertThat(countRowsWithValue(KEY_TYPE_BRANCH)).isEqualTo(0); underTest.execute(); assertThat(countRowsWithValue(null)).isEqualTo(0); assertThat(countRowsWithValue(KEY_TYPE_BRANCH)).isEqualTo(4); }

Target:
public void updates_rows_to_BRANCH() throws SQLException { insertRow(1, "SHORT"); insertRow(2, "LONG"); insertRow(3, "SHORT"); insertRow(4, "LONG"); String countUpdatedAtSQL = "select count(uuid) from " + TABLE_NAME + " where updated_at = "; assertThat(countRowsWithValue(null)).isEqualTo(4); assertThat(countRowsWithValue(DEFAULT_KEY_TYPE)).isEqualTo(0); assertThat(dbTester.countSql(countUpdatedAtSQL + PAST)).isEqualTo(4); underTest.execute(); assertThat(countRowsWithValue(null)).isEqualTo(0); assertThat(countRowsWithValue(DEFAULT_KEY_TYPE)).isEqualTo(4); assertThat(dbTester.countSql(countUpdatedAtSQL + NOW)).isEqualTo(4); }
Source:
public @CheckForNull String getOut() { return out; }

Target:
public @Nonnull String getOut() { return out; }
Source:
String buildClientResponse() { final String sbOauth2 = USER + username + ImapClientConstants.SOH + AUTH_BEARER + token + ImapClientConstants.SOH + ImapClientConstants.SOH; return Base64.encodeBase64String(sbOauth2.getBytes(StandardCharsets.UTF_8)); }

Target:
String buildClientResponse() { final int len = USER.length() + username.length() + token.length() + EXTRA_LEN; final StringBuilder sbOauth2 = new StringBuilder(len).append(USER).append(username).append(ImapClientConstants.SOH).append(AUTH_BEARER) .append(token).append(ImapClientConstants.SOH).append(ImapClientConstants.SOH); return Base64.encodeBase64String(sbOauth2.toString().getBytes(StandardCharsets.UTF_8)); }
Source:
public void decorate(World world, Random random, Chunk source) { int sourceX = (source.getX() << 4) + random.nextInt(16); int sourceZ = (source.getZ() << 4) + random.nextInt(16); int sourceY = random.nextInt(random.nextInt(type == Material.LAVA ? random.nextInt(240) + 8 : 248) + 8); Block block = world.getBlockAt(sourceX, sourceY, sourceZ); if ((block.getType() == Material.STONE || block.getType() == Material.AIR) && block.getRelative(BlockFace.DOWN).getType() == Material.STONE && block.getRelative(BlockFace.UP).getType() == Material.STONE) { int stoneBlockCount = 0; for (BlockFace face : SIDES) { if (block.getRelative(face).getType() == Material.STONE) { stoneBlockCount++; } } if (stoneBlockCount == 3) { int airBlockCount = 0; for (BlockFace face : SIDES) { if (block.getRelative(face).isEmpty()) { airBlockCount++; } } if (airBlockCount == 1) { BlockState state = block.getState(); state.setType(type); state.update(true); ((GlowWorld) block.getWorld()).requestSinglePulse((GlowBlock) block, 20); } } } }

Target:
public void decorate(World world, Random random, Chunk source) { int sourceX = (source.getX() << 4) + random.nextInt(16); int sourceZ = (source.getZ() << 4) + random.nextInt(16); int sourceY = random.nextInt(random.nextInt(type == Material.LAVA ? random.nextInt(240) + 8 : 248) + 8); Block block = world.getBlockAt(sourceX, sourceY, sourceZ); if ((block.getType() == Material.STONE || block.getType() == Material.AIR) && block.getRelative(BlockFace.DOWN).getType() == Material.STONE && block.getRelative(BlockFace.UP).getType() == Material.STONE) { int stoneBlockCount = 0; for (BlockFace face : SIDES) { if (block.getRelative(face).getType() == Material.STONE) { stoneBlockCount++; } } if (stoneBlockCount == 3) { int airBlockCount = 0; for (BlockFace face : SIDES) { if (block.getRelative(face).isEmpty()) { airBlockCount++; } } if (airBlockCount == 1) { BlockState state = block.getState(); state.setType(type); state.update(true); ((GlowWorld) block.getWorld()).requestSinglePulse((GlowBlock) block, 0); } } } }
Source:
private void disableHook() { if (getWindow() != null) { return; } if (getSelectedItems() == null || getSelectedItems().size() == 0) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().confirmDisableGlusterHooks()); model.setHashName("disable_hooks"); model.setMessage(ConstantsManager.getInstance().getConstants().disableGlusterHooksMessage()); if (getSelectedItems() == null) { return; } ArrayList<String> list = new ArrayList<String>(); for (Object item : getSelectedItems()) { GlusterHookEntity hook = (GlusterHookEntity) item; list.add(hook.getName()); } model.setItems(list); UICommand okCommand = new UICommand("OnDisableHook", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("OnCancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }

Target:
private void disableHook() { if (getWindow() != null) { return; } if (getSelectedItems() == null || getSelectedItems().size() == 0) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().confirmDisableGlusterHooks()); model.setHashName("disable_hooks"); model.setMessage(ConstantsManager.getInstance().getConstants().disableGlusterHooksMessage()); ArrayList<String> list = new ArrayList<String>(); for (Object item : getSelectedItems()) { GlusterHookEntity hook = (GlusterHookEntity) item; list.add(hook.getName()); } model.setItems(list); UICommand okCommand = new UICommand("OnDisableHook", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("OnCancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }
Source:
public Image pull(String name, String tag) { Objects.requireNonNull(name); Objects.requireNonNull(tag); findImage(new ImageNamePredicate(name, tag)); LOG.info(String.format("Pulling %s:%s", name, tag)); HttpRequest request = new HttpRequest(POST, "/images/create") .addQueryParameter("fromImage", name) .addQueryParameter("tag", tag); HttpResponse res = client.execute(request); if (res.getStatus() != HTTP_OK) { throw new WebDriverException("Unable to pull container: " + name); } LOG.fine(String.format("Pull of %s:%s complete", name, tag)); return findImage(new ImageNamePredicate(name, tag)) .orElseThrow(() -> new DockerException( String.format("Cannot find image matching: %s:%s", name, tag))); }

Target:
public Image pull(String name, String tag) { Objects.requireNonNull(name); Objects.requireNonNull(tag); findImage(new ImageNamePredicate(name, tag)); LOG.info(String.format("Pulling %s:%s", name, tag)); HttpRequest request = new HttpRequest(POST, "/images/create") .addQueryParameter("fromImage", name) .addQueryParameter("tag", tag); HttpResponse res = client.execute(request); if (res.getStatus() != HTTP_OK) { throw new WebDriverException("Unable to pull container: " + name); } LOG.info(String.format("Pull of %s:%s complete", name, tag)); return findImage(new ImageNamePredicate(name, tag)) .orElseThrow(() -> new DockerException( String.format("Cannot find image matching: %s:%s", name, tag))); }
Source:
public static InFlightCache create( Config config, Monitors monitors ) { Type type = config.get( CausalClusteringSettings.in_flight_cache_type ); switch ( type ) { case NONE: return new VoidInFlightCache(); case CONSECUTIVE: return new ConsecutiveInFlightCache( config.get( in_flight_cache_max_entries ), config.get( in_flight_cache_max_bytes ), monitors.newMonitor( InFlightCacheMonitor.class ), false ); case UNBOUNDED: return new UnboundedInFlightCache(); default: throw new IllegalArgumentException( "Unrecognized type" ); } }

Target:
public static InFlightCache create( Config config, Monitors monitors ) { return config.get( CausalClusteringSettings.in_flight_cache_type ).create( config, monitors ); }
Source:
public static ImageService getInstance() { if (Objects.equals(instance, null)) { synchronized (FilterService.class) { if (Objects.equals(instance, null)) { instance = new ImageService(); } } } return instance; }

Target:
public static ImageService getInstance() { if (Objects.equals(instance, null)) { synchronized (ImageService.class) { if (Objects.equals(instance, null)) { instance = new ImageService(); } } } return instance; }
Source:
void openResponse() throws IOException { final int status = HttpSupport.response(conn); if (!((status == HttpConnection.HTTP_OK) || (status == HttpConnection.HTTP_MOVED_PERM) || (status == HttpConnection.HTTP_MOVED_TEMP))) { throw new TransportException(uri, status + " " + conn.getResponseMessage()); } final String contentType = conn.getContentType(); if ((status == HttpConnection.HTTP_OK) && !responseType.equals(contentType)) { conn.getInputStream().close(); throw wrongContentType(responseType, contentType); } }

Target:
void openResponse() throws IOException { final int status = HttpSupport.response(conn); if (status != HttpConnection.HTTP_OK) { throw new TransportException(uri, status + " " + conn.getResponseMessage()); } final String contentType = conn.getContentType(); if (!responseType.equals(contentType)) { conn.getInputStream().close(); throw wrongContentType(responseType, contentType); } }
Source:
public void addRecipients(ExtendedEmailPublisherContext context, EnvVars env, Set<InternetAddress> to, Set<InternetAddress> cc, Set<InternetAddress> bcc) { ExtendedEmailPublisherDescriptor descriptor = Jenkins.getInstance().getDescriptorByType(ExtendedEmailPublisherDescriptor.class); descriptor.debug(context.getListener().getLogger(), "Sending email to upstream committer(s)."); AbstractBuild<?, ?> cur; Cause.UpstreamCause upc = context.getBuild().getCause(Cause.UpstreamCause.class); while (upc != null) { AbstractProject<?, ?> p = (AbstractProject<?, ?>) Jenkins.getInstance().getItemByFullName(upc.getUpstreamProject()); if(p == null) break; cur = p.getBuildByNumber(upc.getUpstreamBuild()); upc = cur.getCause(Cause.UpstreamCause.class); addUpstreamCommittersTriggeringBuild(cur, to, cc, bcc, env, context.getListener()); } }

Target:
public void addRecipients(ExtendedEmailPublisherContext context, EnvVars env, Set<InternetAddress> to, Set<InternetAddress> cc, Set<InternetAddress> bcc) { descriptor.debug(context.getListener().getLogger(), "Sending email to upstream committer(s)."); AbstractBuild<?, ?> cur; Cause.UpstreamCause upc = context.getBuild().getCause(Cause.UpstreamCause.class); while (upc != null) { AbstractProject<?, ?> p = (AbstractProject<?, ?>) Jenkins.getInstance().getItemByFullName(upc.getUpstreamProject()); if(p == null) break; cur = p.getBuildByNumber(upc.getUpstreamBuild()); upc = cur.getCause(Cause.UpstreamCause.class); addUpstreamCommittersTriggeringBuild(cur, to, cc, bcc, env, context.getListener()); } }
Source:
@Override protected void tearDown() throws Exception { long dur = System.currentTimeMillis() - ts; info(">>> Stopping test: " + testDescription() + " in " + dur + " ms <<<"); TestCounters cntrs = getTestCounters(); if (isDebug()) info("Test counters [numOfTests=" + cntrs.getNumberOfTests() + ", started=" + cntrs.getStarted() + ", stopped=" + cntrs.getStopped() + ']'); try { afterTest(); } finally { serializedObj.clear(); Exception err = null; if (isLastTest()) { info(">>> Stopping test class: " + testClassDescription() + " <<<"); TestCounters counters = getTestCounters(); GridTestUtils.stopThreads(log); getTestResources().stopThreads(); counters.setReset(true); try { afterTestsStopped(); } catch (Exception e){ err = e; } if(isSafeTopology()) stopAllGrids(false); tests.remove(getClass()); GridClassLoaderCache.clear(); U.clearClassCache(); MarshallerExclusions.clearCache(); BinaryEnumCache.clear(); } Thread.currentThread().setContextClassLoader(clsLdr); clsLdr = null; cleanReferences(); if (isLastTest()) { if (err != null) throw err; else if (isSafeTopology() && stopGridErr) throw new RuntimeException("Not all Ignite instances has been stopped. Please, see log for details."); } } }

Target:
@Override protected void tearDown() throws Exception { long dur = System.currentTimeMillis() - ts; info(">>> Stopping test: " + testDescription() + " in " + dur + " ms <<<"); TestCounters cntrs = getTestCounters(); if (isDebug()) info("Test counters [numOfTests=" + cntrs.getNumberOfTests() + ", started=" + cntrs.getStarted() + ", stopped=" + cntrs.getStopped() + ']'); try { afterTest(); } finally { serializedObj.clear(); Exception err = null; if (isLastTest()) { info(">>> Stopping test class: " + testClassDescription() + " <<<"); TestCounters counters = getTestCounters(); GridTestUtils.stopThreads(log); getTestResources().stopThreads(); counters.setReset(true); try { afterTestsStopped(); } catch (Exception e){ err = e; } if (isSafeTopology()) { stopAllGrids(false); if (stopGridErr) err = new RuntimeException("Not all Ignite instances has been stopped. " + "Please, see log for details.", err); } tests.remove(getClass()); GridClassLoaderCache.clear(); U.clearClassCache(); MarshallerExclusions.clearCache(); BinaryEnumCache.clear(); } Thread.currentThread().setContextClassLoader(clsLdr); clsLdr = null; cleanReferences(); if (err != null) throw err; } }
Source:
private Function<PollResponse<CertificateOperation>, Mono<PollResponse<CertificateOperation>>> createPollOperation(String certificateName) { return prePollResponse -> { try { System.out.println("Calling Polling Function"); return service.getCertificateOperation(endpoint, certificateName, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .flatMap(this::processCertificateOperationResponse); } catch (HttpRequestException e) { logger.logExceptionAsError(e); return Mono.just(new PollResponse<>(PollResponse.OperationStatus.FAILED, null)); } }; }

Target:
private Function<PollResponse<CertificateOperation>, Mono<PollResponse<CertificateOperation>>> createPollOperation(String certificateName) { return prePollResponse -> { try { return withContext(context -> service.getCertificateOperation(endpoint, certificateName, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .flatMap(this::processCertificateOperationResponse)); } catch (HttpRequestException e) { logger.logExceptionAsError(e); return Mono.just(new PollResponse<>(PollResponse.OperationStatus.FAILED, null)); } }; }
Source:
private boolean executeWithoutTransaction() { boolean functionReturnValue = false; boolean exceptionOccurred = true; try { logRunningCommand(); executeCommand(); functionReturnValue = getSucceeded(); exceptionOccurred = false; } catch (EJBTransactionRolledbackException e) { Throwable cause = e.getCause(); if (cause != null && cause instanceof EngineException) { processEngineException((EngineException) cause); } else { processRuntimeException(e); } } catch (EngineException e) { processEngineException(e); } catch (OpenStackResponseException e) { if (returnValue.getExecuteFailedMessages().isEmpty()) { processExceptionToClient(new EngineFault(e, EngineError.ENGINE)); } log.error("Command '{}' failed: {}", getClass().getName(), e.getMessage()); log.error("Exception", e); } catch (RuntimeException e) { processRuntimeException(e); } finally { if (!exceptionOccurred) { setCommandExecuted(); } if (exceptionOccurred || !getSucceeded()) { setSucceeded(false); compensate(); if (commandStatus == CommandStatus.ACTIVE) { setCommandStatus(noAsyncOperations() ? CommandStatus.ENDED_WITH_FAILURE : CommandStatus.EXECUTION_FAILED); } } else { ENDED_SUCCESSFULLY if the status is ACTIVE if (getReturnValue().getVdsmTaskIdList().isEmpty() && getReturnValue().getInternalVdsmTaskIdList().isEmpty() && getCallback() == null && commandStatus == CommandStatus.ACTIVE) { setCommandStatus(CommandStatus.ENDED_SUCCESSFULLY); } getCompensationContext().cleanupCompensationDataAfterSuccessfulCommand(); } } return functionReturnValue; }

Target:
private boolean executeWithoutTransaction() { boolean functionReturnValue = false; boolean exceptionOccurred = true; try { logRunningCommand(); executeCommand(); functionReturnValue = getSucceeded(); exceptionOccurred = false; } catch (EngineException e) { processEngineException(e); } catch (OpenStackResponseException e) { processOpenStackException(e); } catch (RuntimeException e) { Throwable cause = e.getCause(); if (cause != null && cause instanceof EngineException) { processEngineException((EngineException) cause); } else if (cause != null && cause instanceof OpenStackResponseException) { processOpenStackException((OpenStackResponseException) cause); } else { processRuntimeException(e); } } finally { if (!exceptionOccurred) { setCommandExecuted(); } if (exceptionOccurred || !getSucceeded()) { setSucceeded(false); compensate(); if (commandStatus == CommandStatus.ACTIVE) { setCommandStatus(noAsyncOperations() ? CommandStatus.ENDED_WITH_FAILURE : CommandStatus.EXECUTION_FAILED); } } else { ENDED_SUCCESSFULLY if the status is ACTIVE if (getReturnValue().getVdsmTaskIdList().isEmpty() && getReturnValue().getInternalVdsmTaskIdList().isEmpty() && getCallback() == null && commandStatus == CommandStatus.ACTIVE) { setCommandStatus(CommandStatus.ENDED_SUCCESSFULLY); } getCompensationContext().cleanupCompensationDataAfterSuccessfulCommand(); } } return functionReturnValue; }
Source:
private static String buildResolutionString(Dimension dimension) { return String.format("%sx%s", dimension.width, dimension.height); }

Target:
private static String buildResolutionString(Dimension dimension) { return String.format("%dx%d", dimension.width, dimension.height); }
Source:
public void removeCredentialsForCluster(String clusterName, Set<String> aliases) throws KeystoreServiceException { synchronized (this) { KeyStore ks = getCredentialStoreForCluster(clusterName); if (ks != null) { try { for (String alias : aliases) { if (ks.containsAlias(alias)) { ks.deleteEntry(alias); } removeFromCache(clusterName, alias); } final Path keyStoreFilePath = keyStoreDirPath.resolve(clusterName + CREDENTIALS_SUFFIX); writeKeyStoreToFile(ks, keyStoreFilePath, masterService.getMasterSecret()); } catch (KeyStoreException | IOException | CertificateException | NoSuchAlgorithmException e) { LOG.failedToRemoveCredentialForCluster(clusterName, e); } } } }

Target:
public void removeCredentialsForCluster(String clusterName, Set<String> aliases) throws KeystoreServiceException { synchronized (this) { KeyStore ks = getCredentialStoreForCluster(clusterName); if (ks != null) { try { for (String alias : aliases) { if (ks.containsAlias(alias)) { ks.deleteEntry(alias); } } removeFromCache(clusterName, aliases); final Path keyStoreFilePath = keyStoreDirPath.resolve(clusterName + CREDENTIALS_SUFFIX); writeKeyStoreToFile(ks, keyStoreFilePath, masterService.getMasterSecret()); } catch (KeyStoreException | IOException | CertificateException | NoSuchAlgorithmException e) { LOG.failedToRemoveCredentialForCluster(clusterName, e); } } } }