auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Transfer buy(Money amount, String paymentMethodId, Boolean commit) throws CoinbaseException, IOException { URL buysUrl; try { buysUrl = new URL(_baseApiUrl, "buys"); } catch (MalformedURLException ex) { throw new AssertionError(ex); } Request request = newAccountSpecificRequest(); request.setQty(amount.getAmount().doubleValue()); request.setPaymentMethodId(paymentMethodId); request.setCurrency(amount.getCurrencyUnit().getCurrencyCode()); <START> if(commit != null) <END> request.setCommit(commit); return post(buysUrl, request, TransferResponse.class).getTransfer(); }</code><technical_language>Braces</technical_language>

Target:
public Transfer buy(Money amount, String paymentMethodId, Boolean commit) throws CoinbaseException, IOException { URL buysUrl; try { buysUrl = new URL(_baseApiUrl, "buys"); } catch (MalformedURLException ex) { throw new AssertionError(ex); } Request request = newAccountSpecificRequest(); request.setQty(amount.getAmount().doubleValue()); request.setPaymentMethodId(paymentMethodId); request.setCurrency(amount.getCurrencyUnit().getCurrencyCode()); request.setCommit(commit); return post(buysUrl, request, TransferResponse.class).getTransfer(); }
Source:
<code>public IUnitRating getUnitRating() { if(unitRating == null) { UnitRatingMethod method = getCampaignOptions().getUnitRatingMethod(); <START> if (method.equals(UnitRatingMethod.FLD_MAN_MERCS_REV)) { <END> unitRating = new FieldManualMercRevDragoonsRating(this); } else { unitRating = new CampaignOpsReputation(this); } } return unitRating; }</code><technical_language>This flipped off-chance _method_ ends null</technical_language>

Target:
public IUnitRating getUnitRating() { if(unitRating != null && (unitRating.getUnitRatingMethod() != getCampaignOptions().getUnitRatingMethod())) { unitRating = null; } if(unitRating == null) { UnitRatingMethod method = getCampaignOptions().getUnitRatingMethod(); if (UnitRatingMethod.FLD_MAN_MERCS_REV.equals(method)) { unitRating = new FieldManualMercRevDragoonsRating(this); } else { unitRating = new CampaignOpsReputation(this); } } return unitRating; }
Source:
<code>public Iterator<V2> iterator() { return new Iterator<V2>(){ Iterator<V1> backing = original.iterator(); int cursor; @Override public boolean hasNext() { <START> return cursor <= size(); <END> } @Override public V2 next() { V1 backingNext = backing.next(); cursor += 1; return function.apply(backingNext); } }; }</code><technical_language>return backing.hasNext()</technical_language>

Target:
public Iterator<V2> iterator() { return new Iterator<V2>(){ Iterator<V1> backing = original.iterator(); @Override public boolean hasNext() { return backing.hasNext(); } @Override public V2 next() { V1 backingNext = backing.next(); return function.apply(backingNext); } }; }
Source:
<code>public static StatementInfo fromJson(String json) { String right_json = ""; try { gson.fromJson(json, StatementInfo.class); right_json = json; } catch (Exception e) { if (json.contains("\"traceback\":{}")) { LOGGER.info("traceback type mismatch, replacing the mismatching part "); right_json = json.replace("\"traceback\":{}", "\"traceback\":[]"); <START> LOGGER.info("new json string is {}", right_json); <END> } } return gson.fromJson(right_json, StatementInfo.class); }</code><technical_language>change LOGGER.debug</technical_language>

Target:
public static StatementInfo fromJson(String json) { String right_json = ""; try { gson.fromJson(json, StatementInfo.class); right_json = json; } catch (Exception e) { if (json.contains("\"traceback\":{}")) { LOGGER.debug("traceback type mismatch, replacing the mismatching part "); right_json = json.replace("\"traceback\":{}", "\"traceback\":[]"); LOGGER.debug("new json string is {}", right_json); } } return gson.fromJson(right_json, StatementInfo.class); }
Source:
<code>public static CommandResult processed() { <START> return new CommandResultBuilder().processed(true).build(); <END> }</code><technical_language>If this changes this a constant return (see Text API for some examples)</technical_language>

Target:
public static CommandResult processed() { return PROCESSED; }
Source:
<code><START> protected boolean useDirectReplyTo() { <END> if (Address.TEMPORARY_REPLY_QUEUE_TOKEN.equals(this.replyAddress)) { return false; } if (this.replyAddress == null || Address.AMQ_RABBITMQ_REPLY_TO.equals(this.replyAddress)) { try { execute(new ChannelCallback<Void>() { @Override public Void doInRabbit(Channel channel) throws Exception { channel.queueDeclarePassive(Address.AMQ_RABBITMQ_REPLY_TO); return null; } }); return true; } catch (Exception e) { if (this.replyAddress != null) { logger.error("Broker does not support fast replies via 'amq.rabbitmq.reply-to', temporary " + "queues will be used:" + e.getMessage() + "."); } else { if (logger.isDebugEnabled()) { logger.debug("Broker does not support fast replies via 'amq.rabbitmq.reply-to', temporary " + "queues will be used:" + e.getMessage() + "."); } } this.replyAddress = null; } } return false; }</code><technical_language>this method is a thread safe, synchronization</technical_language>

Target:
protected boolean useDirectReplyTo() { if (this.useTemporaryReplyQueues) { if (this.replyAddress != null) { logger.error("'useTemporaryReplyQueues' is ignored when a 'replyAddress' is provided"); } else { return false; } } if (this.replyAddress == null || Address.AMQ_RABBITMQ_REPLY_TO.equals(this.replyAddress)) { try { execute(new ChannelCallback<Void>() { @Override public Void doInRabbit(Channel channel) throws Exception { channel.queueDeclarePassive(Address.AMQ_RABBITMQ_REPLY_TO); return null; } }); return true; } catch (Exception e) { if (this.replyAddress != null) { logger.error("Broker does not support fast replies via 'amq.rabbitmq.reply-to', temporary " + "queues will be used:" + e.getMessage() + "."); } else { if (logger.isDebugEnabled()) { logger.debug("Broker does not support fast replies via 'amq.rabbitmq.reply-to', temporary " + "queues will be used:" + e.getMessage() + "."); } } this.replyAddress = null; } } return false; }
Source:
<code>public int getRenderState() { int state = speed.ordinal(); if (getReverse()) state = 14; if (isPowered()) { if (getReverse()) state += 1; else state += 7; <START> } <END> return state; }</code><technical_language>simplify this reordering states</technical_language>

Target:
public int getRenderState() { int state = speed.ordinal(); if (getReverse()) state = 4; if (isPowered()) state += 5; return state; }
Source:
<code>public String getClientPackageElementName(String packageElementName) { <START> { <END> if (packageElementName.matches(".*client$")) { return packageElementName; } String[] packageUnits = packageElementName.split("\\."); String parentPackageElementName = ""; for (int i = 0; i < packageUnits.length - 1; i++) { parentPackageElementName += packageUnits[i]; if (i < packageUnits.length - 2) { parentPackageElementName += "."; } if (packageUnits[i].equals("client")) { break; } } if (parentPackageElementName.matches(".*\\.$")) { parentPackageElementName = parentPackageElementName.replaceAll("\\.$", ""); } return parentPackageElementName; } }</code><technical_language>reason for this extra bracket</technical_language>

Target:
public String getClientPackageElementName(String packageElementName) { if (packageElementName.matches(".*client$")) { return packageElementName; } String[] packageUnits = packageElementName.split("\\."); String parentPackageElementName = ""; for (int i = 0; i < packageUnits.length - 1; i++) { parentPackageElementName += packageUnits[i]; if (i < packageUnits.length - 2) { parentPackageElementName += "."; } if (packageUnits[i].equals("client")) { break; } } if (parentPackageElementName.matches(".*\\.$")) { parentPackageElementName = parentPackageElementName.replaceAll("\\.$", ""); } return parentPackageElementName; }
Source:
<code>public void setUpLanguageScrollTabData(List<String> languageCodes, Callback callback, int position) { this.callback = callback; this.languagecodes = languageCodes; for (int i = 0; i < languageCodes.size(); i++) { TabLayout.Tab tab = horizontalLanguageScroll.newTab(); horizontalLanguageScroll.addTab(tab); <START> horizontalLanguageScroll.getTabAt(i).setCustomView(createLanguageTab(languageCodes.get(i))); <END> } selectLanguageTab(position); }</code><technical_language>this tab.setCustomView</technical_language>

Target:
public void setUpLanguageScrollTabData(List<String> languageCodes, Callback callback, int position) { if (this.callback != null) { this.callback = null; } if (horizontalLanguageScroll.getChildCount() > 0) { horizontalLanguageScroll.removeAllTabs(); } this.callback = callback; this.languagecodes = languageCodes; for (int i = 0; i < languageCodes.size(); i++) { TabLayout.Tab tab = horizontalLanguageScroll.newTab(); tab.setCustomView(createLanguageTab(languageCodes.get(i))); horizontalLanguageScroll.addTab(tab); updateTabView(false, tab); } selectLanguageTab(position); }
Source:
<code>public void write(CommandId id, CommandStorageRecord record) { <START> checkNotNull(id); <END> checkNotDefault(id); checkNotNull(record); final String commandId = record.getCommandId(); checkNotEmptyOrBlank(commandId, "Command ID"); put(id, record); }</code><technical_language>checkNotDefault(M extends Message), non-null non-default checks? again</technical_language>

Target:
public void write(CommandId id, CommandStorageRecord record) { checkNotClosed(); checkNotDefault(id); checkNotDefault(record); final String commandId = record.getCommandId(); checkNotEmptyOrBlank(commandId, "Command ID"); put(id, record); }
Source:
<code>public VdcActionParametersBase(String engineSessionId) { shouldbelogged = true; transctionOption = TransactionScopeOption.Required; setTaskGroupSuccess(true); setParentCommand(VdcActionType.Unknown); executionReason = CommandExecutionReason.REGULAR_FLOW; compensationEnabled = false; parentCommand = VdcActionType.Unknown; commandType = VdcActionType.Unknown; imagesParameters = new ArrayList<VdcActionParametersBase>(); <START> sessionid = engineSessionId; <END> }</code><technical_language>simply constructor this: public VdcActionParametersBase(String engineSessionId) { this(); sessionId = engineSessionId; } code duplication shorter</technical_language>

Target:
public VdcActionParametersBase(String engineSessionId) { this(); sessionid = engineSessionId; }
Source:
<code><START> public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { <END> if (request instanceof HttpServletRequest) { HttpServletRequest httpServletRequest = (HttpServletRequest) request; String language = httpServletRequest.getHeader("Accept-Language"); if (language != null) { if (!requestsByLanguage.containsKey(language)) { requestsByLanguage.put(language, new MutableLong(0)); } requestsByLanguage.get(language).increment(); } } chain.doFilter(request, response); }</code><technical_language>this unique based cookie other browser/session-specific identifier? Otherwise, if I understanding this code correctly, a single power-user skew statistics a bit</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (request instanceof HttpServletRequest && !Telemetry.isDisabled()) { HttpServletRequest httpServletRequest = (HttpServletRequest) request; String language = httpServletRequest.getHeader("Accept-Language"); if (language != null) { if (!requestsByLanguage.containsKey(language)) { requestsByLanguage.put(language, new AtomicLong(0)); } requestsByLanguage.get(language).incrementAndGet(); } } chain.doFilter(request, response); }
Source:
<code>protected void onUnload() { super.onUnload(); <START> $(listBox.getElement()).material_select("destroy"); <END> }</code><technical_language>this action exist in material_select? should, need sure</technical_language>

Target:
protected void onUnload() { super.onUnload(); $(listBox.getElement()).off("change"); $(listBox.getElement()).material_select("destroy"); }
Source:
<code>public <T> FieldProjectionBuilder<T> createFieldValueProjectionBuilder(String absoluteFieldPath, Class<T> expectedType, ProjectionConverter projectionConverter) { checkProjectable( absoluteFieldPath, projectable ); <START> if ( projectionConverter.isEnabled() && !converter.isConvertedTypeAssignableTo( expectedType ) ) { <END> throw log.invalidProjectionInvalidType( absoluteFieldPath, expectedType, EventContexts.fromIndexFieldAbsolutePath( absoluteFieldPath ) ); } return (FieldProjectionBuilder<T>) new ElasticsearchFieldProjectionBuilder<>( absoluteFieldPath, getConverter( projectionConverter ), codec ); }</code><technical_language>check type is assignable in cases. Just, projection converter is disabled, call isConvertedTypeAssignableTo *raw* converter. Note tests fail, missing a test try pass wrong type rawField(String, Class)</technical_language>

Target:
public <T> FieldProjectionBuilder<T> createFieldValueProjectionBuilder(String absoluteFieldPath, Class<T> expectedType, ProjectionConverter projectionConverter) { checkProjectable( absoluteFieldPath, projectable ); FromDocumentFieldValueConverter<? super F, ?> requestConverter = getConverter( projectionConverter ); if ( !requestConverter.isConvertedTypeAssignableTo( expectedType ) ) { throw log.invalidProjectionInvalidType( absoluteFieldPath, expectedType, EventContexts.fromIndexFieldAbsolutePath( absoluteFieldPath ) ); } return (FieldProjectionBuilder<T>) new ElasticsearchFieldProjectionBuilder<>( absoluteFieldPath, requestConverter, codec ); }
Source:
<code>public ByteBuffer sliceAsByteBuffer(int index, int length) { <START> if (base != null) { <END> return ByteBuffer.wrap((byte[]) base, (int) ((address - ARRAY_BYTE_BASE_OFFSET) + index), length); } else { assert (!isUniversalBuffer); return DirectBufferAccess.newByteBuffer(address, index, length, reference); } }</code><technical_language>for hasArray</technical_language>

Target:
public ByteBuffer sliceAsByteBuffer(int index, int length) { if (hasArray()) { return ByteBuffer.wrap((byte[]) base, (int) ((address - ARRAY_BYTE_BASE_OFFSET) + index), length); } else { assert (!isUniversalBuffer); return DirectBufferAccess.newByteBuffer(address, index, length, reference); } }
Source:
<code>public void init() throws IOException { kafkaConfig.put(ConsumerConfig.GROUP_ID_CONFIG, minionIdentity.getLocation()); kafkaConfig.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true"); kafkaConfig.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getCanonicalName()); kafkaConfig.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getCanonicalName()); kafkaConfig.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, "1000"); kafkaConfig.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); kafkaConfig.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getCanonicalName()); kafkaConfig.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getCanonicalName()); kafkaConfig.putAll(kafkaConfigProvider.getProperties()); LOG.info("initializing the Kafka producer with: {}", kafkaConfig); producer = Utils.runWithGivenClassLoader(() -> new KafkaProducer<String, byte[]>(kafkaConfig), KafkaProducer.class.getClassLoader()); maxBufferSize = KafkaRpcConstants.getMaxBufferSize(kafkaConfig); delayQueueExecutor.execute(() -> { while(true) { try { rpcIdQueue.take(); <START> } catch (InterruptedException e) { <END> LOG.error("Delay Queue has been interrupted ", e); break; } } }); }</code><technical_language>purpose of RpcId objects? do pulled queue</technical_language>

Target:
public void init() throws IOException { kafkaConfig.put(ConsumerConfig.GROUP_ID_CONFIG, minionIdentity.getLocation()); kafkaConfig.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true"); kafkaConfig.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getCanonicalName()); kafkaConfig.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getCanonicalName()); kafkaConfig.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, "1000"); kafkaConfig.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); kafkaConfig.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getCanonicalName()); kafkaConfig.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getCanonicalName()); kafkaConfig.putAll(kafkaConfigProvider.getProperties()); LOG.info("initializing the Kafka producer with: {}", kafkaConfig); producer = Utils.runWithGivenClassLoader(() -> new KafkaProducer<String, byte[]>(kafkaConfig), KafkaProducer.class.getClassLoader()); maxBufferSize = KafkaRpcConstants.getMaxBufferSize(kafkaConfig); delayQueueExecutor.execute(() -> { while(true) { try { RpcId rpcId = rpcIdQueue.take(); messageCache.remove(rpcId.getRpcId()); } catch (InterruptedException e) { LOG.error("Delay Queue has been interrupted ", e); break; } } }); }
Source:
<code>public Map<TaskName, Set<SystemStreamPartition>> group(Set<SystemStreamPartition> ssps) { Map<TaskName, Set<SystemStreamPartition>> groupedMap = new HashMap<>(); <START> for (SystemStreamPartition ssp : ssps) { <END> if (broadcastSystemStreamPartitions.contains(ssp)) { continue; } TaskName taskName = new TaskName(String.format("Partition %d", ssp.getPartition().getPartitionId())); if (!groupedMap.containsKey(taskName)) { groupedMap.put(taskName, new HashSet<>()); } groupedMap.get(taskName).add(ssp); } if (!broadcastSystemStreamPartitions.isEmpty()) { for (Set<SystemStreamPartition> value : groupedMap.values()) { value.addAll(broadcastSystemStreamPartitions); } } return groupedMap; }</code><technical_language>Thanks for cleanup</technical_language>

Target:
public Map<TaskName, Set<SystemStreamPartition>> group(Set<SystemStreamPartition> ssps) { Map<TaskName, Set<SystemStreamPartition>> groupedMap = new HashMap<>(); for (SystemStreamPartition ssp : ssps) { if (broadcastStreams.contains(ssp)) { continue; } TaskName taskName = new TaskName(String.format("Partition %d", ssp.getPartition().getPartitionId())); if (!groupedMap.containsKey(taskName)) { groupedMap.put(taskName, new HashSet<>()); } groupedMap.get(taskName).add(ssp); } if (!broadcastStreams.isEmpty()) { for (Set<SystemStreamPartition> value : groupedMap.values()) { value.addAll(broadcastStreams); } } return groupedMap; }
Source:
<code>static void write(ObjectOutput out, Object o) throws IOException { try { Method writeReplace = o.getClass().getDeclaredMethod("writeReplace"); <START> writeReplace.setAccessible(true); <END> SerializedLambda sl = (SerializedLambda) writeReplace.invoke(o); writeSerializedLamda(out, sl); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new MarshallingException(e); } }</code><technical_language>Do need worry this a security manager installed</technical_language>

Target:
static void write(ObjectOutput out, Object o) throws IOException { try { Method writeReplace = SecurityActions.getMethodAndSetAccessible(o, "writeReplace"); SerializedLambda sl = (SerializedLambda) writeReplace.invoke(o); writeSerializedLambda(out, sl); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new MarshallingException(e); } }
Source:
<code>public void setValue(ELContext context, Object base, Object property, Object value) { if (base instanceof DocumentModel) { try { super.setValue(context, base, property, value); } catch (PropertyNotFoundException e) { } } else if (base instanceof DocumentPropertyContext) { DocumentPropertyContext ctx = (DocumentPropertyContext) base; value = FieldAdapterManager.getValueForStorage(value); try { ctx.doc.setPropertyValue(getDocumentPropertyName(ctx, property), (Serializable) value); } catch (PropertyException e) { log.warn(e.toString()); } context.setPropertyResolved(true); } else if (base instanceof Property) { try { Property docProperty = (Property) base; Property subProperty = getDocumentProperty(docProperty, property); value = FieldAdapterManager.getValueForStorage(value); subProperty.setValue(value); } catch (PropertyException pe) { try { super.setValue(context, base, property, value); } catch (PropertyNotFoundException e) { log.warn(pe.toString()); } } context.setPropertyResolved(true); } else if (base instanceof Blob) { try { super.setValue(context, base, property, value); } catch (PropertyNotFoundException e) { Blob blob = (Blob) base; if ("name".equals(property)) { value = blob.getFilename(); context.setPropertyResolved(true); } else if ("mime-type".equals(property)) { value = blob.getMimeType(); <START> context.setPropertyResolved(true); <END> } } } }</code><technical_language>This copy/pasted getValue, set instead? If so, a unit test is missing</technical_language>

Target:
public void setValue(ELContext context, Object base, Object property, Object value) { if (base instanceof DocumentModel) { try { super.setValue(context, base, property, value); } catch (PropertyNotFoundException e) { } } else if (base instanceof DocumentPropertyContext) { DocumentPropertyContext ctx = (DocumentPropertyContext) base; value = FieldAdapterManager.getValueForStorage(value); try { ctx.doc.setPropertyValue(getDocumentPropertyName(ctx, property), (Serializable) value); } catch (PropertyException e) { log.warn(e.toString()); } context.setPropertyResolved(true); } else if (base instanceof Property) { try { Property docProperty = (Property) base; Property subProperty = getDocumentProperty(docProperty, property); value = FieldAdapterManager.getValueForStorage(value); subProperty.setValue(value); } catch (PropertyException pe) { try { super.setValue(context, base, property, value); } catch (PropertyNotFoundException e) { log.warn(pe.toString()); } } context.setPropertyResolved(true); } else if (base instanceof Blob) { super.setValue(context, base, getBlobMapping(property), value); } }
Source:
<code>public void purgeDeletedCertificateWithResponseCodeSnippets() { CertificateAsyncClient certificateAsyncClient = getCertificateAsyncClient(); certificateAsyncClient.purgeDeletedCertificateWithResponse("deletedCertificateName") .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(purgeResponse -> <START> System.out.printf("Purge Status response %d \n", purgeResponse.getStatusCode())); <END> END: com.azure.security.keyvault.certificates.CertificateAsyncClient.purgeDeletedCertificateWithResponse#string }</code><technical_language>%n</technical_language>

Target:
public void purgeDeletedCertificateWithResponseCodeSnippets() { CertificateAsyncClient certificateAsyncClient = getCertificateAsyncClient(); certificateAsyncClient.purgeDeletedCertificateWithResponse("deletedCertificateName") .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(purgeResponse -> System.out.printf("Purge Status response %d %n", purgeResponse.getStatusCode())); END: com.azure.security.keyvault.certificates.CertificateAsyncClient.purgeDeletedCertificateWithResponse#string }
Source:
<code>private void stopWriteThread() { mmStoppingThread = Thread.currentThread(); mmWriteThreadRunning = false; synchronized(mmStoppingThread) { try { <START> mmStoppingThread.wait(1000); <END> } catch (InterruptedException e) { } if (mmWriteThread.isAlive()) { Log.w(TAG, "Write thread is still alive..."); } } }</code><technical_language>Magic number. I I understand this method is supposed work. need explain in person is cool</technical_language>

Target:
private void stopWriteThread() { mmStoppingThread = Thread.currentThread(); mmWriteThreadRunning = false; synchronized(mmStoppingThread) { try { int waitTimeInMS = 1000; mmStoppingThread.wait(waitTimeInMS); } catch (InterruptedException e) { } if (mmWriteThread.isAlive()) { Log.w(TAG, "Write thread is still alive..."); } } }
Source:
<code>private BuildResults build( final Project project, final Supplier<BuildResults> buildResultsSupplier ) { try { cache.invalidateCache( project ); final BuildResults results = buildResultsSupplier.get(); StringBuffer message = new StringBuffer(); <START> message.append( "Build of project '" + project.getProjectName() + "' (requested by " + getIdentifier() + ") completed.\n" ); <END> message.append( " Build: " + ( results.getErrorMessages().isEmpty() ? "SUCCESSFUL" : "FAILURE" ) ); BuildMessage infoMsg = new BuildMessage(); infoMsg.setLevel( Level.INFO ); infoMsg.setText( message.toString() ); results.addBuildMessage( 0, infoMsg ); return results; } catch ( Exception e ) { logger.error( e.getMessage(), e ); return buildExceptionResults( e, project.getPom().getGav() ); } }</code><technical_language>I moved this, strange original author StringBuffer a String + put this together. I wrong here, this removes benefits StringBuffer gives</technical_language>

Target:
private BuildResults build( final Project project, final Supplier<BuildResults> buildResultsSupplier ) { try { cache.invalidateCache( project ); final BuildResults results = buildResultsSupplier.get(); BuildMessage infoMsg = new BuildMessage(); infoMsg.setLevel( Level.INFO ); infoMsg.setText( buildResultMessage( project, results ).toString() ); results.addBuildMessage( 0, infoMsg ); return results; } catch ( Exception e ) { logger.error( e.getMessage(), e ); return buildExceptionResults( e, project.getPom().getGav() ); } }
Source:
<code>public StatusOnlyReturnForXmlRpc snapshot(String vmId, Map<String, String>[] disks, String memory, boolean frozen) { JsonRpcRequest request = new RequestBuilder("VM.snapshot").withParameter("vmID", vmId) .withParameter("snapDrives", new ArrayList<Map<String, String>>(Arrays.asList(disks))) <START> .withParameter("snapMemory", memory) <END> .withParameter("frozen", frozen) .build(); Map<String, Object> response = new FutureMap(this.client, request); return new StatusOnlyReturnForXmlRpc(response); }</code><technical_language>this stop optional? If break older hosts</technical_language>

Target:
public StatusOnlyReturnForXmlRpc snapshot(String vmId, Map<String, String>[] disks, String memory, boolean frozen) { JsonRpcRequest request = new RequestBuilder("VM.snapshot").withParameter("vmID", vmId) .withParameter("snapDrives", new ArrayList<Map<String, String>>(Arrays.asList(disks))) .withOptionalParameter("snapMemory", memory) .withParameter("frozen", frozen) .build(); Map<String, Object> response = new FutureMap(this.client, request); return new StatusOnlyReturnForXmlRpc(response); }
Source:
<code>C baseApply() { final TreeMap<String, String> t = new TreeMap<String, String>(validate()); if(!children.contains(t)) { C child = newChild(); children.put(t, child); <START> return child; <END> } else return children.get(t); }</code><technical_language>thread safety here? I mistaken, this code snippet more thread check condition, receive false contains() method execute code block. reason blocking putIfAbsent method is here</technical_language>

Target:
C baseApply() { final TreeMap<String, String> t = new TreeMap<String, String>(validate()); C child = children.get(t); if(child == null) { child = newChild(); children.put(t, child); } return child; }
Source:
<code>private JSONObject buildExtensionJobDetailResult(final String jobName) throws FalconException { ExtensionMetaStore metaStore = ExtensionStore.getMetaStore(); ExtensionJobsBean jobsBean = metaStore.getExtensionJobDetails(jobName); if (jobsBean == null) { throw new ValidationException("Job name not found:" + jobName); } ExtensionBean extensionBean = metaStore.getDetail(jobsBean.getExtensionName()); JSONObject detailsObject = new JSONObject(); try { detailsObject.put(JOB_NAME, jobsBean.getJobName()); detailsObject.put(EXTENSION_NAME, jobsBean.getExtensionName()); JSONObject feedsObject = new JSONObject(); for (String feed : jobsBean.getFeeds()) { try { EntityUtil.getEntity(EntityType.FEED, feed); <START> } catch (EntityNotRegisteredException e) { <END> feedsObject.put(feed, ENTITY_NOT_EXISTS_STATUS); } feedsObject.put(feed, ENTITY_EXISTS_STATUS); } detailsObject.put(FEEDS, feedsObject); JSONObject processObject = new JSONObject(); for (String process : jobsBean.getProcesses()) { try { EntityUtil.getEntity(EntityType.PROCESS, process); } catch (EntityNotRegisteredException e) { processObject.put(process, ENTITY_NOT_EXISTS_STATUS); } processObject.put(process, ENTITY_EXISTS_STATUS); } detailsObject.put(PROCESSES, processObject); detailsObject.put(CONFIG, jobsBean.getConfig()); detailsObject.put(CREATION_TIME, jobsBean.getCreationTime()); detailsObject.put(LAST_UPDATE_TIME, jobsBean.getLastUpdatedTime()); detailsObject.put(EXTENSION_LOCATION, extensionBean.getLocation()); detailsObject.put(EXTENSION_TYPE, extensionBean.getExtensionType()); } catch (JSONException e) { LOG.error("Exception while building extension jon details for job {}", jobName, e); } return detailsObject; }</code><technical_language>type is changed in 2 segments. Extract a method for</technical_language>

Target:
private JSONObject buildExtensionJobDetailResult(final String jobName) throws FalconException { ExtensionMetaStore metaStore = ExtensionStore.getMetaStore(); ExtensionJobsBean jobsBean = metaStore.getExtensionJobDetails(jobName); if (jobsBean == null) { throw new ValidationException("Job name not found:" + jobName); } ExtensionBean extensionBean = metaStore.getDetail(jobsBean.getExtensionName()); JSONObject detailsObject = new JSONObject(); try { detailsObject.put(JOB_NAME, jobsBean.getJobName()); detailsObject.put(EXTENSION_NAME, jobsBean.getExtensionName()); detailsObject.put(FEEDS, getEntitiesStatus(jobsBean.getFeeds(), EntityType.FEED)); detailsObject.put(PROCESSES, getEntitiesStatus(jobsBean.getProcesses(), EntityType.PROCESS)); detailsObject.put(CONFIG, jobsBean.getConfig()); detailsObject.put(CREATION_TIME, jobsBean.getCreationTime()); detailsObject.put(LAST_UPDATE_TIME, jobsBean.getLastUpdatedTime()); detailsObject.put(EXTENSION_LOCATION, extensionBean.getLocation()); detailsObject.put(EXTENSION_TYPE, extensionBean.getExtensionType()); } catch (JSONException e) { LOG.error("Exception while building extension jon details for job {}", jobName, e); } return detailsObject; }
Source:
<code><START> public void loadTSnePlots(String experimentAccession) { <END> DataFileHub.SingleCellExperimentFiles files = dataFileHub.getSingleCellExperimentFiles(experimentAccession); try (TSnePlotStreamer tSnePlotStreamer = new TSnePlotStreamer(files.tSnePlotTsvs)) { tSnePlotStreamer.availablePerplexities() .forEach(p -> tSnePlotDao.loadTSnePlot(experimentAccession, p, tSnePlotStreamer.stream(p))); } }</code><technical_language>methods private. if some other class call them, @Transactional</technical_language>

Target:
private void loadTSnePlots(String experimentAccession) { DataFileHub.SingleCellExperimentFiles files = dataFileHub.getSingleCellExperimentFiles(experimentAccession); try (TSnePlotStreamer tSnePlotStreamer = new TSnePlotStreamer(files.tSnePlotTsvs)) { tSnePlotStreamer.availablePerplexities() .forEach(p -> tSnePlotDao.loadTSnePlot(experimentAccession, p, tSnePlotStreamer.stream(p))); } }
Source:
<code>public void createAssertionWithExplicitProvider_correct() throws IOException { PrivateKey privateKey = ServiceAccountCredentials.privateKeyFromPkcs8(PRIVATE_KEY_PKCS8); List<String> scopes = Arrays.asList("scope1", "scope2"); ServiceAccountCredentials credentials = ServiceAccountCredentials.newBuilder() .setClientId(CLIENT_ID) .setClientEmail(CLIENT_EMAIL) .setPrivateKey(privateKey) .setPrivateKeyId(PRIVATE_KEY_ID) .setScopes(scopes) .setServiceAccountUser(USER) .setProjectId(PROJECT_ID) .setSignatureProvider(defaultRsaSignatureProvider) .build(); JsonFactory jsonFactory = OAuth2Utils.JSON_FACTORY; long currentTimeMillis = Clock.SYSTEM.currentTimeMillis(); String assertion = credentials.createAssertion(jsonFactory, currentTimeMillis, null); JsonWebSignature signature = JsonWebSignature.parse(jsonFactory, assertion); JsonWebToken.Payload payload = signature.getPayload(); assertEquals(CLIENT_EMAIL, payload.getIssuer()); <START> assertEquals(OAuth2Utils.TOKEN_SERVER_URI.toString(), payload.getAudience()); <END> assertEquals(currentTimeMillis / 1000, (long) payload.getIssuedAtTimeSeconds()); assertEquals(currentTimeMillis / 1000 + 3600, (long) payload.getExpirationTimeSeconds()); assertEquals(USER, payload.getSubject()); assertEquals(Joiner.on(' ').join(scopes), payload.get("scope")); }</code><technical_language>change existing methods in this PR--in fact, please harder review--but do try copy bad habits new code</technical_language>

Target:
public void createAssertionWithExplicitProvider_correct() throws IOException { PrivateKey privateKey = ServiceAccountCredentials.privateKeyFromPkcs8(PRIVATE_KEY_PKCS8); List<String> scopes = Arrays.asList("scope1", "scope2"); ServiceAccountCredentials credentials = ServiceAccountCredentials.newBuilder() .setClientId(CLIENT_ID) .setClientEmail(CLIENT_EMAIL) .setPrivateKey(privateKey) .setPrivateKeyId(PRIVATE_KEY_ID) .setScopes(scopes) .setServiceAccountUser(USER) .setProjectId(PROJECT_ID) .setSignatureProvider(defaultRsaSignatureProvider) .build(); long currentTimeMillis = FixedClock.SYSTEM.currentTimeMillis(); String assertion = credentials.createAssertion(OAuth2Utils.JSON_FACTORY, currentTimeMillis, null); JsonWebSignature signature = JsonWebSignature.parse(OAuth2Utils.JSON_FACTORY, assertion); JsonWebToken.Payload payload = signature.getPayload(); assertEquals(CLIENT_EMAIL, payload.getIssuer()); assertEquals(OAuth2Utils.TOKEN_SERVER_URI.toString(), payload.getAudience()); assertEquals(currentTimeMillis / 1000, (long) payload.getIssuedAtTimeSeconds()); assertEquals(currentTimeMillis / 1000 + 3600, (long) payload.getExpirationTimeSeconds()); assertEquals(USER, payload.getSubject()); assertEquals(Joiner.on(' ').join(scopes), payload.get("scope")); }
Source:
<code>private static Command getTargetReconnectionCommand(ISequenceEventEditPart parent, Range parentRange, SequenceMessageEditPart msg) { CompoundCommand result = new CompoundCommand(); Range currentRange = msg.getISequenceEvent().getVerticalRange(); SetMessageRangeOperation smrc = new SetMessageRangeOperation((Edge) msg.getNotationView(), currentRange, true); IGraphicalEditPart source = (IGraphicalEditPart) msg.getSource(); Rectangle sourceBounds; if (source instanceof ISequenceEventEditPart) { Range sourceRange = SequenceEditPartsOperations.getVerticalRange((ISequenceEventEditPart) source); sourceBounds = new Rectangle(0, sourceRange.getLowerBound(), 0, sourceRange.width()); } else if (source instanceof LostMessageEndEditPart) { LostMessageEnd lostMessageEnd = ((LostMessageEndEditPart) source).getLostMessageEnd(); sourceBounds = lostMessageEnd.getProperLogicalBounds().getCopy(); } else { throw new <START> RuntimeException(Messages.ExecutionOperations_invalidMessageSource + String.valueOf(source)); <END> } smrc.setSource(source.getNotationView(), sourceBounds); smrc.setTarget(parent.getNotationView(), new Rectangle(0, parentRange.getLowerBound(), 0, parentRange.width())); result.append(CommandFactory.createRecordingCommand(parent.getEditingDomain(), smrc)); return result; }</code><technical_language>a template "{0}" instead of a concatenation</technical_language>

Target:
private static Command getTargetReconnectionCommand(ISequenceEventEditPart parent, Range parentRange, SequenceMessageEditPart msg) { CompoundCommand result = new CompoundCommand(); Range currentRange = msg.getISequenceEvent().getVerticalRange(); SetMessageRangeOperation smrc = new SetMessageRangeOperation((Edge) msg.getNotationView(), currentRange, true); IGraphicalEditPart source = (IGraphicalEditPart) msg.getSource(); Rectangle sourceBounds; if (source instanceof ISequenceEventEditPart) { Range sourceRange = SequenceEditPartsOperations.getVerticalRange((ISequenceEventEditPart) source); sourceBounds = new Rectangle(0, sourceRange.getLowerBound(), 0, sourceRange.width()); } else if (source instanceof LostMessageEndEditPart) { LostMessageEnd lostMessageEnd = ((LostMessageEndEditPart) source).getLostMessageEnd(); sourceBounds = lostMessageEnd.getProperLogicalBounds().getCopy(); } else { throw new RuntimeException(MessageFormat.format(Messages.ExecutionOperations_invalidMessageSource, String.valueOf(source))); } smrc.setSource(source.getNotationView(), sourceBounds); smrc.setTarget(parent.getNotationView(), new Rectangle(0, parentRange.getLowerBound(), 0, parentRange.width())); result.append(CommandFactory.createRecordingCommand(parent.getEditingDomain(), smrc)); return result; }
Source:
<code>public static VmWatchdog map(WatchDog model, VmWatchdog template) { VmWatchdog entity = template == null ? new VmWatchdog() : template; <START> entity.setAction( VmWatchdogAction.getByName(model.getAction())); <END> entity.setId(new Guid(model.getId())); entity.setModel( VmWatchdogType.getByName(model.getModel())); return entity; }</code><technical_language>mapping /api/restapi/types/WatchdogAction backend enum</technical_language>

Target:
public static VmWatchdog map(WatchDog model, VmWatchdog template) { VmWatchdog entity = template == null ? new VmWatchdog() : template; if (model.isSetAction()) { WatchdogAction wdAction = WatchdogAction.fromValue(model.getAction().toUpperCase()); if (wdAction != null) { entity.setAction(map(wdAction, null)); } } if (model.isSetModel()) { WatchdogModel wdModel = WatchdogModel.fromValue(model.getModel().toUpperCase()); if (wdModel != null) { entity.setModel(map(wdModel, null)); } } entity.setModel(VmWatchdogType.getByName(model.getModel())); entity.setId(new Guid(model.getId())); return entity; }
Source:
<code>public final int parseArguments(final Parameters params) throws CmdLineException { final String token = params.getParameter(0); final String[] tokens = token.split(","); if (tokens.length != 3) { throw new CmdLineException(owner, "change should be specified as " + "<project>,<branch>,<change-id>"); } try { final Change.Key key = Change.Key.parse(tokens[2]); <START> for (final Change change : db.changes().byKey(key)) { <END> if (change.getProject().get().equals(tokens[0]) && change.getDest().getShortName().equals(tokens[1])) { setter.addValue(change.getId()); return 1; } } } catch (IllegalArgumentException e) { throw new CmdLineException(owner, "Change-Id is not valid"); } catch (OrmException e) { throw new CmdLineException(owner, "Database error: " + e.getMessage()); } throw new CmdLineException(owner, "\"" + token + "\": change not found"); }</code><technical_language>branch in query: final Branch.NameKey branch = new Branch.NameKey(new Project.NameKey(tokens[0]), tokens[1]); db.changes().byBranchKey(branch, key) This simplify code</technical_language>

Target:
public final int parseArguments(final Parameters params) throws CmdLineException { final String token = params.getParameter(0); final String[] tokens = token.split(","); if (tokens.length != 3) { throw new CmdLineException(owner, "change should be specified as " + "<project>,<branch>,<change-id>"); } try { final Change.Key key = Change.Key.parse(tokens[2]); final Project.NameKey project = new Project.NameKey(tokens[0]); final Branch.NameKey branch = new Branch.NameKey(project, tokens[1]); for (final Change change : db.changes().byBranchKey(branch, key)) { setter.addValue(change.getId()); return 1; } } catch (IllegalArgumentException e) { throw new CmdLineException(owner, "Change-Id is not valid"); } catch (OrmException e) { throw new CmdLineException(owner, "Database error: " + e.getMessage()); } throw new CmdLineException(owner, "\"" + token + "\": change not found"); }
Source:
<code>public Double getPropeller(int bp) { <START> if (bp < 0 || bp >= getPairingParameters().length) throw new IllegalArgumentException(); <END> return pairingParameters[bp][1]; }</code><technical_language>Please add a message for exception</technical_language>

Target:
public Double getPropeller(int bp) { checkArgument(bp); return pairingParameters[bp][1]; }
Source:
<code>private String getLog(StructuredRecord input) { Schema.Field inputField = input.getSchema().getField(config.inputName); if (inputField == null) { LOG.debug("Invalid inputName, no known inputField matches given input of " + config.inputName); return null; } Schema inputSchema = inputField.getSchema(); if (inputSchema.isNullableSimple()) { inputSchema = inputSchema.getNonNullable(); } Schema.Type inputType = inputSchema.getType(); try { <START> validateInputSchemaType(inputSchema, config.inputName, getContext().getFailureCollector()); <END> } catch (Exception e) { LOG.error(e.getMessage()); } if (Schema.Type.STRING.equals(inputType)) { return input.get(config.inputName); } else { Object data = input.get(config.inputName); if (data instanceof ByteBuffer) { return Bytes.toString((ByteBuffer) input.get(config.inputName)); } else if (data instanceof byte[]) { return Bytes.toString((byte[]) input.get(config.inputName)); } else { LOG.debug("Not a byte type, type is {}", data.getClass().toString()); return null; } } }</code><technical_language>check in line 200 done validation</technical_language>

Target:
private String getLog(StructuredRecord input) { Schema.Field inputField = input.getSchema().getField(config.inputName); if (inputField == null) { LOG.debug("Invalid inputName, no known inputField matches given input of " + config.inputName); return null; } Schema inputSchema = inputField.getSchema(); if (inputSchema.isNullableSimple()) { inputSchema = inputSchema.getNonNullable(); } Schema.Type inputType = inputSchema.getType(); try { validateInputSchemaType(inputSchema, config.inputName); } catch (Exception e) { LOG.error(e.getMessage()); } if (Schema.Type.STRING.equals(inputType)) { return input.get(config.inputName); } else { Object data = input.get(config.inputName); if (data instanceof ByteBuffer) { return Bytes.toString((ByteBuffer) input.get(config.inputName)); } else if (data instanceof byte[]) { return Bytes.toString((byte[]) input.get(config.inputName)); } else { LOG.debug("Not a byte type, type is {}", data.getClass().toString()); return null; } } }
Source:
<code>public String toString() { <START> return "ConnectionPolicy{" + <END> "requestTimeout=" + requestTimeout + ", connectionMode=" + connectionMode + ", maxConnectionPoolSize=" + maxConnectionPoolSize + ", idleHttpConnectionTimeout=" + idleHttpConnectionTimeout + ", idleTcpConnectionTimeout=" + idleTcpConnectionTimeout + ", userAgentSuffix='" + userAgentSuffix + '\'' + ", throttlingRetryOptions=" + throttlingRetryOptions + ", endpointDiscoveryEnabled=" + endpointDiscoveryEnabled + ", preferredRegions=" + preferredRegions + ", multipleWriteRegionsEnabled=" + multipleWriteRegionsEnabled + ", proxyType=" + (proxy != null ? proxy.getType() : null) + ", inetSocketProxyAddress=" + (proxy != null ? proxy.getAddress() : null) + ", readRequestsFallbackEnabled=" + readRequestsFallbackEnabled + ", connectTimeout=" + connectTimeout + ", idleTcpEndpointTimeout=" + idleTcpEndpointTimeout + ", maxConnectionsPerEndpoint=" + maxConnectionsPerEndpoint + ", maxRequestsPerConnection=" + maxRequestsPerConnection + ", tcpConnectionEndpointRediscoveryEnabled=" + tcpConnectionEndpointRediscoveryEnabled + '}'; }</code><technical_language>Please include clientTelemetryEnabled in toString() API</technical_language>

Target:
public String toString() { return "ConnectionPolicy{" + "requestTimeout=" + requestTimeout + ", connectionMode=" + connectionMode + ", maxConnectionPoolSize=" + maxConnectionPoolSize + ", idleHttpConnectionTimeout=" + idleHttpConnectionTimeout + ", idleTcpConnectionTimeout=" + idleTcpConnectionTimeout + ", userAgentSuffix='" + userAgentSuffix + '\'' + ", throttlingRetryOptions=" + throttlingRetryOptions + ", endpointDiscoveryEnabled=" + endpointDiscoveryEnabled + ", preferredRegions=" + preferredRegions + ", multipleWriteRegionsEnabled=" + multipleWriteRegionsEnabled + ", proxyType=" + (proxy != null ? proxy.getType() : null) + ", inetSocketProxyAddress=" + (proxy != null ? proxy.getAddress() : null) + ", readRequestsFallbackEnabled=" + readRequestsFallbackEnabled + ", connectTimeout=" + connectTimeout + ", idleTcpEndpointTimeout=" + idleTcpEndpointTimeout + ", maxConnectionsPerEndpoint=" + maxConnectionsPerEndpoint + ", maxRequestsPerConnection=" + maxRequestsPerConnection + ", tcpConnectionEndpointRediscoveryEnabled=" + tcpConnectionEndpointRediscoveryEnabled + ", clientTelemetryEnabled=" + clientTelemetryEnabled + '}'; }
Source:
<code>private Map<String,String> parseCompoundText (XMLStreamReader xmlr, String endTag) throws XMLStreamException { Map<String,String> returnMap = new HashMap<>(); String text = ""; while (true) { int event = xmlr.next(); if (event == XMLStreamConstants.CHARACTERS) { <START> if (!"".equals(text)) { text += "\n";} <END> text += xmlr.getText().trim().replace('\n',' '); } else if (event == XMLStreamConstants.START_ELEMENT) { if (xmlr.getLocalName().equals("ExtLink")) { String mapKey = ("image".equalsIgnoreCase( xmlr.getAttributeValue(null, "role") ) || "logo".equalsIgnoreCase(xmlr.getAttributeValue(null, "title")))? "logo" : "url"; returnMap.put( mapKey, xmlr.getAttributeValue(null, "URI") ); parseText(xmlr, "ExtLink"); } } else if (event == XMLStreamConstants.END_ELEMENT) { if (xmlr.getLocalName().equals(endTag)) { break; } } } returnMap.put( "name", text ); return returnMap; }</code><technical_language>isEmpty()</technical_language>

Target:
private Map<String,String> parseCompoundText (XMLStreamReader xmlr, String endTag) throws XMLStreamException { Map<String,String> returnMap = new HashMap<>(); String text = ""; while (true) { int event = xmlr.next(); if (event == XMLStreamConstants.CHARACTERS) { if (!text.isEmpty()) { text += "\n";} text += xmlr.getText().trim().replace('\n',' '); } else if (event == XMLStreamConstants.START_ELEMENT) { if (xmlr.getLocalName().equals("ExtLink")) { String mapKey = ("image".equalsIgnoreCase( xmlr.getAttributeValue(null, "role") ) || "logo".equalsIgnoreCase(xmlr.getAttributeValue(null, "title")))? "logo" : "url"; returnMap.put( mapKey, xmlr.getAttributeValue(null, "URI") ); parseText(xmlr, "ExtLink"); } } else if (event == XMLStreamConstants.END_ELEMENT) { if (xmlr.getLocalName().equals(endTag)) break; } } returnMap.put( "name", text ); return returnMap; }
Source:
<code>public void process() { PerformanceMonitor.startActivity("rendering/chunksrefractivereflective"); <START> boolean isHeadUnderWater = worldRenderer.isHeadUnderWater(); <END> preRenderSetupSceneReflectiveRefractive(isHeadUnderWater); worldRenderer.renderChunks(renderQueues.chunksAlphaBlend, ChunkMesh.RenderPhase.REFRACTIVE, playerCamera, WorldRendererImpl.ChunkRenderMode.DEFAULT); postRenderCleanupSceneReflectiveRefractive(isHeadUnderWater); PerformanceMonitor.endActivity(); }</code><technical_language>this boolean a private variable please</technical_language>

Target:
public void process() { PerformanceMonitor.startActivity("rendering/chunksrefractivereflective"); isHeadUnderWater = worldRenderer.isHeadUnderWater(); preRenderSetupSceneReflectiveRefractive(); worldRenderer.renderChunks(renderQueues.chunksAlphaBlend, ChunkMesh.RenderPhase.REFRACTIVE, playerCamera, WorldRendererImpl.ChunkRenderMode.DEFAULT); postRenderCleanupSceneReflectiveRefractive(); PerformanceMonitor.endActivity(); }
Source:
<code>private void setSessionUser(Session session) { User user = getUserResource().getUserByNameAndDomain(session.getUser().getUserName(), <START> session.getUser().getDomain().getName()); <END> session.getUser().setId(user.getId()); session.getUser().setHref(user.getHref()); session.getUser().getDomain().setId(user.getDomain().getId()); session.getUser().getDomain().setHref(user.getDomain().getHref()); }</code><technical_language>suggest check if returned user is null. happen if user removed users table name@domain is in vm_dynamic table</technical_language>

Target:
private void setSessionUser(Session session) { User user = getUserResource().getUserByNameAndDomain(session.getUser().getUserName(), session.getUser().getDomain().getName()); if (user != null) { session.getUser().setId(user.getId()); session.getUser().setHref(user.getHref()); session.getUser().getDomain().setId(user.getDomain().getId()); session.getUser().getDomain().setHref(user.getDomain().getHref()); } }
Source:
<code>public void eachNonZero(VectorProcedure procedure) { for (int i = 0; i < length; i++) { <START> if (Math.abs(get(i))>Vectors.EPS) procedure.apply(i, get(i)); <END> } }</code><technical_language>Please, add spaces get(i) > Vectors.EPS. a arround procedure is a good practice</technical_language>

Target:
public void eachNonZero(VectorProcedure procedure) { for (int i = 0; i < length; i++) { if (Math.abs(get(i)) > Vectors.EPS) { procedure.apply(i, get(i)); } } }