auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static synchronized boolean isWordPressCom(URL url) { if (url == null) { return false; } return url.getHost().endsWith(".wordpress.com") || url.getHost().equals("wordpress.com"); }

Target:
public static boolean isWordPressCom(URL url) { if (url == null) { return false; } return url.getHost().endsWith(".wordpress.com") || url.getHost().equals("wordpress.com"); }
Source:
private void registerReceivers() { this.broadcastRegistrar = new BroadcastRegistrar(); this.broadcastRegistrar .addLocalAction(ConnectionService.ACTION_HOST_CONNECTED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { joinView.setEnabled(true); joinView.findViewById(R.id.searching).setVisibility(View.INVISIBLE); Transitions.transitionToHome((CoreActivity)getActivity()); ((CoreActivity)getActivity()).enableSlidingMenu(); ((CoreActivity)getActivity()).showPlaybar(); } }) .addGlobalAction(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { int mode = intent.getIntExtra( BluetoothAdapter.EXTRA_SCAN_MODE, BluetoothAdapter.SCAN_MODE_NONE); if(joinView != null){ switch(mode){ case BluetoothAdapter.SCAN_MODE_NONE: isSearching = false; setJoinToDefaultState(); break; case BluetoothAdapter.SCAN_MODE_CONNECTABLE: isSearching = false; setJoinToDefaultState(); break; case BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE: isSearching = true; setJoinToSearchingState(); break; default: Log.wtf(TAG, "Recieved scan mode changed with unknown mode"); break; } } } }) .register(this.getActivity()); }

Target:
private void registerReceivers() { this.broadcastRegistrar = new BroadcastRegistrar(); this.broadcastRegistrar .addLocalAction(ConnectionService.ACTION_HOST_CONNECTED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { joinView.setEnabled(true); joinView.findViewById(R.id.searching).setVisibility(View.INVISIBLE); Transitions.transitionToHome((CoreActivity)getActivity()); ((CoreActivity)getActivity()).enableSlidingMenu(); ((CoreActivity)getActivity()).showPlaybar(); } }) .addGlobalAction(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { int mode = intent.getIntExtra( BluetoothAdapter.EXTRA_SCAN_MODE, BluetoothAdapter.SCAN_MODE_NONE); if(joinView != null){ switch(mode){ case BluetoothAdapter.SCAN_MODE_NONE: case BluetoothAdapter.SCAN_MODE_CONNECTABLE: isSearching = false; setJoinToDefaultState(); break; case BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE: isSearching = true; setJoinToSearchingState(); break; default: Log.wtf(TAG, "Recieved scan mode changed with unknown mode"); break; } } } }) .register(this.getActivity()); }
Source:
private RenderChunk getRenderChunkOffset(BlockPos playerPos, RenderChunk renderChunkBase, EnumFacing facing) { BlockPos blockpos = renderChunkBase.getBlockPosOffset16(facing); return MathHelper.abs(playerPos.getX() - blockpos.getX()) > this.renderDistanceChunks * Cube.SIZE ? null : MathHelper.abs(playerPos.getY() - blockpos.getY()) > this.renderDistanceChunks * Cube.SIZE ? null : MathHelper.abs(playerPos.getZ() - blockpos.getZ()) > this.renderDistanceChunks * Cube.SIZE ? null : this.viewFrustum.getRenderChunk(blockpos); }

Target:
private RenderChunk getRenderChunkOffset(BlockPos playerPos, RenderChunk renderChunkBase, EnumFacing facing) { BlockPos blockpos = renderChunkBase.getBlockPosOffset16(facing); return MathHelper.abs(playerPos.getX() - blockpos.getX()) > this.renderDistanceChunks * 16 ? null : MathHelper.abs(playerPos.getY() - blockpos.getY()) > this.renderDistanceChunks * 16 ? null : MathHelper.abs(playerPos.getZ() - blockpos.getZ()) > this.renderDistanceChunks * 16 ? null : this.viewFrustum.getRenderChunk(blockpos); }
Source:
public void testInsert() throws Exception { int key = UUID.randomUUID().hashCode(); StatementProvider stmt = of("INSERT INTO " + TEST_DML_TABLE + "(_key, _val) VALUES (" + key + ", 0);"); assertAuthorizationFailed(stmt, EMPTY_PERMS_USER); assertAuthorizationFailed(stmt, CACHE_READ_USER); assertAuthorizationFailed(stmt, CACHE_REMOVE_USER); execute(stmt, CACHE_PUT_USER); }

Target:
public void testInsert() throws Exception { int key = KEY_CNTR.getAndIncrement(); String sql = "INSERT INTO " + TEST_DML_TABLE + "(_key, _val) VALUES (" + key + ", 0);"; assertAuthorizationFailed(sql, EMPTY_PERMS_USER); assertAuthorizationFailed(sql, CACHE_READ_USER); assertAuthorizationFailed(sql, CACHE_REMOVE_USER); execute(sql, CACHE_PUT_USER); }
Source:
public ArgumentSplitter(String arguments) { this.arguments = arguments; }

Target:
private ArgumentSplitter(String arguments) { this.arguments = arguments; }
Source:
public Map<String, String> getprop() throws IOException, JadbException { BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new InputStreamReader(device.executeShell("getprop"))); return parseProp(bufferedReader); } finally { if (bufferedReader != null) { bufferedReader.close(); } } }

Target:
public Map<String, String> getprop() throws IOException, JadbException { try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(device.executeShell("getprop")))) { return parseProp(bufferedReader); } }
Source:
private List<GlusterVolumeEntity> getAllGlusterVolumesWithMasterCompatibleVersion(Guid masterVolumeId) { GlusterVolumeEntity masterVolume = getGlusterVolumeDao().getById(masterVolumeId); VDSGroup masterCluster = getVdsGroupDao().get(masterVolume.getClusterId()); List<VDSGroup> clusters = getVdsGroupDao().getClustersByServiceAndCompatibilityVersion(true, false, masterCluster.getcompatibility_version().getValue()); List<GlusterVolumeEntity> volumes = new ArrayList<GlusterVolumeEntity>(); if(clusters != null) { for(VDSGroup currentCluster : clusters) { volumes.addAll(getGlusterVolumeDao().getByClusterId(currentCluster.getId())); } } volumes.remove(masterVolume); return volumes; }

Target:
private List<GlusterVolumeEntity> getAllGlusterVolumesWithMasterCompatibleVersion(Guid masterVolumeId) { GlusterVolumeEntity masterVolume = getGlusterVolumeDao().getById(masterVolumeId); VDSGroup masterCluster = getVdsGroupDao().get(masterVolume.getClusterId()); List<VDSGroup> clusters = getVdsGroupDao().getGeoRepEligibleVdsGroups(masterCluster.getId(), masterCluster.getcompatibility_version().getValue()); List<GlusterVolumeEntity> volumes = new ArrayList<GlusterVolumeEntity>(); if(clusters != null) { for(VDSGroup currentCluster : clusters) { volumes.addAll(getGlusterVolumeDao().getByClusterId(currentCluster.getId())); } } return volumes; }
Source:
private Long determineImageInitialSize(Image sourceImage, VolumeFormat destFormat, Guid storagePoolId, Guid srcDomain, Guid dstDomain, Guid imageGroupID) { if (storageDomainDao.get(dstDomain).getStorageType().isBlockDomain() && Guid.Empty.equals(sourceImage.getParentId())) { MeasureVolumeParameters parameters = new MeasureVolumeParameters(storagePoolId, srcDomain, imageGroupID, sourceImage.getId(), destFormat.getValue()); parameters.setEndProcedure(EndProcedure.COMMAND_MANAGED); parameters.setParentCommand(getActionType()); ActionReturnValue actionReturnValue = runInternalAction(ActionType.MeasureVolume, parameters); if (!actionReturnValue.getSucceeded()) { throw new RuntimeException("Could not measure volume"); } return actionReturnValue.getActionReturnValue(); } if (imagesHandler.isInitialSizeSupportedForFormat(destFormat, dstDomain)) { DiskImage imageInfoFromStorage = imagesHandler.getVolumeInfoFromVdsm(storagePoolId, srcDomain, imageGroupID, sourceImage.getId()); return imagesHandler.computeCowImageNeededSize(sourceImage.getVolumeFormat(), imageInfoFromStorage.getActualSizeInBytes()); } return null; }

Target:
private Long determineImageInitialSize(Image sourceImage, VolumeFormat destFormat, Guid storagePoolId, Guid srcDomain, Guid dstDomain, Guid imageGroupID) { if (storageDomainDao.get(dstDomain).getStorageType().isBlockDomain() && Guid.Empty.equals(sourceImage.getParentId())) { MeasureVolumeParameters parameters = new MeasureVolumeParameters(storagePoolId, srcDomain, imageGroupID, sourceImage.getId(), destFormat.getValue()); parameters.setEndProcedure(EndProcedure.COMMAND_MANAGED); parameters.setParentCommand(getActionType()); ActionReturnValue actionReturnValue = runInternalAction(ActionType.MeasureVolume, parameters); if (!actionReturnValue.getSucceeded()) { throw new RuntimeException("Could not measure volume"); } return actionReturnValue.getActionReturnValue(); } if (imagesHandler.isInitialSizeSupportedForFormat(destFormat, dstDomain)) { DiskImage imageInfoFromStorage = imagesHandler.getVolumeInfoFromVdsm(storagePoolId, srcDomain, imageGroupID, sourceImage.getId()); return ImagesHandler.computeCowImageNeededSize(sourceImage.getVolumeFormat(), imageInfoFromStorage.getActualSizeInBytes()); } return null; }
Source:
private static boolean isLog4jOrSpringAssertNotNull(Symbol symbol) { Type ownerType = symbol.owner().type(); return (ownerType.is("org.apache.logging.log4j.core.util.Assert") && "requireNonNull".equals(symbol.name())) || (ownerType.is("org.springframework.util.Assert") && "notNull".equals(symbol.name())); }

Target:
private static boolean isLog4jOrSpringAssertNotNull(Symbol symbol) { Type ownerType = symbol.owner().type(); return (ownerType.is("org.apache.logging.log4j.core.util.Assert") && "requireNonNull".equals(symbol.name())) || (ownerType.is("org.springframework.util.Assert") && ("notNull".equals(symbol.name()) || "notEmpty".equals(symbol.name()))); }
Source:
public List<Kind> nodesToVisit() { return ImmutableList.of(Tree.Kind.CLASS); }

Target:
public List<Kind> nodesToVisit() { return ImmutableList.of(Tree.Kind.CLASS, Tree.Kind.ENUM, Tree.Kind.ANNOTATION_TYPE); }
Source:
private List<TopMenu.MenuItem> my(ProjectState allProjects) { List<TopMenu.MenuItem> my = new ArrayList<TopMenu.MenuItem>(); Config cfg = allProjects.getConfig(PREFERENCES, REFS_META_USER).get(); for (String subsection : cfg.getSubsections(MY)) { my.add(new TopMenu.MenuItem(subsection, my(cfg, subsection, KEY_URL, "#/"), my(cfg, subsection, KEY_TARGET, null), my(cfg, subsection, KEY_ID, null))); } if (my.isEmpty()) { my.add(new TopMenu.MenuItem("Changes", "#/", "")); my.add(new TopMenu.MenuItem("Drafts", "#/q/is:draft", "")); my.add(new TopMenu.MenuItem("Draft Comments", "#/q/has:draft", "")); my.add(new TopMenu.MenuItem("Watched Changes", "#/q/is:watched+is:open", "")); my.add(new TopMenu.MenuItem("Starred Changes", "#/q/is:starred", "")); } return my; }

Target:
private List<TopMenu.MenuItem> my(ProjectState allProjects) { List<TopMenu.MenuItem> my = new ArrayList<>(); Config cfg = allProjects.getConfig(PREFERENCES, REFS_META_USER).get(); for (String subsection : cfg.getSubsections(MY)) { my.add(new TopMenu.MenuItem(subsection, my(cfg, subsection, KEY_URL, "#/"), my(cfg, subsection, KEY_TARGET, null), my(cfg, subsection, KEY_ID, null))); } if (my.isEmpty()) { my.add(new TopMenu.MenuItem("Changes", "#/", "")); my.add(new TopMenu.MenuItem("Drafts", "#/q/is:draft", "")); my.add(new TopMenu.MenuItem("Draft Comments", "#/q/has:draft", "")); my.add(new TopMenu.MenuItem("Watched Changes", "#/q/is:watched+is:open", "")); my.add(new TopMenu.MenuItem("Starred Changes", "#/q/is:starred", "")); } return my; }
Source:
public <K, V> TransactionContext<K, V> enlist(TransactionalRemoteCacheImpl<K, V> txRemoteCache, Transaction tx) { SynchronizationAdapter adapter = registeredTransactions.computeIfAbsent(tx, this::createSynchronizationAdapter); TransactionContext<K, V> context = adapter.registerCache(txRemoteCache); if (trace) { log.tracef("Xid=%s retrieving context: %s", adapter.xid, context); } return context; }

Target:
public <K, V> TransactionContext<K, V> enlist(TransactionalRemoteCacheImpl<K, V> txRemoteCache, Transaction tx) { SynchronizationAdapter adapter = registeredTransactions.computeIfAbsent(tx, constructor); TransactionContext<K, V> context = adapter.registerCache(txRemoteCache); if (trace) { log.tracef("Xid=%s retrieving context: %s", adapter.xid, context); } return context; }
Source:
private void performDiskUpdate(final boolean unlockImage) { if (isMetaDataPropertiesChangedForDiskImage()) { updateMetaDataDescription((DiskImage) getNewDisk()); } final Disk disk = getDiskDao().get(getParameters().getDiskId()); applyUserChanges(disk); TransactionSupport.executeInNewTransaction(new TransactionMethod<Object>() { @Override public Object runInTransaction() { getVmStaticDAO().incrementDbGeneration(getVm().getId()); updateDeviceProperties(); getBaseDiskDao().update(disk); if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { DiskImage diskImage = (DiskImage) disk; diskImage.setQuotaId(getQuotaId()); if (unlockImage && diskImage.getImageStatus() == ImageStatus.LOCKED) { diskImage.setImageStatus(ImageStatus.OK); } getImageDao().update(diskImage.getImage()); updateQuota(diskImage); updateDiskProfile(); } reloadDisks(); updateBootOrder(); setSucceeded(true); return null; } private void updateDeviceProperties() { if (updateReadOnlyRequested()) { vmDeviceForVm.setIsReadOnly(getNewDisk().getReadOnly()); getVmDeviceDao().update(vmDeviceForVm); } if (getOldDisk().getDiskInterface() != getNewDisk().getDiskInterface()) { getVmDeviceDao().clearDeviceAddress(getOldDisk().getId()); } } }); }

Target:
private void performDiskUpdate(final boolean unlockImage) { if (shouldPerformMetadataUpdate()) { updateMetaDataDescription((DiskImage) getNewDisk()); } final Disk disk = getDiskDao().get(getParameters().getDiskId()); applyUserChanges(disk); TransactionSupport.executeInNewTransaction(new TransactionMethod<Object>() { @Override public Object runInTransaction() { getVmStaticDAO().incrementDbGeneration(getVm().getId()); updateDeviceProperties(); getBaseDiskDao().update(disk); if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { DiskImage diskImage = (DiskImage) disk; diskImage.setQuotaId(getQuotaId()); if (unlockImage && diskImage.getImageStatus() == ImageStatus.LOCKED) { diskImage.setImageStatus(ImageStatus.OK); } getImageDao().update(diskImage.getImage()); updateQuota(diskImage); updateDiskProfile(); } reloadDisks(); updateBootOrder(); setSucceeded(true); return null; } private void updateDeviceProperties() { if (updateReadOnlyRequested()) { vmDeviceForVm.setIsReadOnly(getNewDisk().getReadOnly()); getVmDeviceDao().update(vmDeviceForVm); } if (getOldDisk().getDiskInterface() != getNewDisk().getDiskInterface()) { getVmDeviceDao().clearDeviceAddress(getOldDisk().getId()); } } }); }
Source:
@Override public void load(Request request, int networkPolicy, Callback callback) { try { InputStream is = getInputStream(request); if (is == null) { callback.onError(new IOException("no contact found")); } else { callback.onSuccess(new Result(Okio.source(is), DISK)); } } catch (Exception e) { callback.onError(e); } }

Target:
@Override public void load(Request request, int networkPolicy, Callback callback) { boolean signaledCallback = false; try { InputStream is = getInputStream(request); if (is == null) { signaledCallback = true; callback.onError(new IOException("no contact found")); } else { signaledCallback = true; callback.onSuccess(new Result(Okio.source(is), DISK)); } } catch (Exception e) { if (!signaledCallback) { callback.onError(e); } } }
Source:
public boolean isApplicableForMlx(CloudSubnet cloudSubnet) { return cloudSubnet.getType() == null || PUBLIC.equals(cloudSubnet.getType()) || SubnetType.PRIVATE.equals(cloudSubnet.getType()) || SubnetType.MLX.equals(cloudSubnet.getType()); }

Target:
public boolean isApplicableForMlx(CloudSubnet cloudSubnet) { return cloudSubnet.getType() == null || PUBLIC.equals(cloudSubnet.getType()) || PRIVATE.equals(cloudSubnet.getType()) || MLX.equals(cloudSubnet.getType()); }
Source:
private List<AbstractNode> getPrecedingSiblings() { final List<AbstractNode> siblings = new ArrayList<>(); for (int i = positionAmongSiblings - 1; i >= 0; i--) { final AbstractNode preceding = parent.getChildren().get(i); siblings.add(preceding); } return siblings; }

Target:
private List<AbstractNode> getPrecedingSiblings() { final List<AbstractNode> siblings = parent.getChildren(); return siblings.subList(0, indexAmongSiblings); }
Source:
public void registerCallback(String importer, ChannelChangeCallback callback) { Preconditions.checkArgument( importer != null && !importer.trim().isEmpty(), "importer is null or empty" ); callback = checkNotNull(callback, "callback is null"); if (m_done.get()) return; int stamp = new int[]{0}; NavigableMap<String,ChannelChangeCallback> prev = null; NavigableMap<String,ChannelChangeCallback> next = null; ImmutableSortedMap.Builder<String,ChannelChangeCallback> mbldr = null; synchronized (m_undispatched) { do { prev = m_callbacks.get(stamp); mbldr = ImmutableSortedMap.naturalOrder(); mbldr.putAll(Maps.filterKeys(prev, not(equalTo(importer)))); mbldr.put(importer, callback); next = mbldr.build(); } while (!m_callbacks.compareAndSet(prev, next, stamp[0], stamp[0]+1)); NavigableSet<String> registered = next.navigableKeySet(); Iterator<ImporterChannelAssignment> itr = m_undispatched.iterator(); while (itr.hasNext()) { final ImporterChannelAssignment assignment = itr.next(); if (registered.contains(assignment.getImporter())) { final ChannelChangeCallback dispatch = next.get(assignment.getImporter()); if (dispatch.canAcceptAssignments()) { m_buses.submit(new DistributerRunnable() { @Override public void susceptibleRun() throws Exception { dispatch.onChange(assignment); } }); itr.remove(); } else { LOG.debug("importer " + dispatch + " is stopping, not sending the assigment " + assignment); } } } } }

Target:
public void registerCallback(String importer, ChannelChangeCallback callback) { Preconditions.checkArgument( importer != null && !importer.trim().isEmpty(), "importer is null or empty" ); Preconditions.checkArgument( !m_unregistered.getReference().contains(importer), "cannot re-register importer %s as it was already unregistered", importer ); callback = checkNotNull(callback, "callback is null"); if (m_done.get()) return; int stamp = new int[]{0}; NavigableMap<String,ChannelChangeCallback> prev = null; NavigableMap<String,ChannelChangeCallback> next = null; ImmutableSortedMap.Builder<String,ChannelChangeCallback> mbldr = null; synchronized (m_undispatched) { do { prev = m_callbacks.get(stamp); mbldr = ImmutableSortedMap.naturalOrder(); mbldr.putAll(Maps.filterKeys(prev, not(equalTo(importer)))); mbldr.put(importer, callback); next = mbldr.build(); } while (!m_callbacks.compareAndSet(prev, next, stamp[0], stamp[0]+1)); NavigableSet<String> registered = next.navigableKeySet(); NavigableSet<String> unregistered = m_unregistered.getReference(); Iterator<ImporterChannelAssignment> itr = m_undispatched.iterator(); while (itr.hasNext()) { final ImporterChannelAssignment assignment = itr.next(); if (registered.contains(assignment.getImporter())) { final ChannelChangeCallback dispatch = next.get(assignment.getImporter()); m_buses.submit(new DistributerRunnable() { @Override public void susceptibleRun() throws Exception { dispatch.onChange(assignment); } }); itr.remove(); } else if (unregistered.contains(assignment.getImporter())) { itr.remove(); if (!assignment.getAdded().isEmpty()) { LOG.warn("(" + m_hostId + ") discarding assignment to unregistered importer " + assignment); } } } } }
Source:
public int hashCode() { return Objects.hash(storageDomainId, imageGroupId, baseImageId, topImageId, baseImageGeneration, baseImage, topImage); }

Target:
public int hashCode() { return Objects.hash(storageDomainId, imageGroupId, baseImageGeneration, baseImage, topImage); }
Source:
public BodyPart addPart(String mimeType, Object content) { if (content instanceof BodyPart) { try { Multipart multipart = getMultipart(); multipart.addBodyPart((BodyPart) content); } catch (Exception e) { setError(e); return null; } return (BodyPart) content; } return addPart(mimeType, content, Collections.<String, Object>emptyMap()); }

Target:
public BodyPart addPart(String mimeType, Object content) { return addPart(mimeType, content, Collections.<String, Object>emptyMap()); }
Source:
public static TmfXmlScenarioHistoryBuilder getInstance() { TmfXmlReadWriteScenarioHistoryBuilder instance = fInstance; if (instance == null) { instance = new TmfXmlReadWriteScenarioHistoryBuilder(); fInstance = instance; } return instance; }

Target:
public static synchronized TmfXmlScenarioHistoryBuilder getInstance() { TmfXmlReadWriteScenarioHistoryBuilder instance = INSTANCE; if (instance == null) { instance = new TmfXmlReadWriteScenarioHistoryBuilder(); INSTANCE = instance; } return instance; }
Source:
public String param(String key) { WebService.Param definition = action.param(key); String rawValue = readParam(key, definition); validateRequiredValue(key, definition, rawValue); String valueOrDefault = defaultString(rawValue, definition.defaultValue()); String value = valueOrDefault == null ? null : CharMatcher.WHITESPACE.trimFrom(valueOrDefault); if (value == null) { return null; } validatePossibleValues(key, value, definition); validateMaximumLength(key, definition, valueOrDefault); validateMinimumLength(key, definition, valueOrDefault); validateMaximumValue(key, definition, value); return value; }

Target:
public String param(String key) { WebService.Param definition = action.param(key); String rawValue = readParam(key, definition); String rawValueOrDefault = defaultString(rawValue, definition.defaultValue()); String value = rawValueOrDefault == null ? null : CharMatcher.WHITESPACE.trimFrom(rawValueOrDefault); validateRequiredValue(key, definition, rawValue); if (value == null) { return null; } validatePossibleValues(key, value, definition); validateMaximumLength(key, definition, rawValueOrDefault); validateMinimumLength(key, definition, rawValueOrDefault); validateMaximumValue(key, definition, value); return value; }
Source:
public StructField getStructField(String columnName) { return DataTypes.createStructField(columnName, DataTypes.BinaryType, true); }

Target:
public StructField getStructField(String columnName) { return DataTypes.createStructField(columnName, DataTypes.StringType, true); }
Source:
public void setPluginSettingsProperties(List<ConfigurationProperty> configurationProperties) { settingsMap.addAll(configurationProperties); }

Target:
public void setPluginSettingsProperties(List<ConfigurationProperty> configurationProperties) { settingsMap.clear(); settingsMap.addAll(configurationProperties); }
Source:
public static int getAndroidVersionNumber() { if (sAndroidSdkVersion != null) { try { return Integer.parseInt(sAndroidSdkVersion); } catch (NumberFormatException ex) { log.warning("The android sdk version seems to be invalid: " + sAndroidSdkVersion); } } if (androidSdkFolder() != null) { String versionString = androidSdkFolder().getName(); log.info("Android SDK folder name is: " + versionString); Pattern p = Pattern.compile("(android-)(\\d{2})"); Matcher matcher = p.matcher(versionString); if (matcher.matches()) { return Integer.parseInt(matcher.group(2)); } else { log.warning("Could not parse Android SDK version number " + "from the sdk folder name !"); } } return -1; }

Target:
public static int getAndroidVersionNumber() { if (androidSdkFolder() != null) { String versionString = androidSdkFolder().getName(); log.info("Android SDK folder name is: " + versionString); Pattern p = Pattern.compile(PLATFORM_VERSION_REGEX); Matcher matcher = p.matcher(versionString); if (matcher.matches()) { return Integer.parseInt(matcher.group(1)); } else { log.warning("Could not identify Android SDK version number " + "from the sdk folder name !"); } } throw new SelendroidException("Could not identify the Android SDK version number"); }
Source:
public static Object safeEGet(EObject object, EStructuralFeature feature) { final EClass clazz = object.eClass(); if (clazz.getEPackage() == feature.getEContainingClass().getEPackage()) { return object.eGet(feature, false); } EStructuralFeature clazzFeature = clazz.getEStructuralFeature(feature.getName()); if (clazzFeature == null && object instanceof AnyType) { for (Entry entry : ((AnyType)object).getAnyAttribute()) { if (entry.getEStructuralFeature().getName().equals(feature.getName())) { return entry.getValue(); } } return feature.getDefaultValue(); } return object.eGet(clazzFeature, false); }

Target:
public static Object safeEGet(EObject object, EStructuralFeature feature) { final EClass clazz = object.eClass(); if (clazz.getEPackage() == feature.getEContainingClass().getEPackage()) { return object.eGet(feature, false); } final EStructuralFeature clazzFeature = clazz.getEStructuralFeature(feature.getName()); if (clazzFeature == null && object instanceof AnyType) { for (Entry entry : ((AnyType)object).getAnyAttribute()) { if (entry.getEStructuralFeature().getName().equals(feature.getName())) { return entry.getValue(); } } return feature.getDefaultValue(); } return object.eGet(clazzFeature, false); }
Source:
public AdminCommand create( Path homeDir, Path configDir, OutsideWorld outsideWorld ) { LogProvider logProvider = NullLogProvider.getInstance(); Monitors monitors = new Monitors(); OnlineBackupContextLoader onlineBackupContextLoader = new OnlineBackupContextLoader( new BackupCommandArgumentHandler(), new OnlineBackupCommandConfigLoader( homeDir, configDir ) ); BackupModuleResolveAtRuntime backupModuleResolveAtRuntime = new BackupModuleResolveAtRuntime( outsideWorld, logProvider, monitors ); return new OnlineBackupCommand( outsideWorld, onlineBackupContextLoader, BackupSupportingClassesFactoryProvider.findBestProvider().get().getFactory( backupModuleResolveAtRuntime ), new BackupFlowFactory( backupModuleResolveAtRuntime ) ); }

Target:
public AdminCommand create( Path homeDir, Path configDir, OutsideWorld outsideWorld ) { LogProvider logProvider = NullLogProvider.getInstance(); Monitors monitors = new Monitors(); OnlineBackupContextLoader onlineBackupContextLoader = new OnlineBackupContextLoader( new BackupCommandArgumentHandler(), new OnlineBackupCommandConfigLoader( homeDir, configDir ) ); BackupModuleResolveAtRuntime backupModuleResolveAtRuntime = new BackupModuleResolveAtRuntime( outsideWorld, logProvider, monitors ); return new OnlineBackupCommand( outsideWorld, onlineBackupContextLoader, BackupSupportingClassesFactoryProvider.findBestProvider() .orElseThrow( noProviderException() ) .getFactory( backupModuleResolveAtRuntime ), new BackupFlowFactory( backupModuleResolveAtRuntime ) ); }
Source:
private static void startNominatimImport(CommandLineArgs args, Server esServer, Client esNodeClient) { try { esServer.recreateIndex(); } catch (IOException e) { throw new RuntimeException("cannot setup index, elastic search config files not readable", e); } log.info("starting import from nominatim to photon with languages: " + args.getLanguages()); de.komoot.photon.elasticsearch.Importer importer = new de.komoot.photon.elasticsearch.Importer(esNodeClient, args.getLanguages()); NominatimConnector nominatimConnector = new NominatimConnector(args.getHost(), args.getPort(), args.getDatabase(), args.getUser(), args.getPassword()); nominatimConnector.setImporter(importer); try { nominatimConnector.readEntireDatabase(); } catch (Exception e) { throw new RuntimeException("error importing from nominatim: " + e.getMessage()); } log.info("imported data from nominatim to photon with languages: " + args.getLanguages()); }

Target:
private static void startNominatimImport(CommandLineArgs args, Server esServer, Client esNodeClient) { try { esServer.recreateIndex(); } catch (IOException e) { throw new RuntimeException("cannot setup index, elastic search config files not readable", e); } log.info("starting import from nominatim to photon with languages: " + args.getLanguages()); de.komoot.photon.elasticsearch.Importer importer = new de.komoot.photon.elasticsearch.Importer(esNodeClient, args.getLanguages()); NominatimConnector nominatimConnector = new NominatimConnector(args.getHost(), args.getPort(), args.getDatabase(), args.getUser(), args.getPassword()); nominatimConnector.setImporter(importer); nominatimConnector.readEntireDatabase(args.getCountryCodes().split(",")); log.info("imported data from nominatim to photon with languages: " + args.getLanguages()); }
Source:
public void refresh(boolean fullRefresh, IProgressMonitor monitor) { try { monitor.beginTask("Refresh tree", 4); if (ctx.getModelAccessor().getPermissionAuthority().canEditInstance(container)) { if (container != null && container.getTarget() != null) { ctx.getInterpreter().setVariable(IInterpreterSiriusVariables.CONTAINER_VIEW, container.eContainer()); ctx.getInterpreter().setVariable(IInterpreterSiriusVariables.CONTAINER, container.getTarget()); ctx.getInterpreter().setVariable(IInterpreterSiriusVariables.VIEW, container); } MappingHiearchyTable hierarchy = new MappingHiearchyTable(); SignatureProvider signProvider = new TreeSignatureProvider(hierarchy); SemanticPartitionProvider semProvider = new SemanticPartitionProvider(this.ctx); final TreeMappingProvider provider = new TreeMappingProvider(semProvider); Iterable<Mapping> providedMappings = Iterables.transform(mappings, new Function<TreeItemMapping, Mapping>() { public Mapping apply(TreeItemMapping from) { return provider.getOrCreate(from); } }); monitor.worked(1); hierarchy.compute(Lists.newArrayList(providedMappings)); monitor.worked(1); DTreePreRefreshStatus pre = new DTreePreRefreshStatus(ctx, provider); ModelToModelSynchronizer refresher = new ModelToModelSynchronizer(this.invalidator, hierarchy, pre, signProvider); CreatedOutput cDiag = buildOutput(provider); monitor.worked(1); refresher.update(cDiag, fullRefresh); monitor.worked(1); } } finally { if (container != null) { ctx.getInterpreter().unSetVariable(IInterpreterSiriusVariables.CONTAINER_VIEW); ctx.getInterpreter().unSetVariable(IInterpreterSiriusVariables.CONTAINER); ctx.getInterpreter().unSetVariable(IInterpreterSiriusVariables.VIEW); } monitor.done(); } }

Target:
public void refresh(boolean fullRefresh, IProgressMonitor monitor) { try { monitor.beginTask("Refresh tree", 4); if (ctx.getModelAccessor().getPermissionAuthority().canEditInstance(container)) { MappingHiearchyTable hierarchy = new MappingHiearchyTable(); SignatureProvider signProvider = new TreeSignatureProvider(hierarchy); SemanticPartitionProvider semProvider = new SemanticPartitionProvider(this.ctx); final TreeMappingProvider provider = new TreeMappingProvider(semProvider); Iterable<Mapping> providedMappings = Iterables.transform(mappings, new Function<TreeItemMapping, Mapping>() { public Mapping apply(TreeItemMapping from) { return provider.getOrCreate(from); } }); monitor.worked(1); hierarchy.compute(Lists.newArrayList(providedMappings)); monitor.worked(1); DTreePreRefreshStatus pre = new DTreePreRefreshStatus(ctx, provider); ModelToModelSynchronizer refresher = new ModelToModelSynchronizer(this.invalidator, hierarchy, pre, signProvider); CreatedOutput cDiag = buildOutput(provider); monitor.worked(1); refresher.update(cDiag, fullRefresh); monitor.worked(1); } } finally { monitor.done(); } }
Source:
public void testParceling() { RouteInfo r; r = new RouteInfo(Prefix("::/0"), Address("2001:db8::"), null); assertParcelingIsLossless(r); r = new RouteInfo(Prefix("192.0.2.0/24"), null, "wlan0"); assertParcelingIsLossless(r); }

Target:
public void testParceling() { RouteInfo r; r = new RouteInfo(Prefix("::/0"), Address("2001:db8::"), null); assertParcelingIsLossless(r); r = new RouteInfo(Prefix("192.0.2.0/24"), null, "wlan0"); assertParcelSane(r, 6); }
Source:
public void assertNotNull(AssertionInfo info, Object actual, String label) { if (actual != null) { return; } throw failures.failure(info, ShouldNotBeNull.of(label)); }

Target:
public void assertNotNull(AssertionInfo info, Object actual, String label) { if (actual == null) { throw failures.failure(info, shouldNotBeNull(label)); } }
Source:
public void setFieldNames(String header) throws FormattedException { try { setFieldNames(splitter.split(header)); } catch (Exception e) { Throwables.propagateIfInstanceOf(e, FormattedException.class); throw new FormattedException.Builder() .withErrorCode(FormattedException.ErrorCode.UNPARSABLE_HEADER) .withMessage(e.getMessage()) .build(); } }

Target:
public void setFieldNames(String header) { try { setFieldNames(splitter.split(header)); } catch (Exception e) { Throwables.propagateIfInstanceOf(e, FormattedException.class); throw new FormattedException.Builder() .withErrorCode(FormattedException.ErrorCode.UNPARSABLE_HEADER) .withMessage(e.getMessage()) .build(); } }
Source:
public PCollection<IndexedRecord> expand(PBegin in) { ElasticsearchIO.Read esRead = ElasticsearchIO.read() .withConnectionConfiguration(createConnectionConf(properties.getDatasetProperties())); if (properties.query.getValue() != null) { esRead = esRead.withQuery(properties.query.getValue()); } PCollection<String> readFromElasticsearch = in.apply("ReadFromElasticsearch", esRead); PCollection<GenericRecord> elasticsearchDataAsAvro = readFromElasticsearch.apply("ElasticsearchDataAsAvro", ParDo.of(new DoFn<String, GenericRecord>() { @ProcessElement public void processElement(ProcessContext c) { if (jsonGenericRecordConverter == null) { JsonSchemaInferrer jsonSchemaInferrer = new JsonSchemaInferrer(new ObjectMapper()); Schema jsonSchema = jsonSchemaInferrer.inferSchema(c.element().toString()); jsonGenericRecordConverter = new JsonGenericRecordConverter(jsonSchema); } GenericRecord outputRecord = jsonGenericRecordConverter.convertToAvro(c.element().toString()); c.output(outputRecord); } })); return elasticsearchDataAsAvro.apply(ConvertToIndexedRecord.<GenericRecord>of()); }

Target:
public PCollection<IndexedRecord> expand(PBegin in) { ElasticsearchIO.Read esRead = ElasticsearchIO.read() .withConnectionConfiguration(createConnectionConf(properties.getDatasetProperties())); if (properties.query.getValue() != null) { esRead = esRead.withQuery(properties.query.getValue()); } PCollection<String> readFromElasticsearch = in.apply("ReadFromElasticsearch", esRead); PCollection<IndexedRecord> elasticsearchDataAsAvro = readFromElasticsearch.apply("ElasticsearchDataAsAvro", ParDo.of(new DoFn<String, IndexedRecord>() { @ProcessElement public void processElement(ProcessContext c) { if (jsonGenericRecordConverter == null) { JsonSchemaInferrer jsonSchemaInferrer = new JsonSchemaInferrer(new ObjectMapper()); Schema jsonSchema = jsonSchemaInferrer.inferSchema(c.element().toString()); jsonGenericRecordConverter = new JsonGenericRecordConverter(jsonSchema); } GenericRecord outputRecord = jsonGenericRecordConverter.convertToAvro(c.element().toString()); c.output(outputRecord); } })); return elasticsearchDataAsAvro; }
Source:
private Enum reverseLookup(Class enumClass, String enumValue) { try { Method reverseLookupMethod = enumClass.getMethod("reverseLookup", String.class); if (reverseLookupMethod != null) { Enum e = (Enum) reverseLookupMethod.invoke(null, enumValue); return e; } } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e1) { } return null; }

Target:
private Enum reverseLookup(Class enumClass, String enumValue) { try { Method reverseLookupMethod = enumClass.getMethod("reverseLookup", String.class); Enum e = (Enum) reverseLookupMethod.invoke(null, enumValue); return e; } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e1) { } return null; }
Source:
public String getStateTypeName(ITimeGraphEntry entry) { if (entry instanceof TimeGraphEntry) { ITimeGraphEntryModel model = ((TimeGraphEntry) entry).getModel(); if (model instanceof TraceEntryModel) { return Messages.TraceEntry_StateTypeName; } else if (model instanceof ModuleEntryModel) { return Messages.ModuleEntry_StateTypeName; } else if (model instanceof StateSystemEntryModel) { return Messages.StateSystemEntry_StateTypeName; } } return Messages.AttributeEntry_StateTypeName; }

Target:
public String getStateTypeName(ITimeGraphEntry entry) { if (entry instanceof TimeGraphEntry) { ITmfTreeDataModel model = ((TimeGraphEntry) entry).getEntryModel(); if (model instanceof TraceEntryModel) { return Messages.TraceEntry_StateTypeName; } else if (model instanceof ModuleEntryModel) { return Messages.ModuleEntry_StateTypeName; } else if (model instanceof StateSystemEntryModel) { return Messages.StateSystemEntry_StateTypeName; } } return Messages.AttributeEntry_StateTypeName; }
Source:
public void addDecoration(final DDiagramElement element, final DecorationDescription decorationDescription) { for (final Decoration decoration : new ArrayList<Decoration>(element.getDecorations())) { if (EcoreUtil.equals(decorationDescription, decoration.getDescription())) { return; } } if (checkDecoratorPrecondition(element.getTarget(), (DSemanticDecorator) element.eContainer(), decorationDescription)) { final Decoration decoration = ViewpointFactory.eINSTANCE.createDecoration(); decoration.setDescription(decorationDescription); if (decorationDescription.eContainer().eContainer() instanceof TransientLayer) { element.getTransientDecorations().add(decoration); } else { element.getDecorations().add(decoration); } } }

Target:
public void addDecoration(final DDiagramElement element, final DecorationDescription decorationDescription) { for (final Decoration decoration : new ArrayList<Decoration>(element.getDecorations())) { if (EcoreUtil.equals(decorationDescription, decoration.getDescription())) { return; } } for (final Decoration decoration : new ArrayList<Decoration>(element.getTransientDecorations())) { if (EcoreUtil.equals(decorationDescription, decoration.getDescription())) { return; } } if (checkDecoratorPrecondition(element.getTarget(), (DSemanticDecorator) element.eContainer(), decorationDescription)) { final Decoration decoration = ViewpointFactory.eINSTANCE.createDecoration(); decoration.setDescription(decorationDescription); if (decorationDescription.eContainer().eContainer() instanceof TransientLayer) { element.getTransientDecorations().add(decoration); } else { element.getDecorations().add(decoration); } } }
Source:
private String getRawFormatDisksWithBackupEnabled() { Snapshot snapshot = getSelectedItem(); List<Snapshot> snapshots = (List<Snapshot>) getItems(); int snapshotIndex = snapshots.indexOf(snapshot); Snapshot parentSnapshot = snapshots.get(snapshotIndex - 1); List<Guid> backupEnabledDisksIds = snapshotsMap.get(parentSnapshot.getId()).getDisks() .stream() .filter(diskImage -> diskImage.getBackup().equals(DiskBackup.Incremental)) .map(DiskImage::getId) .collect(Collectors.toList()); if (backupEnabledDisksIds.isEmpty()) { return null; } String diskList = snapshotsMap.get(snapshot.getId()).getDisks() .stream() .filter(diskImage -> backupEnabledDisksIds.contains(diskImage.getId())) .filter(diskImage -> diskImage.getVolumeFormat() == VolumeFormat.RAW) .map(DiskImage::getName) .collect(Collectors.joining(", ")); return diskList.isEmpty() ? null : diskList; }

Target:
private String getRawFormatDisksWithBackupEnabled() { Snapshot snapshot = getSelectedItem(); List<Snapshot> snapshots = (List<Snapshot>) getItems(); int snapshotIndex = snapshots.indexOf(snapshot); Snapshot parentSnapshot = snapshots.get(snapshotIndex - 1); List<Guid> backupEnabledDisksIds = snapshotsMap.get(parentSnapshot.getId()).getDisks() .stream() .filter(diskImage -> diskImage.getBackup().equals(DiskBackup.Incremental)) .map(DiskImage::getId) .collect(Collectors.toList()); if (backupEnabledDisksIds.isEmpty()) { return ""; } return snapshotsMap.get(snapshot.getId()).getDisks() .stream() .filter(diskImage -> backupEnabledDisksIds.contains(diskImage.getId())) .filter(diskImage -> diskImage.getVolumeFormat() == VolumeFormat.RAW) .map(DiskImage::getName) .collect(Collectors.joining(", ")); }
Source:
private void createWorkspace(String organizationName, String workspaceName) { dashboard.selectWorkspacesItemOnDashboard(); dashboard.waitToolbarTitleName("Workspaces"); workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); newWorkspace.openOrganizationsList(); newWorkspace.selectOrganizationFromList(organizationName); newWorkspace.selectStack(JAVA.getId()); newWorkspace.typeWorkspaceName(workspaceName); newWorkspace.clickOnCreateButtonAndEditWorkspace(); WaitUtils.sleepQuietly(2); }

Target:
private void createWorkspace(String organizationName, String workspaceName) { dashboard.selectWorkspacesItemOnDashboard(); dashboard.waitToolbarTitleName("Workspaces"); workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); newWorkspace.openOrganizationsList(); newWorkspace.selectOrganizationFromList(organizationName); newWorkspace.selectStack(JAVA.getId()); newWorkspace.typeWorkspaceName(workspaceName); newWorkspace.clickOnCreateButtonAndEditWorkspace(); try { workspaceDetails.waitToolbarTitleName(workspaceName); } catch (TimeoutException ex) { fail("Known issue <LINK_0>"); } }
Source:
public Value setCallbackOperation( Value request ) { operationName = request.getFirstChild( "operationName" ).strValue(); return Value.create(); }

Target:
public void setCallbackOperation( Value request ) { operationName = request.getFirstChild( "operationName" ).strValue(); }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; if (!FiltersHelper.isAuthenticated(req)) { String headerValue = req.getHeader("Authorization"); if (headerValue != null && headerValue.startsWith("Basic ")) { String[] creds = null; try { creds = new String( Base64.decodeBase64(headerValue.substring("Basic".length())), Charset.forName("UTF-8") ).split(":", 2); } catch (Throwable th) { log.error("Error in decoding ", th); } if (creds != null && creds.length == 2) { handleCredentials(req, creds[0], creds[1]); } else { log.error("Error in parsing basic authorization information"); } } } chain.doFilter(request, response); }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; if (!FiltersHelper.isAuthenticated(req)) { String headerValue = req.getHeader("Authorization"); if (headerValue != null && headerValue.startsWith("Basic ")) { String[] creds = new String( Base64.decodeBase64(headerValue.substring("Basic".length())), Charset.forName("UTF-8") ).split(":", 2); if (creds != null && creds.length == 2) { handleCredentials(req, creds[0], creds[1]); } else { log.error("Error in parsing basic authorization information"); } } } chain.doFilter(request, response); }
Source:
public void init(String param, ClassLoader classLoader) { PropertyHelper.setProperties(this, Utils.parseParams(param), false, false); try { clazz = classLoader.loadClass(this.clazzName); Class<?>[] params = new Class<?>[numInts]; fields = new Field[numInts]; for (int i = 0; i < params.length; ++i) { params[i] = int.class; fields[i] = clazz.getDeclaredField("int" + i); fields[i].setAccessible(true); } ctor = clazz.getConstructor(params); } catch (Exception e) { throw new IllegalStateException(e); } }

Target:
public void init(String param, ClassLoader classLoader) { PropertyHelper.setProperties(this, Utils.parseParams(param), false, false); if (max > min) throw new IllegalArgumentException(String.format("min (%d) must be <= max (%d)", min, max)); try { clazz = classLoader.loadClass(this.clazzName); Class<?>[] params = new Class<?>[numInts]; fields = new Field[numInts]; for (int i = 0; i < params.length; ++i) { params[i] = int.class; fields[i] = clazz.getDeclaredField("int" + i); fields[i].setAccessible(true); } ctor = clazz.getConstructor(params); } catch (Exception e) { throw new IllegalArgumentException(e); } }
Source:
public static void registerAlias(String name, Enchantment enchantment) { if(ENCHANTMENTS.containsKey(name) || ALIASENCHANTMENTS.containsKey(name) || !ENCHANTMENTS.containsValue(enchantment)) return; ALIASENCHANTMENTS.put(name, enchantment); }

Target:
public static void registerAlias(String name, Enchantment enchantment) { if (ENCHANTMENTS.containsKey(name) || ALIASENCHANTMENTS.containsKey(name) || !ENCHANTMENTS.containsValue(enchantment)) { return; } ALIASENCHANTMENTS.put(name, enchantment); }
Source:
public CompletableFuture<Object> invokeAsync() throws Throwable { RemoteTxInvocationContext ctx = createContext(); if (ctx == null) { return CompletableFutures.completedNull(); } if (trace) log.tracef("Invoking remotely originated prepare: %s with invocation context: %s", this, ctx); CompletionStage<Void> stage = null; if (notifier.hasListener(TransactionRegistered.class)) { stage = notifier.notifyTransactionRegistered(ctx.getGlobalTransaction(), false); } if (stage == null || CompletionStages.isComplete(stage)) { return invoker.invokeAsync(ctx, this); } else { return stage.thenCompose(v -> invoker.invokeAsync(ctx, this)).toCompletableFuture(); } }

Target:
public CompletableFuture<Object> invokeAsync() throws Throwable { RemoteTxInvocationContext ctx = createContext(); if (ctx == null) { return CompletableFutures.completedNull(); } if (trace) log.tracef("Invoking remotely originated prepare: %s with invocation context: %s", this, ctx); CompletionStage<Void> stage = notifier.notifyTransactionRegistered(ctx.getGlobalTransaction(), false); if (CompletionStages.isCompletedSuccessfully(stage)) { return invoker.invokeAsync(ctx, this); } else { return stage.thenCompose(v -> invoker.invokeAsync(ctx, this)).toCompletableFuture(); } }
Source:
public void validateApplicationContributions(IBuildEntry binIncludes) { try { Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(PDEProject.getPluginXml(fProject).getContents()); XPath xpath = XPathFactory.newInstance().newXPath(); Node nodeProduct = (Node) xpath.evaluate("/plugin/extension[@point='org.eclipse.core.runtime.products']/product", doc, XPathConstants.NODE); if (nodeProduct != null) { Node attValue = (Node) xpath.evaluate("property[@name='applicationXMI']/@value", nodeProduct, XPathConstants.NODE); if (attValue != null) { if (attValue.getNodeValue().isEmpty()) { } else { validateBinIncludes(binIncludes, attValue.getNodeValue()); } } else { validateBinIncludes(binIncludes, "Application.e4xmi"); } } } catch (Exception e) { e.printStackTrace(); } }

Target:
private void validateApplicationContributions(IBuildEntry binIncludes) { try { Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(PDEProject.getPluginXml(fProject).getContents()); XPath xpath = XPathFactory.newInstance().newXPath(); Node nodeProduct = (Node) xpath.evaluate("/plugin/extension[@point='org.eclipse.core.runtime.products']/product", doc, XPathConstants.NODE); if (nodeProduct != null) { Node attValue = (Node) xpath.evaluate("property[@name='applicationXMI']/@value", nodeProduct, XPathConstants.NODE); if (attValue != null) { if (attValue.getNodeValue().isEmpty()) { } else { validateBinIncludes(binIncludes, attValue.getNodeValue()); } } else { validateBinIncludes(binIncludes, "Application.e4xmi"); } } } catch (Exception e) { e.printStackTrace(); } }
Source:
public YamlClientFailoverConfigBuilder(String resource) throws IOException { URL url = ConfigLoader.locateConfig(resource); if (url == null) { throw new IllegalArgumentException("Could not load " + resource); } this.in = url.openStream(); }

Target:
public YamlClientFailoverConfigBuilder(String resource) throws IOException { URL url = ConfigLoader.locateConfig(resource); checkTrue(url != null, "Could not load " + resource); this.in = url.openStream(); }
Source:
public void onImageProcessed(UploadItem uploadItem, Place place) { this.uploadItem = uploadItem; if (uploadItem.getTitle() != null) { etTitle.setText(uploadItem.getTitle().toString()); } descriptions = uploadItem.getDescriptions(); compositeDisposable .add(downSampleImage(uploadItem.getContentUri()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(bitmap -> { if (null != bitmap) { photoViewBackgroundImage.setImageBitmap(bitmap); } }, Timber::d)); setDescriptionsInAdapter(descriptions); }

Target:
public void onImageProcessed(UploadItem uploadItem, Place place) { this.uploadItem = uploadItem; if (uploadItem.getTitle() != null) { etTitle.setText(uploadItem.getTitle().toString()); } descriptions = uploadItem.getDescriptions(); showImageWithLocalUri(uploadItem.getMediaUri()); setDescriptionsInAdapter(descriptions); }