auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testFilterInitiator(){ String variableNameWithInitiator = "initiator"; String variableValueWithInitiator = "initiator people"; String variableNameWithoutInitiator = "noinitiator"; String variableValueWithoutInitiator = "other people"; <START> assertEquals(presenter.filterInitiator(variableNameWithInitiator,variableValueWithInitiator,variableValueWithInitiator),true); <END> assertEquals(presenter.filterInitiator(variableNameWithoutInitiator,variableValueWithoutInitiator,variableValueWithoutInitiator),false); assertEquals(presenter.filterInitiator(variableNameWithInitiator,variableValueWithInitiator,variableValueWithoutInitiator),false); assertEquals(presenter.filterInitiator(variableNameWithoutInitiator,variableValueWithoutInitiator,variableValueWithInitiator),false); }</code><technical_language>expected parameter in _assertEquals_</technical_language>

Target:
public void testFilterInitiator(){ String variableNameWithInitiator = "initiator"; String variableValueWithInitiator = "initiator people"; String variableNameWithoutInitiator = "noinitiator"; String variableValueWithoutInitiator = "other people"; assertEquals(true, presenter.filterInitiator(variableNameWithInitiator, variableValueWithInitiator, variableValueWithInitiator)); assertEquals(false, presenter.filterInitiator(variableNameWithoutInitiator, variableValueWithoutInitiator, variableValueWithoutInitiator)); assertEquals(false, presenter.filterInitiator(variableNameWithInitiator, variableValueWithInitiator, variableValueWithoutInitiator)); assertEquals(false, presenter.filterInitiator(variableNameWithoutInitiator, variableValueWithoutInitiator, variableValueWithInitiator)); }
Source:
<code>public Cursor query(Uri uri, String[] projection, String where, String[] selectionArgs, String sortOrder) { switch (matchUri(uri)) { case LOCAL_VALUES_URI: break; case REMOTE_VALUES_URI: try { return commonSense.query(uri, projection, where, selectionArgs, sortOrder); } catch (Exception e) { Log.e(TAG, "Failed to query the CommonSense data points", e); return null; } default: throw new IllegalArgumentException("Unknown URI " + uri); } if (projection == null) { projection = DEFAULT_PROJECTION; } Cursor inMemoryCursor = inMemory.query(projection, where, selectionArgs, sortOrder); <START> Cursor persistedCursor = persisted.query(projection, where, selectionArgs, sortOrder); <END> if (inMemoryCursor.getCount() > 0) { if (persistedCursor.getCount() > 0) { return new MergeCursor(new Cursor[] { persistedCursor, inMemoryCursor }); } else { return inMemoryCursor; } } else { return persistedCursor; } }</code><technical_language>If of cursors points zero rows, cursor is returned. other cursor closed? (Even points rows)</technical_language>

Target:
public Cursor query(Uri uri, String[] projection, String where, String[] selectionArgs, String sortOrder) { switch (matchUri(uri)) { case LOCAL_VALUES_URI: break; case REMOTE_VALUES_URI: try { return commonSense.query(uri, projection, where, selectionArgs, sortOrder); } catch (Exception e) { Log.e(TAG, "Failed to query the CommonSense data points", e); return null; } default: throw new IllegalArgumentException("Unknown URI " + uri); } if (projection == null) { projection = DEFAULT_PROJECTION; } Cursor inMemoryCursor = inMemory.query(projection, where, selectionArgs, sortOrder); Cursor persistedCursor = persisted.query(projection, where, selectionArgs, sortOrder); if (inMemoryCursor.getCount() > 0) { if (persistedCursor.getCount() > 0) { return new MergeCursor(new Cursor[] { persistedCursor, inMemoryCursor }); } else { persistedCursor.close(); return inMemoryCursor; } } else { inMemoryCursor.close(); return persistedCursor; } }
Source:
<code>public TmfSimpleTimestamp(final ITmfTimestamp timestamp) { super(timestamp.getValue(), 0, 0); <START> if (timestamp.getScale() != 0 || timestamp.getPrecision() != 0) { <END> throw new IllegalArgumentException(); } }</code><technical_language>thought this one: throw exception this a conversion function i.e. normalize scale=0 drop precision</technical_language>

Target:
public TmfSimpleTimestamp(final ITmfTimestamp timestamp) { super(timestamp.getValue(), 0, 0); }
Source:
<code>public void checkOutputSpecs(JobContext context) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); BasicAWSCredentials awsCred = new BasicAWSCredentials(conf.get(Properties.KinesisRealtimeSink.ACCESS_ID), conf.get(Properties.KinesisRealtimeSink.ACCESS_KEY)); if (kinesisClient == null) { LOG.info("Creating amazon kinesis client for stream {}", Properties.KinesisRealtimeSink.NAME); kinesisClient = new AmazonKinesisClient(awsCred); try { KinesisUtil.createAndWaitForStream(kinesisClient, conf.get(Properties.KinesisRealtimeSink.NAME), Integer.valueOf(conf.get(Properties.KinesisRealtimeSink.SHARD_COUNT))); } catch (AmazonServiceException e) { <START> throw new IllegalArgumentException("AWS credentials are not correct", e); <END> } } }</code><technical_language>giving a potentially misleading/inaccurate error message here</technical_language>

Target:
public void checkOutputSpecs(JobContext context) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); BasicAWSCredentials awsCred = new BasicAWSCredentials(conf.get(Properties.KinesisRealtimeSink.ACCESS_ID), conf.get(Properties.KinesisRealtimeSink.ACCESS_KEY)); if (kinesisClient == null) { LOG.info("Creating amazon kinesis client for stream {}", Properties.KinesisRealtimeSink.NAME); kinesisClient = new AmazonKinesisClient(awsCred); KinesisUtil.createAndWaitForStream(kinesisClient, conf.get(Properties.KinesisRealtimeSink.NAME), Integer.valueOf(conf.get(Properties.KinesisRealtimeSink.SHARD_COUNT))); } }
Source:
<code>protected void addStream(String uploadType, String batchId, String fileIdx, InputStream is, String fileName, String mimeType, long uploadedSize, int chunkCount, int uploadChunkIndex, long fileSize) throws IOException { String uploadedSizeDisplay = uploadedSize > -1 ? uploadedSize + "b" : "unknown size"; if (UPLOAD_TYPE_CHUNKED.equals(uploadType)) { <START> log.debug(String.format("Uploading chunk [index=%d / total=%d] (%s) for file %s", uploadChunkIndex, <END> chunkCount, uploadedSizeDisplay, fileName)); Framework.getService(BatchManager.class).addStream(batchId, fileIdx, is, chunkCount, uploadChunkIndex, fileName, mimeType, fileSize); } else { log.debug(String.format("Uploading file %s (%s)", fileName, uploadedSizeDisplay)); Framework.getService(BatchManager.class).addStream(batchId, fileIdx, is, fileName, mimeType); } }</code><technical_language>wondering if this code is called a lot not, construction of log message hit performance. add a isDebugEnabled(), wdyt</technical_language>

Target:
protected void addStream(String uploadType, String batchId, String fileIdx, InputStream is, String fileName, String mimeType, long uploadedSize, int chunkCount, int uploadChunkIndex, long fileSize) throws IOException { String uploadedSizeDisplay = uploadedSize > -1 ? uploadedSize + "b" : "unknown size"; if (UPLOAD_TYPE_CHUNKED.equals(uploadType)) { if (log.isDebugEnabled()) { log.debug(String.format("Uploading chunk [index=%d / total=%d] (%s) for file %s", uploadChunkIndex, chunkCount, uploadedSizeDisplay, fileName)); } Framework.getService(BatchManager.class).addStream(batchId, fileIdx, is, chunkCount, uploadChunkIndex, fileName, mimeType, fileSize); } else { if (log.isDebugEnabled()) { log.debug(String.format("Uploading file %s (%s)", fileName, uploadedSizeDisplay)); } Framework.getService(BatchManager.class).addStream(batchId, fileIdx, is, fileName, mimeType); } }
Source:
<code><START> public void writePage(BytesInput bytes, <END> int valueCount, Statistics statistics, Encoding rlEncoding, Encoding dlEncoding, Encoding valuesEncoding) throws IOException { long uncompressedSize = bytes.size(); if (uncompressedSize > Integer.MAX_VALUE) { throw new ParquetEncodingException( "Cannot write page larger than Integer.MAX_VALUE bytes: " + uncompressedSize); } BytesInput compressedBytes = compressor.compress(bytes); long compressedSize = compressedBytes.size(); if (compressedSize > Integer.MAX_VALUE) { throw new ParquetEncodingException( "Cannot write compressed page larger than Integer.MAX_VALUE bytes: " + compressedSize); } if (statistics != null) { this.totalStatistics.mergeStatistics(statistics); } else { statistics = new BooleanStatistics(); } parquetMetadataConverter.writeDataPageHeader( (int)uncompressedSize, (int)compressedSize, valueCount, statistics, rlEncoding, dlEncoding, valuesEncoding, buf); this.uncompressedLength += uncompressedSize; this.compressedLength += compressedSize; this.totalValueCount += valueCount; this.pageCount += 1; compressedBytes.writeAllTo(buf); encodings.add(rlEncoding); encodings.add(dlEncoding); encodings.add(valuesEncoding); }</code><technical_language>this part of a change</technical_language>

Target:
public void writePage(BytesInput bytes, int valueCount, Statistics statistics, Encoding rlEncoding, Encoding dlEncoding, Encoding valuesEncoding) throws IOException { long uncompressedSize = bytes.size(); if (uncompressedSize > Integer.MAX_VALUE) { throw new ParquetEncodingException( "Cannot write page larger than Integer.MAX_VALUE bytes: " + uncompressedSize); } BytesInput compressedBytes = compressor.compress(bytes); long compressedSize = compressedBytes.size(); if (compressedSize > Integer.MAX_VALUE) { throw new ParquetEncodingException( "Cannot write compressed page larger than Integer.MAX_VALUE bytes: " + compressedSize); } parquetMetadataConverter.writeDataPageHeader( (int)uncompressedSize, (int)compressedSize, valueCount, statistics, rlEncoding, dlEncoding, valuesEncoding, buf); this.uncompressedLength += uncompressedSize; this.compressedLength += compressedSize; this.totalValueCount += valueCount; this.pageCount += 1; this.totalStatistics.mergeStatistics(statistics); compressedBytes.writeAllTo(buf); encodings.add(rlEncoding); encodings.add(dlEncoding); encodings.add(valuesEncoding); }
Source:
<code>public void onNameAdded(String name, int amount, String listName) { <START> listInfo = new DataSource(getContext()).getListInfo(listName); <END> settings.setListSize(listInfo.getNumNames()); settingsDialog.refreshSetting(); }</code><technical_language>Instead of creating a new DataSource time, I worth a member variable. save calls getContext() well</technical_language>

Target:
public void onNameAdded(String name, int amount, String listName) { listInfo.addNames(name, amount); settings.setNameListSize(listInfo.getNumInstances()); settingsDialog.refreshSetting(); }
Source:
<code>protected static void removeContainer(final DockerClient dockerClient, final String containerId) throws Exception { Polling.await(1, MINUTES, new Callable<Object>() { @Override public Object call() throws Exception { try { dockerClient.killContainer(containerId); } catch (DockerException e) { <START> if ((e instanceof DockerRequestException) && <END> ((DockerRequestException) e).message().contains("is not running")) { } else { throw e; } } try { dockerClient.removeContainer(containerId); return true; } catch (ContainerNotFoundException e) { return true; } catch (DockerException e) { if ((e instanceof DockerRequestException) && ((DockerRequestException) e).message().contains( "Driver btrfs failed to remove root filesystem")) { return true; } else { return null; } } } }); }</code><technical_language>super minor: if catch (DockerRequestException e) skip this block</technical_language>

Target:
protected static void removeContainer(final DockerClient dockerClient, final String containerId) throws Exception { Polling.await(1, MINUTES, new Callable<Object>() { @Override public Object call() throws Exception { try { dockerClient.killContainer(containerId); } catch (DockerRequestException e) { if (e.message().contains("is not running")) { } else { throw e; } } try { dockerClient.removeContainer(containerId); return true; } catch (ContainerNotFoundException e) { return true; } catch (DockerException e) { if ((e instanceof DockerRequestException) && ((DockerRequestException) e).message().contains( "Driver btrfs failed to remove root filesystem")) { return true; } else { return null; } } } }); }
Source:
<code>public void initialize(final Map<String, String> configuration) { configuration.forEach( (key, value) -> { String[] newRoles = value.split("\\s+"); for (String newRole : newRoles) { Set<String> rolesToMappedRole = reverseRoleMap.get(newRole); if (rolesToMappedRole == null) { rolesToMappedRole = new LinkedHashSet<>(); reverseRoleMap.put(newRole, rolesToMappedRole); <START> } <END> rolesToMappedRole.add(value); } } ); }</code><technical_language>I bug here, key is used...</technical_language>

Target:
public void initialize(final Map<String, String> configuration) { if (initialized) { throw log.roleMappedAlreadyInitialized(); } reverseRoleMap.clear(); configuration.forEach( (key, value) -> { String[] newRoles = value.split("\\s+"); for (String newRole : newRoles) { Set<String> rolesToMappedRole = reverseRoleMap.get(newRole); if (rolesToMappedRole == null) { rolesToMappedRole = new LinkedHashSet<>(); reverseRoleMap.put(newRole, rolesToMappedRole); } rolesToMappedRole.add(key); } }); initialized = true; }
Source:
<code>long gtk_size_allocate (long widget, long allocation) { GtkAllocation widgetAllocation = new GtkAllocation (); OS.gtk_widget_get_allocation (shellHandle, widgetAllocation); int width = widgetAllocation.width; int height = widgetAllocation.height; if ((!resized || oldWidth != width || oldHeight != height) && (OS.GTK3 ? ((style & SWT.RESIZE) <START> != 0) <END> : true)) { oldWidth = width; oldHeight = height; resizeBounds (width, height, true); } return 0; }</code><technical_language>I ot extra safe smth OS.GTK3 && !OS.isX11. This I confident effect X11</technical_language>

Target:
long gtk_size_allocate (long widget, long allocation) { GtkAllocation widgetAllocation = new GtkAllocation (); OS.gtk_widget_get_allocation (shellHandle, widgetAllocation); int width = widgetAllocation.width; int height = widgetAllocation.height; if ((!resized || oldWidth != width || oldHeight != height) && (OS.GTK3 && !OS.isX11() ? ((style & SWT.RESIZE) != 0) : true)) { oldWidth = width; oldHeight = height; resizeBounds (width, height, true); } return 0; }
Source:
<code>private static boolean isInJavaTimePackage(String className) { <START> if (className.contains(".")) { <END> return "java.time".equals(className.substring(0, className.lastIndexOf('.'))); } else { return false; } }</code><technical_language>This if a single return statement</technical_language>

Target:
private static boolean isInJavaTimePackage(String className) { return className.startsWith("java.time"); }
Source:
<code>public List<Project> getGroupProjects(User user) { <START> List<Project> array = new ArrayList<Project>(); <END> List<Project> projects = getProjects(); for (Project project : projects) { if (project.hasGroupPermission(user, Type.READ)) { array.add(project); } } return array; }</code><technical_language>name more explicit? array anything</technical_language>

Target:
public List<Project> getGroupProjects(User user) { List<Project> groupProjects = new ArrayList<>(); for (Project project : getProjects()) { if (project.hasGroupPermission(user, Type.READ)) { groupProjects.add(project); } } return groupProjects; }
Source:
<code>public void closePort() { try { inputStream.close(); } catch (IOException e) { e.printStackTrace(); } try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); } if (typeIsSerial) { serialPort.close(); <START> logger.debug("port closed: " + port); <END> } else { try { ipSocket.close(); logger.debug("ipSocket closed: " + hostName + " on port " + ipPortNumber); } catch (IOException e) { e.printStackTrace(); } } }</code><technical_language>Need parameterized logging instead of string concatenation</technical_language>

Target:
public void closePort() { try { inputStream.close(); } catch (IOException e) { logger.debug("closePort inputStream.close error", e); } try { outputStream.close(); } catch (IOException e) { logger.debug("closePort outputStream.close error", e); } if (typeIsSerial) { serialPort.close(); logger.debug("port closed: {}", port); } else { try { ipSocket.close(); logger.debug("ipSocket closed: on port {}", hostName, ipPortNumber); } catch (IOException e) { logger.debug("I/O error when closing ip communication", e); } } }
Source:
<code>protected boolean contains(URI location, ProvisioningSession session) { URI[] knownRepositories = getKnownRepositories(session); <START> for (URI knownRepositorie : knownRepositories) { <END> if (URIUtil.sameURI(knownRepositorie, location)) { return true; } } return false; }</code><technical_language>repository</technical_language>

Target:
protected boolean contains(URI location, ProvisioningSession session) { URI[] knownRepositories = getKnownRepositories(session); for (URI repository : knownRepositories) { if (URIUtil.sameURI(repository, location)) { return true; } } return false; }
Source:
<code>private static void shutdown() { logger.info("Got shutdown request..."); shuttingDown = true; <START> long killDelay = 30 * 1000; <END> killUnlessShutdownWithin(killDelay); if (simpleSocketServer != null) { try { simpleSocketServer.close(); } catch (Exception e) { logger.debug("Caught exception while shuttin down simpleSocketSserver. Was is not started?", e); } } else { logger.trace("simpleSocketServer was null"); } if (server != null) { try { server.shutdown(); return; } catch (Exception e) { logger.debug("Caught exception while shuttin down the server. Was it not started?", e); System.exit(1); } } else { logger.trace("server was null"); } }</code><technical_language>java TimeUnit.SECONDS(30).toMillis() is more readable</technical_language>

Target:
public void shutdown() { logger.info("Got shutdown request..."); shuttingDown = true; long killDelay = TimeUnit.SECONDS.toMillis(30); killUnlessShutdownWithin(killDelay); if (simpleSocketServer != null) { try { simpleSocketServer.close(); } catch (Exception e) { logger.debug("Caught exception while shuttin down simpleSocketSserver. Was is not started?", e); } } else { logger.trace("simpleSocketServer was null"); } if (server != null) { try { server.shutdown(); return; } catch (Exception e) { logger.debug("Caught exception while shuttin down the server. Was it not started?", e); System.exit(1); } } else { logger.trace("server was null"); } }
Source:
<code>public RoamingGroup(ID id, String name, String description, RoamingGroupType type, List<Operator> operators) { this.id = id; this.name = name; this.description = description; this.type = type; <START> this.operators = operators; <END> }</code><technical_language>Immutable copy</technical_language>

Target:
public RoamingGroup(ID id, String name, String description, RoamingGroupType type, List<Operator> operators) { this.id = id; this.name = name; this.description = description; this.type = type; this.operators = ImmutableList.copyOf(operators); }
Source:
<code>public SystemConsumer getConsumer(String systemName, Config config, MetricsRegistry registry) { <START> jobToManager.putIfAbsent(parseJobId(config), new InMemoryManager()); <END> return new InMemorySystemConsumer(jobToManager.get(parseJobId(config))); }</code><technical_language>roll this parseJobId method rename reflect purpose of creating a manager config attribute keyed on? E.g. getManagerFor... getManagerFrom..</technical_language>

Target:
public SystemConsumer getConsumer(String systemName, Config config, MetricsRegistry registry) { return new InMemorySystemConsumer(getOrDefaultInMemoryManagerByTestId(config)); }
Source:
<code><START> public QueryListDTO(List<Integer> values) { <END> this.values = ImmutableList.copyOf(values); }</code><technical_language>remove public</technical_language>

Target:
QueryListDTO(List<Integer> values) { this.values = ImmutableList.copyOf(values); }
Source:
<code>public void deploy(DeploymentPhaseContext deploymentPhaseContext) throws DeploymentUnitProcessingException { ROOT_LOGGER.processingDeployment(); final DeploymentUnit deploymentUnit = deploymentPhaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); <START> if (support.hasCapability(WELD_CAPABILITY_NAME)) { <END> try { final WeldCapability weldCapability = support.getCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class); if (!weldCapability.isPartOfWeldDeployment(deploymentUnit)) { ROOT_LOGGER.noCdiDeployment(); return; } } catch (CapabilityServiceSupport.NoSuchCapabilityException e) { throw new DeploymentUnitProcessingException(ROOT_LOGGER.deploymentRequiresCapability( deploymentPhaseContext.getDeploymentUnit().getName(), WELD_CAPABILITY_NAME )); } } setServiceName(deploymentUnit); addListeners(deploymentUnit); }</code><technical_language>This check is confusing. org.wildfly.extension.microprofile.opentracing.SubsystemDefinition.OPENTRACING_CAPABILITY if this subsystem is present, WELD_CAPABILITY_NAME present too. this if test return false. try/catch L57 is NoSuchCapabilityException is a checked exception dealt with. Wrapping if test implies WELD_CAPABILITY_NAME optional requirement, not</technical_language>

Target:
public void deploy(DeploymentPhaseContext deploymentPhaseContext) throws DeploymentUnitProcessingException { ROOT_LOGGER.processingDeployment(); final DeploymentUnit deploymentUnit = deploymentPhaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); try { final WeldCapability weldCapability = support.getCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class); if (!weldCapability.isPartOfWeldDeployment(deploymentUnit)) { ROOT_LOGGER.noCdiDeployment(); return; } } catch (CapabilityServiceSupport.NoSuchCapabilityException e) { throw new DeploymentUnitProcessingException(ROOT_LOGGER.deploymentRequiresCapability( deploymentPhaseContext.getDeploymentUnit().getName(), WELD_CAPABILITY_NAME )); } setServiceName(deploymentUnit); addListeners(deploymentUnit); }
Source:
<code>private void showAddBagDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.nav_add)); final View view = getLayoutInflater().inflate(R.layout.dialog_add, null); builder.setView(view); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { TextView textView = (TextView)view.findViewById(R.id.page_url); ServiceHelper.addLink(getBaseContext(), textView.getText().toString()); } }); <START> builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { <END> @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); builder.show(); }</code><technical_language>Pass null a listener, dismiss dialog</technical_language>

Target:
private void showAddBagDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.dialog_add_label); @SuppressLint("InflateParams") final View view = getLayoutInflater().inflate(R.layout.dialog_add, null); builder.setView(view); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { TextView textView = (TextView)view.findViewById(R.id.page_url); ServiceHelper.addLink(getBaseContext(), textView.getText().toString()); } }); builder.setNegativeButton(android.R.string.cancel, null); builder.show(); }
Source:
<code>public synchronized void startPolling(CatalogContext catalogContext) { m_startPolling = true; CatalogMap<Connector> connectors = CatalogUtil.getConnectors(catalogContext); if(!CatalogUtil.hasEnabledConnectors(connectors)) { exportLog.info("System is not using any export functionality or connectors configured are disabled."); return; } ExportDataProcessor processor = m_processor.get(); Preconditions.checkState(processor != null, "guest processor is not set"); processor.startPolling(); <START> cleanupStaleBuffers(); <END> }</code><technical_language>BUG? Should'nt this done startting processor polling</technical_language>

Target:
public synchronized void startPolling(CatalogContext catalogContext) { m_startPolling = true; CatalogMap<Connector> connectors = CatalogUtil.getConnectors(catalogContext); if(!CatalogUtil.hasEnabledConnectors(connectors)) { exportLog.info("System is not using any export functionality or connectors configured are disabled."); return; } ExportDataProcessor processor = m_processor.get(); Preconditions.checkState(processor != null, "guest processor is not set"); cleanupStaleBuffers(); processor.startPolling(); }
Source:
<code>public void testAtsProgramInsertionFeatureBadInsertionRestCall() throws Exception { String result = <START> doRequestString( <END> "/ats/program/" + getSawProgram().getArtId() + "/insertion/" + getSawTeam().getArtId() + "/feature", HttpMethod.GET, null, javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); Assert.assertTrue(result.contains("SERVER_ERROR")); }</code><technical_language>getUuid instead of getArtId,</technical_language>

Target:
public void testAtsProgramInsertionFeatureBadInsertionRestCall() throws Exception { String result = doRequestString("/ats/program/" + getSawProgram().getUuid() + "/insertion/" + getSawTeam() + "/feature", HttpMethod.GET, null, javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); Assert.assertTrue(result.contains("SERVER_ERROR")); }
Source:
<code>public void offer(StreamBlock streamBlock) throws IOException { m_persistentDeque.offer(streamBlock.asBBContainer()); long unreleasedSeqNo = streamBlock.unreleasedSequenceNumber(); if (m_memoryDeque.size() < 2) { StreamBlock fromPBD = pollPersistentDeque(false); if ((streamBlock.startSequenceNumber() == fromPBD.startSequenceNumber()) && (unreleasedSeqNo > streamBlock.startSequenceNumber())) { fromPBD.releaseTo(unreleasedSeqNo - 1); <START> assert(fromPBD.unreleasedSequenceNumber() <= fromPBD.lastSequenceNumber()); <END> } } }</code><technical_language>duplicates assert in 'releaseTo' method</technical_language>

Target:
public void offer(StreamBlock streamBlock) throws IOException { m_persistentDeque.offer(streamBlock.asBBContainer(), !DISABLE_COMPRESSION); long unreleasedSeqNo = streamBlock.unreleasedSequenceNumber(); if (m_memoryDeque.size() < 2) { StreamBlock fromPBD = pollPersistentDeque(false); if ((streamBlock.startSequenceNumber() == fromPBD.startSequenceNumber()) && (unreleasedSeqNo > streamBlock.startSequenceNumber())) { fromPBD.releaseTo(unreleasedSeqNo - 1); } } }
Source:
<code>protected GlusterVolumeSnapshotSchedule getSchedule() { <START> return this.schedule; <END> }</code><technical_language>return schedule; - suffice</technical_language>

Target:
protected GlusterVolumeSnapshotSchedule getSchedule() { return schedule; }
Source:
<code><START> public void addMetadata(Context context, T dso, MetadataField metadataField, String lang, List<String> values, <END> List<String> authorities, List<Integer> confidences) throws SQLException { addMetadata(context, dso, metadataField, lang, values, authorities, confidences, null); }</code><technical_language>This method overrides a method DSpaceObjectServiceImpl changes original object I tell. I remove this one</technical_language>

Target:
public void addMetadata(Context context, T dso, MetadataField metadataField, String lang, List<String> values, List<String> authorities, List<Integer> confidences) throws SQLException { boolean authorityControlled = metadataAuthorityService.isAuthorityControlled(metadataField); boolean authorityRequired = metadataAuthorityService.isAuthorityRequired(metadataField); for (int i = 0; i < values.size(); i++) { MetadataValue metadataValue = metadataValueService.create(context, dso, metadataField); metadataValue.setLanguage(lang == null ? null : lang.trim()); if (authorityControlled) { if (authorities != null && authorities.get(i) != null && authorities.get(i).length() > 0) { metadataValue.setAuthority(authorities.get(i)); metadataValue.setConfidence(confidences == null ? Choices.CF_NOVALUE : confidences.get(i)); } else { metadataValue.setAuthority(null); metadataValue.setConfidence(confidences == null ? Choices.CF_UNSET : confidences.get(i)); } if (authorityRequired && (metadataValue.getAuthority() == null || metadataValue.getAuthority() .length() == 0)) { throw new IllegalArgumentException("The metadata field \"" + metadataField .toString() + "\" requires an authority key but none was provided. Value=\"" + values .get(i) + "\""); } } if (values.get(i) != null) { String temp = values.get(i).trim(); char[] dcvalue = temp.toCharArray(); for (int charPos = 0; charPos < dcvalue.length; charPos++) { if (Character.isISOControl(dcvalue[charPos]) && !String.valueOf(dcvalue[charPos]).equals("\u0009") && !String.valueOf(dcvalue[charPos]).equals("\n") && !String.valueOf(dcvalue[charPos]).equals("\r")) { dcvalue[charPos] = ' '; } } metadataValue.setValue(String.valueOf(dcvalue)); ; } else { metadataValue.setValue(null); } dso.addDetails(metadataField.toString()); } }
Source:
<code>public void onAddPassenger(net.minecraft.entity.Entity passenger, CallbackInfo ci) { if (!this.worldObj.isRemote) { MountEntityEvent event = SpongeEventFactory.createMountEntityEvent(Cause.of(NamedCause.source(passenger)), this); SpongeImpl.postEvent(event); <START> Thread.dumpStack(); <END> if(event.isCancelled()) { ci.cancel(); } } }</code><technical_language>Leftover debug code</technical_language>

Target:
public void onAddPassenger(net.minecraft.entity.Entity passenger, CallbackInfo ci) { if (!this.worldObj.isRemote && ShouldFire.MOUNT_ENTITY_EVENT) { if (SpongeImpl.postEvent(SpongeEventFactory.createMountEntityEvent(Cause.of(NamedCause.source(passenger)), this))) { ci.cancel(); } } }
Source:
<code>public void failForNonexistingName() throws Exception { when(jenkins.getView("NoSuchViewOrItemGroup")).thenReturn(null); when(jenkins.getItemByFullName("NoSuchViewOrItemGroup")).thenReturn(null); try { assertThat(runWith("NoSuchViewOrItemGroup"), equalTo(3)); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), containsString("No view or item group with the given name 'NoSuchViewOrItemGroup' found.")); } catch (Exception e) { <START> throw e; <END> } assertThat(stdout, is(empty())); }</code><technical_language>Do need this branch</technical_language>

Target:
public void failForNonexistingName() throws Exception { when(jenkins.getView("NoSuchViewOrItemGroup")).thenReturn(null); when(jenkins.getItemByFullName("NoSuchViewOrItemGroup")).thenReturn(null); try { runWith("NoSuchViewOrItemGroup"); fail("Exception should be thrown in the previous call."); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), containsString("No view or item group with the given name 'NoSuchViewOrItemGroup' found.")); } assertThat(stdout, is(empty())); }
Source:
<code>public List<String> getExamples() { return Lists.newArrayList( "# Copy the contents of from sample.tar.gz to dataset \"sample\"", <START> "csv-import path/to/sample.tar.gz sample --compression gzip", <END> "# Copy the records from sample.tar.bz2 to a dataset in HDFS", "csv-import path/to/sample.tar.bz2 sample --compression bzip2 --use-hdfs -d datasets" ); }</code><technical_language>remove "csv-import" examples</technical_language>

Target:
public List<String> getExamples() { return Lists.newArrayList( "# Copy the contents of from sample.tar.gz to HDFS dataset \"sample\"", "path/to/sample.tar.gz dataset:hdfs:/path/to/sample" ); }
Source:
<code>private Boolean isTaskKilled(long taskId) { boolean isKilled = false; <START> LOGGER.info("Checking the task status for the task id from backend: " + taskId); <END> if (taskDAO.hasKillFlag(taskId)) { isKilled = true; } return isKilled; }</code><technical_language>internal formatting? so: LOGGER.info("Checking task status for task id backend: {}", taskId);</technical_language>

Target:
private Boolean isTaskKilled(long taskId) { boolean isKilled = false; LOGGER.info("Checking the task status for the task id from backend: {}" , taskId); if (taskDAO.hasKillFlag(taskId)) { isKilled = true; } return isKilled; }
Source:
<code>public Object visitContextDefinition(@NotNull cqlParser.ContextDefinitionContext ctx) { String modelIdentifier = ctx.modelIdentifier() != null ? (String)visit(ctx.modelIdentifier()) : null; String unqualifiedContext = (String)visit(ctx.identifier()); if (modelIdentifier != null && !modelIdentifier.equals("")) { currentContext = modelIdentifier + "." + unqualifiedContext; } else { currentContext = unqualifiedContext; } <START> if (!implicitContextCreated && !unqualifiedContext.equals("Unspecified")) { <END> ExpressionDefinitionInfo expressionDefinition = new ExpressionDefinitionInfo(); expressionDefinition.setName(unqualifiedContext); expressionDefinition.setContext(currentContext); libraryInfo.addExpressionDefinition(expressionDefinition); implicitContextCreated = true; } return currentContext; }</code><technical_language>I this "Unfiltered"</technical_language>

Target:
public Object visitContextDefinition(@NotNull cqlParser.ContextDefinitionContext ctx) { String modelIdentifier = ctx.modelIdentifier() != null ? (String)visit(ctx.modelIdentifier()) : null; String unqualifiedContext = (String)visit(ctx.identifier()); if (modelIdentifier != null && !modelIdentifier.equals("")) { currentContext = modelIdentifier + "." + unqualifiedContext; } else { currentContext = unqualifiedContext; } if (!implicitContextCreated && !unqualifiedContext.equals("Unfiltered")) { ExpressionDefinitionInfo expressionDefinition = new ExpressionDefinitionInfo(); expressionDefinition.setName(unqualifiedContext); expressionDefinition.setContext(currentContext); libraryInfo.addExpressionDefinition(expressionDefinition); implicitContextCreated = true; } return currentContext; }
Source:
<code>protected int runWithJobId(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final JobId jobId, final BufferedReader stdin) throws ExecutionException, InterruptedException { final Map<JobId, Job> jobs = client.jobs(jobId.toString()).get(); if (jobs.size() == 0) { out.printf("Unknown job: %s%n", jobId); return 1; } final Job job = Iterables.getOnlyElement(jobs.values()); if (json) { out.println(Json.asPrettyStringUnchecked(job)); } else { out.printf("Id: %s%n", job.getId()); out.printf("Image: %s%n", job.getImage()); out.printf("Command: %s%n", quote(job.getCommand())); printMap(out, "Env: ", QUOTE, job.getEnv()); <START> out.printf("Health check:%n %s%n", formatHealthCheck(job.getHealthCheck())); <END> out.printf("Grace period (seconds): %s%n", job.getGracePeriod()); printMap(out, "Ports: ", FORMAT_PORTMAPPING, job.getPorts()); printMap(out, "Reg: ", FORMAT_SERVICE_PORTS, job.getRegistration()); out.printf("Token: %s%n", job.getToken()); printVolumes(out, job.getVolumes()); } return 0; }</code><technical_language>%n there? other items start printing line</technical_language>

Target:
protected int runWithJobId(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final JobId jobId, final BufferedReader stdin) throws ExecutionException, InterruptedException { final Map<JobId, Job> jobs = client.jobs(jobId.toString()).get(); if (jobs.size() == 0) { out.printf("Unknown job: %s%n", jobId); return 1; } final Job job = Iterables.getOnlyElement(jobs.values()); if (json) { out.println(Json.asPrettyStringUnchecked(job)); } else { out.printf("Id: %s%n", job.getId()); out.printf("Image: %s%n", job.getImage()); out.printf("Command: %s%n", quote(job.getCommand())); printMap(out, "Env: ", QUOTE, job.getEnv()); out.printf("Health check: %s%n", formatHealthCheck(job.getHealthCheck())); out.printf("Grace period (seconds): %s%n", job.getGracePeriod()); printMap(out, "Ports: ", FORMAT_PORTMAPPING, job.getPorts()); printMap(out, "Reg: ", FORMAT_SERVICE_PORTS, job.getRegistration()); out.printf("Token: %s%n", job.getToken()); printVolumes(out, job.getVolumes()); } return 0; }
Source:
<code><START> public String requestGetConfigurationObject(final DlmsConnectionHolder conn, final DlmsDevice device) <END> throws ProtocolAdapterException { return this.getConfigurationObjectCommandExecutor.execute(conn, device, null); }</code><technical_language>I return a dto do marshalling of response in IL do other responses</technical_language>

Target:
public GetConfigurationObjectResponseDto requestGetConfigurationObject(final DlmsConnectionHolder conn, final DlmsDevice device) throws ProtocolAdapterException { return new GetConfigurationObjectResponseDto( this.getConfigurationObjectCommandExecutor.execute(conn, device, null)); }
Source:
<code>public void testContent() { ______TS("content: typical page"); Url logPageUrl = createUrl(Const.ActionURIs.ADMIN_ACTIVITY_LOG_PAGE); logPage = loginAdminToPage(browser, logPageUrl, AdminActivityLogPage.class); logPage.verifyIsCorrectPage(); ______TS("content: navigate to other pages to get some logs"); logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_HOME_PAGE)); logPage.waitForPageToLoad(); logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_ACCOUNT_MANAGEMENT_PAGE)); logPage.waitForPageToLoad(); logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_SEARCH_PAGE)); logPage.waitForPageToLoad(); logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_ACTIVITY_LOG_PAGE)); <START> logPage.waitForPageToLoad(); <END> logPage.verifyHtmlMainContent("/adminActivityLogPage.html"); }</code><technical_language>Do admin pages show in logs</technical_language>

Target:
public void testContent() { ______TS("content: typical page"); Url logPageUrl = createUrl(Const.ActionURIs.ADMIN_ACTIVITY_LOG_PAGE); logPage = loginAdminToPage(browser, logPageUrl, AdminActivityLogPage.class); logPage.verifyIsCorrectPage(); ______TS("content: navigate to other pages to get some logs"); logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_HOME_PAGE)); logPage.waitForPageToLoad(); logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_ACCOUNT_MANAGEMENT_PAGE)); logPage.waitForPageToLoad(); logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_SEARCH_PAGE)); logPage.waitForPageToLoad(); logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_ACTIVITY_LOG_PAGE)); logPage.waitForPageToLoad(); assertNotNull(logPage.getFirstActivityLogRow()); logPage.verifyHtmlPart(logPage.getFirstActivityLogRow(), "/adminActivityLogPage.html"); }
Source:
<code>public EntityLoader() { <START> } <END></code><technical_language>Explicitely mark QueryBuilder null here, qb a protected final variable. This more explicit constructor means for implementation</technical_language>

Target:
public EntityLoader() { this.qb = null; }
Source:
<code>public void setUp() throws Exception { repo = tmp.getRoot(); j.jenkins .getDescriptorByType(MercurialInstallation.DescriptorImpl.class) .setInstallations(new MercurialInstallation(CACHING_INSTALLATION, "", "hg", <START> false, true, Paths.get("target", "test-data", "custom-cache-dir").toString(), false, "", <END> Collections.<ToolProperty<?>> emptyList())); }</code><technical_language>tmp.newFolder().getAbsolutePath() instead</technical_language>

Target:
public void setUp() throws Exception { repo = tmp.getRoot(); j.jenkins .getDescriptorByType(MercurialInstallation.DescriptorImpl.class) .setInstallations(new MercurialInstallation(CACHING_INSTALLATION, "", "hg", false, true, new File(tmp.newFolder(),"custom-cache-dir").getAbsolutePath().toString(), false, "", Collections.<ToolProperty<?>> emptyList())); }
Source:
<code>public void doFilter( ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain ) throws IOException, ServletException { if (authConfig.isEnabled()) { QueryInterruptedException unauthorizedError = new QueryInterruptedException( QueryInterruptedException.UNAUTHORIZED, null, null, DruidNode.getDefaultHost() ); unauthorizedError.setStackTrace(new StackTraceElement[0]); OutputStream out = servletResponse.getOutputStream(); Boolean authInfoChecked = null; final HttpServletResponse response = (HttpServletResponse) servletResponse; if (servletRequest.getAttribute(AuthConfig.DRUID_AUTH_TOKEN) == null) { Set<String> supportedAuthSchemes = Sets.newHashSet(); for (Authenticator authenticator : authenticators) { String challengeHeader = authenticator.getAuthChallengeHeader(); if (challengeHeader != null) { supportedAuthSchemes.add(challengeHeader); } } for (String authScheme : supportedAuthSchemes) { response.addHeader("WWW-Authenticate", authScheme); } sendJsonError(response, Response.SC_UNAUTHORIZED, jsonMapper.writeValueAsString(unauthorizedError), out); <START> return; <END> } GenericResponseWrapper wrapper = new GenericResponseWrapper((HttpServletResponse) servletResponse); filterChain.doFilter(servletRequest, wrapper); authInfoChecked = (Boolean) servletRequest.getAttribute(AuthConfig.DRUID_AUTH_TOKEN_CHECKED); if (authInfoChecked == null && !errorOverridesMissingAuth(response.getStatus())) { log.error( "Request did not have an authorization check performed: %s", ((HttpServletRequest) servletRequest).getRequestURI() ); sendJsonError(response, Response.SC_FORBIDDEN, jsonMapper.writeValueAsString(unauthorizedError), out); } else { out.write(wrapper.getData()); } out.close(); } else { filterChain.doFilter(servletRequest, servletResponse); } }</code><technical_language>out closed return</technical_language>

Target:
public void doFilter( ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain ) throws IOException, ServletException { final HttpServletResponse response = (HttpServletResponse) servletResponse; final HttpServletRequest request = (HttpServletRequest) servletRequest; if (servletRequest.getAttribute(AuthConfig.DRUID_AUTHENTICATION_RESULT) == null) { handleUnauthenticatedRequest(response); return; } filterChain.doFilter(servletRequest, servletResponse); Boolean authInfoChecked = (Boolean) servletRequest.getAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED); if (authInfoChecked == null && !errorOverridesMissingAuth(response.getStatus())) { handleAuthorizationCheckError( "Request did not have an authorization check performed.", request, response ); } if (authInfoChecked != null && !authInfoChecked && response.getStatus() != Response.SC_FORBIDDEN) { handleAuthorizationCheckError( "Request's authorization check failed but status code was not 403.", request, response ); } }
Source:
<code>public ReferenceWithError<Optional<Entity>> addInSingleLocation(Location location, Map<?,?> flags) { ReferenceWithError<Collection<Entity>> added = addInEachLocation(ImmutableList.of(location), flags); <START> return ReferenceWithError.newInstanceWithInformativeError( <END> Iterables.isEmpty(added.getIgnoringError()) ? Optional.<Entity>absent() : Optional.of(Iterables.getOnlyElement(added.getIgnoringError())), added.getError()); }</code><technical_language>I follow. If underlying ReferenceWithError is a newInstanceWithFatalError, turning a newInstanceWithInformativeError. Is deliberate</technical_language>

Target:
protected ReferenceWithError<Optional<Entity>> addInSingleLocation(Location location, Map<?,?> flags) { ReferenceWithError<Collection<Entity>> added = addInEachLocation(ImmutableList.of(location), flags); Optional<Entity> result = Iterables.isEmpty(added.getMaskingError()) ? Optional.<Entity>absent() : Optional.of(Iterables.getOnlyElement(added.get())); if (!added.hasError()) { return ReferenceWithError.newInstanceWithoutError( result ); } else { if (added.masksErrorIfPresent()) { return ReferenceWithError.newInstanceMaskingError( result, added.getError() ); } else { return ReferenceWithError.newInstanceThrowingError( result, added.getError() ); } } }
Source:
<code>public void anonCanRemindPasswordFromAuthModal() { MailFunctions.deleteAllEmails(credentials.email, credentials.emailPassword); WikiBasePageObject base = new WikiBasePageObject(); base.openWikiPage(wikiURL); DetachedSignInPage loginModal = new DetachedSignInPage(new NavigationBar(driver).clickOnSignIn()); loginModal .clickForgotPasswordLink() .requestLinkForUsername(User.FORGOTTEN_PASSWORD.getUserName()); String resetLink = base.getPasswordResetLink(credentials.email, credentials.emailPassword); ResetPasswordPage resetPass = new ResetPasswordPage(resetLink); resetPass.setNewPassword(User.FORGOTTEN_PASSWORD.getPassword()); Assertion.assertTrue(resetPass.newPasswordSetSuccessfully()); <START> <END> }</code><technical_language>Empty newline + static import</technical_language>

Target:
public void anonCanRemindPasswordFromAuthModal() { EmailUtils.deleteAllEmails(credentials.email, credentials.emailPassword); WikiBasePageObject base = new WikiBasePageObject(); base.openWikiPage(wikiURL); DetachedSignInPage loginModal = new DetachedSignInPage(new NavigationBar(driver).clickOnSignIn()); loginModal .clickForgotPasswordLink() .requestLinkForUsername(User.FORGOTTEN_PASSWORD.getUserName()); String resetLink = base.getPasswordResetLink(credentials.email, credentials.emailPassword); ResetPasswordPage resetPass = new ResetPasswordPage(resetLink); resetPass.setNewPassword(User.FORGOTTEN_PASSWORD.getPassword()); assertTrue(resetPass.newPasswordSetSuccessfully()); }
Source:
<code>private void createEmptyFolder() throws Exception { File path = new File(db.getWorkTree(), FOLDER); assertTrue(path.mkdir()); <START> assertTrue(path.isDirectory()); <END> }</code><technical_language>Replace asserts FileUtils.mkDirs</technical_language>

Target:
private void createEmptyFolder() throws Exception { File path = new File(db.getWorkTree(), FOLDER); FileUtils.mkdir(path); }
Source:
<code>void handleRevocation(final Collection<TopicPartition> revokedPartitions) { final Set<TopicPartition> remainingPartitions = new HashSet<>(revokedPartitions); final Map<TaskId, Map<TopicPartition, OffsetAndMetadata>> consumedOffsetsAndMetadataPerTask = new HashMap<>(); for (final Task task : tasks.values()) { if (remainingPartitions.containsAll(task.inputPartitions())) { task.prepareSuspend(); if (task.state() != CREATED) { consumedOffsetsAndMetadataPerTask.put(task.id(), task.committableOffsetsAndMetadata()); } } remainingPartitions.removeAll(task.inputPartitions()); } if (!consumedOffsetsAndMetadataPerTask.isEmpty()) { commitOffsetsOrTransaction(consumedOffsetsAndMetadataPerTask); } <START> for (final Task task : tasks.values()) { <END> if (consumedOffsetsAndMetadataPerTask.containsKey(task.id())) { task.suspend(); } } if (!remainingPartitions.isEmpty()) { log.warn("The following partitions are missing from the task partitions. It could potentially " + "due to race condition of consumer detecting the heartbeat failure, or the tasks " + "have been cleaned up by the handleAssignment callback.", remainingPartitions); } }</code><technical_language>Similarly here, this state check internalized</technical_language>

Target:
void handleRevocation(final Collection<TopicPartition> revokedPartitions) { final Set<TopicPartition> remainingPartitions = new HashSet<>(revokedPartitions); final Map<TaskId, Map<TopicPartition, OffsetAndMetadata>> consumedOffsetsAndMetadataPerTask = new HashMap<>(); for (final Task task : tasks.values()) { if (remainingPartitions.containsAll(task.inputPartitions())) { task.prepareSuspend(); final Map<TopicPartition, OffsetAndMetadata> committableOffsets = task.committableOffsetsAndMetadata(); if (!committableOffsets.isEmpty()) { consumedOffsetsAndMetadataPerTask.put(task.id(), committableOffsets); } } remainingPartitions.removeAll(task.inputPartitions()); } if (!consumedOffsetsAndMetadataPerTask.isEmpty()) { commitOffsetsOrTransaction(consumedOffsetsAndMetadataPerTask); } for (final Task task : tasks.values()) { if (consumedOffsetsAndMetadataPerTask.containsKey(task.id())) { task.suspend(); } } if (!remainingPartitions.isEmpty()) { log.warn("The following partitions are missing from the task partitions. It could potentially " + "due to race condition of consumer detecting the heartbeat failure, or the tasks " + "have been cleaned up by the handleAssignment callback.", remainingPartitions); } }