auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean uploadDependencyToBlobStore(String key, File dependency) throws KeyAlreadyExistsException, AuthorizationException, IOException { boolean uploadNew = false; try { getBlobStore().getBlobMeta(key); } catch (KeyNotFoundException e) { List<AccessControl> acls = new ArrayList<>(); acls.add(new AccessControl(AccessControlType.USER, BlobStoreAclHandler.READ | BlobStoreAclHandler.WRITE | BlobStoreAclHandler.ADMIN)); acls.add(new AccessControl(AccessControlType.OTHER, BlobStoreAclHandler.READ)); AtomicOutputStream blob = null; try { blob = getBlobStore().createBlob(key, new SettableBlobMeta(acls)); Files.copy(dependency.toPath(), blob); blob.close(); uploadNew = true; <START> } finally { <END> try { if (blob != null) { blob.cancel(); } } catch (IOException throwaway) { } } } return uploadNew; }</code><technical_language>call blob = null prevent a dupe cancel close</technical_language>

Target:
private boolean uploadDependencyToBlobStore(String key, File dependency) throws KeyAlreadyExistsException, AuthorizationException, IOException { boolean uploadNew = false; try { getBlobStore().getBlobMeta(key); } catch (KeyNotFoundException e) { List<AccessControl> acls = new ArrayList<>(); acls.add(new AccessControl(AccessControlType.USER, BlobStoreAclHandler.READ | BlobStoreAclHandler.WRITE | BlobStoreAclHandler.ADMIN)); acls.add(new AccessControl(AccessControlType.OTHER, BlobStoreAclHandler.READ)); AtomicOutputStream blob = null; try { blob = getBlobStore().createBlob(key, new SettableBlobMeta(acls)); Files.copy(dependency.toPath(), blob); blob.close(); blob = null; uploadNew = true; } finally { try { if (blob != null) { blob.cancel(); } } catch (IOException throwaway) { } } } return uploadNew; }
Source:
<code><START> GreetInfo( String <END> m, String c, String h) { country = c; message = m; href = h; }</code><technical_language>space (</technical_language>

Target:
GreetInfo(String m, String c, String h) { message = m; country = c; href = h; }
Source:
<code>public boolean uploadIfNotExists(BlobId blobId, long inputLength, CloudBlobMetadata cloudBlobMetadata, InputStream blobInputStream) throws BlobStorageException, IOException { BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setIfNoneMatch("*"); azureMetrics.blobUploadRequestCount.inc(); Timer.Context storageTimer = azureMetrics.blobUploadTime.time(); try { BlockBlobClient blobClient = getAzureBlobReference(blobId, true); cloudBlobMetadata.setCloudBlobName(getAzureBlobName(blobId)); Map<String, String> metadata = getMetadataMap(cloudBlobMetadata); <START> Response<BlockBlobItem> response = <END> blobClient.uploadWithResponse(blobInputStream, inputLength, null, metadata, null, null, blobRequestConditions, null, Context.NONE); logger.debug("Uploaded blob to ABS", blobId); azureMetrics.blobUploadSuccessCount.inc(); return true; } catch (UncheckedIOException e) { throw e.getCause(); } catch (BlobStorageException e) { if (e.getErrorCode() == BlobErrorCode.BLOB_ALREADY_EXISTS) { logger.debug("Skipped upload of existing blob {}", blobId); azureMetrics.blobUploadConflictCount.inc(); return false; } else { throw e; } } finally { storageTimer.stop(); } }</code><technical_language>Minor: need set response here. arent anywhere</technical_language>

Target:
public boolean uploadIfNotExists(BlobId blobId, long inputLength, CloudBlobMetadata cloudBlobMetadata, InputStream blobInputStream) throws BlobStorageException, IOException { BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setIfNoneMatch("*"); azureMetrics.blobUploadRequestCount.inc(); Timer.Context storageTimer = azureMetrics.blobUploadTime.time(); try { BlockBlobClient blobClient = getAzureBlobReference(blobId, true); cloudBlobMetadata.setCloudBlobName(getAzureBlobName(blobId)); Map<String, String> metadata = getMetadataMap(cloudBlobMetadata); blobClient.uploadWithResponse(blobInputStream, inputLength, null, metadata, null, null, blobRequestConditions, null, Context.NONE); logger.debug("Uploaded blob to ABS", blobId); azureMetrics.blobUploadSuccessCount.inc(); return true; } catch (UncheckedIOException e) { throw e.getCause(); } catch (BlobStorageException e) { if (e.getErrorCode() == BlobErrorCode.BLOB_ALREADY_EXISTS) { logger.debug("Skipped upload of existing blob {}", blobId); azureMetrics.blobUploadConflictCount.inc(); return false; } else { throw e; } } finally { storageTimer.stop(); } }
Source:
<code>protected boolean canDoAction() { final ClusterValidator validator = new ClusterValidator(getDbFacade(), getVdsGroup()); if (!validateClusterPolicy()) { return false; <START> } <END> return validate(validator.nameNotUsed()) && validate(validator.cpuTypeSupportsVirtService()) && validate(validator.versionSupported()) && validate(validator.dataCenterVersionMismatch()) && validate(validator.dataCenterExists()) && validate(validator.localStoragePoolAttachedToSingleCluster()) && validate(validator.qosBaloonSupported()) && validate(validator.glusterServiceSupported()) && validate(validator.clusterServiceDefined()) && validate(validator.mixedClusterServicesSupported()) && validate(validator.attestationServerConfigured()) && validate(validator.migrationSupported(getArchitecture())) && validate(validator.virtIoRngSupported()); }</code><technical_language>for sake of comparability, this validation added end</technical_language>

Target:
protected boolean canDoAction() { if (!validateClusterPolicy()) { return false; } final ClusterValidator validator = new ClusterValidator(getDbFacade(), getVdsGroup()); return validate(validator.nameNotUsed()) && validate(validator.cpuTypeSupportsVirtService()) && validate(validator.versionSupported()) && validate(validator.dataCenterVersionMismatch()) && validate(validator.dataCenterExists()) && validate(validator.localStoragePoolAttachedToSingleCluster()) && validate(validator.qosBaloonSupported()) && validate(validator.glusterServiceSupported()) && validate(validator.clusterServiceDefined()) && validate(validator.mixedClusterServicesSupported()) && validate(validator.attestationServerConfigured()) && validate(validator.migrationSupported(getArchitecture())) && validate(validator.virtIoRngSupported()); }
Source:
<code>public Object run() { RequestContext context = RequestContext.getCurrentContext(); HttpServletRequest request = context.getRequest(); if(context.get("warning") != null){ <START> System.out.printf("should not stop here"); <END> } MultiValueMap<String, String> headers = this.helper .buildZuulRequestHeaders(request); MultiValueMap<String, String> params = this.helper .buildZuulRequestQueryParams(request); String verb = getVerb(request); InputStream requestEntity = getRequestBody(request); if (request.getContentLength() < 0) { context.setChunkedRequestBody(); } String uri = this.helper.buildZuulRequestURI(request); this.helper.addIgnoredHeaders(); try { HttpResponse response = forward(this.httpClient, verb, uri, request, headers, params, requestEntity); setResponse(response); } catch (Exception ex) { context.set("error.status_code", HttpServletResponse.SC_INTERNAL_SERVER_ERROR); context.set("error.exception", ex); } return null; }</code><technical_language>logging</technical_language>

Target:
public Object run() { RequestContext context = RequestContext.getCurrentContext(); HttpServletRequest request = context.getRequest(); if(context.get("warning") != null){ log.info("should not stop here"); } MultiValueMap<String, String> headers = this.helper .buildZuulRequestHeaders(request); MultiValueMap<String, String> params = this.helper .buildZuulRequestQueryParams(request); String verb = getVerb(request); InputStream requestEntity = getRequestBody(request); if (request.getContentLength() < 0) { context.setChunkedRequestBody(); } String uri = this.helper.buildZuulRequestURI(request); this.helper.addIgnoredHeaders(); try { HttpResponse response = forward(this.httpClient, verb, uri, request, headers, params, requestEntity); setResponse(response); } catch (Exception ex) { context.set("error.status_code", HttpServletResponse.SC_INTERNAL_SERVER_ERROR); context.set("error.exception", ex); } return null; }
Source:
<code>public void addInput(Page page) { requireNonNull(page, "page is null"); if (page.getPositionCount() == 0) { return; } page = pagePreprocessor.apply(page); pagePartitioner.partitionPage(page); <START> System.out.println(pagePartitioner.getRetainedSizeInBytes()); <END> operatorContext.recordOutput(page.getSizeInBytes(), page.getPositionCount()); systemMemoryContext.setBytes(pagePartitioner.getRetainedSizeInBytes()); }</code><technical_language>Debugging? Remove</technical_language>

Target:
public void addInput(Page page) { requireNonNull(page, "page is null"); if (page.getPositionCount() == 0) { return; } page = pagePreprocessor.apply(page); pagePartitioner.partitionPage(page); operatorContext.recordOutput(page.getSizeInBytes(), page.getPositionCount()); systemMemoryContext.setBytes(pagePartitioner.getRetainedSizeInBytes()); }
Source:
<code><START> public ResourceTable updateEntity(RequestDetails theRequest, IBaseResource theResource, IBasePersistedResource theEntity, Date theDeletedTimestampOrNull, boolean thePerformIndexing, <END> boolean theUpdateVersion, TransactionDetails theTransactionDetails, boolean theForceUpdate, boolean theCreateNewHistoryEntry) { ResourceTable retVal = super.updateEntity(theRequest, theResource, theEntity, theDeletedTimestampOrNull, thePerformIndexing, theUpdateVersion, theTransactionDetails, theForceUpdate, theCreateNewHistoryEntry); if (!retVal.isUnchangedInCurrentOperation()) { if (retVal.getDeleted() == null) { Observation observation = (Observation) theResource; myObservationLastNIndexPersistSvc.indexObservation(observation); } else { myObservationLastNIndexPersistSvc.deleteObservationIndex(theEntity); } } return retVal; }</code><technical_language>spaces IbasePersistedResource theEntity</technical_language>

Target:
public ResourceTable updateEntity(RequestDetails theRequest, IBaseResource theResource, IBasePersistedResource theEntity, Date theDeletedTimestampOrNull, boolean thePerformIndexing, boolean theUpdateVersion, TransactionDetails theTransactionDetails, boolean theForceUpdate, boolean theCreateNewHistoryEntry) { return updateObservationEntity(theRequest, theResource, theEntity, theDeletedTimestampOrNull, thePerformIndexing, theUpdateVersion, theTransactionDetails, theForceUpdate, theCreateNewHistoryEntry); }
Source:
<code>private void writeStreamToFile(ByteArrayOutputStream bos, String filename, byte[] key) throws IOException { DataOutputStream fileOutputStream = null; try { fileOutputStream = getOutputFileStream(filename, key); bos.writeTo(fileOutputStream); } finally { if (fileOutputStream != null) { <START> fileOutputStream.close(); <END> } } }</code><technical_language>guess is wrap this in IOException wrapper, generally swallow stream close IOExceptions. (The method signature is eating right now)</technical_language>

Target:
private void writeStreamToFile(ByteArrayOutputStream bos, String filename, byte[] key) throws IOException { DataOutputStream fileOutputStream = null; try { fileOutputStream = getOutputFileStream(filename, key); bos.writeTo(fileOutputStream); } finally { if (fileOutputStream != null) { try { fileOutputStream.close(); } catch (IOException e) { e.printStackTrace(); } } } }
Source:
<code>private void applyModeCustomizations() { if (ApplicationModeHelper.getUiMode() == ApplicationMode.GlusterOnly) { optimizationTab.setVisible(false); resiliencePolicyTab.setVisible(false); <START> clusterPolicyTab.setVisible(true); <END> dataCenterPanel.addStyleName(style.generalTabTopDecoratorEmpty()); } }</code><technical_language>please policy tab hidden in Gluster mode</technical_language>

Target:
private void applyModeCustomizations() { if (ApplicationModeHelper.getUiMode() == ApplicationMode.GlusterOnly) { optimizationTab.setVisible(false); resiliencePolicyTab.setVisible(false); clusterPolicyTab.setVisible(false); dataCenterPanel.addStyleName(style.generalTabTopDecoratorEmpty()); } }
Source:
<code><START> PRED_change_topic_1(Term a1, Operation n) { <END> arg1 = a1; cont = n; }</code><technical_language>public</technical_language>

Target:
public PRED_change_topic_1(Term a1, Operation n) { arg1 = a1; cont = n; }
Source:
<code><START> public RetryCacheMetrics(RetryCache retryCache) { <END> name = "RetryCache."+ retryCache.getCacheName(); registry = new MetricsRegistry(name); if (LOG.isDebugEnabled()) { LOG.debug("Initialized "+ registry); } }</code><technical_language>this need public</technical_language>

Target:
RetryCacheMetrics(RetryCache retryCache) { name = "RetryCache."+ retryCache.getCacheName(); registry = new MetricsRegistry(name); if (LOG.isDebugEnabled()) { LOG.debug("Initialized "+ registry); } }
Source:
<code><START> @Nullable public String getComment() { <END> return comment; }</code><technical_language>put this function other field declarations? This a messy</technical_language>

Target:
@NonNull public String getComment() { return StringUtils.defaultString(comment); }
Source:
<code>public Object readChunk( ByteBufAllocator allocator ) throws Exception { assert !endOfInput; if ( pending != null ) { if ( noMoreTransactions ) { endOfInput = true; } return consumePending(); } else if ( noMoreTransactions ) { throw new IllegalStateException(); } else if ( txCursor.next() ) { assert pending == null; CommittedTransactionRepresentation tx = txCursor.get(); lastTxId = tx.getCommitEntry().getTxId(); if ( lastTxId != expectedTxId ) { <START> throw new IllegalStateException( "Transaction cursor out of order." ); <END> } expectedTxId++; pending = new TxPullResponse( storeId, tx ); return ResponseMessageType.TX; } else { assert pending == null; noMoreTransactions = true; protocol.expect( CatchupServerProtocol.State.MESSAGE_TYPE ); pending = new TxStreamFinishedResponse( SUCCESS_END_OF_STREAM, lastTxId ); return ResponseMessageType.TX_STREAM_FINISHED; } }</code><technical_language>worth providing expected actual values of transaction cursor debugging logs</technical_language>

Target:
public Object readChunk( ByteBufAllocator allocator ) throws Exception { assert !endOfInput; if ( pending != null ) { if ( noMoreTransactions ) { endOfInput = true; } return consumePending(); } else if ( noMoreTransactions ) { throw new IllegalStateException(); } else if ( txCursor.next() ) { assert pending == null; CommittedTransactionRepresentation tx = txCursor.get(); lastTxId = tx.getCommitEntry().getTxId(); if ( lastTxId != expectedTxId ) { String msg = format( "Transaction cursor out of order. Expected %d but was %d", expectedTxId, lastTxId ); throw new IllegalStateException( msg ); } expectedTxId++; pending = new TxPullResponse( storeId, tx ); return ResponseMessageType.TX; } else { assert pending == null; noMoreTransactions = true; protocol.expect( CatchupServerProtocol.State.MESSAGE_TYPE ); pending = new TxStreamFinishedResponse( SUCCESS_END_OF_STREAM, lastTxId ); return ResponseMessageType.TX_STREAM_FINISHED; } }
Source:
<code>private ValidationResult validateDuplicatesConfiguration() { try { TransactionSupport.executeInNewTransaction( (TransactionMethod<Void>) () -> { <START> macPoolPerCluster.testCreateMacPool(getParameters().getMacPool()); <END> return null; } ); } catch (Exception e) { if (e.getCause() instanceof EngineException) { e = (EngineException) e.getCause(); } if (e.getMessage() != null && e.getMessage().contains(UNABLE_TO_INITIALIZE_MAC_POOL_DUE_TO_EXISTING_DUPLICATES)) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_MAC_POOL_CONTAINS_DUPLICATES); } } return ValidationResult.VALID; }</code><technical_language>This creates unexpected log info messages in engine.log 2018-03-21 18:07:09,220+01 INFO [org.ovirt.engine.core.bll.network.macpool.MacPoolUsingRanges] (default task-18) [0aa4cf84-1290-4f83-bb09-51e5fbc70140] Initializing MacPoolUsingRanges:{id='c6ad4c07-5959-41e2-9582-be116092fd6d'} 2018-03-21 18:07:09,220+01 INFO [org.ovirt.engine.core.bll.network.macpool.MacPoolUsingRanges] (default task-18) [0aa4cf84-1290-4f83-bb09-51e5fbc70140] Finished initializing MacPoolUsingRanges:{id='c6ad4c07-5959-41e2-9582-be116092fd6d'}. MACs in pool: 252</technical_language>

Target:
private ValidationResult validateDuplicatesConfiguration() { return TransactionSupport.executeInNewTransaction( () -> ValidationResult.failWith(EngineMessage.ACTION_TYPE_FAILED_MAC_POOL_CONTAINS_DUPLICATES) .when(macPoolPerCluster.containsForbiddenDuplicates(getParameters().getMacPool())) ); }
Source:
<code>protected Map<Integer, ResolvedDbType> getLobFieldsDataTypeInfo(String typeName) throws SQLException { if(this.resolvedDbTypesCache.containsKey(typeName)){ if(logger.isDebugEnabled()) { logger.info("Returning chached LobFieldsDataTypeInfo"); } return resolvedDbTypesCache.get(typeName); } if(logger.isDebugEnabled()){ logger.info("Obtaining LobFieldsDataTypeInfo"); } <START> synchronized (this){ <END> if(this.resolvedDbTypesCache.containsKey(typeName)){ return resolvedDbTypesCache.get(typeName); } Map<Integer, ResolvedDbType> dataTypes = new HashMap<>(); String owner = getOwnerFrom(typeName); String type = getTypeSimpleName(typeName); String query = QUERY_TYPE_ATTRS + (owner != null ? QUERY_OWNER_CONDITION : ""); try (PreparedStatement ps = this.prepareStatement(query)) { ps.setString(1, type); if (owner != null) { ps.setString(2, owner); } try (ResultSet resultSet = ps.executeQuery()) { while (resultSet.next()) { ResolvedDbType resolvedDbType = new ResolvedDbType(UNKNOWN_DATA_TYPE, resultSet.getString(ATTR_TYPE_NAME_PARAM)); dataTypes.put(resultSet.getInt(ATTR_NO_PARAM), resolvedDbType); } } resolvedDbTypesCache.put(typeName,dataTypes); return dataTypes; } } }</code><technical_language>map monitor</technical_language>

Target:
protected Map<Integer, ResolvedDbType> getLobFieldsDataTypeInfo(String typeName) throws SQLException { if (this.resolvedDbTypesCache.containsKey(typeName)) { if (logger.isDebugEnabled()) { logger.info("Returning chached LobFieldsDataTypeInfo"); } return resolvedDbTypesCache.get(typeName); } if (logger.isDebugEnabled()) { logger.info("Obtaining LobFieldsDataTypeInfo"); } synchronized (resolvedDbTypesCache) { if (this.resolvedDbTypesCache.containsKey(typeName)) { return resolvedDbTypesCache.get(typeName); } Map<Integer, ResolvedDbType> dataTypes = new HashMap<>(); String owner = getOwnerFrom(typeName); String type = getTypeSimpleName(typeName); String query = QUERY_TYPE_ATTRS + (owner != null ? QUERY_OWNER_CONDITION : ""); try (PreparedStatement ps = this.prepareStatement(query)) { ps.setString(1, type); if (owner != null) { ps.setString(2, owner); } try (ResultSet resultSet = ps.executeQuery()) { while (resultSet.next()) { ResolvedDbType resolvedDbType = new ResolvedDbType(UNKNOWN_DATA_TYPE, resultSet.getString(ATTR_TYPE_NAME_PARAM)); dataTypes.put(resultSet.getInt(ATTR_NO_PARAM), resolvedDbType); } } resolvedDbTypesCache.put(typeName, dataTypes); return dataTypes; } } }
Source:
<code>public <T> UpdateResults update(final Query<T> query, final UpdateOperations<T> operations, final UpdateOptions options) { DBCollection dbColl = query.getCollection(); if (dbColl == null) { dbColl = getCollection(query.getEntityClass()); } final MappedClass mc = getMapper().getMappedClass(query.getEntityClass()); final List<MappedField> fields = mc.getFieldsAnnotatedWith(Version.class); DBObject queryObject = query.getQueryObject(); if (operations.isIsolated()) { <START> queryObject.put("$isolated", true); <END> } if (!fields.isEmpty()) { final MappedField versionField = fields.get(0); if (queryObject.get(versionField.getNameToStore()) == null) { operations.inc(versionField.getNameToStore(), 1); } } final BasicDBObject update = (BasicDBObject) ((UpdateOpsImpl) operations).getOps(); if (LOG.isTraceEnabled()) { LOG.trace(format("Executing update(%s) for query: %s, ops: %s, multi: %s, upsert: %s", dbColl.getName(), queryObject, update, options.isMulti(), options.isUpsert())); } return new UpdateResults(dbColl.update(queryObject, update, options.getOptions())); }</code><technical_language>Is this change unrelated bug fix</technical_language>

Target:
public <T> UpdateResults update(final Query<T> query, final UpdateOperations<T> operations, final UpdateOptions options) { DBCollection dbColl = query.getCollection(); if (dbColl == null) { dbColl = getCollection(query.getEntityClass()); } final MappedClass mc = getMapper().getMappedClass(query.getEntityClass()); final List<MappedField> fields = mc.getFieldsAnnotatedWith(Version.class); DBObject queryObject = query.getQueryObject(); if (operations.isIsolated()) { queryObject.put("$isolated", true); } if (!fields.isEmpty()) { operations.inc(fields.get(0).getNameToStore(), 1); } final BasicDBObject update = (BasicDBObject) ((UpdateOpsImpl) operations).getOps(); if (LOG.isTraceEnabled()) { LOG.trace(format("Executing update(%s) for query: %s, ops: %s, multi: %s, upsert: %s", dbColl.getName(), queryObject, update, options.isMulti(), options.isUpsert())); } return new UpdateResults(dbColl.update(queryObject, update, options.getOptions())); }
Source:
<code>private Table getTableByName(String tableName) { for (Table table : this.elideTableConfig.getTables()) { if (table.getName().equals(tableName)) { return table; } else { <START> log.warn("Table " + tableName + " is not defined in Dynamic Config."); <END> return null; } } return null; }</code><technical_language>throw error here</technical_language>

Target:
private Table getTableByName(String tableName) { Table tableByName = this.elideTableConfig.getTables().stream().filter( table -> table.getName().equals(tableName)).findFirst().orElse(null); if (tableByName != null) { return tableByName; } throw new IllegalStateException("Table " + tableName + " is not defined in Dynamic Config."); }
Source:
<code>private void initBottomSheetBehaviour() { transparentView.setAlpha(0); bottomSheet.getLayoutParams().height = getActivity().getWindowManager() .getDefaultDisplay().getHeight() / 16 * 9; bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet); bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { @Override <START> public void onStateChanged(View bottomSheet, int newState) { <END> prepareViewsForSheetPosition(); } @Override public void onSlide(View bottomSheet, float slideOffset) { } }); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); bottomSheetBehaviorForDetails = BottomSheetBehavior.from(bottomSheetDetails); bottomSheetBehaviorForDetails.setState(BottomSheetBehavior.STATE_HIDDEN); }</code><technical_language>other collaborators newState is intentionally unused: rename unusedNewState</technical_language>

Target:
private void initBottomSheetBehaviour() { transparentView.setAlpha(0); bottomSheet.getLayoutParams().height = getActivity().getWindowManager() .getDefaultDisplay().getHeight() / 16 * 9; bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet); bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { @Override public void onStateChanged(View bottomSheet, int unusedNewState) { prepareViewsForSheetPosition(); } @Override public void onSlide(View bottomSheet, float slideOffset) { } }); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); bottomSheetBehaviorForDetails = BottomSheetBehavior.from(bottomSheetDetails); bottomSheetBehaviorForDetails.setState(BottomSheetBehavior.STATE_HIDDEN); }
Source:
<code>private void searchByQuery(SearchConfig searchConfig) { <START> this.query = searchConfig.getSearchQuery() + ";latestVersion.hidden==\"false\""; <END> this.sortConfig = searchConfig.getSortConfig(); enterLoadingState(); displayMapsFromSupplier(() -> mapService.findByQuery(query, ++currentPage, MAX_SEARCH_RESULTS, sortConfig)); }</code><technical_language>filter dialects, field name is subject change well. Hardcoding this is, therefore, a future-proof solution. Also, display search query user, this part left out results. proper solution include adding a pre-defined condition a parameter com.faforever.client.vault.search.SearchController#buildQuery. put field name SearchableProperties place distributed application. easy more robust</technical_language>

Target:
private void searchByQuery(SearchConfig searchConfig) { this.query = searchConfig.getSearchQuery(); this.sortConfig = searchConfig.getSortConfig(); enterLoadingState(); displayMapsFromSupplier(() -> mapService.findByQuery(query, ++currentPage, MAX_SEARCH_RESULTS, sortConfig)); }
Source:
<code>boolean isCQRoutingNeeded(CacheEvent event) { if (!isTransactionalEvent(event)) { return true; } FilterInfo localFilterInfo = getLocalFilterInfo(event); <START> if (localFilterInfo != null) { return false; } return true; <END> }</code><technical_language>This simplified return localFilterInfo == null;</technical_language>

Target:
boolean isCQRoutingNeeded(CacheEvent event) { if (!isTransactionalEvent(event)) { return true; } FilterInfo localFilterInfo = getLocalFilterInfo(event); return localFilterInfo == null; }
Source:
<code>public static String fullyQualifiedNameDiff(TypeRef typeRef, TypeDef originType) { Map<String, String> map = DefinitionRepository.getRepository().getReferenceMap(); String currentPackage = originType != null ? originType.getPackageName() : null; if (typeRef instanceof ClassRef) { <START> ClassRef classRef = (ClassRef) TypeAs.combine(UNWRAP_COLLECTION_OF, UNWRAP_ARRAY_OF, UNWRAP_OPTIONAL_OF).apply(typeRef); <END> String candidateFqn = classRef.getFullyQualifiedName().replace(classRef.getDefinition().getPackageName(), currentPackage); if (candidateFqn.equals(classRef.getFullyQualifiedName())) { return ""; } if (originType.getImports().contains(candidateFqn) && !classRef.getDefinition().getFullyQualifiedName().equals(candidateFqn)) { return captializeFirst(TypeUtils.fullyQualifiedNameDiff(candidateFqn, classRef.getFullyQualifiedName())); } String fqn = map.get(classRef.getDefinition().getName()); if (!classRef.getDefinition().getFullyQualifiedName().equals(fqn)) { return captializeFirst(TypeUtils.fullyQualifiedNameDiff(fqn, classRef.getFullyQualifiedName())); } } return ""; }</code><technical_language>@jimmidyson: cast a TypeRef ClassRef checking. I codebase is allover this kind of cast, this is case, dealing types recognized buildables. primitves, generics, null types</technical_language>

Target:
public static String fullyQualifiedNameDiff(TypeRef typeRef, TypeDef originType) { Map<String, String> map = DefinitionRepository.getRepository().getReferenceMap(); String currentPackage = originType != null ? originType.getPackageName() : null; if (typeRef instanceof ClassRef) { TypeRef unwrapped = TypeAs.combine(UNWRAP_COLLECTION_OF, UNWRAP_ARRAY_OF, UNWRAP_OPTIONAL_OF).apply(typeRef); if (unwrapped instanceof ClassRef) { ClassRef classRef = (ClassRef) unwrapped; String candidateFqn = classRef.getFullyQualifiedName().replace(classRef.getDefinition().getPackageName(), currentPackage); if (candidateFqn.equals(classRef.getFullyQualifiedName())) { return ""; } if (originType.getImports().contains(candidateFqn) && !classRef.getDefinition().getFullyQualifiedName().equals(candidateFqn)) { return captializeFirst(TypeUtils.fullyQualifiedNameDiff(candidateFqn, classRef.getFullyQualifiedName())); } String fqn = map.get(classRef.getDefinition().getName()); if (!classRef.getDefinition().getFullyQualifiedName().equals(fqn)) { return captializeFirst(TypeUtils.fullyQualifiedNameDiff(fqn, classRef.getFullyQualifiedName())); } } } return ""; }
Source:
<code>private void showDaysOfMonth() { int row = 0; int column = 0; for (int i = 0; i < LAST_DAY_OF_MONTH_INDEX; i++) { if ((i + 1) % DAYS_IN_WEEK == 1 && i != 1) { row++; column = 0; } daysOfMonth.setWidget(row, column, new Label(Integer.toString(i + 1))); daysOfMonth.getCellFormatter().getElement(row, <START> column).addClassName("normalFlexTableCell"); END> clickedList.add(i, false); column++; } Label widget = new Label(constants.lastDay()); clickedList.add(LAST_DAY_OF_MONTH_INDEX, false); daysOfMonth.setWidget(row, column, widget); daysOfMonth.getFlexCellFormatter().setColSpan(row, column, 4); wrapperPanel.add(daysOfMonth); }</code><technical_language>trouble get style defined here. do addClassName(style.normalFlexTableCell());</technical_language>

Target:
private void showDaysOfMonth() { int row = 0; int column = 0; for (int i = 0; i < LAST_DAY_OF_MONTH_INDEX; i++) { if ((i + 1) % DAYS_IN_WEEK == 1 && i != 1) { row++; column = 0; } daysOfMonth.setWidget(row, column, new Label(Integer.toString(i + 1))); daysOfMonth.getCellFormatter().getElement(row, column).addClassName(style.normalFlexTableCell()); clickedList.add(i, false); column++; } Label widget = new Label(constants.lastDay()); clickedList.add(LAST_DAY_OF_MONTH_INDEX, false); daysOfMonth.setWidget(row, column, widget); daysOfMonth.getFlexCellFormatter().setColSpan(row, column, 4); wrapperPanel.add(daysOfMonth); }
Source:
<code>public Multimap<String, Object> getMetadata() { String label = getLabel(); <START> if (label != null && !fMetaData.containsKey(IElementResolver.LABEL_KEY)) { fMetaData.put(IElementResolver.LABEL_KEY, label); } if (!fMetaData.containsKey(TmfStrings.startTime())) { fMetaData.put(TmfStrings.startTime(), fStartTime); } if (!fMetaData.containsKey(TmfStrings.endTime())) { fMetaData.put(TmfStrings.endTime(), fStartTime + fDuration); } if (!fMetaData.containsKey(TmfStrings.duration())) { fMetaData.put(TmfStrings.duration(), fDuration); } <END> return fMetaData; }</code><technical_language>check if empty add properties, avoids if-then-else call</technical_language>

Target:
public synchronized Multimap<String, Object> getMetadata() { Multimap<String, Object> metadata = fMetadata; if (metadata == null) { metadata = HashMultimap.create(); String label = getLabel(); if (label != null) { metadata.put(IElementResolver.LABEL_KEY, label); } metadata.put(TmfStrings.startTime(), fStartTime); metadata.put(TmfStrings.endTime(), fStartTime + fDuration); metadata.put(TmfStrings.duration(), fDuration); fMetadata = metadata; } return metadata; }
Source:
<code>protected void controlBulkOperations(final ListTable<T> extendedPagedTable) { enableWidgets( <START> Streams.stream(extendedPagedTable.getRightActionsToolbar()).findFirst().orElse(null), <END> extendedPagedTable.hasSelectedItems()); }</code><technical_language>@nmirasch avoid Guava altogether, like: suggestion StreamSupport.stream(extendedPagedTable.getRightActionsToolbar().spliterator(), false).findFirst().orElse(null)</technical_language>

Target:
protected void controlBulkOperations(final ListTable<T> extendedPagedTable) { enableWidgets(StreamSupport.stream(extendedPagedTable.getRightActionsToolbar().spliterator(), false).findFirst().orElse(null), extendedPagedTable.hasSelectedItems()); }
Source:
<code>public boolean performOk() { this.registry.setAssociations(this.workingCopy); EnableDisableLSJob enableDisableLSJob = new EnableDisableLSJob(changedDefinitions, getEditors()); enableDisableLSJob.schedule(); IPreferenceStore store = LanguageServerPlugin.getDefault().getPreferenceStore(); if (logToStdErrCheckbox.getSelection() != store .getBoolean(LoggingStreamConnectionProviderProxy.STDERR_KEY) || logToFileCheckbox.getSelection() != store .getBoolean(LoggingStreamConnectionProviderProxy.FILE_KEY)) { store.setValue(LoggingStreamConnectionProviderProxy.STDERR_KEY, logToStdErrCheckbox.getSelection()); store.setValue(LoggingStreamConnectionProviderProxy.FILE_KEY, logToFileCheckbox.getSelection()); MessageDialog dialog = new MessageDialog(getShell(), Messages.PreferencesPage_restartWarning_title, null, Messages.PreferencesPage_restartWarning_message, MessageDialog.WARNING, <START> new String[] { Messages.PreferencesPage_restartWarning_no, <END> Messages.PreferencesPage_restartWarning_restart }, 1); if (dialog.open() == 1) { PlatformUI.getWorkbench().restart(); } } return super.performOk(); }</code><technical_language>IDialogConstants.NO_LABEL instead</technical_language>

Target:
public boolean performOk() { this.registry.setAssociations(this.workingCopy); EnableDisableLSJob enableDisableLSJob = new EnableDisableLSJob(changedDefinitions, getEditors()); enableDisableLSJob.schedule(); IPreferenceStore store = LanguageServerPlugin.getDefault().getPreferenceStore(); if (logToStdErrCheckbox.getSelection() != store .getBoolean(LoggingStreamConnectionProviderProxy.STDERR_KEY) || logToFileCheckbox.getSelection() != store .getBoolean(LoggingStreamConnectionProviderProxy.FILE_KEY)) { store.setValue(LoggingStreamConnectionProviderProxy.STDERR_KEY, logToStdErrCheckbox.getSelection()); store.setValue(LoggingStreamConnectionProviderProxy.FILE_KEY, logToFileCheckbox.getSelection()); MessageDialog dialog = new MessageDialog(getShell(), Messages.PreferencesPage_restartWarning_title, null, Messages.PreferencesPage_restartWarning_message, MessageDialog.WARNING, new String[] { IDialogConstants.NO_LABEL, Messages.PreferencesPage_restartWarning_restart }, 1); if (dialog.open() == 1) { PlatformUI.getWorkbench().restart(); } } return super.performOk(); }
Source:
<code>public Value propertyValue() { if ( stateValue != null ) { return stateValue.value(); } Value value = readValue(); assertOpen.assertOpen(); <START> return value; <END> }</code><technical_language>assertOpen _before_ readValue</technical_language>

Target:
public Value propertyValue() { if ( txStateValue != null ) { return txStateValue.value(); } Value value = readValue(); assertOpen.assertOpen(); return value; }
Source:
<code>public static boolean isNotDefault(Message object) { checkNotNull(object); <START> return !isDefault(object); <END> }</code><technical_language>Please result variable</technical_language>

Target:
public static boolean isNotDefault(Message object) { checkNotNull(object); final boolean result = !isDefault(object); return result; }
Source:
<code>public SourceMethod build() { MappingOptions mappingOptions = null; if ( (mappings != null && !mappings.isEmpty()) || iterableMapping != null || mapMapping != null || beanMapping != null <START> || valueMappings != null ) { <END> mappingOptions = new MappingOptions( mappings, iterableMapping, mapMapping, beanMapping, valueMappings ); } SourceMethod sourceMethod = new SourceMethod( declaringMapper, executable, parameters, returnType, exceptionTypes, mappingOptions, typeUtils, typeFactory, mapperConfig, prototypeMethods, definingType ); if ( mappings != null ) { for ( Map.Entry<String, List<Mapping>> entry : mappings.entrySet() ) { for ( Mapping mapping : entry.getValue() ) { mapping.init( sourceMethod, messager, typeFactory, false ); } } } return sourceMethod; }</code><technical_language>valueMappings null empty. need check here? If generate mappings. @InheritInverseConfuguration _only_ pick annotated methods mapper well</technical_language>

Target:
public SourceMethod build() { MappingOptions mappingOptions = new MappingOptions( mappings, iterableMapping, mapMapping, beanMapping, valueMappings ); SourceMethod sourceMethod = new SourceMethod( declaringMapper, executable, parameters, returnType, exceptionTypes, mappingOptions, typeUtils, typeFactory, mapperConfig, prototypeMethods, definingType ); if ( mappings != null ) { for ( Map.Entry<String, List<Mapping>> entry : mappings.entrySet() ) { for ( Mapping mapping : entry.getValue() ) { mapping.init( sourceMethod, messager, typeFactory, false ); } } } return sourceMethod; }
Source:
<code>public void theSetAlarmNotificationsRequestIsReceived(final Map<String, String> requestData) throws Throwable { final Map<String, String> settings = new HashMap<>(); settings.put(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION, requestData.get(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION)); <START> settings.put(PlatformSmartmeteringKeys.ALARM_TYPE, requestData.get(PlatformSmartmeteringKeys.ALARM_TYPE)); <END> settings.put(PlatformSmartmeteringKeys.ALARM_TYPE_ENABLED, requestData.get(PlatformSmartmeteringKeys.ALARM_TYPE_ENABLED)); final SetAlarmNotificationsRequest setAlarmNotificationsRequest = SetAlarmNotificationsRequestFactory .fromParameterMap(settings); final SetAlarmNotificationsAsyncResponse setAlarmNotificationsAsyncResponse = this.smartMeteringConfigurationClient .setAlarmNotifications(setAlarmNotificationsRequest); LOGGER.info("Set alarm notifications response is received {}", setAlarmNotificationsAsyncResponse); assertNotNull("Set alarm notifications response should not be null", setAlarmNotificationsAsyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setAlarmNotificationsAsyncResponse.getAsyncResponse().getCorrelationUid()); }</code><technical_language>requestData parameters set, if not, add in scenario this</technical_language>

Target:
public void theSetAlarmNotificationsRequestIsReceived(final Map<String, String> requestData) throws Throwable { final SetAlarmNotificationsRequest setAlarmNotificationsRequest = SetAlarmNotificationsRequestFactory .fromParameterMap(requestData); final SetAlarmNotificationsAsyncResponse setAlarmNotificationsAsyncResponse = this.smartMeteringConfigurationClient .setAlarmNotifications(setAlarmNotificationsRequest); LOGGER.info("Set alarm notifications response is received {}", setAlarmNotificationsAsyncResponse); assertNotNull("Set alarm notifications response should not be null", setAlarmNotificationsAsyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setAlarmNotificationsAsyncResponse.getAsyncResponse().getCorrelationUid()); }
Source:
<code>private Mono<DatabaseAccount> getDatabaseAccountAsync(URI serviceEndpoint) { final GlobalEndpointManager that = this; Callable<Mono<DatabaseAccount>> fetchDatabaseAccount = () -> { return that.owner.getDatabaseAccountFromEndpoint(serviceEndpoint).doOnNext(databaseAccount -> { if(databaseAccount != null) { this.latestDatabaseAccount = databaseAccount; } logger.debug("account retrieved: {}", databaseAccount); }).single(); }; Mono<DatabaseAccount> obsoleteValueMono = databaseAccountAsyncCache.getAsync(StringUtils.EMPTY, null, fetchDatabaseAccount); return obsoleteValueMono.flatMap(obsoleteValue -> { if (firstTimeDatabaseAccountInitialization.compareAndSet(true, false)) { return Mono.just(obsoleteValue); } return databaseAccountAsyncCache.getAsync(StringUtils.EMPTY, obsoleteValue, fetchDatabaseAccount).doOnError(t -> { <START> databaseAccountAsyncCache.set(StringUtils.EMPTY, obsoleteValue); <END> }); }); }</code><technical_language>this is a window of time is invalid result in cache</technical_language>

Target:
private Mono<DatabaseAccount> getDatabaseAccountAsync(URI serviceEndpoint) { return this.owner.getDatabaseAccountFromEndpoint(serviceEndpoint) .doOnNext(databaseAccount -> { if(databaseAccount != null) { this.latestDatabaseAccount = databaseAccount; } logger.debug("account retrieved: {}", databaseAccount); }).single(); }
Source:
<code>private CommentUtils() { <START> throw new AssertionError(); <END> }</code><technical_language>Personnaly I overkill for a test class extended, in case of class, AssertionError clear. this is a detail</technical_language>

Target:
private CommentUtils() { }
Source:
<code>private int getCourseAccountId(String courseId){ M_log.debug("getCourseAccountId() call"); int course_account_id = 0; String url = canvasURL + "/api/v1/courses/" + courseId; M_log.info("API call "+url); HttpResponse response = processApiCall(new HttpGet(url)); if (response == null) { return 0; } int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != HttpStatus.SC_OK) { return course_account_id; } String courseData = null; try { courseData = EntityUtils.toString(response.getEntity(), "UTF-8"); } catch (IOException e) { e.printStackTrace(); } JSONObject courseJson = new JSONObject(courseData); <START> course_account_id = (int) courseJson.get("account_id"); <END> return course_account_id; }</code><technical_language>if is "account_id" in json</technical_language>

Target:
private int getCourseAccountId(String courseId){ M_log.debug("getCourseAccountId() call"); int course_account_id = 0; String url = makeCanvasURL("/courses/" + courseId); HttpResponse response = processApiCall(new HttpGet(url)); if (response == null) { return 0; } int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != HttpStatus.SC_OK) { return course_account_id; } String courseData = null; String errMsg = "As part of SubAccountAdmin check, couldn't get accountId the course %s belong to"; try { courseData = EntityUtils.toString(response.getEntity(), "UTF-8"); } catch (IOException e) { M_log.error(String.format(errMsg, courseId)); return 0; } catch (Exception e) { M_log.error(String.format(errMsg, courseId)); return 0; } JSONObject courseJson = new JSONObject(courseData); if (!courseJson.isNull("account_id")) { course_account_id = (int) courseJson.get("account_id"); } return course_account_id; }
Source:
<code>public void testWindowsReservedNames() { if (!SystemReader.getInstance().isWindows()) return; assertValid(false, "refs/heads/con"); assertValid(false, "refs/con/x"); assertValid(false, "con/heads/x"); assertValid(true, "refs/heads/conx"); <START> assertValid(true, "refs/heads/xcon"); <END> }</code><technical_language>if this test run non-Windows, faking this: SystemReader originalReader = SystemReader.getInstance(); try { MockSystemReader mockReader = new MockSystemReader(); mockReader.setWindows(); SystemReader.setInstance(mockReader); // re-using code DirCacheCheckoutTest, // testing for of special names. assertValid(false, "refs/heads/con"); assertValid(false, "refs/con/x"); assertValid(false, "con/heads/x"); assertValid(true, "refs/heads/conx"); assertValid(true, "refs/heads/xcon"); } finally { SystemReader.setInstance(originalReader); }</technical_language>

Target:
public void testWindowsReservedNames() { SystemReader original = SystemReader.getInstance(); try { SystemReader.setInstance(new MockSystemReader() { public boolean isWindows() { return true; } }); assertValid(false, "refs/heads/con"); assertValid(false, "refs/con/x"); assertValid(false, "con/heads/x"); assertValid(true, "refs/heads/conx"); assertValid(true, "refs/heads/xcon"); } finally { SystemReader.setInstance(original); } }
Source:
<code>private void saveUserWithRoles(String username, Set<String> roles) { UserEntity user = new UserEntity(username); user.setPassword("password"); user.setSecurityTokenKey("security-token"); Set<UserRole> userRoles = roles.stream() <START> .map(role -> new UserRoleEntity(role)) <END> .collect(Collectors.toSet()); user.setRoles(userRoles); user.setEnabled(true); user.setLastUpdated(EntityTraversalUtils.toLocalDateTime(new Date())); userRepository.save(user); }</code><technical_language>suggestion .map(UserRoleEntity::new)</technical_language>

Target:
private void saveUserWithRoles(String username, Set<String> roles) { UserEntity user = new UserEntity(username); user.setPassword("password"); user.setSecurityTokenKey("security-token"); Set<SecurityRole> userRoles = roles.stream() .map(SecurityRoleEntity::new) .collect(Collectors.toSet()); user.setRoles(userRoles); user.setEnabled(true); user.setLastUpdated(EntityTraversalUtils.toLocalDateTime(new Date())); userRepository.save(user); }
Source:
<code>public static MergeStrategy getMergeStrategy(Map<String, String> taskConfigs) { String mergeStrategyTypeStr = taskConfigs.getOrDefault(MinionConstants.MergeRollupTask.MERGE_STRATEGY_TYPE, MergeStrategyType.TIME.name()); MergeStrategyType mergeStrategyType; try { mergeStrategyType = MergeStrategyType.valueOf(mergeStrategyTypeStr.toUpperCase()); } catch (IllegalArgumentException e) { <START> mergeStrategyType = MergeStrategyType.TIME; <END> } switch (mergeStrategyType) { case TIME: return new TimeBasedMergeStrategy(taskConfigs); default: throw new RuntimeException("Unsupported merge strategy type."); } }</code><technical_language>abort for invalid value</technical_language>

Target:
public static MergeStrategy getMergeStrategy(Map<String, String> taskConfigs) { String mergeStrategyTypeStr = taskConfigs.getOrDefault(MinionConstants.MergeRollupTask.MERGE_STRATEGY_TYPE, MergeStrategyType.TIME.name()); MergeStrategyType mergeStrategyType; try { mergeStrategyType = MergeStrategyType.valueOf(mergeStrategyTypeStr.toUpperCase()); } catch (IllegalArgumentException e) { LOGGER.error("Invalid merge type: {}", mergeStrategyTypeStr); throw e; } switch (mergeStrategyType) { case TIME: return new TimeBasedMergeStrategy(taskConfigs); default: throw new RuntimeException("Unsupported merge strategy type."); } }
Source:
<code>public List<String> getTemplateDetails() throws Exception { int index = triggerRowToggle(templatesTable, "First template"); <START> Thread.sleep(5000); <END> WebElement detailsTable = Browser.getDriver() .findElement(By.id(TEMPLATE_TABLE + ":" + index + ":templateDetailTable")); Thread.sleep(5000); return new ArrayList<>(); }</code><technical_language>add this a lines this call returning empty list? I this similar line removed</technical_language>

Target:
public List<String> getTemplateDetails() { int index = triggerRowToggle(templatesTable, "First template"); WebElement detailsTable = Browser.getDriver() .findElement(By.id(TEMPLATE_TABLE + ":" + index + ":templateDetailTable")); return new ArrayList<>(); }
Source:
<code>protected void validateSubmit(SchedulerStateManagerAdaptor adaptor, String topologyName) throws TopologySubmissionException { Boolean isTopologyRunning = adaptor.isTopologyRunning(topologyName); if (isTopologyRunning != null && isTopologyRunning.equals(Boolean.TRUE)) { <START> throw new TopologySubmissionException("Topology already exists"); <END> } }</code><technical_language>include topology name in message well: Topology foo exists</technical_language>

Target:
protected void validateSubmit(SchedulerStateManagerAdaptor adaptor, String topologyName) throws TopologySubmissionException { Boolean isTopologyRunning = adaptor.isTopologyRunning(topologyName); if (isTopologyRunning != null && isTopologyRunning.equals(Boolean.TRUE)) { throw new TopologySubmissionException( String.format("Topology '%s' already exists", topologyName)); } }
Source:
<code>protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { HttpSession session = req.getSession(); Matcher keyMatched = getKeyPattern.matcher(req.getRequestURI()); if (keyMatched.find()) { String[] split = keyMatched.group().split("/"); String key = split[1]; Object value = session.getAttribute(key); <START> System.out.println("get sessionId="+session.getId()+" key="+key+" val="+value); <END> if(value==null){ resp.getWriter().write("key="+key+" Not found in session "+session.getId()); } else{ resp.getWriter().write(value.toString()); } } }</code><technical_language>want apply pattern: if(logger.isDebugEnabled()){ logger.debug("get sessionId="+session.getId()+" key="+key+" val="+value) } Loggers (and System.out) a bad impact performance</technical_language>

Target:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { HttpSession session = req.getSession(); Matcher keyMatched = getKeyPattern.matcher(req.getRequestURI()); if (keyMatched.find()) { String[] split = keyMatched.group().split("/"); String key = split[1]; Object value = session.getAttribute(key); if(value==null){ resp.getWriter().write("key="+key+" Not found in session "+session.getId()); } else{ resp.getWriter().write(value.toString()); } } }
Source:
<code>public EObject updateCreatedObject(EObject newObject, String loadedVersion) { EObject returnedValue = newObject; for (IMigrationParticipant contribution : delegatesParticipants) { <START> returnedValue = contribution.updateCreatedObject(newObject, loadedVersion); <END> } return returnedValue; }</code><technical_language>is a bug --> returnedValue = contribution.updateCreatedObject(returnedValue, loadedVersion);</technical_language>

Target:
public EObject updateCreatedObject(EObject newObject, String loadedVersion) { EObject returnedValue = null; for (IMigrationParticipant contribution : delegatesParticipants) { returnedValue = contribution.updateCreatedObject(newObject, loadedVersion); if (returnedValue != null) { break; } } return returnedValue; }