auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void update() { briefcaseDir.ifPresent(path -> { Set<String> scannedFiles = new HashSet<>(); list(path.resolve("forms")) .map(this::getFormFilePath) .peek(p -> scannedFiles.add(p.toString())) .forEach(form -> { String hash = FileSystemUtils.getMd5Hash(form.toFile()); if (isFormNewOrChanged(form, hash)) { try { formDefByPath.put(form.toString(), new BriefcaseFormDefinition(form.getParent().toFile(), form.toFile())); hashByPath.put(form.toString(), hash); } catch (BadFormDefinition e) { log.warn("Can't parse form file", e); } } }); hashByPath.keySet().stream().filter(p -> !scannedFiles.contains(p)).collect(toList()).forEach(hashByPath::remove); formDefByPath.keySet().stream().filter(p -> !scannedFiles.contains(p)).collect(toList()).forEach(formDefByPath::remove); EventBus.publish(new CacheUpdateEvent()); save(); }); }

Target:
public void update() { briefcaseDir.ifPresent(path -> { Set<String> scannedFiles = new HashSet<>(); list(path.resolve("forms")).forEach(formDir -> { Path form = getFormFilePath(formDir); scannedFiles.add(form.toString()); String hash = FileSystemUtils.getMd5Hash(form.toFile()); if (isFormNewOrChanged(form, hash)) { try { formDefByPath.put(form.toString(), new BriefcaseFormDefinition(form.getParent().toFile(), form.toFile())); hashByPath.put(form.toString(), hash); } catch (BadFormDefinition e) { log.warn("Can't parse form file", e); } } }); hashByPath.keySet().removeIf(negate(scannedFiles::contains)); formDefByPath.keySet().removeIf(negate(scannedFiles::contains)); EventBus.publish(new CacheUpdateEvent()); save(); }); }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; JobSubjectEntityId other = (JobSubjectEntityId) obj; if (entityId == null) { if (other.entityId != null) return false; } else if (!entityId.equals(other.entityId)) return false; if (jobId == null) { if (other.jobId != null) return false; } else if (!jobId.equals(other.jobId)) return false; return true; }

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (this == obj) { return true; } if (!(obj instanceof JobSubjectEntityId)) { return false; } JobSubjectEntityId other = (JobSubjectEntityId) obj; return Objects.equals(entityId, other.entityId) && Objects.equals(jobId, other.jobId); }
Source:
private void evaluateSiteBasedSubscription(Set<String> sourceIds, String metacardSourceId) { String sourceId = sourceIds .iterator() .next(); LOGGER.debug("subscription is a site-based subscription starting with site id {}", sourceId); if (sourceIds.contains(metacardSourceId)) { LOGGER.debug("event received from subscribed site"); evaluateEvent(event); } else { LOGGER.debug( "event received from remote site that is not in list of source IDs of subscription - not evaluating event"); } }

Target:
private void evaluateSiteBasedSubscription(Set<String> sourceIds, String metacardSourceId) { if (LOGGER.isDebugEnabled()) { LOGGER.debug( "subscription is a site-based subscription starting with site id {}", sourceIds.iterator().next()); } if (sourceIds.contains(metacardSourceId)) { LOGGER.debug("event received from subscribed site"); evaluateEvent(event); } else { LOGGER.debug( "event received from remote site that is not in list of source IDs of subscription - not evaluating event"); } }
Source:
public void whenPostEventOverflowsBufferThenUpdateItemStatus() throws Exception { BatchItem item = new BatchItem(new JSONObject()); item.setPartition("1"); List<BatchItem> batch = new ArrayList<>(); batch.add(item); Mockito .doThrow(BufferExhaustedException.class) .when(kafkaProducer) .send(any(), any()); try { kafkaTopicRepository.syncPostBatch(EXPECTED_PRODUCER_RECORD.topic(), batch); fail(); } catch (EventPublishingException e) { assertThat(item.getResponse().getPublishingStatus(), equalTo(EventPublishingStatus.FAILED)); assertThat(item.getResponse().getDetail(), equalTo("internal error")); } }

Target:
public void whenPostEventOverflowsBufferThenUpdateItemStatus() throws Exception { final BatchItem item = new BatchItem(new JSONObject()); item.setPartition("1"); final List<BatchItem> batch = new ArrayList<>(); batch.add(item); Mockito .doThrow(BufferExhaustedException.class) .when(kafkaProducer) .send(any(), any()); try { kafkaTopicRepository.syncPostBatch(EXPECTED_PRODUCER_RECORD.topic(), batch); fail(); } catch (EventPublishingException e) { assertThat(item.getResponse().getPublishingStatus(), equalTo(EventPublishingStatus.FAILED)); assertThat(item.getResponse().getDetail(), equalTo("internal error")); } }
Source:
private boolean areBricksInTheList(GlusterVolumeEntity volumeEntity, final List<GlusterBrickEntity> bricks, final List<GlusterBrickEntity> searchBricks) { boolean found = false; for (GlusterBrickEntity paramBrick : bricks) { GlusterBrickEntity paramBrickFromVolume = volumeEntity.getBrickWithId(paramBrick.getId()); if (paramBrickFromVolume == null) { paramBrickFromVolume = volumeEntity.getBrickWithQualifiedName(paramBrick.getQualifiedName()); } found = false; for (GlusterBrickEntity brick : searchBricks) { if (paramBrickFromVolume == null || paramBrickFromVolume.getId() == null) { return false; } if (paramBrickFromVolume.getId().equals(brick.getId())) { found = true; break; } if (!found) { return false; } } } return found; }

Target:
private boolean areBricksInTheList(GlusterVolumeEntity volumeEntity, final List<GlusterBrickEntity> bricks, final List<GlusterBrickEntity> searchBricks) { boolean found = false; for (GlusterBrickEntity paramBrick : bricks) { GlusterBrickEntity paramBrickFromVolume = volumeEntity.getBrickWithId(paramBrick.getId()); if (paramBrickFromVolume == null) { paramBrickFromVolume = volumeEntity.getBrickWithQualifiedName(paramBrick.getQualifiedName()); } found = false; for (GlusterBrickEntity brick : searchBricks) { if (paramBrickFromVolume == null || paramBrickFromVolume.getId() == null) { return false; } if (paramBrickFromVolume.getId().equals(brick.getId())) { found = true; break; } } if (!found) { return false; } } return found; }
Source:
private String createDanglingImage() { CreateContainerResponse container = dockerClient.createContainerCmd("busybox").withCmd("sleep", "9999").exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); dockerClient.startContainerCmd(container.getId()).exec(); LOG.info("Committing container {}", container.toString()); String imageId = dockerClient.commitCmd(container.getId()).exec(); dockerClient.stopContainerCmd(container.getId()).exec(); dockerClient.removeContainerCmd(container.getId()).exec(); return imageId; }}

Target:
private String createDanglingImage() { CreateContainerResponse container = dockerClient.createContainerCmd("busybox").withCmd("sleep", "9999").exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); dockerClient.startContainerCmd(container.getId()).exec(); LOG.info("Committing container {}", container.toString()); String imageId = dockerClient.commitCmd(container.getId()).exec(); dockerClient.stopContainerCmd(container.getId()).exec(); dockerClient.removeContainerCmd(container.getId()).exec(); return imageId; }
Source:
public void setBreed(boolean breed) { if (breed) { setAge(AGE_ADULT); } else if (isAdult()) { setAge(6000); } }

Target:
public void setBreed(boolean breed) { if (breed) { setAge(AGE_ADULT); } else if (isAdult()) { setAge(BREEDING_AGE); } }
Source:
public void load(GlowItemFrame entity, CompoundTag tag) { super.load(entity, tag); if (tag.isInt("Facing")) { entity.setFacingDirectionNumber((tag.getInt("Facing"))); } if (tag.isCompound("Item")) { entity.setIteminFrame(NbtSerialization.readItem(tag.getCompound("Item"))); } if (tag.isInt("Rotation")) { entity.setRotationAngle((tag.getInt("Rotation") * 45)); } }

Target:
public void load(GlowItemFrame entity, CompoundTag tag) { super.load(entity, tag); if (tag.isInt("Facing")) { entity.setFacingDirectionNumber((tag.getInt("Facing"))); } if (tag.isCompound("Item")) { entity.setItemInFrame(NbtSerialization.readItem(tag.getCompound("Item"))); } if (tag.isInt("Rotation")) { entity.setRotationAngle((tag.getInt("Rotation") * 45)); } }
Source:
public String getLocalName() { if (localName == null) { if (stereotypeHelper.isStereotypeComment(getNotationElement())) { return "StereotypeComment"; } } return super.getLocalName(); }

Target:
public String getLocalName() { if (localName == null) { if (stereotypeHelper.isStereotypeComment(getNotationElement())) { return STEREOTYPE_COMMENT; } } return super.getLocalName(); }
Source:
void collectStaticMetrics(Collection<ProbeInstance> probeInstances) { for (ProbeInstance probeInstance : probeInstances) { ProbeFunction function = probeInstance.function; if (function instanceof LongProbeFunction) { collectLong(probeInstance.source, probeInstance.name, (LongProbeFunction) function); } else if (function instanceof DoubleProbeFunction) { collectDouble(probeInstance.source, probeInstance.name, (DoubleProbeFunction) function); } } }

Target:
void collectStaticMetrics(Collection<ProbeInstance> probeInstances) { for (ProbeInstance probeInstance : probeInstances) { ProbeFunction function = probeInstance.function; if (function instanceof LongProbeFunction) { collectLong(probeInstance.source, probeInstance.name, (LongProbeFunction) function); } else if (function instanceof DoubleProbeFunction) { collectDouble(probeInstance.source, probeInstance.name, (DoubleProbeFunction) function); } else { throw new IllegalStateException("Unhandled ProbeFunction encountered: " + function.getClass().getName()); } } }
Source:
public void setter_list_ownList() { realm.beginTransaction(); RealmList<AllJavaTypes> allTypesRealmModels = new RealmList<>(); for (int i = 0; i < 2; i++) { allTypesRealmModels.add(new AllJavaTypes(i)); } AllJavaTypes model = new AllJavaTypes(2); model.setFieldList(allTypesRealmModels); model = realm.copyToRealm(model); realm.commitTransaction(); assertEquals(2, model.getFieldList().size()); realm.beginTransaction(); model.setFieldList(model.getFieldList()); realm.commitTransaction(); assertEquals(2, model.getFieldList().size()); }

Target:
public void setter_list_ownList() { realm.beginTransaction(); RealmList<AllJavaTypes> allTypesRealmModels = new RealmList<>(); for (int i = 0; i < 2; i++) { allTypesRealmModels.add(new AllJavaTypes(i)); } AllJavaTypes model = new AllJavaTypes(2); model.setFieldList(allTypesRealmModels); model = realm.copyToRealm(model); realm.commitTransaction(); assertEquals(2, model.getFieldList().size()); realm.beginTransaction(); model.setFieldList(model.getFieldList()); realm.commitTransaction(); assertEquals(2, model.getFieldList().size()); realm.beginTransaction(); RealmList<AllJavaTypes> unmanagedList = new RealmList<>(); unmanagedList.addAll(realm.copyFromRealm(model.getFieldList())); try { model.setFieldList(unmanagedList); fail(); } catch (IllegalArgumentException ignored) { } }
Source:
private TrackedContentEntry recalculate( final TrackedContentEntry entry ) throws IndyWorkflowException { StoreKey affectedStore = entry.getStoreKey(); String path = entry.getPath(); AccessChannel channel = entry.getAccessChannel(); Transfer transfer = contentManager.getTransfer( affectedStore, path, entry.getEffect() == StoreEffect.UPLOAD ? TransferOperation.UPLOAD : TransferOperation.DOWNLOAD ); if ( transfer == null ) { return null; } contentDigester.removeMetadata( transfer ); TransferMetadata artifactData = contentDigester.digest( affectedStore, path, new EventMetadata( affectedStore.getPackageType() ) ); Map<ContentDigest, String> digests = artifactData.getDigests(); return new TrackedContentEntry( entry.getTrackingKey(), affectedStore, channel, entry.getOriginUrl(), path, entry.getEffect(), artifactData.getSize(), digests.get( ContentDigest.MD5 ), digests.get( ContentDigest.SHA_1 ), digests.get( ContentDigest.SHA_256 ) ); }

Target:
private TrackedContentEntry recalculate( final TrackedContentEntry entry ) throws IndyWorkflowException { StoreKey affectedStore = entry.getStoreKey(); String path = entry.getPath(); AccessChannel channel = entry.getAccessChannel(); Transfer transfer = contentManager.getTransfer( affectedStore, path, entry.getEffect() == StoreEffect.UPLOAD ? TransferOperation.UPLOAD : TransferOperation.DOWNLOAD ); if ( transfer == null ) { return entry; } contentDigester.removeMetadata( transfer ); TransferMetadata artifactData = contentDigester.digest( affectedStore, path, new EventMetadata( affectedStore.getPackageType() ) ); Map<ContentDigest, String> digests = artifactData.getDigests(); return new TrackedContentEntry( entry.getTrackingKey(), affectedStore, channel, entry.getOriginUrl(), path, entry.getEffect(), artifactData.getSize(), digests.get( ContentDigest.MD5 ), digests.get( ContentDigest.SHA_1 ), digests.get( ContentDigest.SHA_256 ) ); }
Source:
private static Map<String, String> readMessagesFromBundle() { try { ResourceBundle bundle = ResourceBundle.getBundle(APP_ERRORS_MESSAGES_FILE_NAME); Map<String, String> messages = new HashMap<String, String>(); for (String key : bundle.keySet()) { messages.put(key, bundle.getString(key)); } return messages; } catch (MissingResourceException e) { log.error("Could not load audit log messages from the file " + APP_ERRORS_MESSAGES_FILE_NAME); throw new ApplicationException(e); } }

Target:
private static ResourceBundle readMessagesFromBundle() { try { return ResourceBundle.getBundle(APP_ERRORS_MESSAGES_FILE_NAME); } catch (MissingResourceException e) { log.error("Could not load audit log messages from the file " + APP_ERRORS_MESSAGES_FILE_NAME); throw new ApplicationException(e); } }
Source:
public void testNonExistingClass() throws Exception { exit.expectSystemExitWithStatus(-2); exit.checkAssertionAfterwards(() -> { final String expectedExceptionMessage = errorCounterMessage.getMessage() + System.getProperty("line.separator"); assertEquals(expectedExceptionMessage, systemOut.getLog()); final String cause = "com.puppycrawl.tools.checkstyle.api.CheckstyleException:" + " cannot initialize module TreeWalker - "; assertTrue(systemErr.getLog().startsWith(cause)); }); Main.main("-c", getPath("config-non-existing-classname.xml"), getPath("InputMain.java")); }

Target:
public void testNonExistingClass() throws Exception { exit.expectSystemExitWithStatus(-2); exit.checkAssertionAfterwards(() -> { final String expectedExceptionMessage = errorCounterOneMessage.getMessage() + EOL; assertEquals(expectedExceptionMessage, systemOut.getLog()); final String cause = "com.puppycrawl.tools.checkstyle.api.CheckstyleException:" + " cannot initialize module TreeWalker - "; assertTrue(systemErr.getLog().startsWith(cause)); }); Main.main("-c", getPath("config-non-existing-classname.xml"), getPath("InputMain.java")); }
Source:
public SnapshotImpl updateSnapshot(SnapshotImpl update) throws NotFoundException, ConflictException, SnapshotException { requireNonNull(update, "Required non-null snapshot"); requireNonNull(update.getId(), "Required non-null snapshot id"); return snapshots.put(update.getId(), update); }

Target:
public SnapshotImpl updateSnapshot(SnapshotImpl update) throws NotFoundException, ConflictException, SnapshotException { throw new RuntimeException("Not implemented"); }
Source:
public GridDialect newInstance(Class<? extends GridDialect> clazz) { try { Constructor<?> injector = null; for ( Constructor<?> constructor : clazz.getConstructors() ) { Class<?>[] parameterTypes = constructor.getParameterTypes(); if ( parameterTypes.length == 1 && DatastoreProvider.class.isAssignableFrom( parameterTypes[0] ) ) { injector = constructor; break; } } if ( injector == null ) { log.gridDialectHasNoProperConstructor( clazz ); } GridDialect gridDialect = (GridDialect) injector.newInstance( datastore ); if ( gridDialect instanceof BatchableGridDialect ) { BatchableGridDialect batchable = (BatchableGridDialect) gridDialect; gridDialect = new BatchOperationsDelegator( batchable ); } log.useGridDialect( gridDialect.getClass().getName() ); if ( GridDialectLogger.activationNeeded() ) { gridDialect = new GridDialectLogger<Serializable>( gridDialect ); log.info( "Grid dialect logs are active" ); } else { log.info( "Grid dialect logs are disabled" ); } return gridDialect; } catch ( Exception e ) { throw log.cannotInstantiateGridDialect( clazz, e ); } }

Target:
public GridDialect newInstance(Class<? extends GridDialect> clazz) { try { Constructor<?> injector = null; for ( Constructor<?> constructor : clazz.getConstructors() ) { Class<?>[] parameterTypes = constructor.getParameterTypes(); if ( parameterTypes.length == 1 && DatastoreProvider.class.isAssignableFrom( parameterTypes[0] ) ) { injector = constructor; break; } } if ( injector == null ) { log.gridDialectHasNoProperConstructor( clazz ); } GridDialect gridDialect = (GridDialect) injector.newInstance( datastore ); if ( gridDialect instanceof BatchableGridDialect ) { BatchableGridDialect batchable = (BatchableGridDialect) gridDialect; gridDialect = new BatchOperationsDelegator( batchable ); } log.useGridDialect( gridDialect.getClass().getName() ); if ( GridDialectLogger.activationNeeded() ) { gridDialect = new GridDialectLogger( gridDialect ); log.info( "Grid dialect logs are active" ); } else { log.info( "Grid dialect logs are disabled" ); } return gridDialect; } catch ( Exception e ) { throw log.cannotInstantiateGridDialect( clazz, e ); } }
Source:
public CTFTrace(File path) throws CTFReaderException { this.path = path; this.metadata = new Metadata(this); if (!this.path.exists()) { throw new CTFReaderException("Trace doesn't exists. Deleted or moved?"); } if (!this.path.isDirectory()) { throw new CTFReaderException("Path must be a valid directory"); } metadata.parse(); if (packetHeaderDecl != null) { packetHeaderDef = packetHeaderDecl.createDefinition(this, "packet.header"); } File[] files = path.listFiles(metadataFileFilter); Arrays.sort(files, metadataComparator); for (File streamFile : files) { openStreamInput(streamFile); } for (Map.Entry<Long, Stream> stream : streams.entrySet()) { Set<StreamInput> inputs = stream.getValue().getStreamInputs(); for (StreamInput s : inputs) { Iterator<Entry<Long, EventDeclaration>> it = s.getStream() .getEvents().entrySet().iterator(); while (it.hasNext()) { Map.Entry<Long, EventDeclaration> pairs = it.next(); Long eventNum = pairs.getKey(); EventDeclaration eventDec = pairs.getValue(); getEvents(s.getStream().getId()).put(eventNum, eventDec); } s.setupIndex(); } } }

Target:
public CTFTrace(File path) throws CTFReaderException { this.path = path; this.metadata = new Metadata(this); if (!this.path.exists()) { throw new CTFReaderException("Trace (" + path.getPath() + ") doesn't exist. Deleted or moved?"); } if (!this.path.isDirectory()) { throw new CTFReaderException("Path must be a valid directory"); } metadata.parse(); if (packetHeaderDecl != null) { packetHeaderDef = packetHeaderDecl.createDefinition(this, "packet.header"); } File[] files = path.listFiles(metadataFileFilter); Arrays.sort(files, metadataComparator); for (File streamFile : files) { openStreamInput(streamFile); } for (Map.Entry<Long, Stream> stream : streams.entrySet()) { Set<StreamInput> inputs = stream.getValue().getStreamInputs(); for (StreamInput s : inputs) { Iterator<Entry<Long, EventDeclaration>> it = s.getStream() .getEvents().entrySet().iterator(); while (it.hasNext()) { Map.Entry<Long, EventDeclaration> pairs = it.next(); Long eventNum = pairs.getKey(); EventDeclaration eventDec = pairs.getValue(); getEvents(s.getStream().getId()).put(eventNum, eventDec); } s.setupIndex(); } } }
Source:
private JsonObject getJsonFile(String jsonFilePath) throws IOException { final URL urlResource = getUrlResource(jsonFilePath); if (urlResource == null) { return null; } File pluginPackageJson = new File(urlResource.getFile()); String jsonString; if (!pluginPackageJson.exists()) { try (InputStream resourceAsStream = this.getClass().getClassLoader() .getResourceAsStream(jsonFilePath)) { if (resourceAsStream != null) { jsonString = FrontendUtils.streamToString(resourceAsStream); } else { return null; } } } else { jsonString = FileUtils.readFileToString(pluginPackageJson, UTF_8); } return Json.parse(jsonString); }

Target:
private JsonObject getJsonFile(String jsonFilePath) throws IOException { final URL urlResource = getResourceUrl(jsonFilePath); if (urlResource == null) { return null; } File jsonFile = new File(urlResource.getFile()); String jsonString; if (!jsonFile.exists()) { try (InputStream resourceAsStream = this.getClass().getClassLoader() .getResourceAsStream(jsonFilePath)) { if (resourceAsStream != null) { jsonString = FrontendUtils.streamToString(resourceAsStream); } else { return null; } } } else { jsonString = FileUtils.readFileToString(jsonFile, UTF_8); } return Json.parse(jsonString); }
Source:
public Annotation createAnnotation(CoreSession session, Annotation annotation) { ConfigurationService configurationService = Framework.getService(ConfigurationService.class); boolean annotationPlaceless = configurationService.isBooleanPropertyTrue(ANNOTATIONS_PLACELESS_STORAGE_PROPERTY); return CoreInstance.doPrivileged(session, s -> { String path = null; if (!annotationPlaceless) { DocumentModel annotatedDoc = s.getDocument(new IdRef(annotation.getDocumentId())); String parentPath = s.getRootDocument().getPathAsString(); if (annotatedDoc.getPath().segmentCount() > 1) { parentPath += annotatedDoc.getPath().segment(0); } String folderName = "Annotation_" + annotatedDoc.getId() + "_" + annotatedDoc.getVersionLabel(); PathRef ref = new PathRef(parentPath, folderName); if (!s.exists(ref)) { DocumentModel annotationFolderDoc = s.createDocumentModel(parentPath, folderName, "HiddenFolder"); s.createDocument(annotationFolderDoc); s.save(); } path = ref.toString(); } DocumentModel annotationModel = s.createDocumentModel(path, ANNOTATION_NAME, ANNOTATION_DOC_TYPE); setAnnotationProperties(annotationModel, annotation); annotationModel = s.createDocument(annotationModel); return new AnnotationImpl(annotationModel); }); }

Target:
public Annotation createAnnotation(CoreSession session, Annotation annotation) { ConfigurationService configurationService = Framework.getService(ConfigurationService.class); boolean annotationPlaceless = configurationService.isBooleanPropertyTrue( ANNOTATIONS_PLACELESS_STORAGE_PROPERTY); return CoreInstance.doPrivileged(session, s -> { String path = null; if (!annotationPlaceless) { DocumentModel annotatedDoc = s.getDocument(new IdRef(annotation.getDocumentId())); String parentPath = s.getRootDocument().getPathAsString(); if (annotatedDoc.getPath().segmentCount() > 1) { parentPath += annotatedDoc.getPath().segment(0); } PathRef ref = new PathRef(parentPath, ANNOTATION_FOLDER_NAME); DocumentModel annotationFolderDoc = s.createDocumentModel(parentPath, ANNOTATION_FOLDER_NAME, HIDDEN_FOLDER_TYPE); s.getOrCreateDocument(annotationFolderDoc); s.save(); path = ref.toString(); } DocumentModel annotationModel = s.createDocumentModel(path, ANNOTATION_NAME, ANNOTATION_DOC_TYPE); setAnnotationProperties(annotationModel, annotation); annotationModel = s.createDocument(annotationModel); return new AnnotationImpl(annotationModel); }); }
Source:
public void setUpClass() throws Exception { generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.resolve.only:foo", "1.1" ); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.partial:partial-foo", "3.1", "3.2" ); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.copy:copy-foo", "1.1", "1.2" ); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "com.artifacts.to.delete.releases:delete-foo", "1.2.1", "1.2.2" ); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.partial:partial-foo", "3.1", "3.2" ); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.browse:foo-bar", "1.0", "2.4" ); new File(TEST_RESOURCES).mkdirs(); }

Target:
public static void setUpClass() throws Exception { GENERATOR_BASEDIR = new File(ConfigurationResourceResolver.getVaultDirectory() + "/local"); REPOSITORY_BASEDIR_RELEASES = new File(ConfigurationResourceResolver.getVaultDirectory() + "/storages/storage0/releases"); removeDir(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath() + "/org/carlspring/strongbox/resolve"); removeDir(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath() + "/org/carlspring/strongbox/partial"); removeDir(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath() + "/org/carlspring/strongbox/copy"); removeDir(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath() + "/org/carlspring/strongbox/browse"); removeDir(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath() + "/com/artifacts/to/delete"); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.resolve.only:foo", "1.1" ); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.partial:partial-foo", "3.1", "3.2" ); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.copy:copy-foo", "1.1", "1.2" ); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "com.artifacts.to.delete.releases:delete-foo", "1.2.1", "1.2.2" ); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.partial:partial-foo", "3.1", "3.2" ); generateArtifact(REPOSITORY_BASEDIR_RELEASES.getAbsolutePath(), "org.carlspring.strongbox.browse:foo-bar", "1.0", "2.4" ); new File(TEST_RESOURCES).mkdirs(); }
Source:
public void generate(final Ds3ApiSpec spec, final FileUtils fileUtils, final Path destDir, final Ds3DocSpec docSpec) throws IOException { this.fileUtils = fileUtils; this.destDir = destDir; try { final ImmutableList<Ds3Request> ds3Requests = spec.getRequests(); final ImmutableMap<String, Ds3Type> typeMap = removeUnusedTypes( spec.getTypes(), spec.getRequests()); generateCommands(ds3Requests); generateClient(ds3Requests); generateAllTypes(typeMap); } catch (final Exception e) { e.printStackTrace(); } }

Target:
public void generate(final Ds3ApiSpec spec, final FileUtils fileUtils, final Path destDir, final Ds3DocSpec docSpec) throws IOException { this.fileUtils = fileUtils; this.destDir = destDir; try { final ImmutableList<Ds3Request> ds3Requests = spec.getRequests(); final ImmutableMap<String, Ds3Type> typeMap = removeUnusedTypes( spec.getTypes(), spec.getRequests()); generateCommands(ds3Requests); generateClient(ds3Requests); generateAllTypes(typeMap); } catch (final Exception e) { LOG.error("Unable to generate Go SDK code", e); } }
Source:
public void close() { try { if (baseOp != null) baseOp.close(); if (startTime != -1) { String cql = command.toCQLString(); int time = (int) Math.min(TimeUnit.NANOSECONDS.toMicros(System.nanoTime() - startTime), Integer.MAX_VALUE); ColumnFamilyStore cfs = ColumnFamilyStore.getIfExists(baseMetadata.id); if(cfs != null) { cfs.metric.topLocalReadQueryTime.addSample(cql, time); } } } finally { if (indexController != null) { try { indexController.close(); } finally { writeContext.close(); } } } }

Target:
public void close() { try { if (baseOp != null) baseOp.close(); if (startTimeNanos != -1) { String cql = command.toCQLString(); int timeMicros = (int) Math.min(TimeUnit.NANOSECONDS.toMicros(clock.nanoTime() - startTimeNanos), Integer.MAX_VALUE); ColumnFamilyStore cfs = ColumnFamilyStore.getIfExists(baseMetadata.id); if(cfs != null) cfs.metric.topLocalReadQueryTime.addSample(cql, timeMicros); } } finally { if (indexController != null) { try { indexController.close(); } finally { writeContext.close(); } } } }
Source:
private void assertContainersHaveAccessRules(IJavaProject javaProject) throws JavaModelException { List<IClasspathEntry> containerEntries = Arrays.asList(javaProject.getRawClasspath()).stream() .filter(mavenClasspathEntry()).collect(Collectors.toList()); assertEquals(1, containerEntries.size()); containerEntries.forEach(entry -> { assertNotNull(entry.getAccessRules()); List<IAccessRule> accessRules = Arrays.asList(entry.getAccessRules()); assertEquals(1, accessRules.size()); accessRules.forEach(accessRule -> { assertEquals(IAccessRule.K_DISCOURAGED, accessRule.getKind()); assertEquals("**/internal/**", accessRule.getPattern().toPortableString()); }); }); }

Target:
private void assertContainersHaveAccessRules(IJavaProject javaProject) throws JavaModelException { List<IClasspathEntry> containerEntries = Stream.of(javaProject.getRawClasspath()) .filter(mavenClasspathEntry()).collect(Collectors.toList()); assertEquals(1, containerEntries.size()); containerEntries.forEach(entry -> { assertNotNull(entry.getAccessRules()); List<IAccessRule> accessRules = Arrays.asList(entry.getAccessRules()); assertEquals(1, accessRules.size()); accessRules.forEach(accessRule -> { assertEquals(IAccessRule.K_DISCOURAGED, accessRule.getKind()); assertEquals("**/internal/**", accessRule.getPattern().toPortableString()); }); }); }
Source:
public void setUp() { typeManager = new TypeRegistry(); functionManager = new FunctionManager(typeManager, new BlockEncodingManager(typeManager), new FeaturesConfig()); optimizer = new ExpressionOptimizer(functionManager, TEST_SESSION); }

Target:
public void setUp() { TypeManager typeManager = new TypeRegistry(); functionManager = new FunctionManager(typeManager, new BlockEncodingManager(typeManager), new FeaturesConfig()); optimizer = new ExpressionOptimizer(functionManager, TEST_SESSION); }
Source:
public void testNewStorageTypes() { assertEquals(9, StorageType.values().length, "A storage type was added/removed. Update this test, and the isFileDomain/isBlockDomain " + "method accordingly"); }

Target:
public void testNewStorageTypes() { assertEquals(10, StorageType.values().length, "A storage type was added/removed. Update this test, and the isFileDomain/isBlockDomain " + "method accordingly"); }
Source:
public void initAccessSettings() { if (dvObject instanceof Dataverse) { authenticatedUsersContributorRoleAlias = ""; List<RoleAssignment> aUsersRoleAssignments = roleService.directRoleAssignments(AuthenticatedUsers.get(), dvObject); for (RoleAssignment roleAssignment : aUsersRoleAssignments) { String roleAlias = roleAssignment.getRole().getAlias(); authenticatedUsersContributorRoleAlias = roleAlias; break; } defaultContributorRoleAlias = ((Dataverse) dvObject).getDefaultContributorRole() == null ? "none" : ((Dataverse) dvObject).getDefaultContributorRole().getAlias(); } }

Target:
public void initAccessSettings() { if (dvObject instanceof Dataverse) { authenticatedUsersContributorRoleAlias = ""; List<RoleAssignment> aUsersRoleAssignments = roleService.directRoleAssignments(AuthenticatedUsers.get(), dvObject); for (RoleAssignment roleAssignment : aUsersRoleAssignments) { String roleAlias = roleAssignment.getRole().getAlias(); authenticatedUsersContributorRoleAlias = roleAlias; break; } defaultContributorRoleAlias = ((Dataverse) dvObject).getDefaultContributorRole() == null ? DataverseRole.NONE : ((Dataverse) dvObject).getDefaultContributorRole().getAlias(); } }
Source:
public MeasureDefinition withObjUriQualifiers(final ObjQualifierConverter objQualifierConverter) { notNull(objQualifierConverter, "'objQualifierConverter' must not be null!"); return new OverPeriodMeasureDefinition(measureIdentifier, copyAttributesWithUriQualifiers(objQualifierConverter)); }

Target:
public MeasureDefinition withObjUriQualifiers(final ObjQualifierConverter objQualifierConverter) { notNull(objQualifierConverter, "objQualifierConverter"); return new OverPeriodMeasureDefinition(measureIdentifier, copyAttributesWithUriQualifiers(objQualifierConverter)); }
Source:
public ClientResponse invoke(ClientInvocation invocation) { Future<ClientResponse> future = submit(invocation, true, NOP, null); try { return future.get(client.getIdleTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { future.cancel(true); throw clientException(e, null); } catch (ExecutionException | TimeoutException e) { throw clientException(e.getCause(), null); } }

Target:
public ClientResponse invoke(ClientInvocation invocation) { Future<ClientResponse> future = submit(invocation, true, NOP, null); try { return future.get(1, TimeUnit.HOURS); } catch (InterruptedException e) { future.cancel(true); Thread.currentThread().interrupt(); throw clientException(e, null); } catch (TimeoutException | ExecutionException e) { future.cancel(true); throw clientException(e.getCause(), null); } }
Source:
public MutableRoaringBitmap getDocIds(String searchQuery) { MutableRoaringBitmap docIds = new MutableRoaringBitmap(); Collector docIDCollector = new LuceneDocIdCollector(docIds, _docIdTranslator); try { QueryParser parser = new QueryParser(_column, _standardAnalyzer); Query query = parser.parse(searchQuery); _indexSearcher.search(query, docIDCollector); return docIds; } catch (Exception e) { String msg = "Caught excepttion while searching the text index for column:" + _column + " search query:" + searchQuery; throw new RuntimeException(msg, e); } }

Target:
public MutableRoaringBitmap getDocIds(String searchQuery) { MutableRoaringBitmap docIds = new MutableRoaringBitmap(); Collector docIDCollector = new LuceneDocIdCollector(docIds, _docIdTranslator); try { QueryParser parser = new QueryParser(_column, _standardAnalyzer); if (_useANDForMultiTermQueries) { parser.setDefaultOperator(QueryParser.Operator.AND); } Query query = parser.parse(searchQuery); _indexSearcher.search(query, docIDCollector); return docIds; } catch (Exception e) { String msg = "Caught excepttion while searching the text index for column:" + _column + " search query:" + searchQuery; throw new RuntimeException(msg, e); } }
Source:
public static void register(CommandRegistrationHandler registration, CommandManager commandManager, CommandManagerService commandManagerService, WorldEdit worldEdit) { CommandManager collect = commandManagerService.newCommandManager(); registration.register( collect, ToolCommandsRegistration.builder(), new ToolCommands(worldEdit) ); Set<org.enginehub.piston.Command> commands = collect.getAllCommands() .collect(Collectors.toSet()); for (org.enginehub.piston.Command command : commands) { if (command.getAliases().contains("unbind")) { command = command.toBuilder().aliases( Collections2.filter(command.getAliases(), alias -> !"unbind".equals(alias)) ).build(); } if (command.getAliases().contains("stacker")) { command = command.toBuilder().aliases( Collections2.filter(command.getAliases(), alias -> !"stacker".equals(alias)) ).build(); } commandManager.register(CommandUtil.deprecate( command, "Global tool names cause conflicts " + "and will be removed in WorldEdit 8", ToolCommands::asNonGlobal )); } Set<org.enginehub.piston.Command> nonGlobalCommands = commands.stream() .map(command -> command.toBuilder().aliases( Collections2.filter(command.getAliases(), alias -> !alias.startsWith("/")) ).build() ) .collect(Collectors.toSet()); commandManager.register("tool", command -> { command.addPart(SubCommandPart.builder( TranslatableComponent.of("tool"), TextComponent.of("The tool to bind") ) .withCommands(nonGlobalCommands) .required() .build()); command.description(TextComponent.of("Binds a tool to the item in your hand")); }); }

Target:
public static void register(CommandRegistrationHandler registration, CommandManager commandManager, CommandManagerService commandManagerService, WorldEdit worldEdit) { CommandManager collect = commandManagerService.newCommandManager(); registration.register( collect, ToolCommandsRegistration.builder(), new ToolCommands(worldEdit) ); Set<org.enginehub.piston.Command> commands = collect.getAllCommands() .collect(Collectors.toSet()); for (org.enginehub.piston.Command command : commands) { for (String ignoredAlias : IGNORED_GLOBAL_ALIASES) { if (command.getAliases().contains(ignoredAlias)) { command = command.toBuilder().aliases( Collections2.filter(command.getAliases(), alias -> !ignoredAlias.equals(alias)) ).build(); } } commandManager.register(CommandUtil.deprecate( command, "Global tool names cause conflicts " + "and will be removed in WorldEdit 8", ToolCommands::asNonGlobal )); } Set<org.enginehub.piston.Command> nonGlobalCommands = commands.stream() .map(command -> command.toBuilder().aliases( Collections2.filter(command.getAliases(), alias -> !alias.startsWith("/")) ).build() ) .collect(Collectors.toSet()); commandManager.register("tool", command -> { command.addPart(SubCommandPart.builder( TranslatableComponent.of("tool"), TextComponent.of("The tool to bind") ) .withCommands(nonGlobalCommands) .required() .build()); command.description(TextComponent.of("Binds a tool to the item in your hand")); }); }
Source:
protected boolean interceptorMatches(SequentialInterceptor interceptor, Class<? extends SequentialInterceptor> clazz) { Class<? extends SequentialInterceptor> interceptorType = interceptor.getClass(); return clazz == interceptorType || clazz == interceptorType; }

Target:
protected boolean interceptorMatches(SequentialInterceptor interceptor, Class<? extends SequentialInterceptor> clazz) { Class<? extends SequentialInterceptor> interceptorType = interceptor.getClass(); return clazz == interceptorType; }
Source:
public List<BatchResult> doFlushStatements(boolean isRollback) throws SQLException { try { List<BatchResult> results = new ArrayList<BatchResult>(); if (isRollback) { return Collections.emptyList(); } for (int i = 0, n = statementList.size(); i < n; i++) { Statement stmt = statementList.get(i); applyTransactionTimeout(stmt); BatchResult batchResult = batchResultList.get(i); try { batchResult.setUpdateCounts(stmt.executeBatch()); MappedStatement ms = batchResult.getMappedStatement(); List<Object> parameterObjects = batchResult.getParameterObjects(); KeyGenerator keyGenerator = ms.getKeyGenerator(); if (Jdbc3KeyGenerator.class.equals(keyGenerator.getClass())) { Jdbc3KeyGenerator jdbc3KeyGenerator = (Jdbc3KeyGenerator) keyGenerator; jdbc3KeyGenerator.processBatch(ms, stmt, parameterObjects); } else if (!NoKeyGenerator.class.equals(keyGenerator.getClass())) { for (Object parameter : parameterObjects) { keyGenerator.processAfter(this, ms, stmt, parameter); } } closeStatement(stmt); } catch (BatchUpdateException e) { StringBuilder message = new StringBuilder(); message.append(batchResult.getMappedStatement().getId()) .append(" (batch index #") .append(i + 1) .append(")") .append(" failed."); if (i > 0) { message.append(" ") .append(i) .append(" prior sub executor(s) completed successfully, but will be rolled back."); } throw new BatchExecutorException(message.toString(), e, results, batchResult); } results.add(batchResult); } return results; } finally { currentSql = null; statementList.clear(); batchResultList.clear(); } }

Target:
public List<BatchResult> doFlushStatements(boolean isRollback) throws SQLException { try { List<BatchResult> results = new ArrayList<BatchResult>(); if (isRollback) { return Collections.emptyList(); } for (int i = 0, n = statementList.size(); i < n; i++) { Statement stmt = statementList.get(i); applyTransactionTimeout(stmt); BatchResult batchResult = batchResultList.get(i); try { batchResult.setUpdateCounts(stmt.executeBatch()); MappedStatement ms = batchResult.getMappedStatement(); List<Object> parameterObjects = batchResult.getParameterObjects(); KeyGenerator keyGenerator = ms.getKeyGenerator(); if (Jdbc3KeyGenerator.class.equals(keyGenerator.getClass())) { Jdbc3KeyGenerator jdbc3KeyGenerator = (Jdbc3KeyGenerator) keyGenerator; jdbc3KeyGenerator.processBatch(ms, stmt, parameterObjects); } else if (!NoKeyGenerator.class.equals(keyGenerator.getClass())) { for (Object parameter : parameterObjects) { keyGenerator.processAfter(this, ms, stmt, parameter); } } closeStatement(stmt); } catch (BatchUpdateException e) { StringBuilder message = new StringBuilder(); message.append(batchResult.getMappedStatement().getId()) .append(" (batch index #") .append(i + 1) .append(")") .append(" failed."); if (i > 0) { message.append(" ") .append(i) .append(" prior sub executor(s) completed successfully, but will be rolled back."); } throw new BatchExecutorException(message.toString(), e, results, batchResult); } results.add(batchResult); } return results; } finally { for (Statement stmt : statementList) { closeStatement(stmt); } currentSql = null; statementList.clear(); batchResultList.clear(); } }
Source:
protected void onInit() { super.onInit(); if (this.connectionFactory == null) { this.connectionFactory = new TcpNioServerConnectionFactory(super.getPort()); this.connectionFactory.setDeserializer(new ByteArrayLfSerializer()); this.connectionFactory.setBeanFactory(getBeanFactory()); if (this.applicationEventPublisher != null) { this.connectionFactory.setApplicationEventPublisher(this.applicationEventPublisher); } this.connectionFactory.afterPropertiesSet(); } this.connectionFactory.registerListener(this); }

Target:
protected void onInit() { super.onInit(); if (this.connectionFactory == null) { this.connectionFactory = new TcpNioServerConnectionFactory(getPort()); this.connectionFactory.setDeserializer(new ByteArrayLfSerializer()); this.connectionFactory.setBeanFactory(getBeanFactory()); if (this.applicationEventPublisher != null) { this.connectionFactory.setApplicationEventPublisher(this.applicationEventPublisher); } this.connectionFactory.afterPropertiesSet(); } this.connectionFactory.registerListener(this); }
Source:
private void releaseSharedSlot(ExecutionSlotSharingGroup executionSlotSharingGroup) { SharedSlot slot = sharedSlots.remove(executionSlotSharingGroup); if (slot != null) { slotProvider.cancelSlotRequest( slot.getPhysicalSlotRequestId(), new FlinkException("Slot is being returned from SlotSharingExecutionSlotAllocator.")); } else { LOG.debug("There is no slot for ExecutionSlotSharingGroup to release", executionSlotSharingGroup); } }

Target:
private void releaseSharedSlot(ExecutionSlotSharingGroup executionSlotSharingGroup) { SharedSlot slot = sharedSlots.remove(executionSlotSharingGroup); Preconditions.checkNotNull(slot); Preconditions.checkState( slot.isEmpty(), "Trying to remove a shared slot with physical request id %s which has assigned logical slots", slot.getPhysicalSlotRequestId()); slotProvider.cancelSlotRequest( slot.getPhysicalSlotRequestId(), new FlinkException("Slot is being returned from SlotSharingExecutionSlotAllocator.")); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AggregateReadRequest<?> that = (AggregateReadRequest<?>) o; return snapshotTrigger == that.snapshotTrigger && id.equals(that.id); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AggregateReadRequest<?> that = (AggregateReadRequest<?>) o; return recordId.equals(that.recordId); }
Source:
public String getCompleted(UUID uuid, String[] args) { String regex = String.join("_", Arrays.copyOfRange(args, 2, args.length)); String category = args[0]; long[] count = { 0 }; achievementCache.getByCategory(category).stream().filter(i -> i.getName().matches(regex)).forEach(achievement -> { count[0] += cacheManager.getReceivedAchievementsCache().getOrDefault(uuid, new HashSet<>()).stream() .filter(i -> { return i.equalsIgnoreCase(achievement.getName()); }).count(); }); return "" + count[0]; }

Target:
private String getCompleted(UUID uuid, String[] args) { String regex = String.join("_", Arrays.copyOfRange(args, 1, args.length)); String category = args[0]; return "" + achievementCache.getByCategory(category).stream() .filter(achievement -> achievement.getName().matches(regex) && cacheManager.getReceivedAchievementsCache().getOrDefault(uuid, new HashSet<>()) .contains(achievement.getName())) .count(); }
Source:
public ServiceModel generateService(ApiService service, ApiServiceConfig serviceConfig, ApiRole role, ApiConfigList roleConfig) { String hostname = role.getHostRef().getHostname(); String sslEnabledRaw = getRoleConfigValue(roleConfig, SSL_ENABLED); String scheme = "http"; if (sslEnabledRaw != null) { if (Boolean.parseBoolean(getRoleConfigValue(roleConfig, SSL_ENABLED))) { scheme = "https"; } } String port = getRoleConfigValue(roleConfig, QUERY_SERVER_PORT); ServiceModel model = createServiceModel(String.format(Locale.getDefault(), "%s://%s:%s", scheme, hostname, port)); model.addRoleProperty(getRoleType(), QUERY_SERVER_PORT, port); if (sslEnabledRaw != null) { model.addRoleProperty(getRoleType(), SSL_ENABLED, sslEnabledRaw); } return model; }

Target:
public ServiceModel generateService(ApiService service, ApiServiceConfig serviceConfig, ApiRole role, ApiConfigList roleConfig) { String hostname = role.getHostRef().getHostname(); String sslEnabledRaw = getRoleConfigValue(roleConfig, SSL_ENABLED); String scheme = "http"; if (Boolean.parseBoolean(sslEnabledRaw)) { scheme = "https"; } String port = getRoleConfigValue(roleConfig, QUERY_SERVER_PORT); ServiceModel model = createServiceModel(String.format(Locale.getDefault(), "%s://%s:%s", scheme, hostname, port)); model.addRoleProperty(getRoleType(), QUERY_SERVER_PORT, port); if (sslEnabledRaw != null) { model.addRoleProperty(getRoleType(), SSL_ENABLED, sslEnabledRaw); } return model; }
Source:
private void setWikidataEditCount() { String userName = sessionManager.getUserName(); if (StringUtils.isBlank(userName)) { return; } wikidataEditsText.setText(String.valueOf(0)); compositeDisposable.add(okHttpJsonApiClient .getWikidataEdits(userName) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(edits -> { numberOfEdits = edits; wikidataEditsText.setText(String.valueOf(edits)); }, e -> { Timber.e("Error:" + e); })); }

Target:
private void setWikidataEditCount() { String userName = sessionManager.getUserName(); if (StringUtils.isBlank(userName)) { return; } compositeDisposable.add(okHttpJsonApiClient .getWikidataEdits(userName) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(edits -> { numberOfEdits = edits; wikidataEditsText.setText(String.valueOf(edits)); }, e -> { Timber.e("Error: " + e); })); }
Source:
public void addOutputData(long checkpointId, ResultSubpartitionInfo info, int startSeqNum, Buffer... data) { LOG.debug("{} add output data, checkpoint id: {}, channel: {}, startSeqNum: {}, num buffers: {}", taskName, checkpointId, info, startSeqNum, data == null ? 0 : data.length); enqueue(write(checkpointId, info, checkBufferType(data)), false); }

Target:
public void addOutputData(long checkpointId, ResultSubpartitionInfo info, int startSeqNum, Buffer... data) { LOG.debug( "{} adding output data, checkpoint id: {}, channel: {}, startSeqNum: {}, num buffers: {}", taskName, checkpointId, info, startSeqNum, data == null ? 0 : data.length); enqueue(write(checkpointId, info, checkBufferType(data)), false); }
Source:
public int compare(Task a, Task b) { return new CompareToBuilder() .append(b.getPriority(), a.getPriority()) .append(a.getId(), b.getId()) .toComparison(); }

Target:
public int compare(Task a, Task b) { return COMPARATOR.compare(a, b); }