auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testVarchars() throws Exception { tester.testRoundTrip(VARCHAR, newArrayList(limit(cycle(ImmutableList.of("apple", "apple pie", "apple\uD835\uDC03", "apple\uFFFD")), NUM_ROWS)), stringEquals(false, "apple")); tester.testRoundTrip(VARCHAR, intsBetween(0, NUM_ROWS).stream().map(Object::toString).collect(toList()), stringIn(false, "10", "11"), stringIn(true, "10", "11"), stringBetween(false, "14", "10")); tester.testRoundTripTypes( ImmutableList.of(VARCHAR, VARCHAR), ImmutableList.of( intsBetween(0, NUM_ROWS).stream().map(Object::toString).collect(toList()), newArrayList(limit(cycle(ImmutableList.of("A", "B", "C")), NUM_ROWS))), toSubfieldFilters(ImmutableMap.of( 0, stringBetween(true, "16", "10"), 1, stringBetween(false, "B", "A")))); tester.testRoundTrip(VARCHAR, newArrayList(concat(ImmutableList.of("a"), nCopies(9999, "123"), ImmutableList.of("b"), nCopies(9999, "123")))); tester.testRoundTrip(VARCHAR, nCopies(NUM_ROWS, ""), BytesRange.of("".getBytes(), false, "".getBytes(), false, false)); List<Integer> values = newArrayList(limit( cycle(concat( ImmutableList.of(1), nCopies(9999, 123), ImmutableList.of(2), nCopies(9999, 123), ImmutableList.of(3), nCopies(9999, 123), nCopies(1_000_000, null))), 200_000)); tester.assertRoundTrip( VARCHAR, newArrayList(values).stream() .map(value -> value == null ? null : String.valueOf(value)) .collect(toList())); tester.testRoundTrip( VARCHAR, newArrayList(limit(cycle(ImmutableList.of(1, 3, 5, 7, 11, 13, 17)), 200_000)).stream() .map(Object::toString) .collect(toList())); }

Target:
public void testVarchars() throws Exception { tester.testRoundTrip(VARCHAR, newArrayList(limit(cycle(ImmutableList.of("apple", "apple pie", "apple\uD835\uDC03", "apple\uFFFD")), NUM_ROWS)), stringEquals(false, "apple")); tester.testRoundTrip(VARCHAR, intsBetween(0, NUM_ROWS).stream().map(Object::toString).collect(toList()), stringIn(false, "10", "11"), stringIn(true, "10", "11"), stringBetween(false, "14", "10")); tester.testRoundTripTypes( ImmutableList.of(VARCHAR, VARCHAR), ImmutableList.of( intsBetween(0, NUM_ROWS).stream().map(Object::toString).collect(toList()), newArrayList(limit(cycle(ImmutableList.of("A", "B", "C")), NUM_ROWS))), toSubfieldFilters(ImmutableMap.of( 0, stringBetween(true, "16", "10"), 1, stringBetween(false, "B", "A")))); tester.testRoundTrip(VARCHAR, newArrayList(concat(ImmutableList.of("a"), nCopies(9999, "123"), ImmutableList.of("b"), nCopies(9999, "123")))); tester.testRoundTrip(VARCHAR, nCopies(NUM_ROWS, ""), stringEquals(false, "")); List<Integer> values = newArrayList(limit( cycle(concat( ImmutableList.of(1), nCopies(9999, 123), ImmutableList.of(2), nCopies(9999, 123), ImmutableList.of(3), nCopies(9999, 123), nCopies(1_000_000, null))), 200_000)); tester.assertRoundTrip( VARCHAR, newArrayList(values).stream() .map(value -> value == null ? null : String.valueOf(value)) .collect(toList())); tester.testRoundTrip( VARCHAR, newArrayList(limit(cycle(ImmutableList.of(1, 3, 5, 7, 11, 13, 17)), 200_000)).stream() .map(Object::toString) .collect(toList())); }
Source:
public void testBinaryComparisonTypeTemplated() { FilterNode node = builder .beginBinaryComparisonType("=") .setProperty("name") .setTemplatedValues("5", "id", true, false) .endBinaryComparisonType() .getResult(); assertThat(node.getType(), is("=")); assertThat(node.getNodes(), is(nullValue())); assertThat(node.isLeaf(), is(true)); assertThat(FilterLeafNode.class.isInstance(node), is(true)); FilterLeafNode leaf = (FilterLeafNode) node; assertThat(leaf.getProperty(), is("name")); assertThat(leaf.getValue(), is(nullValue())); assertThat(leaf.isTemplated(), is(true)); assertThat(FilterTemplatedLeafNode.class.isInstance(leaf), is(true)); FilterTemplatedLeafNode template = (FilterTemplatedLeafNode) leaf; assertThat(template.getDefaultValue(), is("5")); assertThat(template.getNodeId(), is("id")); assertThat(template.isVisible(), is(true)); assertThat(template.isReadOnly(), is(false)); }

Target:
public void testBinaryComparisonTypeTemplated() { FilterNode node = builder .beginBinaryComparisonType("=") .setProperty("name") .setTemplatedValues("5", "id", true, false) .endTerminalType() .getResult(); assertTemplatedNode(node, "=", "name", "5", "id"); }
Source:
public void save() { try { doSave(); } catch(CoreException e) { GdbPlugin.log(e); } }

Target:
public void save() { IRegisterGroupDescriptor[] groups = buildDescriptors(); ILaunchConfiguration launchConfig = getLaunchConfig(); if (launchConfig != null) { RegisterGroupsPersistance serializer = new RegisterGroupsPersistance(launchConfig); try { serializer.saveGroups(groups); } catch (CoreException e) { GdbPlugin.log(e); } } }
Source:
public static boolean intArrayContains(int[] source, int target) { for (int sort: source) { if (sort == target) { return true; } } return false; }

Target:
public static boolean intArrayContains(int[] source, int target) { for (int current: source) { if (current == target) { return true; } } return false; }
Source:
public boolean getUserHasPermissions(String userName, String domain) throws SQLException { ResultSet resultSet = null; try (Connection connection = ds.getConnection(); PreparedStatement prepareStatement = connection.prepareStatement(selectQuery);) { log.info("getPermissionsForUser username: " + userName + " domain: " + domain); prepareStatement.setString(1, userName); prepareStatement.setString(2, domain); resultSet = prepareStatement.executeQuery(); if (resultSet.next()) { return true; } } finally { if (resultSet != null) { resultSet.close(); } } return false; }

Target:
public boolean getUserHasPermissions(String userName, String domain) throws SQLException { boolean result = false; try (Connection connection = ds.getConnection(); PreparedStatement prepareStatement = connection.prepareStatement(selectQuery);) { log.info("getPermissionsForUser username: " + userName + " domain: " + domain); prepareStatement.setString(1, userName); prepareStatement.setString(2, domain); try (ResultSet resultSet = prepareStatement.executeQuery()) { result = resultSet.next(); } } return result; }
Source:
public SubmissionStepConfig(Map<String, String> stepMap) { id = stepMap.get("id"); String s = stepMap.get("mandatory"); if (s != null) { mandatory = BooleanUtils.toBoolean(s); } heading = stepMap.get("heading"); processingClassName = stepMap.get("processing-class"); type = stepMap.get("type"); scope = stepMap.get("scope"); visibility = stepMap.get("scope.visibility"); visibilityOutside = stepMap.get("scope.visibilityOustside"); }

Target:
public SubmissionStepConfig(Map<String, String> stepMap) { id = stepMap.get("id"); String s = stepMap.get("mandatory"); if (s != null) { mandatory = BooleanUtils.toBoolean(s); } heading = stepMap.get("heading"); processingClassName = stepMap.get("processing-class"); type = stepMap.get("type"); scope = stepMap.get("scope"); visibility = stepMap.get("scope.visibility"); visibilityOutside = stepMap.get("scope.visibilityOutside"); }
Source:
public static void insertUpdates(final DB database, final String[] users, final String objectAffectedId, final String classification) { if (users == null) { LOG.error("There are no users for this school item"); return; } for (int i = 0; i < users.length; i++) { try { UpdateManager.mongoInsertUpdate(database, users[i], objectAffectedId, TimeManager.getSystemTime(), classification); } catch (AuthenticationException | DatabaseAccessException e) { LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); } } }

Target:
public static void insertUpdates(final DB database, final String[] users, final String objectAffectedId, final String classification) { if (users == null) { LOG.error("There are no users for this school item"); return; } for (int i = 0; i < users.length; i++) { try { UpdateManager.mongoInsertUpdate(database, users[i], objectAffectedId, TimeManager.getSystemTime(), classification); } catch (AuthenticationException | DatabaseAccessException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } } }
Source:
public void table() { BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.TABLE)); assertTrue(strategies.getBlockStrategy(BlockType.TABLE) instanceof SupportedBlockStrategy); assertTrue(strategies.getBlockStrategy(BlockType.TABLE_ROW) instanceof SupportedBlockStrategy); assertTrue(strategies.getBlockStrategy(BlockType.TABLE_CELL_HEADER) instanceof SupportedBlockStrategy); assertTrue(strategies.getBlockStrategy(BlockType.TABLE_CELL_NORMAL) instanceof SupportedBlockStrategy); }

Target:
public void table() { BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.TABLE)); assertSupported(strategies, BlockType.TABLE); assertSupported(strategies, BlockType.TABLE_ROW); assertSupported(strategies, BlockType.TABLE_CELL_HEADER); assertSupported(strategies, BlockType.TABLE_CELL_NORMAL); }
Source:
public void updateArchive(F target, ExecutionResult executionResult, double fitnessValue) { assert target != null; assert this.archive.containsKey(target); assert fitnessValue >= 0.0; ExecutionResult executionResultClone = executionResult.clone(); T solutionClone = (T) executionResultClone.test.clone(); executionResultClone.setTest(solutionClone); if (!executionResultClone.noThrownExceptions()) { solutionClone.chop(executionResultClone.getFirstPositionOfThrownException() + 1); } boolean isNewCoveredTarget = this.archive.get(target).addSolution( 1.0 - (fitnessValue <= 1.0 ? fitnessValue : FitnessFunction.normalize(fitnessValue)), solutionClone); if (isNewCoveredTarget) { this.removeNonCoveredTargetOfAMethod(target); this.hasBeenUpdated = true; } }

Target:
public void updateArchive(F target, ExecutionResult executionResult, double fitnessValue) { assert target != null; assert this.archive.containsKey(target); assert fitnessValue >= 0.0; ExecutionResult executionResultClone = executionResult.clone(); T solutionClone = (T) executionResultClone.test.clone(); executionResultClone.setTest(solutionClone); if (!executionResultClone.noThrownExceptions()) { solutionClone.chop(executionResultClone.getFirstPositionOfThrownException() + 1); } boolean isNewCoveredTarget = this.archive.get(target) .addSolution(1.0 - FitnessFunction.normalize(fitnessValue), solutionClone); if (isNewCoveredTarget) { this.removeNonCoveredTargetOfAMethod(target); this.hasBeenUpdated = true; } }
Source:
public void handleResponsePacket(Packet packet) { try { lock.lock(); if (packet instanceof StateResponse) { handleLightStatus((StateResponse) packet); } else if (packet instanceof StatePowerResponse) { handlePowerStatus((StatePowerResponse) packet); } else if (packet instanceof StateLightPowerResponse) { handleLightPowerStatus((StateLightPowerResponse) packet); } else if (packet instanceof StateLightInfraredResponse) { handleInfraredStatus((StateLightInfraredResponse) packet); } else if (packet instanceof StateMultiZoneResponse) { handleMultiZoneStatus((StateMultiZoneResponse) packet); } if (currentLightState.isOnline() && !wasOnline) { wasOnline = true; logger.trace("{} : The light just went online, immediately polling the state of the light", macAsHex); sendLightStateRequests(); } } catch (Exception e) { logger.error("Error occurred while handling response packet", e); } finally { lock.unlock(); } }

Target:
public void handleResponsePacket(Packet packet) { try { lock.lock(); if (packet instanceof StateResponse) { handleLightStatus((StateResponse) packet); } else if (packet instanceof StatePowerResponse) { handlePowerStatus((StatePowerResponse) packet); } else if (packet instanceof StateLightPowerResponse) { handleLightPowerStatus((StateLightPowerResponse) packet); } else if (packet instanceof StateLightInfraredResponse) { handleInfraredStatus((StateLightInfraredResponse) packet); } else if (packet instanceof StateMultiZoneResponse) { handleMultiZoneStatus((StateMultiZoneResponse) packet); } if (currentLightState.isOnline() && !wasOnline) { wasOnline = true; logger.trace("{} : The light just went online, immediately polling the state of the light", macAsHex); sendLightStateRequests(); } } finally { lock.unlock(); } }
Source:
public void setPmOptionsMap(HashMap<String, String> value) { String pmOptions = ""; for (Map.Entry<String, String> pair : value.entrySet()) { String k = pair.getKey(); String v = pair.getValue(); if (StringHelper.stringsEqual(k, PmPortKey)) { getPmPort().setEntity(StringHelper.isNullOrEmpty(value.get(k)) ? "" : value.get(k)); } else if (StringHelper.stringsEqual(k, PmSlotKey)) { getPmSlot().setEntity(StringHelper.isNullOrEmpty(value.get(k)) ? "" : value.get(k)); } else if (StringHelper.stringsEqual(k, PmSecureKey)) { getPmSecure().setEntity(Boolean.parseBoolean(value.get(k))); } else { if (StringHelper.isNullOrEmpty(v)) { pmOptions += k + ","; } else { pmOptions += k + "=" + v + ","; } } } if (!StringHelper.isNullOrEmpty(pmOptions)) { getPmOptions().setEntity(pmOptions.substring(0, pmOptions.length() - 1)); } }

Target:
public void setPmOptionsMap(HashMap<String, String> value) { StringBuilder pmOptions = new StringBuilder(); for (Map.Entry<String, String> pair : value.entrySet()) { String k = pair.getKey(); String v = pair.getValue(); if (StringHelper.stringsEqual(k, PmPortKey)) { getPmPort().setEntity(StringHelper.isNullOrEmpty(value.get(k)) ? "" : value.get(k)); } else if (StringHelper.stringsEqual(k, PmSlotKey)) { getPmSlot().setEntity(StringHelper.isNullOrEmpty(value.get(k)) ? "" : value.get(k)); } else if (StringHelper.stringsEqual(k, PmSecureKey)) { getPmSecure().setEntity(Boolean.parseBoolean(value.get(k))); } else { if (StringHelper.isNullOrEmpty(v)) { pmOptions.append(k).append(","); } else { pmOptions.append(k).append("=").append(v).append(","); } } } String pmOptionsValue = pmOptions.toString(); if (!StringHelper.isNullOrEmpty(pmOptionsValue)) { getPmOptions().setEntity(pmOptionsValue.substring(0, pmOptionsValue.length() - 1)); } }
Source:
private void populateAnnouncements(List<AnnouncementsModel> announcementsList) { if(announcementsList !=null && announcementsList.size()>0) { hideEmptyAnnouncementMessage(); try{ String cssFileContent = FileUtil.loadTextFileFromAssets(getActivity(), "css/handouts-announcements.css"); StringBuffer buff = new StringBuffer(); buff.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"); buff.append("<head>"); buff.append("<style>"); buff.append(cssFileContent); buff.append("</style>"); buff.append("</head>"); for (AnnouncementsModel m : announcementsList) { buff.append("<div class=\"announcement-header\">"); buff.append(m.getDate()); buff.append("</div>"); buff.append("<div class=\"announcement-separator\"></div>"); buff.append("<div class=\"announcement\">"); buff.append(m.getContent()); buff.append("</div>"); } announcementWebView.clearCache(true); announcementWebView.loadDataWithBaseURL(environment.getConfig().getApiHostURL(), buff.toString(), "text/html", HTTP.UTF_8, null); } catch (IOException e) { logger.error(e); } } else { showEmptyAnnouncementMessage(); } }

Target:
private void populateAnnouncements(List<AnnouncementsModel> announcementsList) { if (announcementsList != null && announcementsList.size() > 0) { hideEmptyAnnouncementMessage(); StringBuffer buff = new StringBuffer(); buff.append("<head>"); buff.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"); try { String cssFileContent = FileUtil.loadTextFileFromAssets(getActivity(), "css/handouts-announcements.css"); buff.append("<style>"); buff.append(cssFileContent); buff.append("</style>"); } catch (IOException e) { logger.error(e); } buff.append("</head>"); buff.append("<body>"); for (AnnouncementsModel m : announcementsList) { buff.append("<div class=\"announcement-header\">"); buff.append(m.getDate()); buff.append("</div>"); buff.append("<div class=\"announcement-separator\"></div>"); buff.append("<div class=\"announcement\">"); buff.append(m.getContent()); buff.append("</div>"); } buff.append("</body>"); announcementWebView.clearCache(true); announcementWebView.loadDataWithBaseURL(environment.getConfig().getApiHostURL(), buff.toString(), "text/html", HTTP.UTF_8, null); } else { showEmptyAnnouncementMessage(); } }
Source:
public boolean isConnectionSetup() { return (connection != null); }

Target:
protected boolean isConnectionSetup() { return (connection != null); }
Source:
public static JavaVersion fromString(String javaVersion) { Matcher javaVersionMatcher = JAVA_8_VERSION_PATTERN.matcher(javaVersion); if (javaVersionMatcher.find()) { return new JavaVersion(Integer.parseInt(javaVersionMatcher.group(1)), Integer.parseInt(javaVersionMatcher.group(2)), Integer.parseInt(javaVersionMatcher.group(3)), Integer.parseInt(javaVersionMatcher.group(4)), Integer.parseInt((javaVersionMatcher.group(6) != null ? javaVersionMatcher.group(6) : "0"))); } else { logger.error("Java version not valid"); return null; } }

Target:
public static JavaVersion fromString(String javaVersion) throws IllegalArgumentException { Matcher javaVersionMatcher = JAVA_8_VERSION_PATTERN.matcher(javaVersion); if (!javaVersionMatcher.find()) { throw new IllegalArgumentException(String.format(EXCEPTION_STRING_NOT_JAVA_VERSION, javaVersion)); } return new JavaVersion(Integer.parseInt(javaVersionMatcher.group(1)), Integer.parseInt(javaVersionMatcher.group(2)), Integer.parseInt(javaVersionMatcher.group(3)), Integer.parseInt(javaVersionMatcher.group(4)), Integer.parseInt((javaVersionMatcher.group(6) != null ? javaVersionMatcher.group(6) : "0"))); }
Source:
public void testWorkingWhile() throws WordsRuntimeException { environment.createObject("Fred", "thing", new WordsPosition(0,0)); LNodeReference fredLNodeRef = new LNodeReference("Fred's"); INodeReferenceList fredRefList = new INodeReferenceList(fredLNodeRef); AST statementList = new INodeStatementList(new INodeAssign(fredRefList, new LNodeIdentifier("row"), new LNodeNum(environment.getObject("Fred").getCurrentCell().x++))); AST relation = new INodeLess(new LNodeNum(environment.getObject("Fred").getCurrentCell().x), new LNodeNum(2)); AST testNode = new INodeWhile(relation, statementList); loop.enqueueAST(testNode); loop.fastForwardEnvironment(2); assertEquals("Fred has moved correctly", environment.getObject("Fred").getCurrentCell(), new WordsPosition(2,0)); }

Target:
public void testWorkingWhile() throws WordsRuntimeException { environment.createObject("Fred", "thing", new WordsPosition(0,0)); LNodeReference fredLNodeRef = new LNodeReference("Fred's"); INodeReferenceList fredRefList = new INodeReferenceList(fredLNodeRef); AST statementList = new INodeStatementList(new INodeAssign(fredRefList, new LNodeIdentifier("row"), new LNodeNum(environment.getObject("Fred").getCurrentCell().x++))); AST relation = new INodeLess(new LNodeNum(environment.getObject("Fred").getCurrentCell().x), new LNodeNum(2)); AST testNode = new INodeWhile(relation, statementList); testNode.eval(environment); loop.fastForwardEnvironment(1); assertEquals("Fred has moved correctly", environment.getObject("Fred").getCurrentCell(), new WordsPosition(2,0)); }
Source:
protected void onPostExecute(Boolean resultBoolean) { super.onPostExecute(resultBoolean); if (resultBoolean && channelMetaDataUpdateListener != null) { channelMetaDataUpdateListener.onUpdateSuccess(updateNameResponse, context); } else if (!resultBoolean && exception != null && channelMetaDataUpdateListener != null) { channelMetaDataUpdateListener.onFailure(updateNameResponse, exception, context); } }

Target:
protected void onPostExecute(Boolean resultBoolean) { super.onPostExecute(resultBoolean); if (resultBoolean && channelMetaDataUpdateListener != null) { channelMetaDataUpdateListener.onUpdateSuccess(updateMetaDataResponse, context); } else if (!resultBoolean && channelMetaDataUpdateListener != null) { channelMetaDataUpdateListener.onFailure(updateMetaDataResponse, exception, context); } }
Source:
public static Set<String> evaluateProvidersWithPermissions(LocationManager manager, Context context) { HashSet<String> set = new HashSet<>(); List<String> providers = manager.getProviders(true); for (String provider : providers) { if ((provider.equalsIgnoreCase(LocationManager.GPS_PROVIDER) && ContextCompat.checkSelfPermission( context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)) { set.add(LocationManager.GPS_PROVIDER); } if ((provider.equalsIgnoreCase(LocationManager.NETWORK_PROVIDER) && ContextCompat.checkSelfPermission( context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED)) { set.add(LocationManager.NETWORK_PROVIDER); } } return set; }

Target:
public static Set<String> evaluateProvidersWithPermissions(LocationManager manager, Context context) { HashSet<String> set = new HashSet<>(); List<String> providers = manager.getProviders(true); for (String provider : providers) { if (provider.equalsIgnoreCase(LocationManager.GPS_PROVIDER) && ContextCompat.checkSelfPermission( context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { set.add(LocationManager.GPS_PROVIDER); } if (provider.equalsIgnoreCase(LocationManager.NETWORK_PROVIDER) && ContextCompat.checkSelfPermission( context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) { set.add(LocationManager.NETWORK_PROVIDER); } } return set; }
Source:
public boolean add(T t) { boolean result = consumers.add(t); if (result) { changedIteratorFieldUpdater.set(this, consumers.resettableIterator()); } return result; }

Target:
public boolean add(T t) { boolean result = consumers.add(t); if (result) { iterator.update(consumers.resettableIterator()); } return result; }
Source:
private byte[] decryptPayload(ExtendedJSONObject payload, KeyBundle keybundle) throws CryptoException, UnsupportedEncodingException { byte[] ciphertext = Utils.decodeBase64((String) payload .get(Constants.JSON_KEY_CIPHERTEXT)); byte[] iv = Utils.decodeBase64((String) payload.get(Constants.JSON_KEY_IV)); byte[] hmac = Utils.hex2Byte((String) payload.get(Constants.JSON_KEY_HMAC)); CryptoInfo decrypted = CryptoInfo.decrypt(ciphertext, iv, hmac, keybundle); return decrypted.getMessage(); }

Target:
private byte[] decryptPayload(ExtendedJSONObject payload, KeyBundle keybundle) throws CryptoException, UnsupportedEncodingException { String sCiphertext = (String) payload.get(Constants.JSON_KEY_CIPHERTEXT); String sIv = (String) payload.get(Constants.JSON_KEY_IV); String sHmac = (String) payload.get(Constants.JSON_KEY_HMAC); byte[] ciphertext = Utils.decodeBase64(sCiphertext); byte[] iv = Utils.decodeBase64(sIv); byte[] hmac = Utils.hex2Byte(sHmac); CryptoInfo decrypted = CryptoInfo.decrypt(ciphertext, iv, hmac, keybundle); return decrypted.getMessage(); }
Source:
private void setVendorFaxNumberValue(VendorAddress vendorAddress, String vendorFaxNumber) { try { Class type = ObjectUtils.easyGetPropertyType(vendorAddress, VendorPropertyConstants.VENDOR_FAX_NUMBER); ObjectUtils.setObjectProperty(vendorAddress, VendorPropertyConstants.VENDOR_FAX_NUMBER, type, vendorFaxNumber); } catch (FormatException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { vendorAddress.setVendorFaxNumber(null); LOG.error("setVendorFaxNumberValue: Vendor Fax Number cannot be set due to exception: " + e); e.printStackTrace(); } }

Target:
private void setVendorFaxNumberValue(VendorAddress vendorAddress, String vendorFaxNumber) { try { Class type = ObjectUtils.easyGetPropertyType(vendorAddress, VendorPropertyConstants.VENDOR_FAX_NUMBER); ObjectUtils.setObjectProperty(vendorAddress, VendorPropertyConstants.VENDOR_FAX_NUMBER, type, vendorFaxNumber); } catch (FormatException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { vendorAddress.setVendorFaxNumber(null); LOG.error("setVendorFaxNumberValue: Vendor Fax Number cannot be set due to exception: " + e.getMessage(), e); } }
Source:
public ServiceStatus getStatus(Coordinate coordinate) throws CloudnameException { String statusPath = ZkCoordinatePath.getStatusPath(coordinate); ZkCoordinateData zkCoordinateData = ZkCoordinateData.loadCoordianteData(statusPath, getZk(), null); return zkCoordinateData.snapshot().getServiceStatus(); }

Target:
public ServiceStatus getStatus(Coordinate coordinate) throws CloudnameException { String statusPath = ZkCoordinatePath.getStatusPath(coordinate); ZkCoordinateData zkCoordinateData = ZkCoordinateData.loadCoordinateData(statusPath, getZk(), null); return zkCoordinateData.snapshot().getServiceStatus(); }
Source:
protected void executeQueryCommand() { List<AuthenticationProfile> profiles = AuthenticationProfileRepository.getInstance().getProfiles(); List<ProfileEntry> names = new ArrayList<>(profiles.size()); for (AuthenticationProfile profile : profiles) { names.add(new ProfileEntry(profile.getName(), AuthzUtils.getName(profile.getAuthz()))); } Collections.sort(names, new Comparator<ProfileEntry>() { @Override public int compare(ProfileEntry lhs, ProfileEntry rhs) { return lhs.getProfile().compareTo(rhs.getProfile()) == 0 ? lhs.getProfile().compareTo(rhs.getProfile()) : lhs.getAuthz().compareTo(rhs.getAuthz()); } }); getQueryReturnValue().setReturnValue(names); }

Target:
protected void executeQueryCommand() { List<AuthenticationProfile> profiles = AuthenticationProfileRepository.getInstance().getProfiles(); List<ProfileEntry> names = new ArrayList<>(profiles.size()); for (AuthenticationProfile profile : profiles) { names.add(new ProfileEntry(profile.getName(), AuthzUtils.getName(profile.getAuthz()))); } Collections.sort(names, new Comparator<ProfileEntry>() { @Override public int compare(ProfileEntry lhs, ProfileEntry rhs) { return lhs.getProfile().compareTo(rhs.getProfile()) != 0 ? lhs.getProfile().compareTo(rhs.getProfile()) : lhs.getAuthz().compareTo(rhs.getAuthz()); } }); getQueryReturnValue().setReturnValue(names); }
Source:
private void initAssets() { BlockFamilyRegistryImpl familyFactoryRegistry = new BlockFamilyRegistryImpl(); rootContext.put(BlockFamilyRegistry.class, familyFactoryRegistry); assetTypeManager.registerCoreAssetType(Prefab.class, (AssetFactory<Prefab, PrefabData>) PojoPrefab::new, false, "prefabs"); assetTypeManager.registerCoreAssetType(BlockShape.class, (AssetFactory<BlockShape, BlockShapeData>) BlockShapeImpl::new, "shapes"); assetTypeManager.registerCoreAssetType(BlockSounds.class, (AssetFactory<BlockSounds, BlockSoundsData>) BlockSounds::new, "blockSounds"); assetTypeManager.registerCoreAssetType(BlockTile.class, (AssetFactory<BlockTile, TileData>) BlockTile::new, "blockTiles"); assetTypeManager.registerCoreAssetType(BlockFamilyDefinition.class, (AssetFactory<BlockFamilyDefinition, BlockFamilyDefinitionData>) BlockFamilyDefinition::new, "blocks"); assetTypeManager.registerCoreFormat(BlockFamilyDefinition.class, new BlockFamilyDefinitionFormat(assetTypeManager.getAssetManager(), familyFactoryRegistry)); assetTypeManager.registerCoreAssetType(UISkin.class, (AssetFactory<UISkin, UISkinData>) UISkin::new, "skins"); assetTypeManager.registerCoreAssetType(BehaviorTree.class, (AssetFactory<BehaviorTree, BehaviorTreeData>) BehaviorTree::new, false, "behaviors"); assetTypeManager.registerCoreAssetType(UIElement.class, (AssetFactory<UIElement, UIData>) UIElement::new, "ui"); for (EngineSubsystem subsystem : allSubsystems) { subsystem.registerCoreAssetTypes(assetTypeManager); } }

Target:
private void initAssets() { BlockFamilyRegistry familyFactoryRegistry = new BlockFamilyRegistry(); rootContext.put(BlockFamilyRegistry.class, familyFactoryRegistry); assetTypeManager.registerCoreAssetType(Prefab.class, (AssetFactory<Prefab, PrefabData>) PojoPrefab::new, false, "prefabs"); assetTypeManager.registerCoreAssetType(BlockShape.class, (AssetFactory<BlockShape, BlockShapeData>) BlockShapeImpl::new, "shapes"); assetTypeManager.registerCoreAssetType(BlockSounds.class, (AssetFactory<BlockSounds, BlockSoundsData>) BlockSounds::new, "blockSounds"); assetTypeManager.registerCoreAssetType(BlockTile.class, (AssetFactory<BlockTile, TileData>) BlockTile::new, "blockTiles"); assetTypeManager.registerCoreAssetType(BlockFamilyDefinition.class, (AssetFactory<BlockFamilyDefinition, BlockFamilyDefinitionData>) BlockFamilyDefinition::new, "blocks"); assetTypeManager.registerCoreFormat(BlockFamilyDefinition.class, new BlockFamilyDefinitionFormat(assetTypeManager.getAssetManager(), familyFactoryRegistry)); assetTypeManager.registerCoreAssetType(UISkin.class, (AssetFactory<UISkin, UISkinData>) UISkin::new, "skins"); assetTypeManager.registerCoreAssetType(BehaviorTree.class, (AssetFactory<BehaviorTree, BehaviorTreeData>) BehaviorTree::new, false, "behaviors"); assetTypeManager.registerCoreAssetType(UIElement.class, (AssetFactory<UIElement, UIData>) UIElement::new, "ui"); for (EngineSubsystem subsystem : allSubsystems) { subsystem.registerCoreAssetTypes(assetTypeManager); } }
Source:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> vanillaValues = super.api$getVanillaValues(); if (this.patrolTarget != null) { this.targetPosition().map(Value::asImmutable).ifPresent(vanillaValues::add); } vanillaValues.add(this.leader().asImmutable()); vanillaValues.add(this.patrolling().asImmutable()); return vanillaValues; }

Target:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> values = super.api$getVanillaValues(); values.add(this.leader().asImmutable()); values.add(this.patrolling().asImmutable()); this.targetPosition().map(Value::asImmutable).ifPresent(values::add); return values; }
Source:
private static boolean equalsTwoArray(byte[][] byte1, byte[][] byte2) { if (byte1.length != byte2.length) { return false; } for (int i = 0; i < byte1.length; i++) { if (byte1[i].length != byte2[i].length) { return false; } for (int j = 0; j < byte1[i].length; j++) { if (byte1[i][j] != byte2[i][j]) { return false; } } } return true; }

Target:
private static boolean equalsTwoArray(byte[][] byte1, byte[][] byte2) { if (byte1 == null && byte2 == null) { return true; } if ((byte1 == null && byte2 != null) || (byte1 != null && byte2 == null)) { return false; } if (byte1.length != byte2.length) { return false; } for (int i = 0; i < byte1.length; i++) { if (byte1[i].length != byte2[i].length) { return false; } for (int j = 0; j < byte1[i].length; j++) { if (byte1[i][j] != byte2[i][j]) { return false; } } } return true; }
Source:
private void initPlateauSlider() { GeneratorPrefs generatorPrefs = preferencesService.getPreferences().getGeneratorPrefs(); double plateauDensityProperty = generatorPrefs.getPlateauDensityProperty(); boolean plateauRandomProperty = generatorPrefs.getPlateauRandomProperty(); plateauSlider.setLabelFormatter(getLabelConverter()); plateauRandom.setSelected(plateauRandomProperty); plateauRandom.selectedProperty().addListener(((observable, oldValue, newValue) -> { generatorPrefs.setPlateauRandomProperty(newValue); plateauBox.setVisible(!newValue); })); plateauBox.setVisible(!plateauRandomProperty); plateauSlider.setValue(plateauDensityProperty); plateauSlider.valueProperty().addListener(((observable, oldValue, newValue) -> { generatorPrefs.setPlateauDensityProperty(newValue.intValue()); preferencesService.storeInBackground(); })); }

Target:
private void initPlateauSlider() { GeneratorPrefs generatorPrefs = preferencesService.getPreferences().getGeneratorPrefs(); double plateauDensityProperty = generatorPrefs.getPlateauDensityProperty(); boolean plateauRandomProperty = generatorPrefs.getPlateauRandomProperty(); plateauSlider.setLabelFormatter(getLabelConverter()); plateauRandom.setSelected(plateauRandomProperty); plateauSlider.setValue(plateauDensityProperty); plateauSliderBox.visibleProperty().bind(plateauRandom.selectedProperty().not()); generatorPrefs.plateauDensityPropertyProperty().bind(plateauSlider.valueProperty()); generatorPrefs.plateauRandomPropertyProperty().bind(plateauRandom.selectedProperty()); plateauSliderBox.disableProperty().bind(Bindings.isNotEmpty(previousMapName.textProperty())); plateauRandomBox.disableProperty().bind(Bindings.isNotEmpty(previousMapName.textProperty())); }
Source:
public void serialize(OutputStream output) throws IOException { writeInteger(library.size(), output); for(SongMetadata metadata : library) { writeString(String.valueOf(metadata.getId()), output); writeString(metadata.getTitle(), output); writeString(metadata.getArtist(), output); writeString(metadata.getAlbum(), output); writeString(metadata.getUsername(), output); } }

Target:
public void serialize(OutputStream output) throws IOException { writeInteger(library.size(), output); for(SongMetadata metadata : library) { writeLong(metadata.getId(), output); writeString(metadata.getTitle(), output); writeString(metadata.getArtist(), output); writeString(metadata.getAlbum(), output); writeString(metadata.getUsername(), output); } }
Source:
public void testCommandOverride() throws SQLException { PostgreSQLContainer postgres = (PostgreSQLContainer) new PostgreSQLContainer().withCommand("postgres -c max_connections=42"); postgres.start(); try { ResultSet resultSet = performQuery(postgres,"SELECT current_setting('max_connections')"); String result = resultSet.getString(1); assertEquals("max_connections should be overriden", "42", result); } finally { postgres.stop(); } }

Target:
public void testCommandOverride() throws SQLException { try (PostgreSQLContainer postgres = new PostgreSQLContainer<>().withCommand("postgres -c max_connections=42")) { postgres.start(); ResultSet resultSet = performQuery(postgres, "SELECT current_setting('max_connections')"); String result = resultSet.getString(1); assertEquals("max_connections should be overriden", "42", result); } }
Source:
protected boolean checkDisksNotInBackupStorage() { for (Disk disk : getVm().getDiskMap().values()) { StorageDomainStatic destDomain = storageDomainStaticDao.get(disk.getId()); if (destDomain.isBackup() == true) { return false; } } return true; }

Target:
protected boolean checkDisksNotInBackupStorage() { for (Disk disk : getVm().getDiskMap().values()) { StorageDomainStatic destDomain = storageDomainStaticDao.get(disk.getId()); if (destDomain.isBackup()) { return false; } } return true; }
Source:
public void strobe(int millis, String... lightIdentifiers) { if (!hueFacade.bridgeAvailable()) { throw new EventNotExecutedException("Hue bridge is not available"); } try { hueFacade.strobe(millis, getLightIdentifiers(lightIdentifiers)); } catch (BridgeUnavailableException e) { e.printStackTrace(); } }

Target:
public void strobe(int millis, String... lightIdentifiers) { try { hueFacade.strobe(millis, getLightIdentifiers(lightIdentifiers)); } catch (BridgeUnavailableException e) { throw new EventNotExecutedException(e); } }
Source:
public Response add(Disk disk) { if (QueryHelper.hasMatrixParam(getUriInfo(), UNREGISTERED_CONSTRAINT_PARAMETER)) { GetUnregisteredDiskQueryParameters getDiskParams = new GetUnregisteredDiskQueryParameters( Guid.createGuidFromString(disk.getId()), storageDomainId); VdcQueryReturnValue populateReturn = runQuery(VdcQueryType.GetUnregisteredDisk, getDiskParams); if (populateReturn.getSucceeded()) { DiskImage unregisteredDisk = (DiskImage) populateReturn.getReturnValue(); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(unregisteredDisk); return performCreate(VdcActionType.RegisterDisk, registerDiskParams, ID_RESOLVER); } else { return handleError(new Exception(populateReturn.getExceptionString()), false); } } else { validateDiskForCreation(disk); AddDiskParameters params = new AddDiskParameters(); params.setDiskInfo(getMapper(Disk.class, org.ovirt.engine.core.common.businessentities.Disk.class).map( disk, null)); params.setStorageDomainId(this.storageDomainId); return performCreate(VdcActionType.AddDisk, params, ID_RESOLVER); } }

Target:
public Response add(Disk disk) { if (QueryHelper.hasMatrixParam(getUriInfo(), UNREGISTERED_CONSTRAINT_PARAMETER)) { GetUnregisteredDiskQueryParameters getDiskParams = new GetUnregisteredDiskQueryParameters( asGuid(disk.getId()), storageDomainId, getStoragePoolIdForDomain(storageDomainId)); DiskImage unregisteredDisk = getEntity(DiskImage.class, VdcQueryType.GetUnregisteredDisk, getDiskParams, disk.getId()); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(unregisteredDisk); return performCreate(VdcActionType.RegisterDisk, registerDiskParams, ID_RESOLVER); } else { validateDiskForCreation(disk); AddDiskParameters params = new AddDiskParameters(); params.setDiskInfo(getMapper(Disk.class, org.ovirt.engine.core.common.businessentities.Disk.class).map( disk, null)); params.setStorageDomainId(this.storageDomainId); return performCreate(VdcActionType.AddDisk, params, ID_RESOLVER); } }
Source:
public void testUnionDeterminism() throws Exception { assertPlanDeterminismCore("(select a, b, c from ttree_with_key) " + "union (select a, b, c from ttree_with_key order by a, b, c limit 1);", false, true, DeterminismMode.FASTER); assertPlanDeterminismCore("(select a, b, c from ttree_with_key) " + "union (select a, b, c from ttree_with_key order by a, b, c limit 1) " + "order by a, b, c;", true, true, DeterminismMode.FASTER); assertPlanDeterminismCore("(select a, b, c from ttree_with_key order by a, b, c limit 1) " + "union (select a, b, c from ttree_with_key);", false, true, DeterminismMode.FASTER); assertPlanDeterminismCore("(select a, b, c from ttree_with_key order by a, b, c limit 1) " + "union (select a, b, c from ttree_with_key) " + "union (select a, b, c from ttree_with_key);", false, true, DeterminismMode.FASTER); assertPlanDeterminismCore("(select a, b, c from ttree_with_key order by a, b, c) " + "union (select a, b, c from ttree_with_key order by a, b, c limit 1);", true, true, DeterminismMode.FASTER); assertPlanDeterminismCore("select a from tonecolumn order by abs(a)", false, true, DeterminismMode.FASTER); }

Target:
public void testUnionDeterminism() throws Exception { assertPlanDeterminismCore("(select a, b, c from ttree_with_key) " + "union (select a, b, c from ttree_with_key order by a, b, c limit 1);", false, true, DeterminismMode.FASTER); assertPlanDeterminismCore("(select a, b, c from ttree_with_key) " + "union (select a, b, c from ttree_with_key order by a, b, c limit 1) " + "order by a, b, c;", true, true, DeterminismMode.FASTER); assertPlanDeterminismCore("(select a, b, c from ttree_with_key order by a, b, c limit 1) " + "union (select a, b, c from ttree_with_key);", false, true, DeterminismMode.FASTER); assertPlanDeterminismCore("(select a, b, c from ttree_with_key order by a, b, c limit 1) " + "union (select a, b, c from ttree_with_key) " + "union (select a, b, c from ttree_with_key);", false, true, DeterminismMode.FASTER); assertPlanDeterminismCore("(select a, b, c from ttree_with_key order by a, b, c) " + "union (select a, b, c from ttree_with_key order by a, b, c limit 1);", true, true, DeterminismMode.FASTER); }
Source:
private String GetLocalStoragesFormattedString() { StringBuilder localStorages = new StringBuilder(""); for (StorageDomain a : Linq.<StorageDomain> cast(getSelectedItems())) { if (a.getStorageType() == StorageType.LOCALFS) { localStorages.append(a.getStorageName()).append(", "); } } return localStorages.substring(0, localStorages.length() - 2); }

Target:
private String GetLocalStoragesFormattedString() { StringBuilder localStorages = new StringBuilder(); for (StorageDomain a : Linq.<StorageDomain> cast(getSelectedItems())) { if (a.getStorageType() == StorageType.LOCALFS) { localStorages.append(a.getStorageName()).append(", "); } } return localStorages.substring(0, localStorages.length() - 2); }
Source:
public void shouldRightReturnNotNull() { assertThat(right(null)).isNotNull(); }

Target:
public void shouldRightReturnNotNull() { assertThat(Right(null)).isNotNull(); }
Source:
public void testInvalidCallDuringInitialization() throws Exception { dispatcher = createAndStartDispatcher(heartbeatServices, haServices, new ExpectedJobIdJobManagerRunnerFactory(TEST_JOB_ID, createdJobManagerRunnerLatch)); jobMasterLeaderElectionService.isLeader(UUID.randomUUID()); DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); final BlockingJobVertex blockingJobVertex = new BlockingJobVertex("testVertex"); blockingJobVertex.setInvokableClass(NoOpInvokable.class); JobGraph blockingJobGraph = new JobGraph(TEST_JOB_ID, "blockingTestJob", blockingJobVertex); dispatcherGateway.submitJob(blockingJobGraph, TIMEOUT).get(); CompletableFuture<JobStatus> jobStatusFuture = dispatcherGateway.requestJobStatus(blockingJobGraph.getJobID(), TIMEOUT); Assert.assertEquals(JobStatus.INITIALIZING, jobStatusFuture.get()); boolean exceptionSeen = false; try { dispatcherGateway.triggerSavepoint(blockingJobGraph.getJobID(), "file:/ } catch (ExecutionException t) { Assert.assertTrue(t.getCause() instanceof UnavailableDispatcherOperationException); exceptionSeen = true; } Assert.assertTrue(exceptionSeen); blockingJobVertex.unblock(); }

Target:
public void testInvalidCallDuringInitialization() throws Exception { dispatcher = createAndStartDispatcher(heartbeatServices, haServices, new ExpectedJobIdJobManagerRunnerFactory(TEST_JOB_ID, createdJobManagerRunnerLatch)); jobMasterLeaderElectionService.isLeader(UUID.randomUUID()); DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); Tuple2<JobGraph, BlockingJobVertex> blockingJobGraph = getBlockingJobGraphAndVertex(); JobID jid = blockingJobGraph.f0.getJobID(); dispatcherGateway.submitJob(blockingJobGraph.f0, TIMEOUT).get(); assertThat(dispatcherGateway.requestJobStatus(jid, TIMEOUT).get(), is(JobStatus.INITIALIZING)); try { dispatcherGateway.triggerSavepoint(jid, "file:/ fail("Previous statement should have failed"); } catch (ExecutionException t) { assertTrue(t.getCause() instanceof UnavailableDispatcherOperationException); } blockingJobGraph.f1.unblock(); CommonTestUtils.waitUntilCondition(() -> dispatcherGateway.requestJobStatus(jobGraph.getJobID(), TIMEOUT).get() == JobStatus.RUNNING, Deadline.fromNow(Duration.of(10, ChronoUnit.SECONDS)), 5L); }
Source:
private void initializeProbabilityVector(MatrixLib p) { double[] pi = new double[p.numCols()]; this.logP = new double[p.numCols()]; double sum = 0.0; for (int i = 0; i < p.numCols(); i++) { double ele = p.elementAt(0, i); if (ele < 0) { throw new IllegalArgumentException("Probability " + ele + " for element " + i + " is negative."); } sum += p.elementAt(0, i); } if (sum < 1e-9) { throw new IllegalArgumentException("Probabilities sum to approx zero"); } for (int i = 0; i < p.numCols(); i++) { pi[i] = p.elementAt(0, i) / sum; this.logP[i] = Math.log(pi[i]); } this.p = pi; this.k = this.p.length; this.pCDF = new double[k]; pCDF[0] = this.p[0]; for (int i = 1; i < k; i++) { this.pCDF[i] = pCDF[i - 1] + this.p[i]; } }

Target:
private void initializeProbabilityVector(MatrixLib p) { double[] pi = new double[p.numCols()]; this.logP = new double[p.numCols()]; double sum = 0.0; for (int i = 0; i < p.numCols(); i++) { double ele = p.elementAt(0, i); if (ele < 0) { throw new IllegalArgumentException("Probability " + ele + " for element " + i + " is negative."); } sum += p.elementAt(0, i); } if (Util.closeToZero(sum)) { throw new IllegalArgumentException("Probabilities sum to approx zero"); } for (int i = 0; i < p.numCols(); i++) { pi[i] = p.elementAt(0, i) / sum; this.logP[i] = Math.log(pi[i]); } this.p = pi; this.k = this.p.length; this.pCDF = new double[k]; pCDF[0] = this.p[0]; for (int i = 1; i < k; i++) { this.pCDF[i] = pCDF[i - 1] + this.p[i]; } }
Source:
private void init(Object target, Method method) { final Map<Class<? extends Throwable>, Method> types = new HashMap<Class<? extends Throwable>, Method>(); final Method failingMethod = method; Retryable retryable = method.getAnnotation(Retryable.class); this.recoverMethodName = retryable != null ? retryable.recoverName() : ""; ReflectionUtils.doWithMethods(failingMethod.getDeclaringClass(), new MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { Recover recover = AnnotationUtils.findAnnotation(method, Recover.class); if (recover != null && method.getReturnType().isAssignableFrom(failingMethod.getReturnType())) { Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length > 0 && Throwable.class.isAssignableFrom(parameterTypes[0])) { @SuppressWarnings("unchecked") Class<? extends Throwable> type = (Class<? extends Throwable>) parameterTypes[0]; types.put(type, method); RecoverAnnotationRecoveryHandler.this.methods.put(method, new SimpleMetadata(parameterTypes.length, type)); } else { RecoverAnnotationRecoveryHandler.this.classifier.setDefaultValue(method); RecoverAnnotationRecoveryHandler.this.methods.put(method, new SimpleMetadata(parameterTypes.length, null)); } } } }); this.classifier.setTypeMap(types); optionallyFilterMethodsBy(failingMethod.getReturnType()); }

Target:
private void init(Object target, Method method) { final Map<Class<? extends Throwable>, Method> types = new HashMap<Class<? extends Throwable>, Method>(); final Method failingMethod = method; Retryable retryable = method.getAnnotation(Retryable.class); if (retryable != null) { this.recoverMethodName = retryable.recover(); } ReflectionUtils.doWithMethods(failingMethod.getDeclaringClass(), new MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { Recover recover = AnnotationUtils.findAnnotation(method, Recover.class); if (recover != null && method.getReturnType().isAssignableFrom(failingMethod.getReturnType())) { Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length > 0 && Throwable.class.isAssignableFrom(parameterTypes[0])) { @SuppressWarnings("unchecked") Class<? extends Throwable> type = (Class<? extends Throwable>) parameterTypes[0]; types.put(type, method); RecoverAnnotationRecoveryHandler.this.methods.put(method, new SimpleMetadata(parameterTypes.length, type)); } else { RecoverAnnotationRecoveryHandler.this.classifier.setDefaultValue(method); RecoverAnnotationRecoveryHandler.this.methods.put(method, new SimpleMetadata(parameterTypes.length, null)); } } } }); this.classifier.setTypeMap(types); optionallyFilterMethodsBy(failingMethod.getReturnType()); }
Source:
private String getListingOfDex(@Nonnull File dex) throws IOException { assert dex.isFile(); StringBuilder sb = new StringBuilder(); for (ClassDef def : new DexBuffer(dex).classDefs()) { String typeName = def.getTypeName(); sb.append(typeName); sb.append(":"); sb.append(TextUtils.LINE_SEPARATOR); } return sb.toString(); }

Target:
private String getListingOfDex(@Nonnull File dex) throws IOException { assert dex.isFile(); StringBuilder sb = new StringBuilder(); for (ClassDef def : new DexBuffer(dex).classDefs()) { sb.append(def.getTypeName()); sb.append(":"); sb.append(TextUtils.LINE_SEPARATOR); } return sb.toString(); }
Source:
private boolean handleLibvirtSecrets(CommandContext cmdContext, VDS vds, Guid poolId) { List<LibvirtSecret> libvirtSecrets = DbFacade.getInstance().getLibvirtSecretDao().getAllByStoragePoolIdFilteredByActiveStorageDomains(poolId); if (!libvirtSecrets.isEmpty() && !registerLibvirtSecretsImpl(vds, libvirtSecrets, false)) { setNonOperational(cmdContext, vds.getId(), NonOperationalReason.LIBVIRT_SECRETS_REGISTRATION_FAILURE); return false; } return true; }

Target:
private boolean handleLibvirtSecrets(CommandContext cmdContext, VDS vds, Guid poolId) { List<LibvirtSecret> libvirtSecrets = DbFacade.getInstance().getLibvirtSecretDao().getAllByStoragePoolIdFilteredByActiveStorageDomains(poolId); if (!libvirtSecrets.isEmpty() && !registerLibvirtSecretsImpl(vds, libvirtSecrets, false)) { log.error("Failed to register libvirt secret on vds {}.", vds.getName()); setNonOperational(cmdContext, vds.getId(), NonOperationalReason.LIBVIRT_SECRETS_REGISTRATION_FAILURE); return false; } return true; }
Source:
public void nullableStringFromNull() { assertThat(InternalQueries.nullableString(null)).isEqualTo(null); }

Target:
public void nullableStringFromNull() { assertThat(InternalQueries.nullableString(null)).isNull(); }