auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static Object objectConvert(Object value, Class<?> type) { Object result = value; String typeName = type.getSimpleName(); if (value instanceof BigDecimal && !type.equals(BigDecimal.class)) { BigDecimal bdValue = (BigDecimal) value; if (type.equals(Float.class) || typeName.equals("float")) { result = bdValue.floatValue(); } else if (type.equals(Double.class) || typeName.equals("double")) { result = bdValue.doubleValue(); } else if (type.equals(Long.class) || typeName.equals("long")) { result = bdValue.longValue(); } else if (type.equals(Integer.class) || typeName.equals("int")) { result = bdValue.intValue(); } } else if (value instanceof String && !type.equals(String.class)) { String bdValue = (String) value; if (type.equals(Float.class) || typeName.equals("float")) { result = Float.valueOf(bdValue); } else if (type.equals(Double.class) || typeName.equals("double")) { result = Double.valueOf(bdValue); } else if (type.equals(Long.class) || typeName.equals("long")) { result = Long.valueOf(bdValue); } else if (type.equals(BigDecimal.class)) { result = new BigDecimal(bdValue); } else if (type.equals(Integer.class) || typeName.equals("int")) { result = Integer.valueOf(bdValue); } else if (type.equals(Boolean.class) || typeName.equals("boolean")) { result = Boolean.valueOf(bdValue); } else if (type.isEnum()) { @SuppressWarnings({ "rawtypes" }) final Class<? extends Enum> enumType = (Class<? extends Enum>) type; return Enum.valueOf(enumType, value.toString()); } } return result; }

Target:
private static Object objectConvert(Object value, Class<?> type) { Object result = value; String typeName = type.getSimpleName(); if (value instanceof BigDecimal && !type.equals(BigDecimal.class)) { BigDecimal bdValue = (BigDecimal) value; if (type.equals(Float.class) || typeName.equals("float")) { result = bdValue.floatValue(); } else if (type.equals(Double.class) || typeName.equals("double")) { result = bdValue.doubleValue(); } else if (type.equals(Long.class) || typeName.equals("long")) { result = bdValue.longValue(); } else if (type.equals(Integer.class) || typeName.equals("int")) { result = bdValue.intValue(); } } else if (value instanceof String && !type.equals(String.class)) { String bdValue = (String) value; if (type.equals(Float.class) || typeName.equals("float")) { result = Float.valueOf(bdValue); } else if (type.equals(Double.class) || typeName.equals("double")) { result = Double.valueOf(bdValue); } else if (type.equals(Long.class) || typeName.equals("long")) { result = Long.valueOf(bdValue); } else if (type.equals(BigDecimal.class)) { result = new BigDecimal(bdValue); } else if (type.equals(Integer.class) || typeName.equals("int")) { result = Integer.valueOf(bdValue); } else if (type.equals(Boolean.class) || typeName.equals("boolean")) { result = Boolean.valueOf(bdValue); } else if (type.isEnum()) { @SuppressWarnings({ "rawtypes", "unchecked" }) final Class<? extends Enum> enumType = (Class<? extends Enum>) type; @SuppressWarnings({ "unchecked" }) final Enum<?> enumvalue = Enum.valueOf(enumType, value.toString()); result = enumvalue; } } return result; }
Source:
public void manualJPushAlert(long id) { JPushAlertModel jPushAlertModel = jPushAlertMapper.findJPushAlertModelById(id); if (jPushAlertModel != null) { if (jPushAlertModel.isAutomatic()) { logger.debug("JPush is failed, this JPush is not manual, id = " + id); return; } List<String> districtCode = jPushAlertModel.getPushObjects(); List<String> districtName = null; if (CollectionUtils.isNotEmpty(districtCode)) { districtName = Lists.transform(districtCode, new Function<String, String>() { @Override public String apply(String input) { return DistrictUtil.convertCodeToName(input); } }); } if (jPushAlertModel.getPushUserType().contains(PushUserType.ALL) && jPushAlertModel.getPushObjects() == null) { String[] jumpToOrLink = chooseJumpToOrLink(new JPushAlertDto(jPushAlertModel)); mobileAppJPushClient.sendPushAlertByAll(String.valueOf(jPushAlertModel.getId()), jPushAlertModel.getContent(), jumpToOrLink[0], jumpToOrLink[1], jPushAlertModel.getPushSource()); } else { List<String> loginNames = findManualJPushAlertUserLoginName(jPushAlertModel.getPushUserType(), districtName); if (CollectionUtils.isEmpty(loginNames)) { logger.debug("this JPush without data, id = " + id); return; } autoJPushByBatchRegistrationId(jPushAlertModel, loginNames, jPushAlertModel.getPushSource()); } jPushAlertModel.setStatus(PushStatus.SEND_SUCCESS); jPushAlertMapper.update(jPushAlertModel); } else { logger.debug("this JPush is disabled, id = " + id); } }

Target:
public void manualJPushAlert(long id) { JPushAlertModel jPushAlertModel = jPushAlertMapper.findJPushAlertModelById(id); if (jPushAlertModel != null) { if (jPushAlertModel.isAutomatic()) { logger.debug("JPush is failed, this JPush is not manual, id = " + id); return; } List<String> districtCode = jPushAlertModel.getPushDistricts(); List<String> districtName = null; if (CollectionUtils.isNotEmpty(districtCode)) { districtName = Lists.transform(districtCode, new Function<String, String>() { @Override public String apply(String input) { return DistrictUtil.convertCodeToName(input); } }); } if (jPushAlertModel.getPushUserType().contains(PushUserType.ALL) && jPushAlertModel.getPushDistricts() == null) { String[] jumpToOrLink = chooseJumpToOrLink(new JPushAlertDto(jPushAlertModel)); mobileAppJPushClient.sendPushAlertByAll(String.valueOf(jPushAlertModel.getId()), jPushAlertModel.getContent(), jumpToOrLink[0], jumpToOrLink[1], jPushAlertModel.getPushSource()); } else { List<String> loginNames = findManualJPushAlertUserLoginName(jPushAlertModel.getPushUserType(), districtName); if (CollectionUtils.isEmpty(loginNames)) { logger.debug("this JPush without data, id = " + id); return; } autoJPushByBatchRegistrationId(jPushAlertModel, loginNames, jPushAlertModel.getPushSource()); } jPushAlertModel.setStatus(PushStatus.SEND_SUCCESS); jPushAlertMapper.update(jPushAlertModel); } else { logger.debug("this JPush is disabled, id = " + id); } }
Source:
public synchronized void setH2DbService(H2DbService dbService) { this.dbService = dbService; startDbStore(); }

Target:
public synchronized void setH2DbService(H2DbService dbService) { this.dbService = dbService; startDbStore(); signalPublisher(); }
Source:
public void addFeedbackResponseComment(String addResponseCommentId, String commentText) { waitForElementPresence(By.id(addResponseCommentId)); WebElement addResponseCommentForm = browser.driver.findElement(By.id(addResponseCommentId)); WebElement parentContainer = addResponseCommentForm.findElement(By.xpath("../..")); WebElement showResponseCommentAddFormButton = parentContainer.findElement(By.id("button_add_comment")); click(showResponseCommentAddFormButton); WebElement editorElement = addResponseCommentForm.findElement(By.className("mce-content-body")); waitForRichTextEditorToLoad(editorElement.getAttribute("id")); fillRichTextEditor(editorElement.getAttribute("id"), commentText); click(addResponseCommentForm.findElement(By.className("col-sm-offset-5")).findElement(By.tagName("a"))); if (commentText.isEmpty()) { waitForElementToBeClickable(editorElement); } else { waitForElementToDisappear(By.id(addResponseCommentId)); } }

Target:
public void addFeedbackResponseComment(String addResponseCommentId, String commentText) { WebElement addResponseCommentForm = browser.driver.findElement(By.id(addResponseCommentId)); WebElement parentContainer = addResponseCommentForm.findElement(By.xpath("../..")); WebElement showResponseCommentAddFormButton = parentContainer.findElement(By.id("button_add_comment")); click(showResponseCommentAddFormButton); WebElement editorElement = addResponseCommentForm.findElement(By.className("mce-content-body")); waitForRichTextEditorToLoad(editorElement.getAttribute("id")); fillRichTextEditor(editorElement.getAttribute("id"), commentText); click(addResponseCommentForm.findElement(By.className("col-sm-offset-5")).findElement(By.tagName("a"))); if (commentText.isEmpty()) { waitForElementToBeClickable(editorElement); } else { waitForElementToDisappear(By.id(addResponseCommentId)); } }
Source:
private void startPythonWorker() throws IOException { String pythonWorker = MyriaConstants.PYTHONWORKER; ProcessBuilder pb = new ProcessBuilder(MyriaConstants.PYTHONEXEC, "-m", pythonWorker); final Map<String, String> env = pb.environment(); env.put("PYTHONUNBUFFERED", "YES"); pb.redirectError(Redirect.INHERIT); pb.redirectOutput(Redirect.INHERIT); worker = pb.start(); OutputStream stdin = worker.getOutputStream(); OutputStreamWriter out = new OutputStreamWriter(stdin, StandardCharsets.UTF_8); out.write(serverSocket.getLocalPort() + "\n"); out.flush(); clientSock = serverSocket.accept(); LOGGER.info("successfully launched worker"); setupStreams(); return; }

Target:
private void startPythonWorker() throws IOException { String pythonWorker = MyriaConstants.PYTHONWORKER; ProcessBuilder pb = new ProcessBuilder(MyriaConstants.PYTHONEXEC, "-m", pythonWorker); final Map<String, String> env = pb.environment(); env.put("PYTHONUNBUFFERED", "YES"); pb.redirectError(Redirect.INHERIT); pb.redirectOutput(Redirect.INHERIT); worker = pb.start(); OutputStream stdin = worker.getOutputStream(); OutputStreamWriter out = new OutputStreamWriter(stdin, StandardCharsets.UTF_8); out.write(serverSocket.getLocalPort() + "\n"); out.flush(); clientSock = serverSocket.accept(); setupStreams(); }
Source:
public static boolean isStopGlusterProcessesSupported(Version version) { return Version.v3_5.compareTo(version) <= 0; }

Target:
public static boolean isStopGlusterProcessesSupported(Version version) { return Version.v3_5.lessOrEquals(version); }
Source:
public static List<FilterEntry> parse(String filters) { List<FilterEntry> ret = new LinkedList<>(); if (!PATTERN_BLANK.matcher(filters).matches()) { Matcher m = PATTERN_PARSE.matcher(filters); boolean ok = false; int expectedStart = 0; while (m.find()) { log.debug("parse: handling '{}'", m.group(0)); if (m.start() != expectedStart) { throw new RuntimeException("Cannot parse filters"); } expectedStart = m.end(); ok = m.end() == m.regionEnd(); ret.add( new FilterEntry( m.group("anymsg") != null ? null : m.group("message"), m.group("anyseverity") != null ? null : m.group("severity"), m.group("exclude") != null, m.group("recipient") == null || m.group("anyrecipient") != null ? null : new Recipient( m.group("transport"), m.group("name") ) ) ); } if (!ok) { throw new IllegalArgumentException("Cannot parse filters"); } } return ret; }

Target:
public static List<FilterEntry> parse(String filters) { List<FilterEntry> ret = new LinkedList<>(); if (!PATTERN_BLANK.matcher(filters).matches()) { Matcher m = PATTERN_PARSE.matcher(filters); boolean ok = false; int expectedStart = 0; while (m.find()) { log.debug("parse: handling '{}'", m.group(0)); if (m.start() != expectedStart) { throw new RuntimeException("Cannot parse filters"); } expectedStart = m.end(); ok = m.end() == m.regionEnd(); ret.add( new FilterEntry( m.group("anymsg") != null ? null : m.group("message"), m.group("severity") == null || m.group("severity").equals("*") ? null : AuditLogSeverity.valueOf(m.group("severity")), m.group("exclude") != null, m.group("recipient") == null || m.group("anyrecipient") != null ? null : new Recipient( m.group("transport"), m.group("name") ) ) ); } if (!ok) { throw new IllegalArgumentException("Cannot parse filters"); } } return ret; }
Source:
private void deleteAllRefs() throws Exception { final RevWalk rw = new RevWalk(db); for (final Ref r : db.getRefDatabase().getAllRefs()) { if (Constants.HEAD.equals(r.getName())) continue; final RefUpdate u = db.updateRef(r.getName()); u.setForceUpdate(true); u.delete(rw); } }

Target:
private void deleteAllRefs() throws Exception { final RevWalk rw = new RevWalk(db); for (Ref r : db.getRefDatabase().getAllRefs()) { if (Constants.HEAD.equals(r.getName())) continue; final RefUpdate u = db.updateRef(r.getName()); u.setForceUpdate(true); u.delete(rw); } }
Source:
public void testTaskValidation() { final ConsistencyChecker.Task.Builder builder = new ConsistencyChecker.Task.Builder() .setSourceMetricName("my_metric") .setRollupMetricName("my_metric_1h") .setPeriod(RollupPeriod.HOURLY) .setTrigger(ConsistencyChecker.Task.Trigger.HUMAN_REQUESTED); builder.setStartTime(Instant.EPOCH).build(); builder.setStartTime(Instant.EPOCH.plus(Duration.ofHours(1))).build(); try { builder.setStartTime(Instant.EPOCH.plus(Duration.ofSeconds(1))).build(); fail(); } catch (final ConstraintsViolatedException e) { } }

Target:
public void testTaskValidation() { final ConsistencyChecker.Task.Builder builder = new ConsistencyChecker.Task.Builder() .setSourceMetricName("my_metric") .setRollupMetricName("my_metric_1h") .setPeriod(RollupPeriod.HOURLY) .setTrigger(ConsistencyChecker.Task.Trigger.ON_DEMAND); builder.setStartTime(Instant.EPOCH).build(); builder.setStartTime(Instant.EPOCH.plus(Duration.ofHours(1))).build(); try { builder.setStartTime(Instant.EPOCH.plus(Duration.ofSeconds(1))).build(); fail("expected ConstraintsViolatedException"); } catch (final ConstraintsViolatedException e) { } }
Source:
private boolean skipLoad(FlagAffectedCommand cmd, Object key, InvocationContext ctx) { if (!shouldAttemptLookup(ctx.lookupEntry(key))) { if (trace) { log.tracef("Skip load for command %s. Entry already exists in context.", cmd); } return true; } if (!canLoad(key)) { if (trace) { log.tracef("Skip load for command %s. Cannot load the key.", cmd); } return true; } boolean skip = false; if (cmd instanceof GetKeyValueCommand) { skip = hasSkipLoadFlag(cmd); if (trace) { log.tracef("Skip load for read command %s? %s", cmd, skip); } } else if (cmd instanceof WriteCommand) { skip = skipLoadForWriteCommand((WriteCommand) cmd, key, ctx); if (trace) { log.tracef("Skip load for write command %s? %s", cmd, skip); } } else { if (trace) { log.tracef("Unknown command type %s. Don't skip load.", cmd); } } return skip; }

Target:
private boolean skipLoad(FlagAffectedCommand cmd, Object key, InvocationContext ctx) { if (!shouldAttemptLookup(ctx.lookupEntry(key))) { if (trace) { log.tracef("Skip load for command %s. Entry already exists in context.", cmd); } return true; } if (!canLoad(key)) { if (trace) { log.tracef("Skip load for command %s. Cannot load the key.", cmd); } return true; } boolean skip; if (cmd instanceof WriteCommand) { skip = skipLoadForWriteCommand((WriteCommand) cmd, key, ctx); if (trace) { log.tracef("Skip load for write command %s? %s", cmd, skip); } } else { skip = hasSkipLoadFlag(cmd); if (trace) { log.tracef("Skip load for command %s?. %s", cmd, skip); } } return skip; }
Source:
private IProject getSingleProject() { IProject first= null; for (Object fElement : fElements) { IProject project= null; if (fElement instanceof IJavaElement) { project= ((IJavaElement) fElement).getJavaProject().getProject(); } else if (fElement instanceof IResource) { project= ((IResource) fElement).getProject(); } if (project != null) { if (first == null) first= project; else if (!project.equals(first)) return null; } } return first; }

Target:
private IProject getSingleProject() { IProject first= null; for (Object javaElement : fElements) { IProject project= null; if (javaElement instanceof IJavaElement) { project= ((IJavaElement) javaElement).getJavaProject().getProject(); } else if (javaElement instanceof IResource) { project= ((IResource) javaElement).getProject(); } if (project != null) { if (first == null) first= project; else if (!project.equals(first)) return null; } } return first; }
Source:
public boolean isExistingLabel(PickerLabel targetLabel) { return allLabels.stream() .filter(label -> issue.getLabels().contains(targetLabel.getActualName())) .count() > 0; }

Target:
private boolean isExistingLabel(PickerLabel targetLabel) { return isExistingLabel(targetLabel.getActualName()); }
Source:
@Override public void onResponse(Call<AnnouncementList> call, Response<AnnouncementList> response) { if (response.isSuccessful()) { List<Card> cards = new ArrayList<>(); AnnouncementList content = response.body(); if (content != null && content.items() != null) { cards = buildCards(content.items()); } cb.success(cards); } else { L.v(response.message()); cb.error(new IOException(response.message())); } }

Target:
@Override public void onResponse(Call<AnnouncementList> call, Response<AnnouncementList> response) { if (response.isSuccessful()) { List<Card> cards = new ArrayList<>(); AnnouncementList content = response.body(); if (content != null) { cards.addAll(buildCards(content.items())); } cb.success(cards); } else { L.v(response.message()); cb.error(new IOException(response.message())); } }
Source:
public Secret getPassword() { return secretPassword; }

Target:
public String getPassword() { return Secret.toString(secretPassword); }
Source:
public DiskProfile getProfile() { if (profile == null) { if (getParameters().getProfile() != null) { profile = getParameters().getProfile(); } else if (getParameters().getProfileId() != null) { profile = getProfileDao().get(getParameters().getProfileId()); } else { log.error("couldn't find disk profile"); } } return profile; }

Target:
public DiskProfile getProfile() { if (profile == null) { if (getParameters().getProfile() != null) { profile = getParameters().getProfile(); } else if (getParameters().getProfileId() != null) { profile = getProfileDao().get(getParameters().getProfileId()); } } return profile; }
Source:
public AbstractCppGenerator getGenerator ( CppCodeGenerator.Kind kind, CppCodePattern cpp, NamedElement element, NamedElement context ) { switch( kind ) { case Structural: return new CompositionGenerator .Factory() .create( cpp, (Capsule) element, null ); case StateMachine: return new StateMachineGenerator .Factory() .create( cpp, (StateMachine) element, (Capsule)context ); default: return super.getGenerator( kind, cpp, element, context ); } }

Target:
public AbstractCppGenerator getGenerator ( CppCodeGenerator.Kind kind, CppCodePattern cpp, NamedElement element, NamedElement context ) { if (element == null) return null; switch( kind ) { case Structural: if (!(element instanceof Capsule)) return null; return new CompositionGenerator .Factory() .create( cpp, (Capsule) element, null ); case StateMachine: if (!(element instanceof StateMachine) || !(context instanceof Capsule)) return null; return new StateMachineGenerator .Factory() .create( cpp, (StateMachine) element, (Capsule)context ); default: return super.getGenerator( kind, cpp, element, context ); } }
Source:
public void accept(List<Span> spans, Callback<Void> callback) { if (spans.isEmpty()) { callback.onSuccess(null); return; } metrics.incrementSpans(spans.size()); List<Span> sampled = sample(spans); if (sampled.isEmpty()) { callback.onSuccess(null); return; } try { record(sampled, acceptSpansCallback(sampled)); callback.onSuccess(null); } catch (RuntimeException | Error e) { handleStorageError(spans, e, callback); } }

Target:
public void accept(List<Span> spans, Callback<Void> callback) { if (spans.isEmpty()) { callback.onSuccess(null); return; } metrics.incrementSpans(spans.size()); List<Span> sampledSpans = sample(spans); if (sampledSpans.isEmpty()) { callback.onSuccess(null); return; } Callback<Void> logOnErrorCallback = storeSpansCallback(sampledSpans); try { store(sampledSpans, logOnErrorCallback); callback.onSuccess(null); } catch (RuntimeException | Error e) { handleStorageError(spans, e, callback); } }
Source:
private boolean sendMessagesForChangedEntries(String url, SyndFeed cachedFeed, SyndFeed fetchedFeed, String regex) { boolean anyChanges = false; for (SyndEntry fetchedEntry : fetchedFeed.getEntries()) { boolean foundInCache = false; for (SyndEntry cachedEntry : cachedFeed.getEntries()) { if (fetchedEntry.getUri().equals(cachedEntry.getUri())) { foundInCache = true; if (areEntriesDifferent(fetchedEntry, cachedEntry)) { sendMessageForFeedEntry(url, fetchedEntry, regex); anyChanges = true; } } } if (!foundInCache) { sendMessageForFeedEntry(url, fetchedEntry, regex); anyChanges = true; } } return anyChanges; }

Target:
private boolean sendMessagesForChangedEntries(String url, SyndFeed cachedFeed, SyndFeed fetchedFeed, String regex) { boolean anyChanges = false; for (SyndEntry fetchedEntry : fetchedFeed.getEntries()) { boolean foundInCache = false; for (SyndEntry cachedEntry : cachedFeed.getEntries()) { if (fetchedEntry.getUri().equals(cachedEntry.getUri())) { foundInCache = true; if (areEntriesDifferent(fetchedEntry, cachedEntry)) { LOGGER.debug("Sending message for changed entry in feed {}", fetchedEntry.getUri(), url); sendMessageForFeedEntry(url, fetchedEntry, regex); anyChanges = true; } } } if (!foundInCache) { LOGGER.debug("Sending message for new entry in feed {}", fetchedEntry.getUri(), url); sendMessageForFeedEntry(url, fetchedEntry, regex); anyChanges = true; } } if (anyChanges == false) { LOGGER.debug("No changes detected in feed {}", url); } return anyChanges; }
Source:
public Ds3TypeMapperParserImpl() throws IOException { objectMapper = new ObjectMapper(); objectMapper.registerModule(new GuavaModule()); final InputStream inputStream = Ds3TypeMapperParserImpl.class.getResourceAsStream("/typeMap.json"); jsonData = ByteStreams.toByteArray(inputStream); }

Target:
public Ds3TypeMapperParserImpl() throws IOException { this.ds3TypeMapper = initDs3TypeMapper(); }
Source:
KafkaProducerWrapper(String logSuffix, Properties props, String metricsNamesPrefix) { _log = LoggerFactory.getLogger(String.format("%s:%s", KafkaTransportProvider.class, logSuffix)); if (!props.containsKey(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG)) { throw new RuntimeException("Bootstrap servers are not set"); } VerifiableProperties transportProviderProperties = new VerifiableProperties(props); _dynamicMetricsManager = DynamicMetricsManager.getInstance(); _metricsNamesPrefix = metricsNamesPrefix == null ? CLASS_NAME : metricsNamesPrefix + CLASS_NAME; _dynamicMetricsManager.registerGauge(_metricsNamesPrefix, AGGREGATE, PRODUCER_COUNT, PRODUCER_GAUGE); _clientId = transportProviderProperties.getProperty(ProducerConfig.CLIENT_ID_CONFIG); if (_clientId == null || _clientId.isEmpty()) { _log.warn("Client ID is either null or empty"); } _sendFailureRetryWaitTimeMs = transportProviderProperties.getLong(CFG_SEND_FAILURE_RETRY_WAIT_MS, DEFAULT_SEND_FAILURE_RETRY_WAIT_MS); _rateLimiter = RateLimiter.create(transportProviderProperties.getDouble(CFG_RATE_LIMITER_CFG, DEFAULT_RATE_LIMITER)); _props = props; String kafkaProducerFactoryName = transportProviderProperties.getString(CFG_KAFKA_PRODUCER_FACTORY, SimpleKafkaProducerFactory.class.getCanonicalName()); _producerFactory = ReflectionUtils.createInstance(kafkaProducerFactoryName); populateDefaultProducerConfigs(); }

Target:
KafkaProducerWrapper(String logSuffix, Properties props, String metricsNamesPrefix) { _log = LoggerFactory.getLogger(String.format("%s:%s", KafkaTransportProvider.class, logSuffix)); if (!props.containsKey(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG)) { throw new RuntimeException("Bootstrap servers are not set"); } VerifiableProperties transportProviderProperties = new VerifiableProperties(props); _dynamicMetricsManager = DynamicMetricsManager.getInstance(); _metricsNamesPrefix = metricsNamesPrefix == null ? CLASS_NAME : metricsNamesPrefix + CLASS_NAME; _dynamicMetricsManager.registerGauge(_metricsNamesPrefix, AGGREGATE, PRODUCER_COUNT, PRODUCER_GAUGE); _clientId = transportProviderProperties.getProperty(ProducerConfig.CLIENT_ID_CONFIG); if (StringUtils.isEmpty(_clientId)) { _log.warn("Client ID is either null or empty"); } _sendFailureRetryWaitTimeMs = transportProviderProperties.getLong(CFG_SEND_FAILURE_RETRY_WAIT_MS, DEFAULT_SEND_FAILURE_RETRY_WAIT_MS); _rateLimiter = RateLimiter.create(transportProviderProperties.getDouble(CFG_RATE_LIMITER_CFG, DEFAULT_RATE_LIMITER)); _props = props; String kafkaProducerFactoryName = transportProviderProperties.getString(CFG_KAFKA_PRODUCER_FACTORY, SimpleKafkaProducerFactory.class.getCanonicalName()); _producerFactory = ReflectionUtils.createInstance(kafkaProducerFactoryName); populateDefaultProducerConfigs(); }
Source:
public void pre(FMLPreInitializationEvent event) { ModelLoader.setCustomModelResourceLocation(DIAMOND_SHIELD, 0, new ModelResourceLocation("minecraft:shield", "inventory")); ModelLoader.setCustomModelResourceLocation(HEAVY_DIAMOND_SWORD, 0, new ModelResourceLocation("minecraft:diamond_sword", "inventory")); TileEntityRendererDispatcher.instance.mapSpecialRenderers.put(TileEntityCustomShield.class, new TileEntitySpecialRenderer<TileEntityCustomShield>() { @Override public void renderTileEntityAt(TileEntityCustomShield entity, double x, double y, double z, float partialTicks, int destroyStage) { Minecraft.getMinecraft().getTextureManager().bindTexture(BannerTextures.SHIELD_BASE_TEXTURE); GlStateManager.pushMatrix(); GlStateManager.scale(1.0F, -1.0F, -1.0F); modelShield.render(); GlStateManager.popMatrix(); } }); ForgeHooksClient.registerTESRItemStack(DIAMOND_SHIELD, 0, TileEntityCustomShield.class); }

Target:
public void pre(FMLPreInitializationEvent event) { ModelLoader.setCustomModelResourceLocation(DIAMOND_SHIELD, 0, new ModelResourceLocation("shield_test:diamond_shield", "inventory")); ModelLoader.setCustomModelResourceLocation(HEAVY_DIAMOND_SWORD, 0, new ModelResourceLocation("minecraft:diamond_sword", "inventory")); }
Source:
private void scheduleLocationUpdate() { Log.i(TAG, "Scheduling mock location updates"); if (locationUpdateTask != null) { locationUpdateTask.cancel(); } locationUpdateTask = new TimerTask() { @Override public void run() { for (MockLocationProvider mockLocationProvider : mockLocationProviders) { Location location = locationFactory.createLocation(mockLocationProvider.getProviderName(), Criteria.ACCURACY_FINE); Log.d(TAG, String.format("Setting location of '%s' to '%s'", mockLocationProvider.getProviderName(), location)); try { mockLocationProvider.setLocation(location); } catch (Exception e) { Log.e(TAG, String.format("Could not set location for '%s': %s", mockLocationProvider.getProviderName(), e.getMessage())); } } } }; locationUpdatesTimer.schedule(locationUpdateTask, 0, UPDATE_INTERVAL_MS); }

Target:
private void scheduleLocationUpdate() { Log.i(TAG, "Scheduling mock location updates"); if (locationUpdateTask != null) { locationUpdateTask.cancel(); } locationUpdateTask = new TimerTask() { @Override public void run() { for (MockLocationProvider mockLocationProvider : mockLocationProviders) { Location location = locationFactory.createLocation(mockLocationProvider.getProviderName(), Criteria.ACCURACY_FINE); Log.d(TAG, String.format("Setting location of '%s' to '%s'", mockLocationProvider.getProviderName(), location)); try { mockLocationProvider.setLocation(location); } catch (Exception e) { Log.e(TAG, String.format("Could not set location for '%s'", mockLocationProvider.getProviderName()), e); } } } }; locationUpdatesTimer.schedule(locationUpdateTask, 0, UPDATE_INTERVAL_MS); }
Source:
public SignUpTask(Context context) { super(TaskProvider.TASK_ID_SIGN_UP); inclusionCriteriaStep = UiManager.getInstance().getInclusionCriteriaStep(context); }

Target:
public SignUpTask(Context context) { super(TaskProvider.TASK_ID_SIGN_UP); inclusionCriteriaStep = UiManager.getInstance().getInclusionCriteriaStep(context); inclusionCriteriaStep.setOptional(false); }
Source:
public void logoutFunctionTest() { find("#repoOwnerField"); selectAll(); type("dummy").push(KeyCode.TAB); type("dummy").push(KeyCode.TAB); type("test").push(KeyCode.TAB); type("test"); click("Sign in"); sleep(2000); click("File"); click("Logout"); File testConfig = new File(configFileDirectory, testConfigFileName); if (!(testConfig.exists() && testConfig.isFile())) fail(); Preferences testPref = new Preferences(true); assertEquals("", testPref.getLastLoginUsername()); assertEquals("", testPref.getLastLoginPassword()); }

Target:
public void logoutFunctionTest() { selectAll(); type("dummy").push(KeyCode.TAB); type("dummy").push(KeyCode.TAB); type("test").push(KeyCode.TAB); type("test"); click("Sign in"); sleep(2000); click("File"); click("Logout"); File testConfig = new File(configFileDirectory, testConfigFileName); if (!(testConfig.exists() && testConfig.isFile())) fail(); Preferences testPref = new Preferences(true); assertEquals("", testPref.getLastLoginUsername()); assertEquals("", testPref.getLastLoginPassword()); }
Source:
public int hashCode() { int result = hashCode; if(result == 0) { result = 31 * result + size(); result = 31 * result + set.hashCode(); hashCode = result; } return result; }

Target:
public int hashCode() { int result = hashCode; if(result == 0) { result = 31 * result + set.hashCode(); hashCode = result; } return result; }
Source:
public List<String> getIP(ClaudiaData claudiaData, String tierName, int replica, VM vm, String region) throws InfrastructureException { List<String> ips = new ArrayList<String>(); String response =""; try { String token = claudiaData.getUser().getToken(); String vdc = claudiaData.getVdc(); response = openStackUtil.getServer(vm.getVmid(), region, token, vdc); JSONObject jsonNodeServers = new JSONObject(response).getJSONObject("server"); JSONObject jsonAddress = jsonNodeServers.getJSONObject("addresses"); java.util.Iterator iter = jsonAddress.keys(); while(iter.hasNext()){ String key = (String)iter.next(); org.json.JSONArray value = jsonAddress.getJSONArray(key); for (int i = 0; i < value.length(); i++) { JSONObject childJSONObject = value.getJSONObject(i); ips.add(childJSONObject.getString("addr")); } } } catch (OpenStackException oes) { String errorMessage = "Error interacting getting ip from OpenStack "; log.error(errorMessage); throw new InfrastructureException(errorMessage); } catch (JSONException e) { String errorMessage = "Error with Json "; log.error(errorMessage); } return ips; }

Target:
public List<String> getIP(ClaudiaData claudiaData, String tierName, int replica, VM vm, String region) throws InfrastructureException { List<String> ips = new ArrayList<String>(); String response = ""; try { String token = claudiaData.getUser().getToken(); String vdc = claudiaData.getVdc(); response = openStackUtil.getServer(vm.getVmid(), region, token, vdc); JSONObject jsonNodeServers = new JSONObject(response).getJSONObject("server"); JSONObject jsonAddress = jsonNodeServers.getJSONObject("addresses"); java.util.Iterator iter = jsonAddress.keys(); while(iter.hasNext()){ String key = (String)iter.next(); org.json.JSONArray value = jsonAddress.getJSONArray(key); for (int i = 0; i < value.length(); i++) { JSONObject childJSONObject = value.getJSONObject(i); ips.add(childJSONObject.getString("addr")); } } } catch (OpenStackException oes) { String errorMessage = "Error interacting getting ip from OpenStack "; log.error(errorMessage); throw new InfrastructureException(errorMessage); } catch (JSONException e) { log.error("Error with Json " + e.getMessage()); } return ips; }
Source:
private DeveloperProducts getDevProductMap(Owner owner, String sku) { Collection<? extends ProductInfo> productsByIds = this.productAdapter .getProductsByIds(owner.getKey(), Arrays.asList(sku)); Collection<String> devProductIds = new ArrayList<>(); if (productsByIds.iterator().hasNext()) { ProductInfo devProduct = productsByIds.iterator().next(); devProductIds.add(devProduct.getId()); if (!devProduct.getProvidedProducts().isEmpty()) { devProductIds.addAll( devProduct.getProvidedProducts() .stream() .map(p -> p.getId()) .collect(Collectors.toList()) ); } } log.debug("Importing products for dev pool resolution..."); ImportedEntityCompiler compiler = new ImportedEntityCompiler(); compiler.addProducts(this.productAdapter.getProductsByIds(owner.getKey(), devProductIds)); Map<String, ? extends ProductInfo> productMap = compiler.getProducts(); Map<String, ? extends ContentInfo> contentMap = compiler.getContent(); log.debug("Importing content...", contentMap.size()); Map<String, Content> importedContent = this.contentManager .importContent(owner, contentMap, productMap.keySet()) .getImportedEntities(); log.debug("Importing product(s)...", productMap.size()); Map<String, Product> importedProducts = this.productManager .importProducts(owner, productMap, importedContent) .getImportedEntities(); log.debug("Resolved dev product(s) for sku: {}", productMap.size(), sku); return new DeveloperProducts(sku, importedProducts); }

Target:
private DeveloperProducts getDevProductMap(Owner owner, String sku) { Collection<? extends ProductInfo> productsByIds = this.productAdapter .getProductsByIds(owner.getKey(), Arrays.asList(sku)); Collection<String> devProductIds = new ArrayList<>(); if (productsByIds.iterator().hasNext()) { ProductInfo devProduct = productsByIds.iterator().next(); devProductIds.add(devProduct.getId()); Collection<? extends ProductInfo> provided = devProduct.getProvidedProducts(); if (provided != null) { provided.forEach(product -> { if (product != null) { devProductIds.add(product.getId()); } }); } } log.debug("Importing products for dev pool resolution..."); ImportedEntityCompiler compiler = new ImportedEntityCompiler(); compiler.addProducts(this.productAdapter.getProductsByIds(owner.getKey(), devProductIds)); Map<String, ? extends ProductInfo> productMap = compiler.getProducts(); Map<String, ? extends ContentInfo> contentMap = compiler.getContent(); log.debug("Importing content...", contentMap.size()); Map<String, Content> importedContent = this.contentManager .importContent(owner, contentMap, productMap.keySet()) .getImportedEntities(); log.debug("Importing product(s)...", productMap.size()); Map<String, Product> importedProducts = this.productManager .importProducts(owner, productMap, importedContent) .getImportedEntities(); log.debug("Resolved dev product(s) for sku: {}", productMap.size(), sku); return new DeveloperProducts(sku, importedProducts); }
Source:
public boolean shouldSuppressWarnings(Tree tree, String errKey) { Collection<String> prefixes = getSuppressWarningsPrefixes(); if (prefixes.isEmpty() || (prefixes.contains(SUPPRESS_ALL_PREFIX) && prefixes.size() == 1)) { throw new BugInCF( "Checker must provide a SuppressWarnings prefix. Add @SuppressWarningsPrefix meta-annotation."); } @Nullable TreePath path = trees.getPath(this.currentRoot, tree); @Nullable VariableTree var = TreeUtils.enclosingVariable(path); if (var != null && shouldSuppressWarnings(TreeUtils.elementFromTree(var), errKey)) { return true; } @Nullable MethodTree method = TreeUtils.enclosingMethod(path); if (method != null) { @Nullable Element elt = TreeUtils.elementFromTree(method); if (shouldSuppressWarnings(elt, errKey)) { return true; } if (isAnnotatedForThisCheckerOrUpstreamChecker(elt)) { return false; } } @Nullable ClassTree cls = TreeUtils.enclosingClass(path); if (cls != null) { @Nullable Element elt = TreeUtils.elementFromTree(cls); if (shouldSuppressWarnings(elt, errKey)) { return true; } if (isAnnotatedForThisCheckerOrUpstreamChecker(elt)) { return false; } } if (useConservativeDefault("source")) { return true; } return false; }

Target:
public boolean shouldSuppressWarnings(Tree tree, String errKey) { Collection<String> prefixes = getSuppressWarningsPrefixes(); if (prefixes.isEmpty() || (prefixes.contains(SUPPRESS_ALL_PREFIX) && prefixes.size() == 1)) { throw new BugInCF( "Checker must provide a SuppressWarnings prefix. SourceChecker#getSuppressWarningsPrefixes was not overridden correctly."); } @Nullable TreePath path = trees.getPath(this.currentRoot, tree); @Nullable VariableTree var = TreeUtils.enclosingVariable(path); if (var != null && shouldSuppressWarnings(TreeUtils.elementFromTree(var), errKey)) { return true; } @Nullable MethodTree method = TreeUtils.enclosingMethod(path); if (method != null) { @Nullable Element elt = TreeUtils.elementFromTree(method); if (shouldSuppressWarnings(elt, errKey)) { return true; } if (isAnnotatedForThisCheckerOrUpstreamChecker(elt)) { return false; } } @Nullable ClassTree cls = TreeUtils.enclosingClass(path); if (cls != null) { @Nullable Element elt = TreeUtils.elementFromTree(cls); if (shouldSuppressWarnings(elt, errKey)) { return true; } if (isAnnotatedForThisCheckerOrUpstreamChecker(elt)) { return false; } } if (useConservativeDefault("source")) { return true; } return false; }
Source:
public final String toJsonWithName() { return "{\"properties\":{" + toJson() + "}"; }

Target:
public final String toJsonWithName() { return toJsonWithName(getJsonName()); }
Source:
public RexNode visitRangeRef(RexRangeRef rangeRef) { return new RexRangeRef(copy(rangeRef.getType()), rangeRef.getOffset()); }

Target:
public RexNode visitRangeRef(RexRangeRef rangeRef) { return builder.makeRangeReference(copy(rangeRef.getType()), rangeRef.getOffset(), false); }
Source:
public synchronized void trimMemory(int level) { if (level >= android.content.ComponentCallbacks2.TRIM_MEMORY_BACKGROUND) { clearMemory(); } else if (level >= android.content.ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) { evictToSize(maxSize / 2); } else if (level == android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL) { evictToSize(maxSize / 2); } }

Target:
public synchronized void trimMemory(int level) { if (level >= android.content.ComponentCallbacks2.TRIM_MEMORY_BACKGROUND) { clearMemory(); } else if (level >= android.content.ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN || level == android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL) { evictToSize(maxSize / 2); } }
Source:
private FileDescriptor getDescriptor(String name) throws DescriptorValidationException { if (fileDescriptorMap.containsKey(name)) { return fileDescriptorMap.get(name); } if (!fdProtoMap.containsKey(name)) { throw new SerializerException("DynamicProtobuf type "+name+" was never seen in registry"); } List<FileDescriptor> fileDescriptorList = new ArrayList<>(); for (String s : fdProtoMap.get(name).getDependencyList()) { FileDescriptor descriptor = getDescriptor(s); fileDescriptorList.add(descriptor); } FileDescriptor[] fileDescriptors = fileDescriptorList.toArray(new FileDescriptor[fileDescriptorList.size()]); FileDescriptor fileDescriptor = FileDescriptor.buildFrom(fdProtoMap.get(name), fileDescriptors); fileDescriptorMap.putIfAbsent(name, fileDescriptor); return fileDescriptor; }

Target:
private FileDescriptor getDescriptor(String name) throws DescriptorValidationException { if (fileDescriptorMap.containsKey(name)) { return fileDescriptorMap.get(name); } if (!fdProtoMap.containsKey(name)) { log.error("DynamicProtobufSerializer failed to deserialize unknown file {}", name); log.error(this.toString()); throw new SerializerException( "DynamicProtobufSerializer file " + name + " was never seen in registry"); } List<FileDescriptor> fileDescriptorList = new ArrayList<>(); for (String s : fdProtoMap.get(name).getDependencyList()) { FileDescriptor descriptor = getDescriptor(s); fileDescriptorList.add(descriptor); } FileDescriptor[] fileDescriptors = fileDescriptorList.toArray(new FileDescriptor[fileDescriptorList.size()]); FileDescriptor fileDescriptor = FileDescriptor.buildFrom(fdProtoMap.get(name), fileDescriptors); fileDescriptorMap.putIfAbsent(name, fileDescriptor); return fileDescriptor; }
Source:
public void menuDetected(MenuDetectEvent e) { fPendingMenuDetectEvent = e; return; }

Target:
public void menuDetected(MenuDetectEvent e) { if (null == _timeProvider) { return; } if (e.detail == SWT.MENU_MOUSE) { if (fPendingMenuDetectEvent == null) { fPendingMenuDetectEvent = e; return; } fPendingMenuDetectEvent = null; if (_dragState != DRAG_ZOOM || _dragX != _dragX0) { return; } } else { if (_dragState != DRAG_NONE) { return; } } Point p = toControl(e.x, e.y); int idx = getItemIndexAtY(p.y); if (idx >= 0 && idx < _data._expandedItems.length) { Item item = _data._expandedItems[idx]; ITimeGraphEntry entry = item._trace; if (entry.hasTimeEvents()) { ITimeEvent event = Utils.findEvent(entry, getTimeAtX(p.x), 2); if (event != null) { e.data = event; fireMenuEventOnTimeEvent(e); return; } } e.data = entry; fireMenuEventOnTimeGraphEntry(e); } }
Source:
private void testDone(ExecutorService service, long beforeSetDelay, final long beforeExecuteDelay) throws InterruptedException, ExecutionException { final NotifyingFutureImpl<Integer> nf = new NotifyingFutureImpl<Integer>(); Future<Integer> f = service.submit(new Callable<Integer>() { @Override public Integer call() throws Exception { Thread.sleep(beforeExecuteDelay); int retval = 42; nf.notifyDone(retval); return retval; } }); try { int check = f.get(0, TimeUnit.NANOSECONDS); assert check == 42; } catch (TimeoutException e) { } Thread.sleep(beforeSetDelay); nf.setFuture(f); try { int check = nf.get(0, TimeUnit.NANOSECONDS); assert check == 42; } catch (TimeoutException e) { } final AtomicInteger retval = new AtomicInteger(-1); final CountDownLatch latch = new CountDownLatch(1); nf.attachListener(new FutureListener<Integer>() { @Override public void futureDone(Future<Integer> future) { try { retval.set(future.get()); } catch (Exception e) { e.printStackTrace(); } finally { latch.countDown(); } } }); latch.await(); assert nf.isDone(); assert !nf.isCancelled(); assert f.isDone(); assert !f.isCancelled(); assert retval.get() == 42; assert nf.get() == 42; assert f.get() == 42; }

Target:
private void testDone(ExecutorService service, long beforeSetDelay, final long beforeExecuteDelay) throws InterruptedException, ExecutionException { final NotifyingFutureImpl<Integer> nf = new NotifyingFutureImpl<Integer>(); Future<Integer> f = service.submit(new Callable<Integer>() { @Override public Integer call() throws Exception { Thread.sleep(beforeExecuteDelay); int retval = 42; nf.notifyDone(retval); return retval; } }); try { assertEquals(Integer.valueOf(42), f.get(0, TimeUnit.NANOSECONDS)); } catch (TimeoutException e) { } Thread.sleep(beforeSetDelay); nf.setFuture(f); try { assertEquals(Integer.valueOf(42), f.get(0, TimeUnit.NANOSECONDS)); } catch (TimeoutException e) { } final AtomicInteger retval = new AtomicInteger(-1); final CountDownLatch latch = new CountDownLatch(1); nf.attachListener(new FutureListener<Integer>() { @Override public void futureDone(Future<Integer> future) { try { retval.set(future.get()); } catch (Exception e) { e.printStackTrace(); } finally { latch.countDown(); } } }); latch.await(); assertTrue(nf.isDone()); assertFalse(nf.isCancelled()); assertTrue(f.isDone()); assertFalse(f.isCancelled()); assertEquals(42, retval.get()); assertEquals(Integer.valueOf(42), nf.get()); assertEquals(Integer.valueOf(42), f.get()); }
Source:
public FreeStyleProject newInstance(Branch branch) { FreeStyleProject job = new FreeStyleProject(getOwner(), branch.getName()); job.onCreatedFromScratch(); FreeStyleProject spied = spy(job); when(spied.scheduleBuild()).thenReturn(false); setBranch(spied, branch); return spied; }

Target:
public FreeStyleProject newInstance(Branch branch) { FreeStyleProject job = new FreeStyleProject(getOwner(), branch.getName()); FreeStyleProject spied = spy(job); when(spied.scheduleBuild()).thenReturn(false); setBranch(spied, branch); return spied; }
Source:
public void verifyAllPinTypesIsUncheck() { try { waitForElementVisibleByElement(mapFrame); driver.switchTo().frame(mapFrame); waitForElementVisibleByElement(allPinTypes); if (!allPinTypes.getAttribute("class").contains("enabled")) { PageObjectLogging.log("verifyAllPointTypesIsUnCheck", "All pin types were unchecked", true); } driver.switchTo().defaultContent(); }catch (Exception e) { PageObjectLogging.log("verifyAllPointTypesIsUnCheck", "All pin types were checked", false); } }

Target:
public void verifyAllPinTypesIsUncheck() { waitForElementVisibleByElement(mapFrame); driver.switchTo().frame(mapFrame); waitForElementVisibleByElement(allPinTypes); if (!allPinTypes.getAttribute("class").contains("enabled")) { PageObjectLogging.log("verifyAllPointTypesIsUnCheck", "All pin types were unchecked", true); }else { PageObjectLogging.log("verifyAllPointTypesIsUnCheck", "All pin types were checked", false); } driver.switchTo().defaultContent(); }
Source:
public void testGetParentDocumentFromPathReference() { DocumentModel root = session.getRootDocument(); DocumentModel shouldBeNull = session.getParentDocument(new PathRef(root.getPathAsString())); assertNull(shouldBeNull); String name = "folder#" + generateUnique(); DocumentModel parentFolder = session.createDocumentModel(root.getPathAsString(), name, "Folder"); DocumentModel shouldBeRoot = session.getParentDocument(parentFolder.getRef()); assertEquals(root.getPathAsString(), shouldBeRoot.getPathAsString()); parentFolder = session.createDocument(parentFolder); session.save(); String name2 = "file#" + generateUnique(); DocumentModel childFile = session.createDocumentModel(parentFolder.getPathAsString(), name2, "File"); DocumentModel shouldBeFolder = session.getParentDocument(childFile.getRef()); assertEquals(parentFolder.getPathAsString(), shouldBeFolder.getPathAsString()); DocumentRef shouldBeRootRef = session.getParentDocumentRef(parentFolder.getRef()); assertEquals(root.getRef(), shouldBeRootRef); DocumentRef shouldBeFolderRef = session.getParentDocumentRef(childFile.getRef()); assertEquals(parentFolder.getRef(), shouldBeFolderRef); }

Target:
public void testGetParentDocumentFromPathReference() { DocumentRef rootRef = new PathRef("/"); assertNull(session.getParentDocument(rootRef)); assertNull(session.getParentDocumentRef(rootRef)); String name = "folder#" + generateUnique(); DocumentModel parentFolder = session.createDocumentModel("/", name, "Folder"); DocumentModel shouldBeRoot = session.getParentDocument(parentFolder.getRef()); assertEquals("/", shouldBeRoot.getPathAsString()); parentFolder = session.createDocument(parentFolder); String name2 = "file#" + generateUnique(); DocumentModel childFile = session.createDocumentModel(parentFolder.getPathAsString(), name2, "File"); DocumentModel shouldBeFolder = session.getParentDocument(childFile.getRef()); assertEquals(parentFolder.getPathAsString(), shouldBeFolder.getPathAsString()); DocumentRef shouldBeRootRef = session.getParentDocumentRef(parentFolder.getRef()); assertEquals(session.getRootDocument().getRef(), shouldBeRootRef); DocumentRef shouldBeFolderRef = session.getParentDocumentRef(childFile.getRef()); assertEquals(parentFolder.getRef(), shouldBeFolderRef); }
Source:
public Collection<ItemStack> getDrops(GlowBlock block) { if (random.nextFloat() < 12.5) { return Collections.unmodifiableList(Arrays.asList(new ItemStack(Material.SEEDS, 1))); } return Collections.unmodifiableList(Arrays.asList(new ItemStack[0])); }

Target:
public Collection<ItemStack> getDrops(GlowBlock block) { if (random.nextFloat() < .125) { return Collections.unmodifiableList(Arrays.asList(new ItemStack(Material.SEEDS, 1))); } return Collections.unmodifiableList(Arrays.asList(new ItemStack[0])); }
Source:
public void migrateMetadata() { migrateWorkflow = false; try { allProjects = ServiceManager.getProjectService().getAll(); projectListShown = true; } catch (DAOException e) { Helper.setErrorMessage("Error during database access"); } }

Target:
public void migrateMetadata() { try { allProjects = ServiceManager.getProjectService().getAll(); projectListShown = true; metadataShown = true; workflowShown = false; } catch (DAOException e) { Helper.setErrorMessage("Error during database access", e.getLocalizedMessage(), logger, e); } }
Source:
private boolean initAutoscaler( AutoScaler autoScaler, String category, DefaultWorkerBehaviorConfig workerConfig, Map<String, Set<String>> currentlyProvisioningMap ) { currentlyProvisioningMap.putIfAbsent( category, new HashSet<>() ); Set<String> currentlyProvisioning = currentlyProvisioningMap.get(category); return doProvision( category, Collections.emptyList(), Collections.emptyList(), workerConfig, currentlyProvisioning, autoScaler ); }

Target:
private boolean initAutoscaler( AutoScaler autoScaler, String category, DefaultWorkerBehaviorConfig workerConfig, Map<String, Set<String>> currentlyProvisioningMap ) { Set<String> currentlyProvisioning = currentlyProvisioningMap.computeIfAbsent( category, ignored -> new HashSet<>() ); return doProvision( category, Collections.emptyList(), Collections.emptyList(), workerConfig, currentlyProvisioning, autoScaler ); }