auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void loadViewConfig(Context context, AttributeSet attrs) { TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ShrinkingLinearLayout); shrinkingViewId = typedArray.getResourceId(R.styleable.ShrinkingLinearLayout_shrinkable_view, -1); }

Target:
private void loadViewConfig(Context context, AttributeSet attrs) { TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ShrinkingLinearLayout); shrinkingViewId = typedArray.getResourceId(R.styleable.ShrinkingLinearLayout_shrinkable_view, -1); typedArray.recycle(); }
Source:
public void setInput(EObject eObject) { Object selfValue = variableManager.getVariables().get(EEFExpressionUtils.SELF); if (eObject != selfValue) { variableManager.clear(); variableManager.put(EEFExpressionUtils.SELF, eObject); for (EEFPage eefPage : eefPages) { String pageSemanticCandidateExpression = eefPage.getDescription().getSemanticCandidateExpression(); if (!isBlank(pageSemanticCandidateExpression)) { IEvaluationResult evaluationResult = interpreter.evaluateExpression(variableManager.getVariables(), pageSemanticCandidateExpression); if (Diagnostic.OK == evaluationResult.getDiagnostic().getSeverity() && evaluationResult.getValue() != null) { eefPage.getVariableManager().put(EEFExpressionUtils.SELF, evaluationResult.getValue()); } else { } } List<EEFGroup> groups = eefPage.getGroups(); for (EEFGroup eefGroup : groups) { String groupSemanticCandidateExpression = eefGroup.getDescription().getSemanticCandidateExpression(); if (!isBlank(groupSemanticCandidateExpression)) { IEvaluationResult evaluationResult = interpreter.evaluateExpression(eefPage.getVariableManager().getVariables(), groupSemanticCandidateExpression); if (Diagnostic.OK == evaluationResult.getDiagnostic().getSeverity() && evaluationResult.getValue() != null) { eefGroup.getVariableManager().put(EEFExpressionUtils.SELF, evaluationResult.getValue()); } else { } } } } } }

Target:
public void setInput(EObject eObject) { Object selfValue = this.variableManager.getVariables().get(EEFExpressionUtils.SELF); if (eObject != selfValue) { this.variableManager.clear(); this.variableManager.put(EEFExpressionUtils.SELF, eObject); for (EEFPage eefPage : this.eefPages) { String pageSemanticCandidateExpression = eefPage.getDescription().getSemanticCandidateExpression(); if (!isBlank(pageSemanticCandidateExpression)) { IEvaluationResult evaluationResult = this.interpreter.evaluateExpression(this.variableManager.getVariables(), pageSemanticCandidateExpression); if (Diagnostic.OK == evaluationResult.getDiagnostic().getSeverity() && evaluationResult.getValue() != null) { eefPage.getVariableManager().put(EEFExpressionUtils.SELF, evaluationResult.getValue()); } else { } } List<EEFGroup> groups = eefPage.getGroups(); for (EEFGroup eefGroup : groups) { String groupSemanticCandidateExpression = eefGroup.getDescription().getSemanticCandidateExpression(); if (!isBlank(groupSemanticCandidateExpression)) { IEvaluationResult evaluationResult = this.interpreter.evaluateExpression(eefPage.getVariableManager().getVariables(), groupSemanticCandidateExpression); if (Diagnostic.OK == evaluationResult.getDiagnostic().getSeverity() && evaluationResult.getValue() != null) { eefGroup.getVariableManager().put(EEFExpressionUtils.SELF, evaluationResult.getValue()); } else { } } } } } }
Source:
public List<OSThread> getThreadDetails() { return this.threadDetails; }

Target:
public List<OSThread> getThreadDetails() { List<OSThread> threadDetails = ProcessStat.getThreadIds(getProcessID()).stream() .map(id -> new LinuxOSThread(getProcessID(), id)).collect(Collectors.toList()); return Collections.unmodifiableList(threadDetails); }
Source:
private boolean stopTransferIfNecessary(ImageTransfer entity, long ts) { if (transferImageInactivityTimeoutInSeconds > 0 && (entity.getPhase() == ImageTransferPhase.INITIALIZING || entity.getPhase() == ImageTransferPhase.TRANSFERRING) && (entity.getLastUpdated().getTime() / 1000) + transferImageInactivityTimeoutInSeconds < ts) { ImageTransferPhase phase = ImageTransferPhase.PAUSED_SYSTEM; if (getParameters().getTransferType() == TransferType.Download) { phase = ImageTransferPhase.CANCELLED; } log.warn("Transfer phase was changed to due to no updates in seconds. {}", phase.toString(), ts - (entity.getLastUpdated().getTime() / 1000), getTransferDescription()); updateEntityPhase(phase); return true; } return false; }

Target:
private boolean stopTransferIfNecessary(ImageTransfer entity, long ts) { if (getTransferImageClientInactivityTimeoutInSeconds() > 0 && (entity.getPhase() == ImageTransferPhase.INITIALIZING || entity.getPhase() == ImageTransferPhase.TRANSFERRING) && (entity.getLastUpdated().getTime() / 1000) + getTransferImageClientInactivityTimeoutInSeconds() < ts) { ImageTransferPhase phase = ImageTransferPhase.PAUSED_SYSTEM; if (getParameters().getTransferType() == TransferType.Download) { phase = ImageTransferPhase.CANCELLED; } log.warn("Transfer phase was changed to due to no updates in seconds. {}", phase.toString(), ts - (entity.getLastUpdated().getTime() / 1000), getTransferDescription()); updateEntityPhase(phase); return true; } return false; }
Source:
private String canonicalizeAmzHeaders( final Multimap<String, String> customHeaders) { String ret = ""; for (final Map.Entry<String, Collection<String>> header : customHeaders .asMap().entrySet()) { final String key = header.getKey().toLowerCase(); if (key.startsWith(PutObjectRequest.AMZ_META_HEADER) && header.getValue().size() > 0) { ret += key + ":"; ret += Joiner.on(",").join(header.getValue()); ret += '\n'; } } System.out.println(ret); return ret; }

Target:
private String canonicalizeAmzHeaders( final Multimap<String, String> customHeaders) { StringBuilder ret = new StringBuilder(); for (final Map.Entry<String, Collection<String>> header : customHeaders .asMap().entrySet()) { final String key = header.getKey().toLowerCase(); if (key.startsWith(PutObjectRequest.AMZ_META_HEADER) && header.getValue().size() > 0) { ret.append(key).append(":"); ret.append(Joiner.on(",").join(header.getValue())); ret.append('\n'); } } return ret.toString(); }
Source:
public Builder() { this(15 * 60 * 1000L, 524288000L, 100, 5, 15, 10, 1, false, null, -1); }

Target:
public Builder() { this(15 * 60 * 1000L, 524288000L, 100, 5, 15, 10, 1, false, null, DEFAULT_LOADING_THROTTLE_LIMIT); }
Source:
public FormValidation doCheckUnstableReturn(@QueryParameter String value) { value = Util.fixEmptyAndTrim(value); if (value == null) { return FormValidation.ok(); } long unstableReturn; try { unstableReturn = Long.parseLong(value); } catch (NumberFormatException e) { return FormValidation.error(hudson.model.Messages.Hudson_NotANumber()); } if (unstableReturn < Integer.MIN_VALUE || unstableReturn > Integer.MAX_VALUE) { return FormValidation.error(hudson.tasks.Messages.BatchFile_invalid_exit_code_range(unstableReturn)); } return FormValidation.ok(); }

Target:
public FormValidation doCheckUnstableReturn(@QueryParameter String value) { value = Util.fixEmptyAndTrim(value); if (value == null) { return FormValidation.ok(); } long unstableReturn; try { unstableReturn = Long.parseLong(value); } catch (NumberFormatException e) { return FormValidation.error(hudson.model.Messages.Hudson_NotANumber()); } if (unstableReturn == 0) { return FormValidation.warning(hudson.tasks.Messages.BatchFile_invalid_exit_code_zero()); } if (unstableReturn < Integer.MIN_VALUE || unstableReturn > Integer.MAX_VALUE) { return FormValidation.error(hudson.tasks.Messages.BatchFile_invalid_exit_code_range(unstableReturn)); } return FormValidation.ok(); }
Source:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() != 2) { throw new RuntimeException("function 'nvl' needs 2 argument"); } ExprEval eval = args.get(0).eval(bindings); if (eval.value() == null || (eval.type() == ExprType.STRING && Strings.isNullOrEmpty(eval.stringValue()))) { return args.get(1).eval(bindings); } return eval; }

Target:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() != 2) { throw new IAE("function 'nvl' needs 2 arguments"); } final ExprEval eval = args.get(0).eval(bindings); return eval.isNull() ? args.get(1).eval(bindings) : eval; }
Source:
public Instant softDeleteCourse(String courseId) throws InvalidParametersException, EntityDoesNotExistException { CourseAttributes course = getCourse(courseId); course.setDeletedAt(); updateCourse(course); return course.deletedAt; }

Target:
public Instant softDeleteCourse(String courseId) throws EntityDoesNotExistException { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseId); Course courseEntity = getCourseEntity(courseId); if (courseEntity == null) { throw new EntityDoesNotExistException(ERROR_UPDATE_NON_EXISTENT_COURSE); } courseEntity.setDeletedAt(Instant.now()); saveEntity(courseEntity); return courseEntity.getDeletedAt(); }
Source:
public String toText() { return "{@" + type.keyword + this.content; }

Target:
public String toText() { return "@" + tagName + this.content; }
Source:
private boolean checkCanPerformPlugUnPlugDisk() { if (getVm().getStatus().isUpOrPaused()) { setVdsId(getVm().getRunOnVds()); if (!isHotPlugSupported() || !isOsSupportingHotPlug() || !isInterfaceSupportedForPlugUnPlug(disk)) { return false; } } oldVmDevice = getVmDeviceDao().get(new VmDeviceId(disk.getId(), getVmId())); if (getPlugAction() == VDSCommandType.HotPlugDisk && oldVmDevice.getIsPlugged()) { return failCanDoAction(VdcBllMessages.HOT_PLUG_DISK_IS_NOT_UNPLUGGED); } if (getPlugAction() == VDSCommandType.HotUnPlugDisk && !oldVmDevice.getIsPlugged()) { return failCanDoAction(VdcBllMessages.HOT_UNPLUG_DISK_IS_NOT_PLUGGED); } return true; }

Target:
private boolean checkCanPerformPlugUnPlugDisk() { if (getVm().getStatus().isUpOrPaused()) { setVdsId(getVm().getRunOnVds()); if (!canPerformHotPlug() || !isInterfaceSupportedForPlugUnPlug(disk)) { return false; } } oldVmDevice = getVmDeviceDao().get(new VmDeviceId(disk.getId(), getVmId())); if (getPlugAction() == VDSCommandType.HotPlugDisk && oldVmDevice.getIsPlugged()) { return failCanDoAction(VdcBllMessages.HOT_PLUG_DISK_IS_NOT_UNPLUGGED); } if (getPlugAction() == VDSCommandType.HotUnPlugDisk && !oldVmDevice.getIsPlugged()) { return failCanDoAction(VdcBllMessages.HOT_UNPLUG_DISK_IS_NOT_PLUGGED); } return true; }
Source:
public void knows_how_to_clone_an_instance() { ExportConfiguration clonedConfig = validConfig.clone(); assertThat(clonedConfig == validConfig, is(false)); assertThat(clonedConfig, is(validConfig)); assertThat(clonedConfig.getExportDir(), is(validConfig.getExportDir())); assertThat(clonedConfig.getPemFile(), is(validConfig.getPemFile())); assertThat(clonedConfig.getStartDate(), is(validConfig.getStartDate())); assertThat(clonedConfig.getEndDate(), is(validConfig.getEndDate())); }

Target:
public void knows_how_to_clone_an_instance() { ExportConfiguration clonedConfig = validConfig.copy(); assertThat(clonedConfig == validConfig, is(false)); assertThat(clonedConfig, is(validConfig)); assertThat(clonedConfig.getExportDir(), is(validConfig.getExportDir())); assertThat(clonedConfig.getPemFile(), is(validConfig.getPemFile())); assertThat(clonedConfig.getStartDate(), is(validConfig.getStartDate())); assertThat(clonedConfig.getEndDate(), is(validConfig.getEndDate())); }
Source:
public void setBufferLineLimit(int bufferLines) { int chars = bufferLines * CHARS_PER_LINE_AVG; setWaterMarks(chars, chars); }

Target:
public void setBufferLineLimit(int bufferLines) { int chars = bufferLines * CHARS_PER_LINE_AVG; setWaterMarks(chars, chars + HIGH_WATERMARK_OFFSET_BYTES); }
Source:
public void clearThreadLocalCache() { String canonicalPath = cachedRealm.getPath(); localCount.set(null); globalCount--; if (globalCount < 0) { throw new IllegalStateException("Global reference counter of Realm" + canonicalPath + " got corrupted."); } }

Target:
public void clearThreadLocalCache() { String canonicalPath = cachedRealm.getPath(); localCount.set(null); cachedRealm = null; if (globalCount.decrementAndGet() < 0) { throw new IllegalStateException("Global reference counter of Realm" + canonicalPath + " not be negative."); } }
Source:
private void visitBlock(BlockTree block) { boolean hasLabel = currentLabel != null; if (hasLabel) { addBreakable(null); currentBlock = createSimpleBlock(currentBlock); } build(block.statements()); if (hasLabel) { breakables.removeFirst(); } }

Target:
private void visitBlock(BlockTree block) { boolean hasLabel = currentLabel != null; if (hasLabel) { addBreakable(null); currentBlock = createSimpleBlock(currentBlock); } build(block.statements()); if (hasLabel) { removeBreakable(); } }
Source:
public void openFlowView_navigateToTsView_navigationSuccessful() { getDriver().get(getRootURL() + "/hello"); waitForDevServer(); Assert.assertThat(getDriver().getCurrentUrl(), CoreMatchers.endsWith("/hello")); $(NativeButtonElement.class).id(NAVIGATE_ABOUT).click(); waitUntil( input -> getInShadowRoot(findElement(By.tagName("about-view")), By.id("navigate-hello")).isDisplayed()); Assert.assertThat(getDriver().getCurrentUrl(), CoreMatchers.endsWith("/about")); Assert.assertTrue(getInShadowRoot(findElement(By.tagName("about-view")), By.id("navigate-hello")).isDisplayed()); }

Target:
public void openFlowView_navigateToTsView_navigationSuccessful() { getDriver().get(getRootURL() + "/hello"); waitForDevServer(); Assert.assertThat(getDriver().getCurrentUrl(), CoreMatchers.endsWith("/hello")); $(NativeButtonElement.class).id(NAVIGATE_ABOUT).click(); waitUntil(input -> $("about-view").first().$("a").id("navigate-hello") .isDisplayed()); Assert.assertThat(getDriver().getCurrentUrl(), CoreMatchers.endsWith("/about")); Assert.assertTrue(getInShadowRoot(findElement(By.tagName("about-view")), By.id("navigate-hello")).isDisplayed()); }
Source:
public void handleCommand(ChannelUID channelUID, Command command) { logger.debug("Received channel: {}, command: {}", channelUID, command); if (remoteName == null) { logger.error("Remote name is not set in {}", getThing().getUID()); return; } if (channelUID.getId().equals(CHANNEL_BUTTON)) { if (command instanceof RefreshType) { } else if (command instanceof StringType) { bridgeHandler.transmit(remoteName, command.toString()); } } }

Target:
public void handleCommand(ChannelUID channelUID, Command command) { logger.debug("Received channel: {}, command: {}", channelUID, command); if (remoteName == null) { logger.error("Remote name is not set in {}", getThing().getUID()); return; } if (channelUID.getId().equals(LIRCBindingConstants.CHANNEL_TRANSMIT)) { if (command instanceof RefreshType) { } else if (command instanceof StringType) { bridgeHandler.transmit(remoteName, command.toString()); } } }
Source:
public HadoopOutputFormatWrapper(org.apache.hadoop.mapred.OutputFormat<K,V> hadoopFormat, JobConf job, StratosphereTypeConverter<K,V> conv) { super(); this.hadoopOutputFormat = hadoopFormat; this.hadoopOutputFormatName = hadoopFormat.getClass().getName(); this.converter = conv; org.apache.hadoop.conf.Configuration hadoopConf = DistributedFileSystem.getHadoopConfiguration(); for (Map.Entry<String, String> e : hadoopConf) { job.set(e.getKey(), e.getValue()); } this.fileOutputCommitterWrapper = new FileOutputCommitterWrapper(); this.jobConf = job; }

Target:
public HadoopOutputFormatWrapper(org.apache.hadoop.mapred.OutputFormat<K,V> hadoopFormat, JobConf job, StratosphereTypeConverter<K,V> conv) { super(); this.hadoopOutputFormat = hadoopFormat; this.hadoopOutputFormatName = hadoopFormat.getClass().getName(); this.converter = conv; this.fileOutputCommitterWrapper = new FileOutputCommitterWrapper(); HadoopConfiguration.mergeHadoopConf(job); this.jobConf = job; }
Source:
private Runnable createProxyThreadRunnable() { return () -> { isRunning = true; try { consumerPollThreadStartLatch.countDown(); LOG.info("Starting consumer poll thread for system {}", consumerPollThread.getName(), systemName); initializeLags(); while (isRunning) { fetchMessages(); } } catch (Throwable throwable) { LOG.error(String.format("Error in KafkaConsumerProxy poll thread for system: %s.", systemName), throwable); failureCause = throwable; isRunning = false; ((KafkaSystemConsumer) this.kafkaConsumer).setProxyFailureCause(this.failureCause); } if (!isRunning) { LOG.info("KafkaConsumerProxy for system has stopped.", systemName); } }; }

Target:
private Runnable createProxyThreadRunnable() { return () -> { isRunning = true; try { consumerPollThreadStartLatch.countDown(); LOG.info("Starting consumer poll thread for system {}", consumerPollThread.getName(), systemName); initializeLags(); while (isRunning) { fetchMessages(); } } catch (Throwable throwable) { LOG.error(String.format("Error in KafkaConsumerProxy poll thread for system: %s.", systemName), throwable); failureCause = throwable; isRunning = false; kafkaSystemConsumer.setFailureCause(this.failureCause); } if (!isRunning) { LOG.info("KafkaConsumerProxy for system has stopped.", systemName); } }; }
Source:
public boolean start() throws IOException { MarkLogicConnection connection = (MarkLogicConnection) getCurrentSource(); result = new Result(); connectionClient = connection.connect(container); if (connectionClient == null) { return false; } docManager = connectionClient.newDocumentManager(); boolean isDocContentFieldPresent = (settings.outputSchema.getFields().size() >= 2); if (isDocContentFieldPresent) { docContentField = settings.outputSchema.getFields().get(1); } docContentReader = new DocContentReader(docManager, settings.outputSchema, docContentField); if (settings.useQueryOption && StringUtils.isNotEmpty(settings.queryOptionName)) { prepareQueryOption(); } queryManager = connectionClient.newQueryManager(); stringQueryDefinition = (settings.useQueryOption) ? queryManager.newStringDefinition(settings.queryOptionName) : queryManager.newStringDefinition(); stringQueryDefinition.setCriteria(settings.criteria); searchHandle = queryManager.search(stringQueryDefinition, new SearchHandle()); matchedDocuments = searchHandle.getTotalResults(); pageSize = (settings.pageSize <= 0) ? DEFAULT_PAGE_SIZE : settings.pageSize; maxRetrieve = settings.maxRetrieve; queryManager.setPageLength(pageSize); documentCounter = 1; readNextPage(); return (matchedDocuments > 0); }

Target:
public boolean start() throws IOException { MarkLogicConnection connection = (MarkLogicConnection) getCurrentSource(); result = new ResultWithLongNB(); connectionClient = connection.connect(container); if (connectionClient == null) { return false; } docManager = connectionClient.newDocumentManager(); boolean isDocContentFieldPresent = (settings.outputSchema.getFields().size() >= 2); if (isDocContentFieldPresent) { docContentField = settings.outputSchema.getFields().get(1); } docContentReader = new DocContentReader(docManager, settings.outputSchema, docContentField); if (settings.useQueryOption && StringUtils.isNotEmpty(settings.queryOptionName)) { prepareQueryOption(); } queryManager = connectionClient.newQueryManager(); stringQueryDefinition = (settings.useQueryOption) ? queryManager.newStringDefinition(settings.queryOptionName) : queryManager.newStringDefinition(); stringQueryDefinition.setCriteria(settings.criteria); searchHandle = queryManager.search(stringQueryDefinition, new SearchHandle()); matchedDocuments = searchHandle.getTotalResults(); pageSize = (settings.pageSize <= 0) ? matchedDocuments : settings.pageSize; maxRetrieve = settings.maxRetrieve; queryManager.setPageLength(pageSize); documentCounter = 1; readNextPage(); return (matchedDocuments > 0); }
Source:
public void executeConstantAction( Activation activation ) throws StandardException { LanguageConnectionContext lcc = activation.getLanguageConnectionContext(); TransactionController tc = lcc.getTransactionExecute(); Manager manager = EngineDriver.driver().manager(); if (privileges instanceof TablePrivilegeInfo) { TablePrivilegeInfo info = (TablePrivilegeInfo) privileges; if (!manager.isEnabled() && info.hasColumns()) { throw StandardException.newException(SQLState.COLS_PERMS_EXCEPTION); } } List <PermissionsDescriptor> permissionsDescriptors = privileges.executeGrantRevoke( activation, grant, grantees); for (PermissionsDescriptor permissionsDescriptor : permissionsDescriptors) { DDLMessage.DDLChange ddlChange = createDDLChange(((SpliceTransactionManager) tc).getActiveStateTxn().getTxnId(), permissionsDescriptor); tc.prepareDataDictionaryChange(DDLUtils.notifyMetadataChange(ddlChange)); } }

Target:
public void executeConstantAction( Activation activation ) throws StandardException { LanguageConnectionContext lcc = activation.getLanguageConnectionContext(); TransactionController tc = lcc.getTransactionExecute(); Manager manager = EngineDriver.driver().manager(); if (privileges instanceof TablePrivilegeInfo) { TablePrivilegeInfo info = (TablePrivilegeInfo) privileges; if (!manager.isEnabled() && info.hasColumns()) { throw StandardException.newException(SQLState.MANAGER_DISABLED); } } List <PermissionsDescriptor> permissionsDescriptors = privileges.executeGrantRevoke( activation, grant, grantees); for (PermissionsDescriptor permissionsDescriptor : permissionsDescriptors) { DDLMessage.DDLChange ddlChange = createDDLChange(((SpliceTransactionManager) tc).getActiveStateTxn().getTxnId(), permissionsDescriptor); tc.prepareDataDictionaryChange(DDLUtils.notifyMetadataChange(ddlChange)); } }
Source:
private static DiskVmElement buildDiskVmElementWithDiskInterfaceFromExternalProvider(Map<String, Object> map, DiskImage image, Guid vmId) { DiskVmElement dve = new DiskVmElement(image.getId(), vmId); String diskDevName = (String) map.get(VdsProperties.DISK_TARGET_DEV_NAME); diskDevName = (diskDevName == null || diskDevName.length() < 3) ? "" : diskDevName.substring(0, 2); switch (diskDevName) { case "sd": dve.setDiskInterface(DiskInterface.VirtIO_SCSI); break; case "hd": dve.setDiskInterface(DiskInterface.IDE); break; case "vd": default: dve.setDiskInterface(DiskInterface.VirtIO); break; } return dve; }

Target:
private static DiskVmElement buildDiskVmElementWithDiskInterfaceFromExternalProvider(Map<String, Object> map, DiskImage image, Guid vmId) { DiskVmElement dve = new DiskVmElement(image.getId(), vmId); String diskDevName = (String) map.get(VdsProperties.DISK_TARGET_DEV_NAME); diskDevName = (diskDevName == null || diskDevName.length() < 3) ? "" : diskDevName.substring(0, 2); switch (diskDevName) { case "sd": dve.setDiskInterface(DiskInterface.VirtIO_SCSI); break; case "hd": dve.setDiskInterface(DiskInterface.IDE); break; case "vd": default: dve.setDiskInterface(DiskInterface.VirtIO); } return dve; }
Source:
public boolean isEditable() { BranchState state = getBranchState(); return !state.isCommitInProgress() && !state.isCommitted() && !state.isRebaselined() && !state.isDeleted() && !state.isCreationInProgress() && !getArchiveState().isArchived() && !isPurged() && !isDeleteInProgress() && !isPurgeInProgress(); }

Target:
public boolean isEditable() { BranchState state = getBranchState(); return (state.isCreated() || state.isModified() || state.isRebaselineInProgress()) && getArchiveState().isUnArchived(); }
Source:
public void accept(E entry) { Cache<?, ?> cache = getForEachObject(cacheOffset); if (cache != null && this.cache != null && cache.getName().equals(this.cache.getName())) { ((AtomicInteger) getForEachObject(atomicOffset)).addAndGet(function.applyAsInt(entry)); } }

Target:
public void accept(E entry) { Cache<?, ?> cache = getForEachObject(cacheOffset); if (cache != null && this.cache != null && cache.getName().equals(this.cache.getName())) { ((AtomicInteger) getForEachObject(atomicOffset)).addAndGet(function.applyAsInt(entry)); } else { fail("Did not receive correct cache!"); } }
Source:
public void save(Patient patient, DocumentModelBridge doc) { PatientData<Disorder> features = patient.getData(this.getName()); if (features == null || !features.isIndexed()) { return; } if (doc == null) { throw new NullPointerException(ERROR_MESSAGE_NO_PATIENT_CLASS); } XWikiDocument docX = (XWikiDocument) doc; BaseObject data = docX.getXObject(Patient.CLASS_REFERENCE); XWikiContext context = this.xcontextProvider.get(); List<String> disorderValues = new LinkedList<>(); Iterator<Disorder> iterator = features.iterator(); while (iterator.hasNext()) { Disorder disorder = iterator.next(); disorderValues.add(disorder.getValue()); } data.set(DISORDER_PROPERTIES_OMIMID, null, context); data.set(DISORDER_PROPERTIES_OMIMID, disorderValues, context); }

Target:
public void save(Patient patient, DocumentModelBridge doc) { PatientData<Disorder> disorders = patient.getData(this.getName()); if (disorders == null || !disorders.isIndexed()) { return; } if (doc == null) { throw new NullPointerException(ERROR_MESSAGE_NO_PATIENT_CLASS); } XWikiDocument docX = (XWikiDocument) doc; BaseObject data = docX.getXObject(Patient.CLASS_REFERENCE); XWikiContext context = this.xcontextProvider.get(); List<String> disorderValues = new LinkedList<>(); Iterator<Disorder> iterator = disorders.iterator(); while (iterator.hasNext()) { Disorder disorder = iterator.next(); disorderValues.add(disorder.getValue()); } data.set(DISORDER_PROPERTIES_OMIMID, null, context); data.set(DISORDER_PROPERTIES_OMIMID, disorderValues, context); }
Source:
public ExportUserActivityStream(String[] args){ this.connectionsUrl = args[0]; this.USERNAME = args[1]; this.PASSWORD = args[2]; this.USER_ID = args[3]; this.resultCount = args[4]; this.filePath = args[5]; this.serviceMap = args[6]; System.out.println("Initialising environment and authenticating with connections..."); this.initEnvironment(); endpoint = (BasicEndpoint) EndpointFactory.getEndpoint(this.endpointName); System.out.println("endpoint created"+endpoint.toString()); this.setBaseUrl(this.connectionsUrl); Map<String,String> map = new HashMap<String,String>(); map.put("connections", this.serviceMap); this.setServiceMaps(map); if (StringUtil.isNotEmpty(this.USERNAME)) { try { endpoint.login(this.USERNAME, this.PASSWORD); System.out.println("Login Successful"); } catch (AuthenticationException e) { System.out.println("Error authenticating with connections"); e.printStackTrace(); } } this.getUserActivityStream(); this.getProfileProperties(); System.out.println("Done"); }

Target:
public ExportUserActivityStream(String[] args){ this.connectionsUrl = args[0]; this.USERNAME = args[1]; this.PASSWORD = args[2]; this.USER_ID = args[3]; this.resultCount = args[4]; this.filePath = args[5]; this.serviceMap = args[6]; System.out.println("Initialising environment and authenticating with connections..."); this.initEnvironment(); endpoint = new BasicEndpoint(); endpoint.setUrl(this.connectionsUrl); endpoint.setForceTrustSSLCertificate(true); endpoint.setUser(this.USERNAME); endpoint.setPassword(this.PASSWORD); Map<String,String> map = new HashMap<String,String>(); map.put("connections", this.serviceMap); endpoint.setServiceMappings(map); this.getUserActivityStream(); this.getProfileProperties(); System.out.println("Done"); }
Source:
public void onClose(final WebSocket conn, final int code, final String reason, final boolean remote) { FailIf.isNull(conn); log.info("Connection closed."); if (code == CloseFrame.REFUSE) { return; } this.controllers.get(conn).dispose(); this.controllers.remove(conn); }

Target:
public void onClose(final WebSocket conn, final int code, final String reason, final boolean remote) { FailIf.isNull(conn); log.info("Connection closed."); if (code != CloseFrame.REFUSE) { this.controllers.get(conn).dispose(); this.controllers.remove(conn); } }
Source:
public static long getMaxBytesInMemoryOrDefault(final long maxBytesInMemory) { long newMaxBytesInMemory = maxBytesInMemory; if (maxBytesInMemory == 0) { newMaxBytesInMemory = TuningConfig.DEFAULT_MAX_BYTES_IN_MEMORY; } else if (maxBytesInMemory == -1) { newMaxBytesInMemory = Long.MAX_VALUE; } return newMaxBytesInMemory; }

Target:
public static long getMaxBytesInMemoryOrDefault(final long maxBytesInMemory) { long newMaxBytesInMemory = maxBytesInMemory; if (maxBytesInMemory == 0) { newMaxBytesInMemory = TuningConfig.DEFAULT_MAX_BYTES_IN_MEMORY; } else if (maxBytesInMemory < 0) { newMaxBytesInMemory = Long.MAX_VALUE; } return newMaxBytesInMemory; }
Source:
public LogFilePath(String prefix, String path) { assert path.startsWith(prefix): path + ".startsWith(" + prefix + ")"; mPrefix = prefix; int prefixLength = prefix.length(); if (!prefix.endsWith("/")) { prefixLength++; } String suffix = path.substring(prefixLength); String[] pathElements = suffix.split("/"); assert pathElements.length >= 3: Arrays.toString(pathElements) + ".length >= 3"; mTopic = pathElements[0]; mPartitions = subArray(pathElements, 1, pathElements.length - 2); String basename = pathElements[pathElements.length - 1]; String suffixPattern = "\\.[^\\.]*$"; Matcher matcher = Pattern.compile(suffixPattern).matcher(basename); if (matcher.find()) { mSuffix = matcher.group(0); } else { mSuffix = ""; } basename = basename.split(suffixPattern)[0]; String[] basenameElements = basename.split("_"); assert basenameElements.length == 3: Integer.toString(basenameElements.length) + " == 3"; mGeneration = Integer.parseInt(basenameElements[0]); mKafkaPartition = Integer.parseInt(basenameElements[1]); mOffset = Long.parseLong(basenameElements[2]); }

Target:
public LogFilePath(String prefix, String path) { assert path.startsWith(prefix): path + ".startsWith(" + prefix + ")"; mPrefix = prefix; int prefixLength = prefix.length(); if (!prefix.endsWith("/")) { prefixLength++; } String suffix = path.substring(prefixLength); String[] pathElements = suffix.split("/"); assert pathElements.length >= 3: Arrays.toString(pathElements) + ".length >= 3"; mTopic = pathElements[0]; mPartitions = subArray(pathElements, 1, pathElements.length - 2); String basename = pathElements[pathElements.length - 1]; int lastIndexOf = basename.lastIndexOf('.'); if (lastIndexOf >= 0) { mExtension = basename.substring(lastIndexOf, basename.length()); basename = basename.substring(0, lastIndexOf); } else { mExtension = ""; } String[] basenameElements = basename.split("_"); assert basenameElements.length == 3: Integer.toString(basenameElements.length) + " == 3"; mGeneration = Integer.parseInt(basenameElements[0]); mKafkaPartition = Integer.parseInt(basenameElements[1]); mOffset = Long.parseLong(basenameElements[2]); }
Source:
@Override protected void onDestroy() { mUnbinder.unbind(); super.onDestroy(); }

Target:
protected void onDestroy() { mUnbinder.unbind(); super.onDestroy(); }
Source:
private Set<EventHandlerInfo> selectEventHandlers(Class<? extends Event> eventType, EntityRef entity) { Set<EventHandlerInfo> result = Sets.newHashSet(); result.addAll(generalHandlers.get(eventType)); SetMultimap<Class<? extends Component>, EventHandlerInfo> handlers = componentSpecificHandlers.get(eventType); if (handlers == null) { return result; } handlers.keySet().stream().filter(compClass -> entity.hasComponent(compClass)).forEach(compClass -> { for (EventHandlerInfo eventHandler : handlers.get(compClass)) { if (eventHandler.isValidFor(entity)) { result.add(eventHandler); } } }); return result; }

Target:
private Set<EventHandlerInfo> selectEventHandlers(Class<? extends Event> eventType, EntityRef entity) { Set<EventHandlerInfo> result = Sets.newHashSet(); result.addAll(generalHandlers.get(eventType)); SetMultimap<Class<? extends Component>, EventHandlerInfo> handlers = componentSpecificHandlers.get(eventType); if (handlers == null) { return result; } for (Class<? extends Component> compClass : handlers.keySet()) { if (entity.hasComponent(compClass)) { for (EventHandlerInfo eventHandler : handlers.get(compClass)) { if (eventHandler.isValidFor(entity)) { result.add(eventHandler); } } } } return result; }
Source:
public Void execute(K k, Rewriter rewriter, CompiledDefinition compiledDefinition) { KDebug debugger = new KoreKDebug(k, rewriter, checkpointInterval, files, kem, kRunOptions, compiledDefinition); ConsoleReader reader = getConsoleReader(); while (true) { try { String input = reader.readLine("KDebug> "); if (input.isEmpty()) { continue; } Command command = parseCommand(input); if (command instanceof Commands.QuitCommand) { break; } if (command instanceof Commands.SourceCommand) { String source = ((Commands.SourceCommand) command).getSourceFile(); processSourceCommand(source, debugger, compiledDefinition); System.out.println("File " + source + " Sourced"); } command.runCommand(debugger, compiledDefinition, false); } catch (KEMException e) { System.out.println(e.getMessage()); } catch (ParseException parseException) { System.out.println(parseException.getMessage()); } catch (NumberFormatException numberException) { System.out.println("Could not parse \"foo\" as number"); } catch (FileNotFoundException fileNotFound) { System.out.println(fileNotFound.getMessage()); } catch (IOException inputException) { KEMException.criticalError("Failed to read input from console"); } } return null; }

Target:
public Void execute(K k, Rewriter rewriter, CompiledDefinition compiledDefinition) { KDebug debugger = new KoreKDebug(k, rewriter, checkpointInterval, files, kem, kRunOptions, compiledDefinition); ConsoleReader reader = getConsoleReader(); while (true) { try { String input = reader.readLine("KDebug> "); if (input == null) { return null; } if (input.isEmpty()) { continue; } Command command = parseCommand(input); if (command instanceof Commands.QuitCommand) { break; } if (command instanceof Commands.SourceCommand) { String source = ((Commands.SourceCommand) command).getSourceFile(); processSourceCommand(source, debugger, compiledDefinition); System.out.println("File " + source + " Sourced"); } command.runCommand(debugger, compiledDefinition, false); } catch (KEMException e) { System.out.println(e.getMessage()); } catch (ParseException parseException) { System.out.println(parseException.getMessage()); } catch (NumberFormatException numberException) { System.out.println("Could not parse \"foo\" as number"); } catch (FileNotFoundException fileNotFound) { System.out.println(fileNotFound.getMessage()); } catch (IOException inputException) { KEMException.criticalError("Failed to read input from console"); } catch (UserInterruptException interrupt) { return null; } } return null; }
Source:
private DocStructInterface parseIssueAssignment(DocStructInterface dsPeriodicalVolume, String right, DigitalDocumentInterface inDigitalDocument) throws TypeNotAllowedForParentException, MetadataTypeNotAllowedException, TypeNotAllowedAsChildException { DocStructTypeInterface dst; MetadataTypeInterface mdt = this.myPrefs.getMetadataTypeByName("CurrentNo"); DocStructInterface dsPeriodicalIssue = null; List<DocStructInterface> myList = dsPeriodicalVolume.getAllChildrenByTypeAndMetadataType("PeriodicalIssue", "CurrentNo"); if (myList != null && myList.size() != 0) { for (DocStructInterface dsIntern : myList) { MetadataInterface metadata = dsIntern.getAllMetadataByType(mdt).get(0); if (metadata.getValue().equals(right)) { dsPeriodicalIssue = dsIntern; } } } if (dsPeriodicalIssue == null) { dst = this.myPrefs.getDocStrctTypeByName("PeriodicalIssue"); dsPeriodicalIssue = inDigitalDocument.createDocStruct(dst); MetadataInterface myMD = UghImplementation.INSTANCE.createMetadata(mdt); myMD.setStringValue(right); dsPeriodicalIssue.addMetadata(myMD); dsPeriodicalVolume.addChild(dsPeriodicalIssue); } return dsPeriodicalIssue; }

Target:
private DocStructInterface parseIssueAssignment(DocStructInterface dsPeriodicalVolume, String right, DigitalDocumentInterface inDigitalDocument) throws MetadataTypeNotAllowedException, TypeNotAllowedAsChildException { DocStructTypeInterface dst; MetadataTypeInterface mdt = this.myPrefs.getMetadataTypeByName("CurrentNo"); DocStructInterface dsPeriodicalIssue = null; List<DocStructInterface> myList = dsPeriodicalVolume.getAllChildrenByTypeAndMetadataType("PeriodicalIssue", "CurrentNo"); if (myList != null && myList.size() != 0) { for (DocStructInterface dsIntern : myList) { MetadataInterface metadata = dsIntern.getAllMetadataByType(mdt).get(0); if (metadata.getValue().equals(right)) { dsPeriodicalIssue = dsIntern; } } } if (dsPeriodicalIssue == null) { dst = this.myPrefs.getDocStrctTypeByName("PeriodicalIssue"); dsPeriodicalIssue = inDigitalDocument.createDocStruct(dst); MetadataInterface myMD = UghImplementation.INSTANCE.createMetadata(mdt); myMD.setStringValue(right); dsPeriodicalIssue.addMetadata(myMD); dsPeriodicalVolume.addChild(dsPeriodicalIssue); } return dsPeriodicalIssue; }
Source:
private ImmutableSet<ModelWithPayload<Item>> mergeItemsWithExisting( ImmutableSet<ModelWithPayload<Item>> fetchedItems, Set<ModelWithPayload<Item>> existingItems) { Map<String, ModelWithPayload<Item>> fetchedIndex = LocalOrRemoteNitroFetcher.getIndex(fetchedItems); ImmutableSet.Builder<ModelWithPayload<Item>> merged = ImmutableSet.builder(); for (ModelWithPayload<Item> existing : existingItems) { ModelWithPayload<Item> fetched = fetchedIndex.remove(existing.getModel().getCanonicalUri()); if (fetched != null) { Item mergedItem = contentMerger.merge(existing.getModel(), fetched.getModel()); merged.add(new ModelWithPayload(mergedItem, fetched.getPayload())); } else { merged.add(existing); } } ImmutableSet<ModelWithPayload<Item>> all = ImmutableSet.copyOf(Iterables.concat(merged.build(), fetchedIndex.values())); return all; }

Target:
private ImmutableSet<ModelWithPayload<Item>> mergeItemsWithExisting( ImmutableSet<ModelWithPayload<Item>> fetchedItems, Set<ModelWithPayload<Item>> existingItems) { Map<String, ModelWithPayload<Item>> fetchedIndex = LocalOrRemoteNitroFetcher.getIndex(fetchedItems); ImmutableSet.Builder<ModelWithPayload<Item>> merged = ImmutableSet.builder(); for (ModelWithPayload<Item> existing : existingItems) { ModelWithPayload<Item> fetched = fetchedIndex.remove(existing.getModel().getCanonicalUri()); if (fetched != null) { Item mergedItem = contentMerger.merge(existing.getModel(), fetched.getModel()); merged.add(new ModelWithPayload(mergedItem, fetched.getPayload())); } else { merged.add(existing); } } return ImmutableSet.copyOf(Iterables.concat(merged.build(), fetchedIndex.values())); }
Source:
protected void executeCommand() { VmDevice graphicsDev = getParameters().getDev(); if (graphicsDev.getDeviceId() == null) { graphicsDev.setDeviceId(Guid.newGuid()); } vmDeviceDao.save(graphicsDev); if (isCompensationEnabled()) { getCompensationContext().snapshotNewEntity(graphicsDev); getCompensationContext().stateChanged(); } setSucceeded(true); setActionReturnValue(graphicsDev.getId().getDeviceId()); }

Target:
protected void executeCommand() { VmDevice graphicsDev = getParameters().getDev(); if (graphicsDev.getDeviceId() == null) { graphicsDev.setDeviceId(Guid.newGuid()); } CompensationUtils.saveEntity(graphicsDev, vmDeviceDao, getCompensationContextIfEnabled()); if (isCompensationEnabled()) { getCompensationContext().stateChanged(); } setSucceeded(true); setActionReturnValue(graphicsDev.getId().getDeviceId()); }
Source:
public int getTopologyId(byte[] cacheName) { return topologyInfo.getTopologyId(cacheName); }

Target:
public int getTopologyId(byte[] cacheName) { synchronized (lock) { return topologyInfo.getTopologyId(cacheName); } }
Source:
public int getNumberOfUghElements(Process myProcess, CountType inType) { int rueckgabe = 0; FileformatInterface gdzfile; try { gdzfile = serviceManager.getProcessService().readMetadataFile(myProcess); } catch (Exception e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung("xml error", e.getMessage()); return -1; } DigitalDocumentInterface document; try { document = gdzfile.getDigitalDocument(); DocStructInterface logicalTopstruct = document.getLogicalDocStruct(); rueckgabe += getNumberOfUghElements(logicalTopstruct, inType); } catch (PreferencesException e) { Helper.setFehlerMeldung("[" + myProcess.getId() + "] Can not get DigitalDocument: ", e.getMessage()); logger.error(e.getMessage(), e); rueckgabe = 0; } myProcess.setSortHelperArticles(rueckgabe); try { serviceManager.getProcessService().save(myProcess); } catch (DataException e) { logger.error(e.getMessage(), e); } return rueckgabe; }

Target:
public int getNumberOfUghElements(Process myProcess, CountType inType) { int rueckgabe = 0; FileformatInterface gdzfile; try { gdzfile = serviceManager.getProcessService().readMetadataFile(myProcess); } catch (PreferencesException | IOException | ReadException | RuntimeException e) { Helper.setErrorMessage("xml error", logger, e); return -1; } DigitalDocumentInterface document; try { document = gdzfile.getDigitalDocument(); DocStructInterface logicalTopstruct = document.getLogicalDocStruct(); rueckgabe += getNumberOfUghElements(logicalTopstruct, inType); } catch (PreferencesException e) { Helper.setErrorMessage("[" + myProcess.getId() + "] " + Helper.getTranslation("cannotGetDigitalDocument") + ": " + e.getMessage(), logger, e); rueckgabe = 0; } myProcess.setSortHelperArticles(rueckgabe); try { serviceManager.getProcessService().save(myProcess); } catch (DataException e) { logger.error(e.getMessage(), e); } return rueckgabe; }
Source:
public void after() { try { txSupport.rollbackTx(); } catch (Throwable t){ } try { txSupport.getTransactionInfo(); Assert.fail("Failed to rollback the transaction."); } catch (Throwable e) { } }

Target:
public void after() { try { txSupport.rollbackTx(); } catch (Throwable t){ } try { txSupport.getTransactionInfo(); Assert.fail("Failed to rollback the transaction."); } catch (HttpResponseException e) { } catch (IllegalStateException e) { } catch (Throwable t) { throw new RuntimeException(t); } }
Source:
public Response send(final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read) throws IOException { final Response rsp; if (method.equals(Request.GET)) { rsp = this.lookInCache( req, home, method, headers, content, connect, read ); } else { rsp = this.origin.send( req, home, method, headers, content, connect, read ); } return rsp; }

Target:
public Response send(final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read) throws IOException { final Response rsp; if (method.equals(Request.GET)) { rsp = this.consultCache( req, home, method, headers, content, connect, read ); } else { rsp = this.origin.send( req, home, method, headers, content, connect, read ); } return rsp; }
Source:
private Profile fetch(final XML xml) throws IOException { final Profile profile; final List<String> type = xml.xpath(" if (type.isEmpty() || !Profiles.MERGE.equals(type.get(0))) { profile = new GithubProfile( new TalkIssues(Profiles.github(), xml).get().repo() ); } else { final Profile master = new GithubProfile( new TalkIssues(Profiles.github(), xml).get().repo() ); profile = this.merged( master, xml.xpath(" xml.xpath( " ).get(0) ); } return profile; }

Target:
private Profile fetch(final XML xml) throws IOException { final Profile profile; final List<String> type = xml.xpath(" if (type.isEmpty() || !Profiles.MERGE.equals(type.get(0))) { profile = new GithubProfile( new TalkIssues(Profiles.github(), xml).get().repo() ); } else { profile = this.merged( new GithubProfile( new TalkIssues(Profiles.github(), xml).get().repo() ), xml.xpath(" xml.xpath( " ).get(0) ); } return profile; }
Source:
public String exportVm(VM vm, FullEntityOvfData fullEntityOvfData, Version version) { updateBootOrderOnDevices(vm.getStaticData(), false); final OvfVmWriter vmWriter; if (vm.isHostedEngine()) { Cluster cluster = clusterDao.get(vm.getClusterId()); String cpuId = cpuFlagsManagerHandler.getCpuId(cluster.getCpuName(), cluster.getCompatibilityVersion()); String engineXml = null; if (Version.v4_2.lessOrEquals(cluster.getCompatibilityVersion())) { engineXml = generateEngineXml(vm, cpuId, cluster.getEmulatedMachine()); } vmWriter = new HostedEngineOvfWriter(vm, fullEntityOvfData, version, cluster.getEmulatedMachine(), cpuId, osRepository, engineXml); } else { vmWriter = new OvfVmWriter(vm, fullEntityOvfData, version, osRepository, getMemoryDiskForSnapshots(vm)); } return vmWriter.build().getStringRepresentation(); }

Target:
public String exportVm(VM vm, FullEntityOvfData fullEntityOvfData, Version version) { updateBootOrderOnDevices(vm.getStaticData(), false); final OvfVmWriter vmWriter; if (vm.isHostedEngine()) { Cluster cluster = clusterDao.get(vm.getClusterId()); String cpuId = cpuFlagsManagerHandler.getCpuId(cluster.getCpuName(), cluster.getCompatibilityVersion()); String engineXml = null; if (FeatureSupported.isDomainXMLSupported(cluster.getCompatibilityVersion())) { engineXml = generateEngineXml(vm, cpuId, cluster.getEmulatedMachine()); } vmWriter = new HostedEngineOvfWriter(vm, fullEntityOvfData, version, cluster.getEmulatedMachine(), cpuId, osRepository, engineXml); } else { vmWriter = new OvfVmWriter(vm, fullEntityOvfData, version, osRepository, getMemoryDiskForSnapshots(vm)); } return vmWriter.build().getStringRepresentation(); }
Source:
private static BinaryResult stackBase64(HttpServletResponse res, final BinaryResult src) throws IOException { BinaryResult b64; long len = src.getContentLength(); if (0 <= len && len <= (7 << 20)) { b64 = base64(src); } else { b64 = new BinaryResult() { @Override public void writeTo(OutputStream out) throws IOException { try (OutputStream e = BaseEncoding.base64().encodingStream( new OutputStreamWriter(out, ISO_8859_1))) { src.writeTo(e); e.flush(); } } }; } res.setHeader("X-FYI-Content-Encoding", "base64"); res.setHeader("X-FYI-Content-Type", src.getContentType()); return b64.setContentType("text/plain").setCharacterEncoding("ISO-8859-1"); }

Target:
private static BinaryResult stackBase64(HttpServletResponse res, final BinaryResult src) throws IOException { BinaryResult b64; long len = src.getContentLength(); if (0 <= len && len <= (7 << 20)) { b64 = base64(src); } else { b64 = new BinaryResult() { @Override public void writeTo(OutputStream out) throws IOException { try (OutputStreamWriter w = new OutputStreamWriter(out, ISO_8859_1); OutputStream e = BaseEncoding.base64().encodingStream(w)) { src.writeTo(e); e.flush(); } } }; } res.setHeader("X-FYI-Content-Encoding", "base64"); res.setHeader("X-FYI-Content-Type", src.getContentType()); return b64.setContentType("text/plain").setCharacterEncoding("ISO-8859-1"); }
Source:
private static Details getDetailsForOthers(DetailAST ast) { DetailAST rcurly = null; final DetailAST lcurly; final int tokenType = ast.getType(); if (isDefinitionToken(tokenType)) { final DetailAST child = ast.getLastChild(); lcurly = child.getFirstChild(); rcurly = child.getLastChild(); } else { lcurly = ast.findFirstToken(TokenTypes.SLIST); if (lcurly != null) { rcurly = lcurly.getLastChild(); } } return new Details(lcurly, rcurly, getNextToken(ast), true); }

Target:
private static Details getDetailsForOthers(DetailAST ast) { DetailAST rcurly = null; final DetailAST lcurly; final int tokenType = ast.getType(); if (isTokenWithNoChildSlist(tokenType)) { final DetailAST child = ast.getLastChild(); lcurly = child.getFirstChild(); rcurly = child.getLastChild(); } else { lcurly = ast.findFirstToken(TokenTypes.SLIST); if (lcurly != null) { rcurly = lcurly.getLastChild(); } } return new Details(lcurly, rcurly, getNextToken(ast), true); }