auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addProperty(String p_key, String p_value) { logger.debug("addProperty Key : " + p_key + ", Value : " + p_value); m_properties.put(p_key, p_value); }

Target:
public void addProperty(String p_key, String p_value) { logger.debug("addProperty Key : {}, Value : {}", p_key, p_value); m_properties.put(p_key, p_value); }
Source:
private long parseValueAsLong() { try { return Long.parseLong(value.toString()); } catch (NumberFormatException ex) { throw new NumberFormatException(RedisConstants.ERROR_NOT_LONG); } }

Target:
private long parseValueAsLong() { try { return Long.parseLong(value.toString()); } catch (NumberFormatException ex) { throw new NumberFormatException(RedisConstants.ERROR_NOT_INTEGER); } }
Source:
public double asFloat() { boolean negative = false; int i = offset; if (bytes[i] == '-') { negative = true; i++; } long significand = 0; byte b = 0; while (i < offset + length) { b = bytes[i++]; if (b < '0' || b > '9') break; significand = 10 * significand + b - '0'; } if (b != '.' && i < offset + length) notFloat(); int exponent = 0; while (i < offset + length) { b = bytes[i++]; if (b < '0' || b > '9') notFloat(); significand = 10 * significand + b - '0'; exponent++; } double x = exponent != 0 ? significand / POWERS_OF_TEN[exponent] : significand; return negative ? -x : +x; }

Target:
public double asFloat() { boolean negative = false; int i = offset; if (bytes[i] == '-') { negative = true; i++; } long significand = 0; byte b = 0; while (i < offset + length) { b = bytes[i++]; if (b < '0' || b > '9') break; significand = 10 * significand + b - '0'; } if (b != '.' && i < offset + length) notFloat(); int exponent = 0; while (i < offset + length) { b = bytes[i++]; if (b < '0' || b > '9') notFloat(); significand = 10 * significand + b - '0'; exponent++; } double x = significand / POWERS_OF_TEN[exponent]; return negative ? -x : +x; }
Source:
public ProcessEditPage editProcess() throws Exception { if (isNotAt()) { goTo(); } clickButtonAndWaitForRedirect(editProcessLink, Pages.getProjectEditPage().getUrl()); return Pages.getProcessEditPage(); }

Target:
public ProcessEditPage editProcess() throws Exception { if (isNotAt()) { goTo(); } clickButtonAndWaitForRedirect(editProcessLink, Pages.getProcessEditPage().getUrl()); return Pages.getProcessEditPage(); }
Source:
private static void verifyInputFile(Map<String, List<String>> allTests, boolean skipFileNaming, String path, String fileName) { if (!skipFileNaming) { List<String> classes; int slash = path.lastIndexOf(File.separatorChar); String packge = path.substring(0, slash); boolean found = false; for (int depth = 0; depth < 4; depth++) { final String folderPath = packge; slash = packge.lastIndexOf(File.separatorChar); packge = path.substring(0, slash); classes = allTests.get(packge); if (classes != null && checkInputMatchCorrectFileStructure(classes, folderPath, skipFileNaming, fileName)) { found = true; break; } } assertTrue(found, "Resource must be named after a Test like 'InputMyCustomCase.java' " + "and be in the sub-package of the test like 'mycustom' " + "for test 'MyCustomCheckTest': " + path); } }

Target:
private static void verifyInputFile(Map<String, List<String>> allTests, boolean skipFileNaming, String path, String fileName) { List<String> classes; int slash = path.lastIndexOf(File.separatorChar); String packge = path.substring(0, slash); boolean found = false; for (int depth = 0; depth < 4; depth++) { final String folderPath = packge; slash = packge.lastIndexOf(File.separatorChar); packge = path.substring(0, slash); classes = allTests.get(packge); if (classes != null && checkInputMatchCorrectFileStructure(classes, folderPath, skipFileNaming, fileName)) { found = true; break; } } assertTrue(found, "Resource must be named after a Test like 'InputMyCustomCase.java' " + "and be in the sub-package of the test like 'mycustom' " + "for test 'MyCustomCheckTest': " + path); }
Source:
public List<String> getGroupsWithPermission(final Type type) { final ArrayList<String> groups = new ArrayList<>(); for (final Map.Entry<String, Permission> entry : this.groupPermissionMap.entrySet()) { final Permission perm = entry.getValue(); if (perm.isPermissionSet(type)) { groups.add(entry.getKey()); } } return groups; }

Target:
public List<String> getGroupsWithPermission(final Type type) { final List<String> groups = new ArrayList<>(); for (final Map.Entry<String, Permission> entry : this.groupPermissionMap.entrySet()) { final Permission perm = entry.getValue(); if (perm.isPermissionSet(type)) { groups.add(entry.getKey()); } } return groups; }
Source:
public static Location fromValue(String v) { try { return valueOf(v); } catch (IllegalArgumentException ex) { return UNRECOGNIZED; } }

Target:
public static Location fromValue(String v) { return Enums .getIfPresent(Location.class, v) .or(UNRECOGNIZED); }
Source:
public void notifyRefReplicated(String project, String ref, URIish uri, RefPushResult status) { pushProcessing.onOneNodeReplicated(project, ref, uri, status); countingLock.lock(); try { finishedPushCount++; if (!allScheduled) { return; } if (finishedPushCount < totalPushCount) { return; } } finally { countingLock.unlock(); } pushProcessing.onAllNodesReplicated(); if (type == ReplicationType.COMMAND) { allPushTasksFinished.countDown(); } }

Target:
public void notifyRefReplicated(String project, String ref, URIish uri, RefPushResult status) { pushResultProcessing.onOneNodeReplicated(project, ref, uri, status); countingLock.lock(); try { finishedPushTasksCount++; if (!allScheduled) { return; } if (finishedPushTasksCount < totalPushTasksCount) { return; } } finally { countingLock.unlock(); } doAllPushTasksCompleted(); }
Source:
public int remove(Filter filter) { LOGGER.info("removing statuses matching " + filter); int ret = 0; DefaultTransaction transaction = new DefaultTransaction("create"); try { SimpleFeatureSource source = statuses.getFeatureSource(STATUS); SimpleFeatureCollection features = source.getFeatures(filter); ret = features.size(); if (ret == 0) { return ret; } SimpleFeatureIterator itr = features.features(); itr.close(); if (source instanceof SimpleFeatureStore) { SimpleFeatureStore store = (SimpleFeatureStore) source; store.setTransaction(transaction); store.removeFeatures(filter); transaction.commit(); } } catch (IOException e) { e.printStackTrace(); try { transaction.rollback(); } catch (IOException e1) { } } finally { transaction.close(); } return ret; }

Target:
public int remove(Filter filter) { LOGGER.fine("removing statuses matching " + filter); int ret = 0; DefaultTransaction transaction = new DefaultTransaction("create"); try { SimpleFeatureSource source = statuses.getFeatureSource(fixTableName(STATUS)); Filter fixedFilter = fixFilter(filter); SimpleFeatureCollection features = source.getFeatures(fixedFilter); ret = features.size(); if (ret == 0) { return ret; } if (source instanceof SimpleFeatureStore) { SimpleFeatureStore store = (SimpleFeatureStore) source; store.setTransaction(transaction); store.removeFeatures(fixedFilter); transaction.commit(); } else { LOGGER.info("Readonly status store found, probably not what you wanted"); } } catch (IOException e) { LOGGER.info("failed to remove WPS Status matching " + filter); LOGGER.log(Level.FINE,"failed to remove WPS Status matching " + filter,e); try { transaction.rollback(); } catch (IOException e1) { } } finally { transaction.close(); } return ret; }
Source:
public void testgetSqlString() { List<String> streams = Collections.singletonList("kafka_stream_1"); List<String> gbk = Collections.singletonList("a.b.c"); List<Projection> projections = Collections.singletonList(new Projection("f1.g.h", null, null, null)); String sql = streamCatalogService.getSqlString(streams, projections, "x = y", gbk); assertEquals("SELECT f1['g']['h'] FROM kafka_stream_1 WHERE x = y GROUP BY a['b']['c']", sql); projections = Collections.singletonList(new Projection(null, "foo", Arrays.asList("a.b", "kafka_stream_1.c.d"), "res")); sql = streamCatalogService.getSqlString(streams, projections, "x = y", gbk); assertEquals("SELECT foo(a['b'],kafka_stream_1.c['d']) AS \"res\" FROM kafka_stream_1 WHERE x = y GROUP BY a['b']['c']", sql); }

Target:
public void testgetSqlString() { List<String> streams = Collections.singletonList("kafka_stream_1"); List<String> gbk = Collections.singletonList("a.b.c"); List<Projection> projections = Collections.singletonList(new Projection("f1.g.h", null, null, null)); String sql = streamCatalogService.getSqlString(streams, projections, "f1.a.b = kafka_stream_1.g.h", gbk); assertEquals("SELECT f1['g']['h'] FROM kafka_stream_1 WHERE f1['a']['b'] = kafka_stream_1.g['h'] GROUP BY a['b']['c']", sql); projections = Collections.singletonList(new Projection(null, "foo", Arrays.asList("a.b", "kafka_stream_1.c.d"), "res")); sql = streamCatalogService.getSqlString(streams, projections, "f1.a.b = kafka_stream_1.g.h", gbk); assertEquals("SELECT foo(a['b'],kafka_stream_1.c['d']) AS \"res\" FROM kafka_stream_1 WHERE f1['a']['b'] = kafka_stream_1.g['h'] GROUP BY a['b']['c']", sql); }
Source:
public void run() { final IRunnableWithProgress generateCodeRunnable = new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.beginTask("Generating Code", IProgressMonitor.UNKNOWN); final ResourceSet resourceSet = (ResourceSet) currentObject; final GenModel genmodel = (GenModel) resourceSet.getResources().get(0).getContents().get(0); genmodel.reconcile(); genmodel.setCanGenerate(true); final Generator generator = GenModelUtil.createGenerator(genmodel); for (final Object type : types) { generator.generate(genmodel, type, new BasicMonitor.EclipseSubProgress(monitor, 1)); } } }; try { new ProgressMonitorDialog(Display.getCurrent().getActiveShell()).run(true, false, generateCodeRunnable); } catch (final InvocationTargetException e) { e.printStackTrace(); } catch (final InterruptedException e) { e.printStackTrace(); } }

Target:
public void run() { final IRunnableWithProgress generateCodeRunnable = new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.beginTask("Generating Code", IProgressMonitor.UNKNOWN); final ResourceSet resourceSet = (ResourceSet) currentObject; final GenModel genmodel = (GenModel) resourceSet.getResources().get(0).getContents().get(0); genmodel.reconcile(); genmodel.setCanGenerate(true); final Generator generator = GenModelUtil.createGenerator(genmodel); for (final Object type : types) { generator.generate(genmodel, type, new BasicMonitor.EclipseSubProgress(monitor, 1)); } } }; try { new ProgressMonitorDialog(Display.getCurrent().getActiveShell()).run(true, false, generateCodeRunnable); } catch (final InvocationTargetException ex) { Activator.getDefault().getReportService().report( new StatusReport(new Status(IStatus.ERROR, Activator.PLUGIN_ID, ex.getMessage(), ex))); } catch (final InterruptedException ex) { Activator.getDefault().getReportService().report( new StatusReport(new Status(IStatus.ERROR, Activator.PLUGIN_ID, ex.getMessage(), ex))); } }
Source:
public int getDurationInYears() { return Float.valueOf(getDegreeStructure().getAcademicPeriod().getWeight()).intValue(); }

Target:
public int getDurationInYears() { final AcademicPeriod academicPeriod = getDegreeStructure() != null ? getDegreeStructure().getAcademicPeriod() : getDegreeType().getAcademicPeriod(); return Float.valueOf(academicPeriod.getWeight()).intValue(); }
Source:
public MetadataResolutionResult addError( Exception e ) { if ( exceptions == null ) { exceptions = initList( exceptions ); } exceptions.add( e ); return this; }

Target:
public MetadataResolutionResult addError( Exception e ) { exceptions = initList( exceptions ); exceptions.add( e ); return this; }
Source:
public void worldTick(TickEvent.WorldTickEvent event) { if (ENABLE && !event.world.isRemote ) { if(ticks++ > 60) { ticks = 0; World w = event.world; List<EntityLivingBase> list = w.getEntities(EntityLivingBase.class, new Predicate<EntityLivingBase>() { public boolean test(EntityLivingBase e) { return e.isAlive(); }; }); for(EntityLivingBase liv : list) { IAttributeInstance grav = liv.getAttribute(EntityLivingBase.ENTITY_GRAVITY); boolean inPlains = liv.world.getBiome(liv.getPosition()).getCategory() == Category.PLAINS; if(inPlains && !grav.hasModifier(REDUCED_GRAVITY)) { logger.info("Granted low gravity to Entity: {}", liv); grav.applyModifier(REDUCED_GRAVITY); } else if(!inPlains && grav.hasModifier(REDUCED_GRAVITY)) { logger.info("Removed low gravity from Entity: {}", liv); grav.removeModifier(REDUCED_GRAVITY); } } } } }

Target:
public void worldTick(TickEvent.WorldTickEvent event) { if (ENABLE && !event.world.isRemote) { if (ticks++ > 60) { ticks = 0; World w = event.world; List<LivingEntity> list; if(w.isRemote) { ClientWorld cw = (ClientWorld) w; list = new ArrayList<>(100); for(Entity e : cw.func_217416_b()) { if(e.isAlive()) { if(e instanceof LivingEntity) { list.add((LivingEntity) e); } } } } else { ServerWorld sw = (ServerWorld) w; Stream<LivingEntity> s = sw.getEntities().filter(Entity::isAlive).filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e); list = s.collect(Collectors.toList()); } for(LivingEntity liv : list) { IAttributeInstance grav = liv.getAttribute(LivingEntity.ENTITY_GRAVITY); boolean inPlains = liv.world.getBiome(liv.getPosition()).getCategory() == Category.PLAINS; if (inPlains && !grav.hasModifier(REDUCED_GRAVITY)) { logger.info("Granted low gravity to Entity: {}", liv); grav.applyModifier(REDUCED_GRAVITY); } else if (!inPlains && grav.hasModifier(REDUCED_GRAVITY)) { logger.info("Removed low gravity from Entity: {}", liv); grav.removeModifier(REDUCED_GRAVITY); } } } } }
Source:
public void experimentUpdated(TmfExperimentUpdatedSignal signal) { TmfExperiment experiment = signal.getExperiment(); if (!experiment.equals(TmfExperiment.getCurrentExperiment())) { return; } requestData(experiment, experiment.getTimeRange()); }

Target:
public void experimentUpdated(TmfExperimentUpdatedSignal signal) { TmfExperiment experiment = signal.getExperiment(); if (!experiment.equals(TmfExperiment.getCurrentExperiment())) { return; } long nbEvents = 0; if (fRequest != null) { nbEvents = fRequest.getLastEventIndex(); } if (nbEvents < experiment.getNbEvents()) { requestData(experiment, experiment.getTimeRange()); } }
Source:
private Iterable<Payload> doSlice(InputStream rawContent, ContentMetadata meta) { return new PayloadIterator(rawContent, meta); }

Target:
protected Iterable<Payload> doSlice(InputStream rawContent, ContentMetadata meta) { return new PayloadIterator(rawContent, meta); }
Source:
public static <R extends BaseResource> UriBuilder getUriBuilder(UriInfo uriInfo, R model, Class<? extends BaseResource> suggestedParentType) { Collection collection = getCollection(model, suggestedParentType); if (collection == null) { return null; } UriBuilder uriBuilder = builderMap.get(collection); if (uriBuilder == null) { if (collection.getParentType() != NO_PARENT) { BaseResource parent = getParentModel(model, collection.getParentType()); Collection parentCollection = getCollection(parent, suggestedParentType); String path = getPath(collection.getCollectionType(), parentCollection.getResourceType(), model.getClass()); uriBuilder = getUriBuilder(uriInfo, parent).path(path); } else { String path = getPath(collection.getCollectionType()); uriBuilder = uriInfo != null ? UriBuilder.fromPath(uriInfo.getBaseUri().getPath()).path(path) : UriBuilder.fromPath(path); } builderMap.put(collection, uriBuilder.clone()); } else { uriBuilder = uriBuilder.clone(); } return uriBuilder.path(model.getId()); }

Target:
public static <R extends BaseResource> UriBuilder getUriBuilder(UriInfo uriInfo, R model, Class<? extends BaseResource> suggestedParentType) { Collection collection = getCollection(model, suggestedParentType); if (collection == null) { return null; } UriBuilder uriBuilder; if (collection.getParentType() != NO_PARENT) { BaseResource parent = getParentModel(model, collection.getParentType()); Collection parentCollection = getCollection(parent, suggestedParentType); String path = getPath(collection.getCollectionType(), parentCollection.getResourceType(), model.getClass()); uriBuilder = getUriBuilder(uriInfo, parent).path(path); } else { uriBuilder = builderMap.get(collection); if (uriBuilder == null) { String path = getPath(collection.getCollectionType()); uriBuilder = uriInfo != null ? UriBuilder.fromPath(uriInfo.getBaseUri().getPath()).path(path) : UriBuilder.fromPath(path); builderMap.put(collection, uriBuilder.clone()); } else { uriBuilder = uriBuilder.clone(); } } return uriBuilder.path(model.getId()); }
Source:
public Optional<Metacard> apply(String featureMember, WfsMetadata metadata) { for (FeatureTransformer featureTransformer : transformerServiceList) { try (InputStream featureMemberInputStream = new BufferedInputStream(new ByteArrayInputStream(featureMember.getBytes()))) { Optional<Metacard> metacardOptional = featureTransformer.apply(featureMemberInputStream, metadata); if (metacardOptional.isPresent()) { return metacardOptional; } } catch (IOException e) { LOGGER.debug( "Error transforming feature member:{}, with feature transformer: {}", featureMember, featureTransformer); } } return Optional.empty(); }

Target:
public Optional<Metacard> apply(String featureMember, WfsMetadata metadata) { if (StringUtils.isEmpty(featureMember)) { return Optional.empty(); } for (FeatureTransformer featureTransformer : transformerServiceList) { try (InputStream featureMemberInputStream = new BufferedInputStream(new ByteArrayInputStream(featureMember.getBytes()))) { Optional<Metacard> metacardOptional = featureTransformer.apply(featureMemberInputStream, metadata); if (metacardOptional.isPresent()) { return metacardOptional; } } catch (IOException e) { LOGGER.error( "Error transforming feature member:{}, with feature transformer: {}", featureMember, featureTransformer); } } return Optional.empty(); }
Source:
public void shouldThrowExceptionOnValidationNonValidDevfile( String resourceFilePath, String expectedMessageRegexp) throws Exception { try { schemaValidator.validateBySchema(getResource(resourceFilePath), false); } catch (DevfileFormatException e) { if (!Pattern.matches(expectedMessageRegexp, e.getMessage())) { assertEquals( e.getMessage(), expectedMessageRegexp, "DevfileFormatException with unexpected message is thrown: "); } return; } fail("DevfileFormatException expected to be thrown but is was not"); }

Target:
public void shouldThrowExceptionOnValidationNonValidDevfile( String resourceFilePath, String expectedMessageRegexp) throws Exception { try { schemaValidator.validateBySchema(getResource(resourceFilePath), false); } catch (DevfileFormatException e) { if (!Pattern.matches(expectedMessageRegexp, e.getMessage())) { assertEquals( e.getMessage(), expectedMessageRegexp, "DevfileFormatException thrown with message that doesn't match expected pattern:"); } return; } fail("DevfileFormatException expected to be thrown but is was not"); }
Source:
public static boolean useLegacyParser(final Class<?> clazz) { String legacyPropertyValue = null; if (useLegacyParser == null) { legacyPropertyValue = System.getProperty(PROPERTY_USE_LEGACY_PARSER); if (null == legacyPropertyValue){ Properties props = PropertyUtils.loadPropertiesFile(PICARD_CMDLINE_PROPERTIES_FILE, clazz); if (props != null) { legacyPropertyValue = props.getProperty(PROPERTY_USE_LEGACY_PARSER); } } useLegacyParser = legacyPropertyValue == null || Boolean.parseBoolean(legacyPropertyValue); } return useLegacyParser; }

Target:
public static boolean useLegacyParser(final Class<?> clazz) { if (useLegacyParser == null) { String legacyPropertyValue = legacyPropertyValue = System.getProperty(PROPERTY_USE_LEGACY_PARSER); if (null == legacyPropertyValue){ final Properties props = PropertyUtils.loadPropertiesFile(PICARD_CMDLINE_PROPERTIES_FILE, clazz); if (props != null) { legacyPropertyValue = props.getProperty(PROPERTY_USE_LEGACY_PARSER); } } useLegacyParser = legacyPropertyValue == null ? true : Boolean.parseBoolean(legacyPropertyValue); } return useLegacyParser; }
Source:
private void setOrReplace(String name, Map<String, String> namesMap, String field) { String existingName = namesMap.get("name"); if (!name.equals(existingName)) { if (log.isDebugEnabled()) { log.debug("Replacing "+ field +" name '"+existingName+"' with '"+ name+ "' for osmId #" + osmId); } namesMap.put("formerName", existingName); namesMap.put("name", name); } }

Target:
private void setOrReplace(String name, Map<String, String> namesMap, String field) { String existingName = namesMap.get("name"); if (!name.equals(existingName)) { if (log.isDebugEnabled()) { log.debug("Replacing "+ field +" name '"+existingName+"' with '"+ name+ "' for osmId #" + osmId); } if(!Objects.isNull(existingName)) { context.add(ImmutableMap.of("formerName", existingName)); } namesMap.put("name", name); } }
Source:
private static void ensureResultTypesMatch(Collection<? extends Symbol> results) { HashSet<DataType<?>> resultTypes = new LinkedHashSet<>(results.size()); for (Symbol result : results) { resultTypes.add(result.valueType()); } if (resultTypes.size() == 2 && !resultTypes.contains(DataTypes.UNDEFINED) || resultTypes.size() > 2) { throw new UnsupportedOperationException(String.format(Locale.ENGLISH, "Data types of all result expressions of a CASE statement must be equal, found: %s", resultTypes)); } }

Target:
private static void ensureResultTypesMatch(Collection<? extends Symbol> results) { HashSet<DataType<?>> resultTypes = new HashSet<>(results.size()); for (Symbol result : results) { resultTypes.add(result.valueType()); } if (resultTypes.size() == 2 && !resultTypes.contains(DataTypes.UNDEFINED) || resultTypes.size() > 2) { throw new UnsupportedOperationException(String.format(Locale.ENGLISH, "Data types of all result expressions of a CASE statement must be equal, found: %s", results.stream().map(Symbol::valueType).collect(toList()))); } }
Source:
private boolean canDoSnapshot(VM vm) { if (!isLiveSnapshotEnabled() && !vm.isDown()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DATA_CENTER_VERSION_DOESNT_SUPPORT_LIVE_SNAPSHOT); } if (!getVdsFromRunningVm(vm).getLiveSnapshotSupport()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_QEMU_UNSUPPORTED_OPERATION); } return true; }

Target:
private boolean canDoSnapshot(VM vm) { if (!isLiveSnapshotEnabled() && !vm.isDown()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DATA_CENTER_VERSION_DOESNT_SUPPORT_LIVE_SNAPSHOT); } VDS vds = getVds(); if (vds != null && !vds.getLiveSnapshotSupport()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_QEMU_UNSUPPORTED_OPERATION); } return true; }
Source:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { logger.debug("PowerDogLocalApi:processBindingConfiguration called"); super.processBindingConfiguration(context, item, bindingConfig); if (bindingConfig != null) { PowerDogLocalApiBindingConfig config = parseBindingConfig(item, bindingConfig); logger.debug("bindingConfig adeed (config=" + config.toString() + ")"); addBindingConfig(item, config); } else { logger.warn("bindingConfig is NULL (item=" + item + ") -> process bindingConfig aborted!"); } }

Target:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { logger.debug("PowerDogLocalApi:processBindingConfiguration called"); super.processBindingConfiguration(context, item, bindingConfig); if (bindingConfig != null) { PowerDogLocalApiBindingConfig config = parseBindingConfig(item, bindingConfig); logger.debug("bindingConfig added (config={})", config.toString()); addBindingConfig(item, config); } else { logger.warn("bindingConfig is NULL (item={}) -> process bindingConfig aborted!", item); } }
Source:
public void horizontalConflictWithTwoQueens() { Queen queen1 = new Queen(0, row1, column1); Queen queen2 = new Queen(1, row1, column2); constraintVerifier.forConstraint(constraintProvider::horizontalConflict) .given(queen1, queen2) .expectReward(1); }

Target:
public void horizontalConflictWithTwoQueens() { Queen queen1 = new Queen(0, row1, column1); Queen queen2 = new Queen(1, row1, column2); constraintVerifier.verifyThat(constraintProvider::horizontalConflict) .given(queen1, queen2) .penalizesBy(1); }
Source:
public void handleDelete(ActionParameters params) throws ActionException { final int id = params.getRequiredParamInt(PARAM_ID); final boolean deleteLayers = params.getRequiredParamBoolean(PARAM_DELETE_LAYERS); if (!dataProviderService.hasPermissionToUpdate(params.getUser(), id)) { throw new ActionDeniedException("Unauthorized user tried to remove data provider id=" + id); } if (deleteLayers) { deleteDataProviderAndLayers(id, params); } else { deleteDataProvider(id, params); } }

Target:
public void handleDelete(ActionParameters params) throws ActionException { final int id = params.getRequiredParamInt(PARAM_ID); final boolean deleteLayers = params.getRequiredParamBoolean(PARAM_DELETE_LAYERS); if (!dataProviderService.hasPermissionToUpdate(params.getUser(), id)) { throw new ActionDeniedException("Unauthorized user tried to remove data provider id=" + id); } List<OskariLayer> layers = mapLayerService.findByDataProviderId(id); if (!deleteLayers) { removeProviderFromLayers(layers, id); } deleteDataProvider(layers, deleteLayers, id, params); }
Source:
public PetriNet() { super(); includes = new IncludeHierarchy(this, null); }

Target:
public PetriNet() { this(new NormalPetriNetName("")); }
Source:
private void expire(final String key, final int expireInSeconds) { ops.expire(key, expireInSeconds); }

Target:
private void expire(final String key, final int expireInSeconds) { final Long result = ops.expire(key, expireInSeconds); if (result != 1L) { throw new RedisException("Failed to expire key " + key + "."); } }
Source:
private List<Step> buildStepsTree(List<Step> steps) { List<Step> jobDirectSteps = new ArrayList<>(); Map<Guid, List<Step>> parentStepMap = new HashMap<>(); for (Step step : steps) { if (step.getParentStepId() == null) { jobDirectSteps.add(step); } else { MultiValueMapUtils.addToMap(step.getParentStepId(), step, parentStepMap); } } for (Step step : steps) { if (parentStepMap.get(step.getId()) != null) { step.setSteps(parentStepMap.get(step.getId())); } } return jobDirectSteps; }

Target:
private List<Step> buildStepsTree(List<Step> steps) { List<Step> jobDirectSteps = new ArrayList<>(); Map<Guid, List<Step>> parentStepMap = new HashMap<>(); for (Step step : steps) { if (step.getParentStepId() == null) { jobDirectSteps.add(step); } else { MultiValueMapUtils.addToMap(step.getParentStepId(), step, parentStepMap); } } for (Step step : steps) { if (parentStepMap.containsKey(step.getId())) { step.setSteps(parentStepMap.get(step.getId())); } } return jobDirectSteps; }
Source:
BeanPojoProperties(Type type) { super(type); try { this.info = Introspector.getBeanInfo(GenericTypes.getErasedType(type)); } catch (IntrospectionException e) { throw new IllegalArgumentException("Failed to inspect bean " + type, e); } final Map<String, BeanPojoProperty<T>> props = new LinkedHashMap<>(); for (PropertyDescriptor property : info.getPropertyDescriptors()) { final BeanPojoProperty<T> bp = new BeanPojoProperty<>(property); props.put(bp.getName(), bp); } properties = Collections.unmodifiableMap(props); }

Target:
BeanPojoProperties(Type type) { super(type); try { this.info = Introspector.getBeanInfo(GenericTypes.getErasedType(type)); } catch (IntrospectionException e) { throw new IllegalArgumentException("Failed to inspect bean " + type, e); } final Map<String, BeanPojoProperty<T>> props = new LinkedHashMap<>(); for (PropertyDescriptor property : info.getPropertyDescriptors()) { if (shouldSeeProperty(property)) { final BeanPojoProperty<T> bp = new BeanPojoProperty<>(property); props.put(bp.getName(), bp); } } properties = Collections.unmodifiableMap(props); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { RepositoryTreeNode<String> node = getSelectedNodes(event).get(0); URIish uri; try { uri = new URIish(node.getObject()); } catch (URISyntaxException e) { Activator.error(e.getMessage(), e); return null; } UserPasswordCredentials credentials = LoginDialog.changeCredentials(getShell(event), uri); if (credentials == null) return null; try { Activator.getDefault().getSecureStore().putCredentials(uri, credentials); } catch (StorageException e) { Activator.error(UIText.ChangeCredentialsPushCommand_writingToSecureStoreFailed, e); } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { RepositoryTreeNode<String> node = getSelectedNodes(event).get(0); URIish uri; try { uri = new URIish(node.getObject()); } catch (URISyntaxException e) { Activator.error(e.getMessage(), e); return null; } UserPasswordCredentials credentials = LoginDialog.changeCredentials(getShell(event), uri); if (credentials == null) return null; try { Activator.getDefault().getSecureStore().putCredentials(uri, credentials); } catch (StorageException e) { Activator.error(UIText.ChangeCredentialsCommand_writingToSecureStoreFailed, e); } return null; }
Source:
public long serialize(final SnapshotBuffer sb) { ReceivedRootNode rm = (ReceivedRootNode) this.onReceive.getRootNode(); if (VmSettings.TEST_SNAPSHOTS || VmSettings.TEST_SERIALIZE_ALL || sb.getSnapshotVersion() > this.getMessageId()) { return rm.getSerializer().execute(this, sb); } else { return -1; } }

Target:
public long serialize(final SnapshotBuffer sb) { ReceivedRootNode rm = (ReceivedRootNode) this.onReceive.getRootNode(); if (sb.needsToBeSnapshot(getMessageId())) { return rm.getSerializer().execute(this, sb); } else { return -1; } }
Source:
private Boolean getBooleanCapability(String key) { Object o = getRawCapabilities().get(key); if (o == null) { return null; } else if (o instanceof Boolean) { return (Boolean) o; } else { throw new ClassCastException("DesiredCapability " + key + "'s value is expected to of type Boolean but has been set as type " + o.getClass().getName()); } }

Target:
private Boolean getBooleanCapability(String key) { Object o = getRawCapabilities().get(key); if (o == null) { return null; } else if (o instanceof Boolean) { return (Boolean) o; } else { throw new ClassCastException(String.format( "DesiredCapability %s's value should be boolean: found value %s of type %s", key, o.toString(), o.getClass() .getName())); } }
Source:
private String alertFingerprint(Alert alert) { return alert.getPluginId() + "/" + alert.getName() + "/" + alert.getRisk() + "/" + alert.getConfidence(); }

Target:
private String alertFingerprint(Alert alert) { return alert.getPluginId() + "/" + alert.getRisk() + "/" + alert.getConfidence(); }
Source:
public Iterator<JsonObject> execJsonItems() { JsonArray array = execJson().getAsArray(); List<JsonObject> x = new ArrayList<>(array.size()); array.forEach(elt->{ if ( ! elt.isObject()) x.add(elt.getAsObject()); }); return x.iterator(); }

Target:
public Iterator<JsonObject> execJsonItems() { JsonArray array = execJson().getAsArray(); List<JsonObject> x = new ArrayList<>(array.size()); array.forEach(elt->{ if ( ! elt.isObject()) throw new QueryExecException("Item in an array from a JSON query isn't an object"); x.add(elt.getAsObject()); }); return x.iterator(); }
Source:
public void block() { if (block) { throw new IllegalStateException("Realm is already blocking."); } if (Thread.currentThread() != thread) { throw new IllegalStateException("The current thread is not the correct thread."); } try { block = true; synchronized (queue) { queue.notifyAll(); } while (block) { Runnable runnable = null; synchronized (queue) { if (doProcess) { if (queue.isEmpty()) { queue.wait(); } else { runnable = queue.getFirst(); } } } if (runnable != null) { safeRun(runnable); synchronized (queue) { queue.removeFirst(); queue.notifyAll(); } } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } finally { block = false; } }

Target:
public void block() { if (block) { throw new IllegalStateException("Realm is already blocking."); } if (Thread.currentThread() != thread) { throw new IllegalStateException("The current thread is not the correct thread."); } try { block = true; synchronized (queue) { queue.notifyAll(); } while (block) { Runnable runnable = null; synchronized (queue) { if (queue.isEmpty()) { queue.wait(); } else { runnable = queue.getFirst(); } } if (runnable != null) { safeRun(runnable); synchronized (queue) { queue.removeFirst(); queue.notifyAll(); } } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } finally { block = false; } }
Source:
private boolean addMember(Address joiner, CacheJoinInfo joinInfo) { synchronized (this) { if (expectedMembers.contains(joiner)) { return false; } if (persistentState.isPresent()) { if (!joinInfo.getPersistentStateChecksum().isPresent()) { if (status == ComponentStatus.INSTANTIATED) { throw log.nodeWithoutPersistentStateJoiningCacheWithState(joiner, cacheName); } } else if (persistentState.get().getChecksum() != joinInfo.getPersistentStateChecksum().get()){ throw log.nodeWithIncompatibleStateJoiningCache(joiner, cacheName); } } else { if (joinInfo.getPersistentStateChecksum().isPresent()) { throw log.nodeWithPersistentStateJoiningClusterWithoutState(joiner, cacheName); } } if (this.joinInfo == null) { this.joinInfo = joinInfo; } HashMap<Address, Float> newCapacityFactors = new HashMap<Address, Float>(capacityFactors); newCapacityFactors.put(joiner, joinInfo.getCapacityFactor()); capacityFactors = Immutables.immutableMapWrap(newCapacityFactors); expectedMembers = immutableAdd(expectedMembers, joiner); joiners = immutableAdd(joiners, joiner); if (trace) log.tracef("Added joiner %s to cache %s: members = %s, joiners = %s", joiner, cacheName, expectedMembers, joiners); return true; } }

Target:
private boolean addMember(Address joiner, CacheJoinInfo joinInfo) { synchronized (this) { if (expectedMembers.contains(joiner)) { return false; } if (persistentState.isPresent()) { if (!joinInfo.getPersistentStateChecksum().isPresent()) { if (status == ComponentStatus.INSTANTIATED) { throw log.nodeWithoutPersistentStateJoiningCacheWithState(joiner, cacheName); } } else if (persistentState.get().getChecksum() != joinInfo.getPersistentStateChecksum().get()){ throw log.nodeWithIncompatibleStateJoiningCache(joiner, cacheName); } } else { if (joinInfo.getPersistentStateChecksum().isPresent()) { throw log.nodeWithPersistentStateJoiningClusterWithoutState(joiner, cacheName); } } if (this.joinInfo == null) { this.joinInfo = joinInfo; } HashMap<Address, Float> newCapacityFactors = new HashMap<Address, Float>(capacityFactors); newCapacityFactors.put(joiner, joinInfo.getCapacityFactor()); capacityFactors = Immutables.immutableMapWrap(newCapacityFactors); expectedMembers = immutableAdd(expectedMembers, joiner); persistentUUIDManager.addPersistentAddressMapping(joiner, joinInfo.getPersistentUUID()); joiners = immutableAdd(joiners, joiner); if (trace) log.tracef("Added joiner %s to cache %s with persistent uuid %s: members = %s, joiners = %s", joiner, cacheName, joinInfo.getPersistentUUID(), expectedMembers, joiners); return true; } }
Source:
public void and_overloaded() { when(mock.oneArg(and(eq(false), eq(false)))).thenReturn("0"); when(mock.oneArg(and(eq((byte) 1), eq((byte) 1)))).thenReturn("1"); when(mock.oneArg(and(eq('a'), eq('a')))).thenReturn("2"); when(mock.oneArg(and(eq((double) 1), eq((double) 1)))).thenReturn("3"); when(mock.oneArg(and(eq((float) 1), eq((float) 1)))).thenReturn("4"); when(mock.oneArg(and(eq((int) 1), eq((int) 1)))).thenReturn("5"); when(mock.oneArg(and(eq(1L), eq(1L)))).thenReturn("6"); when(mock.oneArg(and(eq((short) 1), eq((short) 1)))).thenReturn("7"); when(mock.oneArg(and(contains("a"), contains("d")))).thenReturn("8"); when(mock.oneArg(and(isA(Class.class), eq(Object.class)))).thenReturn("9"); assertEquals("0", mock.oneArg(false)); assertEquals(null, mock.oneArg(true)); assertEquals("1", mock.oneArg((byte) 1)); assertEquals("2", mock.oneArg('a')); assertEquals("3", mock.oneArg((double) 1)); assertEquals("4", mock.oneArg((float) 1)); assertEquals("5", mock.oneArg((int) 1)); assertEquals("6", mock.oneArg(1L)); assertEquals("7", mock.oneArg((short) 1)); assertEquals("8", mock.oneArg("abcde")); assertEquals(null, mock.oneArg("aaaaa")); assertEquals("9", mock.oneArg(Object.class)); }

Target:
public void and_overloaded() { when(mock.oneArg(and(eq(false), eq(false)))).thenReturn("0"); when(mock.oneArg(and(eq((byte) 1), eq((byte) 1)))).thenReturn("1"); when(mock.oneArg(and(eq('a'), eq('a')))).thenReturn("2"); when(mock.oneArg(and(eq(1D), eq(1D)))).thenReturn("3"); when(mock.oneArg(and(eq(1F), eq(1F)))).thenReturn("4"); when(mock.oneArg(and(eq(1), eq(1)))).thenReturn("5"); when(mock.oneArg(and(eq(1L), eq(1L)))).thenReturn("6"); when(mock.oneArg(and(eq((short) 1), eq((short) 1)))).thenReturn("7"); when(mock.oneArg(and(contains("a"), contains("d")))).thenReturn("8"); when(mock.oneArg(and(isA(Class.class), eq(Object.class)))).thenReturn("9"); assertEquals("0", mock.oneArg(false)); assertEquals(null, mock.oneArg(true)); assertEquals("1", mock.oneArg((byte) 1)); assertEquals("2", mock.oneArg('a')); assertEquals("3", mock.oneArg(1D)); assertEquals("4", mock.oneArg(1F)); assertEquals("5", mock.oneArg(1)); assertEquals("6", mock.oneArg(1L)); assertEquals("7", mock.oneArg((short) 1)); assertEquals("8", mock.oneArg("abcde")); assertEquals(null, mock.oneArg("aaaaa")); assertEquals("9", mock.oneArg(Object.class)); }
Source:
public void run() { int qSize = hwf.getWorkerQueue().size(); while(!stopped.get()){ try{ while(hwf.getWorkerQueue().size() > qSize/2 && !stopped.get()){ UtilWaitThread.sleep(50, stopped); } List<TabletInfo<TabletData>> tablets = new ArrayList<>(tabletInfoCache.getTablets()); Collections.shuffle(tablets, rand); long minRetryTime = MAX_SLEEP_TIME + System.currentTimeMillis(); int notifications = 0; int tabletsScanned = 0; try{ for (TabletInfo<TabletData> tabletInfo : tablets) { if(System.currentTimeMillis() >= tabletInfo.getData().retryTime){ int count = 0; ModulusParams modParams = hwf.getModulusParams(); if(modParams != null){ count = scan(modParams, tabletInfo.getRange()); tabletsScanned++; } tabletInfo.getData().updateScanCount(count); notifications += count; if(stopped.get()) break; } minRetryTime = Math.min(tabletInfo.getData().retryTime, minRetryTime); } }catch(ModParamsChangedException mpce){ hwf.getWorkerQueue().clear(); waitForFindersToStabalize(); } long sleepTime = Math.max(MIN_SLEEP_TIME, minRetryTime - System.currentTimeMillis()); qSize = hwf.getWorkerQueue().size(); log.debug("Scanned of tablets, added new notifications (total queued {})", tabletsScanned, tablets.size(), notifications, qSize); UtilWaitThread.sleep(sleepTime, stopped); }catch(Exception e){ if(isInterruptedException(e)) log.debug("Error while looking for notifications", e); else log.error("Error while looking for notifications", e); } } }

Target:
public void run() { int qSize = hwf.getWorkerQueue().size(); while(!stopped.get()){ try{ while(hwf.getWorkerQueue().size() > qSize/2 && !stopped.get()){ UtilWaitThread.sleep(50, stopped); } List<TabletInfo<TabletData>> tablets = new ArrayList<>(tabletInfoCache.getTablets()); Collections.shuffle(tablets, rand); long minRetryTime = max_sleep_time + System.currentTimeMillis(); int notifications = 0; int tabletsScanned = 0; try{ for (TabletInfo<TabletData> tabletInfo : tablets) { if(System.currentTimeMillis() >= tabletInfo.getData().retryTime){ int count = 0; ModulusParams modParams = hwf.getModulusParams(); if(modParams != null){ count = scan(modParams, tabletInfo.getRange()); tabletsScanned++; } tabletInfo.getData().updateScanCount(count, max_sleep_time); notifications += count; if(stopped.get()) break; } minRetryTime = Math.min(tabletInfo.getData().retryTime, minRetryTime); } }catch(ModParamsChangedException mpce){ hwf.getWorkerQueue().clear(); waitForFindersToStabalize(); } long sleepTime = Math.max(min_sleep_time, minRetryTime - System.currentTimeMillis()); qSize = hwf.getWorkerQueue().size(); log.debug("Scanned of tablets, added new notifications (total queued {})", tabletsScanned, tablets.size(), notifications, qSize); if (!stopped.get()) UtilWaitThread.sleep(sleepTime, stopped); }catch(Exception e){ if(isInterruptedException(e)) log.debug("Error while looking for notifications", e); else log.error("Error while looking for notifications", e); } } }
Source:
public static void startES() throws Exception { FileUtil.delete("target/data"); Settings localSettings = Settings.settingsBuilder() .put("http.enabled", true) .put("number_of_shards", 1) .put("number_of_replicas", 1) .put("path.home", "target/data") .build(); esNode = NodeBuilder.nodeBuilder().settings(localSettings).local(false).build().start(); Thread.currentThread().sleep(3000); }

Target:
public static void startES() throws Exception { FileUtil.delete("target/data"); Settings localSettings = Settings.settingsBuilder() .put("http.enabled", true) .put("number_of_shards", 1) .put("number_of_replicas", 1) .put("path.home", "target/data") .build(); esNode = NodeBuilder.nodeBuilder().settings(localSettings).local(false).build().start(); Thread.currentThread().sleep(1000); }
Source:
private void maybeRecordE2ELatency(final long recordTimestamp, final long now, final String nodeName) { final Sensor e2eLatencySensor = e2eLatencySensors.get(nodeName); if (e2eLatencySensor == null) { throw new IllegalStateException("Requested to record e2e latency but could not find sensor for node " + nodeName); } else if (e2eLatencySensor.shouldRecord() && e2eLatencySensor.hasMetrics()) { final long e2eLatency = now - recordTimestamp; if (e2eLatency > MAXIMUM_E2E_LATENCY) { log.warn("Skipped recording e2e latency for node because is higher than maximum allowed latency {}", nodeName, e2eLatency, MAXIMUM_E2E_LATENCY); } else if (e2eLatency < MINIMUM_E2E_LATENCY) { log.warn("Skipped recording e2e latency for node because is smaller than minimum allowed latency {}", nodeName, e2eLatency, MINIMUM_E2E_LATENCY); } else { e2eLatencySensor.record(e2eLatency, now); } } }

Target:
private void maybeRecordE2ELatency(final long recordTimestamp, final long now, final String nodeName) { final Sensor e2eLatencySensor = e2eLatencySensors.get(nodeName); if (e2eLatencySensor == null) { throw new IllegalStateException("Requested to record e2e latency but could not find sensor for node " + nodeName); } else if (e2eLatencySensor.shouldRecord() && e2eLatencySensor.hasMetrics()) { e2eLatencySensor.record(now - recordTimestamp, now); } }
Source:
public void testFormatTimeCalendar() { String calendarTime = Utils.formatTime(37935447675l, TimeFormat.CALENDAR, Resolution.NANOSEC); assertEquals("19:00:37.935447675", calendarTime); }

Target:
public void testFormatTimeCalendar() { String calendarTime = Utils.formatTime(37935447675l, TimeFormat.CALENDAR, Resolution.NANOSEC); assertTrue(calendarTime.endsWith("37.935447675")); }
Source:
private void initNetworkList(Guid dataCenterId) { startProgress(); IdQueryParameters queryParams = new IdQueryParameters(dataCenterId); Frontend.getInstance().runQuery(QueryType.GetAllNetworks, queryParams, new AsyncQuery<QueryReturnValue>(returnValue -> { Collection<Network> networks = returnValue.getReturnValue(); getNetwork().setItems(networks.stream().filter(Network::isVmNetwork).collect(Collectors.toList())); updateNetworks(networks); stopProgress(); })); }

Target:
private void initNetworkList(Guid dataCenterId) { startProgress(); AsyncDataProvider.getInstance().getNetworkList(new AsyncQuery<>(returnValue -> { Collection<Network> networks = returnValue.stream().filter(Network::isVmNetwork).collect(Collectors.toList()); getNetwork().setItems(networks); updateNetworks(networks); stopProgress(); }), dataCenterId); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VDS other = (VDS) obj; return (ObjectUtils.objectsEqual(mVdsStatic, other.mVdsStatic) && ObjectUtils.objectsEqual(cpuName, other.cpuName) && _spm_status == other._spm_status && cpuOverCommitDurationMinutes == other.cpuOverCommitDurationMinutes && highUtilization == other.highUtilization && lowUtilization == other.lowUtilization && ObjectUtils.objectsEqual(mImagesLastCheck, other.mImagesLastCheck) && ObjectUtils.objectsEqual(mImagesLastDelay, other.mImagesLastDelay) && ObjectUtils.objectsEqual(mInterfaceList, other.mInterfaceList) && ObjectUtils.objectsEqual(mNetworkList, other.mNetworkList) && maxVdsMemoryOverCommit == other.maxVdsMemoryOverCommit && ObjectUtils.objectsEqual(privateDomains, other.privateDomains) && ObjectUtils.objectsEqual(vdsSpmId, other.vdsSpmId) && selectionAlgorithm == other.selectionAlgorithm && ObjectUtils.objectsEqual(storagePoolId, other.storagePoolId) && ObjectUtils.objectsEqual(storagePoolName, other.storagePoolName) && ObjectUtils.objectsEqual(vdsGroupCompatibilityVersion, other.vdsGroupCompatibilityVersion) && ObjectUtils.objectsEqual(vdsGroupCpuName, other.vdsGroupCpuName) && ObjectUtils.objectsEqual(vdsGroupDescription, other.vdsGroupDescription) && ObjectUtils.objectsEqual(vdsGroupName, other.vdsGroupName) $$ trustedService == other.trustedService); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VDS other = (VDS) obj; return (ObjectUtils.objectsEqual(mVdsStatic, other.mVdsStatic) && ObjectUtils.objectsEqual(cpuName, other.cpuName) && _spm_status == other._spm_status && cpuOverCommitDurationMinutes == other.cpuOverCommitDurationMinutes && highUtilization == other.highUtilization && lowUtilization == other.lowUtilization && ObjectUtils.objectsEqual(mImagesLastCheck, other.mImagesLastCheck) && ObjectUtils.objectsEqual(mImagesLastDelay, other.mImagesLastDelay) && ObjectUtils.objectsEqual(mInterfaceList, other.mInterfaceList) && ObjectUtils.objectsEqual(mNetworkList, other.mNetworkList) && maxVdsMemoryOverCommit == other.maxVdsMemoryOverCommit && ObjectUtils.objectsEqual(privateDomains, other.privateDomains) && ObjectUtils.objectsEqual(vdsSpmId, other.vdsSpmId) && selectionAlgorithm == other.selectionAlgorithm && ObjectUtils.objectsEqual(storagePoolId, other.storagePoolId) && ObjectUtils.objectsEqual(storagePoolName, other.storagePoolName) && ObjectUtils.objectsEqual(vdsGroupCompatibilityVersion, other.vdsGroupCompatibilityVersion) && ObjectUtils.objectsEqual(vdsGroupCpuName, other.vdsGroupCpuName) && ObjectUtils.objectsEqual(vdsGroupDescription, other.vdsGroupDescription) && ObjectUtils.objectsEqual(vdsGroupName, other.vdsGroupName) && trustedService == other.trustedService); }
Source:
private SolrClient getSolrClient(String storeName) throws PersistenceException { try { final SolrClient solrClient = solrCients.computeIfAbsent(storeName, clientFactory::newClient); if (solrClient.isAvailable(5, TimeUnit.SECONDS)) { return solrClient; } } catch (InterruptedException e) { LOGGER.warn("Error getting available solr server for core: {}", storeName, e); Thread.currentThread().interrupt(); } throw new PersistenceException("Solr client is not available"); }

Target:
private SolrClient getSolrClient(String storeName) throws PersistenceException { try { final SolrClient solrClient = solrClients.computeIfAbsent(storeName, clientFactory::newClient); if (solrClient.isAvailable(5, TimeUnit.SECONDS)) { return solrClient; } } catch (InterruptedException e) { LOGGER.warn("Error getting available solr server for core: {}", storeName, e); Thread.currentThread().interrupt(); } throw new PersistenceException("Solr client is not available"); }