auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addListeners(ListModel<Label> labelList) { labelList.getItemsChangedEvent().addListener((ev, sender, args) -> { if (labelList.getSelectedItems() == null) { labelList.setSelectedItems(new ArrayList<>()); } getListWidget().refreshItems(); boolean labelsAvailable = labelList.getItems() != null && !labelList.getItems().isEmpty(); getAddSelectedItemButton().setEnabled(labelsAvailable); getSelectionWidget().getFilterListEditor().setEnabled(labelsAvailable); }); labelList.getSelectedItemsChangedEvent().addListener((ev, sender, args) -> { if (labelList.getSelectedItems() != null) { getListWidget().refreshItems(); } }); }

Target:
private void addListeners(ListModel<Label> labelList) { labelList.getItemsChangedEvent().addListener((ev, sender, args) -> { if (labelList.getSelectedItems() == null) { labelList.setSelectedItems(new ArrayList<>()); } getListWidget().refreshItems(); boolean labelsAvailable = !labelList.getItems().isEmpty(); getAddSelectedItemButton().setEnabled(labelsAvailable); getSelectionWidget().getFilterListEditor().setEnabled(labelsAvailable); }); labelList.getSelectedItemsChangedEvent().addListener((ev, sender, args) -> { if (labelList.getSelectedItems() != null) { getListWidget().refreshItems(); } }); }
Source:
private boolean setDrawableArtwork(Drawable drawable) { if(drawable instanceof BitmapDrawable) { return setArtworkFromBitmap(((BitmapDrawable) drawable)); } else { artworkView.setImageDrawable(drawable); } return true; }

Target:
private boolean setDrawableArtwork(Drawable drawable) { if(drawable != null) { artworkView.setImageDrawable(drawable); if(contentFrame != null) { contentFrame.setAspectRatio(0); } } return true; }
Source:
ConjureJerseyFeature() { TaggedMetricRegistry registry = DefaultTaggedMetricRegistry.getDefault(); ConjureServerMetrics conjureServerMetrics = ConjureServerMetrics.of(registry); this.internalExceptionMeter = conjureServerMetrics.exception(); }

Target:
ConjureJerseyFeature() { JerseyServerMetrics jerseyServerMetrics = JerseyServerMetrics.of(SharedTaggedMetricRegistries.getSingleton()); this.internalErrorMeter = jerseyServerMetrics.internalerrorAll(); }
Source:
public int getLeftX() { try { return (int) Math.round(Double.parseDouble(getPropertyValue(PROPERTY_NAME_X))); } catch (NumberFormatException e) { return 0; } }

Target:
public int getLeftX() { return x; }
Source:
public void update(ViewerCell cell) { Object element = cell.getElement(); int columnNumber = cell.getColumnIndex(); if (columnNumber == 0) { cell.setImage(getColumnImage(element, columnNumber)); cell.setText(getColumnText(element, columnNumber)); } else { if (columnNumber == 3) { cell.setText(getColumnText(element, columnNumber)); } else { cell.setImage(getColumnImage(element, columnNumber)); } } }

Target:
public void update(ViewerCell cell) { Object element = cell.getElement(); int columnNumber = cell.getColumnIndex(); if (columnNumber == DESCRIPTION_COLUMN) { cell.setImage(getColumnImage(element, columnNumber)); cell.setText(getColumnText(element, columnNumber)); } else { if (columnNumber == INCOMING_CHANGES_COLUMN) { cell.setText(getColumnText(element, columnNumber)); } else { cell.setImage(getColumnImage(element, columnNumber)); } } }
Source:
private Method getMethod(Class<?> testClass, String methodName) { try { return testClass.getMethod(methodName); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } }

Target:
private static Method getMethod(Class<?> testClass, String methodName) { try { return testClass.getMethod(methodName); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } }
Source:
public GMeterInfoDto makeGMeterInfoDto() { final GMeterInfoDto result = new GMeterInfoDto(1, "todo"); return result; }

Target:
public GMeterInfoDto makeGMeterInfoDto() { return new GMeterInfoDto(1, "EXXXX001692675614"); }
Source:
public ImmutableSet<Publisher> getEnabledReadSources() { return ImmutableSet.copyOf( Iterables.transform( Iterables.filter(this.getReads(), ENABLED_READS_FILTER), SOURCEREADS_TO_PUBLISHER)); }

Target:
public ImmutableSet<Publisher> getEnabledReadSources() { return this.enabledReadSources; }
Source:
public AirSweep(final Player player) { super(player); this.affectedEntities = new ArrayList<>(); this.tasks = new ArrayList<>(); if (!this.bPlayer.canBendIgnoreBindsCooldowns(this)) { return; } if (this.bPlayer.isOnCooldown(this)) { return; } this.damage = getConfig().getDouble("Abilities.Air.AirSweep.Damage"); this.range = getConfig().getDouble("Abilities.Air.AirSweep.Range"); this.speed = getConfig().getDouble("Abilities.Air.AirSweep.Speed"); this.knockback = getConfig().getDouble("Abilities.Air.AirSweep.Knockback"); this.cooldown = getConfig().getLong("Abilities.Air.AirSweep.Cooldown"); this.hitRadius = getConfig().getDouble("Abilities.Air.AirSweep.HitRadius"); if (this.bPlayer.isAvatarState()) { this.cooldown = 0; this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirSweep.Damage"); this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirSweep.Range"); this.knockback = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirSweep.Knockback"); } this.bPlayer.addCooldown(this); this.start(); }

Target:
public AirSweep(final Player player) { super(player); this.affectedEntities = new ArrayList<>(); this.tasks = new ArrayList<>(); if (!this.bPlayer.canBendIgnoreBindsCooldowns(this)) { return; } if (this.bPlayer.isOnCooldown(this)) { return; } this.damage = getConfig().getDouble("Abilities.Air.AirSweep.Damage"); this.range = getConfig().getDouble("Abilities.Air.AirSweep.Range"); this.speed = getConfig().getDouble("Abilities.Air.AirSweep.Speed"); this.knockback = getConfig().getDouble("Abilities.Air.AirSweep.Knockback"); this.cooldown = getConfig().getLong("Abilities.Air.AirSweep.Cooldown"); this.radius = getConfig().getDouble("Abilities.Air.AirSweep.Radius"); if (this.bPlayer.isAvatarState()) { this.cooldown = 0; this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirSweep.Damage"); this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirSweep.Range"); this.knockback = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirSweep.Knockback"); } this.bPlayer.addCooldown(this); this.start(); }
Source:
@Override public ClientClusterGroup forNodes(Collection<? extends ClusterNode> nodes) { A.notNull(nodes, "nodes"); ClientClusterGroupImpl grp = forProjectionFilters(projectionFilters.forNodeIds(new HashSet<>(F.nodeIds(nodes)))); grp.cachedNodes.putAll(nodes.stream().collect(Collectors.toMap(ClusterNode::id, Function.identity()))); return grp; }

Target:
@Override public ClientClusterGroup forNodes(Collection<? extends ClusterNode> nodes) { A.notNull(nodes, "nodes"); ClientClusterGroupImpl grp = forProjectionFilters(projectionFilters.forNodeIds(new HashSet<>(F.nodeIds(nodes)))); for (ClusterNode node : nodes) grp.cachedNodes.put(node.id(), node); return grp; }
Source:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setMetricsUpdateFrequency(METRIC_UPDATE_FREQUENCY); cfg.setCommunicationSpi(new TestRecordingCommunicationSpi()); boolean client = igniteInstanceName.startsWith("client"); cfg.setClientMode(client); return cfg; }

Target:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setCommunicationSpi(new TestRecordingCommunicationSpi()); cfg.setClientMode(igniteInstanceName.startsWith("client")); return cfg; }
Source:
public void refresh() { final Timer.Context context = m_loadFullTimer.time(); try { resetContainer(); m_nodeToOnmsSnmpMap = new HashMap<Integer, Map<Integer,OnmsSnmpInterface>>(); m_nodeToOnmsIpPrimaryMap = new HashMap<Integer, OnmsIpInterface>(); m_macToNodeidMap = new HashMap<String, Integer>(); m_macToOnmsIpMap = new HashMap<String, OnmsIpInterface>(); m_macToOnmsSnmpMap = new HashMap<String, OnmsSnmpInterface>(); doRefresh(); } finally { context.stop(); } LOG.info("refresh: Found groups", getGroups().size()); LOG.info("refresh: Found vertices", getVerticesWithoutGroups().size()); LOG.info("refresh: Found edges", getEdges().size()); }

Target:
public void refresh() { final Timer.Context context = m_loadFullTimer.time(); try { resetContainer(); m_nodeToOnmsSnmpMap.clear(); m_nodeToOnmsIpPrimaryMap.clear(); m_macToNodeidMap.clear(); m_macToOnmsIpMap.clear(); m_macToOnmsSnmpMap.clear(); doRefresh(); } finally { context.stop(); } LOG.info("refresh: Found groups", getGroups().size()); LOG.info("refresh: Found vertices", getVerticesWithoutGroups().size()); LOG.info("refresh: Found edges", getEdges().size()); }
Source:
public void load(List<List<Object>> batch) throws SQLException { for (List<Object> row : batch) { int pos = 1; for (Object value : row) { preparedStatement.setObject(pos, value); ++pos; } preparedStatement.addBatch(); } executeBatchWithVerification(preparedStatement, batch); }

Target:
public void load(List<List<Object>> batch) throws SQLException { if (batch.size() == 0) { return; } for (List<Object> row : batch) { checkArgument(row.size() == columnsCount, "Unexpected columns count: %d vs %d", row.size(), columnsCount); int pos = 1; for (Object value : row) { preparedStatement.setObject(pos, value); ++pos; } preparedStatement.addBatch(); } int[] insertCounts = preparedStatement.executeBatch(); for (int rowIndex = 0; rowIndex < insertCounts.length; ++rowIndex) { if (insertCounts[rowIndex] != 1) { throw new RuntimeException("could not insert values=" + batch.get(rowIndex)); } } }
Source:
public static void chunkedCopy(InputStream src, File dest) throws IOException { final RandomAccessFile raf = new RandomAccessFile(dest, "rwd"); final int fd = getfd(raf.getFD()); final byte[] buf = new byte[1024 * 1024 * 8]; int numBytes; long offset = 0; LOG.info("Started chunked copy to " + dest); while ((numBytes = src.read(buf)) > 0) { LOG.info("Writing " + numBytes + " at offset " + offset); raf.write(buf, 0, numBytes); trySkipCache(fd, offset, numBytes); offset = raf.getFilePointer(); } LOG.info("Done chunkedCopy"); raf.close(); }

Target:
public static void chunkedCopy(InputStream src, File dest) throws IOException { final byte[] buf = new byte[8 << 20]; long offset = 0; try ( final RandomAccessFile raf = new RandomAccessFile(dest, "rwd") ) { final int fd = getfd(raf.getFD()); for (int numBytes = 0, bytesRead = 0; bytesRead > -1; ) { bytesRead = src.read(buf, numBytes, buf.length - numBytes); if (numBytes >= buf.length || bytesRead == -1) { raf.write(buf, 0, numBytes); trySkipCache(fd, offset, numBytes); offset = raf.getFilePointer(); numBytes = 0; } numBytes += bytesRead; } } }
Source:
private List<String> determineListOfDownloadsToProcess() { List<String> list = new ArrayList<>(); if (!Config.getBoolConfigProperty(ConfigProperty.DOWNLOAD_DEPENDENCIES)) { return list; } if (SystemUtils.IS_OS_WINDOWS) { if (!checkForPresenceOf(ConfigProperty.SELENIUM_IEDRIVER_PATH, SeLionConstants.WEBDRIVER_IE_DRIVER_PROPERTY, SeLionConstants.IE_DRIVER)) { Config.setConfigProperty(ConfigProperty.SELENIUM_IEDRIVER_PATH, SeLionConstants.selionHomeDir + SeLionConstants.IE_DRIVER); list.add("iedriver"); } } if (!checkForPresenceOf(ConfigProperty.SELENIUM_CHROMEDRIVER_PATH, SeLionConstants.WEBDRIVER_CHROME_DRIVER_PROPERTY, SeLionConstants.CHROME_DRIVER)) { Config.setConfigProperty(ConfigProperty.SELENIUM_CHROMEDRIVER_PATH, SeLionConstants.selionHomeDir + SeLionConstants.CHROME_DRIVER); list.add("chromedriver"); } if (!checkForPresenceOf(ConfigProperty.SELENIUM_PHANTOMJS_PATH, SeLionConstants.WEBDRIVER_PHANTOMJS_DRIVER_PROPERTY, SeLionConstants.PHANTOMJS_DRIVER)) { Config.setConfigProperty(ConfigProperty.SELENIUM_PHANTOMJS_PATH, SeLionConstants.selionHomeDir + SeLionConstants.PHANTOMJS_DRIVER); list.add("phantomjs"); } return list; }

Target:
private List<String> determineListOfDownloadsToProcess() { List<String> list = new ArrayList<>(); if (!Config.getBoolConfigProperty(ConfigProperty.DOWNLOAD_DEPENDENCIES)) { return list; } if (SystemUtils.IS_OS_WINDOWS && !checkForPresenceOf(ConfigProperty.SELENIUM_IEDRIVER_PATH, SeLionConstants.WEBDRIVER_IE_DRIVER_PROPERTY, SeLionConstants.IE_DRIVER)) { Config.setConfigProperty(ConfigProperty.SELENIUM_IEDRIVER_PATH, SeLionConstants.SELION_HOME_DIR + SeLionConstants.IE_DRIVER); list.add("iedriver"); } if (!checkForPresenceOf(ConfigProperty.SELENIUM_CHROMEDRIVER_PATH, SeLionConstants.WEBDRIVER_CHROME_DRIVER_PROPERTY, SeLionConstants.CHROME_DRIVER)) { Config.setConfigProperty(ConfigProperty.SELENIUM_CHROMEDRIVER_PATH, SeLionConstants.SELION_HOME_DIR + SeLionConstants.CHROME_DRIVER); list.add("chromedriver"); } if (!checkForPresenceOf(ConfigProperty.SELENIUM_PHANTOMJS_PATH, SeLionConstants.WEBDRIVER_PHANTOMJS_DRIVER_PROPERTY, SeLionConstants.PHANTOMJS_DRIVER)) { Config.setConfigProperty(ConfigProperty.SELENIUM_PHANTOMJS_PATH, SeLionConstants.SELION_HOME_DIR + SeLionConstants.PHANTOMJS_DRIVER); list.add("phantomjs"); } return list; }
Source:
protected void link() { super.link(); try { BaseEntityRef.OnDelete deleteHandler = getBlobSoftRef().getDeleteHandler(); if (deleteHandler == BaseEntityRef.OnDelete.CASCADE) { getReferencedDescriptors().forEach(entityDescriptor -> entityDescriptor.addCascadeDeleteHandler(this::onDeleteCascade)); } else if (deleteHandler == BaseEntityRef.OnDelete.SET_NULL) { if (!isNullable()) { Mixing.LOG.WARN("Error in property %s of %s: The field is not marked as NullAllowed," + " therefore SET_NULL is not a valid delete handler!", this, getDescriptor()); } getReferencedDescriptors().forEach(entityDescriptor -> entityDescriptor.addCascadeDeleteHandler(this::onDeleteSetNull)); } else if (deleteHandler == BaseEntityRef.OnDelete.REJECT) { throw new IllegalArgumentException("BlobSoftRef references do not accept REJECT as deleteHandler."); } } catch (Exception e) { Mixing.LOG.WARN("Error when linking property %s of %s: %s (%s)", this, getDescriptor(), e.getMessage(), e.getClass().getSimpleName()); } }

Target:
protected void link() { super.link(); try { BaseEntityRef.OnDelete deleteHandler = getBlobSoftRef().getDeleteHandler(); if (deleteHandler == BaseEntityRef.OnDelete.CASCADE) { forEachBlobType(entityDescriptor -> entityDescriptor.addCascadeDeleteHandler(this::onDeleteCascade)); } else if (deleteHandler == BaseEntityRef.OnDelete.SET_NULL) { if (!isNullable()) { Mixing.LOG.WARN("Error in property %s of %s: The field is not marked as NullAllowed," + " therefore SET_NULL is not a valid delete handler!", this, getDescriptor()); } forEachBlobType(entityDescriptor -> entityDescriptor.addCascadeDeleteHandler(this::onDeleteSetNull)); } } catch (Exception e) { Mixing.LOG.WARN("Error when linking property %s of %s: %s (%s)", this, getDescriptor(), e.getMessage(), e.getClass().getSimpleName()); } }
Source:
private static <T extends Comparable<T>> IBlockState getReplantState(IBlockState sappyState) { if (hasRubberToHarvest(sappyState)) { for (Map.Entry<IProperty<?>, Comparable<?>> wetPropertyEntry : sappyState.getProperties().entrySet()) { if (wetPropertyEntry.getKey() instanceof PropertyBool && wetPropertyEntry.getKey().getName().equals("hassap")) { return sappyState.withProperty(PropertyBool.create("hassap"), false); } String valueWetString = wetPropertyEntry.getValue().toString(); String valueDryString = valueWetString.replace("wet", "dry"); IProperty<?> property = wetPropertyEntry.getKey(); IBlockState baseState = sappyState.getBlock().getBlockState().getBaseState(); IBlockState dryState = getStateWithValue(baseState, property, valueDryString); if (dryState != null) { return dryState; } } } return sappyState.getBlock().getDefaultState(); }

Target:
private static <T extends Comparable<T>> IBlockState getReplantState(IBlockState sappyState) { if (hasRubberToHarvest(sappyState)) { for (Map.Entry<IProperty<?>, Comparable<?>> wetPropertyEntry : sappyState.getProperties().entrySet()) { String valueWetString = wetPropertyEntry.getValue().toString(); String valueDryString = valueWetString.replace("wet", "dry"); IProperty<?> property = wetPropertyEntry.getKey(); if (property instanceof PropertyBool && property.getName().equals("hassap")) { return sappyState.withProperty(PropertyBool.create("hassap"), false); } IBlockState baseState = sappyState.getBlock().getBlockState().getBaseState(); IBlockState dryState = getStateWithValue(baseState, property, valueDryString); if (dryState != null) { return dryState; } } } return sappyState.getBlock().getDefaultState(); }
Source:
public int[] getAcceptableTokens() { return new int[] { TokenTypes.LITERAL_TRY, TokenTypes.LITERAL_IF, TokenTypes.LITERAL_ELSE, TokenTypes.LITERAL_SWITCH, TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF, TokenTypes.METHOD_DEF, TokenTypes.CTOR_DEF, TokenTypes.LITERAL_FOR, TokenTypes.LITERAL_WHILE, TokenTypes.LITERAL_DO, TokenTypes.STATIC_INIT, TokenTypes.INSTANCE_INIT, TokenTypes.ANNOTATION_DEF, TokenTypes.ENUM_DEF, }; }

Target:
public int[] getAcceptableTokens() { return new int[] { TokenTypes.ANNOTATION_ARRAY_INIT, TokenTypes.ANNOTATION_DEF, TokenTypes.ARRAY_INIT, TokenTypes.CASE_GROUP, TokenTypes.CLASS_DEF, TokenTypes.CTOR_DEF, TokenTypes.ENUM_CONSTANT_DEF, TokenTypes.ENUM_DEF, TokenTypes.INSTANCE_INIT, TokenTypes.INTERFACE_DEF, TokenTypes.LAMBDA, TokenTypes.LITERAL_CASE, TokenTypes.LITERAL_CATCH, TokenTypes.LITERAL_DEFAULT, TokenTypes.LITERAL_DO, TokenTypes.LITERAL_ELSE, TokenTypes.LITERAL_FINALLY, TokenTypes.LITERAL_FOR, TokenTypes.LITERAL_IF, TokenTypes.LITERAL_NEW, TokenTypes.LITERAL_SWITCH, TokenTypes.LITERAL_SYNCHRONIZED, TokenTypes.LITERAL_TRY, TokenTypes.LITERAL_WHILE, TokenTypes.METHOD_DEF, TokenTypes.SLIST, TokenTypes.STATIC_INIT, }; }
Source:
public List<Tree.Kind> nodesToVisit() { return Collections.singletonList(SWITCH_EXPRESSION); }

Target:
public List<Tree.Kind> nodesToVisit() { return Collections.singletonList(SWITCH_STATEMENT); }
Source:
public Batch getNextEmptyBatch() { for (;batches[emptyBatch].getNumEvents() != 0; emptyBatch = (emptyBatch + 1) % (poolSize)); return batches[emptyBatch]; }

Target:
public Batch getNextEmptyBatch() throws InterruptedException { synchronized(availableBatches) { while (availableBatches.isEmpty()) { availableBatches.wait(); } Integer batchIdx = availableBatches.pop(); return batches[batchIdx]; } }
Source:
public void createHost(UUID hostId, HostDirectory.Metadata metadata) throws StateAccessException, SerializationException { zk.multi(prepareCreate(hostId, metadata)); log.debug("Host was created successfully", hostId); }

Target:
public void createHost(UUID hostId, HostDirectory.Metadata metadata) throws StateAccessException, SerializationException { zk.multi(prepareCreate(hostId, metadata)); log.info("Host registered to NSDB", hostId); }
Source:
public void testNestedValid() { Validator validator = getValidator(); Set<ConstraintViolation<EmailAddressMap>> constraintViolations = validator.validate( EmailAddressMap.validEmailAddressMap() ); assertNumberOfViolations( constraintViolations, 0 ); constraintViolations = validator.validate( EmailAddressMap.invalidEmailAddressMap() ); assertNumberOfViolations( constraintViolations, 2 ); assertCorrectPropertyPaths( constraintViolations, "map[invalid].[1].email", "map[invalid].[2].email" ); assertCorrectConstraintTypes( constraintViolations, Email.class, Email.class ); }

Target:
public void testNestedValid() { Validator validator = getValidator(); Set<ConstraintViolation<EmailAddressMap>> constraintViolations = validator.validate( EmailAddressMap.validEmailAddressMap() ); assertNumberOfViolations( constraintViolations, 0 ); constraintViolations = validator.validate( EmailAddressMap.invalidEmailAddressMap() ); assertCorrectPropertyPaths( constraintViolations, "map[invalid].<map value>[1].email", "map[invalid].<map value>[2].email" ); assertCorrectConstraintTypes( constraintViolations, Email.class, Email.class ); assertThat( constraintViolations ).containsOnlyPaths( pathWith() .property( "map" ) .typeArgument( "<map value>", true, "invalid", null ) .property( "email", true, null, 1 ), pathWith() .property( "map" ) .typeArgument( "<map value>", true, "invalid", null ) .property( "email", true, null, 2 ) ); }
Source:
public void remove(final List<String> ids){ mLock.readLock().lock(); try { HashMap<String, Integer> itemsPositionMap = getPositionMap(mItems); boolean foundInItems = false; for (String id: ids){ if (itemsPositionMap.containsKey(id)){ foundInItems = true; break; } } if (!foundInItems){ return; } } finally{ mLock.readLock().unlock(); } mHandler.post(new Runnable() { @Override public void run() { final Lock writeLock = mLock.writeLock(); writeLock.lock(); HashSet<String> idsRemoved = new HashSet<String>(ids.size()); try { final ArrayList<Integer> indexesRemoved = new ArrayList<Integer>(ids.size()); HashMap<String, Integer> mItemsPositionMap = getPositionMap(mItems); for (String id : ids) { Integer index = mItemsPositionMap.get(id); if (index != null) { idsRemoved.add(id); indexesRemoved.add(index); } } final ArrayList<BoxItem> listWithoutRemovedIds = new ArrayList<BoxItem>(mItems.size() - idsRemoved.size()); for (BoxItem item : mItems) { if (!idsRemoved.contains(item.getId())) { listWithoutRemovedIds.add(item); } } boolean removedItems = false; if (indexesRemoved.size() <= REMOVE_LIMIT) { for (Integer index : indexesRemoved) { notifyItemRemoved(index); } removedItems = true; } mItems.clear(); mItems.addAll(listWithoutRemovedIds); if (removedItems && mItems.size() > 0) { notifyItemRangeChanged(0, mItems.size()); } else { notifyDataSetChanged(); } } finally { writeLock.unlock(); } } }); }

Target:
public void remove(final List<String> ids){ mLock.readLock().lock(); try { HashMap<String, Integer> itemsPositionMap = getPositionMap(mItems); boolean foundInItems = false; for (String id: ids){ if (itemsPositionMap.containsKey(id)){ foundInItems = true; break; } } if (!foundInItems){ return; } } finally{ mLock.readLock().unlock(); } mHandler.post(new Runnable() { @Override public void run() { final Lock writeLock = mLock.writeLock(); writeLock.lock(); HashSet<String> idsRemoved = new HashSet<String>(ids.size()); try { final ArrayList<Integer> indexesRemoved = new ArrayList<Integer>(ids.size()); HashMap<String, Integer> mItemsPositionMap = getPositionMap(mItems); for (String id : ids) { Integer index = mItemsPositionMap.get(id); if (index != null) { idsRemoved.add(id); indexesRemoved.add(index); } } final ArrayList<BoxItem> listWithoutRemovedIds = new ArrayList<BoxItem>(mItems.size() - idsRemoved.size()); for (BoxItem item : mItems) { if (!idsRemoved.contains(item.getId())) { listWithoutRemovedIds.add(item); } } boolean removedItems = false; if (indexesRemoved.size() <= REMOVE_LIMIT) { Collections.sort(indexesRemoved); for (int i=indexesRemoved.size() -1; i >= 0; i--){ notifyItemRemoved(indexesRemoved.get(i)); } removedItems = true; } mItems.clear(); mItems.addAll(listWithoutRemovedIds); if (removedItems && mItems.size() > 0) { notifyItemRangeChanged(0, mItems.size()); } else { notifyDataSetChanged(); } } finally { writeLock.unlock(); } } }); }
Source:
public BenchmarkSuite get() { BenchmarkSuite benchmarkSuite; ImmutableList.Builder<BenchmarkQuery> benchmarkQueries = ImmutableList.builder(); try (Handle handle = jdbi.open()) { BenchmarkSuiteDao benchmarkDao = handle.attach(BenchmarkSuiteDao.class); BenchmarkSuiteInfo benchmarkSuiteInfo = benchmarkDao.getBenchmarkSuiteInfo(suitesTableName, suite); benchmarkQueries.addAll(benchmarkDao.getBenchmarkQueries(queriesTableName, benchmarkSuiteInfo.getQuerySet())); benchmarkSuite = new BenchmarkSuite(benchmarkSuiteInfo, benchmarkQueries.build()); } return benchmarkSuite; }

Target:
public BenchmarkSuite get() { BenchmarkSuite benchmarkSuite; try (Handle handle = jdbi.open()) { BenchmarkSuiteDao benchmarkDao = handle.attach(BenchmarkSuiteDao.class); BenchmarkSuiteInfo benchmarkSuiteInfo = benchmarkDao.getBenchmarkSuiteInfo(suitesTableName, suite); benchmarkSuite = new BenchmarkSuite(benchmarkSuiteInfo, benchmarkDao.getBenchmarkQueries(queriesTableName, benchmarkSuiteInfo.getQuerySet())); } return benchmarkSuite; }
Source:
public static void onConfigChange(OnConfigChangedEvent cce) { if (BCModules.isBcMod(cce.getModID())) { EnumRestartRequirement req = EnumRestartRequirement.NONE; if (Loader.instance().isInState(LoaderState.AVAILABLE)) { req = EnumRestartRequirement.WORLD; } reloadConfig(req); } }

Target:
public static void onConfigChange(OnConfigChangedEvent cce) { if (BCModules.isBcMod(cce.getModID())) { reloadConfig(EnumRestartRequirement.NONE); } }
Source:
private static String readFromFile(String filePath) { String encoding = StandardCharsets.UTF_8.name(); String content = ""; File file = new File(filePath.trim()); if (file.isFile() && file.exists()) { try { content = FileUtils.readFileToString(file, encoding); } catch (IOException e) { LOGGER.error("Failed to read from File {}", filePath); throw new IllegalArgumentException("Failed to read from File " + filePath); } } else { throw new IllegalArgumentException(filePath + " is a directory or does not exist"); } return content; }

Target:
private static String readFromFile(String filePath) { String content = ""; File file = new File(filePath.trim()); if (file.isFile() && file.exists()) { try { content = FileUtils.readFileToString(file, StandardCharsets.UTF_8.name()); } catch (IOException e) { LOGGER.error("Failed to read from File {}", filePath); throw new IllegalArgumentException("Failed to read from File " + filePath); } } else { throw new IllegalArgumentException(filePath + " is a directory or does not exist"); } return content; }
Source:
public void testDefaults() { assertRecordedDefaults(recordDefaults(StaticMetastoreConfig.class) .setMetastoreUris(null).setHiveUserName(null)); }

Target:
public void testDefaults() { assertRecordedDefaults(recordDefaults(StaticMetastoreConfig.class) .setMetastoreUris(null) .setMetastoreUsername(null)); }
Source:
private TrieNode constructTrie(Map<String, InstanceConfig> instanceConfigMap, final String[] topologyKeys) { TrieNode rootNode = new TrieNode("", "ROOT"); Map<String, Map<String, String>> instanceDomainsMap = new HashMap<>(); instanceConfigMap.entrySet().forEach( entry -> instanceDomainsMap.put(entry.getKey(), entry.getValue().getDomainAsMap())); for (Map.Entry<String, Map<String, String>> entry : instanceDomainsMap.entrySet()) { TrieNode curNode = rootNode; String path = ""; for (int i = 0; i < topologyKeys.length; i++) { String key = topologyKeys[i] + CONNECTOR + entry.getValue().get(topologyKeys[i]); path = path + DELIMITER + key; TrieNode nextNode = curNode.getChildren().get(key); if (nextNode == null) { nextNode = new TrieNode(path, topologyKeys[i]); } curNode.addChild(key, nextNode); curNode = nextNode; } } return rootNode; }

Target:
private TrieNode constructTrie(Map<String, InstanceConfig> instanceConfigMap, final String[] topologyKeys) { TrieNode rootNode = new TrieNode("", "ROOT"); Map<String, Map<String, String>> instanceDomainsMap = new HashMap<>(); instanceConfigMap.entrySet().forEach( entry -> instanceDomainsMap.put(entry.getKey(), entry.getValue().getDomainAsMap())); for (Map.Entry<String, Map<String, String>> entry : instanceDomainsMap.entrySet()) { TrieNode curNode = rootNode; StringBuilder path = new StringBuilder(); for (int i = 0; i < topologyKeys.length; i++) { String key = topologyKeys[i] + CONNECTOR + entry.getValue().get(topologyKeys[i]); path.append(DELIMITER).append(key); TrieNode nextNode = curNode.getChildren().get(key); if (nextNode == null) { nextNode = new TrieNode(path.toString(), topologyKeys[i]); } curNode.addChild(key, nextNode); curNode = nextNode; } } return rootNode; }
Source:
public Object create(SimpleObject post, RequestContext context) throws ResponseException { TaskAction action = newDelegate(); setConvertedProperties(action, post, getCreatableProperties(), true); Collection<TaskDefinition> taskDefinitions; if (action.isAllTasks() != null && action.isAllTasks()) { taskDefinitions = taskFactoryWrapper.getRegisteredTasks(); action.setTasks(new ArrayList<TaskDefinition>(taskDefinitions)); } else { taskDefinitions = action.getTasks(); } ServletContext servletContext = getServletContext(context); if (action.getAction().equals("SCHEDULETASK") || action.getAction().equals("RESCHEDULETASK") || action.getAction().equals("DELETE") || action.getAction().equals("SHUTDOWNTASK")) { if (taskDefinitions == null || taskDefinitions.isEmpty()) { throw new IllegalRequestException("Cannot execute action " + action.getAction() + " on empty set of task definitions."); } } if (action.isAllTasks() == null || !action.isAllTasks()) { for (TaskDefinition taskDef : taskDefinitions) { if (taskDef == null) { throw new IllegalRequestException( "One or more of the modules you specified are not loaded on this server"); } } } switch (action.getAction()) { case SCHEDULETASK: scheduleTask(taskDefinitions); break; case RESCHEDULETASK: reScheduleTask(taskDefinitions); break; case DELETE: deleteTask(taskDefinitions); break; case SHUTDOWNTASK: shutDownTask(taskDefinitions); break; case RESCHEDULEALLTASK: reScheduleAllTask(); break; case ONSTARTUP: onStartUpTask(); break; case ONSHUTDOWN: onShutDownUpTask(); break; } return ConversionUtil.convertToRepresentation(action, Representation.DEFAULT); }

Target:
public Object create(SimpleObject post, RequestContext context) throws ResponseException { TaskAction action = newDelegate(); setConvertedProperties(action, post, getCreatableProperties(), true); Collection<TaskDefinition> taskDefinitions; if (action.isAllTasks()) { taskDefinitions = taskServiceWrapper.getRegisteredTasks(); action.setTasks(new ArrayList<TaskDefinition>(taskDefinitions)); } else { taskDefinitions = action.getTasks(); } TaskAction.Action actionType = action.getAction(); if (actionType != TaskAction.Action.RESCHEDULEALLTASKS) { if (taskDefinitions == null || taskDefinitions.isEmpty()) { throw new IllegalRequestException("Cannot execute action " + actionType + " on empty set of task definitions."); } } switch (action.getAction()) { case SCHEDULETASK: scheduleTasks(taskDefinitions); break; case RESCHEDULETASK: reScheduleTasks(taskDefinitions); break; case DELETE: deleteTasks(taskDefinitions); break; case SHUTDOWNTASK: shutDownTasks(taskDefinitions); break; case RESCHEDULEALLTASKS: reScheduleAllTasks(); break; } return ConversionUtil.convertToRepresentation(action, Representation.DEFAULT); }
Source:
public void emptyCheckPoint() throws Exception { final String streamA = "streamA"; final String streamB = "streamB"; Map<String, Long> mA = instantiateMap(streamA); Map<String, Long> mB = instantiateMap(streamB); final String author = "CPWriter"; final int iter = 1000; for (int x = 0; x < iter; x++) { mA.put(Integer.toString(x), (long) x); mB.put(Integer.toString(x), (long) x); } for (String key : mA.keySet()) { mA.remove(key); } MultiCheckpointWriter mcw1 = new MultiCheckpointWriter(); mcw1.addMap((SMRMap) mA); mcw1.addMap((SMRMap) mB); Token trimAddress = mcw1.appendCheckpoints(r, author); r.getAddressSpaceView().prefixTrim(trimAddress); r.getAddressSpaceView().gc(); r.getAddressSpaceView().invalidateServerCaches(); r.getAddressSpaceView().invalidateClientCache(); CorfuRuntime rt2 = getNewRuntime(getDefaultNode()).connect(); Map<String, Long> mA2 = rt2.getObjectsView() .build() .setStreamName(streamB) .setTypeToken(new TypeToken<SMRMap<String, Long>>() { }) .setSerializer(serializer) .open(); rt2.getObjectsView().TXBegin(); mA2.put("a", 2l); rt2.getObjectsView().TXEnd(); }

Target:
public void emptyCheckPoint() throws Exception { final String streamA = "streamA"; final String streamB = "streamB"; Map<String, Long> mA = instantiateMap(streamA); Map<String, Long> mB = instantiateMap(streamB); final String author = "CPWriter"; final int iter = 1000; for (int x = 0; x < iter; x++) { mA.put(Integer.toString(x), (long) x); mB.put(Integer.toString(x), (long) x); } for (String key : mA.keySet()) { mA.remove(key); } MultiCheckpointWriter mcw1 = new MultiCheckpointWriter(); mcw1.addMap((CorfuTable) mA); mcw1.addMap((CorfuTable) mB); Token trimAddress = mcw1.appendCheckpoints(r, author); r.getAddressSpaceView().prefixTrim(trimAddress); r.getAddressSpaceView().gc(); r.getAddressSpaceView().invalidateServerCaches(); r.getAddressSpaceView().invalidateClientCache(); CorfuRuntime rt2 = getNewRuntime(getDefaultNode()).connect(); Map<String, Long> mA2 = rt2.getObjectsView() .build() .setStreamName(streamA) .setTypeToken(new TypeToken<CorfuTable<String, Long>>() { }) .setSerializer(serializer) .open(); rt2.getObjectsView().TXBegin(); mA2.put("a", 2l); rt2.getObjectsView().TXEnd(); }
Source:
public boolean tryAdd(final EventData eventData) { if (eventData == null) { throw logger.logWarningAndThrow(new IllegalArgumentException("eventData cannot be null")); } final int size; try { size = getSize(eventData, events.isEmpty()); } catch (java.nio.BufferOverflowException exception) { throw logger.logWarningAndThrow(new AmqpException(false, ErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, String.format(Locale.US, "Size of the payload exceeded maximum message size: %s kb", maxMessageSize / 1024), contextProvider.getErrorContext())); } synchronized (lock) { if (this.sizeInBytes + size > this.maxMessageSize) { return false; } this.sizeInBytes += size; } this.events.add(eventData); return true; }

Target:
public boolean tryAdd(final EventData eventData) { if (eventData == null) { throw logger.logExceptionAsWarning(new IllegalArgumentException("eventData cannot be null")); } final int size; try { size = getSize(eventData, events.isEmpty()); } catch (BufferOverflowException exception) { throw logger.logExceptionAsWarning(new AmqpException(false, ErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, String.format(Locale.US, "Size of the payload exceeded maximum message size: %s kb", maxMessageSize / 1024), contextProvider.getErrorContext())); } synchronized (lock) { if (this.sizeInBytes + size > this.maxMessageSize) { return false; } this.sizeInBytes += size; } this.events.add(eventData); return true; }
Source:
private void showInstallationDetails(InstallationDTO installationDTO) { installationDetailsPanel.setInstallation(installationDTO); showDetailsView(installationDetailsPanel); }

Target:
private void showInstallationDetails(InstallationDTO installationDTO) { this.installationDetailsPanel.setInstallation(installationDTO); showDetailsView(this.installationDetailsPanel); }
Source:
public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } IndexEntryUpdate that = (IndexEntryUpdate) o; if ( entityId != that.entityId ) { return false; } if ( updateMode != that.updateMode ) { return false; } if ( !Arrays.equals( before, that.before ) ) { return false; } if ( !Arrays.equals( values, that.values ) ) { return false; } return descriptor != null ? descriptor.equals( that.descriptor ) : that.descriptor == null; }

Target:
public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } IndexEntryUpdate that = (IndexEntryUpdate) o; if ( entityId != that.entityId ) { return false; } if ( updateMode != that.updateMode ) { return false; } if ( !Arrays.deepEquals( before, that.before ) ) { return false; } if ( !Arrays.deepEquals( values, that.values ) ) { return false; } return descriptor != null ? descriptor.equals( that.descriptor ) : that.descriptor == null; }
Source:
protected void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == SEAT_APP_ACTIVITY && resultCode == RESULT_OK) { uiController.refreshForNewApp(); } }

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == SEAT_APP_ACTIVITY && resultCode == RESULT_OK) { uiController.refreshForNewApp(); } super.onActivityResult(requestCode, resultCode, intent); }
Source:
public void validationErrorsRequiredMetadataTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1") .withWorkflowGroup(1, admin).build(); EPerson submitter = EPersonBuilder.createEPerson(context) .withEmail("submitter@example.com") .withPassword("dspace") .build(); context.setCurrentUser(submitter); XmlWorkflowItem witem = WorkflowItemBuilder.createWorkflowItem(context, col1) .withTitle("Workflow Item 1") .withIssueDate("2017-10-17") .build(); XmlWorkflowItem witemMissingFields = WorkflowItemBuilder.createWorkflowItem(context, col1) .withTitle("Workflow Item 1") .build(); String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform(get("/api/workflow/worfklowitems/" + witem.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.status", is(true))) .andExpect(jsonPath("$.errors").doesNotExist()) ; getClient(authToken).perform(get("/api/workflow/worfklowitems/" + witemMissingFields.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.status", is(false))) .andExpect(jsonPath("$.errors[?(@.message=='error.validation.required')]", Matchers.contains( hasJsonPath("$.paths", Matchers.contains( hasJsonPath("$", Matchers.is("/sections/traditionalpageone/dc.date.issued")) ))))) ; }

Target:
public void validationErrorsRequiredMetadataTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1") .withWorkflowGroup(1, eperson).build(); EPerson submitter = EPersonBuilder.createEPerson(context) .withEmail("submitter@example.com") .withPassword("dspace") .build(); context.setCurrentUser(submitter); XmlWorkflowItem witem = WorkflowItemBuilder.createWorkflowItem(context, col1) .withTitle("Workflow Item 1") .withIssueDate("2017-10-17") .build(); XmlWorkflowItem witemMissingFields = WorkflowItemBuilder.createWorkflowItem(context, col1) .withTitle("Workflow Item 1") .build(); context.restoreAuthSystemState(); String authToken = getAuthToken(eperson.getEmail(), password); getClient(authToken).perform(get("/api/workflow/worfklowitems/" + witem.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.errors").doesNotExist()) ; getClient(authToken).perform(get("/api/workflow/worfklowitems/" + witemMissingFields.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.errors[?(@.message=='error.validation.required')]", Matchers.contains( hasJsonPath("$.paths", Matchers.contains( hasJsonPath("$", Matchers.is("/sections/traditionalpageone/dc.date.issued")) ))))) ; }
Source:
private void handleMissingResponse(Response response) { if (response instanceof UnsureResponse) { remoteGetAllHandler.onUnsureResponse(); } GlobalTransaction gtx = ctx.isInTxScope() ? ((TxInvocationContext) ctx).getGlobalTransaction() : null; Map<Object, Collection<Address>> contactedNodes = this.contactedNodes == null ? new HashMap<>() : this.contactedNodes; Map<Address, List<Object>> requestedKeys; synchronized (contactedNodes) { for (Object key : keys) { contactedNodes.computeIfAbsent(key, k -> new ArrayList<>(4)).add(target); } requestedKeys = getKeysByOwner(ctx, keys, checkTopologyId(command), null, contactedNodes); } synchronized (allFuture) { allFuture.counter += requestedKeys.size(); } for (Map.Entry<Address, List<Object>> pair : requestedKeys.entrySet()) { ClusteredGetAllCommand clusteredGetAllCommand = cf.buildClusteredGetAllCommand(pair.getValue(), command.getFlagsBitSet(), gtx); clusteredGetAllCommand.setTopologyId(command.getTopologyId()); keys.removeAll(pair.getValue()); Address target = pair.getKey(); rpcManager.invokeCommand(target, clusteredGetAllCommand, new MapResponseCollector(true, 1), rpcManager.getSyncRpcOptions()) .whenComplete(new ClusteredGetAllHandler(target, allFuture, ctx, command, pair.getValue(), contactedNodes, remoteGetAllHandler)); } if (!keys.isEmpty()) { synchronized (allFuture) { try { remoteGetAllHandler.onKeysLost(keys); } catch (Throwable t) { allFuture.completeExceptionally(t); } } } synchronized (allFuture) { if (--allFuture.counter == 0) { allFuture.complete(null); } } }

Target:
private void handleMissingResponse(Response response) { if (response instanceof UnsureResponse) { remoteGetAllHandler.onUnsureResponse(); } GlobalTransaction gtx = ctx.isInTxScope() ? ((TxInvocationContext) ctx).getGlobalTransaction() : null; Map<Object, Collection<Address>> contactedNodes = this.contactedNodes == null ? new HashMap<>() : this.contactedNodes; Map<Address, List<Object>> requestedKeys; synchronized (contactedNodes) { for (Object key : keys) { contactedNodes.computeIfAbsent(key, k -> new ArrayList<>(4)).add(target); } requestedKeys = getKeysByOwner(ctx, keys, checkTopologyId(command), null, contactedNodes); } synchronized (allFuture) { allFuture.counter += requestedKeys.size(); } for (Map.Entry<Address, List<Object>> pair : requestedKeys.entrySet()) { ClusteredGetAllCommand clusteredGetAllCommand = cf.buildClusteredGetAllCommand(pair.getValue(), command.getFlagsBitSet(), gtx); clusteredGetAllCommand.setTopologyId(command.getTopologyId()); keys.removeAll(pair.getValue()); Address target = pair.getKey(); rpcManager.invokeCommand(target, clusteredGetAllCommand, SingletonMapResponseCollector.ignoreLeavers(), rpcManager.getSyncRpcOptions()) .whenComplete(new ClusteredGetAllHandler(target, allFuture, ctx, command, pair.getValue(), contactedNodes, remoteGetAllHandler)); } if (!keys.isEmpty()) { synchronized (allFuture) { try { remoteGetAllHandler.onKeysLost(keys); } catch (Throwable t) { allFuture.completeExceptionally(t); } } } synchronized (allFuture) { if (--allFuture.counter == 0) { allFuture.complete(null); } } }
Source:
public Object getAdapter(Class adapter) { if (adapter.equals(ITerminateHandler.class)) return getSession().getModelAdapter(adapter); if (adapter.equals(IConnectHandler.class)) return getSession().getModelAdapter(adapter); if (adapter.equals(IDisconnectHandler.class)) return getSession().getModelAdapter(adapter); if (adapter.equals(IDebugNewExecutableHandler.class)) return getSession().getModelAdapter(adapter); Platform.getAdapterManager().loadAdapter(this, adapter.getName()); return super.getAdapter(adapter); }

Target:
public Object getAdapter(Class adapter) { if (adapter.equals(ITerminateHandler.class)) return getSession().getModelAdapter(adapter); if (adapter.equals(IDisconnectHandler.class)) return getSession().getModelAdapter(adapter); if (adapter.equals(IConnectHandler.class)) return getSession().getModelAdapter(adapter); if (adapter.equals(IDebugNewExecutableHandler.class)) return getSession().getModelAdapter(adapter); Platform.getAdapterManager().loadAdapter(this, adapter.getName()); return super.getAdapter(adapter); }
Source:
public ImmutableSpongeBodyPartRotationalData(Map<BodyPart, Vector3d> rotations) { super(ImmutableBodyPartRotationalData.class); this.rotations = ImmutableMap.copyOf(checkNotNull(rotations)); this.rotationsValue = new ImmutableSpongeMapValue<>(Keys.BODY_ROTATIONS, this.rotations); this.headRotationValue = new ImmutableSpongeValue<>(Keys.HEAD_ROTATION, this.rotations.get(BodyParts.HEAD)); this.chestRotationValue = new ImmutableSpongeValue<>(Keys.CHEST_ROTATION, this.rotations.get(BodyParts.CHEST)); this.leftArmRotationValue = new ImmutableSpongeValue<>(Keys.LEFT_ARM_ROTATION, this.rotations.get(BodyParts.LEFT_ARM)); this.rightArmRotationValue = new ImmutableSpongeValue<>(Keys.RIGHT_ARM_ROTATION, this.rotations.get(BodyParts.RIGHT_ARM)); this.leftLegRotationValue = new ImmutableSpongeValue<>(Keys.LEFT_LEG_ROTATION, this.rotations.get(BodyParts.LEFT_LEG)); this.rightLegRotationValue = new ImmutableSpongeValue<>(Keys.RIGHT_LEG_ROTATION, this.rotations.get(BodyParts.RIGHT_LEG)); registerGetters(); }

Target:
public ImmutableSpongeBodyPartRotationalData(Map<BodyPart, Vector3d> rotations) { super(ImmutableBodyPartRotationalData.class); this.rotations = ImmutableMap.copyOf(checkNotNull(rotations, "rotations")); this.rotationsValue = new ImmutableSpongeMapValue<>(Keys.BODY_ROTATIONS, this.rotations); this.headRotationValue = new ImmutableSpongeValue<>(Keys.HEAD_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.HEAD)).orElse(DataConstants.DEFAULT_HEAD_ROTATION)); this.chestRotationValue = new ImmutableSpongeValue<>(Keys.CHEST_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.CHEST)).orElse(DataConstants.DEFAULT_CHEST_ROTATION)); this.leftArmRotationValue = new ImmutableSpongeValue<>(Keys.LEFT_ARM_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.LEFT_ARM)).orElse(DataConstants.DEFAULT_LEFT_ARM_ROTATION)); this.rightArmRotationValue = new ImmutableSpongeValue<>(Keys.RIGHT_ARM_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.RIGHT_ARM)).orElse(DataConstants.DEFAULT_RIGHT_ARM_ROTATION)); this.leftLegRotationValue = new ImmutableSpongeValue<>(Keys.LEFT_LEG_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.LEFT_LEG)).orElse(DataConstants.DEFAULT_LEFT_LEG_ROTATION)); this.rightLegRotationValue = new ImmutableSpongeValue<>(Keys.RIGHT_LEG_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.RIGHT_LEG)).orElse(DataConstants.DEFAULT_RIGHT_LEG_ROTATION)); registerGetters(); }
Source:
protected void processEvent(EventObject event) { Assert.notNull(event, "event must not be null"); if (getCacheEventTypeSet().contains(((ItemEvent<E>) event).getEventType().toString())) { sendMessage(event, ((ItemEvent<E>) event).getMember().getSocketAddress(), getCacheListeningPolicy()); } }

Target:
protected void processEvent(EventObject event) { Assert.notNull(event, "event must not be null"); if (getCacheEvents().contains(((ItemEvent<E>) event).getEventType().toString())) { sendMessage(event, ((ItemEvent<E>) event).getMember().getSocketAddress(), getCacheListeningPolicy()); } if (logger.isDebugEnabled()){ logger.debug("Received ItemEvent : " + event); } }
Source:
private static boolean isList(Type type) { if (type instanceof ParameterizedType) { Type rawType = ((ParameterizedType) type).getRawType(); return List.class.isAssignableFrom((Class<?>) rawType); } return false; }

Target:
private static boolean isList(Type type) { if (!(type instanceof ParameterizedType)) { return false; } Type rawType = ((ParameterizedType) type).getRawType(); return List.class.isAssignableFrom((Class<?>) rawType); }
Source:
protected final void initialize(final WishlistViewModel viewModel, final ShoppingList wishlist) { if (wishlist != null) { fillTitle(viewModel, wishlist); final List<LineItem> lineItems = wishlist.getLineItems(); fillQuantity(viewModel, lineItems); fillLineItems(viewModel, lineItems); } }

Target:
protected final void initialize(final WishlistViewModel viewModel, final ShoppingList wishlist) { fillTitle(viewModel, wishlist); fillQuantity(viewModel, wishlist); fillLineItems(viewModel, wishlist); }
Source:
public void waitForServiceToBeAvailable(long maxWaitTime, String servicePid) throws SynchronizedInstallerException, InterruptedException { ServiceTracker st = getServiceTracker(bundleContext, getServiceIdFilter(servicePid)); st.open(true); Callable<Boolean> isServiceAvailable = () -> { LOGGER.debug("Waiting for service with pid to be registered", servicePid); return st.getService() != null; }; try { wait( isServiceAvailable, maxWaitTime, DEFAULT_POLLING_INTERVAL, "Managed service failed to appear after [" + maxWaitTime + "] ms."); } finally { st.close(); } }

Target:
public void waitForServiceToBeAvailable(long maxWaitTime, String servicePid) throws InterruptedException { ServiceTracker st = getServiceTracker(bundleContext, getServiceIdFilter(servicePid)); st.open(true); Callable<Boolean> isServiceAvailable = () -> { LOGGER.trace("Waiting for service with pid to be registered", servicePid); return st.getService() != null; }; try { wait( isServiceAvailable, maxWaitTime, DEFAULT_POLLING_INTERVAL, "Managed service failed to appear after [" + maxWaitTime + "] ms."); } finally { st.close(); } }