auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static ICPPExecution getConstructorChainExecution(IASTNode def) { ICPPASTFunctionDefinition fnDef = getFunctionDefinition(def); if (fnDef != null) { final ICPPASTConstructorChainInitializer[] ccInitializers = fnDef.getMemberInitializers(); <START> final List<Pair<IBinding, ICPPEvaluation>> resultPairs = new ArrayList<Pair<IBinding, ICPPEvaluation>>(); <END> for(ICPPASTConstructorChainInitializer ccInitializer : ccInitializers) { final IBinding member = ccInitializer.getMemberInitializerId().resolveBinding(); if(member instanceof ICPPField) { final ICPPField fieldMember = (ICPPField)member; final ICPPEvaluation memberEval = getMemberEvaluation(fieldMember, ccInitializer, fnDef); final Pair<IBinding, ICPPEvaluation> resultPair = new Pair<IBinding, ICPPEvaluation>(fieldMember, memberEval); resultPairs.add(resultPair); } else if(member instanceof ICPPConstructor) { final ICPPConstructor ctorMember = (ICPPConstructor)member; final IASTInitializer initializer = ccInitializer.getInitializer(); if (initializer instanceof ICPPASTConstructorInitializer) { final ICPPClassType baseClassType = (ICPPClassType)ctorMember.getOwner(); EvalConstructor memberEval = new EvalConstructor(baseClassType, ctorMember, EvalConstructor.extractArguments(initializer), fnDef); final Pair<IBinding, ICPPEvaluation> resultPair = new Pair<IBinding, ICPPEvaluation>(ctorMember, memberEval); resultPairs.add(resultPair); } } } return new ExecConstructorChain(resultPairs); } return null; }</code><technical_language>In Java 7, write "new ArrayList<>()" here</technical_language>

Target:
public static ICPPExecution getConstructorChainExecution(IASTNode def) { ICPPASTFunctionDefinition fnDef = getFunctionDefinition(def); if (fnDef != null) { final ICPPASTConstructorChainInitializer[] ccInitializers = fnDef.getMemberInitializers(); final List<Pair<IBinding, ICPPEvaluation>> resultPairs = new ArrayList<>(); for(ICPPASTConstructorChainInitializer ccInitializer : ccInitializers) { final IBinding member = ccInitializer.getMemberInitializerId().resolveBinding(); if(member instanceof ICPPField) { final ICPPField fieldMember = (ICPPField)member; final ICPPEvaluation memberEval = getMemberEvaluation(fieldMember, ccInitializer, fnDef); final Pair<IBinding, ICPPEvaluation> resultPair = new Pair<>(fieldMember, memberEval); resultPairs.add(resultPair); } else if(member instanceof ICPPConstructor) { final ICPPConstructor ctorMember = (ICPPConstructor)member; final IASTInitializer initializer = ccInitializer.getInitializer(); if (initializer instanceof ICPPASTConstructorInitializer) { final ICPPClassType baseClassType = (ICPPClassType)ctorMember.getOwner(); EvalConstructor memberEval = new EvalConstructor(baseClassType, ctorMember, EvalConstructor.extractArguments(initializer), fnDef); final Pair<IBinding, ICPPEvaluation> resultPair = new Pair<IBinding, ICPPEvaluation>(ctorMember, memberEval); resultPairs.add(resultPair); } } } return new ExecConstructorChain(resultPairs); } return null; }
Source:
<code>public void setProduct(ProductDto productDto) { <START> Brand brand = productDto.getBrand(); <END> $(brandName).text(brand.getValue()); Product product = productDto.getProduct(); $(productName).text(product.getName()); $(productDescription).text(product.getDescription()); $(priceText).text(String.valueOf(product.getPrice() + " $")); productImage.setResource(productBrandUtil.getImage(product, brand)); if (product.equals(Product.SHIRT)) { $(productImageDiv).css("background-color", Colors.getBrandColor(brand)); $(productInfoDiv).css("background-color", Colors.getBrandColor(brand)); } else { $(productImageDiv).css("background-color", ""); $(productInfoDiv).css("background-color", ""); } setAnchorToProduct(previous, product.getPreviousProduct()); setAnchorToProduct(next, product.getNextProduct()); }</code><technical_language>Group Brand brand = ... Product product = ... together</technical_language>

Target:
public void setProduct(ProductDto productDto) { Brand brand = productDto.getBrand(); Product product = productDto.getProduct(); $(brandName).text(brand.getValue()); $(productName).text(product.getName()); $(productDescription).text(product.getDescription()); $(priceText).text(String.valueOf(product.getPrice() + " $")); productImage.setResource(productBrandUtil.getImage(product, brand)); if (product.equals(Product.SHIRT)) { $(productImageDiv).css("background-color", Colors.getBrandColor(brand)); $(productInfoDiv).css("background-color", Colors.getBrandColor(brand)); $(sizeDiv).show(); } else { $(productImageDiv).css("background-color", ""); $(productInfoDiv).css("background-color", ""); $(sizeDiv).hide(); } setAnchorToProduct(previous, product.getPreviousProduct()); setAnchorToProduct(next, product.getNextProduct()); }
Source:
<code>private void injectAccountAndContainerUsingServiceId(RestRequest restRequest) throws RestServiceException { String accountName = getServiceId(restRequest); Account targetAccount = accountService.getAccountByName(accountName); if (targetAccount == null) { frontendMetrics.unrecognizedServiceIdCount.inc(); if (frontendConfig.frontendAllowUnrecognizedAccountAndContainerForPreContainerizationRequest) { logger.debug( "Account cannot be found for accountName={} in put request with serviceId. Setting targetAccount to UNKNOWN_ACCOUNT", accountName); targetAccount = Account.UNKNOWN_ACCOUNT; } else { throw new RestServiceException( "Account cannot be found for accountName=" + accountName + " in put request with serviceId", RestServiceErrorCode.InvalidAccount); } } boolean isBlobPrivate = isPrivate(restRequest.getArgs()); Container targetContainer = targetAccount.getContainerById( isBlobPrivate ? Container.DEFAULT_PRIVATE_CONTAINER_ID : Container.DEFAULT_PUBLIC_CONTAINER_ID); <START> if (targetContainer == null) { <END> frontendMetrics.missingDefaultContainerCount.inc(); if (frontendConfig.frontendAllowUnrecognizedAccountAndContainerForPreContainerizationRequest) { logger.debug( "Container cannot be identified for accountName={} and isPrivate={} in put request with serviceId. " + "Setting targetAccount to UNKNOWN_ACCOUNT, targetContainer to UNKNOWN_CONTAINER", accountName, isBlobPrivate); targetAccount = Account.UNKNOWN_ACCOUNT; targetContainer = Container.UNKNOWN_CONTAINER; } else { throw new RestServiceException( "Container cannot be identified for accountName=" + accountName + " and isPrivate=" + isBlobPrivate + " in put request with serviceId.", RestServiceErrorCode.InvalidContainer); } } setTargetAccountAndContainerInRestRequest(restRequest, targetAccount, targetContainer); }</code><technical_language>target container if account in this case? default containers, a misconfiguration of account, it</technical_language>

Target:
private void injectAccountAndContainerUsingServiceId(RestRequest restRequest) throws RestServiceException { String accountName = getHeader(restRequest.getArgs(), Headers.SERVICE_ID, false); Account targetAccount = accountService.getAccountByName(accountName); if (targetAccount == null) { frontendMetrics.unrecognizedServiceIdCount.inc(); logger.debug( "Account cannot be found for accountName={} in put request with serviceId. Setting targetAccount to UNKNOWN_ACCOUNT", accountName); targetAccount = Account.UNKNOWN_ACCOUNT; } boolean isBlobPrivate = isPrivate(restRequest.getArgs()); Container targetContainer = targetAccount.getContainerById( isBlobPrivate ? Container.DEFAULT_PRIVATE_CONTAINER_ID : Container.DEFAULT_PUBLIC_CONTAINER_ID); setTargetAccountAndContainerInRestRequest(restRequest, targetAccount, targetContainer); }
Source:
<code>private void conditionallyAddHost(List<Host> agentBasedHosts, Host host) { <START> if (host == null) { <END> if (LOG.isTraceEnabled()) { LOG.trace("trying to add no host to a list"); } return; } if (host.getResourceState() == ResourceState.Creating) { if (LOG.isTraceEnabled()) { LOG.trace(String.format("host is in creating state, not adding to the host list, (id = %s)", host.getUuid())); } return; } if (host.getResourceState() == ResourceState.Error) { if (LOG.isTraceEnabled()) { LOG.trace(String.format("host is in error state, not adding to the host list, (id = %s)", host.getUuid())); } return; } if (host.getType() != Host.Type.Routing && host.getType() != Host.Type.ConsoleProxy && host.getType() != Host.Type.SecondaryStorage && host.getType() != Host.Type.SecondaryStorageVM) { if (LOG.isTraceEnabled()) { LOG.trace(String.format("host is of wrong type, not adding to the host list, (id = %s, type = %s)", host.getUuid(), host.getType())); } return; } if (host.getHypervisorType() != null && ! (host.getHypervisorType() == Hypervisor.HypervisorType.KVM || host.getHypervisorType() == Hypervisor.HypervisorType.LXC)) { if (LOG.isTraceEnabled()) { LOG.trace(String.format("hypervisor is not the right type, not adding to the host list, (id = %s, hypervisortype = %s)", host.getUuid(), host.getHypervisorType())); } return; } agentBasedHosts.add(host); }</code><technical_language>do null checks if host is removed is some unsupported state error etc.</technical_language>

Target:
private void conditionallyAddHost(List<Host> agentBasedHosts, Host host) { if (host == null) { if (LOG.isTraceEnabled()) { LOG.trace("trying to add no host to a list"); } return; } EnumSet<ResourceState> allowedStates = EnumSet.of( ResourceState.Enabled, ResourceState.Maintenance, ResourceState.Disabled, ResourceState.ErrorInMaintenance, ResourceState.PrepareForMaintenance); if (!allowedStates.contains(host.getResourceState())) { if (LOG.isTraceEnabled()) { LOG.trace(String.format("host is in '%s' state, not adding to the host list, (id = %s)", host.getResourceState(), host.getUuid())); } return; } if (host.getType() != Host.Type.Routing && host.getType() != Host.Type.ConsoleProxy && host.getType() != Host.Type.SecondaryStorage && host.getType() != Host.Type.SecondaryStorageVM) { if (LOG.isTraceEnabled()) { LOG.trace(String.format("host is of wrong type, not adding to the host list, (id = %s, type = %s)", host.getUuid(), host.getType())); } return; } if (host.getHypervisorType() != null && ! (host.getHypervisorType() == Hypervisor.HypervisorType.KVM || host.getHypervisorType() == Hypervisor.HypervisorType.LXC)) { if (LOG.isTraceEnabled()) { LOG.trace(String.format("hypervisor is not the right type, not adding to the host list, (id = %s, hypervisortype = %s)", host.getUuid(), host.getHypervisorType())); } return; } agentBasedHosts.add(host); }
Source:
<code>public void shouldThrowExceptionIfTemplateIsMalformed() throws Exception { <START> when(settingsFacade.getRawConfig(INCORRECT_TEMPLATE)).thenReturn(loadFile(INCORRECT_TEMPLATE)); <END> try { parser.mergeTemplateIntoString(INCORRECT_TEMPLATE, params); } finally { verify(settingsFacade, times(1)).getRawConfig(INCORRECT_TEMPLATE); } }</code><technical_language>close stream (use try resource)</technical_language>

Target:
public void shouldThrowExceptionIfTemplateIsMalformed() throws Exception { try (FileInputStream template = loadFile(INCORRECT_TEMPLATE)) { when(settingsFacade.getRawConfig(INCORRECT_TEMPLATE)).thenReturn(template); parser.mergeTemplateIntoString(INCORRECT_TEMPLATE, params); } finally { verify(settingsFacade).getRawConfig(INCORRECT_TEMPLATE); } }
Source:
<code>boolean invoke(Object receiver, String methodName, String argument) { try { <START> Method method = TextView.class.getMethod(methodName, mArgType); <END> method.invoke(receiver, convertArgument(argument)); return true; } catch (NoSuchMethodException e) { LogUtil.w("Method with name " + methodName + " and argument of type " + mArgType.getSimpleName() + " not found"); } catch (InvocationTargetException e) { LogUtil.w("InvocationTargetException: " + e.getMessage()); } catch (IllegalAccessException e) { LogUtil.w("IllegalAccessException: " + e.getMessage()); } catch (IllegalArgumentException e) { LogUtil.w("IllegalArgumentException: " + e.getMessage()); } return false; }</code><technical_language>this is hard-coded for TextView</technical_language>

Target:
boolean invoke(Object receiver, String methodName, String argument) { try { Method method = receiver.getClass().getMethod(methodName, mArgType); method.invoke(receiver, convertArgument(argument)); return true; } catch (NoSuchMethodException ignored) { } catch (InvocationTargetException e) { LogUtil.w("InvocationTargetException: " + e.getMessage()); } catch (IllegalAccessException e) { LogUtil.w("IllegalAccessException: " + e.getMessage()); } catch (IllegalArgumentException e) { LogUtil.w("IllegalArgumentException: " + e.getMessage()); } return false; }
Source:
<code>protected List<String> buildRetrieveStatusCommand() { String cmd = "if test -s "+exitStatusPath+"; then"+"\n"+ " cat "+exitStatusPath+"\n"+ "elif test -s "+pidPath+"; then"+"\n"+ " pid=`cat "+pidPath+"`"+"\n"+ " if ! ps -p $pid > /dev/null < /dev/null; then"+"\n"+ " # no exit status, and not executing; give a few seconds grace in case just about to write exit status"+"\n"+ " sleep 3"+"\n"+ " if test -s "+exitStatusPath+"; then"+"\n"+ " cat "+exitStatusPath+""+"\n"+ " else"+"\n"+ <START> " echo \"No exit status in a.exitstatus, and pid in a.pid ($pid) not executing\""+"\n"+ <END> " exit 1"+"\n"+ " fi"+"\n"+ " fi"+"\n"+ "else"+"\n"+ " echo \"No exit status in "+exitStatusPath+", and "+pidPath+" is empty\""+"\n"+ " exit 1"+"\n"+ "fi"+"\n"; MutableList.Builder<String> cmds = MutableList.<String>builder() .add((runAsRoot ? BashCommands.sudo(cmd) : cmd)) .add("RESULT=$?"); cmds.add("exit $RESULT"); return cmds.build(); }</code><technical_language>a.exitstatus a.pid meant variable interpolations</technical_language>

Target:
protected List<String> buildRetrieveStatusCommand() { List<String> cmdParts = ImmutableList.of( "# Retrieve status", "if test -s "+exitStatusPath+"; then", " cat "+exitStatusPath, "elif test -s "+pidPath+"; then", " pid=`cat "+pidPath+"`", " if ! ps -p $pid > /dev/null < /dev/null; then", " # no exit status, and not executing; give a few seconds grace in case just about to write exit status", " sleep 3", " if test -s "+exitStatusPath+"; then", " cat "+exitStatusPath+"", " else", " echo \"No exit status in "+exitStatusPath+", and pid in "+pidPath+" ($pid) not executing\"", " exit 1", " fi", " fi", "else", " echo \"No exit status in "+exitStatusPath+", and "+pidPath+" is empty\"", " exit 1", "fi"+"\n"); String cmd = Joiner.on("\n").join(cmdParts); MutableList.Builder<String> cmds = MutableList.<String>builder() .add((runAsRoot ? BashCommands.sudo(cmd) : cmd)) .add("RESULT=$?"); cmds.add("exit $RESULT"); return cmds.build(); }
Source:
<code><START> public void close() throws IOException <END> { if ( treeState.compareAndSet(TreeState.STARTED, TreeState.CLOSED) ) { client.getConnectionStateListenable().removeListener(connectionStateListener); listeners.clear(); executorService.close(); try { root.wasDeleted(); } catch ( Exception e ) { handleException(e); } } }</code><technical_language>need throw IOException</technical_language>

Target:
public void close() { if ( treeState.compareAndSet(TreeState.STARTED, TreeState.CLOSED) ) { client.getConnectionStateListenable().removeListener(connectionStateListener); listeners.clear(); executorService.close(); try { root.wasDeleted(); } catch ( Exception e ) { handleException(e); } } }
Source:
<code>public void handleDownload(HttpServletRequest req, HttpServletResponse resp, String baseUrl, String path) throws IOException { Pair<String, Action> pair = getDownloadPathAndAction(path); if (pair == null) { resp.sendError(HttpServletResponse.SC_NOT_FOUND, "Invalid URL syntax"); return; } String downloadPath = pair.getLeft(); Action action = pair.getRight(); switch (action) { case INFO: handleDownload(req, resp, downloadPath, baseUrl, true); break; case DOWNLOAD_FROM_DOC: handleDownload(req, resp, downloadPath, baseUrl, false); break; case DOWNLOAD: <START> downloadBlob(req, resp, downloadPath, EVENT_NAME); <END> break; default: resp.sendError(HttpServletResponse.SC_NOT_FOUND, "Invalid URL syntax"); } }</code><technical_language>EVENT_NAME either</technical_language>

Target:
public void handleDownload(HttpServletRequest req, HttpServletResponse resp, String baseUrl, String path) throws IOException { Pair<String, Action> pair = getDownloadPathAndAction(path); if (pair == null) { resp.sendError(HttpServletResponse.SC_NOT_FOUND, "Invalid URL syntax"); return; } String downloadPath = pair.getLeft(); Action action = pair.getRight(); switch (action) { case INFO: handleDownload(req, resp, downloadPath, baseUrl, true); break; case DOWNLOAD_FROM_DOC: handleDownload(req, resp, downloadPath, baseUrl, false); break; case DOWNLOAD: downloadBlob(req, resp, downloadPath, "download"); break; default: resp.sendError(HttpServletResponse.SC_NOT_FOUND, "Invalid URL syntax"); } }
Source:
<code>protected void onPostExecute(String result) { <START> mLogTV.setText(result); <END> dismissLoadingDialog(); }</code><technical_language>AsyncTask holds a WeakReference mLogTV instead of accessing mLogTV itself. Check <LINK_0> . I understand Google WeakReference in some examples, in others.... method dismissLoadingDialog() called WeakReference.get() is null</technical_language>

Target:
protected void onPostExecute(String result) { if (textViewReference != null && result != null) { final TextView logTV = textViewReference.get(); if (logTV != null) { logTV.setText(result); dismissLoadingDialog(); } } }
Source:
<code>public void doStart() throws MuleException { try { logger.debug("Starting subreceiver on queue: " + getQueueName() + " on channel: " + getChannel()); super.doStart(); channel = amqpConnector.getChannelHandler().getOrCreateChannel(endpoint); parentReceiver.declareEndpoint(channel); if (logger.isDebugEnabled()) { logger.debug("Connected queue: " + getQueueName() + " on channel: " + getChannel()); } if (endpoint.getTransactionConfig().isTransacted()) { channel.txSelect(); } queueName = parentReceiver.getQueueOrCreateTemporaryQueue(channel); consumerTag = channel.basicConsume(getQueueName(), amqpConnector.getAckMode().isAutoAck(), getClientConsumerTag(), amqpConnector.isNoLocal(), amqpConnector.isExclusiveConsumers(), null, new MessageReceiverConsumer(this, channel)); logger.info("Started subscription: " + consumerTag + " on " + (endpoint.getTransactionConfig().isTransacted() ? "transacted " : "") + "channel: " + channel); } catch (final Exception e) { try { amqpConnector.stop(); } catch (MuleException w) { <START> logger.error("Unable to stop channel's connection"); <END> } throw new StartException( MessageFactory.createStaticMessage("Error when subscribing to queue: " + getQueueName() + " on channel: " + channel), e, this); } logger.debug("Started subreceiver on queue: " + getQueueName() + " on channel: " + getChannel()); }</code><technical_language>Is this message accurate? unable stop connector</technical_language>

Target:
public void doStart() throws MuleException { try { logger.debug("Starting subreceiver on queue: " + getQueueName() + " on channel: " + getChannel()); super.doStart(); channel = amqpConnector.getChannelHandler().getOrCreateChannel(endpoint); parentReceiver.declareEndpoint(channel); if (logger.isDebugEnabled()) { logger.debug("Connected queue: " + getQueueName() + " on channel: " + getChannel()); } if (endpoint.getTransactionConfig().isTransacted()) { channel.txSelect(); } queueName = parentReceiver.getQueueOrCreateTemporaryQueue(channel); consumerTag = channel.basicConsume(getQueueName(), amqpConnector.getAckMode().isAutoAck(), getClientConsumerTag(), amqpConnector.isNoLocal(), amqpConnector.isExclusiveConsumers(), null, new MessageReceiverConsumer(this, channel)); logger.info("Started subscription: " + consumerTag + " on " + (endpoint.getTransactionConfig().isTransacted() ? "transacted " : "") + "channel: " + channel); } catch (final Exception e) { try { amqpConnector.stop(); } catch (MuleException w) { logger.error("Unable to stop amqp connector"); } throw new StartException( MessageFactory.createStaticMessage("Error when subscribing to queue: " + getQueueName() + " on channel: " + channel), e, this); } logger.debug("Started subreceiver on queue: " + getQueueName() + " on channel: " + getChannel()); }
Source:
<code>private void executeQueryWithCriticalHeapCalledAfterTimeout(VM server, VM client) { createLatchTestHook(server, false, VM.getController()); AsyncInvocation queryExecution = executeQueryWithTimeout(client); try { Thread.sleep(1 + TEST_QUERY_TIMEOUT); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } vmHitsCriticalHeap(server); releaseHook(server); try { <START> assertThat(queryExecution.get(60, SECONDS)).isEqualTo(0); <END> } catch (Throwable e) { e.printStackTrace(); fail("queryExecution.getResult() threw Exception " + e.toString()); } }</code><technical_language>Another 60 seconds replace GeodeAwaitility.getTimeout(). surrounding try-catch delete</technical_language>

Target:
private void executeQueryWithCriticalHeapCalledAfterTimeout(VM server, VM client) throws InterruptedException { createLatchTestHook(server, false, VM.getController()); AsyncInvocation queryExecution = executeQueryWithTimeout(client); Thread.sleep(1 + TEST_QUERY_TIMEOUT); vmHitsCriticalHeap(server); releaseHook(server); await().untilAsserted(() -> assertThat(queryExecution.get()).isEqualTo(0)); }
Source:
<code>public static void input(@AggregationState DigestAndPercentileArrayState state, @SqlType(StandardTypes.DOUBLE) double value, @SqlType(StandardTypes.DOUBLE) double lowerQuantile, @SqlType(StandardTypes.DOUBLE) double upperQuantile) { ApproximateDoublePercentileArrayAggregations.input(state, value, <START> ApproximateLongTruncatedMeanAggregations.quantileBoundsToArray(lowerQuantile, upperQuantile)); <END> }</code><technical_language>I static import quantileBoundsToArray</technical_language>

Target:
public static void input( @AggregationState DigestAndPercentileArrayState state, @SqlType(StandardTypes.DOUBLE) double value, @SqlType(StandardTypes.DOUBLE) double lowerQuantile, @SqlType(StandardTypes.DOUBLE) double upperQuantile) { ApproximateDoublePercentileArrayAggregations.input(state, value, quantileBoundsToArray(lowerQuantile, upperQuantile)); }
Source:
<code>private Map<String, DbParameterAccessor> readIntoParams( String tableOrViewName, String query) throws SQLException { try (PreparedStatement dc = getConnection().prepareStatement(query)) { dc.setString(1, tableOrViewName); ResultSet rs = dc.executeQuery(); Map<String, DbParameterAccessor> allParams = new HashMap<String, DbParameterAccessor>(); int position = 0; while (rs.next()) { String columnName = rs.getString(1); String dataType = rs.getString(2); DbParameterAccessor dbp = new DbParameterAccessor(columnName, Direction.INPUT, typeMapper.getJDBCSQLTypeForDBType(dataType), getJavaClass(dataType), position++, <START> typeSpecifiers); <END> allParams.put(NameNormaliser.normaliseName(columnName), dbp); } rs.close(); return allParams; } }</code><technical_language>Adding this extra parameter widespread passing value. extract a common place</technical_language>

Target:
private Map<String, DbParameterAccessor> readIntoParams( String tableOrViewName, String query) throws SQLException { try (PreparedStatement dc = getConnection().prepareStatement(query)) { dc.setString(1, tableOrViewName); ResultSet rs = dc.executeQuery(); Map<String, DbParameterAccessor> allParams = new HashMap<String, DbParameterAccessor>(); int position = 0; while (rs.next()) { String columnName = rs.getString(1); String dataType = rs.getString(2); DbParameterAccessor dbp = createDbParameterAccessor( columnName, Direction.INPUT, typeMapper.getJDBCSQLTypeForDBType(dataType), getJavaClass(dataType), position++); allParams.put(NameNormaliser.normaliseName(columnName), dbp); } rs.close(); return allParams; } }
Source:
<code>public static Collection<String> getAllPackagesInDirectory(@Nullable final PsiDirectory dir) { if (dir == null) { return Collections.emptyList(); } return CachedValuesManager.getCachedValue(dir, new CachedValueProvider<Collection<String>>() { @Nullable @Override public Result<Collection<String>> compute() { Collection<String> set = ContainerUtil.newLinkedHashSet(); for (PsiFile file : dir.getFiles()) { <START> if (allowed(file)) { <END> String name = ((GoFile)file).getPackageName(); if (name != null) { set.add(name); } } } return Result.create(set, dir); } }); }</code><technical_language>Is this needed? If dir is wrong dependency for cache. Result of allowed invocation change changing IDE settings</technical_language>

Target:
public static Collection<String> getAllPackagesInDirectory(@Nullable final PsiDirectory dir) { if (dir == null) { return Collections.emptyList(); } return CachedValuesManager.getCachedValue(dir, new CachedValueProvider<Collection<String>>() { @Nullable @Override public Result<Collection<String>> compute() { Collection<String> set = ContainerUtil.newLinkedHashSet(); for (PsiFile file : dir.getFiles()) { if (file instanceof GoFile && !libraryDirectoryToIgnore(file.getName())) { String name = ((GoFile)file).getPackageName(); if (name != null) { set.add(name); } } } return Result.create(set, dir); } }); }
Source:
<code>private void updateOldSelection(ListView<DetailsListElement<E>> container, ListWidgetSelection<E> oldSelection) { Optional.ofNullable(oldSelection).map(ListWidgetSelection::getSelection).ifPresent(selection -> { final int oldValueIndex = getControl().getElements().indexOf(selection); <START> if (oldValueIndex != -1) { <END> container.getSelectionModel().clearSelection(oldValueIndex); } }); }</code><technical_language>I skins require mappedElements.size() > oldValueIndex && oldValueIndex != -1. I container.getSelectionModel().clearSelection(oldValueIndex) throw a NullPointerException if index is larger number of shown elements</technical_language>

Target:
private void updateOldSelection(ListView<DetailsListElement<E>> container, ListWidgetSelection<E> oldSelection) { Optional.ofNullable(oldSelection).map(ListWidgetSelection::getSelection).ifPresent(selection -> { final int oldValueIndex = getControl().getElements().indexOf(selection); if (mappedElements.size() > oldValueIndex && oldValueIndex != -1) { container.getSelectionModel().clearSelection(oldValueIndex); } }); }
Source:
<code>@Test public void multipleParameters() throws IOException { String expected = "@com.example.Thing(name = \"Hello, world!\", value = 42)"; writer.setMember("name", "Hello, world!"); writer.setMember("value", 42); <START> String actual = writer.write(new StringBuilder(), context).toString(); <END> assertThat(actual).isEqualTo(expected); }</code><technical_language>writer.toString() is equivalent</technical_language>

Target:
@Test public void multipleParameters() throws IOException { String expected = "@com.example.Thing(name = \"Hello, world!\", value = 42)"; writer.setMember("name", "Hello, world!"); writer.setMember("value", 42); assertThat(Writables.writeToString(writer)).isEqualTo(expected); }
Source:
<code>public void cleanup() { <START> labelsWidget.cleanup(); <END> driver.cleanup(); }</code><technical_language>question here: labelsWidget.cleanup() included in generated driver.cleanup()</technical_language>

Target:
public void cleanup() { driver.cleanup(); }
Source:
<code>public void countError(CoordinatorOperationType operation, CoordinatorError error) { operationExceptionRate.mark(); switch (error) { case UnexpectedInternalError: updateOperationMetric(operation); unexpectedInternalError.inc(); break; case BlobAlreadyExistInLocalColo: updateOperationMetric(operation); blobAlreadyExistInLocalColoError.inc(); break; case BlobAlreadyExistInRemoteColo: <START> updateOperationMetric(operation); <END> blobAlreadyExistInRemoteColoError.inc(); break; case AmbryUnavailable: updateOperationMetric(operation); ambryUnavailableError.inc(); break; case OperationTimedOut: updateOperationMetric(operation); operationTimedOutError.inc(); break; case InvalidBlobId: updateOperationMetric(operation); invalidBlobIdError.inc(); break; case InvalidPutArgument: updateOperationMetric(operation); invalidPutArgumentError.inc(); break; case InsufficientCapacity: updateOperationMetric(operation); insufficientCapacityError.inc(); break; case BlobTooLarge: updateOperationMetric(operation); blobTooLargeError.inc(); break; case BlobDoesNotExist: blobDoesNotExistError.inc(); break; case BlobDeleted: blobDeletedError.inc(); break; case BlobExpired: blobExpiredError.inc(); break; default: updateOperationMetric(operation); logger.warn("Unknown CoordinatorError being counted: " + error); unknownError.inc(); break; } }</code><technical_language>reasons differentiate this error</technical_language>

Target:
public void countError(CoordinatorOperationType operation, CoordinatorError error) { operationExceptionRate.mark(); switch (error) { case UnexpectedInternalError: updateOperationMetric(operation); unexpectedInternalError.inc(); break; case AmbryUnavailable: updateOperationMetric(operation); ambryUnavailableError.inc(); break; case OperationTimedOut: updateOperationMetric(operation); operationTimedOutError.inc(); break; case InvalidBlobId: updateOperationMetric(operation); invalidBlobIdError.inc(); break; case InvalidPutArgument: updateOperationMetric(operation); invalidPutArgumentError.inc(); break; case InsufficientCapacity: updateOperationMetric(operation); insufficientCapacityError.inc(); break; case BlobTooLarge: updateOperationMetric(operation); blobTooLargeError.inc(); break; case BlobDoesNotExist: blobDoesNotExistError.inc(); break; case BlobDeleted: blobDeletedError.inc(); break; case BlobExpired: blobExpiredError.inc(); break; default: updateOperationMetric(operation); logger.warn("Unknown CoordinatorError being counted: " + error); unknownError.inc(); break; } }
Source:
<code>boolean isSuccessful() { <START> return isComplete() && failedEvents.size() == 0; <END> }</code><technical_language>isEmpty() instead of size() == 0</technical_language>

Target:
boolean isSuccessful() { return isComplete() && failedEvents.isEmpty(); }
Source:
<code>public Target onboard( @NonNull String thingID, @NonNull String thingPassword) throws ThingIFException { <START> return thingIfApi.onboard(thingID, thingPassword); <END> }</code><technical_language>Adding this a field is good manner</technical_language>

Target:
public Target onboard( @NonNull String thingID, @NonNull String thingPassword) throws ThingIFException { return this.thingIfApi.onboard(thingID, thingPassword); }
Source:
<code>private void configureRemoteStream() { try { LOG.debug("Setting up remote stream"); RemoteAddCommand remoteAddCommand = git.remoteAdd(); remoteAddCommand.setName(zeppelinConfiguration.getZeppelinNotebookGitRemoteOrigin()); remoteAddCommand.setUri(new URIish(zeppelinConfiguration.getZeppelinNotebookGitURL())); remoteAddCommand.call(); } catch (GitAPIException e) { <START> e.printStackTrace(); <END> } catch (URISyntaxException e) { e.printStackTrace(); } }</code><technical_language>printStackTrace, call LOG.error("", e)</technical_language>

Target:
private void configureRemoteStream() { try { LOG.debug("Setting up remote stream"); RemoteAddCommand remoteAddCommand = git.remoteAdd(); remoteAddCommand.setName(zeppelinConfiguration.getZeppelinNotebookGitRemoteOrigin()); remoteAddCommand.setUri(new URIish(zeppelinConfiguration.getZeppelinNotebookGitURL())); remoteAddCommand.call(); } catch (GitAPIException e) { LOG.error("Error configuring GitHub", e); } catch (URISyntaxException e) { LOG.error("Error in GitHub URL provided", e); } }
Source:
<code>public JsonDeserializer() { <START> this(Collections.emptySet(), false); <END> }</code><technical_language>is false (inexact decimals) default for no-arg constructor? If this is attempt maintain compatibility, consider this bug, fixed, compatible. be, deserializer trailing zeros fine/better them</technical_language>

Target:
public JsonDeserializer() { this(Collections.emptySet(), JsonNodeFactory.withExactBigDecimals(true)); }
Source:
<code>public FeaturePath getFeaturePath(String propertyPath) { String[] featureNames = propertyPath.split("\\."); EStructuralFeature[] features = new EStructuralFeature[featureNames.length]; int i = 0; EClass currentClass = source.eClass(); for (String featureName : featureNames) { <START> featureName = featureName.replaceAll("\\s", ""); <END> EStructuralFeature feature = currentClass.getEStructuralFeature(featureName); features[i++] = feature; if (i < featureNames.length) { if (feature instanceof EReference) { EReference reference = (EReference) feature; EClassifier type = reference.getEType(); if (type instanceof EClass) { currentClass = (EClass) type; continue; } } Activator.log.warn("Cannot find feature path " + propertyPath + " for EClass " + source.eClass()); return null; } } return FeaturePath.fromList(features); }</code><technical_language>String tag NON-NLS</technical_language>

Target:
public FeaturePath getFeaturePath(String propertyPath) { String[] featureNames = propertyPath.split("\\."); EStructuralFeature[] features = new EStructuralFeature[featureNames.length]; int i = 0; EClass currentClass = source.eClass(); for (String featureName : featureNames) { featureName = featureName.replaceAll("\\s", ""); EStructuralFeature feature = currentClass.getEStructuralFeature(featureName); features[i++] = feature; if (i < featureNames.length) { if (feature instanceof EReference) { EReference reference = (EReference) feature; EClassifier type = reference.getEType(); if (type instanceof EClass) { currentClass = (EClass) type; continue; } } final StringBuilder warningMessage = new StringBuilder("Cannot find feature path "); warningMessage.append(propertyPath); warningMessage.append(" for EClass "); warningMessage.append(source.eClass()); Activator.log.warn(warningMessage.toString()); return null; } } return FeaturePath.fromList(features); }
Source:
<code>@Test public void testRequestResponseApiError() throws Throwable { <START> enqueueFromFile("api_error.json"); <END> CreateAccountClient.Callback cb = mock(CreateAccountClient.Callback.class); Call<MwCreateAccountResponse> call = request(cb); server().takeRequest(); assertCallbackThrowableFailure(call, cb); }</code><technical_language>Is this file applicable other clients a name create_account_client_api_error.json</technical_language>

Target:
@Test public void testRequestResponseApiError() throws Throwable { enqueueFromFile("api_error.json"); CreateAccountClient.Callback cb = mock(CreateAccountClient.Callback.class); Call<CreateAccountResponse> call = request(cb); server().takeRequest(); assertCallbackFailure(call, cb, MwApiErrorException.class); }
Source:
<code>private boolean isMbusDeviceCoupled(final SmartMeter mbusDevice) { <START> if (mbusDevice.getChannel() == null) { <END> return false; } else { return true; } }</code><technical_language>Fix please :-)</technical_language>

Target:
private boolean isMbusDeviceCoupled(final SmartMeter mbusDevice) { return mbusDevice.getChannel() == null; }
Source:
<code>protected ByteBuf prepareDecompressBuffer(ChannelHandlerContext ctx, ByteBuf buffer, int preferredSize) { if (buffer == null) { if (maxAllocation == 0) { return ctx.alloc().heapBuffer(preferredSize); } else { <START> return ctx.alloc().heapBuffer(Math.min(preferredSize, maxAllocation), maxAllocation); <END> } } if (buffer.ensureWritable(preferredSize, true) == 1) { return maxAllocationReached(buffer); } return buffer; }</code><technical_language>optional: check preferredSize is non-negative</technical_language>

Target:
protected ByteBuf prepareDecompressBuffer(ChannelHandlerContext ctx, ByteBuf buffer, int preferredSize) { if (buffer == null) { if (maxAllocation == 0) { return ctx.alloc().heapBuffer(preferredSize); } return ctx.alloc().heapBuffer(Math.min(preferredSize, maxAllocation), maxAllocation); } if (buffer.ensureWritable(preferredSize, true) == 1) { decompressionBufferExhausted(buffer.duplicate()); buffer.skipBytes(buffer.readableBytes()); throw new DecompressionException("Decompression buffer has reached maximum size: " + buffer.maxCapacity()); } return buffer; }
Source:
<code>public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) { <START> return size; <END> } size = 0; for (int i = 0; i < localTime_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, localTime_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }</code><technical_language>4 spaces</technical_language>

Target:
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; for (int i = 0; i < localTime_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, localTime_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
Source:
<code>public void testPosixConnectionWithInvalidMountOptions() { StorageServerConnections conn =createConnection(StorageType.POSIXFS, "timeo=30, vfs_type=nfs"); params.setStorageServerConnection(conn); ValidationResult result = command.validateMountOptions(); <START> assertFalse(result.isValid()); <END> }</code><technical_language>Please assertThat (result, failsWith(NAME_OF_FAILURE))</technical_language>

Target:
public void testPosixConnectionWithInvalidMountOptions() { testConnectionMountOptionsValidations(StorageType.POSIXFS, "timeo=30, vfs_type=nfs", false); }
Source:
<code>public Object execute(ExecutionEvent arg0) { IProject project = null; ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(); if (selection instanceof IStructuredSelection) { <START> Object item = ((IStructuredSelection)selection).getFirstElement(); <END> if (item instanceof IProject) { project = (IProject)item; } else if (item instanceof IAdaptable) { project = ((IAdaptable)item).getAdapter(IProject.class); } } if (project == null) { return null; } SmartImportWizard wizard = new SmartImportWizard(); wizard.setInitialImportSource(project.getLocation().toFile()); Set<IWorkingSet> workingSets = new HashSet<>(); for (IWorkingSet workingSet : PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets()) { for (IAdaptable element : workingSet.getElements()) { if (project.getAdapter(element.getClass()) == element) { workingSets.add(workingSet); } } } wizard.setInitialWorkingSets(workingSets); return new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard).open(); }</code><technical_language>Please new 4.6 API: Adapters.adapt</technical_language>

Target:
public Object execute(ExecutionEvent arg0) { IProject project = null; ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(); if (selection instanceof IStructuredSelection) { Object item = ((IStructuredSelection)selection).getFirstElement(); project = Adapters.adapt(item, IProject.class); } if (project == null) { return null; } SmartImportWizard wizard = new SmartImportWizard(); wizard.setInitialImportSource(project.getLocation().toFile()); Set<IWorkingSet> workingSets = new HashSet<>(); for (IWorkingSet workingSet : PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets()) { for (IAdaptable element : workingSet.getElements()) { if (project.getAdapter(element.getClass()) == element) { workingSets.add(workingSet); } } } wizard.setInitialWorkingSets(workingSets); return new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard).open(); }
Source:
<code>public void onBackPressed() { if (isPhotoPickerShowing()) { <START> hidePhotoPicker(); <END> } handleBackPressed(); }</code><technical_language>need a return - want call handleBackPressed() photo picker is showing</technical_language>

Target:
public void onBackPressed() { if (isPhotoPickerShowing()) { hidePhotoPicker(); return; } handleBackPressed(); }
Source:
<code>private void checkForFullyLostDatasets(Set<IntermediateDataSetID> dataSetsWithLostPartitions) { dataSetsWithLostPartitions.forEach(dataSetId -> { if (getHostingTaskExecutors(dataSetId).isEmpty()) { LOG.debug("There are no longer partitions being tracked for dataset {}.", dataSetId); dataSetMetaInfo.remove(dataSetId); <START> Optional.ofNullable(partitionReleaseCompletionFutures.get(dataSetId)).map(future -> future.complete(null)); <END> } }); }</code><technical_language>do want GC completed future partitionReleaseCompletionFutures</technical_language>

Target:
private void checkForFullyLostDatasets(Set<IntermediateDataSetID> dataSetsWithLostPartitions) { dataSetsWithLostPartitions.forEach(dataSetId -> { if (getHostingTaskExecutors(dataSetId).isEmpty()) { LOG.debug("There are no longer partitions being tracked for dataset {}.", dataSetId); dataSetMetaInfo.remove(dataSetId); Optional.ofNullable(partitionReleaseCompletionFutures.remove(dataSetId)).map(future -> future.complete(null)); } }); }
Source:
<code>private JestClient createJestClient(String connectionUrl, String username, String password) { log.info("Create a jest elastic search client for connection url [{}]", connectionUrl); JestClientFactory factory = new JestClientFactory(); factory.setHttpClientConfig( new HttpClientConfig.Builder(connectionUrl) <START> .defaultCredentials(username, password) <END> .multiThreaded(true) .build()); return factory.getObject(); }</code><technical_language>defaultCredentials() configured if null. need able connect anonymously if needed</technical_language>

Target:
private JestClient createJestClient(String connectionUrl, String username, String password) { log.info("Create a jest elastic search client for connection url [{}]", connectionUrl); JestClientFactory factory = new JestClientFactory(); HttpClientConfig.Builder httpClientBuilder = new HttpClientConfig.Builder(connectionUrl).connTimeout(connTimeout).readTimeout(readTimeout).multiThreaded(true); if (StringUtils.isNotEmpty(username)) { httpClientBuilder.defaultCredentials(username, password); } factory.setHttpClientConfig(httpClientBuilder.build()); return factory.getObject(); }
Source:
<code>public MetricRegistry getMetrics() { <START> return metrics != null ? metrics : new MetricRegistry(); <END> }</code><technical_language>store result of new MetricRegistry() instead of returning a new get</technical_language>

Target:
public MetricRegistry getMetrics() { if(metrics == null) { metrics = new MetricRegistry(); } return metrics; }
Source:
<code>public synchronized void deleteOldLogs() throws IOException { if (maxAge <= 0) { logDebug("maxage feature is disabled."); return; } Path prefixPath = Paths.get(prefix); Path logNamePath = prefixPath.subpath(prefixPath.getNameCount() - 1, prefixPath.getNameCount()); <START> String rotatedLogRegex = ".*" + logNamePath.toString() + ".+\\" + suffix + "\\" + compressedSuffix; <END> long currentSystemTime = System.currentTimeMillis(); try { Files.find(prefixPath.getParent(), DEF_MAXDEPTH, (path, attributes) -> path.toString().matches(rotatedLogRegex) && attributes.isRegularFile() && currentSystemTime - attributes.lastModifiedTime().toMillis() >= maxAge) .forEach(path -> { try { Files.delete(path); } catch (IOException e) { e.printStackTrace(System.err); } }); } catch (IOException e) { e.printStackTrace(System.err); } }</code><technical_language>@gregorioosorio I understand rationale of ".*", match basename part of files in log directory? this delete filles start prefix name. I basename part, in lambda expression check basename part regex instead of full path, I if I explain</technical_language>

Target:
public synchronized void deleteOldLogs() throws IOException { if (maxAge <= 0) { logDebug("maxage feature is disabled."); return; } Path logBasePath = Paths.get(prefix).getParent(); long currentSystemTime = System.currentTimeMillis(); try { Files.find(logBasePath, DEF_MAXDEPTH, (path, attributes) -> path.getFileName().toString().matches(deleteRegex) && attributes.isRegularFile() && currentSystemTime - attributes.lastModifiedTime().toMillis() >= maxAge) .forEach(path -> { try { Files.delete(path); } catch (IOException e) { e.printStackTrace(System.err); } }); } catch (IOException e) { e.printStackTrace(System.err); } }
Source:
<code>public ScheduleCriteria(@JsonProperty("schedule") Schedule schedule, @JsonProperty("criteria") Criteria criteria) { checkNotNull(schedule); this.schedule = schedule; <START> this.criteria = criteria; <END> }</code><technical_language>Minor: a null check for schedule, for criteria</technical_language>

Target:
public ScheduleCriteria(@JsonProperty("schedule") Schedule schedule, @JsonProperty("criteria") Criteria criteria) { checkNotNull(schedule); checkNotNull(criteria); this.schedule = schedule; this.criteria = criteria; }
Source:
<code>public void AESGCM_Encryption_Test_Correct_Encryption_And_Decryption() throws IOException, AEADBadTagException { AccumuloConfiguration conf = setAndGetAccumuloConfig(CRYPTO_ON_CONF); byte[] encryptedBytes = testEncryption(conf, new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20}); Integer result = testDecryption(conf, encryptedBytes); <START> assert (result.equals(1)); <END> }</code><technical_language>assertTrue assertEquals</technical_language>

Target:
public void AESGCM_Encryption_Test_Correct_Encryption_And_Decryption() throws IOException, AEADBadTagException { AccumuloConfiguration conf = setAndGetAccumuloConfig(CRYPTO_ON_CONF); byte[] encryptedBytes = testEncryption(conf, new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20}); Integer result = testDecryption(conf, encryptedBytes); assertEquals(result, Integer.valueOf(1)); }
Source:
<code>public void reportIsHealthyWhenEverythingIsRight() { FeedbackHandler feedbackHandler = new FeedbackHandler(); EndpointStatistics statistics = EndpointStatistics .builder() .p99(P_99 - 1) .oneMin(RATE + 1) .errorRate(0) .build(); PointHealthStatusReport healthStatusForMetric = feedbackHandler.getHealthStatusForMetric( CLIENT_1, statistics, Constants.LEADER_TIME_SERVICE_LEVEL_OBJECTIVES); assertThat(healthStatusForMetric.status()).isEqualTo(HealthStatus.HEALTHY); <START> assertThat(healthStatusForMetric.message().isPresent()).isFalse(); <END> }</code><technical_language>nit: Pretty AssertJ OptionalAsserts operate optionals, prefer instead</technical_language>

Target:
public void reportIsHealthyWhenEverythingIsRight() { FeedbackHandler feedbackHandler = new FeedbackHandler(); EndpointStatistics statistics = EndpointStatistics .builder() .p99(P_99 - 1) .oneMin(RATE + 1) .errorRate(0) .build(); HealthStatus healthStatus = getHealthStatus(feedbackHandler, statistics); assertThat(healthStatus).isEqualTo(HealthStatus.HEALTHY); }
Source:
<code>public void getTextFromPart_withUnknownEncoding_shouldReturnNull() throws Exception { part.setHeader(MimeHeader.HEADER_CONTENT_TYPE, "text/plain"); BinaryMemoryBody body = new BinaryMemoryBody("Sample text body".getBytes(), "unknown encoding"); part.setBody(body); <START> assertNull(MessageExtractor.getTextFromPart(part)); <END> }</code><technical_language>Arrange, act, assert. java String textFromPart = MessageExtractor.getTextFromPart(part) ; assertNull(textFromPart);</technical_language>

Target:
public void getTextFromPart_withUnknownEncoding_shouldReturnNull() throws Exception { part.setHeader(MimeHeader.HEADER_CONTENT_TYPE, "text/plain"); BinaryMemoryBody body = new BinaryMemoryBody("Sample text body".getBytes(), "unknown encoding"); part.setBody(body); String result = MessageExtractor.getTextFromPart(part); assertNull(result); }
Source:
<code>public boolean equals(Object o) { <START> if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; <END> NetworkFilter that = (NetworkFilter) o; return Objects.equals(name, that.name) && Objects.equals(version, that.version) && Objects.equals(id, that.id); }</code><technical_language>please configure IDE brackets in equals methods if statements. convention present everywhere</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NetworkFilter that = (NetworkFilter) o; return Objects.equals(name, that.name) && Objects.equals(version, that.version) && Objects.equals(id, that.id); }