auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void writeDictionary() throws IOException { Collection<MetricsDictionary.Word> words = dictionary.words(); dictionaryDos.writeInt(words.size()); String lastWord = ""; for (MetricsDictionary.Word word : words) { String wordText = word.word(); if (wordText.length() > UNSIGNED_BYTE_MAX_VALUE) { throw new RuntimeException("Dictionary element too long: " + wordText); } int maxCommonLen = Math.min(lastWord.length(), wordText.length()) & UNSIGNED_BYTE_MAX_VALUE; int commonLen = 0; while (commonLen < maxCommonLen && wordText.charAt(commonLen) == lastWord.charAt(commonLen)) { commonLen++; } int diffLen = wordText.length() - commonLen; dictionaryDos.writeInt(word.dictionaryId()); dictionaryDos.writeByte(commonLen); dictionaryDos.writeByte(diffLen); for (int i = commonLen; i < wordText.length(); i++) { dictionaryDos.writeChar(wordText.charAt(i)); } lastWord = wordText; } }

Target:
private void writeDictionary() throws IOException { Collection<MetricsDictionary.Word> words = dictionary.words(); dictionaryDos.writeInt(words.size()); String lastWord = ""; for (MetricsDictionary.Word word : words) { tmpBaos.reset(); String wordText = word.word(); if (wordText.length() > UNSIGNED_BYTE_MAX_VALUE) { throw new RuntimeException("Dictionary element too long: " + wordText); } int maxCommonLen = Math.min(lastWord.length(), wordText.length()); int commonLen = 0; while (commonLen < maxCommonLen && wordText.charAt(commonLen) == lastWord.charAt(commonLen)) { commonLen++; } int diffLen = wordText.length() - commonLen; tmpDos.writeInt(word.dictionaryId()); tmpDos.writeByte(commonLen); tmpDos.writeByte(diffLen); for (int i = commonLen; i < wordText.length(); i++) { tmpDos.writeChar(wordText.charAt(i)); } lastWord = wordText; dictionaryDos.write(tmpBaos.internalBuffer(), 0, tmpBaos.size()); } }
Source:
WorkbenchSiteProgressService getSiteProgressService() { return (WorkbenchSiteProgressService) e4Context.get(IWorkbenchSiteProgressService.class); }

Target:
IWorkbenchSiteProgressService getSiteProgressService() { return e4Context.get(IWorkbenchSiteProgressService.class); }
Source:
protected void appendCgroupsCmds(StringBuilder cmdLine) { if (myriadConfiguration.getFrameworkSuperUser().isPresent() && myriadConfiguration.isCgroupEnabled()) { cmdLine.append(" export TASK_DIR=`basename $PWD`&&"); appendSudo(cmdLine); cmdLine.append("chown " + myriadConfiguration.getFrameworkUser().get() + " "); cmdLine.append(myriadConfiguration.getCGroupPath()); cmdLine.append("/cpu/mesos/$TASK_DIR &&"); cmdLine.append(String.format("export %s=%s -D%s=%s", ENV_YARN_NODEMANAGER_OPTS, ENV_YARN_NODEMANAGER_OPTS, KEY_YARN_NM_LCE_CGROUPS_HIERARCHY, "mesos/$TASK_DIR")); } else if (myriadConfiguration.isCgroupEnabled()) { LOGGER.info("frameworkSuperUser not set ignoring cgroup configuration, this will likely can the nodemanager to crash"); } }

Target:
protected void appendCgroupsCmds(StringBuilder cmdLine) { if (myriadConfiguration.getFrameworkSuperUser().isPresent() && myriadConfiguration.isCgroupEnabled()) { cmdLine.append(" export TASK_DIR=`cat /proc/self/cgroup | grep :cpu: | cut -d: -f3` &&"); appendSudo(cmdLine); cmdLine.append("chown " + myriadConfiguration.getFrameworkUser().get() + " "); cmdLine.append(myriadConfiguration.getCGroupPath()); cmdLine.append("/cpu$TASK_DIR &&"); cmdLine.append(String.format("export %s=\"$%s -D%s=%s\" && ", ENV_YARN_NODEMANAGER_OPTS, ENV_YARN_NODEMANAGER_OPTS, KEY_YARN_NM_LCE_CGROUPS_HIERARCHY, "$TASK_DIR")); } else if (myriadConfiguration.isCgroupEnabled()) { LOGGER.info("frameworkSuperUser not set ignoring cgroup configuration, this will likely can the nodemanager to crash"); } }
Source:
private void validateInitialCursors(final SubscriptionBase subscription, final List<EventTypePartition> allPartitions) throws WrongInitialCursorsException, RepositoryProblemException { final boolean cursorsMissing = allPartitions.stream() .anyMatch(p -> !subscription.getInitialCursors().stream().anyMatch(p::ownsCursor)); if (cursorsMissing) { throw new WrongInitialCursorsException( "initial_cursors should contain cursors for all partitions of subscription"); } final boolean hasCursorForWrongPartition = subscription.getInitialCursors().stream() .anyMatch(c -> !allPartitions.contains(new EventTypePartition(c.getEventType(), c.getPartition()))); if (hasCursorForWrongPartition) { throw new WrongInitialCursorsException( "initial_cursors should contain cursors only for partitions of this subscription"); } if (subscription.getInitialCursors().size() > allPartitions.size()) { throw new WrongInitialCursorsException( "there should be no more than 1 cursor for each partition in initial_cursors"); } try { for (SubscriptionCursorWithoutToken cursor : subscription.getInitialCursors()) { final NakadiCursor nakadiCursor = cursorConverter.convert(cursor); timelineService.getTopicRepository(nakadiCursor.getTimeline()).validateReadCursors( Collections.singletonList(nakadiCursor)); } } catch (final InvalidCursorException ex) { throw new WrongInitialCursorsException(ex.getMessage(), ex); } catch (final NakadiException ex) { throw new RepositoryProblemException("Topic repository problem occurred when validating cursors", ex); } }

Target:
private void validateInitialCursors(final SubscriptionBase subscription, final List<EventTypePartition> allPartitions) throws WrongInitialCursorsException, RepositoryProblemException { final boolean cursorsMissing = allPartitions.stream() .anyMatch(p -> !subscription.getInitialCursors().stream().anyMatch(p::ownsCursor)); if (cursorsMissing) { throw new WrongInitialCursorsException( "initial_cursors should contain cursors for all partitions of subscription"); } final boolean hasCursorForWrongPartition = subscription.getInitialCursors().stream() .anyMatch(c -> !allPartitions.contains(new EventTypePartition(c.getEventType(), c.getPartition()))); if (hasCursorForWrongPartition) { throw new WrongInitialCursorsException( "initial_cursors should contain cursors only for partitions of this subscription"); } if (subscription.getInitialCursors().size() > allPartitions.size()) { throw new WrongInitialCursorsException( "there should be no more than 1 cursor for each partition in initial_cursors"); } try { for (final SubscriptionCursorWithoutToken cursor : subscription.getInitialCursors()) { final NakadiCursor nakadiCursor = cursorConverter.convert(cursor); timelineService.getTopicRepository(nakadiCursor.getTimeline()).validateReadCursors( Collections.singletonList(nakadiCursor)); } } catch (final InvalidCursorException ex) { throw new WrongInitialCursorsException(ex.getMessage(), ex); } catch (final NakadiException ex) { throw new RepositoryProblemException("Topic repository problem occurred when validating cursors", ex); } }
Source:
public String destroy(Request req, Response res) throws IOException { String groupName = req.params("group_name"); PipelineConfigs pipelineConfigs = fetchEntityFromConfig(groupName); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); if (!pipelineConfigs.isEmpty()) { result.unprocessableEntity(String.format("Failed to delete group %s because it was not empty.", groupName)); } else { pipelineConfigsService.deleteGroup(SessionUtils.currentUsername(), pipelineConfigs, result); } return renderHTTPOperationResult(result, req, res); }

Target:
public String destroy(Request req, Response res) throws IOException { PipelineConfigs pipelineConfigs = fetchEntityFromConfig(req.params("group_name")); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); pipelineConfigsService.deleteGroup(SessionUtils.currentUsername(), pipelineConfigs, result); return renderHTTPOperationResult(result, req, res); }
Source:
public ConceptName getName() { if (getNames().isEmpty()) { if (log.isDebugEnabled()) { log.debug("there are no names defined for: " + conceptId); } return null; } for (Locale currentLocale : LocaleUtility.getLocalesInOrder()) { ConceptName preferredName = getPreferredName(currentLocale); if (preferredName != null) { return preferredName; } ConceptName fullySpecifiedName = getFullySpecifiedName(currentLocale); if (fullySpecifiedName != null) { return fullySpecifiedName; } if (!StringUtils.isBlank(currentLocale.getCountry()) || !StringUtils.isBlank(currentLocale.getVariant())) { Locale broaderLocale = new Locale(currentLocale.getLanguage()); ConceptName prefNameInBroaderLoc = getPreferredName(broaderLocale); if (prefNameInBroaderLoc != null) { return prefNameInBroaderLoc; } ConceptName fullySpecNameInBroaderLoc = getFullySpecifiedName(broaderLocale); if (fullySpecNameInBroaderLoc != null) { return fullySpecNameInBroaderLoc; } } } for (ConceptName cn : getNames()) { if (cn.isFullySpecifiedName()) { return cn; } } if (!getSynonyms().isEmpty()) { return getSynonyms().iterator().next(); } return null; }

Target:
public ConceptName getName() { if (getNames().isEmpty()) { if (log.isDebugEnabled()) { log.debug("there are no names defined for: " + conceptId); } return null; } for (Locale currentLocale : LocaleUtility.getLocalesInOrder()) { ConceptName preferredName = getPreferredName(currentLocale); if (preferredName != null) { return preferredName; } ConceptName fullySpecifiedName = getFullySpecifiedName(currentLocale); if (fullySpecifiedName != null) { return fullySpecifiedName; } if (!StringUtils.isBlank(currentLocale.getCountry()) || !StringUtils.isBlank(currentLocale.getVariant())) { Locale broaderLocale = new Locale(currentLocale.getLanguage()); ConceptName prefNameInBroaderLoc = getPreferredName(broaderLocale); if (prefNameInBroaderLoc != null) { return prefNameInBroaderLoc; } ConceptName fullySpecNameInBroaderLoc = getFullySpecifiedName(broaderLocale); if (fullySpecNameInBroaderLoc != null) { return fullySpecNameInBroaderLoc; } } } for (ConceptName cn : getNames()) { if (cn.isFullySpecifiedName()) { return cn; } } if (CollectionUtils.isNotEmpty(getSynonyms())) { return getSynonyms().iterator().next(); } return null; }
Source:
protected DocumentTypeSelectionDialog(final Shell parentShell, final String title, final String message) { super(parentShell, title, null, message, MessageDialog.QUESTION, new String[] { Messages.getString("DocumentTypeSelectionDialog.ok"), Messages.getString("DocumentTypeSelectionDialog.cancel") }, 0); setShellStyle(SWT.RESIZE); }

Target:
protected DocumentTypeSelectionDialog(final Shell parentShell, final String title, final String message) { super(parentShell, title, null, message, MessageDialog.QUESTION, new String[] { Messages.getString("DocumentTypeSelectionDialog.ok"), Messages.getString("DocumentTypeSelectionDialog.cancel") }, 0); setShellStyle(SWT.RESIZE | SWT.ON_TOP); }
Source:
public void doLaunch(Context context, View v) { if (v == null) { Toast.makeText(context, ("MSG: " + this.pojo.displayName), Toast.LENGTH_SHORT).show(); } else { Toast.makeText(context, "Uh-oh something went wrong!!" + this.pojo.displayName, Toast.LENGTH_SHORT).show(); } }

Target:
public void doLaunch(Context context, View v) { if (v != null) { Toast.makeText(context, R.string.application_not_found, Toast.LENGTH_LONG).show(); } }
Source:
public BaseListModelSuggestBox(MultiWordSuggestOracle suggestOracle) { suggestBox = new SuggestBox(suggestOracle, new TextBox(), suggestionDisplay) { @Override public void setText(String text) { super.setText(text); postTextSet(text); } }; suggestBox.removeStyleName("gwt-SuggestBox"); suggestBox.addSelectionHandler(new SelectionHandler<Suggestion>() { @Override public void onSelection(SelectionEvent<Suggestion> event) { ValueChangeEvent.fire(suggestBox, event.getSelectedItem().getReplacementString()); } }); }

Target:
public BaseListModelSuggestBox(MultiWordSuggestOracle suggestOracle) { suggestBox = new SuggestBox(suggestOracle, new TextBox(), suggestionDisplay); suggestBox.removeStyleName("gwt-SuggestBox"); suggestBox.addSelectionHandler(new SelectionHandler<Suggestion>() { @Override public void onSelection(SelectionEvent<Suggestion> event) { ValueChangeEvent.fire(suggestBox, event.getSelectedItem().getReplacementString()); } }); }
Source:
private List<StructuredRecord> getInputData() throws IOException { List<StructuredRecord> messagesToWrite = new ArrayList<>(); File file = new File(this.getClass().getResource("/trainData.csv").getFile()); BufferedReader bufferedInputStream = new BufferedReader(new FileReader(file)); String line; while ((line = bufferedInputStream.readLine()) != null) { String[] flightData = line.split(","); Double depdelaymins = Double.parseDouble(flightData[11]); double delayed = depdelaymins > 40 ? 1.0 : 0.0; messagesToWrite.add(new Flight(Integer.parseInt(flightData[0]), Integer.parseInt(flightData[1]), flightData[2], flightData[3], Integer.parseInt(flightData[4]), flightData[5], flightData[6], flightData[7], flightData[8], Integer.parseInt(flightData[9]), Double.parseDouble(flightData[10]), depdelaymins, Double.parseDouble(flightData[12]), Double.parseDouble(flightData[13]), Double.parseDouble(flightData[14]), Double.parseDouble(flightData[15]), Integer.parseInt(flightData[16]), delayed) .toStructuredRecord()); } return messagesToWrite; }

Target:
private List<StructuredRecord> getInputData() throws IOException { List<StructuredRecord> messagesToWrite = new ArrayList<>(); File file = new File(this.getClass().getResource("/trainData.csv").getFile()); BufferedReader bufferedInputStream = new BufferedReader(new FileReader(file)); String line; while ((line = bufferedInputStream.readLine()) != null) { String[] flightData = line.split(","); Double depDelayMins = Double.parseDouble(flightData[11]); double delayed = depDelayMins > 40 ? 1.0 : 0.0; messagesToWrite.add(new Flight(Integer.parseInt(flightData[0]), Integer.parseInt(flightData[1]), Double.parseDouble(flightData[2]), flightData[3], Integer.parseInt(flightData[4]), Integer.parseInt(flightData[5]), flightData[6], Integer.parseInt(flightData[7]), flightData[8], Integer.parseInt(flightData[9]), Double.parseDouble(flightData[10]), depDelayMins, Double.parseDouble(flightData[12]), Double.parseDouble(flightData[13]), Double.parseDouble(flightData[14]), Double.parseDouble(flightData[15]), Integer.parseInt(flightData[16]), delayed) .toStructuredRecord()); } return messagesToWrite; }
Source:
void runOnce() { if (transactionManager != null) { try { if (transactionManager.isTransactional() && transactionManager.hasUnresolvedSequences() && !transactionManager.hasFatalError()) { transactionManager.transitionToFatalError( new KafkaException("The client hasn't received acknowledgment for " + "some previously sent messages and can no longer retry them. It isn't safe to continue.")); } if (transactionManager.hasFatalError()) { RuntimeException lastError = transactionManager.lastError(); if (lastError != null) maybeAbortBatches(lastError); client.poll(retryBackoffMs, time.milliseconds()); return; } transactionManager.resetProducerIdIfNeeded(); if (maybeSendAndPollTransactionalRequest()) { return; } } catch (AuthenticationException e) { log.trace("Authentication exception while processing transactional request: {}", e); transactionManager.authenticationFailed(e); } } long currentTimeMs = time.milliseconds(); long pollTimeout = sendProducerData(currentTimeMs); client.poll(pollTimeout, currentTimeMs); }

Target:
void runOnce() { if (transactionManager != null) { try { if (transactionManager.isTransactional() && transactionManager.hasUnresolvedSequences() && !transactionManager.hasFatalError()) { transactionManager.transitionToFatalError( new KafkaException("The client hasn't received acknowledgment for " + "some previously sent messages and can no longer retry them. It isn't safe to continue.")); } if (transactionManager.hasFatalError()) { RuntimeException lastError = transactionManager.lastError(); if (lastError != null) maybeAbortBatches(lastError); client.poll(retryBackoffMs, time.milliseconds()); return; } transactionManager.resetIdempotentProducerIdIfNeeded(); if (maybeSendAndPollTransactionalRequest()) { return; } } catch (AuthenticationException e) { log.trace("Authentication exception while processing transactional request: {}", e); transactionManager.authenticationFailed(e); } } long currentTimeMs = time.milliseconds(); long pollTimeout = sendProducerData(currentTimeMs); client.poll(pollTimeout, currentTimeMs); }
Source:
private static CasualtyDetails getLowLuckAaCasualties( final List<Unit> availableTargets, final AaPowerStrengthAndRolls unitPowerAndRollsMap, final DiceRoll dice, final IDelegateBridge bridge) { final LowLuckTargetGroups targetGroups = createGuaranteedLowLuckHitGroups(availableTargets, dice, unitPowerAndRollsMap); if (targetGroups.guaranteedHitGroups.isEmpty()) { return buildCasualtyDetails( availableTargets, findRandomTargets(availableTargets, bridge, dice.getHits())); } if (dice.getHits() >= targetGroups.guaranteedHitGroups.size()) { final List<Unit> hitTargetIndices = new ArrayList<>(); for (final List<Unit> group : targetGroups.guaranteedHitGroups) { hitTargetIndices.add(group.get(0)); } final int remainderHits = dice.getHits() - targetGroups.guaranteedHitGroups.size(); if (remainderHits > 0) { if (remainderHits == targetGroups.remainderUnits.size()) { hitTargetIndices.addAll(targetGroups.remainderUnits); } else { hitTargetIndices.addAll( findRandomTargets(targetGroups.remainderUnits, bridge, remainderHits)); } } return buildCasualtyDetails(availableTargets, hitTargetIndices); } else { final List<Unit> guaranteedHitUnits = new ArrayList<>(); for (final List<Unit> group : targetGroups.guaranteedHitGroups) { guaranteedHitUnits.add(group.get(0)); } return buildCasualtyDetails( availableTargets, findRandomTargets(guaranteedHitUnits, bridge, dice.getHits())); } }

Target:
private static Collection<Unit> getLowLuckAaCasualties( final List<Unit> availableTargets, final AaPowerStrengthAndRolls unitPowerAndRollsMap, final DiceRoll dice, final IDelegateBridge bridge) { final LowLuckTargetGroups targetGroups = new LowLuckTargetGroups(availableTargets, dice, unitPowerAndRollsMap); if (!targetGroups.hasGuaranteedGroups()) { return findRandomTargets(availableTargets, bridge, dice.getHits()); } if (dice.getHits() >= targetGroups.getGuaranteedHitGroups().size()) { final List<Unit> hitUnits = targetGroups.getGuaranteedHits(); final int remainderHits = dice.getHits() - hitUnits.size(); if (remainderHits > 0) { if (remainderHits == targetGroups.getRemainderUnits().size()) { hitUnits.addAll(targetGroups.getRemainderUnits()); } else { hitUnits.addAll( findRandomTargets(targetGroups.getRemainderUnits(), bridge, remainderHits)); } } return hitUnits; } else { return findRandomTargets(targetGroups.getGuaranteedHits(), bridge, dice.getHits()); } }
Source:
protected void respond(AjaxRequestTarget target) { String coordinateRaw = RequestCycle.get().getRequest().getRequestParameters() .getParameterValue("coordinate").toString(); String featureId = RequestCycle.get().getRequest().getRequestParameters() .getParameterValue("id").toString(); String properties = RequestCycle.get().getRequest().getRequestParameters() .getParameterValue("properties").toString(); JsonObject propertiesJson = null; JsonElement propertiesParsed = new JsonParser().parse(properties); if (!(propertiesParsed instanceof JsonNull)) { propertiesJson = propertiesParsed.getAsJsonObject(); } String[] coordinates = coordinateRaw.split(","); Double longitude = Double.parseDouble(coordinates[0]); Double latitude = Double.parseDouble(coordinates[1]); if (!featureId.isEmpty()) { handleClick(target, featureId, new LongLat(longitude, latitude, projection), propertiesJson); } else { handleClickMiss(target, new LongLat(longitude, latitude, projection)); } }

Target:
protected void respond(AjaxRequestTarget target) { IRequestParameters params = RequestCycle.get().getRequest().getRequestParameters(); String coordinateRaw = params.getParameterValue("coordinate").toString(); String featureId = params.getParameterValue("id").toString(); String properties = params.getParameterValue("properties").toString(); JsonObject propertiesJson = null; JsonElement propertiesParsed = new JsonParser().parse(properties); if (!(propertiesParsed instanceof JsonNull)) { propertiesJson = propertiesParsed.getAsJsonObject(); } String[] coordinates = Strings.split(coordinateRaw, ','); Double longitude = Double.parseDouble(coordinates[0]); Double latitude = Double.parseDouble(coordinates[1]); if (!featureId.isEmpty()) { handleClick(target, featureId, new LongLat(longitude, latitude, projection), propertiesJson); } else { handleClickMiss(target, new LongLat(longitude, latitude, projection)); } }
Source:
public String getDaemonDir() { String daemonDirectory = pipeConfiguration.getDaemonDir(); int observersDirLength = "pipes/".length() + daemonDirectory.length() - daemonDirectory.lastIndexOf("pipe"); daemonDirectory = daemonDirectory.substring(0, daemonDirectory.length() - observersDirLength); return daemonDirectory + "observers/" + name; }

Target:
public File getDaemonDir() { String daemonDirectory = pipeConfiguration.getDaemonDir().getAbsolutePath(); int observersDirLength = "pipes/".length() + daemonDirectory.length() - daemonDirectory.lastIndexOf("pipe"); daemonDirectory = daemonDirectory.substring(0, daemonDirectory.length() - observersDirLength); return new File(daemonDirectory, "observers/" + name); }
Source:
public static byte[] decode(char[] encoded, boolean allowSingleChar) throws IllegalArgumentException { int resultLengthBytes = (encoded.length + 1) / 2; byte[] result = new byte[resultLengthBytes]; int resultOffset = 0; int i = 0; if (allowSingleChar) { if ((encoded.length % 2) != 0) { result[resultOffset++] = (byte) toDigit(encoded, i); i++; } } else { if ((encoded.length % 2) != 0) { throw new IllegalArgumentException("Invalid input length: " + encoded.length); } } for (; i < encoded.length; i += 2) { result[resultOffset++] = (byte) ((toDigit(encoded, i) << 4) | toDigit(encoded, i + 1)); } return result; }

Target:
public static byte[] decode(char[] encoded, boolean allowSingleChar) throws IllegalArgumentException { int encodedLength = encoded.length; int resultLengthBytes = (encodedLength + 1) / 2; byte[] result = new byte[resultLengthBytes]; int resultOffset = 0; int i = 0; if (allowSingleChar) { if ((encodedLength % 2) != 0) { result[resultOffset++] = (byte) toDigit(encoded, i); i++; } } else { if ((encodedLength % 2) != 0) { throw new IllegalArgumentException("Invalid input length: " + encodedLength); } } for (; i < encodedLength; i += 2) { result[resultOffset++] = (byte) ((toDigit(encoded, i) << 4) | toDigit(encoded, i + 1)); } return result; }
Source:
protected void parseEviction(XMLExtendedStreamReader reader, ConfigurationBuilder builder) throws XMLStreamException { log.evictionDeprecated(); for (int i = 0; i < reader.getAttributeCount(); i++) { String value = replaceProperties(reader.getAttributeValue(i)); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case STRATEGY: { builder.eviction().strategy(EvictionStrategy.valueOf(value)); break; } case MAX_ENTRIES: { log.evictionMaxEntriesDeprecated(); long parsedLong = Long.parseLong(value); builder.eviction().size(parsedLong); builder.memory().size(parsedLong); break; } case THREAD_POLICY: { builder.eviction().threadPolicy(EvictionThreadPolicy.valueOf(value)); break; } case TYPE: { EvictionType type = EvictionType.valueOf(value); builder.eviction().type(type); builder.memory().evictionType(type); break; } case SIZE: { long size = Long.parseLong(value); builder.eviction().size(size); builder.memory().size(size); break; } default: { throw ParseUtils.unexpectedAttribute(reader, i); } } } ParseUtils.requireNoContent(reader); }

Target:
protected void parseEviction(XMLExtendedStreamReader reader, ConfigurationBuilder builder) throws XMLStreamException { log.evictionDeprecated(); for (int i = 0; i < reader.getAttributeCount(); i++) { String value = replaceProperties(reader.getAttributeValue(i)); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case STRATEGY: { builder.eviction().strategy(EvictionStrategy.valueOf(value)); break; } case MAX_ENTRIES: { log.evictionMaxEntriesDeprecated(); builder.eviction().maxEntries(Long.parseLong(value)); break; } case THREAD_POLICY: { builder.eviction().threadPolicy(EvictionThreadPolicy.valueOf(value)); break; } case TYPE: { builder.eviction().type(EvictionType.valueOf(value)); break; } case SIZE: { builder.eviction().size(Long.parseLong(value)); break; } default: { throw ParseUtils.unexpectedAttribute(reader, i); } } } ParseUtils.requireNoContent(reader); }
Source:
public VdcParametersMap put(VdcParameter param, Object value) { paramsMap.put(param, (Serializable) value); return this; }

Target:
public VdcParametersMap put(VdcParameter param, Object value) { if (!isAssignableFrom(param.getJavaType(), value.getClass())) { throw new InvalidParameterValueException(param.getJavaType(), value.getClass()); } paramsMap.put(param, (Serializable) value); return this; }
Source:
public static Policy getHttpPolicy(Configuration conf) { String policyStr = conf.get("ozone.http.policy", OzoneConfigKeys.OZONE_HTTP_POLICY); if(policyStr == null || policyStr.length() == 0) { policyStr = conf.get("dfs.http.policy", DFSConfigKeys.DFS_HTTP_POLICY_DEFAULT); } Policy policy = Policy.fromString(policyStr); if (policy == null) { throw new HadoopIllegalArgumentException("Unrecognized value '" + policyStr + "' for " + "dfs.http.policy"); } else { conf.set("dfs.http.policy", policy.name()); return policy; } }

Target:
public static Policy getHttpPolicy(Configuration conf) { String policyStr = conf.get(OzoneConfigKeys.OZONE_HTTP_POLICY, DFSConfigKeys.DFS_HTTP_POLICY_DEFAULT); Policy policy = Policy.fromString(policyStr); conf.set("dfs.http.policy", policy.name()); return policy; }
Source:
public void setJsonParameters(Map<String, Object> allParameters) throws Exception { Map<String, Object> parameters = (Map<String, Object>)allParameters.get("parameters"); Long bitmask = (Long) parameters.get("type"); type = new ConnectionType(bitmask.intValue()); }

Target:
public void setJsonParameters(Map<String, Object> allParameters) throws Exception { Map<String, Object> parameters = (Map<String, Object>)allParameters.get("parameters"); Number bitmask = (Number) parameters.get("type"); type = new ConnectionType(bitmask.intValue()); }
Source:
private void renameStyle( StyleInfo s, String newName ) throws IOException { LOGGER.fine( "Renameing style " + s.getName() + " to " + newName ); Resource xml = dd.config(s); renameRes( xml, newName+".xml" ); Resource style = dd.style(s); StyleHandler format = Styles.handler( s.getFormat() ); Resource target = uniqueResource( style, newName, format.getFileExtension() ); renameRes(style, target.name()); s.setFilename(target.name()); if( !"sld".equals(format.getFormat())){ Resource sld = style.parent().get(FilenameUtils.getBaseName(style.name()) + ".sld"); if( sld.getType() == Type.RESOURCE ){ Resource generated = uniqueResource( sld, newName, "sld" ); renameRes(sld, generated.name()); } } }

Target:
private void renameStyle( StyleInfo s, String newName ) throws IOException { LOGGER.fine( "Renaming style " + s.getName() + " to " + newName ); Resource xml = dd.config(s); renameRes( xml, newName+".xml" ); Resource style = dd.style(s); StyleHandler format = Styles.handler( s.getFormat() ); Resource target = uniqueResource( style, newName, format.getFileExtension() ); renameRes(style, target.name()); s.setFilename(target.name()); if( !SLDHandler.FORMAT.equals(format.getFormat())){ Resource sld = style.parent().get(FilenameUtils.getBaseName(style.name()) + ".sld"); if( sld.getType() == Type.RESOURCE ){ Resource generated = uniqueResource( sld, newName, "sld" ); renameRes(sld, generated.name()); } } }
Source:
public void joinCourseForInstructor(String encryptedKey, String googleId, String institute) throws JoinCourseException, InvalidParametersException { verifyInstructorJoinCourseRequest(encryptedKey, googleId, institute); InstructorAttributes instructor = InstructorsLogic.inst().getInstructorForRegistrationKey(encryptedKey); if(!institute.isEmpty()){ AccountAttributes accountToAdd = new AccountAttributes(googleId, instructor.name, true, instructor.email, institute); createAccount(accountToAdd); } instructor.googleId = googleId; try { InstructorsLogic.inst().updateInstructorByEmail(instructor.email, instructor); } catch (InvalidParametersException | EntityDoesNotExistException e) { throw new JoinCourseException(e.getMessage()); } AccountAttributes account = accountsDb.getAccount(googleId); if(account == null) { try { createInstructorAccount(instructor); } catch (InvalidParametersException e) { throw new JoinCourseException(e.getMessage()); } } else { makeAccountInstructor(googleId); } }

Target:
public void joinCourseForInstructor(String encryptedKey, String googleId, String institute) throws JoinCourseException, InvalidParametersException{ try { joinCourseForInstructorWithInstitute(encryptedKey, googleId, institute); } catch (EntityDoesNotExistException e) { throw new JoinCourseException(e.getMessage()); } }
Source:
FileSessionPropertyManager(FileSessionPropertyManagerConfig config) { requireNonNull(config, "config is null"); Path configurationFile = Paths.get(config.getConfigFile()); try { sessionMatchSpecs = CODEC.fromJson(Files.readAllBytes(configurationFile)); } catch (IOException e) { throw new UncheckedIOException(e); } catch (IllegalArgumentException e) { Throwable cause = e.getCause(); if (cause instanceof UnrecognizedPropertyException) { UnrecognizedPropertyException ex = (UnrecognizedPropertyException) cause; String message = format("Unknown property at line %s:%s: %s", ex.getLocation().getLineNr(), ex.getLocation().getColumnNr(), ex.getPropertyName()); throw new IllegalArgumentException(message, e); } if (cause instanceof JsonMappingException) { if (cause.getCause() != null) { cause = cause.getCause(); } throw new IllegalArgumentException(cause.getMessage(), e); } throw e; } }

Target:
public FileSessionPropertyManager(FileSessionPropertyManagerConfig config) { requireNonNull(config, "config is null"); Path configurationFile = config.getConfigFile().toPath(); try { sessionMatchSpecs = CODEC.fromJson(Files.readAllBytes(configurationFile)); } catch (IOException e) { throw new UncheckedIOException(e); } catch (IllegalArgumentException e) { Throwable cause = e.getCause(); if (cause instanceof UnrecognizedPropertyException) { UnrecognizedPropertyException ex = (UnrecognizedPropertyException) cause; String message = format("Unknown property at line %s:%s: %s", ex.getLocation().getLineNr(), ex.getLocation().getColumnNr(), ex.getPropertyName()); throw new IllegalArgumentException(message, e); } if (cause instanceof JsonMappingException) { if (cause.getCause() != null) { cause = cause.getCause(); } throw new IllegalArgumentException(cause.getMessage(), e); } throw e; } }
Source:
static long[][] buildFrequencies(final List<CramCompressionRecord> records) { final long[][] frequencies = new long[200][200]; for (final CramCompressionRecord record : records) { if (record.readFeatures != null) { for (final ReadFeature readFeature : record.readFeatures) { if (readFeature.getOperator() == Substitution.operator) { final Substitution substitution = ((Substitution) readFeature); final byte refBase = substitution.getReferenceBase(); final byte base = substitution.getBase(); frequencies[refBase][base]++; } } } } return frequencies; }

Target:
static long[][] buildFrequencies(final List<CramCompressionRecord> records) { final long[][] frequencies = new long[BYTE_SPACE_SIZE][BYTE_SPACE_SIZE]; for (final CramCompressionRecord record : records) { if (record.readFeatures != null) { for (final ReadFeature readFeature : record.readFeatures) { if (readFeature.getOperator() == Substitution.operator) { final Substitution substitution = ((Substitution) readFeature); final byte refBase = substitution.getReferenceBase(); final byte base = substitution.getBase(); frequencies[refBase][base]++; } } } } return frequencies; }
Source:
public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Graph<?, Node> graph = (Graph<?, Node>) context.getGraph(); final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<? extends View<?>, ? extends Edge> source = oSource.get(); final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final Edge<? extends View<?>, ? extends Node> connector = context.getConnector(); if (isConnectionAlreadyFormed(source, target, connector)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; }

Target:
public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<? extends View<?>, ? extends Edge> source = oSource.get(); final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final Edge<? extends View<?>, ? extends Node> connector = context.getConnector(); if (isConnectionAlreadyFormed(source, target, connector)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; }
Source:
public void close() throws IOException { cachedLookups.close(); if(column != null) { column.close(); } if(multiValueColumn != null) { multiValueColumn.close(); } }

Target:
public void close() throws IOException { CloseQuietly.close(cachedLookups); if(column != null) { column.close(); } if(multiValueColumn != null) { multiValueColumn.close(); } }
Source:
public boolean addNetworkRules(final String vmName, final String vmId, final String guestIP, final String sig, final String seq, final String mac, final String rules, final String vif, final String brname, final String secIps) { if (!_canBridgeFirewall) { return false; } final String newRules = rules.replace(" ", ";"); final Script cmd = new Script(_securityGroupPath, _timeout.getMillis(), s_logger); cmd.add("add_network_rules"); cmd.add("--vmname", vmName); cmd.add("--vmid", vmId); cmd.add("--vmip", guestIP); cmd.add("--sig", sig); cmd.add("--seq", seq); cmd.add("--vmmac", mac); cmd.add("--vif", vif); cmd.add("--brname", brname); cmd.add("--nicsecips", secIps); if (newRules != null && !newRules.isEmpty()) { cmd.add("--rules", newRules); } final String result = cmd.execute(); if (result != null) { return false; } return true; }

Target:
public boolean addNetworkRules(final String vmName, final String vmId, final String guestIP, final String sig, final String seq, final String mac, final String rules, final String vif, final String brname, final String secIps) { if (!_canBridgeFirewall) { return false; } final String newRules = rules.replace(" ", ";"); final Script cmd = new Script(_securityGroupPath, _timeout, s_logger); cmd.add("add_network_rules"); cmd.add("--vmname", vmName); cmd.add("--vmid", vmId); cmd.add("--vmip", guestIP); cmd.add("--sig", sig); cmd.add("--seq", seq); cmd.add("--vmmac", mac); cmd.add("--vif", vif); cmd.add("--brname", brname); cmd.add("--nicsecips", secIps); if (newRules != null && !newRules.isEmpty()) { cmd.add("--rules", newRules); } final String result = cmd.execute(); if (result != null) { return false; } return true; }
Source:
public void afterPropertiesSet() throws Exception { List<Link> links = new ArrayList<Link>(); Link l = new Link("/api", "pid"); links.add(l); }

Target:
public void afterPropertiesSet() throws Exception { discoverableEndpointsService .register(this, Arrays.asList( new Link( new UriTemplate("/api/" + CATEGORY + "/" + ACTION, new TemplateVariables( new TemplateVariable(PARAM, VariableType.REQUEST_PARAM))), CATEGORY))); }
Source:
public Map<String, byte[]> getFiles() { return files; }

Target:
public Map<String, InputStream> getFiles() { Map<String, InputStream> streamMap = new HashMap<>(files.size()); for (Entry<String, byte[]> entry : files.entrySet()) { streamMap.put(entry.getKey(), new ByteArrayInputStream(entry.getValue())); } return streamMap; }
Source:
protected OAuth2Client readEntity(JsonNode jn) { String name = getStringField(jn, NAME_FIELD); List<String> redirectURIs = requireNonNullElse(getStringListField(jn, REDIRECT_URI_FIELD), Collections.emptyList()); String clientId = getStringField(jn, "id"); String secret = getStringField(jn, "secret"); boolean autoGrant = BooleanUtils.toBoolean(getBooleanField(jn, "isAutoGrant")); boolean enabled = BooleanUtils.toBoolean(getBooleanField(jn, "isEnabled")); return new OAuth2Client(name, clientId, secret, redirectURIs, autoGrant, enabled); }

Target:
protected OAuth2Client readEntity(JsonNode jn) { String name = getStringField(jn, NAME_FIELD); List<String> redirectURIs = requireNonNullElseGet(getStringListField(jn, REDIRECT_URI_FIELD), Collections::emptyList); String clientId = getStringField(jn, ID_FIELD); String secret = getStringField(jn, SECRET_FIELD); boolean autoGrant = requireNonNullElse(getBooleanField(jn, AUTO_GRANT_FIELD), false); boolean enabled = requireNonNullElse(getBooleanField(jn, ENABLED_FIELD), false); return new OAuth2Client(name, clientId, secret, redirectURIs, autoGrant, enabled); }
Source:
public int hashCode() { final int prime = 31; int result = 1; long temp; temp = Double.doubleToLongBits(numeraire); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(forward); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(volatility); result = prime * result + (int) (temp ^ (temp >>> 32)); return result; }

Target:
public int hashCode() { int hash = getClass().hashCode(); hash = hash * 31 + JodaBeanUtils.hashCode(getForward()); hash = hash * 31 + JodaBeanUtils.hashCode(getNumeraire()); hash = hash * 31 + JodaBeanUtils.hashCode(getNormalVolatility()); return hash; }
Source:
protected void addToString(EntityType model, CodeWriter writer) { }

Target:
protected void addToString(EntityType model, CodeWriter writer) throws IOException { Collection<PrimaryKeyData> primaryKeys = (Collection<PrimaryKeyData>) model.getData().get(PrimaryKeyData.class); if (primaryKeys == null || primaryKeys.isEmpty()) { super.addToString(model, writer); return; } StringBuilder toString = new StringBuilder(); Map<String, Property> columnToProperty = new HashMap<String, Property>(); for (Property property : model.getProperties()) { columnToProperty.put(property.getAnnotation(Column.class).value(), property); } for (PrimaryKeyData pk : primaryKeys) { for (String column : pk.getColumns()) { Property property = columnToProperty.get(column); String propName = property.getEscapedName(); if (toString.length() > 0) { toString.append("+ \";\" + "); } else { toString.append("\"" + model.getSimpleName() + "#\" + "); } toString.append(propName); } } writer.annotation(Override.class); writer.beginPublicMethod(Types.STRING, "toString"); writer.line("return ", toString + ";"); writer.end(); }
Source:
private void writeXMLDeclaration(MessageContext messageContext, OutputStream outputStream, OMOutputFormat format) { String xmlDeclaration; String writeXmlDeclaration = (String) messageContext.getProperty("WRITE_XML_DECLARATION"); if (writeXmlDeclaration != null && "true".equalsIgnoreCase(writeXmlDeclaration)) { String xmlDeclarationEncoding = (String) messageContext.getProperty("XML_DECLARATION_ENCODING"); if (xmlDeclarationEncoding == null) { xmlDeclarationEncoding = (format.getCharSetEncoding() != null) ? format.getCharSetEncoding() : Charset.defaultCharset().toString(); } String xmlDeclarationStandalone = (String) messageContext.getProperty("XML_DECLARATION_STANDALONE"); if (xmlDeclarationStandalone != null) { xmlDeclaration = "<?xml version=\"1.0\" encoding=\"" + xmlDeclarationEncoding + "\" " + "standalone=\"" + xmlDeclarationStandalone + "\" ?>"; } else { xmlDeclaration = "<?xml version=\"1.0\" encoding=\"" + xmlDeclarationEncoding + "\" ?>"; } try { outputStream.write(xmlDeclaration.getBytes()); } catch (IOException e) { log.error("Error while writing the XML declaration ", e); } } }

Target:
private void writeXMLDeclaration(MessageContext messageContext, OutputStream outputStream, OMOutputFormat format) { String xmlDeclaration; String writeXmlDeclaration = (String) messageContext.getProperty(WRITE_XML_DECLARATION); if (writeXmlDeclaration != null && "true".equalsIgnoreCase(writeXmlDeclaration)) { String xmlDeclarationEncoding = (String) messageContext.getProperty(XML_DECLARATION_ENCODING); if (xmlDeclarationEncoding == null) { xmlDeclarationEncoding = (format.getCharSetEncoding() != null) ? format.getCharSetEncoding() : Charset.defaultCharset().toString(); } String xmlDeclarationStandalone = (String) messageContext.getProperty(XML_DECLARATION_STANDALONE); if (xmlDeclarationStandalone != null) { xmlDeclaration = "<?xml version=\"1.0\" encoding=\"" + xmlDeclarationEncoding + "\" " + "standalone=\"" + xmlDeclarationStandalone + "\" ?>"; } else { xmlDeclaration = "<?xml version=\"1.0\" encoding=\"" + xmlDeclarationEncoding + "\" ?>"; } try { outputStream.write(xmlDeclaration.getBytes()); } catch (IOException e) { log.error("Error while writing the XML declaration ", e); } } }
Source:
private void setAuthorView(Media item, TextView author) { if (item.getCreator()!="") { author.setText("Uploaded by: "+item.getCreator()); } else { author.setText(""); } }

Target:
private void setAuthorView(Media item, TextView author) { if (!TextUtils.isEmpty(item.getCreator())) { author.setVisibility(View.VISIBLE); author.setText(getContext().getString(R.string.image_uploaded_by, item.getCreator())); } else { author.setVisibility(View.GONE); } }
Source:
public InstructorAttributes joinCourseForInstructor(String encryptedKey, String googleId, String institute, String mac) throws InvalidParametersException, EntityDoesNotExistException, EntityAlreadyExistsException { if (institute != null && !StringHelper.isCorrectSignature(institute, mac)) { throw new InvalidParametersException("Institute authentication failed."); } InstructorAttributes instructor = validateInstructorJoinRequest(encryptedKey, googleId); instructor.googleId = googleId; try { instructorsLogic.updateInstructorByEmail( InstructorAttributes.updateOptionsWithEmailBuilder(instructor.courseId, instructor.email) .withGoogleId(instructor.googleId) .build()); } catch (EntityDoesNotExistException e) { Assumption.fail("Instructor disappeared while trying to register " + TeammatesException.toStringWithStackTrace(e)); } AccountAttributes account = accountsDb.getAccount(googleId); String instituteToSave = institute == null ? getCourseInstitute(instructor.courseId) : institute; if (account == null) { try { createAccount(AccountAttributes.builder(googleId) .withName(instructor.name) .withEmail(instructor.email) .withInstitute(instituteToSave) .withIsInstructor(true) .build()); } catch (EntityAlreadyExistsException e) { Assumption.fail("Account already exists."); } } else { makeAccountInstructor(googleId); } StudentAttributes student = studentsLogic.getStudentForEmail(instructor.courseId, instructor.email); if (student != null) { student.googleId = googleId; studentsLogic.updateStudentCascade( StudentAttributes.updateOptionsBuilder(student.course, student.email) .withGoogleId(student.googleId) .build()); } return instructor; }

Target:
public InstructorAttributes joinCourseForInstructor(String encryptedKey, String googleId, String institute, String mac) throws InvalidParametersException, EntityDoesNotExistException, EntityAlreadyExistsException { InstructorAttributes instructor = validateInstructorJoinRequest(encryptedKey, googleId, institute, mac); instructor.googleId = googleId; try { instructorsLogic.updateInstructorByEmail( InstructorAttributes.updateOptionsWithEmailBuilder(instructor.courseId, instructor.email) .withGoogleId(instructor.googleId) .build()); } catch (EntityDoesNotExistException e) { Assumption.fail("Instructor disappeared while trying to register " + TeammatesException.toStringWithStackTrace(e)); } AccountAttributes account = accountsDb.getAccount(googleId); String instituteToSave = institute == null ? getCourseInstitute(instructor.courseId) : institute; if (account == null) { try { createAccount(AccountAttributes.builder(googleId) .withName(instructor.name) .withEmail(instructor.email) .withInstitute(instituteToSave) .withIsInstructor(true) .build()); } catch (EntityAlreadyExistsException e) { Assumption.fail("Account already exists."); } } else { makeAccountInstructor(googleId); } StudentAttributes student = studentsLogic.getStudentForEmail(instructor.courseId, instructor.email); if (student != null) { student.googleId = googleId; studentsLogic.updateStudentCascade( StudentAttributes.updateOptionsBuilder(student.course, student.email) .withGoogleId(student.googleId) .build()); } return instructor; }
Source:
public void setOffset(int offset) { if (offset + length > buffer.length) { throw new IllegalArgumentException("length"); } this.offset = offset; }

Target:
public void setOffset(int offset) { if (offset + length > buffer.length || offset < 0) { throw new IllegalArgumentException("offset"); } this.offset = offset; }
Source:
public void renameTo(final FilePath target) throws IOException, InterruptedException { if(this.channel != target.channel) { throw new IOException("renameTo target must be on the same host"); } act(new SecureFileCallable<Void>() { private static final long serialVersionUID = 1L; public Void invoke(File f, VirtualChannel channel) throws IOException { Files.move(reading(f).toPath(), creating(new File(target.remote)).toPath(), StandardCopyOption.COPY_ATTRIBUTES, LinkOption.NOFOLLOW_LINKS); return null; } }); }

Target:
public void renameTo(final FilePath target) throws IOException, InterruptedException { if(this.channel != target.channel) { throw new IOException("renameTo target must be on the same host"); } act(new SecureFileCallable<Void>() { private static final long serialVersionUID = 1L; public Void invoke(File f, VirtualChannel channel) throws IOException { Files.move(fileToPath(reading(f)), fileToPath(creating(new File(target.remote))), LinkOption.NOFOLLOW_LINKS); return null; } }); }
Source:
public WikipediaIrcDecoder(@JsonProperty("namespaces") Map<String, Map<String, String>> namespaces, @JsonProperty("geoIpDatabase") String geoIpDatabase) { if(namespaces == null) namespaces = Maps.newHashMap(); this.namespaces = namespaces; File geoDb; if(geoIpDatabase != null) { geoDb = new File(geoIpDatabase); } else { try { geoDb = File.createTempFile("geoip", null); geoDb.deleteOnExit(); log.info("Downloading geo ip database to [%s]", geoDb); FileUtils.copyInputStreamToFile( new GZIPInputStream( new URL("<LINK_0>").openStream() ), geoDb ); } catch(IOException e) { throw new RuntimeException("Unable to download geo ip database [%s]", e); } } try { geoLookup = new DatabaseReader(geoDb); } catch(IOException e) { throw new RuntimeException("Unable to open geo ip lookup database", e); } }

Target:
public WikipediaIrcDecoder(@JsonProperty("namespaces") Map<String, Map<String, String>> namespaces, @JsonProperty("geoIpDatabase") String geoIpDatabase) { if(namespaces == null) { namespaces = Maps.newHashMap(); } this.namespaces = namespaces; File geoDb; if(geoIpDatabase != null) { geoDb = new File(geoIpDatabase); } else { try { String tmpDir = System.getProperty("java.io.tmpdir"); geoDb = new File(tmpDir, this.getClass().getCanonicalName() + ".GeoLite2-City.mmdb"); if(!geoDb.exists()) { log.info("Downloading geo ip database to [%s]", geoDb); FileUtils.copyInputStreamToFile( new GZIPInputStream( new URL("<LINK_0>").openStream() ), geoDb ); } } catch(IOException e) { throw new RuntimeException("Unable to download geo ip database [%s]", e); } } try { geoLookup = new DatabaseReader(geoDb); } catch(IOException e) { throw new RuntimeException("Unable to open geo ip lookup database", e); } }
Source:
public Builder excludeMethod(String methodName) { excludedMethods.add(methodName); return this; }

Target:
public Builder excludeMethod(String methodName) { checkNotNull(methodName); final boolean validName = isName(methodName); checkArgument(validName); excludedMethods.add(methodName); return this; }