auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setColors() { Resources res = mContext.getResources(); mColorSelected = res.getColor(mSettings.getScoreColor()); mColorEnabled = res.getColor(mSettings.getSurveyColor()); mRatingBar.setSelectedColor(mColorSelected); mBtnDismiss.setTextColor(mColorEnabled); mTvSurveyHeader.setBackgroundColor(mColorEnabled); setCursorDrawableColor(mEtFeedback, mColorSelected); }

Target:
private void setColors() { Resources res = mContext.getResources(); mColorSelected = res.getColor(mSettings.getScoreColor()); mColorEnabled = res.getColor(mSettings.getSurveyColor()); mRatingBar.setSelectedColor(mColorSelected); mBtnDismiss.setTextColor(mColorEnabled); mBtnEditScore.setBackgroundColor(mColorEnabled); mTvSurveyHeader.setBackgroundColor(mColorEnabled); setCursorDrawableColor(mEtFeedback, mColorSelected); }
Source:
public Map<String, String> updateSensorProperties(OwBaseBridgeHandler bridgeHandler) throws OwException { Map<String, String> properties = new HashMap<String, String>(); OwPageBuffer pages = bridgeHandler.readPages(sensorIds.get(0)); OwSensorType sensorType = OwSensorType.UNKNOWN; try { sensorType = OwSensorType.valueOf(new String(pages.getPage(0), 0, 7, StandardCharsets.US_ASCII)); } catch (IllegalArgumentException e) { } if ((sensorType != OwSensorType.EDS0064) && (sensorType != OwSensorType.EDS0065) && (sensorType != OwSensorType.EDS0066) && (sensorType != OwSensorType.EDS0067)) { throw new OwException("sensorType not supported for EDSSensorThing"); } int fwRevisionLow = pages.getByte(3, 3); int fwRevisionHigh = pages.getByte(3, 4); String fwRevision = String.format("%d.%d", fwRevisionHigh, fwRevisionLow); properties.put(PROPERTY_MODELID, sensorType.name()); properties.put(PROPERTY_VENDOR, "Embedded Data Systems"); properties.put(PROPERTY_HW_REVISION, String.valueOf(fwRevision)); return properties; }

Target:
public Map<String, String> updateSensorProperties(OwBaseBridgeHandler bridgeHandler) throws OwException { Map<String, String> properties = new HashMap<String, String>(); OwPageBuffer pages = bridgeHandler.readPages(sensorIds.get(0)); OwSensorType sensorType = OwSensorType.UNKNOWN; try { sensorType = OwSensorType.valueOf(new String(pages.getPage(0), 0, 7, StandardCharsets.US_ASCII)); } catch (IllegalArgumentException e) { } if (!SUPPORTED_SENSOR_TYPES.contains(sensorType)) { throw new OwException("sensorType not supported for EDSSensorThing"); } int fwRevisionLow = pages.getByte(3, 3); int fwRevisionHigh = pages.getByte(3, 4); String fwRevision = String.format("%d.%d", fwRevisionHigh, fwRevisionLow); properties.put(PROPERTY_MODELID, sensorType.name()); properties.put(PROPERTY_VENDOR, "Embedded Data Systems"); properties.put(PROPERTY_HW_REVISION, String.valueOf(fwRevision)); return properties; }
Source:
void testEntryIsUnchangedAfterChecks() { BibEntry entry = new BibEntry(); for (Field field : FieldFactory.getCommonFields()) { entry.setField(field, UUID.randomUUID().toString()); } entry.setField(StandardField.EPRINT, UUID.randomUUID().toString()); BibEntry clonedEntry = (BibEntry) entry.clone(); BibDatabase bibDatabase = new BibDatabase(); bibDatabase.insertEntry(entry); BibDatabaseContext context = new BibDatabaseContext(bibDatabase); new IntegrityCheck(context, mock(FilePreferences.class), createBibtexKeyPatternPreferences(), new JournalAbbreviationRepository(), true, false) .checkDatabase(); assertEquals(clonedEntry, entry); }

Target:
void testEntryIsUnchangedAfterChecks() { BibEntry entry = new BibEntry(); for (Field field : FieldFactory.getCommonFields()) { entry.setField(field, UUID.randomUUID().toString()); } entry.setField(StandardField.EPRINT, UUID.randomUUID().toString()); BibEntry clonedEntry = (BibEntry) entry.clone(); BibDatabase bibDatabase = new BibDatabase(); bibDatabase.insertEntry(entry); BibDatabaseContext context = new BibDatabaseContext(bibDatabase); new IntegrityCheck(context, mock(FilePreferences.class), createBibtexKeyPatternPreferences(), JournalAbbreviationLoader.loadBuiltInRepository(), true, false) .checkDatabase(); assertEquals(clonedEntry, entry); }
Source:
boolean shouldApply(long msgId) { if (msgId < lowerWaterMark) { return false; } if (msgId > higerWaterMark.get()) { return true; } final AtomicBoolean shouldApply = new AtomicBoolean(false); inProgressMessages.computeIfPresent(msgId, (id, state) -> { if (state != true) { shouldApply.set(true); } return null; }); return shouldApply.get(); }

Target:
boolean shouldApply(long msgId) { Lock lock = lwmLock.readLock(); try { lock.lock(); if (msgId < lowerWaterMark) { return false; } } finally { lock.unlock(); } if (msgId > higherWaterMark.get()) { return true; } final AtomicBoolean shouldApply = new AtomicBoolean(false); inProgressMessages.computeIfPresent(msgId, (id, state) -> { if (!state) { shouldApply.set(true); } return true; }); updateLowerWaterMark(); return shouldApply.get(); }
Source:
public void checkSerializableSimplifiedServer() throws Exception { final String echoIpStepWindows = "bat \"echo Instance IP: ${srv.address}\""; final String echoIpStepUnix = "sh \"echo Instance IP: ${srv.address}\""; final String echoIpStep = Functions.isWindows() ? echoIpStepWindows : echoIpStepUnix; WorkflowJob bootSerializableCheck = j.jenkins.createProject(WorkflowJob.class, "bootSerializableCheck"); bootSerializableCheck.setDefinition(new CpsFlowDefinition( " def srv = openstackMachine cloud: 'openstack', template: 'template0'\n" + "node ('master') { \n" + " " + echoIpStep + " \n" + "} \n" + "srv.destroy()", true)); WorkflowRun b = j.assertBuildStatusSuccess(bootSerializableCheck.scheduleBuild2(0)); j.assertLogContains("Instance IP: 42.42.42", b); assertThat(openstack.getRunningNodes(), emptyIterable()); }

Target:
public void checkSerializableSimplifiedServer() throws Exception { WorkflowJob bootSerializableCheck = j.jenkins.createProject(WorkflowJob.class, "bootSerializableCheck"); bootSerializableCheck.setDefinition(new CpsFlowDefinition( " def srv = openstackMachine cloud: 'openstack', template: 'template0'\n" + "node ('master') { \n" + " echo \"Instance IP: ${srv.address}\" \n" + "} \n" + "srv.destroy()", true)); WorkflowRun b = j.assertBuildStatusSuccess(bootSerializableCheck.scheduleBuild2(0)); j.assertLogContains("Instance IP: 42.42.42", b); assertThat(openstack.getRunningNodes(), emptyIterable()); }
Source:
public static HttpClient getClient(){ HttpClient httpClient = new HttpClient(); if (Config.<Boolean> GetValue(ConfigValues.SecureConnectionWithOATServers)) { URL truststoreUrl; try { int port = Config.<Integer> GetValue(ConfigValues.AttestationPort); truststoreUrl = new URL("file://" + Config.resolveAttestationTrustStorePath()); String truststorePassword = Config.<String> GetValue(ConfigValues.AttestationTruststorePass); String attestationServer = Config.<String> GetValue(ConfigValues.AttestationServer); ProtocolSocketFactory factory = new AuthSSLProtocolSocketFactory(null, null, truststoreUrl, truststorePassword); Protocol clientAuthHTTPS = new Protocol("https", factory, port); httpClient.getHostConfiguration().setHost(attestationServer, port, clientAuthHTTPS); } catch (Exception e) { log.fatal("Failed to init AuthSSLProtocolSocketFactory. SSL connections will not work", e); } } return httpClient; }

Target:
public static HttpClient getClient() { HttpClient httpClient = new HttpClient(); if (Config.<Boolean> GetValue(ConfigValues.SecureConnectionWithOATServers)) { URL trustStoreUrl; try { int port = Config.<Integer> GetValue(ConfigValues.AttestationPort); trustStoreUrl = new URL("file://" + Config.resolveAttestationTrustStorePath()); String truststorePassword = Config.<String> GetValue(ConfigValues.AttestationTruststorePass); String attestationServer = Config.<String> GetValue(ConfigValues.AttestationServer); ProtocolSocketFactory factory = new AuthSSLProtocolSocketFactory(null, null, trustStoreUrl, truststorePassword); Protocol clientAuthHTTPS = new Protocol("https", factory, port); httpClient.getHostConfiguration().setHost(attestationServer, port, clientAuthHTTPS); } catch (Exception e) { log.fatal("Failed to init AuthSSLProtocolSocketFactory. SSL connections will not work", e); } } return httpClient; }
Source:
public Object newInstance(OperationContext ctx, Map<String, Object> args) throws OperationException { Map<String, Object> parms = new HashMap<>(args); scripting.parmsInjector.inject(parms, ctx, desc); return new ScriptingOperationImpl(desc.source, ctx, parms); }

Target:
public Object newInstance(OperationContext ctx, Map<String, Object> args) throws OperationException { Map<String, Object> params = new HashMap<>(args); scripting.paramsInjector.inject(params, ctx, desc); return new ScriptingOperationImpl(desc.source, ctx, params); }
Source:
boolean configureAdColony(Context context, Bundle serverParams, MediationAdRequest adRequest, Bundle networkExtras) { String appId = serverParams.getString(AdColonyAdapterUtils.KEY_APP_ID); ArrayList<String> newZoneList = parseZoneList(serverParams); boolean needToConfigure = false; if (!(context instanceof Activity || context instanceof Application)) { Log.w(TAG, "Context must be of type Activity or Application."); return false; } if (appId == null) { Log.w(TAG, "A valid appId wasn't provided."); return false; } if (newZoneList == null || newZoneList.isEmpty()) { Log.w(TAG, "No zones provided to request ad."); return false; } for (String zone : newZoneList) { if (!configuredZones.contains(zone)) { configuredZones.add(zone); needToConfigure = true; } } AdColonyAppOptions appOptions = buildAppOptions(adRequest, networkExtras); AdColony.setAppOptions(appOptions); if (isConfigured && !needToConfigure) { AdColony.setAppOptions(appOptions); } else { String[] zones = configuredZones.toArray(new String[0]); appOptions.setMediationNetwork(AdColonyAppOptions.ADMOB, BuildConfig.VERSION_NAME); isConfigured = context instanceof Activity ? AdColony.configure((Activity) context, appOptions, appId, zones) : AdColony.configure((Application) context, appOptions, appId, zones); } return isConfigured; }

Target:
boolean configureAdColony(Context context, Bundle serverParams, MediationAdRequest adRequest, Bundle networkExtras) { String appId = serverParams.getString(AdColonyAdapterUtils.KEY_APP_ID); ArrayList<String> newZoneList = parseZoneList(serverParams); if (!(context instanceof Activity || context instanceof Application)) { Log.w(TAG, "Context must be of type Activity or Application."); return false; } if (appId == null) { Log.w(TAG, "A valid appId wasn't provided."); return false; } if (newZoneList == null || newZoneList.isEmpty()) { Log.w(TAG, "No zones provided to request ad."); return false; } for (String zone : newZoneList) { if (!configuredZones.contains(zone)) { configuredZones.add(zone); isConfigured = false; } } AdColonyAppOptions appOptions = buildAppOptions(adRequest, networkExtras); if (isConfigured) { AdColony.setAppOptions(appOptions); } else { String[] zones = configuredZones.toArray(new String[0]); appOptions.setMediationNetwork(AdColonyAppOptions.ADMOB, BuildConfig.VERSION_NAME); isConfigured = context instanceof Activity ? AdColony.configure((Activity) context, appOptions, appId, zones) : AdColony.configure((Application) context, appOptions, appId, zones); } return isConfigured; }
Source:
protected void copyAssertionAttributesToUserAttributes(Assertion assertion) { if (!copyAssertionAttributesToUserAttributes) { return; } if (assertion.getPrincipal().getAttributes() == null || assertion.getPrincipal().getAttributes().isEmpty()) { return; } Map<String, List<Object>> attributes = new HashMap<>(); for (Map.Entry<String, Object> attrEntry : assertion.getPrincipal().getAttributes().entrySet()) { log.debug("Adding attribute '{}' from Assertion with value '{}'; runtime type of value is {}", attrEntry.getKey(), attrEntry.getValue(), attrEntry.getValue().getClass().getName()); if (decryptCredentialToPassword && cipher != null && attrEntry.getKey().equals(CREDENTIAL_KEY)) { try { final String encPwd = (String) (attrEntry.getValue() instanceof List ? ((List) attrEntry.getValue()).get(0) : attrEntry.getValue()); byte[] cred64 = Base64.getDecoder().decode(encPwd); cipher.init(Cipher.DECRYPT_MODE, key); final byte[] cipherData = cipher.doFinal(cred64); final String pwd = new String(cipherData); attributes.put(PASSWORD_KEY, Arrays.asList((Object) pwd)); } catch (Exception e) { log.warn("Cannot decipher credential", e); e.printStackTrace(); } } List<Object> valueList = null; if (attrEntry.getValue() instanceof List) { valueList = (List)attrEntry.getValue(); } else { valueList = Arrays.asList(attrEntry.getValue()); } attributes.put(attrEntry.getKey(), valueList); } IAdditionalDescriptors additionalDescriptors = (IAdditionalDescriptors) applicationContext.getBean(SESSION_ADDITIONAL_DESCRIPTORS_BEAN); additionalDescriptors.addAttributes(attributes); }

Target:
private void copyAssertionAttributesToUserAttributes(Assertion assertion) { if (!copyAssertionAttributesToUserAttributes) { return; } if (assertion.getPrincipal().getAttributes() == null || assertion.getPrincipal().getAttributes().isEmpty()) { return; } Map<String, List<Object>> attributes = new HashMap<>(); for (Map.Entry<String, Object> attrEntry : assertion.getPrincipal().getAttributes().entrySet()) { log.debug("Adding attribute '{}' from Assertion with value '{}'; runtime type of value is {}", attrEntry.getKey(), attrEntry.getValue(), attrEntry.getValue().getClass().getName()); if (decryptCredentialToPassword && key != null && cipher != null && attrEntry.getKey().equals(CREDENTIAL_KEY)) { try { final String encPwd = (String) (attrEntry.getValue() instanceof List ? ((List) attrEntry.getValue()).get(0) : attrEntry.getValue()); byte[] cred64 = DatatypeConverter.parseBase64Binary(encPwd); cipher.init(Cipher.DECRYPT_MODE, key); final byte[] cipherData = cipher.doFinal(cred64); final Object pwd = new String(cipherData); attributes.put(PASSWORD_KEY, Collections.singletonList(pwd)); } catch (Exception e) { log.warn("Cannot decipher credential", e); } } List<Object> valueList; if (attrEntry.getValue() instanceof List) { valueList = (List<Object>) attrEntry.getValue(); } else { valueList = Collections.singletonList(attrEntry.getValue()); } attributes.put(attrEntry.getKey(), valueList); } IAdditionalDescriptors additionalDescriptors = (IAdditionalDescriptors) applicationContext.getBean(SESSION_ADDITIONAL_DESCRIPTORS_BEAN); additionalDescriptors.addAttributes(attributes); }
Source:
protected FactModelTree createFactModelTreeForCollection(Map<String, List<String>> genericTypeInfoMap, String factName, DMNType type, SortedMap<String, FactModelTree> hiddenFacts, FactModelTree.Type fmType, List<String> alreadyVisited) throws WrongDMNTypeException { if (!type.isCollection() && !isToBeManagedAsCollection(type)) { throw new WrongDMNTypeException(); } String typeName = type.getName(); populateGeneric(genericTypeInfoMap, "value", typeName); FactModelTree toReturn = createFactModelTreeForSimple(genericTypeInfoMap, factName, List.class.getCanonicalName(), fmType); if (!hiddenFacts.containsKey(typeName) && !alreadyVisited.contains(typeName)) { alreadyVisited.add(typeName); FactModelTree genericFactModelTree = createFactModelTreeForGenericType(new HashMap<>(), typeName, typeName, typeName, type, hiddenFacts, fmType, alreadyVisited); hiddenFacts.put(typeName, genericFactModelTree); } return toReturn; }

Target:
protected FactModelTree createFactModelTreeForCollection(Map<String, List<String>> genericTypeInfoMap, String factName, DMNType type, SortedMap<String, FactModelTree> hiddenFacts, FactModelTree.Type fmType, List<String> alreadyVisited) throws WrongDMNTypeException { if (!type.isCollection() && !isToBeManagedAsCollection(type)) { throw new WrongDMNTypeException(); } String typeName = type.getName(); populateGeneric(genericTypeInfoMap, VALUE, typeName); FactModelTree toReturn = createFactModelTreeForSimple(genericTypeInfoMap, factName, List.class.getCanonicalName(), fmType); if (!hiddenFacts.containsKey(typeName) && !alreadyVisited.contains(typeName)) { alreadyVisited.add(typeName); FactModelTree genericFactModelTree = createFactModelTreeForGenericType(new HashMap<>(), typeName, typeName, typeName, type, hiddenFacts, fmType, alreadyVisited); hiddenFacts.put(typeName, genericFactModelTree); } return toReturn; }
Source:
private String showPasteDlg(final ERepositoryObjectType type, final ContainerItem parentItem, String initLabel) { InputDialog dlg = new InputDialog(getShell(), Messages.RepositoryDropAssistant_pasteObject, Messages.Common_inputName, initLabel, new IInputValidator() { @Override public String isValid(String newText) { if (newText == null || newText.trim().length() == 0) { return Messages.Common_nameCanNotBeEmpty; } if (type.equals(IServerObjectRepositoryType.TYPE_TRANSFORMERV2) || type.equals(IServerObjectRepositoryType.TYPE_VIEW)) { if (type.equals(IServerObjectRepositoryType.TYPE_TRANSFORMERV2)) { if (newText.startsWith(ITransformerV2NodeConsDef.PREFIX_SMARTVIEW_UPPER)) { if (!ValidateUtil.matchSmartViewRegex(newText)) { return Messages.Common_nameInvalid; } } if (!ValidateUtil.matchViewProcessRegex(newText)) { return Messages.Common_nameInvalid; } } else if (type.equals(IServerObjectRepositoryType.TYPE_VIEW)) { if (!ValidateUtil.matchViewProcessRegex(newText)) { return Messages.Common_nameInvalid; } } } else if (type.equals(IServerObjectRepositoryType.TYPE_ROLE)) { if (!ValidateUtil.matchRoleRegex(newText)) { return Messages.Common_nameInvalid; } } else if (!ValidateUtil.matchCommonRegex(newText)) { return Messages.Common_nameInvalid; } if (RepositoryResourceUtil.isExistByName(parentItem.getRepObjType(), newText.trim())) { return Messages.Common_nameIsUsed; } return null; }; }); dlg.setBlockOnOpen(true); if (dlg.open() == Window.CANCEL) { return null; } return dlg.getValue(); }

Target:
private String showPasteDlg(final ERepositoryObjectType type, final ContainerItem parentItem, String initLabel) { InputDialog dlg = new InputDialog(getShell(), Messages.RepositoryDropAssistant_pasteObject, Messages.Common_inputName, initLabel, new IInputValidator() { @Override public String isValid(String newText) { if (newText == null || newText.trim().length() == 0) { return Messages.Common_nameCanNotBeEmpty; } if (type.equals(IServerObjectRepositoryType.TYPE_TRANSFORMERV2)) { if (newText.startsWith(ITransformerV2NodeConsDef.PREFIX_SMARTVIEW_UPPER)) { if (!ValidateUtil.matchSmartViewRegex(newText)) { return Messages.Common_nameInvalid; } } if (!ValidateUtil.matchViewProcessRegex(newText)) { return Messages.Common_nameInvalid; } } else if (type.equals(IServerObjectRepositoryType.TYPE_VIEW)) { if (!ValidateUtil.matchViewProcessRegex(newText)) { return Messages.Common_nameInvalid; } } else if (type.equals(IServerObjectRepositoryType.TYPE_ROLE)) { if (!ValidateUtil.matchRoleRegex(newText)) { return Messages.Common_nameInvalid; } } else if (!ValidateUtil.matchCommonRegex(newText)) { return Messages.Common_nameInvalid; } if (RepositoryResourceUtil.isExistByName(parentItem.getRepObjType(), newText.trim())) { return Messages.Common_nameIsUsed; } return null; }; }); dlg.setBlockOnOpen(true); if (dlg.open() == Window.CANCEL) { return null; } return dlg.getValue(); }
Source:
public String getValue(ITask task) { AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(task.getConnectorKind()); TaskRepository repository = TasksUiInternal.getRepository(task); URL url = connector.getBrowserUrl(repository, task); if (url == null) { return task.getUrl(); } return url.toString(); }

Target:
public String getValue(ITask task) { AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(task.getConnectorKind()); TaskRepository repository = TasksUiInternal.getRepository(task); if (repository != null) { URL url = connector.getBrowserUrl(repository, task); if (url != null) { return url.toString(); } } return task.getUrl(); }
Source:
public String toString(Object o, String formatString, Locale locale) { if ( formatString==null ) return o.toString(); Formatter f = new Formatter(locale); f.format(formatString, o); String str = f.toString(); f.close(); return str; }

Target:
public String toString(Object o, String formatString, Locale locale) { if ( formatString==null ) return o.toString(); Formatter f = new Formatter(locale); try { f.format(formatString, o); return f.toString(); } finally { f.close(); } }
Source:
long flush(final long now) { try { final FlushResult flushResult = this.timeTracker.flush(); return flushResult.getFlushTime(); } catch (Exception e) { if (this.logger.isLoggable(getClass(), TechnicalLogSeverity.WARNING)) { this.logger.log(getClass(), TechnicalLogSeverity.WARNING, "Exception caught while flushing: " + e.getMessage(), e); } } return now; }

Target:
long flush(final long now) { try { final FlushResult flushResult = this.timeTracker.flush(); return flushResult.getFlushTime(); } catch (Exception e) { log(TechnicalLogSeverity.WARNING, "Exception caught while flushing: " + e.getMessage(), e); } return now; }
Source:
public JsPromise<OrionHoverOverlay> computeHover(OrionHoverContextOverlay context) { EditorPartPresenter activeEditor = editorAgent.getActiveEditor(); if (activeEditor == null || !(activeEditor instanceof TextEditor)) { return null; } TextEditor editor = ((TextEditor)activeEditor); if (!(editor.getConfiguration() instanceof LanguageServerEditorConfiguration)) { return null; } LanguageServerEditorConfiguration configuration = (LanguageServerEditorConfiguration)editor.getConfiguration(); if (configuration.getServerCapabilities().getHoverProvider() == null || !configuration.getServerCapabilities().getHoverProvider()) { return null; } Document document = editor.getDocument(); TextDocumentPositionParams paramsDTO = helper.createTDPP(document, context.getOffset()); Promise<Hover> promise = client.hover(paramsDTO); Promise<OrionHoverOverlay> then = promise.then((Function<Hover, OrionHoverOverlay>)arg -> { OrionHoverOverlay hover = OrionHoverOverlay.create(); hover.setType("markdown"); String content = renderContent(arg); if (StringUtils.isNullOrWhitespace(content)) { return null; } hover.setContent(content); return hover; }); return (JsPromise<OrionHoverOverlay>)then; }

Target:
public JsPromise<OrionHoverOverlay> computeHover(OrionHoverContextOverlay context) { EditorPartPresenter activeEditor = editorAgent.getActiveEditor(); if (activeEditor == null || !(activeEditor instanceof TextEditor)) { return null; } TextEditor editor = ((TextEditor)activeEditor); if (!(editor.getConfiguration() instanceof LanguageServerEditorConfiguration)) { return null; } LanguageServerEditorConfiguration configuration = (LanguageServerEditorConfiguration)editor.getConfiguration(); if (configuration.getServerCapabilities().getHoverProvider() == null || !configuration.getServerCapabilities().getHoverProvider()) { return null; } Document document = editor.getDocument(); TextDocumentPositionParams paramsDTO = helper.createTDPP(document, context.getOffset()); Promise<Hover> promise = client.hover(paramsDTO); Promise<OrionHoverOverlay> then = promise.then((Hover arg) -> { OrionHoverOverlay hover = OrionHoverOverlay.create(); hover.setType("markdown"); String content = renderContent(arg); if (StringUtils.isNullOrWhitespace(content)) { return null; } hover.setContent(content); return hover; }); return (JsPromise<OrionHoverOverlay>)then; }
Source:
public List<Map<String, String>> linkify(HttpServletRequest req, String message) { List<CommentLinkInfo> operationalCommentLinks = new ArrayList<>(commentLinks); String baseGerritUrl = urls.getBaseGerritUrl(req); if (baseGerritUrl != null) { System.out.println("baseGerritUrl: " + baseGerritUrl); CommentLinkInfo changeIds = new CommentLinkInfo(CHANGE_ID_PATTERN, baseGerritUrl + "#/q/$0,n,z"); operationalCommentLinks.add(changeIds); } List<Map<String, String>> parsed = Lists.newArrayList(); parsed.add(ImmutableMap.of("text", message)); for (int index = 0; index < parsed.size(); index++) { if (parsed.get(index).get("url") == null) { Matcher m = allPattern.matcher(parsed.get(index).get("text")); if (m.find()) { for (CommentLinkInfo cli : operationalCommentLinks) { if (parsed.get(index).get("url") == null) { List<Map<String, String>> resultingReplacement = cli.replace(parsed.get(index).get("text")); if (resultingReplacement != null) { parsed.remove(index); parsed.addAll(index, resultingReplacement); } } } } } } return parsed; }

Target:
public List<Map<String, String>> linkify(HttpServletRequest req, String message) { List<CommentLinkInfo> operationalCommentLinks = new ArrayList<>(commentLinks); String baseGerritUrl = urls.getBaseGerritUrl(req); if (baseGerritUrl != null) { System.out.println("baseGerritUrl: " + baseGerritUrl); CommentLinkInfo changeIds = new CommentLinkInfo(CHANGE_ID_PATTERN, baseGerritUrl + "#/q/$0,n,z"); operationalCommentLinks.add(changeIds); } List<Map<String, String>> parsed = Lists.newArrayList(); parsed.add(ImmutableMap.of("text", message)); for (int index = 0; index < parsed.size(); index++) { if (parsed.get(index).get("url") != null) { continue; } Matcher m = allPattern.matcher(parsed.get(index).get("text")); if (!m.find()) { continue; } for (CommentLinkInfo cli : operationalCommentLinks) { if (parsed.get(index).get("url") != null) { break; } List<Map<String, String>> resultingReplacement = cli.replace(parsed.get(index).get("text")); if (resultingReplacement != null) { parsed.remove(index); parsed.addAll(index, resultingReplacement); } } } return parsed; }
Source:
public static Collection<Stereotype> getAllSuperStereotypes(Stereotype stereotype) { Set<Stereotype> result = new HashSet<>(); if (stereotype != null) { getAllSuperStereotypes(stereotype, result); } return result; }

Target:
public static Collection<Stereotype> getAllSuperStereotypes(Stereotype stereotype) { Set<Stereotype> result = new HashSet<Stereotype>(); if (stereotype != null) { getAllSuperStereotypes(stereotype, result); } return result; }
Source:
public void testGetBlacklistedMetacardTransformers() { Set<String> blacklist = ImmutableSet.of("hello", "world"); descriptors.setBlackListedMetacardTransformerIds(blacklist); assertThat(descriptors.getBlackListedMetacardTransformerIds(), is(blacklist)); }

Target:
public void testGetBlacklistedMetacardTransformers() { Set<String> blacklist = ImmutableSet.of("hello", "world"); descriptors.setBlackListedMetacardTransformerIds(blacklist); assertThat(descriptors.getBlackListedMetacardTransformerIds(), contains("hello", "world")); }
Source:
int getWidth(Text text) { ITextComponent component = SpongeTexts.toComponent(text); Iterable<ITextComponent> children = ((IMixinTextComponent) component).withChildren(); int total = 0; for(ITextComponent child : children) { PrimitiveIterator.OfInt i_it; if(child instanceof TextComponentString || child instanceof TextComponentTranslation) { i_it = child.getUnformattedComponentText().codePoints().iterator(); } else { continue; } boolean bold = child .getStyle() .getBold(); Integer cp; while(i_it.hasNext()){ cp = i_it.next(); if (cp == 10) { total = ((int) Math.ceil((double) total / LINE_WIDTH)) * LINE_WIDTH; } else { int width = getWidth(cp, bold); total += width; } } } return total; }

Target:
int getWidth(Text text) { ITextComponent component = SpongeTexts.toComponent(text); Iterable<ITextComponent> children = ((IMixinTextComponent) component).withChildren(); int total = 0; for(ITextComponent child : children) { PrimitiveIterator.OfInt i_it; if(child instanceof TextComponentString || child instanceof TextComponentTranslation) { i_it = child.getUnformattedComponentText().codePoints().iterator(); } else { continue; } boolean bold = child .getStyle() .getBold(); Integer cp; boolean newLine = false; while(i_it.hasNext()){ cp = i_it.next(); if (cp == '\n') { if (newLine) { total += LINE_WIDTH; } else { total = ((int) Math.ceil((double) total / LINE_WIDTH)) * LINE_WIDTH; newLine = true; } } else { int width = getWidth(cp, bold); total += width; newLine = false; } } } return total; }
Source:
public void testImagesDoesNotExist() { DiskImage diskImage1 = getNewDiskImage(); DiskImage diskImage2 = getNewDiskImage(); List<DiskImage> diskImagesFromParams = new ArrayList<>(); diskImagesFromParams.addAll(Arrays.asList(diskImage1, diskImage2)); Set<Guid> guidsForDiskImages = new HashSet<>(Arrays.asList(Guid.newGuid(), Guid.newGuid())); cmd.getParameters().setDisks(guidsForDiskImages); doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST)).when(diskExistenceValidator).diskImagesNotExist(); ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST); }

Target:
public void testImagesDoesNotExist() { Set<Guid> guidsForDiskImages = new HashSet<>(Arrays.asList(Guid.newGuid(), Guid.newGuid())); cmd.getParameters().setDiskIds(guidsForDiskImages); doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST)).when(diskExistenceValidator).diskImagesNotExist(); ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST); }
Source:
private void registerNewUsersWithExisting(TokensApi unAuthenticatedTokensApi) throws Exception { mockGitHub(CUSTOM_USERNAME1); mockGoogleHelper(GOOGLE_ACCOUNT_USERNAME1); try { unAuthenticatedTokensApi.addGoogleToken(satellizerJSONForRegistration); Assert.fail(); } catch (Exception e){ Assert.assertEquals("User already exists, cannot register new user", e.getMessage());; } try { unAuthenticatedTokensApi.addToken(satellizerJSONForRegistration); Assert.fail(); } catch (Exception e){ Assert.assertTrue(e.getMessage().contains("already exists")); } }

Target:
private void registerNewUsersWithExisting(TokensApi unAuthenticatedTokensApi) throws Exception { mockGitHub(CUSTOM_USERNAME1); mockGoogleHelper(GOOGLE_ACCOUNT_USERNAME1); try { unAuthenticatedTokensApi.addGoogleToken(satellizerJSONForRegistration); Assert.fail(); } catch (ApiException e){ Assert.assertEquals("User already exists, cannot register new user", e.getMessage());; } try { unAuthenticatedTokensApi.addToken(satellizerJSONForRegistration); Assert.fail(); } catch (ApiException e){ Assert.assertTrue(e.getMessage().contains("already exists")); } }
Source:
private void removeChildFromLRU(ExpressionInfo child) { String childFullExpression = child.getFullExpr(); VariableObjectId childId = new VariableObjectId(); childId.generateId(childFullExpression, getInternalId()); MIVariableObject childOfChild = lruVariableList.remove(childId); if (childOfChild != null) { childOfChild.removeChildrenFromLRU(); } }

Target:
private void removeChildFromLRU(ExpressionInfo child) { String childFullExpression = child.getFullExpr(); VariableObjectId childId = new VariableObjectId(); childId.generateId(childFullExpression, getInternalId()); MIVariableObject varobjOfChild = lruVariableList.remove(childId); if (varobjOfChild != null) { varobjOfChild.removeChildrenFromLRU(); } }
Source:
public int command(String cmd, Writer out, Writer err) { checkNotNull(cmd, "command"); final WinRm service = getService(); final CommandLine cmdLine = new CommandLine(); cmdLine.setCommand(cmd); final OptionSetType optSetCmd = new OptionSetType(); OptionType optConsolemodeStdin = new OptionType(); optConsolemodeStdin.setName("WINRS_CONSOLEMODE_STDIN"); optConsolemodeStdin.setValue("TRUE"); optSetCmd.getOption().add(optConsolemodeStdin); OptionType optSkipCmdShell = new OptionType(); optSkipCmdShell.setName("WINRS_SKIP_CMD_SHELL"); optSkipCmdShell.setValue("FALSE"); optSetCmd.getOption().add(optSkipCmdShell); numberOfReceiveCalls = 0; CommandResponse cmdResponse = winrmCallRetryConnFailure(new CallableFunction<CommandResponse>() { @Override public CommandResponse call() { setActionToContext((BindingProvider) service, "<LINK_1>"); return service.command(cmdLine, RESOURCE_URI, MAX_ENVELOPER_SIZE, operationTimeout, locale, shellSelector, optSetCmd); } }); String commandId = cmdResponse.getCommandId(); try { return receiveCommand(commandId, out, err); } finally { releaseCommand(commandId); } }

Target:
public int command(String cmd, Writer out, Writer err) { checkNotNull(cmd, "command"); final WinRm service = getService(); final CommandLine cmdLine = new CommandLine(); cmdLine.setCommand(cmd); final OptionSetType optSetCmd = new OptionSetType(); OptionType optConsolemodeStdin = new OptionType(); optConsolemodeStdin.setName("WINRS_CONSOLEMODE_STDIN"); optConsolemodeStdin.setValue("TRUE"); optSetCmd.getOption().add(optConsolemodeStdin); OptionType optSkipCmdShell = new OptionType(); optSkipCmdShell.setName("WINRS_SKIP_CMD_SHELL"); optSkipCmdShell.setValue("FALSE"); optSetCmd.getOption().add(optSkipCmdShell); numberOfReceiveCalls = 0; setActionToContext((BindingProvider) service, "<LINK_1>"); CommandResponse cmdResponse = service.command(cmdLine, RESOURCE_URI, MAX_ENVELOPER_SIZE, operationTimeout, locale, shellSelector, optSetCmd); String commandId = cmdResponse.getCommandId(); try { return receiveCommand(commandId, out, err); } finally { releaseCommand(commandId); } }
Source:
public int size() { if (countQuery == null) { return UNKNOWN_SIZE; } try (Connection connection = createConnection()) { Statement st = connection.createStatement(); ResultSet res = st.executeQuery(countQuery); int count = 0; if (res.next()) { count = res.getInt(1); } return count; } catch (SQLException e) { log.warn("Could not determine query size by count query"); try (Connection connection = createConnection()) { Statement st = connection.createStatement(); st.setMaxRows(1); ResultSet res = st.executeQuery(sqlQuery); if (res.next()) { return UNKNOWN_SIZE; } else { return 0; } } catch (SQLException e2) { log.error("Could not determine query size by counting query result", e2); return 0; } } }

Target:
public int size() { if (countQuery == null) { return vagueSize(); } try (Connection connection = createConnection()) { Statement st = connection.createStatement(); ResultSet res = st.executeQuery(countQuery); int count = 0; if (res.next()) { count = res.getInt(1); } return count; } catch (SQLException e) { log.warn("Could not determine query size by count query", e); return vagueSize(); } }
Source:
public void countLostEvent(TmfTimeRange timeRange, int nbLostEvents, boolean fullRange) { if (timeRange.getStartTime().getValue() < 0 || timeRange.getEndTime().getValue() < 0) { return; } int indexStart = (int) ((timeRange.getStartTime().getValue() - fFirstBucketTime) / fBucketDuration); int indexEnd = (int) ((timeRange.getEndTime().getValue() - fFirstBucketTime) / fBucketDuration); if (!fullRange) { if (timeRange.getEndTime().getValue() > fTimeLimit) { indexEnd = (int) ((fTimeLimit - fFirstBucketTime) / fBucketDuration); } } int nbBucketRange = (indexEnd - indexStart) + 1; int lostEventPerBucket = nbLostEvents / nbBucketRange; int remainLostEvent = nbLostEvents % nbBucketRange; if (fullRange && timeRange.getEndTime().getValue() >= fTimeLimit) { while (timeRange.getEndTime().getValue() >= fTimeLimit) { mergeBuckets(); } } for (int index = indexStart; index <= indexEnd; index++) { fLostEventsBuckets[index] += lostEventPerBucket; if ((index - indexStart) < remainLostEvent) { fLostEventsBuckets[index]++; } } fNbEvents++; fireModelUpdateNotification(nbLostEvents); }

Target:
public void countLostEvent(TmfTimeRange timeRange, int nbLostEvents, boolean fullRange) { if (timeRange.getStartTime().getValue() < 0 || timeRange.getEndTime().getValue() < 0) { return; } int indexStart = (int) ((timeRange.getStartTime().getValue() - fFirstBucketTime) / fBucketDuration); int indexEnd = (int) ((timeRange.getEndTime().getValue() - fFirstBucketTime) / fBucketDuration); if (!fullRange) { if (timeRange.getEndTime().getValue() > fTimeLimit) { indexEnd = (int) ((fTimeLimit - fFirstBucketTime) / fBucketDuration); } } int nbBucketRange = (indexEnd - indexStart) + 1; int lostEventPerBucket = (int) Math.ceil((double) nbLostEvents / nbBucketRange); int lastLostCol = nbLostEvents - lostEventPerBucket * (nbBucketRange -1); if (fullRange && timeRange.getEndTime().getValue() >= fTimeLimit) { while (timeRange.getEndTime().getValue() >= fTimeLimit) { mergeBuckets(); } } indexEnd = Math.min(indexEnd, DEFAULT_NUMBER_OF_BUCKETS); for (int index = indexStart; index <= indexEnd; index++) { if (index == (indexStart + nbBucketRange)) { fLostEventsBuckets[index] += lastLostCol; } else { fLostEventsBuckets[index] += lostEventPerBucket; } } fNbEvents++; fireModelUpdateNotification(nbLostEvents); }
Source:
private static void populateEntry(Cache<Path, LocalMetadataEntry> cache, Path path) { FileStatus fileStatus = new FileStatus(0, true, 0, 0, 0, path); S3AFileStatus s3aStatus = S3AFileStatus.fromFileStatus( fileStatus, Tristate.UNKNOWN, null, null); cache.put(path, new LocalMetadataEntry(new PathMetadata(s3aStatus))); }

Target:
private static void populateEntry(Cache<Path, LocalMetadataEntry> cache, Path path) { S3AFileStatus s3aStatus = new S3AFileStatus(Tristate.UNKNOWN, path, null); cache.put(path, new LocalMetadataEntry(new PathMetadata(s3aStatus))); }
Source:
public CamusWrapper<String> decode(Message message) { long timestamp = 0; String payloadString; try { payloadString = new String(message.getPayload(), "UTF-8"); } catch (UnsupportedEncodingException e) { log.error("Unable to load UTF-8 encoding, falling back to system default", e); payloadString = new String(message.getPayload()); } return new CamusWrapper<String>(payloadString, System.currentTimeMillis()); }

Target:
public CamusWrapper<String> decode(Message message) { String payloadString; try { payloadString = new String(message.getPayload(), "UTF-8"); } catch (UnsupportedEncodingException e) { log.error("Unable to load UTF-8 encoding, falling back to system default", e); payloadString = new String(message.getPayload()); } return new CamusWrapper<String>(payloadString, System.currentTimeMillis()); }
Source:
public Violation(String subject) { logger.error( "new Violation(subject) is no longer supported - please use new Violation(OWLEntity) instead."); }

Target:
public Violation(String subject) { this.subject = subject; }
Source:
public void before(InfinispanServerDriver driver) { databases = new LinkedHashMap<>(databaseTypes.length); for (int i = 0; i < databaseTypes.length; i++) { Database database = initDatabase(databaseTypes[i]); log.infof("Starting database: %s", database.getType()); database.start(); log.infof("Started database: %s", database.getType()); databases.put(databaseTypes[i], database); driver.getConfiguration().properties().put("org.infinispan.server.test."+ database.getType()+".jdbcUrl", database.jdbcUrl()); } }

Target:
public void before(InfinispanServerDriver driver) { databases = new LinkedHashMap<>(databaseTypes.length); for (String dbType : databaseTypes) { Database database = initDatabase(dbType); log.infof("Starting database: %s", database.getType()); database.start(); log.infof("Started database: %s", database.getType()); if (databases.putIfAbsent(dbType, database) != null) { throw new RuntimeException("Duplicate database type " + dbType); } driver.getConfiguration().properties().put("org.infinispan.server.test." + database.getType() + ".jdbcUrl", database.jdbcUrl()); } }
Source:
protected void createMainControl(Composite parent, IEEFFormContainer formContainer) { EEFWidgetFactory widgetFactory = formContainer.getWidgetFactory(); FormData formData = new FormData(); formData.left = new FormAttachment(0, LABEL_WIDTH); formData.right = new FormAttachment(100, 0); int lineCount = description.getLineCount(); if (lineCount > 1) { this.text = widgetFactory.createStyledText(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP); formData.height = lineCount * text.getLineHeight(); } else { this.text = widgetFactory.createStyledText(parent, SWT.NONE); } this.text.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); widgetFactory.paintBordersFor(parent); this.text.setLayoutData(formData); if (!isEnabled()) { this.text.setEnabled(false); this.text.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); } this.controller = new EEFControllersFactory().createTextController(this.description, this.variableManager, this.interpreter, this.editingDomain); }

Target:
protected void createMainControl(Composite parent, IEEFFormContainer formContainer) { EEFWidgetFactory widgetFactory = formContainer.getWidgetFactory(); FormData formData = new FormData(); formData.left = new FormAttachment(0, LABEL_WIDTH); formData.right = new FormAttachment(100, 0); int lineCount = description.getLineCount(); if (lineCount > 1) { this.text = widgetFactory.createStyledText(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP); formData.height = lineCount * text.getLineHeight(); } else { this.text = widgetFactory.createStyledText(parent, SWT.NONE); } this.text.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); widgetFactory.paintBordersFor(parent); this.text.setLayoutData(formData); this.controller = new EEFControllersFactory().createTextController(this.description, this.variableManager, this.interpreter, this.editingDomain); }
Source:
private void setHandshakeSuccess() { handshakePromise.trySuccess(ctx.channel()); if (logger.isDebugEnabled()) { logger.debug("{} HANDSHAKEN: {}", ctx.channel(), engine.getSession().getCipherSuite()); } ctx.fireUserEventTriggered(SslHandshakeCompletionEvent.SUCCESS); if (TlsMasterKeyHandler.DoNothingTlsMasterKeyHandler.INSTANCE != masterKeyHandler) { logMasterSecret(engine, masterKeyHandler); } if (readDuringHandshake && !ctx.channel().config().isAutoRead()) { readDuringHandshake = false; ctx.read(); } }

Target:
private void setHandshakeSuccess() { handshakePromise.trySuccess(ctx.channel()); if (logger.isDebugEnabled()) { logger.debug("{} HANDSHAKEN: {}", ctx.channel(), engine.getSession().getCipherSuite()); } ctx.fireUserEventTriggered(SslHandshakeCompletionEvent.SUCCESS); if (readDuringHandshake && !ctx.channel().config().isAutoRead()) { readDuringHandshake = false; ctx.read(); } }
Source:
private void waitUntilExpectedProgress(long expectedProgress, int maxTimeToCheck) throws InterruptedException { int sleptSoFar = 0; while (expectedProgress != index.hardDeleter.getProgress()) { sleptSoFar += 5; Thread.sleep(5); if (sleptSoFar == maxTimeToCheck) { fail("HardDelete failed to catch up in " + maxTimeToCheck); } index.hardDeleter.preLogFlush(); index.hardDeleter.postLogFlush(); } }

Target:
private void waitUntilExpectedProgress(long expectedProgress, int maxTimeToCheck) throws InterruptedException { int sleptSoFar = 0; while (expectedProgress != index.hardDeleter.getProgress()) { sleptSoFar += 5; Thread.sleep(5); if (sleptSoFar >= maxTimeToCheck) { fail("HardDelete failed to catch up in " + maxTimeToCheck); } index.hardDeleter.preLogFlush(); index.hardDeleter.postLogFlush(); } }
Source:
public void start(final Environment env) { startThread(new CommandRunnable() { @Override public void run() throws Exception { if (!currentUser.getCapabilities().canCreateProject()) { String msg = String.format( "fatal: %s does not have \"Create Project\" capability.", currentUser.getUserName()); throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, msg); } PrintWriter p = toPrintWriter(out); parseCommandLine(); try { if (!suggestParent) { if (projectName == null) { throw new UnloggedFailure(1, "Error: Project name is required."); } final CreateProjectArgs args = new CreateProjectArgs(); args.setProjectName(projectName); args.ownerIds = ownerIds; args.newParent = newParent; args.permissionsOnly = permissionsOnly; args.projectDescription = projectDescription; args.submitType = submitType; args.contributorAgreements = contributorAgreements; args.signedOffBy = signedOffBy; args.contentMerge = contentMerge; args.changeIdRequired = requireChangeID; args.branch = branch; args.createEmptyCommit = createEmptyCommit; final CreateProject createProject = CreateProjectFactory.create(args); createProject.createProject(); } else { List<Project.NameKey> parentCandidates = retrieveParentCandidatesFactory.create().get(); for (Project.NameKey parent : parentCandidates) { p.print(parent + "\n"); } } } catch (ProjectCreationFailedException err) { throw new UnloggedFailure(1, "Fatal: " + err.getMessage(), err); } finally { p.flush(); } } }); }

Target:
public void start(final Environment env) { startThread(new CommandRunnable() { @Override public void run() throws Exception { if (!currentUser.getCapabilities().canCreateProject()) { String msg = String.format( "fatal: %s does not have \"Create Project\" capability.", currentUser.getUserName()); throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, msg); } PrintWriter p = toPrintWriter(out); parseCommandLine(); try { if (!suggestParent) { if (projectName == null) { throw new UnloggedFailure(1, "fatal: Project name is required."); } final CreateProjectArgs args = new CreateProjectArgs(); args.setProjectName(projectName); args.ownerIds = ownerIds; args.newParent = newParent; args.permissionsOnly = permissionsOnly; args.projectDescription = projectDescription; args.submitType = submitType; args.contributorAgreements = contributorAgreements; args.signedOffBy = signedOffBy; args.contentMerge = contentMerge; args.changeIdRequired = requireChangeID; args.branch = branch; args.createEmptyCommit = createEmptyCommit; final CreateProject createProject = CreateProjectFactory.create(args); createProject.createProject(); } else { List<Project.NameKey> parentCandidates = retrieveParentCandidatesFactory.create().get(); for (Project.NameKey parent : parentCandidates) { p.print(parent + "\n"); } } } catch (ProjectCreationFailedException err) { throw new UnloggedFailure(1, "fatal: " + err.getMessage(), err); } finally { p.flush(); } } }); }
Source:
public ShardSyncTaskManager(ShardDetector shardDetector, LeaseRefresher leaseRefresher, InitialPositionInStreamExtended initialPositionInStream, boolean cleanupLeasesUponShardCompletion, boolean ignoreUnexpectedChildShards, long shardSyncIdleTimeMillis, ExecutorService executorService, MetricsFactory metricsFactory) { this(shardDetector, leaseRefresher, initialPositionInStream, cleanupLeasesUponShardCompletion, ignoreUnexpectedChildShards, shardSyncIdleTimeMillis, executorService, metricsFactory, new ShardSyncer()); }

Target:
public ShardSyncTaskManager(ShardDetector shardDetector, LeaseRefresher leaseRefresher, InitialPositionInStreamExtended initialPositionInStream, boolean cleanupLeasesUponShardCompletion, boolean ignoreUnexpectedChildShards, long shardSyncIdleTimeMillis, ExecutorService executorService, MetricsFactory metricsFactory) { this.shardDetector = shardDetector; this.leaseRefresher = leaseRefresher; this.initialPositionInStream = initialPositionInStream; this.cleanupLeasesUponShardCompletion = cleanupLeasesUponShardCompletion; this.ignoreUnexpectedChildShards = ignoreUnexpectedChildShards; this.shardSyncIdleTimeMillis = shardSyncIdleTimeMillis; this.executorService = executorService; this.hierarchicalShardSyncer = new HierarchicalShardSyncer(); this.metricsFactory = metricsFactory; }
Source:
public ShardConsumer(RecordsPublisher recordsPublisher, ExecutorService executorService, ShardInfo shardInfo, Optional<Long> logWarningForTaskAfterMillis, ShardConsumerArgument shardConsumerArgument, TaskExecutionListener taskExecutionListener) { this(recordsPublisher, executorService, shardInfo, logWarningForTaskAfterMillis, shardConsumerArgument, taskExecutionListener, ConsumerStates.INITIAL_STATE, ShardConsumer.metricsWrappingFunction(shardConsumerArgument.metricsFactory()), 8); }

Target:
public ShardConsumer(RecordsPublisher recordsPublisher, ExecutorService executorService, ShardInfo shardInfo, Optional<Long> logWarningForTaskAfterMillis, ShardConsumerArgument shardConsumerArgument, TaskExecutionListener taskExecutionListener) { this(recordsPublisher, executorService, shardInfo, logWarningForTaskAfterMillis, shardConsumerArgument, ConsumerStates.INITIAL_STATE, ShardConsumer.metricsWrappingFunction(shardConsumerArgument.metricsFactory()), 8, taskExecutionListener); }
Source:
protected void init(SlotProvider<IInventory, ItemStack> slots) { int base = 0; this.addSpanningChild(new GridInventoryLensImpl(base, 9, this.upperChest / 9, 9, slots)); base += this.upperChest; this.addSpanningChild(new GridInventoryLensImpl(base, 9, this.lowerChest / 9, 9, slots)); base += lowerChest; for (int i = base; i < this.slotCount(); i++) { this.addSpanningChild(new SlotLensImpl(i), SlotIndex.of(i)); } }

Target:
protected void init(SlotProvider<IInventory, ItemStack> slots) { int base = 0; this.addSpanningChild(new GridInventoryLensImpl(base, 9, this.upperChest / 9, 9, slots)); base += this.upperChest; this.addSpanningChild(new GridInventoryLensImpl(base, 9, this.lowerChest / 9, 9, slots)); base += this.lowerChest; for (int i = base; i < this.slotCount(); i++) { this.addSpanningChild(new SlotLensImpl(i), SlotIndex.of(i)); } }