auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public <START> synchronized void <END> invokeCallbackMethods() { initCommandExecutor(); for (Iterator<Entry<Guid, CommandCallBack>> iterator = cmdCallBackMap.entrySet().iterator(); iterator.hasNext();) { Entry<Guid, CommandCallBack> entry = iterator.next(); Guid cmdId = entry.getKey(); CommandCallBack callBack = entry.getValue(); CommandStatus status = coco.getCommandStatus(cmdId); switch(status) { case REJECTED: CommandEntity cmdEntity = coco.getCommandEntity(cmdId); executeAsyncCommand(cmdEntity.getCommandType(), cmdEntity.getActionParameters()); iterator.remove(); break; case FAILED: callBack.onFailed(cmdId, coco.getChildCommandIds(cmdId)); coco.updateCallBackNotified(cmdId); iterator.remove(); break; case SUCCEEDED: callBack.onSucceeded(cmdId, coco.getChildCommandIds(cmdId)); coco.updateCallBackNotified(cmdId); iterator.remove(); break; case ACTIVE: case ACTIVE_ASYNC: callBack.doPolling(cmdId, coco.getChildCommandIds(cmdId)); break; default: break; } } }</code><technical_language>need synchronized</technical_language>

Target:
public void invokeCallbackMethods() { initCommandExecutor(); for (Iterator<Entry<Guid, CommandCallBack>> iterator = cmdCallBackMap.entrySet().iterator(); iterator.hasNext();) { Entry<Guid, CommandCallBack> entry = iterator.next(); Guid cmdId = entry.getKey(); CommandCallBack callBack = entry.getValue(); CommandStatus status = coco.getCommandStatus(cmdId); switch (status) { case FAILED: callBack.onFailed(cmdId, coco.getChildCommandIds(cmdId)); coco.updateCallBackNotified(cmdId); iterator.remove(); break; case SUCCEEDED: callBack.onSucceeded(cmdId, coco.getChildCommandIds(cmdId)); coco.updateCallBackNotified(cmdId); iterator.remove(); break; case ACTIVE: case ACTIVE_ASYNC: callBack.doPolling(cmdId, coco.getChildCommandIds(cmdId)); break; default: break; } } }
Source:
<code><START> public boolean isValid(CruiseConfig preprocessedConfig, String repositoryId) { <END> PackageRepositories packageRepositories = preprocessedConfig.getPackageRepositories(); PackageRepository repository = packageRepositories.find(repositoryId); Packages packages = repository.getPackages(); packageRepositories.validate(new ConfigSaveValidationContext(preprocessedConfig)); packages.validate(new ConfigSaveValidationContext(repository)); PackageDefinition nameValidatedPackage = packages.find(this.packageDefinition.getId()); nameValidatedPackage.validate(new ConfigSaveValidationContext(packages)); if(!isPackageIdPresent(nameValidatedPackage)){ result.unprocessableEntity(LocalizedMessage.string("PACKAGE_ID_NOT_PROVIDED")); } BasicCruiseConfig.copyErrors(nameValidatedPackage, packageDefinition); return com.thoughtworks.go.config.ErrorCollector.getAllErrors(nameValidatedPackage).isEmpty() && result.isSuccessful(); }</code><technical_language>plugin side validations care of</technical_language>

Target:
public boolean isValid(CruiseConfig preprocessedConfig, String repositoryId) { PackageRepositories packageRepositories = preprocessedConfig.getPackageRepositories(); PackageRepository repository = packageRepositories.find(repositoryId); Packages packages = repository.getPackages(); preprocessedPackageDefinition = packages.find(this.packageDefinition.getId()); preprocessedPackageDefinition.validate(null); if (preprocessedPackageDefinition.getAllErrors().isEmpty()) { packageRepositories.validate(null); packages.validate(null); packageDefinitionService.validatePackageConfiguration(preprocessedPackageDefinition); BasicCruiseConfig.copyErrors(preprocessedPackageDefinition, packageDefinition); return preprocessedPackageDefinition.getAllErrors().isEmpty() && result.isSuccessful(); } BasicCruiseConfig.copyErrors(preprocessedPackageDefinition, packageDefinition); return false; }
Source:
<code>public boolean select(Viewer viewer, Object parentElement, Object element) { if (fRejectedElements != null) { for (Object <START> fRejectedElement : <END> fRejectedElements) { if (element.equals(fRejectedElement)) { return false; } } } for (Class<?> fAcceptedType : fAcceptedTypes) { if (fAcceptedType.isInstance(element)) { return true; } } return false; }</code><technical_language>rename element</technical_language>

Target:
public boolean select(Viewer viewer, Object parentElement, Object element) { if (fRejectedElements != null) { for (Object rejectedelement : fRejectedElements) { if (element.equals(rejectedelement)) { return false; } } } for (Class<?> type : fAcceptedTypes) { if (type.isInstance(element)) { return true; } } return false; }
Source:
<code>private List<SignedCertificateTimestamp> <START> getSCTsFromSCTList(byte[] <END> data, SignedCertificateTimestamp.Origin origin) { List<SignedCertificateTimestamp> scts = new ArrayList(); byte[][] sctList; try { sctList = Serialization.readList(data, 2, 2); } catch (SerializationException e) { return null; } for (byte[] encodedSCT: sctList) { try { SignedCertificateTimestamp sct = SignedCertificateTimestamp.decode(encodedSCT, origin); scts.add(sct); } catch (SerializationException e) { } } return scts; }</code><technical_language>If this (and other two) methods accept null input data return empty lists null, error handling do in verifySignedCertificateTimestamps</technical_language>

Target:
private List<SignedCertificateTimestamp> getSCTsFromSCTList(byte[] data, SignedCertificateTimestamp.Origin origin) { if (data == null) { return Collections.EMPTY_LIST; } byte[][] sctList; try { sctList = Serialization.readList(data, 2, 2); } catch (SerializationException e) { return Collections.EMPTY_LIST; } List<SignedCertificateTimestamp> scts = new ArrayList(); for (byte[] encodedSCT: sctList) { try { SignedCertificateTimestamp sct = SignedCertificateTimestamp.decode(encodedSCT, origin); scts.add(sct); } catch (SerializationException e) { } } return scts; }
Source:
<code>public void check(ConfigurationGenerator cg) throws ConfigurationException { File configFile = new File(cg.getConfigDir(), CONFIG_NAME); <START> if (configFile.exists()) { <END> MongoDBConnectionConfig config = getDescriptor(configFile, MongoDBConnectionConfig.class); try (MongoClient mongoClient = MongoDBConnectionHelper.newMongoClient(config, builder -> builder.serverSelectionTimeout((int) TimeUnit.SECONDS.toMillis(getCheckTimeoutInSeconds(cg))) .description("Nuxeo DB Check"))) { MongoDatabase database = mongoClient.getDatabase(config.dbname); Document ping = new Document("ping", "1"); database.runCommand(ping); } catch (MongoTimeoutException e) { throw new ConfigurationException(String.format( "Unable to connect to MongoDB at %s, please check your connection", config.server)); } } }</code><technical_language>Please inverse logic do early-exit if config file exist (and log debug leve)</technical_language>

Target:
public void check(ConfigurationGenerator cg) throws ConfigurationException { File configFile = new File(cg.getConfigDir(), CONFIG_NAME); if (!configFile.exists()) { log.warn("Unable to find config file " + CONFIG_NAME); return; } MongoDBConnectionConfig config = getDescriptor(configFile, MongoDBConnectionConfig.class); try (MongoClient mongoClient = MongoDBConnectionHelper.newMongoClient(config, builder -> builder.serverSelectionTimeout( (int) TimeUnit.SECONDS.toMillis(getCheckTimeoutInSeconds(cg))) .description("Nuxeo DB Check"))) { MongoDatabase database = mongoClient.getDatabase(config.dbname); Document ping = new Document("ping", "1"); database.runCommand(ping); } catch (MongoTimeoutException e) { throw new ConfigurationException(String.format( "Unable to connect to MongoDB at %s, please check your connection", config.server)); } }
Source:
<code>protected final MaterializedFrame determineContext(final Frame frame) { Object next = SArguments.rcvr(frame); int i = contextLevel - 1; while (i > 0) { <START> if (next instanceof SBlock) { <END> next = ((SBlock) next).getOuterSelf(); } else if (next instanceof SObjectWithClass) { next = SArguments.rcvr(((SObjectWithClass) next).getSOMClass().getContext()); } else if (next instanceof MaterializedFrame) { next = SArguments.rcvr((MaterializedFrame) next); } else { throw new RuntimeException("Cannot process " + next + " as contextual object"); } i--; } if (next instanceof SBlock) { return frameType.profile(((SBlock) next).getContext()); } else if (next instanceof SObjectWithClass) { SClass sClass = ((SObjectWithClass) next).getSOMClass(); return frameType.profile(sClass.getContext()); } else if (next instanceof MaterializedFrame) { return frameType.profile((MaterializedFrame) next); } else { throw new RuntimeException("Cannot process " + next + " as contextual object"); } }</code><technical_language>Graal is hate this code. ran benchmarks happen</technical_language>

Target:
protected final MaterializedFrame determineContext(final Frame frame) { SObjectWithContext self = (SObjectWithContext) SArguments.rcvr(frame); int i = contextLevel - 1; if (i > 0) { boolean doBuildChain = determineContext == null; if (doBuildChain) { determineContext = buildChain(self, i); } self = determineContext.getOuterSelf(self); } return frameType.profile(outerType.profile(self).getContext()); }
Source:
<code>public HttpResponse doResult(@QueryParameter String election) throws NamingException, IOException { if ( election.isEmpty() || election.equals(".") || election.equals("..")){ return new HttpRedirect("/election/results"); } File directory = new File( electionLogDir + "/" + election ); if (!directory.isDirectory() || !directory.exists()){ return new HttpRedirect("/election/results"); } if (!isResultExist(election) || isOpen(election)){ return new HttpRedirect("/election/ongoing"); } else{ <START> parseRawResult( election ); <END> return HttpResponses.forwardToView(this,"result.jelly"); } }</code><technical_language>a bit concerned this call well, invoke doResult Is this invoked vote? some file ops in parseRawResult concern</technical_language>

Target:
public HttpResponse doResult(@QueryParameter String election) throws NamingException, IOException { if (!isElectionEnabled()) return new HttpRedirect("/"); else { if (election.isEmpty() || election.equals(".") || election.equals("..")) { return new HttpRedirect("/election/results"); } File directory = new File(electionLogDir + "/" + election); if (!directory.isDirectory() || !directory.exists()) { return new HttpRedirect("/election/results"); } if (!isResultExist(election) || isOpen(election)) { return new HttpRedirect("/election/ongoing"); } else { parseRawResult(election); return HttpResponses.forwardToView(this, "result.jelly"); } } }
Source:
<code><START> String getExternalId(boolean fromServer) { <END> synchronized(syncLock) { return toSyncUserState.syncValues.optString("external_user_id", null); } }</code><technical_language>mark @Nullable</technical_language>

Target:
@Nullable String getExternalId(boolean fromServer) { synchronized(syncLock) { return toSyncUserState.syncValues.optString("external_user_id", null); } }
Source:
<code>public void writeData(ObjectDataOutput out) throws IOException { out.writeObject(value); out.writeLong(expirationTime); out.writeLong(creationTime); out.writeLong(lastAccessTime); out.writeLong(accessHit); <START> out.writeObject(expiryPolicy); <END> }</code><technical_language>this a compatibility problem</technical_language>

Target:
public void writeData(ObjectDataOutput out) throws IOException { out.writeObject(value); out.writeLong(expirationTime); out.writeLong(creationTime); out.writeLong(lastAccessTime); out.writeLong(accessHit); if (out.getVersion().isGreaterOrEqual(EXPIRY_POLICY_VERSION)) { out.writeObject(expiryPolicy); } }
Source:
<code>protected ValidationResult macAvailable() { VmNic nic = getParameters().getNic(); <START> Optional<VM> <END> optionalVm = new VmInterfaceManager().getVmWithSameMacAs(nic, getMacPool()); return optionalVm.map(vm -> new ValidationResult(EngineMessage.NETWORK_MAC_ADDRESS_IN_USE, ReplacementUtils.createSetVariableString(MacAddressValidator.VAR_MAC_ADDRESS, nic.getMacAddress()), ReplacementUtils.createSetVariableString(MacAddressValidator.VAR_VM_NAME, vm.getName()))) .orElse(ValidationResult.VALID); }</code><technical_language>fashion "if" is more easy read here</technical_language>

Target:
protected ValidationResult macAvailable() { VmNic nic = getParameters().getNic(); Optional<VM> optionalVm = new VmInterfaceManager().getVmWithSameMacIfDuplicateIsNotAllowed(nic, getMacPool()); if (optionalVm.isPresent()) { return new ValidationResult(EngineMessage.NETWORK_MAC_ADDRESS_IN_USE, ReplacementUtils.createSetVariableString(MacAddressValidator.VAR_MAC_ADDRESS, nic.getMacAddress()), ReplacementUtils.createSetVariableString(MacAddressValidator.VAR_VM_NAME, optionalVm.get().getName())); } return ValidationResult.VALID; }
Source:
<code>public void scan(File dir, FileVisitor visitor) throws IOException { if(fixEmpty(includes)==null && excludes==null) { new Full().scan(dir,visitor); return; } FileSet fs = Util.createFileSet(dir,includes,excludes); fs.setDefaultexcludes(useDefaultExcludes); if(dir.exists()) { fs.setFollowSymlinks(followSymlinks); DirectoryScanner ds = fs.getDirectoryScanner(new org.apache.tools.ant.Project()); if(!followSymlinks) { for(String f: ds.getNotFollowedSymlinks()) { <START> File file = dir.toPath().relativize(Paths.get(f)).toFile(); <END> scanSymlink(new File(f), file.getPath(), visitor); } } for( String f : ds.getIncludedFiles()) { File file = new File(dir, f); scanSingle(file, f, visitor); } } }</code><technical_language>hudson.model.Util#fileToPath instead of calling Path#toPath wraps InvalidPathException IOException existing callers need handle new types of exceptions</technical_language>

Target:
public void scan(File dir, FileVisitor visitor) throws IOException { if(fixEmpty(includes)==null && excludes==null) { new Full().scan(dir,visitor); return; } FileSet fs = Util.createFileSet(dir,includes,excludes); fs.setDefaultexcludes(useDefaultExcludes); fs.appendSelector(new DescendantFileSelector(fs.getDir())); if(dir.exists()) { fs.setFollowSymlinks(followSymlinks); DirectoryScanner ds = fs.getDirectoryScanner(new org.apache.tools.ant.Project()); if(!followSymlinks) { for(String f: ds.getNotFollowedSymlinks()) { File file = Util.fileToPath(dir).relativize(Paths.get(f)).toFile(); scanSymlink(new File(f), file.getPath(), visitor); } } for( String f : ds.getIncludedFiles()) { File file = new File(dir, f); scanSingle(file, f, visitor); } } }
Source:
<code>private static CompletableFuture<List<? extends ICodeMining>> getCodeMinings(ITextViewer viewer, List<ICodeMiningProvider> providers, IProgressMonitor monitor) { List<CompletableFuture<List<? extends ICodeMining>>> com= providers.stream() .map(provider -> provider.provideCodeMinings(viewer, monitor)) .filter(c -> c != null) <START> .map(provider -> provider.exceptionally(CodeMiningManager::onCodeMiningProviderException)) <END> .collect(Collectors.toList()); return CompletableFuture.allOf(com.toArray(new CompletableFuture[com.size()])).thenApply( v -> com.stream().map(CompletableFuture::join).flatMap(l -> l.stream()).collect(Collectors.toList())); }</code><technical_language>provider, future here</technical_language>

Target:
private static CompletableFuture<List<? extends ICodeMining>> getCodeMinings(ITextViewer viewer, List<ICodeMiningProvider> providers, IProgressMonitor monitor) { List<CompletableFuture<List<? extends ICodeMining>>> com= providers.stream() .map(provider -> provider.provideCodeMinings(viewer, monitor)) .filter(c -> c != null) .map(future -> future.exceptionally(CodeMiningManager::logCodeMiningProviderException)) .collect(Collectors.toList()); return CompletableFuture.allOf(com.toArray(new CompletableFuture[com.size()])).thenApply( v -> com.stream().map(CompletableFuture::join).flatMap(l -> l.stream()).collect(Collectors.toList())); }
Source:
<code>public byte[] toBinary() { final byte[] filterBinary = filterOptionProvider.toBinary(); final byte[] typeNameBinary = typeNameProvider.toBinary(); <START> final byte[] simpBinary = simpOptionProvider.toBinary(); <END> final ByteBuffer buf = ByteBuffer.allocate(filterBinary.length + typeNameBinary.length + simpBinary.length + 4); buf.putInt(filterBinary.length); buf.put(filterBinary); buf.put(typeNameBinary); buf.put(simpBinary); return ArrayUtils.addAll( serializationFormatOptionProvider.toBinary(), buf.array()); }</code><technical_language>fromBinary unchanged (and size of binary needs serialized able deserialize)</technical_language>

Target:
public byte[] toBinary() { final byte[] filterBinary = filterOptionProvider.toBinary(); final byte[] typeNameBinary = typeNameProvider.toBinary(); final byte[] simpBinary = simpOptionProvider.toBinary(); final byte[] backingBuffer = new byte[filterBinary.length + typeNameBinary.length + simpBinary.length + (Integer.BYTES * 2)]; final ByteBuffer buf = ByteBuffer.wrap(backingBuffer); buf.putInt(filterBinary.length); buf.put(filterBinary); buf.putInt(typeNameBinary.length); buf.put(typeNameBinary); buf.put(simpBinary); return ArrayUtils.addAll( serializationFormatOptionProvider.toBinary(), backingBuffer); }
Source:
<code>public OnlineHmmData getModelDataByAccountId(Long accountId,final DateTime date) { final String dateString = DateTimeUtil.dateToYmdString(date); final GeneralProtobufDAODynamoDB.GeneralQueryResult results = dbDAO.getBySingleKeyLTERangeKey(accountId.toString(), dateString, 1); LOGGER.info("getModelDataByAccountId for user {}",accountId); <START> final Map<String,byte[]> allColumns = results.payloadsByKey.get(accountId.toString()); <END> Optional<OnlineHmmPriors> priors = Optional.absent(); Optional<OnlineHmmScratchPad> scratchPad = Optional.absent(); if (allColumns == null) { return new OnlineHmmData(priors,scratchPad); } final byte priorProtobufData = allColumns.get(PAYLOAD_KEY_FOR_PARAMS); if (priorProtobufData != null) { priors = OnlineHmmPriors.createFromProtoBuf(priorProtobufData); } final byte scratchPadProtobufData = allColumns.get(PAYLOAD_KEY_FOR_SCRATCHPAD); if (scratchPadProtobufData != null) { scratchPad = OnlineHmmScratchPad.createFromProtobuf(scratchPadProtobufData); } return new OnlineHmmData(priors,scratchPad); }</code><technical_language>columns return null. Return empty map instead map.isEmpty() return early</technical_language>

Target:
public OnlineHmmData getModelDataByAccountId(Long accountId,final DateTime date) { final String dateString = DateTimeUtil.dateToYmdString(date); final GeneralProtobufDAODynamoDB.GeneralQueryResult results = dbDAO.getBySingleKeyLTERangeKey(accountId.toString(), dateString, 1); LOGGER.info("getModelDataByAccountId for user {}",accountId); if (!results.payloadsByKey.containsKey(accountId.toString())) { LOGGER.info("getModelDataByAccountId for user returned ",accountId); return OnlineHmmData.createEmpty(); } final Map<String,byte[]> allColumns = results.payloadsByKey.get(accountId.toString()); OnlineHmmPriors priors = OnlineHmmPriors.createEmpty(); OnlineHmmScratchPad scratchPad = OnlineHmmScratchPad.createEmpty(); if (!allColumns.containsKey(PAYLOAD_KEY_FOR_PARAMS)) { LOGGER.info("getModelDataByAccountId for user did not find column {}",accountId,PAYLOAD_KEY_FOR_PARAMS); return OnlineHmmData.createEmpty(); } if ( !allColumns.containsKey(PAYLOAD_KEY_FOR_SCRATCHPAD)) { LOGGER.info("getModelDataByAccountId for user did not find column {}",accountId,PAYLOAD_KEY_FOR_SCRATCHPAD); return OnlineHmmData.createEmpty(); } final byte priorProtobufData = allColumns.get(PAYLOAD_KEY_FOR_PARAMS); final Optional<OnlineHmmPriors> priorsOptional = OnlineHmmPriors.createFromProtoBuf(priorProtobufData); if (priorsOptional.isPresent()) { priors = priorsOptional.get(); } final byte scratchPadProtobufData = allColumns.get(PAYLOAD_KEY_FOR_SCRATCHPAD); final Optional<OnlineHmmScratchPad> scratchPadOptional = OnlineHmmScratchPad.createFromProtobuf(scratchPadProtobufData); if (scratchPadOptional.isPresent()) { scratchPad = scratchPadOptional.get(); } return new OnlineHmmData(priors,scratchPad); }
Source:
<code>private String generateRelatedIdentifiers(DvObject dvObject) { StringBuilder sb = new StringBuilder(); if (dvObject.isInstanceofDataset()) { Dataset dataset = (Dataset) dvObject; if (!dataset.getFiles().isEmpty() && !(dataset.getFiles().get(0).getIdentifier() == null)) { datafileIdentifiers = new ArrayList<>(); for (DataFile dataFile : dataset.getFiles()) { String add = ""; sb.append(""); if (!dataFile.getGlobalId().asString().isEmpty()) { add = "<relatedIdentifier relatedIdentifierType=\"DOI\" relationType=\"HasPart\"" + ">" + dataFile.getGlobalId() + "</relatedIdentifier>"; if (sb.toString().isEmpty()) { sb.append("<relatedIdentifiers>"); } sb.append(add); } } if (!sb.toString().isEmpty()) { sb.append("</relatedIdentifiers>"); } } <START> } else if (dvObject.isInstanceofDataFile()){ <END> DataFile df = (DataFile) dvObject; sb.append("<relatedIdentifiers>"); sb.append("<relatedIdentifier relatedIdentifierType=\"DOI\" relationType=\"IsPartOf\"" + ">" + df.getOwner().getGlobalId() + "</relatedIdentifier>"); sb.append("</relatedIdentifiers>"); } return sb.toString(); }</code><technical_language>Is a case a data file for some reason owner</technical_language>

Target:
private String generateRelatedIdentifiers(DvObject dvObject) { StringBuilder sb = new StringBuilder(); if (dvObject.isInstanceofDataset()) { Dataset dataset = (Dataset) dvObject; if (!dataset.getFiles().isEmpty() && !(dataset.getFiles().get(0).getIdentifier() == null)) { datafileIdentifiers = new ArrayList<>(); for (DataFile dataFile : dataset.getFiles()) { if (!dataFile.getGlobalId().asString().isEmpty()) { if (sb.toString().isEmpty()) { sb.append("<relatedIdentifiers>"); } sb.append("<relatedIdentifier relatedIdentifierType=\"DOI\" relationType=\"HasPart\">" + dataFile.getGlobalId() + "</relatedIdentifier>"); } } if (!sb.toString().isEmpty()) { sb.append("</relatedIdentifiers>"); } } } else if (dvObject.isInstanceofDataFile()) { DataFile df = (DataFile) dvObject; sb.append("<relatedIdentifiers>"); sb.append("<relatedIdentifier relatedIdentifierType=\"DOI\" relationType=\"IsPartOf\"" + ">" + df.getOwner().getGlobalId() + "</relatedIdentifier>"); sb.append("</relatedIdentifiers>"); } return sb.toString(); }
Source:
<code>public DirectDebitPayment getDirectDebitPayment(Account account, String paymentId) { Response connectorResponse = client .target(connectorUriGenerator.chargeURI(account, paymentId)) .request() .get(); if (connectorResponse.getStatus() == SC_OK) { <START> DirectDebitConnectorCreatePaymentResponse ddConnectorResponse = <END> connectorResponse.readEntity(DirectDebitConnectorCreatePaymentResponse.class); return aDirectDebitPayment() .withDescription(ddConnectorResponse.getDescription()) .withAmount(ddConnectorResponse.getAmount()) .withPaymentId(ddConnectorResponse.getPaymentExternalId()) .withPaymentProvider(ddConnectorResponse.getPaymentProvider()) .withState(ddConnectorResponse.getState()) .withCreatedDate(ddConnectorResponse.getCreatedDate()) .withReference(ddConnectorResponse.getReference()) .withSelfLink(publicApiUriGenerator.getDirectDebitPaymentURI(paymentId)) .withMandateLink(publicApiUriGenerator.getMandateURI(ddConnectorResponse.getMandateId())) .withEventsLink(publicApiUriGenerator.getMandateEventsURI(ddConnectorResponse.getMandateId())) .build(); } throw new GetChargeException(connectorResponse); }</code><technical_language>rename DirectDebitConnectorCreatePaymentResponse remove "Create" for create get</technical_language>

Target:
public DirectDebitPayment getDirectDebitPayment(Account account, String paymentId) { Response connectorResponse = client .target(connectorUriGenerator.chargeURI(account, paymentId)) .request() .get(); if (connectorResponse.getStatus() != SC_OK) { throw new GetChargeException(connectorResponse); } DirectDebitConnectorPaymentResponse ddConnectorResponse = connectorResponse.readEntity(DirectDebitConnectorPaymentResponse.class); return DirectDebitPayment.from(ddConnectorResponse, publicApiUriGenerator); }
Source:
<code>private RowMapBuffer getTransactionRows() throws Exception { BinlogConnectorEvent event; RowMapBuffer buffer = new RowMapBuffer(MAX_TX_ELEMENTS); while ( true ) { event = pollEvent(); if (event == null) { ensureReplicatorThread(); continue; } switch(event.getEvent().getHeader().getEventType()) { case WRITE_ROWS: case UPDATE_ROWS: case DELETE_ROWS: case EXT_WRITE_ROWS: case EXT_UPDATE_ROWS: case EXT_DELETE_ROWS: Table table = tableCache.getTable(event.getTableID()); event.setLastHeartbeat(lastHeartbeatRead); if ( table != null && shouldOutputEvent(table.getDatabase(), table.getName(), filter) ) { for ( RowMap r : event.jsonMaps(table) ) buffer.add(r); } break; case TABLE_MAP: TableMapEventData data = event.tableMapData(); tableCache.processEvent(getSchema(), this.filter, data.getTableId(), data.getDatabase(), data.getTable()); break; case QUERY: QueryEventData qe = event.queryData(); String sql = qe.getSql(); if ( sql.equals("COMMIT") ) { if ( !buffer.isEmpty() ) buffer.getLast().setTXCommit(); return buffer; } else if ( sql.toUpperCase().startsWith("SAVEPOINT")) { LOGGER.info("Ignoring SAVEPOINT in transaction: " + qe); } else if ( createTablePattern.matcher(sql).find() ) { processQueryEvent(event); } else { LOGGER.warn("Unhandled QueryEvent inside transaction: " + qe); } break; case XID: buffer.setXid(event.xidData().getXid()); <START> replicationLag = event.getEvent().getHeader().getTimestamp() - (System.currentTimeMillis() / 1000); <END> if ( !buffer.isEmpty() ) buffer.getLast().setTXCommit(); return buffer; } } }</code><technical_language>lag is low. milliseconds here? need / 1000. find lag is 0 of time</technical_language>

Target:
private RowMapBuffer getTransactionRows() throws Exception { BinlogConnectorEvent event; RowMapBuffer buffer = new RowMapBuffer(MAX_TX_ELEMENTS); while ( true ) { event = pollEvent(); if (event == null) { ensureReplicatorThread(); continue; } switch(event.getEvent().getHeader().getEventType()) { case WRITE_ROWS: case UPDATE_ROWS: case DELETE_ROWS: case EXT_WRITE_ROWS: case EXT_UPDATE_ROWS: case EXT_DELETE_ROWS: Table table = tableCache.getTable(event.getTableID()); event.setLastHeartbeat(lastHeartbeatRead); if ( table != null && shouldOutputEvent(table.getDatabase(), table.getName(), filter) ) { for ( RowMap r : event.jsonMaps(table) ) buffer.add(r); } break; case TABLE_MAP: TableMapEventData data = event.tableMapData(); tableCache.processEvent(getSchema(), this.filter, data.getTableId(), data.getDatabase(), data.getTable()); break; case QUERY: QueryEventData qe = event.queryData(); String sql = qe.getSql(); if ( sql.equals("COMMIT") ) { if ( !buffer.isEmpty() ) buffer.getLast().setTXCommit(); return buffer; } else if ( sql.toUpperCase().startsWith("SAVEPOINT")) { LOGGER.info("Ignoring SAVEPOINT in transaction: " + qe); } else if ( createTablePattern.matcher(sql).find() ) { processQueryEvent(event); } else { LOGGER.warn("Unhandled QueryEvent inside transaction: " + qe); } break; case XID: buffer.setXid(event.xidData().getXid()); replicationLag = System.currentTimeMillis() - event.getEvent().getHeader().getTimestamp(); if ( !buffer.isEmpty() ) buffer.getLast().setTXCommit(); return buffer; } } }
Source:
<code>private DocumentCollection getMultiPartitionCollectionDefinition() { DocumentCollection collectionDefinition = new DocumentCollection(); collectionDefinition.setId(UUID.randomUUID().toString()); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition(); List<String> paths = new ArrayList<>(); paths.add("/city"); partitionKeyDefinition.setPaths(paths); collectionDefinition.setPartitionKey(partitionKeyDefinition); IndexingPolicy indexingPolicy = new IndexingPolicy(); List<IncludedPath> includedPaths = new ArrayList<>(); IncludedPath includedPath = new IncludedPath("/*"); List<Index> indexes = new ArrayList<>(); indexes.add(Index.range(DataType.STRING, -1)); indexes.add(Index.range(DataType.NUMBER, -1)); <START> ModelBridgeInternal.setIncludedPathIndexes(includedPath, indexes); <END> includedPaths.add(includedPath); indexingPolicy.setIncludedPaths(includedPaths); collectionDefinition.setIndexingPolicy(indexingPolicy); return collectionDefinition; }</code><technical_language>change this. this is in examples module, *BridgeInternal classes here. please check if un-intentionally this change in other public surface area (examples sub-module)</technical_language>

Target:
private DocumentCollection getMultiPartitionCollectionDefinition() { DocumentCollection collectionDefinition = new DocumentCollection(); collectionDefinition.setId(UUID.randomUUID().toString()); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition(); List<String> paths = new ArrayList<>(); paths.add("/city"); partitionKeyDefinition.setPaths(paths); collectionDefinition.setPartitionKey(partitionKeyDefinition); IndexingPolicy indexingPolicy = new IndexingPolicy(); List<IncludedPath> includedPaths = new ArrayList<>(); IncludedPath includedPath = new IncludedPath("/*"); includedPaths.add(includedPath); indexingPolicy.setIncludedPaths(includedPaths); collectionDefinition.setIndexingPolicy(indexingPolicy); return collectionDefinition; }
Source:
<code>LamiReportViewTabPage getCurrentSelectedPage() { CTabFolder tf = fTabFolder; if (tf == null) { return null; } int idx = tf.getSelectionIndex(); <START> if(idx != -1) { <END> return fTabPages.get(idx); } return null; }</code><technical_language>spaces</technical_language>

Target:
@Nullable LamiReportViewTabPage getCurrentSelectedPage() { CTabFolder tf = fTabFolder; if (tf == null) { return null; } int idx = tf.getSelectionIndex(); if (idx != -1) { return fTabPages.get(idx); } return null; }
Source:
<code><START> public static Flux<ByteBuffer> convertStreamToByteBuffer (InputStream data, long length, int blockSize ) { <END> return Flux.range(0, (int) Math.ceil((double) length / (double) blockSize)) .map(i -> i * blockSize) .concatMap(pos -> Mono.fromCallable(() -> { long count = pos + blockSize > length ? length - pos : blockSize; byte[] cache = new byte[(int) count]; if (data.available() > count) { throw new UnexpectedLengthException( String.format("Request body emitted more bytes than the expected %d bytes.", length), count, length); } int lastIndex = data.read(cache); if (lastIndex != -1 && lastIndex < count) { throw new UnexpectedLengthException( String.format("Request body emitted less bytes than the expected %d bytes.", length), count, length); } return ByteBuffer.wrap(cache); })); }</code><technical_language>Mind fixing space parentheses</technical_language>

Target:
public static Flux<ByteBuffer> convertStreamToByteBuffer(InputStream data, long length, int blockSize) { final long[] currentTotalLength = new long[1]; return Flux.range(0, (int) Math.ceil((double) length / (double) blockSize)) .map(i -> i * blockSize) .concatMap(pos -> Mono.fromCallable(() -> { long count = pos + blockSize > length ? length - pos : blockSize; byte[] cache = new byte[(int) count]; int lastIndex = data.read(cache); currentTotalLength[0] += lastIndex; if (currentTotalLength[0] < count) { throw LOGGER.logExceptionAsError(new UnexpectedLengthException( String.format("Request body emitted %d bytes less than the expected %d bytes.", currentTotalLength[0], length), currentTotalLength[0], length)); } return ByteBuffer.wrap(cache); })) .doOnComplete(() -> { try { if (data.available() > 0) { Long totalLength = currentTotalLength[0] + data.available(); throw LOGGER.logExceptionAsError(new UnexpectedLengthException( String.format("Request body emitted %d bytes more than the expected %d bytes.", totalLength, length), totalLength, length)); } } catch (IOException e) { throw LOGGER.logExceptionAsError(new RuntimeException("I/O errors occurs. Error deatils: " + e.getMessage())); } }); }
Source:
<code>void set(ChangeInfo info, final String revision) { if (info.status().isClosed()) { setVisible(false); return; } project = info.project(); ChangeApi.revision(info.legacy_id().get(), revision) .view("related") .get(new AsyncCallback<RelatedInfo>() { @Override public void onSuccess(RelatedInfo result) { tabPanel.getTabBar().setTabText(0, Resources.M.relatedChanges(result.changes().length())); render(revision, result.changes()); } @Override public void onFailure(Throwable err) { <START> tabPanel.getTabBar().setTabText(0, Resources.M.relatedChanges("na")); <END> progress.setVisible(false); scroll.setVisible(false); UIObject.setVisible(error, true); error.setInnerText(err.getMessage()); } }); }</code><technical_language>"N/A" "None"</technical_language>

Target:
void set(ChangeInfo info, final String revision) { if (info.status().isClosed()) { setVisible(false); return; } project = info.project(); ChangeApi.revision(info.legacy_id().get(), revision) .view("related") .get(new AsyncCallback<RelatedInfo>() { @Override public void onSuccess(RelatedInfo result) { tabPanel.getTabBar().setTabText(0, Resources.M.relatedChanges(result.changes().length())); render(revision, result.changes()); } @Override public void onFailure(Throwable err) { tabPanel.getTabBar().setTabText(0, Resources.M.relatedChanges(Resources.C.notAvailable())); progress.setVisible(false); scroll.setVisible(false); UIObject.setVisible(error, true); error.setInnerText(err.getMessage()); } }); }
Source:
<code>public OpticalMicroscopeTileEntity() { <START> super(0); <END> }</code><technical_language>optical microscope inventory slot (for item examined), (second for a light filter some sort of attachment). For change this 1</technical_language>

Target:
public OpticalMicroscopeTileEntity() { super(1); }
Source:
<code>public void show(final Activity activity){ final ScrollView scrollView = new ScrollView(activity); final AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle(R.string.master_password_dialog_title); builder.setView(scrollView); builder.setPositiveButton(R.string.okay_action, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String password = mPasswordView.getText().toString(); <START> if (password == K9.getMasterPassword()) { <END> dialog.dismiss(); mLastActive = currentTimeMillis(); return; } mPasswordView.setText(""); } } ); mDialog = builder.create(); View layout = mDialog.getLayoutInflater().inflate(R.layout.master_password_prompt,scrollView); TextView intro = (TextView) layout.findViewById(R.id.master_password_prompt_intro); intro.setText(R.string.master_password_prompt_intro); TextView prompt = (TextView) layout.findViewById(R.id.master_password_prompt); prompt.setText(R.string.master_password_prompt); mPasswordView = (EditText) layout.findViewById(R.id.master_password_input); mPasswordView.addTextChangedListener(this); mDialog.setCancelable(false); mDialog.show(); }</code><technical_language>String comparison ==</technical_language>

Target:
public void show(final Activity activity){ final ScrollView scrollView = new ScrollView(activity); final AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle(R.string.master_password_dialog_title); builder.setView(scrollView); builder.setPositiveButton(R.string.okay_action, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String password = mPasswordView.getText().toString(); if (hash(password).equals(K9.getMasterPassword())) { dialog.dismiss(); mLastActive = currentTimeMillis(); return; } mPasswordView.setText(""); show(activity); } } ); mDialog = builder.create(); View layout = mDialog.getLayoutInflater().inflate(R.layout.master_password_prompt,scrollView); TextView intro = (TextView) layout.findViewById(R.id.master_password_prompt_intro); intro.setText(R.string.master_password_prompt_intro); TextView prompt = (TextView) layout.findViewById(R.id.master_password_prompt); prompt.setText(R.string.master_password_prompt); mPasswordView = (EditText) layout.findViewById(R.id.master_password_input); mPasswordView.addTextChangedListener(this); mDialog.setCancelable(false); mDialog.show(); }
Source:
<code>private Method getConditionMethod(Class<?> clazz) { for (Method checkMethod : clazz.getMethods()) { if (checkMethod.getName().equals("getCondition") && (checkMethod.getModifiers() & Modifier.STATIC) <START> != Modifier.STATIC <END> && checkParameterTypes(checkMethod.getParameterTypes())) { return checkMethod; } } return null; }</code><technical_language>for a static method here, this == check</technical_language>

Target:
private Method getConditionMethod(Class<?> clazz) { for (Method checkMethod : clazz.getMethods()) { if (checkMethod.getName().equals("getCondition") && (checkMethod.getModifiers() & Modifier.STATIC) == Modifier.STATIC && checkParameterTypes(checkMethod.getParameterTypes())) { return checkMethod; } } return null; }
Source:
<code>protected void loadProperties(Properties props) throws IOException { try { super.loadProperties(props); } catch(FileNotFoundException e) { if (configFile != null && copyOutTemplate) { OutputStream fout = configFile.out(); props.store(fout, comments); fout.flush(); <START> fout.close(); <END> } } }</code><technical_language>@NielsCharlier fix resource leak a try-with-resources block</technical_language>

Target:
protected void loadProperties(Properties props) throws IOException { try { super.loadProperties(props); } catch(FileNotFoundException e) { if (configFile != null && copyOutTemplate) { try (OutputStream fout = configFile.out()) { props.store(fout, comments); fout.flush(); } } } }
Source:
<code>protected void configureCopyCommand(final String source, final String destination) { command = new LocalCopyFileCommand(); <START> ((LocalCopyFileCommand) command).setConfiguration(source, destination); <END> }</code><technical_language>Type casting again</technical_language>

Target:
protected void configureCopyCommand(final String source, final String destination) { LocalCopyFileCommand cmd = new LocalCopyFileCommand(); cmd.setConfiguration(source, destination); command.set(cmd); }
Source:
<code>public void testSHGetKnownFolderPath() { int flags = ShlObj.KNOWN_FOLDER_FLAG.NONE.getFlag(); PointerByReference outPath = new PointerByReference(); HANDLE token = null; GUID guid = KnownFolders.FOLDERID_Fonts; HRESULT hr = Shell32.INSTANCE.SHGetKnownFolderPath(guid, flags, token, outPath); <START> Ole32.INSTANCE.CoTaskMemFree(new LPVOID(outPath.getPointer().getLong(0))); <END> assertTrue(W32Errors.SUCCEEDED(hr.intValue())); }</code><technical_language>declaring a CoTaskMemFree takes Pointer work itself? JNA marshal appropriately. I declare another version of CoTaskMemFree takes a Pointer, wrapping LPVOID one</technical_language>

Target:
public void testSHGetKnownFolderPath() { int flags = ShlObj.KNOWN_FOLDER_FLAG.NONE.getFlag(); PointerByReference outPath = new PointerByReference(); HANDLE token = null; GUID guid = KnownFolders.FOLDERID_Fonts; HRESULT hr = Shell32.INSTANCE.SHGetKnownFolderPath(guid, flags, token, outPath); Ole32.INSTANCE.CoTaskMemFree(outPath.getValue()); assertTrue(W32Errors.SUCCEEDED(hr.intValue())); }
Source:
<code>public void testQueryTaskByVariables() { <START> Map<String, Object> variables = Collections.<String, Object> singletonMap("task_in_a1", "a0"); Map<String, Object> attributes = Collections.<String, Object> singletonMap("deploymentId", "org.jbpm.test:test-module:1.0.0"); <END> List<String> potOwners = emptyList(); List<UserTaskInstanceWithPotOwnerDesc> data = advanceVariableDataService.queryUserTasksByVariables(attributes, variables, emptyMap(), potOwners, new QueryContext()); Assert.assertEquals(4, data.size()); for (UserTaskInstanceWithPotOwnerDesc p : data) { Assert.assertEquals("a0", p.getInputdata().get("task_in_a1")); Assert.assertEquals("org.jbpm.test:test-module:1.0.0", p.getDeploymentId()); } }</code><technical_language>Collections.<String, Object> singletonMap replaced Collections.singletonMap</technical_language>

Target:
public void testQueryTaskByVariables() { List<QueryParam> variables = list(equalsTo("task_in_a1", "a0")); List<QueryParam> attributes = list(equalsTo(PROCESS_ATTR_DEPLOYMENT_ID, "org.jbpm.test:test-module:1.0.0")); List<String> potOwners = emptyList(); List<UserTaskInstanceWithPotOwnerDesc> data = advanceVariableDataService.queryUserTasksByVariables(attributes, variables, emptyList(), potOwners, queryContext); if (queryContext.getCount() > 0) { Assert.assertThat(data.size(), is(queryContext.getCount())); } for (UserTaskInstanceWithPotOwnerDesc p : data) { Assert.assertEquals("a0", p.getInputdata().get("task_in_a1")); Assert.assertEquals("org.jbpm.test:test-module:1.0.0", p.getDeploymentId()); } }
Source:
<code>public void shouldQueryForObservationByPatientIdAndConceptId() throws Exception { String patientId = "OOO"; String conceptId = "CCC"; URI url = config.toInstancePathWithParams("/obs?patient={patientUUID}&concept={conceptUUID}&limit=1", patientId, conceptId); when(restOperations.exchange(eq(url), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class))) .thenReturn(getResponseFromFile(OBSERVATION_QUERY_RESPONSE_JSON)); ObservationListResult result = observationResource.getObservationByPatientUUIDAndConceptUUID(config, patientId, conceptId); verify(restOperations).exchange(eq(url), eq(HttpMethod.GET), requestCaptor.capture(), eq(String.class)); assertThat(result, equalTo(readFromFile(OBSERVATION_QUERY_RESPONSE_JSON, ObservationListResult.class))); assertThat(requestCaptor.getValue().getHeaders(), equalTo(getHeadersForGet(config))); <START> assertThat(requestCaptor.getValue().getBody(), nullValue()); <END> }</code><technical_language>please remove this assert, I other tests this line, this check doesnt sense</technical_language>

Target:
public void shouldQueryForObservationByPatientIdAndConceptId() throws Exception { String patientId = "OOO"; String conceptId = "CCC"; URI url = config.toInstancePathWithParams("/obs?patient={patientUUID}&concept={conceptUUID}&limit=1", patientId, conceptId); when(restOperations.exchange(eq(url), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class))) .thenReturn(getResponseFromFile(OBSERVATION_QUERY_RESPONSE_JSON)); ObservationListResult result = observationResource.getObservationByPatientUUIDAndConceptUUID(config, patientId, conceptId); verify(restOperations).exchange(eq(url), eq(HttpMethod.GET), requestCaptor.capture(), eq(String.class)); assertThat(result, equalTo(readFromFile(OBSERVATION_QUERY_RESPONSE_JSON, ObservationListResult.class))); assertThat(requestCaptor.getValue().getHeaders(), equalTo(getHeadersForGet(config))); }
Source:
<code><START> public void verifyNoAsyncErrors() { <END> try { Thread.sleep(defaultTimeoutMillis()); verifyNoAsyncErrorsNoDelay(); } catch (InterruptedException e) { throw new RuntimeException(e); } }</code><technical_language>this call verifyNoAsyncErrors(defaultTimeoutMillis())</technical_language>

Target:
public void verifyNoAsyncErrors() { verifyNoAsyncErrors(defaultTimeoutMillis()); }
Source:
<code>public static Type getTypeOfVal(String val) { Type type = null; Type[] types = Type.values(); <START> for (int i = 0; i < Type.STRING.ordinal(); i++) { <END> final Class clazz = types[i].getJavaType(); try { clazz.getMethod("valueOf", String.class).invoke(null, val); type = types[i]; break; } catch (Exception e) { } } if (type == null) { type = Type.STRING; } return type; }</code><technical_language>@hmcl I issue pointed out is loop types for request? . Is this for queryparams? find type in other cases too? . If query params safe assume values string int</technical_language>

Target:
public static Type getTypeOfVal(String val) { Type type = null; Type[] types = Type.values(); if (val.equalsIgnoreCase("true") || val.equalsIgnoreCase("false")) { type = BOOLEAN; } for (int i = 1; type == null && i < STRING.ordinal(); i++) { final Class clazz = types[i].getJavaType(); try { Object result = clazz.getMethod("valueOf", String.class).invoke(null, val); if (!(result instanceof Float) || !((Float) result).isInfinite()) { type = types[i]; break; } } catch (Exception e) { } } if (type == null) { type = STRING; } return type; }
Source:
<code>public void init(ImportContext context, boolean prepData) throws IOException { context.reattach(catalog); try { ImportData data = context.getData(); if (data != null) { if (data instanceof RemoteData) { data = ((RemoteData) data).resolve(this); context.setData(data); } addTasks(context, data, prepData); } if (context.getState() == ImportContext.State.INIT) { context.setState(ImportContext.State.PENDING); } } catch (Exception e) { <START> LOGGER.log(Level.SEVERE, "Failed to resolve remote data", e); <END> if (context.getState() == ImportContext.State.INIT) { context.setState(ImportContext.State.COMPLETE); } return; } }</code><technical_language>If a REST import (for example), is of viewing capturing this error? stands, is (without GeoServer logs) of telling difference empty remote directory error - result in a completed import tasks/layers. error field included in import context, similar tasks</technical_language>

Target:
public void init(ImportContext context, boolean prepData) throws IOException { context.reattach(catalog); try { ImportData data = context.getData(); if (data != null) { if (data instanceof RemoteData) { data = ((RemoteData) data).resolve(this); context.setData(data); } addTasks(context, data, prepData); } context.setState(ImportContext.State.PENDING); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to init the context ", e); context.setState(ImportContext.State.INIT_ERROR); context.setMessage(e.getMessage()); return; } }
Source:
<code>protected PersistableNetworkPayload putIfAbsent(P2PDataStorage.ByteArray hash, PersistableNetworkPayload payload) { <START> if (getMap().containsKey(hash)) <END> return null; PersistableNetworkPayload previous = store.getMap().putIfAbsent(hash, payload); persist(); return previous; }</code><technical_language>excessive persist if written, I notice MapStoreService does</technical_language>

Target:
protected PersistableNetworkPayload putIfAbsent(P2PDataStorage.ByteArray hash, PersistableNetworkPayload payload) { if (getMap().containsKey(hash)) return null; PersistableNetworkPayload previous = store.getMap().put(hash, payload); persist(); return previous; }
Source:
<code>private static boolean anyFile(IResource[] memebers) { for (IResource member : memebers) { if (member.getType() == IResource.FILE) return true; else if (member.getType() == IResource.FOLDER) <START> return hasContainerAnyFiles(member); <END> } return false; }</code><technical_language>This returns early. this: if (member.getType() == IResource.FOLDER && hasContainerAnyFiles(member)) return true;</technical_language>

Target:
private static boolean anyFile(IResource[] memebers) { for (IResource member : memebers) { if (member.getType() == IResource.FILE) return true; else if (member.getType() == IResource.FOLDER) if (hasContainerAnyFiles(member)) return true; } return false; }
Source:
<code>private void initializeScanners() { Assert.isTrue(isNewSetup()); boolean isModuleInfoEditor= false; IEditorSite editorSite= <START> fTextEditor.getEditorSite(); <END> if (editorSite != null && editorSite.getId().equals(JavaUI.ID_MODULE_INFO_EDITOR)) { isModuleInfoEditor= true; } fCodeScanner= new JavaCodeScanner(getColorManager(), fPreferenceStore, isModuleInfoEditor); fMultilineCommentScanner= new JavaCommentScanner(getColorManager(), fPreferenceStore, IJavaColorConstants.JAVA_MULTI_LINE_COMMENT); fSinglelineCommentScanner= new JavaCommentScanner(getColorManager(), fPreferenceStore, IJavaColorConstants.JAVA_SINGLE_LINE_COMMENT); fStringScanner= new SingleTokenJavaScanner(getColorManager(), fPreferenceStore, IJavaColorConstants.JAVA_STRING); fJavaDocScanner= new JavaDocScanner(getColorManager(), fPreferenceStore); }</code><technical_language>This 'null'</technical_language>

Target:
private void initializeScanners() { Assert.isTrue(isNewSetup()); boolean isModuleInfoEditor= false; if (fTextEditor != null && JavaUI.ID_MODULE_INFO_EDITOR.equals(fTextEditor.getEditorSite().getId())) { isModuleInfoEditor= true; } fCodeScanner= new JavaCodeScanner(getColorManager(), fPreferenceStore, isModuleInfoEditor); fMultilineCommentScanner= new JavaCommentScanner(getColorManager(), fPreferenceStore, IJavaColorConstants.JAVA_MULTI_LINE_COMMENT); fSinglelineCommentScanner= new JavaCommentScanner(getColorManager(), fPreferenceStore, IJavaColorConstants.JAVA_SINGLE_LINE_COMMENT); fStringScanner= new SingleTokenJavaScanner(getColorManager(), fPreferenceStore, IJavaColorConstants.JAVA_STRING); fJavaDocScanner= new JavaDocScanner(getColorManager(), fPreferenceStore); }