auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public JolieServiceLoader( String code, Expression channelDest, Interpreter currInterpreter ) throws IOException { super( channelDest ); InterpreterParameters interpreterParameters = new InterpreterParameters( currInterpreter.optionArgs(), currInterpreter.getInterpreterParameters().includePaths(), currInterpreter.getInterpreterParameters().libUrls(), <START> new File( "#native_code" ), <END> currInterpreter.getClassLoader(), new ByteArrayInputStream( code.getBytes() ) ); interpreter = new Interpreter( currInterpreter.getClassLoader(), interpreterParameters, currInterpreter.programDirectory() ); }</code><technical_language>generate for embedded piece of code, debugging messages sense</technical_language>

Target:
public JolieServiceLoader( String code, Expression channelDest, Interpreter currInterpreter ) throws IOException { super( channelDest ); InterpreterParameters interpreterParameters = new InterpreterParameters( currInterpreter.optionArgs(), currInterpreter.getInterpreterParameters().includePaths(), currInterpreter.getInterpreterParameters().libUrls(), new File( "#native_code_" + serviceLoaderCounter.getAndIncrement() ), currInterpreter.getClassLoader(), new ByteArrayInputStream( code.getBytes() ) ); interpreter = new Interpreter( currInterpreter.getClassLoader(), interpreterParameters, currInterpreter.programDirectory() ); }
Source:
<code>public SetInputTextureFromFbo(int textureSlot, SimpleUri fboUri, FboTexturesTypes textureType, BaseFBOsManager fboManager, ResourceUrn materialUrn, String shaderParameterName) { this.textureSlot = textureSlot; this.textureType = textureType; this.fbo = fboManager.get(fboUri); this.materialUrn = materialUrn; this.shaderParameterName = shaderParameterName; this.material = getMaterial(materialUrn); propertyChange(null); <START> fboManager.subscribe(this); <END> }</code><technical_language>subscribe POST_FBO_REGENERATION event too</technical_language>

Target:
public SetInputTextureFromFbo(int textureSlot, SimpleUri fboUri, FboTexturesTypes textureType, BaseFBOsManager fboManager, ResourceUrn materialUrn, String shaderParameterName) { this(textureSlot, fboManager.get(fboUri), textureType, fboManager, materialUrn, shaderParameterName); }
Source:
<code>public boolean entityInteract(GlowPlayer player, InteractEntityMessage message) { if (!super.entityInteract(player, message) && message.getAction() == InteractEntityMessage.Action.INTERACT.ordinal()) { ItemStack item = InventoryUtil .itemOrEmpty(player.getInventory().getItem(message.getHandSlot())); int growthAmount = computeGrowthAmount(item.getType()); if (item.getType() == Material.MONSTER_EGG && item.hasItemMeta()) { GlowMetaSpawn meta = (GlowMetaSpawn) item.getItemMeta(); if (meta.hasSpawnedType() && meta.getSpawnedType() == this.getType()) { this.createBaby(); if (player.getGameMode() == GameMode.SURVIVAL || player.getGameMode() == GameMode.ADVENTURE) { <START> player.getInventory().consumeItemInMainHand(); <END> } return true; } } else if (growthAmount > 0) { grow(growthAmount); player.getInventory().consumeItemInMainHand(); return true; } } return false; }</code><technical_language>get hand slot message data</technical_language>

Target:
public boolean entityInteract(GlowPlayer player, InteractEntityMessage message) { if (!super.entityInteract(player, message) && message.getAction() == InteractEntityMessage.Action.INTERACT.ordinal()) { ItemStack item = InventoryUtil .itemOrEmpty(player.getInventory().getItem(message.getHandSlot())); int growthAmount = computeGrowthAmount(item.getType()); if (item.getType() == Material.MONSTER_EGG && item.hasItemMeta()) { GlowMetaSpawn meta = (GlowMetaSpawn) item.getItemMeta(); if (meta.hasSpawnedType() && meta.getSpawnedType() == this.getType()) { this.createBaby(); if (player.getGameMode() == GameMode.SURVIVAL || player.getGameMode() == GameMode.ADVENTURE) { player.getInventory().consumeItem(message.getHand()); } return true; } } else if (growthAmount > 0) { grow(growthAmount); player.getInventory().consumeItem(message.getHand()); return true; } } return false; }
Source:
<code>private void shutdown() { try { LOG.info("Starting to close KafkaConsumer."); kafkaConsumer.close(); LOG.info("Successfully closed KafkaConsumer."); <START> } catch (Exception e) { <END> LOG.error("An error occurred while closing KafkaConsumer!", e); } finally { shutdownLatch.countDown(); } }</code><technical_language>RuntimeException sufficient</technical_language>

Target:
private void shutdown() { try { LOG.debug("Starting to close KafkaConsumer."); kafkaConsumer.close(); LOG.debug("Successfully closed KafkaConsumer."); } catch (RuntimeException e) { LOG.error("An error occurred while closing KafkaConsumer.", e); } finally { shutdownLatch.countDown(); } }
Source:
<code>public T get() { try { <START> T value = delegate.get(); <END> manager.addInstance(value); return value; } catch (Exception e) { throw new ProvisionException("While adding to lifecycle manager", e); } }</code><technical_language>Verify injector set delegate</technical_language>

Target:
public T get() { checkState(delegate != null, "delegate is null"); T value = delegate.get(); try { lifeCycleManager.addInstance(value); } catch (Exception e) { throw new ProvisionException("While adding to lifecycle manager", e); } return value; }
Source:
<code>protected MistDataEvent generateEvent(final I input) { if (extractTimestampFunc == null) { <START> return new MistDataEvent(input, getCurrentTimestamp()); <END> } else { Tuple<V, Long> extractionResult = extractTimestampFunc.apply(input); if (extractionResult.getValue() > latestWatermarkTimestamp) { if (extractionResult.getKey() == null || extractionResult.getValue() == null) { throw new IllegalArgumentException("Timestamp extraction from input data is failed. Data is " + extractionResult.getKey().toString() + ", timestamp is " + extractionResult.getValue().toString()); } return new MistDataEvent(extractionResult.getKey(), extractionResult.getValue()); } else { LOG.log(Level.INFO, "Late data: The data timestamp was later than the latest watermark timestamp."); return null; } } }</code><technical_language>good check late data in this processing-time based event? If user choose punctuated watermark a big watermark, a late data in processing time based event also</technical_language>

Target:
protected MistDataEvent generateEvent(final I input) { if (extractTimestampFunc == null) { long currentTimestamp = getCurrentTimestamp(); if (currentTimestamp > latestWatermarkTimestamp) { return new MistDataEvent(input, currentTimestamp); } else { return null; } } else { Tuple<V, Long> extractionResult = extractTimestampFunc.apply(input); if (extractionResult.getValue() > latestWatermarkTimestamp) { if (extractionResult.getKey() == null || extractionResult.getValue() == null) { throw new IllegalArgumentException("Timestamp extraction from input data is failed. Data is " + extractionResult.getKey().toString() + ", timestamp is " + extractionResult.getValue().toString()); } return new MistDataEvent(extractionResult.getKey(), extractionResult.getValue()); } else { LOG.log(Level.INFO, "Late data: The data timestamp was later than the latest watermark timestamp."); return null; } } }
Source:
<code>public int getNumStages() { <START> return mNumStages; <END> }</code><technical_language>Do need create a separate mNumStages variable? return mFunnel.length a new instance variable</technical_language>

Target:
public int getNumStages() { return mFunnel.length; }
Source:
<code>public Collection<Proposal> getProposals(TypeDefinition type, AbstractNode node, String prefix) { return Lists.newArrayList( new Proposal("array", "array", null, "enum"), new Proposal("boolean", "boolean", null, "enum"), new Proposal("integer", "integer", null, "enum"), <START> new Proposal("null", "null", null, "enum"), END> new Proposal("number", "number", null, "enum"), new Proposal("object", "object", null, "enum"), new Proposal("string", "string", null, "enum")); }</code><technical_language>I added quotes replacement of null type. I created issue #334 "OpenAPI v3: validation rule for null schema types"</technical_language>

Target:
public Collection<Proposal> getProposals(TypeDefinition type, AbstractNode node, String prefix) { return Lists.newArrayList( new Proposal("array", "array", null, "enum"), new Proposal("boolean", "boolean", null, "enum"), new Proposal("integer", "integer", null, "enum"), new Proposal("\"null\"", "null", null, "enum"), new Proposal("number", "number", null, "enum"), new Proposal("object", "object", null, "enum"), new Proposal("string", "string", null, "enum")); }
Source:
<code>public void testDoesNotAllowOuterJoin() { PlanBuilder p = planBuilder(); Symbol a1 = p.symbol("A1"); Symbol b1 = p.symbol("B1"); JoinNode outerJoin = p.join( <START> JoinNode.Type.FULL, <END> p.values(a1), p.values(b1), ImmutableList.of(equiJoinClause(a1, b1)), ImmutableList.of(a1, b1), Optional.empty()); toMultiJoinNode(outerJoin, noLookup(), DEFAULT_JOIN_LIMIT); }</code><technical_language>Import FULL</technical_language>

Target:
public void testDoesNotAllowOuterJoin() { PlanBuilder p = planBuilder(); Symbol a1 = p.symbol("A1"); Symbol b1 = p.symbol("B1"); JoinNode outerJoin = p.join( FULL, p.values(a1), p.values(b1), ImmutableList.of(equiJoinClause(a1, b1)), ImmutableList.of(a1, b1), Optional.empty()); toMultiJoinNode(outerJoin, noLookup(), DEFAULT_JOIN_LIMIT); }
Source:
<code>protected Schema generateSchema() { if (getChild() == null) { return null; } Schema inputSchema = getChild().getSchema(); Schema schema = inputSchema.getSubSchema(gfields); for (int i = 0; i < factories.length; ++i) { <START> schema = Schema.merge(schema, factories[i].generateSchema(inputSchema)); <END> } return schema; }</code><technical_language>I this clearer more verbose: final Schema inputSchema = getChild().getSchema(); final Schema groupingSchema = inputSchema.getSubSchema(gfields); Schema aggSchema = Schema.EMPTY_SCHEMA; for (final AggregatorFactory factory : factories) { aggSchema = Schema.merge(aggSchema, factory.generateSchema(inputSchema)); } return Schema.merge(groupingSchema, aggSchema);</technical_language>

Target:
protected Schema generateSchema() { if (getChild() == null) { return null; } Schema inputSchema = getChild().getSchema(); Schema aggSchema = Schema.EMPTY_SCHEMA; for (int i = 0; i < factories.length; ++i) { aggSchema = Schema.merge(aggSchema, factories[i].generateSchema(inputSchema)); } return Schema.merge(inputSchema.getSubSchema(gfields), aggSchema); }
Source:
<code>public IStructuredSelection convertToResources( IStructuredSelection originalSelection) { List result = new ArrayList(); Iterator elements = originalSelection.iterator(); while (elements.hasNext()) { Object currentElement = elements.next(); IResource resource = ResourceUtil.getResource(currentElement); if (resource == null) { ResourceMapping mapping = ResourceUtil .getResourceMapping(currentElement); if (mapping == null) continue; ResourceTraversal[] traversals = null; try { traversals = mapping.getTraversals( ResourceMappingContext.LOCAL_CONTEXT, new NullProgressMonitor()); } catch (CoreException e) { StatusManager.getManager().handle(e, IDEWorkbenchPlugin.IDE_WORKBENCH); } if (traversals != null) { IResource[] resources = null; for (ResourceTraversal traversal : traversals) { resources = traversal.getResources(); if (resources != null) { for (IResource <START> resource2 : <END> resources) { result.add(resource2); } } } } } else result.add(resource); } if (result.isEmpty()) { return StructuredSelection.EMPTY; } return new StructuredSelection(result.toArray()); }</code><technical_language>rename 'currentResource' 'traversalResource'</technical_language>

Target:
public IStructuredSelection convertToResources( IStructuredSelection originalSelection) { List result = new ArrayList(); Iterator elements = originalSelection.iterator(); while (elements.hasNext()) { Object currentElement = elements.next(); IResource resource = ResourceUtil.getResource(currentElement); if (resource == null) { ResourceMapping mapping = ResourceUtil .getResourceMapping(currentElement); if (mapping == null) continue; ResourceTraversal[] traversals = null; try { traversals = mapping.getTraversals( ResourceMappingContext.LOCAL_CONTEXT, new NullProgressMonitor()); } catch (CoreException e) { StatusManager.getManager().handle(e, IDEWorkbenchPlugin.IDE_WORKBENCH); } if (traversals != null) { IResource[] resources = null; for (ResourceTraversal traversal : traversals) { resources = traversal.getResources(); if (resources != null) { for (IResource traversalResource : resources) { result.add(traversalResource); } } } } } else result.add(resource); } if (result.isEmpty()) { return StructuredSelection.EMPTY; } return new StructuredSelection(result.toArray()); }
Source:
<code>private void init() { inflate(getContext(), R.layout.item_page_list_entry, this); ButterKnife.bind(this); setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); <START> setClickable(true); <END> FeedbackUtil.setToolbarButtonLongPressToast(actionView); actionView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (callback != null) { callback.onActionClick(item); } } }); }</code><technical_language>This cell clickable listener. Do want this</technical_language>

Target:
private void init() { inflate(getContext(), R.layout.item_page_list_entry, this); ButterKnife.bind(this); setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); FeedbackUtil.setToolbarButtonLongPressToast(actionView); }
Source:
<code>public void run() { String threadName = Thread.currentThread().getName(); for (String threadToIgnore : this.threadsToIgnore) { if (threadName.matches(threadToIgnore)) { if (log.isTraceEnabled()) { log.trace(String.format( "Thread with name [%s] matches the regex [%s]. A span will not be created for this Thread.", threadName, threadToIgnore)); } this.actual.run(); return; } } Span span = this.parent; boolean created = false; if (span != null) { <START> span = this.tracer.joinSpan(this.parent.context()); <END> } else { span = this.tracer.nextSpan().name(RXJAVA_COMPONENT).start(); span.tag( this.traceKeys.getAsync().getPrefix() + this.traceKeys.getAsync().getThreadNameKey(), Thread.currentThread().getName()); created = true; } try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span)) { this.actual.run(); } finally { if (created) { span.finish(); } } }</code><technical_language>want joinSpan this. if a span, it</technical_language>

Target:
public void run() { String threadName = Thread.currentThread().getName(); for (String threadToIgnore : this.threadsToIgnore) { if (threadName.matches(threadToIgnore)) { if (log.isTraceEnabled()) { log.trace(String.format( "Thread with name [%s] matches the regex [%s]. A span will not be created for this Thread.", threadName, threadToIgnore)); } this.actual.run(); return; } } Span span = this.parent; boolean created = false; if (span == null) { span = this.tracer.nextSpan().name(RXJAVA_COMPONENT).start(); span.tag( this.traceKeys.getAsync().getPrefix() + this.traceKeys.getAsync().getThreadNameKey(), Thread.currentThread().getName()); created = true; } try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span)) { this.actual.run(); } finally { if (created) { span.finish(); } } }
Source:
<code>protected HandlerRegistration addTimerChangeListener() { if (timerChangeHandler == null) { timerChangeHandler = timer.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { int newInterval; try { newInterval = Integer.valueOf(event.getValue()); } catch (NumberFormatException nfe) { newInterval = timer.getRefreshRate(); } if (timer.isActive()) { if (newInterval != timer.getRefreshRate()) { timer.stop(); timer.setRefreshRate(newInterval); timer.start(); } } else { timer.setRefreshRate(newInterval); } } }); } else { removeTimerChangeHandler(); <START> addTimerChangeListener(); <END> } return timerChangeHandler; }</code><technical_language>Hm, for readability prefer extra method for replace handler logic, for example: protected void addTimerChangeListener() { timerChangeHandler = ... // need return timerChangeHandler field } protected void replaceTimerChangeListener() { if (timerChangeHandler == null) { addTimerChangeListener(); } else { removeTimerChangeHandler(); addTimerChangeListener(); } } This eliminates potential bug removeTimerChangeHandler fail nullify timerChangeHandler reference (for reason) original addTimerChangeListener method stuck in infinite recursion loop</technical_language>

Target:
private void addTimerChangeListener() { timerChangeHandler = timer.addValueChangeHandler(new ValueChangeHandler<Integer>() { @Override public void onValueChange(ValueChangeEvent<Integer> event) { int newInterval = event.getValue(); if (timer.isActive()) { if (newInterval != timer.getRefreshRate()) { timer.stop(); timer.setRefreshRate(newInterval); timer.start(); } } else { timer.setRefreshRate(newInterval); } } }); }
Source:
<code>public synchronized void stop() { if (acceptor != null) { try { <START> acceptor.dispose(); <END> log.info("Stopped Gerrit SSHD"); } finally { acceptor = null; } } }</code><technical_language>Deprecation added in [1] commit message detail. [1] <LINK_0>;a=commitdiff;h=18bcdf797dfba5e462413a6ccce9dd6d3da2025b</technical_language>

Target:
public synchronized void stop() { if (acceptor != null) { try { close(true).await(); } catch (InterruptedException e) { log.warn("Exception caught while closing", e); } finally { acceptor = null; } } }
Source:
<code>protected void onMethodInvocationFound(MethodInvocationTree mit) { if (GET_INSTANCE_METHOD.equals(mit.symbol().name())) { ExpressionTree argument = mit.arguments().get(0); if (argument.is(Tree.Kind.STRING_LITERAL)) { String algorithm = LiteralUtils.trimQuotes(((LiteralTree) argument).value()); if (algorithmKeySizeMap.containsKey(algorithm)) { storeAlgorithmKeySize(algorithm); storeSymbolOfAssignedInstance(mit); } } <START> } else { <END> if (isValidKeyGenSymbolOfInitializeMethod(mit)) { checkAlgorithmParameterToReport(mit.arguments().get(0)).ifPresent(reportString -> reportIssue(mit, reportString)); } } }</code><technical_language>nitpick: need for 2 nested levels, } else if (isValidKeyGenSymbolOfInitializeMethod(mit)) {</technical_language>

Target:
protected void onMethodInvocationFound(MethodInvocationTree mit) { MethodTree methodTree = findEnclosingMethod(mit); String getInstanceArg = ConstantUtils.resolveAsStringConstant(mit.arguments().get(0)); if (methodTree != null && getInstanceArg != null) { MethodVisitor methodVisitor = new MethodVisitor(getInstanceArg); methodTree.accept(methodVisitor); } }
Source:
<code>public FullTextQuery createFullTextQuery(Query luceneQuery, Class<?>... entities) { if (entities.length > 1) { <START> throw new APIException("Can't create FullTextQuery for multiple persistent classes"); <END> } if (log.isDebugEnabled()) { log.debug("Creating new FullTextQuery instance"); } Class<?> entityClass = entities[0]; FullTextQuery query = delegate.createFullTextQuery(luceneQuery, entityClass); if (log.isDebugEnabled()) { log.debug("Notifying FullTextQueryCreated listeners..."); } FullTextQueryAndEntityClass queryAndClass = new FullTextQueryAndEntityClass(query, entityClass); eventPublisher.publishEvent(new FullTextQueryCreatedEvent(queryAndClass)); return query; }</code><technical_language>this a DAOException</technical_language>

Target:
public FullTextQuery createFullTextQuery(Query luceneQuery, Class<?>... entities) { if (entities.length > 1) { throw new DAOException("Can't create FullTextQuery for multiple persistent classes"); } if (log.isDebugEnabled()) { log.debug("Creating new FullTextQuery instance"); } Class<?> entityClass = entities[0]; FullTextQuery query = delegate.createFullTextQuery(luceneQuery, entityClass); if (log.isDebugEnabled()) { log.debug("Notifying FullTextQueryCreated listeners..."); } FullTextQueryAndEntityClass queryAndClass = new FullTextQueryAndEntityClass(query, entityClass); eventPublisher.publishEvent(new FullTextQueryCreatedEvent(queryAndClass)); return query; }
Source:
<code>public ActualProperties visitTopNRowNumber(TopNRowNumberNode node, List<ActualProperties> inputProperties) { ActualProperties properties = Iterables.getOnlyElement(inputProperties); ImmutableList.Builder<LocalProperty<Symbol>> localProperties = ImmutableList.builder(); <START> localProperties.add(new GroupingProperty<>(node.getPartitionBy())); <END> for (Symbol column : node.getOrderingScheme().getOrderBy()) { localProperties.add(new SortingProperty<>(column, node.getOrderingScheme().getOrderings().get(column))); } return ActualProperties.builderFrom(properties) .local(localProperties.build()) .build(); }</code><technical_language>wrong commit</technical_language>

Target:
public ActualProperties visitTopNRowNumber(TopNRowNumberNode node, List<ActualProperties> inputProperties) { ActualProperties properties = Iterables.getOnlyElement(inputProperties); ImmutableList.Builder<LocalProperty<Symbol>> localProperties = ImmutableList.builder(); localProperties.add(new GroupingProperty<>(node.getPartitionBy())); for (Symbol column : node.getOrderingScheme().getOrderBy()) { localProperties.add(new SortingProperty<>(column, node.getOrderingScheme().getOrdering(column))); } return ActualProperties.builderFrom(properties) .local(localProperties.build()) .build(); }
Source:
<code>public void setAgentProtocols(Set<String> protocols) { Set<String> disabled = new TreeSet<>(); Set<String> enabled = new TreeSet<>(); for (AgentProtocol p : AgentProtocol.all()) { String name = p.getName(); if (name != null && !p.isRequired()) { <START> if (p.isOptIn()) { <END> if (protocols.contains(name)) { enabled.add(name); } } else { if (!protocols.contains(name)) { disabled.add(name); } } } } disabledAgentProtocols = fixEmpty(StringUtils.join(disabled, ", ")); enabledAgentProtocols = fixEmpty(StringUtils.join(enabled, ", ")); agentProtocols = null; }</code><technical_language>Is this correct? clear means 'opt-in' -- sounds of 'required', i.e. 'not allowed' (if false)</technical_language>

Target:
public void setAgentProtocols(Set<String> protocols) { Set<String> disabled = new TreeSet<>(); Set<String> enabled = new TreeSet<>(); for (AgentProtocol p : AgentProtocol.all()) { String name = p.getName(); if (name != null && !p.isRequired()) { if (p.isOptIn()) { if (protocols.contains(name)) { enabled.add(name); } } else { if (!protocols.contains(name)) { disabled.add(name); } } } } disabledAgentProtocols = disabled.isEmpty() ? null : new ArrayList<>(disabled); enabledAgentProtocols = enabled.isEmpty() ? null : new ArrayList<>(enabled); agentProtocols = null; }
Source:
<code>public Set<Application> getApplications() { File[] appDefinitions = APPLICATION_DEFINITIONS_FOLDER.toFile().listFiles(); if (appDefinitions == null) { LOGGER.warn("No application-definitions configuration files found."); return Collections.emptySet(); } List<Application> apps = new ArrayList<>(); for (File appDef : appDefinitions) { try { Application app = Boon.fromJson(IOUtils.toString(appDef.toURI()), ApplicationImpl.class); apps.add(app); } catch (IOException e) { LOGGER.warn("Unable to parse application from file ", appDef.getPath()); } } <START> return new TreeSet<>(apps); <END> }</code><technical_language>create a list return a tree set? simply create tree set add returning</technical_language>

Target:
public Set<Application> getApplications() { File[] appDefinitions = APPLICATION_DEFINITIONS_FOLDER.toFile().listFiles(); if (appDefinitions == null) { LOGGER.warn("No application-definitions configuration files found."); return Collections.emptySet(); } Set<Application> apps = new HashSet<>(); for (File appDef : appDefinitions) { try { Application app = Boon.fromJson(IOUtils.toString(appDef.toURI()), ApplicationImpl.class); if (isPermittedToViewFeature(app.getName())) { apps.add(app); } } catch (IOException e) { LOGGER.warn("Unable to parse application from file ", appDef.getPath()); } } return apps; }
Source:
<code>private void registerCustomCredential(final Props props, final Credentials hadoopCred, final String userToProxy) { String credentialClassName = "unknown class"; try { <START> if (!props.containsKey(Constants.ConfigurationKeys.CUSTOM_CREDENTIAL_NAME)) { <END> throw new Exception("can not find settings for credential class"); } credentialClassName = props .get(Constants.ConfigurationKeys.CUSTOM_CREDENTIAL_NAME); logger.info("custom credential class name: " + credentialClassName); final Class metricsClass = Class.forName(credentialClassName); final Constructor[] constructors = metricsClass.getConstructors(); final CredentialProvider customCredential = (CredentialProvider) constructors[0] .newInstance(hadoopCred, props); customCredential.register(userToProxy); } catch (final Exception e) { logger.error("Encountered error while loading and instantiating " + credentialClassName, e); throw new IllegalStateException("Encountered error while loading and instantiating " + credentialClassName, e); } }</code><technical_language>If props.getString line 347 I need this if statement if Constants.ConfigurationKeys.CUSTOM_CREDENTIAL_NAME defined UndefinedPropertyException thrown</technical_language>

Target:
private void registerCustomCredential(final Props props, final Credentials hadoopCred, final String userToProxy) { String credentialClassName = "unknown class"; try { credentialClassName = props .getString(Constants.ConfigurationKeys.CUSTOM_CREDENTIAL_NAME); logger.info("custom credential class name: " + credentialClassName); final Class metricsClass = Class.forName(credentialClassName); final Constructor[] constructors = metricsClass.getConstructors(); final CredentialProvider customCredential = (CredentialProvider) constructors[0] .newInstance(hadoopCred, props); customCredential.register(userToProxy); } catch (final Exception e) { logger.error("Encountered error while loading and instantiating " + credentialClassName, e); throw new IllegalStateException("Encountered error while loading and instantiating " + credentialClassName, e); } }
Source:
<code>public void onCancelled(DatabaseError error) { <START> } <END></code><technical_language>iOS I chose ignore this error data structure useless require some action API consumer</technical_language>

Target:
public void onCancelled(DatabaseError error) { Log.e(TAG, "A fatal error occurred retrieving the necessary keys to populate your adapter."); super.onCancelled(error); }
Source:
<code>void HttpCookie(String domain) { <START> HttpCookie myCookie = new Cookie("name", "val"); <END> myCookie.setDomain(".com"); myCookie.setDomain(".myDomain.com"); myCookie.setDomain(domain); }</code><technical_language>new HttpCookie instead</technical_language>

Target:
void HttpCookie(String domain) { HttpCookie myCookie = new HttpCookie("name", "val"); myCookie.setDomain(".com"); myCookie.setDomain(".myDomain.com"); myCookie.setDomain(domain); }
Source:
<code>private static boolean isLocalhost(String host) { <START> return "localhost".equals(host) || "127.0.0.1".equals(host) || "0.0.0.0".equals(host); <END> }</code><technical_language>need for 0.0.0.0</technical_language>

Target:
private static boolean isLocalhost(String host) { return "localhost".equals(host) || "127.0.0.1".equals(host); }
Source:
<code>private void updateDataSize() { <START> retainedSizeInBytes = INSTANCE_SIZE + sizeOf(valueIsNull) + sizeOf(values) + NULL_VALUE_BLOCK.getRetainedSizeInBytes(); <END> if (blockBuilderStatus != null) { retainedSizeInBytes += BlockBuilderStatus.INSTANCE_SIZE; } }</code><technical_language>This is a constant shared instances, part of retained size</technical_language>

Target:
private void updateDataSize() { retainedSizeInBytes = INSTANCE_SIZE + sizeOf(valueIsNull) + sizeOf(values); if (blockBuilderStatus != null) { retainedSizeInBytes += BlockBuilderStatus.INSTANCE_SIZE; } }
Source:
<code>ListenableFuture<Void> start() { Context ctx = Context.current(); ProgressiveBackoff progressiveBackoff = new ProgressiveBackoff(retrier::newBackoff); AtomicLong committedOffset = new AtomicLong(0); ListenableFuture<Void> callFuture = callAndQueryOnFailureWithRetrier(ctx, committedOffset, progressiveBackoff); callFuture = Futures.catchingAsync( callFuture, Exception.class, (e) -> { Status status = Status.fromThrowable(e); <START> if (status != null && status.getCode() == Code.UNAUTHENTICATED) { <END> callCredentialsProvider.refresh(); return callAndQueryOnFailureWithRetrier(ctx, committedOffset, progressiveBackoff); } else { return Futures.immediateFailedFuture(e); } }, MoreExecutors.directExecutor() ); return Futures.transformAsync( callFuture, (result) -> { long committedSize = committedOffset.get(); long expected = chunker.getSize(); if (committedSize != expected) { String message = format( "write incomplete: committed_size %d for %d total", committedSize, expected); return Futures.immediateFailedFuture(new IOException(message)); } return Futures.immediateFuture(null); }, MoreExecutors.directExecutor()); }</code><technical_language>check for Code.PERMISSION_DENIED here</technical_language>

Target:
ListenableFuture<Void> start() { Context ctx = Context.current(); ProgressiveBackoff progressiveBackoff = new ProgressiveBackoff(retrier::newBackoff); AtomicLong committedOffset = new AtomicLong(0); ListenableFuture<Void> callFuture = callAndQueryOnFailureWithRetrier(ctx, committedOffset, progressiveBackoff); callFuture = Futures.catchingAsync( callFuture, Exception.class, (e) -> { Status status = Status.fromThrowable(e); if (status != null && (status.getCode() == Code.UNAUTHENTICATED || status.getCode() == Code.PERMISSION_DENIED)) { try { callCredentialsProvider.refresh(); } catch (IOException ioe) { e.addSuppressed(ioe); return Futures.immediateFailedFuture(e); } return callAndQueryOnFailureWithRetrier(ctx, committedOffset, progressiveBackoff); } else { return Futures.immediateFailedFuture(e); } }, MoreExecutors.directExecutor() ); return Futures.transformAsync( callFuture, (result) -> { long committedSize = committedOffset.get(); long expected = chunker.getSize(); if (committedSize != expected) { String message = format( "write incomplete: committed_size %d for %d total", committedSize, expected); return Futures.immediateFailedFuture(new IOException(message)); } return Futures.immediateFuture(null); }, MoreExecutors.directExecutor()); }
Source:
<code><START> private int getKeySize(X509Certificate cert){ <END> PublicKey publicKey = cert.getPublicKey(); if (publicKey instanceof RSAPublicKey){ return ((RSAPublicKey)publicKey).getModulus().bitLength(); } return -1; }</code><technical_language>![MINOR](<LINK_1> "getKeySize" a "static" method. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private static int getKeySize(X509Certificate cert){ PublicKey publicKey = cert.getPublicKey(); if (publicKey instanceof RSAPublicKey){ return ((RSAPublicKey)publicKey).getModulus().bitLength(); } return -1; }
Source:
<code>protected void execute(TaskListener listener) throws IOException, InterruptedException { LOGGER.info("Docker Container Watchdog has been triggered"); this.csmMerged = new ContainerNodeNameMapping(); this.loadNodeMap(); for (Cloud c : this.getAllClouds()) { if (!(c instanceof DockerCloud)) { continue; <START> } <END> DockerCloud dc = (DockerCloud) c; LOGGER.info("Checking Docker Cloud '{}'", dc.getDisplayName()); listener.getLogger().println(String.format("Checking Docker Cloud %s", dc.getDisplayName())); this.checkCloud(dc); } this.checkForSuperfluousComputer(); LOGGER.info("Docker Container Watchdog check has been completed"); }</code><technical_language>Instead of Jenkins.getInstance().clouds (and skip non-docker clouds), DockerCloud.instances() obtain list of docker clouds</technical_language>

Target:
protected void execute(TaskListener listener) throws IOException, InterruptedException { if (!JenkinsUtils.getSystemPropertyBoolean(DockerContainerWatchdog.class.getName()+".enabled", true)) { LOGGER.info("Docker Container Watchdog is disabled based on system configuration"); return; } LOGGER.info("Docker Container Watchdog has been triggered"); executionStatistics.writeStatisticsToLog(); executionStatistics.addExecution(); Instant start = clock.instant(); try { ContainerNodeNameMap csmMerged = new ContainerNodeNameMap(); Instant snapshotInstance = clock.instant(); Map<String, Node> nodeMap = loadNodeMap(); try { for (DockerCloud dc : getAllClouds()) { LOGGER.info("Checking Docker Cloud at {}", dc.getDisplayName(), dc.getDockerApi().getDockerHost().getUri()); listener.getLogger().println(String.format("Checking Docker Cloud %s", dc.getDisplayName())); csmMerged = processCloud(dc, nodeMap, csmMerged, snapshotInstance); } if (csmMerged.isContainerListIncomplete()) { LOGGER.info("Not checking the list of nodes, as list of containers is known to be incomplete"); } else { cleanUpSuperfluousComputer(nodeMap, csmMerged, snapshotInstance); } } catch (WatchdogProcessingTimeout timeout) { LOGGER.warn("Processing of cleanup watchdog took too long; current timeout value: ms, " + "watchdog started on {}", PROCESSING_TIMEOUT_IN_MS, start.toString(), timeout); executionStatistics.addProcessingTimeout(); executionStatistics.addOverallRuntime(Duration.between(start, clock.instant()).toMillis()); return; } } finally { Instant stop = clock.instant(); executionStatistics.addOverallRuntime(Duration.between(start, stop).toMillis()); } LOGGER.info("Docker Container Watchdog check has been completed"); }
Source:
<code>protected PageRec doCreatePage(IWorkbenchPart part) { Page page = createPage(part); PageSite site = new PageSite(this.getViewSite()); <START> page.init(site); <END> page.createControl(this.getPageBook()); return new PageBookView.PageRec(part, page); }</code><technical_language>This null, createPage</technical_language>

Target:
protected PageRec doCreatePage(IWorkbenchPart part) { Page page = createMinimapPage(part); PageSite site = new PageSite(this.getViewSite()); page.init(site); page.createControl(this.getPageBook()); return new PageBookView.PageRec(part, page); }
Source:
<code>public void getBlobTestFailure() { <START> blobStore.containerExists(CONTAINER_TEMP); <END> blobStore.createContainerInLocation(null, CONTAINER_TEMP); Blob blob = blobStore.blobBuilder(smallFile.getName()) .payload(new FilePayload(smallFile)) .build(); blobStore.putBlob(CONTAINER, blob); blobStore.getBlob(CONTAINER, smallFile.getName()); blobStore.clearContainer(CONTAINER_TEMP); blobStore.deleteContainer(CONTAINER_TEMP); }</code><technical_language>tests supposed do in parallel class? I run CloudFilesUSBlobIntegrationParallelLiveTest.getBlobTestFailure fails changes createContainerInLocation</technical_language>

Target:
public void getBlobTestFailure() { blobStore.containerExists(CONTAINER_TEMP); blobStore.createContainerInLocation(null, CONTAINER_TEMP); Blob blob = blobStore.blobBuilder(smallFile.getName()) .payload(new FilePayload(smallFile)) .build(); blobStore.putBlob(CONTAINER_TEMP, blob); blobStore.getBlob(CONTAINER_TEMP, smallFile.getName()); blobStore.clearContainer(CONTAINER_TEMP); blobStore.deleteContainer(CONTAINER_TEMP); }
Source:
<code>public void testWrongParams() throws CorruptObjectException, UnmergedPathException, IOException { Git git = new Git(db); try { git.commit().setAuthor(author).run(); <START> fail("Didn't got the expected exception"); <END> } catch (IllegalArgumentException e) { } }</code><technical_language>typo: s/got/get/</technical_language>

Target:
public void testWrongParams() throws CorruptObjectException, UnmergedPathException, IOException { final Git git = new Git(db); try { git.commit().setAuthor(author).call(); fail("Didn't get the expected exception"); } catch (final IllegalArgumentException e) { assertEquals(e.getMessage(), CommitCommand.COMMIT_MESSAGE_NOT_SPECIFIED); } }
Source:
<code>protected Toolbar createMainToolbar() { toolbar_ = new Toolbar("Tutorial Tab"); <START> toolbar_.addLeftWidget(homeButton_ = <END> commands_.tutorialHome().createToolbarButton()); toolbar_.addLeftWidget(commands_.tutorialPopout().createToolbarButton()); toolbar_.addLeftWidget(commands_.tutorialStop().createToolbarButton()); toolbar_.addRightWidget(commands_.tutorialRefresh().createToolbarButton()); return toolbar_; }</code><technical_language>need added homeButton_ member variable</technical_language>

Target:
protected Toolbar createMainToolbar() { toolbar_ = new Toolbar("Tutorial Tab"); toolbar_.addLeftWidget(commands_.tutorialHome().createToolbarButton()); toolbar_.addLeftWidget(commands_.tutorialPopout().createToolbarButton()); toolbar_.addLeftWidget(commands_.tutorialStop().createToolbarButton()); toolbar_.addRightWidget(commands_.tutorialRefresh().createToolbarButton()); return toolbar_; }
Source:
<code><START> public RelationTypeSchemaDescriptor( int relTypeId, int... propertyIds ) <END> { this.relTypeId = relTypeId; this.propertyIds = propertyIds; }</code><technical_language>pretty is a factory for making these, public constructor required. (Took a lot of refactoring achieve that, uphold flag.)</technical_language>

Target:
RelationTypeSchemaDescriptor( int relTypeId, int... propertyIds ) { this.relTypeId = relTypeId; this.propertyIds = propertyIds; }
Source:
<code>private void buildErrataDetailPanel() { errataDetailPanel.clear(); errataDetailFormPanel = new GeneralFormPanel(); errataTitle = new Span(); errataTitle.setStyleName(style.errataTitleLabel()); FlowPanel errataTitlePanel = new FlowPanel(); errataTitlePanel.setStyleName(style.errataTitlePanel()); errataTitlePanel.add(errataTitle); errataDetailPanel.add(errataTitlePanel); <START> errataDetailPanel.setStyleName("testtest"); END> errataDetailPanel.add(errataDetailFormPanel); }</code><technical_language>style name wrong? style.something()</technical_language>

Target:
private void buildErrataDetailPanel() { errataDetailPanel.clear(); errataDetailFormPanel = new GeneralFormPanel(); errataTitle = new Span(); errataTitle.setStyleName(style.errataTitleLabel()); FlowPanel errataTitlePanel = new FlowPanel(); errataTitlePanel.setStyleName(style.errataTitlePanel()); errataTitlePanel.add(errataTitle); errataDetailPanel.add(errataTitlePanel); errataDetailPanel.add(errataDetailFormPanel); }
Source:
<code>private AudioStream getDefaultAudioStream() { <START> int streamIndex = ListHelper.getDefaultAudioFormat(activity, currentInfo.getAudioStreams()); <END> return currentInfo.getAudioStreams().get(streamIndex); }</code><technical_language>This final</technical_language>

Target:
private AudioStream getDefaultAudioStream() { final List<AudioStream> audioStreams = currentInfo.getAudioStreams(); final int streamIndex = ListHelper.getDefaultAudioFormat(activity, audioStreams); return audioStreams.get(streamIndex); }
Source:
<code><START> public void cellValue(ByteString newValue) { <END> if (newValue == null || newValue.isEmpty()) { return; } if (nextValueIndex == -1) { this.value = newValue.toByteArray(); nextValueIndex = newValue.size(); } else { int newValueSize = newValue.size(); Preconditions.checkState( Integer.MAX_VALUE - nextValueIndex > newValueSize, "value would be too large to contain"); this.value = Arrays.copyOf(this.value, nextValueIndex + newValueSize); System.arraycopy(newValue.toByteArray(), 0, this.value, nextValueIndex, newValueSize); nextValueIndex += newValueSize; } }</code><technical_language>current implementation sense me. I suggest this instead? java public void cellValue(ByteString newValue) { // Optimize unsplit cells avoiding a copy if (nextValueIndex == -1) { this.value = ByteStringer.extract(newValue); nextValueIndex = newValue.size(); return; } Preconditions.checkState(nextValueIndex + newValue.size() <= value.length, "Cell is larger expected"); newValue.copyTo(this.value, this.nextValueIndex); nextValueIndex += newValue.size(); }</technical_language>

Target:
public void cellValue(ByteString newValue) { if (nextValueIndex == -1) { this.value = ByteStringer.extract(newValue); nextValueIndex = newValue.size(); return; } Preconditions.checkState( nextValueIndex + newValue.size() <= value.length, "Cell value is larger than expected"); newValue.copyTo(this.value, this.nextValueIndex); nextValueIndex += newValue.size(); }
Source:
<code>public List<String> getLabels() { <START> return null; <END> }</code><technical_language>Throw unsupported operation exception here</technical_language>

Target:
public List<String> getLabels() { throw new UnsupportedOperationException(); }
Source:
<code>private SymbolProviderManager(@NonNull List<@NonNull SymbolProviderFactoryWrapper> providers) { <START> fProviders = ImmutableList.<SymbolProviderFactoryWrapper> copyOf(providers); <END> }</code><technical_language><SymbolProviderFactoryWrapper> here, copyOf() is smart things</technical_language>

Target:
private SymbolProviderManager(@NonNull List<@NonNull SymbolProviderFactoryWrapper> providers) { fProviders = ImmutableList.copyOf(providers); }
Source:
<code>public void dispose() { GitProjectData.removeRepositoryChangeListener(repoChangeListener); <START> Activator.getDefault().getIndexDiffCache().removeIndexDiffChangedListener(indexDiffChangeListener); <END> super.dispose(); }</code><technical_language>This causing NPEs shutdown for me</technical_language>

Target:
public void dispose() { GitProjectData.removeRepositoryChangeListener(repoChangeListener); IndexDiffCache indexDiffCache = Activator.getDefault() .getIndexDiffCache(); if (indexDiffCache != null) indexDiffCache .removeIndexDiffChangedListener(indexDiffChangeListener); super.dispose(); }
Source:
<code><START> private StateLogComponents createLogComponentsForServer( <END> DataSource dataSource, NamespaceAndUseCase namespaceAndUseCase) { Client client = namespaceAndUseCase.namespace(); String paxosUseCase = namespaceAndUseCase.useCase(); PaxosStateLog<PaxosValue> learnerLog = SqlitePaxosStateLog.create( ImmutableNamespaceAndUseCase.of( client, LearnerUseCase.createLearnerUseCase(paxosUseCase).value()), dataSource); PaxosStateLog<PaxosAcceptorState> acceptorLog = SqlitePaxosStateLog.create( ImmutableNamespaceAndUseCase.of( client, AcceptorUseCase.createAcceptorUseCase(paxosUseCase).value()), dataSource); return StateLogComponents.builder() .dataSource(dataSource) .learnerLog(learnerLog) .acceptorLog(acceptorLog) .build(); }</code><technical_language>others in this class</technical_language>

Target:
private static StateLogComponents createLogComponentsForServer( DataSource dataSource, NamespaceAndUseCase namespaceAndUseCase) { Client client = namespaceAndUseCase.namespace(); String paxosUseCase = namespaceAndUseCase.useCase(); PaxosStateLog<PaxosValue> learnerLog = SqlitePaxosStateLog.create( ImmutableNamespaceAndUseCase.of( client, LearnerUseCase.createLearnerUseCase(paxosUseCase).value()), dataSource); PaxosStateLog<PaxosAcceptorState> acceptorLog = SqlitePaxosStateLog.create( ImmutableNamespaceAndUseCase.of( client, AcceptorUseCase.createAcceptorUseCase(paxosUseCase).value()), dataSource); return StateLogComponents.builder() .dataSource(dataSource) .learnerLog(learnerLog) .acceptorLog(acceptorLog) .build(); }
Source:
<code>public void testWhereColumnEqualsValues() throws Exception { indexBulkDocuments(INDEX_NAME, 10); <START> try (DataSet ds = dataContext <END> .query() .from(DEFAULT_TABLE_NAME) .select("user") .and("message") .where("user") .isEquals("user4") .execute()) { assertEquals(ElasticSearchRestDataSet.class, ds.getClass()); assertTrue(ds.next()); assertEquals("Row[values=[user4, 4]]", ds.getRow().toString()); assertFalse(ds.next()); } }</code><technical_language>a name for "ds", (dataSet)</technical_language>

Target:
public void testWhereColumnEqualsValues() throws Exception { indexBulkDocuments(INDEX_NAME, 10); try (final DataSet dataSet = dataContext .query() .from(DEFAULT_TABLE_NAME) .select("user") .and("message") .where("user") .isEquals("user4") .execute()) { assertEquals(ElasticSearchRestDataSet.class, dataSet.getClass()); assertTrue(dataSet.next()); assertEquals("Row[values=[user4, 4]]", dataSet.getRow().toString()); assertFalse(dataSet.next()); } }
Source:
<code>Map<String, Long> getCompactionProgress(String partitionPath) throws BlobStorageException { ByteArrayOutputStream baos = new ByteArrayOutputStream(64); <START> boolean hasCheckpoint = azureBlobDataAccessor.downloadFile(CHECKPOINT_CONTAINER, partitionPath, baos, false); <END> if (!hasCheckpoint) { return emptyCheckpoints; } try { ObjectNode jsonNode = (ObjectNode) objectMapper.readTree(baos.toString()); Map<String, Long> checkpoints = new HashMap<>(); for (String fieldName : new String[]{CloudBlobMetadata.FIELD_DELETION_TIME, CloudBlobMetadata.FIELD_EXPIRATION_TIME}) { checkpoints.put(fieldName, jsonNode.has(fieldName) ? jsonNode.get(fieldName).longValue() : DEFAULT_TIME); } return checkpoints; } catch (IOException e) { logger.error("Could not retrieve compaction progress for {}", partitionPath, e); azureMetrics.compactionProgressReadErrorCount.inc(); return emptyCheckpoints; } }</code><technical_language>retries for retry-able error</technical_language>

Target:
Map<String, Long> getCompactionProgress(String partitionPath) throws CloudStorageException { String payload = requestAgent.doWithRetries( () -> { ByteArrayOutputStream baos = new ByteArrayOutputStream(CHECKPOINT_BUFFER_SIZE); boolean hasCheckpoint = azureBlobDataAccessor.downloadFile(CHECKPOINT_CONTAINER, partitionPath, baos, false); return hasCheckpoint ? baos.toString() : null; }, "Download compaction checkpoint", partitionPath); if (payload == null) { return new HashMap(emptyCheckpoints); } try { ObjectNode jsonNode = (ObjectNode) objectMapper.readTree(payload); Map<String, Long> checkpoints = new HashMap<>(); for (String fieldName : compactionFields) { checkpoints.put(fieldName, jsonNode.has(fieldName) ? jsonNode.get(fieldName).longValue() : DEFAULT_TIME); } return checkpoints; } catch (IOException e) { logger.error("Could not retrieve compaction progress for {}", partitionPath, e); azureMetrics.compactionProgressReadErrorCount.inc(); return new HashMap(emptyCheckpoints); } }
Source:
<code>public void write(CorfuPayloadMsg<WriteRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { log.debug("log write: global: {}, streams: {}", msg.getPayload().getToken(), msg.getPayload().getData().getBackpointerMap()); LogData logData = (LogData) msg.getPayload().getData(); batchWriter.addTask(WRITE, msg) .thenAccept(Void -> { dataCache.put(msg.getPayload().getGlobalAddress(), logData); r.sendResponse(ctx, msg, CorfuMsgType.WRITE_OK.msg()); }).exceptionally(ex -> { handleException(ex, ctx, msg, r); return null; <START> }); <END> }</code><technical_language>I return null. please replace exceptionally() handle(...) whenCompleted(...)</technical_language>

Target:
public void write(CorfuPayloadMsg<WriteRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { log.debug("log write: global: {}, streams: {}", msg.getPayload().getToken(), msg.getPayload().getData().getBackpointerMap()); LogData logData = (LogData) msg.getPayload().getData(); batchWriter.addTask(WRITE, msg) .thenRunAsync(() -> { dataCache.put(msg.getPayload().getGlobalAddress(), logData); r.sendResponse(ctx, msg, CorfuMsgType.WRITE_OK.msg()); }, executor).exceptionally(ex -> { handleException(ex, ctx, msg, r); return null; }); }