auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private GcsStorageService googleCloudStorageService(String dataFilename, GcsProperties gcsProperties) { String applicationVersion = Optional.ofNullable(getClass().getPackage().getImplementationVersion()).orElse("Unknown"); GcsStorageService service; if (dataFilename == null || dataFilename.isEmpty()) { service = new GcsStorageService(gcsProperties.getBucket(), gcsProperties.getBucketLocation(), gcsProperties.getRootFolder(), gcsProperties.getProject(), gcsProperties.getJsonPath(), applicationVersion, maxWaitInterval, retryIntervalBase, jitterMultiplier, maxRetries, taskScheduler, registry); } else { service = new GcsStorageService(gcsProperties.getBucket(), gcsProperties.getBucketLocation(), gcsProperties.getRootFolder(), gcsProperties.getProject(), gcsProperties.getJsonPath(), applicationVersion, dataFilename, maxWaitInterval, retryIntervalBase, jitterMultiplier, maxRetries, taskScheduler, registry); } service.ensureBucketExists(); log.info("Using Google Cloud Storage bucket={} in project={}", value("bucket", gcsProperties.getBucket()), value("project", gcsProperties.getProject())); log.info("Bucket versioning is {}.", value("versioning", service.supportsVersioning() ? "enabled" : "DISABLED")); taskScheduler.scheduleAtFixedRate( new Runnable() { public void run() { service.purgeBatchedVersionPaths(); } }, 300 * 1000); return service; }

Target:
private GcsStorageService googleCloudStorageService(String dataFilename, GcsProperties gcsProperties) { String applicationVersion = Optional.ofNullable(getClass().getPackage().getImplementationVersion()).orElse("Unknown"); GcsStorageService service; if (dataFilename == null || dataFilename.isEmpty()) { service = new GcsStorageService(gcsProperties.getBucket(), gcsProperties.getBucketLocation(), gcsProperties.getRootFolder(), gcsProperties.getProject(), gcsProperties.getJsonPath(), applicationVersion, maxWaitInterval, retryIntervalBase, jitterMultiplier, maxRetries, taskScheduler, registry); } else { service = new GcsStorageService(gcsProperties.getBucket(), gcsProperties.getBucketLocation(), gcsProperties.getRootFolder(), gcsProperties.getProject(), gcsProperties.getJsonPath(), applicationVersion, dataFilename, maxWaitInterval, retryIntervalBase, jitterMultiplier, maxRetries, taskScheduler, registry); } service.ensureBucketExists(); log.info("Using Google Cloud Storage bucket={} in project={}", value("bucket", gcsProperties.getBucket()), value("project", gcsProperties.getProject())); log.info("Bucket versioning is {}.", value("versioning", service.supportsVersioning() ? "enabled" : "DISABLED")); long period_ms = 300 * 1000; taskScheduler.scheduleAtFixedRate( new Runnable() { public void run() { service.purgeBatchedVersionPaths(); } }, period_ms); return service; }
Source:
public BufferedEventSender(int maxCap) { this.queue = new ArrayBlockingQueue<>(maxCap, true); }

Target:
BufferedEventSender(int maxCap) { this.queue = new ArrayBlockingQueue<>(maxCap); }
Source:
private boolean isKeyStoreAvailable(final Path keyStoreFilePath, String storeType, char[] password) throws KeyStoreException, IOException { if (keyStoreFilePath.toFile().exists()) { try (InputStream input = Files.newInputStream(keyStoreFilePath)) { final KeyStore keyStore = KeyStore.getInstance(storeType); keyStore.load(input, password); return true; } catch (NoSuchAlgorithmException | CertificateException e) { LOG.failedToLoadKeystore(keyStoreFilePath.toString(), storeType, e); } catch (IOException | KeyStoreException e) { LOG.failedToLoadKeystore(keyStoreFilePath.toString(), storeType, e); throw e; } } return false; }

Target:
private boolean isKeyStoreAvailable(final Path keyStoreFilePath, String storeType, char[] password) throws KeyStoreException, IOException { if (Files.exists(keyStoreFilePath)) { try (InputStream input = Files.newInputStream(keyStoreFilePath)) { final KeyStore keyStore = KeyStore.getInstance(storeType); keyStore.load(input, password); return true; } catch (NoSuchAlgorithmException | CertificateException e) { LOG.failedToLoadKeystore(keyStoreFilePath.toString(), storeType, e); } catch (IOException | KeyStoreException e) { LOG.failedToLoadKeystore(keyStoreFilePath.toString(), storeType, e); throw e; } } return false; }
Source:
public boolean configure(StaplerRequest request, JSONObject object) throws FormException { save(); return super.configure(request, object); }

Target:
public boolean configure(StaplerRequest request, JSONObject object) throws FormException { LOGGER.info(object.toString()); nativeLibraryPath = object.getString("nativeLibraryPath"); master = object.getString("master"); description = object.getString("description"); frameworkName = object.getString("frameworkName"); slaveAttributes = object.getString("slaveAttributes"); checkpoint = object.getBoolean("checkpoint"); slaveInfos = new ArrayList<MesosSlaveInfo>(); JSONArray labels = object.getJSONArray("slaveInfos"); if (labels != null) { for (int i = 0; i < labels.size(); i++) { JSONObject label = labels.getJSONObject(i); if (label != null) { MesosSlaveInfo.ExternalContainerInfo externalContainerInfo = null; if (label.has("externalContainerInfo")) { JSONObject externalContainerInfoJson = label .getJSONObject("externalContainerInfo"); externalContainerInfo = new MesosSlaveInfo.ExternalContainerInfo( externalContainerInfoJson.getString("image"), externalContainerInfoJson.getString("options")); } MesosSlaveInfo.ContainerInfo containerInfo = null; if (label.has("containerInfo")) { JSONObject containerInfoJson = label .getJSONObject("containerInfo"); List<MesosSlaveInfo.Volume> volumes = new ArrayList<MesosSlaveInfo.Volume>(); if (containerInfoJson.has("volumes")) { JSONArray volumesJson = containerInfoJson .getJSONArray("volumes"); for (Object obj : volumesJson) { JSONObject volumeJson = (JSONObject) obj; volumes .add(new MesosSlaveInfo.Volume(volumeJson .getString("containerPath"), volumeJson .getString("hostPath"), volumeJson .getBoolean("readOnly"))); } } containerInfo = new MesosSlaveInfo.ContainerInfo( containerInfoJson.getString("type"), containerInfoJson.getString("dockerImage"), volumes); } MesosSlaveInfo slaveInfo = new MesosSlaveInfo( object.getString("labelString"), object.getString("slaveCpus"), object.getString("slaveMem"), object.getString("maxExecutors"), object.getString("executorCpus"), object.getString("executorMem"), object.getString("remoteFSRoot"), object.getString("idleTerminationMinutes"), object.getString("slaveAttributes"), object.getString("jvmArgs"), externalContainerInfo, containerInfo); slaveInfos.add(slaveInfo); } } } save(); return super.configure(request, object); }
Source:
public boolean remove(NormalizedResourcesWithMemory other) { boolean negativeResources = normalizedResources.remove(other.getNormalizedResources(), null); totalMemoryMb -= other.getTotalMemoryMb(); if (totalMemoryMb < 0.0) { negativeResources = true; totalMemoryMb = 0.0; } return negativeResources; }

Target:
public boolean remove(NormalizedResourcesWithMemory other) { return remove(other, null); }
Source:
public void testPrefixSuffix() { Bytes b1 = Bytes.of("abcde"); Bytes prefix = Bytes.of("ab"); Bytes suffix = Bytes.of("de"); Bytes mid = Bytes.of("cd"); Assert.assertEquals(true, b1.startsWith(prefix)); Assert.assertEquals(true, b1.endsWith(suffix)); Assert.assertEquals(false, b1.startsWith(mid)); Assert.assertEquals(false, b1.endsWith(mid)); }

Target:
public void testPrefixSuffix() { Bytes b1 = Bytes.of("abcde"); Bytes prefix = Bytes.of("ab"); Bytes suffix = Bytes.of("de"); Bytes empty = new Bytes(); Bytes mid = Bytes.of("cd"); Assert.assertTrue(b1.startsWith(prefix)); Assert.assertTrue(b1.endsWith(suffix)); Assert.assertFalse(b1.startsWith(mid)); Assert.assertFalse(b1.endsWith(mid)); Assert.assertTrue(empty.startsWith(empty)); Assert.assertTrue(empty.endsWith(empty)); Assert.assertTrue(b1.startsWith(b1)); Assert.assertTrue(b1.endsWith(b1)); Assert.assertTrue(b1.startsWith(empty)); Assert.assertTrue(b1.endsWith(empty)); Assert.assertFalse(empty.startsWith(b1)); Assert.assertFalse(empty.endsWith(b1)); Assert.assertFalse(prefix.startsWith(b1)); Assert.assertFalse(prefix.endsWith(b1)); Assert.assertTrue(b1.startsWith(b1.subSequence(0, 2))); Assert.assertFalse(b1.subSequence(0, 2).startsWith(b1)); Assert.assertTrue(b1.endsWith(b1.subSequence(3, 5))); Assert.assertFalse(b1.endsWith(b1.subSequence(0, 2))); Assert.assertFalse(b1.subSequence(0, 2).endsWith(b1)); }
Source:
private Guid addNewVmDevice(Guid vmId, XmlRpcStruct device) { Guid newDeviceId = Guid.Empty; String typeName = (String) device.getItem("type"); String deviceName = (String) device.getItem("device"); if (!StringUtils.isEmpty(typeName) && !StringUtils.isEmpty(deviceName)) { String address = ((Map<String, String>) device.getItem("address")).toString(); String specParams = ""; Object o = device.getItem("specParams"); newDeviceId = Guid.NewGuid(); if (o != null) { specParams = ((Map<String, String>) o).toString(); } VmDeviceId id = new VmDeviceId(newDeviceId, vmId); VmDevice newDevice = new VmDevice(id, typeName, deviceName, address, 0, specParams, false, true, false); DbFacade.getInstance().getVmDeviceDAO().save(newDevice); log.debugFormat("New device was added to VM Devices : {0}", newDevice.toString()); } else { log.error("Empty or NULL values were passed for a VM device, Device is skipped"); } return newDeviceId; }

Target:
private Guid addNewVmDevice(Guid vmId, XmlRpcStruct device) { Guid newDeviceId = Guid.Empty; String typeName = (String) device.getItem(VdsProperties.Type); String deviceName = (String) device.getItem(VdsProperties.Device); if (!StringUtils.isEmpty(typeName) && !StringUtils.isEmpty(deviceName)) { String address = ((Map<String, String>) device.getItem(VdsProperties.Address)).toString(); String specParams = ""; Object o = device.getItem(VdsProperties.SpecParams); newDeviceId = Guid.NewGuid(); if (o != null) { specParams = ((Map<String, String>) o).toString(); } VmDeviceId id = new VmDeviceId(newDeviceId, vmId); VmDevice newDevice = new VmDevice(id, typeName, deviceName, address, 0, specParams, false, true, false); DbFacade.getInstance().getVmDeviceDAO().save(newDevice); log.debugFormat("New device was added to VM {0} Devices : {1}", vmId, newDevice.toString()); } else { log.errorFormat("Empty or NULL values were passed for a VM {0} device, Device is skipped", vmId); } return newDeviceId; }
Source:
protected abstract void internalStart(Map<String, String> startOptions) throws InfrastructureException; public final void stop(Map<String, String> stopOptions) throws InfrastructureException { if (this.status != WorkspaceStatus.RUNNING && this.status != WorkspaceStatus.STARTING) { throw new StateException("The environment must be running"); } status = WorkspaceStatus.STOPPING; try { internalStop(stopOptions); } finally { status = WorkspaceStatus.STOPPED; } }

Target:
protected abstract void internalStart(Map<String, String> startOptions) throws InfrastructureException; public final void stop(Map<String, String> stopOptions) throws InfrastructureException { if (status != WorkspaceStatus.RUNNING && status != WorkspaceStatus.STARTING) { throw new StateException("The environment must be running or starting"); } status = WorkspaceStatus.STOPPING; try { internalStop(stopOptions); } catch (InternalInfrastructureException e) { LOG.error("Error occurs on stop of workspace {}. Error: {}", context.getIdentity().getWorkspaceId(), e.getMessage()); } catch (InfrastructureException e) { LOG.debug(e.getMessage(), e); } status = WorkspaceStatus.STOPPED; }
Source:
public static String trimFieldName(String fieldName) { IPreferencesService preferences = Platform.getPreferencesService(); String prefix = preferences.getString(CUIPlugin.PLUGIN_ID, PreferenceConstants.NAME_STYLE_FIELD_PREFIX, "", null); if (fieldName.startsWith(prefix)) fieldName = fieldName.substring(prefix.length()); int firstWordStart = -1; int lastWordEnd = -1; for (int i = 0; i < fieldName.length(); ++i) { if (Character.isLetterOrDigit(fieldName.charAt(i))) { int pos = i + 1; while (--pos >= i && !Character.isLetterOrDigit(fieldName.charAt(pos))) { } lastWordEnd = pos + 1; if (firstWordStart < 0) { firstWordStart = i; } } } if (firstWordStart < 0) { return fieldName; } else { return fieldName.substring(firstWordStart, lastWordEnd); } }

Target:
public static String trimFieldName(String fieldName) { IPreferencesService preferences = Platform.getPreferencesService(); String prefix = preferences.getString(CUIPlugin.PLUGIN_ID, PreferenceConstants.NAME_STYLE_FIELD_PREFIX, "", null); if (fieldName.startsWith(prefix)) fieldName = fieldName.substring(prefix.length()); int firstWordStart = -1; int lastWordEnd = -1; for (int i = 0; i < fieldName.length(); ++i) { if (Character.isLetterOrDigit(fieldName.charAt(i))) { lastWordEnd = i + 1; if (firstWordStart < 0) { firstWordStart = i; } } } if (firstWordStart < 0) { return fieldName; } else { return fieldName.substring(firstWordStart, lastWordEnd); } }
Source:
public void testTombstonesWithLowerVersionThanTheRecordedVersionGetsGCed() throws Exception { VM vm0 = VM.getVM(0); VM vm1 = VM.getVM(1); Properties props = DistributedRule.getDistributedSystemProperties(); props.put("conserve-sockets", "false"); vm0.invoke(() -> { createCacheAndRegion(RegionShortcut.REPLICATE_PERSISTENT, props); region.put("K1", "V1"); region.put("K2", "V2"); }); vm1.invoke(() -> { createCacheAndRegion(RegionShortcut.REPLICATE, props); DistributionMessageObserver.setInstance(new RegionObserver()); }); AsyncInvocation<Object> vm0Async1 = vm0.invokeAsync(() -> { region.destroy("K1"); }); AsyncInvocation<Object> vm0Async2 = vm0.invokeAsync(() -> { region.destroy("K2"); }); AsyncInvocation<Object> vm0Async3 = vm0.invokeAsync(() -> { waitForTombstoneCount(2); performGC(2); }); vm1.invoke(() -> await() .until(() -> ((InternalCache) cache).getCachePerfStats().getTombstoneGCCount() == 1)); vm0Async1.await(); vm0Async2.await(); vm0Async3.await(); vm1.invoke(() -> { performGC(((LocalRegion) region).getTombstoneCount()); assertEquals(0, ((LocalRegion) region).getTombstoneCount()); }); }

Target:
public void testTombstonesWithLowerVersionThanTheRecordedVersionGetsGCed() throws Exception { VM vm0 = VM.getVM(0); VM vm1 = VM.getVM(1); Properties props = DistributedRule.getDistributedSystemProperties(); props.setProperty("conserve-sockets", "false"); vm0.invoke(() -> { createCacheAndRegion(RegionShortcut.REPLICATE_PERSISTENT, props); region.put("K1", "V1"); region.put("K2", "V2"); }); vm1.invoke(() -> { createCacheAndRegion(RegionShortcut.REPLICATE, props); DistributionMessageObserver.setInstance(new RegionObserver()); }); AsyncInvocation<Object> vm0Async1 = vm0.invokeAsync(() -> { region.destroy("K1"); }); AsyncInvocation<Object> vm0Async2 = vm0.invokeAsync(() -> { region.destroy("K2"); }); AsyncInvocation<Object> vm0Async3 = vm0.invokeAsync(() -> { waitForTombstoneCount(2); performGC(2); }); vm1.invoke(() -> await() .until(() -> ((InternalCache) cache).getCachePerfStats().getTombstoneGCCount() == 1)); vm0Async1.await(); vm0Async2.await(); vm0Async3.await(); vm1.invoke(() -> { performGC(((LocalRegion) region).getTombstoneCount()); assertEquals(0, ((LocalRegion) region).getTombstoneCount()); }); }
Source:
public Modifier(ShapeRenderer shapeRenderer) { this.shapeRenderer = shapeRenderer; handles = new Handle[9]; for (int i = 0; i < 9; i++) { if (i == ORIGIN_HANDLE_INDEX) { handles[i] = new OriginHandle(shapeRenderer, HANDLE_SIZE / 2.0f, Color.CYAN); } else { handles[i] = new Handle(shapeRenderer, HANDLE_SIZE, Color.GREEN); } addActor(handles[i]); } handles[0].setAlignedX(handles[2]); handles[0].setAlignedY(handles[6]); handles[2].setAlignedX(handles[0]); handles[6].setAlignedY(handles[0]); handles[8].setAlignedX(handles[2]); handles[8].setAlignedY(handles[6]); handles[8].setRotationOffset(90); handles[1].setAlignedX(handles[0], handles[2]); handles[3].setAlignedY(handles[0], handles[6]); handles[7].setAlignedX(handles[6]); handles[5].setAlignedY(handles[2]); rotationHandle = new RotationHandle(shapeRenderer, HANDLE_SIZE / 2.0f, Color.RED); addActor(rotationHandle); }

Target:
public Modifier(ShapeRenderer shapeRenderer) { this.shapeRenderer = shapeRenderer; handles = new Handle[9]; for (int i = 0; i < 9; i++) { if (i == ORIGIN_HANDLE_INDEX) { handles[i] = new OriginHandle(shapeRenderer, HANDLE_SIZE / 2.0f, Color.CYAN); } else { handles[i] = new Handle(shapeRenderer, HANDLE_SIZE, Color.GREEN); } addActor(handles[i]); } handles[0].setAlignedX(handles[2]); handles[0].setAlignedY(handles[6]); handles[2].setAlignedX(handles[0]); handles[6].setAlignedY(handles[0]); handles[8].setAlignedX(handles[6]); handles[8].setAlignedY(handles[2]); handles[1].setAlignedX(handles[0], handles[2]); handles[3].setAlignedY(handles[0], handles[6]); handles[7].setAlignedX(handles[6]); handles[5].setAlignedY(handles[2]); rotationHandle = new RotationHandle(shapeRenderer, HANDLE_SIZE / 2.0f, Color.RED); addActor(rotationHandle); }
Source:
private boolean validateSourceStorageDomainsAvailability() { for (DiskImage image : new ArrayList<>(getImages())) { boolean storageDomainAvailable = false; Iterator<Guid> iterator = image.getStorageIds().iterator(); while (iterator.hasNext()) { Guid storageDomainId = iterator.next(); StorageDomain sd = storageDomainDao.getForStoragePool(storageDomainId, getStoragePool().getId()); ValidationResult result = new StorageDomainValidator(sd).isDomainExistAndActive(); if (result.isValid()) { storageDomainAvailable = true; } else { log.warn("Storage domain '{}' does not exist.", storageDomainId); iterator.remove(); } } if (!storageDomainAvailable) { if (getParameters().isAllowPartialImport()) { log.warn("No active storage domain that contains the image {}/{} exists. " + "Ignoring since the force flag in on.", image.getId(), image.getImageId()); getImages().remove(image); failedDisksToImportForAuditLog.putIfAbsent(image.getId(), image.getDiskAlias()); } else { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANNOT_FIND_DISK_IMAGE_IN_ACTIVE_DOMAINS, String.format("$diskImageId %1$s", image.getId()), String.format("$imageId %1$s", image.getImageId())); } } } return true; }

Target:
private boolean validateSourceStorageDomainsAvailability() { for (DiskImage image : new ArrayList<>(getImages())) { boolean storageDomainAvailable = false; Iterator<Guid> iterator = image.getStorageIds().iterator(); while (iterator.hasNext()) { Guid storageDomainId = iterator.next(); StorageDomain sd = storageDomainDao.getForStoragePool(storageDomainId, getStoragePool().getId()); ValidationResult result = new StorageDomainValidator(sd).isDomainExistAndActive(); if (!result.isValid()) { log.warn("Storage domain '{}' does not exist.", storageDomainId); iterator.remove(); } else if (!storageDomainAvailable) { storageDomainAvailable = true; } } if (!storageDomainAvailable) { if (!getParameters().isAllowPartialImport()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANNOT_FIND_DISK_IMAGE_IN_ACTIVE_DOMAINS, String.format("$diskImageId %1$s", image.getId()), String.format("$imageId %1$s", image.getImageId())); } log.warn("No active storage domain that contains the image {}/{} exists. " + "Ignoring since the force flag in on.", image.getId(), image.getImageId()); getImages().remove(image); failedDisksToImportForAuditLog.putIfAbsent(image.getId(), image.getDiskAlias()); } } return true; }
Source:
public Order findMatchingSellOrder(Order o) throws StockMarketExpection { if(o instanceof BuyOrder) { ArrayList<Order> pendingSellOrders = sellOrders.get(o.getStockSymbol()); Collections.sort(pendingSellOrders); if(pendingSellOrders.get(0).getPrice() <= o.getPrice()) { return pendingSellOrders.get(0); } return null; } else { throw new StockMarketExpection("Parameter must be a Buy Order"); } }

Target:
public Order findMatchingSellOrder(Order o) throws StockMarketExpection { if(o instanceof BuyOrder) { ArrayList<Order> pendingSellOrders = sellOrders.get(o.getStockSymbol()); Collections.sort(pendingSellOrders); Order pendingSale = pendingSellOrders.get(0); if(pendingSale.getPrice() <= o.getPrice()) { return pendingSellOrders.get(0); } return null; } else { throw new StockMarketExpection("Parameter must be a Buy Order"); } }
Source:
public void testExecute() throws Exception { AccountAttributes student1 = typicalBundle.accounts.get("student1InCourse1"); loginAsStudent(student1.googleId); ______TS("Typical case: upload profile picture operation successful"); String filePath = "src/test/resources/images/profile_pic.png"; String contentType = URLConnection.guessContentTypeFromName(new File(filePath).getName()); PostStudentProfilePictureAction action = getActionWithParts("studentprofilephoto", contentType, filePath); JsonResult result = getJsonResult(action); assertEquals(HttpStatus.SC_OK, result.getStatusCode()); StudentProfilePictureResults output = (StudentProfilePictureResults) result.getOutput(); assertEquals(output.getMessage(), Const.StatusMessages.STUDENT_PROFILE_PICTURE_SAVED); assertNotNull(output.getPictureKey()); }

Target:
public void testExecute() throws Exception { AccountAttributes student1 = typicalBundle.accounts.get("student1InCourse1"); loginAsStudent(student1.googleId); ______TS("Typical case: upload profile picture operation successful"); String filePath = "src/test/resources/images/profile_pic.png"; PostStudentProfilePictureAction action = getActionWithParts("studentprofilephoto", filePath); JsonResult result = getJsonResult(action); assertEquals(HttpStatus.SC_OK, result.getStatusCode()); StudentProfilePictureResults output = (StudentProfilePictureResults) result.getOutput(); String resultPictureKey = output.getPictureKey(); String newPictureKey = logic.getStudentProfile(student1.googleId).pictureKey; assertNotNull(resultPictureKey); assertNotEquals(resultPictureKey, ""); assertEquals(resultPictureKey, newPictureKey); ______TS("Typical case: profile picture is null"); PostStudentProfilePictureAction nullProfilePicAction = getAction(); assertThrows(InvalidHttpRequestBodyException.class, () -> nullProfilePicAction.execute()); ______TS("Typical case: profile picture is too large"); String largeProfilePicFilePath = "src/test/resources/images/profile_pic_too_large.jpg"; PostStudentProfilePictureAction largeProfilePicAction = getActionWithParts("studentprofilephoto", largeProfilePicFilePath); assertThrows(InvalidHttpRequestBodyException.class, () -> largeProfilePicAction.execute()); ______TS("Typical case: not a profile picture"); String invalidProfilePicFilePath = "src/test/resources/images/not_a_picture.txt"; PostStudentProfilePictureAction invalidProfilePicAction = getActionWithParts("studentprofilephoto", invalidProfilePicFilePath); assertThrows(InvalidHttpRequestBodyException.class, () -> invalidProfilePicAction.execute()); }
Source:
public boolean lookupAttributeBoolean( long deviceId, String attributeName, boolean defaultValue, boolean lookupConfig) { Object result = lookupAttribute(deviceId, attributeName, lookupConfig); return result != null ? Boolean.parseBoolean(result.toString()) : defaultValue; }

Target:
public boolean lookupAttributeBoolean( long deviceId, String attributeName, boolean defaultValue, boolean lookupConfig) { Object result = lookupAttribute(deviceId, attributeName, lookupConfig); if (result != null) { return result instanceof String ? Boolean.parseBoolean((String) result) : (Boolean) result; } return defaultValue; }
Source:
protected void jobReachedGloballyTerminalState(ArchivedExecutionGraph archivedExecutionGraph) { super.jobReachedGloballyTerminalState(archivedExecutionGraph); shutDownFuture.complete(ApplicationStatus.fromJobStatus(archivedExecutionGraph.getState())); }

Target:
protected void jobReachedGloballyTerminalState(ArchivedExecutionGraph archivedExecutionGraph) { super.jobReachedGloballyTerminalState(archivedExecutionGraph); if (jobCancelled || executionMode == ClusterEntrypoint.ExecutionMode.DETACHED) { shutDownFuture.complete(ApplicationStatus.fromJobStatus(archivedExecutionGraph.getState())); } }
Source:
public void copy(Instance sourceMachine, String sourcePath, String targetPath, boolean overwrite) throws MachineException { if (!(sourceMachine instanceof DockerInstance)) { throw new MachineException("Resources can not be copied from the machine " + sourceMachine.getId()); } try { docker.copyResourceTo(container, targetPath, docker.getResourceFrom(((DockerInstance)sourceMachine).container, sourcePath), overwrite); } catch (IOException e) { throw new MachineException(e.getLocalizedMessage()); } }

Target:
public void copy(Instance sourceMachine, String sourcePath, String targetPath, boolean overwrite) throws MachineException { if (!(sourceMachine instanceof DockerInstance)) { throw new MachineException("Unsupported copying between not docker machines"); } try { docker.putResource(container, targetPath, docker.getResource(((DockerInstance)sourceMachine).container, sourcePath), overwrite); } catch (IOException e) { throw new MachineException(e.getLocalizedMessage()); } }
Source:
public RSAPrivateKeyMapper(String credentialName, int privateKey) { Assert.assertNotNull(credentialName); Assert.checkMinimumParameter("privateKey", 1, privateKey); this.privateKey = privateKey; this.credentialName = credentialName; }

Target:
public RSAPrivateKeyMapper(String credentialName, int privateKey) { Assert.checkNotNullParam("credentialName", credentialName); Assert.checkMinimumParameter("privateKey", 1, privateKey); this.privateKey = privateKey; this.credentialName = credentialName; }
Source:
public void testActionIndifferentConfig() throws Exception { MuleTransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_INDIFFERENT); ExecutionTemplate executionTemplate = createExecutionTemplate(config); Object result = executionTemplate.execute(getEmptyTransactionCallback()); assertThat(result, is(RETURN_VALUE)); assertThat(TransactionCoordination.getInstance().getTransaction(), IsNull.nullValue()); }

Target:
public void testActionIndifferentConfig() throws Exception { MuleTransactionConfig config = new MuleTransactionConfig(ACTION_INDIFFERENT); ExecutionTemplate executionTemplate = createExecutionTemplate(config); Object result = executionTemplate.execute(getEmptyTransactionCallback()); assertThat(result, is(RETURN_VALUE)); assertThat(getInstance().getTransaction(), nullValue()); }
Source:
public Map<String, String> tags() { return tags; }

Target:
public Map<String, String> tags() { return Collections.unmodifiableMap(tags); }
Source:
public void cannotGetCharge_WhenInvalidChargeId() { String chargeId = "23235124"; connectorRestApiClient .withAccountId(accountId) .withChargeId(chargeId) .getCharge() .statusCode(NOT_FOUND.getStatusCode()) .contentType(JSON) .body(JSON_MESSAGE_KEY, contains(format("Charge with id [%s] not found.", chargeId))) .body("error_identifier", Matchers.is(ErrorIdentifier.GENERIC.toString())); }

Target:
public void cannotGetCharge_WhenInvalidChargeId() { String chargeId = "23235124"; connectorRestApiClient .withAccountId(accountId) .withChargeId(chargeId) .getCharge() .statusCode(NOT_FOUND.getStatusCode()) .contentType(JSON) .body(JSON_MESSAGE_KEY, contains(format("Charge with id [%s] not found.", chargeId))) .body("error_identifier", is(ErrorIdentifier.GENERIC.toString())); }
Source:
public ParquetInputFormat( Path[] paths, String[] fullFieldNames, DataType[] fullFieldTypes, int[] selectedFields, String partDefaultName, long limit, Configuration conf, boolean utcTimestamp) { this.limit = limit; super.setFilePaths(paths); this.partDefaultName = partDefaultName; this.fullFieldNames = fullFieldNames; this.fullFieldTypes = fullFieldTypes; this.selectedFields = selectedFields; this.conf = new SerializableConfiguration(conf); this.utcTimestamp = utcTimestamp; }

Target:
public ParquetInputFormat( Path[] paths, String[] fullFieldNames, DataType[] fullFieldTypes, int[] selectedFields, String partDefaultName, long limit, Configuration conf, boolean utcTimestamp) { super.setFilePaths(paths); this.limit = limit; this.partDefaultName = partDefaultName; this.fullFieldNames = fullFieldNames; this.fullFieldTypes = fullFieldTypes; this.selectedFields = selectedFields; this.conf = new SerializableConfiguration(conf); this.utcTimestamp = utcTimestamp; }
Source:
public void dispose() { for (Object element : participants.values()) { ISynchronizationScopeParticipant p = (ISynchronizationScopeParticipant) element; p.dispose(); } super.dispose(); }

Target:
public void dispose() { for (ISynchronizationScopeParticipant participant : participants.values()) { participant.dispose(); } super.dispose(); }
Source:
protected Task<Graph> createTask() { return new Task<Graph>() { @Override protected Graph call() throws IOException, ParseException { GraphBuilder gb; gb = new Neo4jBatchBuilder(database.get()); EdgeParser ep = new EdgeParserImpl(getEdgeFile()); NodeParser np = new NodeParserImpl(getNodeFile()); gb.constructGraph(np, ep); ep.close(); np.close(); Graph graph = new Neo4jGraph(database.get()); return graph; } }; }

Target:
protected Task<Graph> createTask() { return new Task<Graph>() { @Override protected Graph call() throws IOException, ParseException { GraphBuilder gb; gb = new Neo4jBatchBuilder(database.get()); EdgeParser ep = new EdgeParserImpl(getEdgeFile()); NodeParser np = new NodeParserImpl(getNodeFile()); gb.constructGraph(np, ep); ep.close(); np.close(); return new Neo4jGraph(database.get()); } }; }
Source:
public List<ConcreteResource> buildContent( RemoteRepository repository ) { if ( repository.getPrefetchPriority() <= 0 ) { logger.error( "The repository prefetch disabled, can not use html content listing", repository.getName() ); return Collections.emptyList(); } if ( PREFETCH_LISTING_TYPE_KOJI.equals( repository.getPrefetchListingType() ) ) { logger.warn( "Will start to use normal html content listing for the koji proxy remote {}", repository.getName() ); } final String rootPath = "/"; final KeyedLocation loc = LocationUtils.toLocation( repository ); final StoreResource res = new StoreResource( loc, rootPath ); try { final ListingResult lr = transferManager.list( res ); if ( lr != null && lr.getListing() != null ) { String[] files = lr.getListing(); List<ConcreteResource> resources = new ArrayList<>( files.length ); for ( final String file : lr.getListing() ) { resources.add( new StoreResource( loc, rootPath, file ) ); } return resources; } } catch ( TransferException e ) { logger.error( String.format( "Can not get transfer for repository %s", repository ), e ); } return Collections.emptyList(); }

Target:
public List<ConcreteResource> buildContent( RemoteRepository repository ) { if ( repository.getPrefetchPriority() <= 0 ) { logger.warn( "The repository prefetch disabled, can not use html content listing", repository.getName() ); return Collections.emptyList(); } final String rootPath = "/"; final KeyedLocation loc = LocationUtils.toLocation( repository ); final StoreResource res = new StoreResource( loc, rootPath ); try { final ListingResult lr = transferManager.list( res ); if ( lr != null && lr.getListing() != null ) { String[] files = lr.getListing(); List<ConcreteResource> resources = new ArrayList<>( files.length ); for ( final String file : lr.getListing() ) { resources.add( new StoreResource( loc, rootPath, file ) ); } return resources; } } catch ( TransferException e ) { logger.error( String.format( "Can not get transfer for repository %s", repository ), e ); } return Collections.emptyList(); }
Source:
public void testParallel() { ParallelGateway gateway = new ParallelGateway(); gateway.getGeneral().getName().setValue(NAME); gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); Node<View<BaseGateway>, ?> node = mockNode(UUID, gateway); when(propertyWriterFactory.of(any(org.eclipse.bpmn2.ParallelGateway.class))).thenReturn(gatewayPropertyWriter); assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); verifyCommonValues(gatewayPropertyWriter, node); verify(gatewayPropertyWriter).setGatewayDirection(node); }

Target:
public void testParallel() { ParallelGateway gateway = new ParallelGateway(); gateway.getGeneral().getName().setValue(NAME); gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); Node<View<BaseGateway>, ?> node = newNode(UUID, gateway); when(propertyWriterFactory.of(any(org.eclipse.bpmn2.ParallelGateway.class))).thenReturn(gatewayPropertyWriter); assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); verifyCommonValues(gatewayPropertyWriter, node); verify(gatewayPropertyWriter).setGatewayDirection(node); }
Source:
public VmSlaPolicyCommand(T parameters) { super(parameters); setVmId((Guid) (getParameters().getSlaParameter(VmSlaPolicyParameters.Params.VM_ID))); setVdsId((Guid) getParameters().getSlaParameter(VmSlaPolicyParameters.Params.VDS_ID)); if (getVds() != null) { setVdsGroupId(getVds().getVdsGroupId()); } }

Target:
public VmSlaPolicyCommand(T parameters) { super(parameters); if (getParameters().getVm() != null) { setVm(getParameters().getVm()); setVdsGroupId(getParameters().getVm().getVdsGroupId()); } }
Source:
@Override protected void executeQueryCommand() { try { executeQueryCommandChecked(); } catch (IOException ex) { final String errorMessage = "Failed to create signed websocket proxy ticket."; log.error(errorMessage, ex); log.debug("Exception", ex); getQueryReturnValue().setSucceeded(false); getQueryReturnValue().setExceptionString(errorMessage); } catch (RuntimeException ex) { log.error(ex.getMessage()); getQueryReturnValue().setSucceeded(false); getQueryReturnValue().setExceptionString(ex.getMessage()); } }

Target:
@Override protected void executeQueryCommand() { try { executeQueryCommandChecked(); } catch (IOException ex) { throw new RuntimeException("Failed to create signed websocket proxy ticket.", ex); } }
Source:
protected String getPossibleValuesString( final String propertyName, final List<Method> methods, final MeasurementVariable variable) { final StringBuilder possibleValuesString = new StringBuilder(); if (variable.getPossibleValues() != null && !variable.getPossibleValues().isEmpty() && !variable.getProperty().equals(propertyName)) { for (final ValueReference value : variable.getPossibleValues()) { if (possibleValuesString.length() > 0) { possibleValuesString.append("/"); } possibleValuesString.append(value.getName()); } } else if (variable.getProperty().equals(propertyName)) { for (final Method method : methods) { if (possibleValuesString.length() > 0) { possibleValuesString.append("/"); } possibleValuesString.append(method.getMcode()); } } return possibleValuesString.toString(); }

Target:
protected String getPossibleValuesString( final String propertyName, final List<Method> methods, final MeasurementVariable variable) { final List<String> possibleValues = new ArrayList<>(); if (!variable.getProperty().equals(propertyName) && !CollectionUtils.isEmpty(variable.getPossibleValues())) { for (final ValueReference value : variable.getPossibleValues()) { possibleValues.add(value.getName()); } } else if (variable.getProperty().equals(propertyName)) { for (final Method method : methods) { possibleValues.add(method.getMcode()); } } return StringUtils.join(possibleValues, "/"); }
Source:
public void loadExtension() { if (isInternal()) { _classLoader = ClassLoaderUtils.getParentClassLoader(); return; } synchronized (ExtensionPackage.class) { _latestClassLoader = new ExtensionClassLoader(ClassLoaderUtils.createClassLoader(getJarFiles(), null), ClassLoaderUtils.getParentClassLoader(), "Extension: " + getName()); _classLoader = _latestClassLoader; } }

Target:
public void loadExtension() { if (isInternal()) { _classLoader = ClassLoaderUtils.getParentClassLoader(); return; } synchronized (ExtensionPackage.class) { final ClassLoader extensionLoader = new ExtensionClassLoader(ClassLoaderUtils.createClassLoader(getJarFiles(), null), ClassLoaderUtils.getParentClassLoader(), "Extension: " + getName()); _allExtensionClassLoaders.add(extensionLoader); _classLoader = extensionLoader; } }
Source:
public void saveString(String string) throws Exception { System.out.println(this.getClass().getSimpleName() + " POST"); System.out.println(this.getClass().getSimpleName() + " begin transaction"); transactionManager.begin(); System.out.println(this.getClass().getSimpleName() + " save string"); stringDao.save(string); System.out.println(this.getClass().getSimpleName() + " commit transaction"); transactionManager.commit(); System.out.println(this.getClass().getSimpleName() + " transaction committed successfully"); }

Target:
public void saveString(String string) throws Exception { System.out.println(this.getClass().getSimpleName() + " POST"); System.out.println(this.getClass().getSimpleName() + " begin transaction"); transactionManager.begin(); System.out.println(this.getClass().getSimpleName() + " save string"); try { stringDao.save(string); System.out.println(this.getClass().getSimpleName() + " commit transaction"); transactionManager.commit(); System.out.println(this.getClass().getSimpleName() + " transaction committed successfully"); } catch (SQLException e) { System.out.println(this.getClass().getSimpleName() + " rollback transaction"); transactionManager.rollback(); System.out.println(this.getClass().getSimpleName() + " transaction rolled back"); throw e; } }
Source:
private boolean matches(String privateCreator, int tag, VR vr, boolean ignorePNCase, boolean matchNoValue, String[] keyVals) { String[] vals = getStrings(privateCreator, tag, null); if (vals == null || vals.length == 0) return matchNoValue; boolean ignoreCase = ignorePNCase && vr == VR.PN; for (String keyVal : keyVals) { DateRange dateRange = null; if (vr == VR.PN) keyVal = new PersonName(keyVals[0]).toString(); switch (vr) { case PN: keyVal = new PersonName(keyVals[0]).toString(); break; case DA: case DT: case TM: dateRange = toDateRange(keyVal, vr); } if (StringUtils.containsWildCard(keyVal)) { Pattern pattern = StringUtils.compilePattern(keyVal, ignoreCase); for (String val : vals) { if (val == null) if (matchNoValue) return true; else continue; if (vr == VR.PN) val = new PersonName(val).toString(); if (pattern.matcher(val).matches()) return true; } } else { for (String val : vals) { if (val == null) if (matchNoValue) return true; else continue; if (dateRange != null) if (dateRange.contains( vr.toDate(val, getTimeZone(), 0, false, null, new DatePrecision()))) return true; else continue; if (vr == VR.PN) val = new PersonName(val).toString(); if (ignoreCase ? keyVal.equalsIgnoreCase(val) : keyVal.equals(val)) return true; } } } return false; }

Target:
private boolean matches(String privateCreator, int tag, VR vr, boolean ignorePNCase, boolean matchNoValue, String[] keyVals) { String[] vals = getStrings(privateCreator, tag, null); if (vals == null || vals.length == 0) return matchNoValue; boolean ignoreCase = ignorePNCase && vr == VR.PN; for (String keyVal : keyVals) { DateRange dateRange = null; switch (vr) { case PN: keyVal = new PersonName(keyVals[0]).toString(); break; case DA: case DT: case TM: dateRange = toDateRange(keyVal, vr); break; } if (StringUtils.containsWildCard(keyVal)) { Pattern pattern = StringUtils.compilePattern(keyVal, ignoreCase); for (String val : vals) { if (val == null) if (matchNoValue) return true; else continue; if (vr == VR.PN) val = new PersonName(val).toString(); if (pattern.matcher(val).matches()) return true; } } else { for (String val : vals) { if (val == null) if (matchNoValue) return true; else continue; if (dateRange != null) if (dateRange.contains( vr.toDate(val, getTimeZone(), 0, false, null, new DatePrecision()))) return true; else continue; if (vr == VR.PN) val = new PersonName(val).toString(); if (ignoreCase ? keyVal.equalsIgnoreCase(val) : keyVal.equals(val)) return true; } } } return false; }
Source:
private void ensureAdvancedOptionsOpen() { if(control("advanced-button").exists()) { control("advanced-button").click(); } }

Target:
private void ensureAdvancedOptionsOpen() { Control advancedButton = control("advanced-button"); if(advancedButton.exists()) { advancedButton.click(); } }
Source:
public int compareTo(SelectListAliasResolution o) { ExpressionColumn ecol = getExpressionColumn(); ExpressionColumn oecol = o.getExpressionColumn(); if (ecol == null || oecol == null) { return getIndex() - o.getIndex(); } else { int nc = getColumnName().compareTo(o.getColumnName()); if (nc != 0) { return nc; } else { RangeVariable rv = ecol.getRangeVariable(); RangeVariable orv = oecol.getRangeVariable(); if (rv == null) { if (orv == null) { return getIndex() - o.getIndex(); } else { if (orv.getColumnExpression(getAlias()) != null) { return 0; } else { return getIndex() - o.getIndex(); } } } else if (orv == null) { if (rv.getColumnExpression(getAlias()) != null) { return 0; } else { return getIndex() - o.getIndex(); } } else { ExpressionColumn myEC = rv.getColumnExpression(getColumnName()); ExpressionColumn oEC = orv.getColumnExpression(getColumnName()); if (myEC != null && oEC != null && myEC == oEC) { return 0; } else { return getTableAlias().compareTo(o.getTableAlias()); } } } } }

Target:
public int compareTo(SelectListAliasResolution o) { ExpressionColumn ecol = getExpressionColumn(); ExpressionColumn oecol = o.getExpressionColumn(); if (ecol == null || oecol == null) { return m_index - o.m_index; } else { int nc = m_columnName.compareTo(o.m_columnName); if (nc != 0) { return nc; } else { RangeVariable rv = ecol.getRangeVariable(); RangeVariable orv = oecol.getRangeVariable(); if (rv == null) { if (orv == null) { return m_index - o.m_index; } else { if (orv.getColumnExpression(m_alias) != null) { return 0; } else { return m_index - o.m_index; } } } else if (orv == null) { if (rv.getColumnExpression(m_columnName) != null) { return 0; } else { return m_index - o.m_index; } } else { ExpressionColumn myEC = rv.getColumnExpression(m_columnName); ExpressionColumn oEC = orv.getColumnExpression(m_columnName); if (myEC != null && oEC != null && myEC == oEC) { return 0; } else { assert(m_tableAlias != null); return m_tableAlias.compareTo(o.m_tableAlias); } } } } }
Source:
public void testTrySend() { final AtomicBoolean isReady = new AtomicBoolean(); final AtomicInteger checkCount = new AtomicInteger(); client = new MockClient(time, metadata) { @Override public boolean ready(Node node, long now) { checkCount.incrementAndGet(); if (isReady.get()) return super.ready(node, now); else return false; } }; consumerClient = new ConsumerNetworkClient(new LogContext(), client, metadata, time, 100, 10, Integer.MAX_VALUE); consumerClient.send(node, heartbeat()); consumerClient.send(node, heartbeat()); assertEquals(2, consumerClient.pendingRequestCount(node)); assertEquals(0, client.inFlightRequestCount(node.idString())); consumerClient.trySend(time.milliseconds()); assertEquals(checkCount.getAndSet(0), 1); assertEquals(2, consumerClient.pendingRequestCount(node)); assertEquals(0, client.inFlightRequestCount(node.idString())); isReady.set(true); consumerClient.trySend(time.milliseconds()); assertEquals(checkCount.getAndSet(0), 2); assertEquals(2, consumerClient.pendingRequestCount(node)); assertEquals(2, client.inFlightRequestCount(node.idString())); }

Target:
public void testTrySend() { final AtomicBoolean isReady = new AtomicBoolean(); final AtomicInteger checkCount = new AtomicInteger(); client = new MockClient(time, metadata) { @Override public boolean ready(Node node, long now) { checkCount.incrementAndGet(); if (isReady.get()) return super.ready(node, now); else return false; } }; consumerClient = new ConsumerNetworkClient(new LogContext(), client, metadata, time, 100, 10, Integer.MAX_VALUE); consumerClient.send(node, heartbeat()); consumerClient.send(node, heartbeat()); assertEquals(2, consumerClient.pendingRequestCount(node)); assertEquals(0, client.inFlightRequestCount(node.idString())); consumerClient.trySend(time.milliseconds()); assertEquals(1, checkCount.getAndSet(0)); assertEquals(2, consumerClient.pendingRequestCount(node)); assertEquals(0, client.inFlightRequestCount(node.idString())); isReady.set(true); consumerClient.trySend(time.milliseconds()); assertEquals(2, checkCount.getAndSet(0)); assertEquals(2, consumerClient.pendingRequestCount(node)); assertEquals(2, client.inFlightRequestCount(node.idString())); }
Source:
public void populate(ApplicationContext ctx) { Map<String, Plugin> allPlugins = getPlugins(ctx); Map<String, Plugin> allExistingPlugins = dataService.findAll(PLUGIN, Plugin.class) .collect(toMap(Plugin::getId, Function.identity())); List<String> pluginIdsToDelete = newArrayList(); allExistingPlugins.forEach((pluginId, plugin) -> { if (allPlugins.get(pluginId) == null) { pluginIdsToDelete.add(pluginId); dataService.delete(PLUGIN, plugin); } }); pluginIdsToDelete.forEach(allExistingPlugins::remove); allPlugins.forEach(allExistingPlugins::putIfAbsent); dataService.getRepository(PLUGIN, Plugin.class).upsertBatch(newArrayList(allExistingPlugins.values())); }

Target:
public void populate(ApplicationContext ctx) { Map<String, Plugin> newOrChangedPluginMap = getPlugins(ctx); List<Plugin> deletedPlugins = new ArrayList<>(); Map<String, Plugin> existingPluginMap = dataService.findAll(PLUGIN, Plugin.class) .collect(toMap(Plugin::getId, Function.identity())); existingPluginMap.forEach((pluginId, plugin) -> { if (newOrChangedPluginMap.get(pluginId) == null) { deletedPlugins.add(plugin); } }); if (!newOrChangedPluginMap.isEmpty()) { dataService.getRepository(PLUGIN, Plugin.class).upsertBatch(newArrayList(newOrChangedPluginMap.values())); } if (!deletedPlugins.isEmpty()) { dataService.delete(PLUGIN, deletedPlugins.stream()); } }
Source:
protected OperationSelector createOperationSelector() { if (operationName.equals(OperationName.INCREMENT_AND_GET)) { return new RatioOperationSelector.Builder().add(CounterOperations.INCREMENT_AND_GET, 1).build(); } else if (operationName.equals(OperationName.DECREMENT_AND_GET)) { return new RatioOperationSelector.Builder().add(CounterOperations.DECREMENT_AND_GET, 1).build(); } else if (operationName.equals(OperationName.ADD_AND_GET)) { return new RatioOperationSelector.Builder().add(CounterOperations.ADD_AND_GET, 1).build(); } else if (operationName.equals(OperationName.COMPARE_AND_SET)) { return new RatioOperationSelector.Builder().add(CounterOperations.COMPARE_AND_SET, 1).build(); } else { throw new IllegalArgumentException("Unknown operation!"); } }

Target:
protected OperationSelector createOperationSelector() { switch (operationName) { case INCREMENT_AND_GET: return new RatioOperationSelector.Builder().add(CounterOperations.INCREMENT_AND_GET, 1).build(); case DECREMENT_AND_GET: return new RatioOperationSelector.Builder().add(CounterOperations.DECREMENT_AND_GET, 1).build(); case ADD_AND_GET: return new RatioOperationSelector.Builder().add(CounterOperations.ADD_AND_GET, 1).build(); case COMPARE_AND_SET: return new RatioOperationSelector.Builder().add(CounterOperations.COMPARE_AND_SET, 1).build(); default: throw new IllegalArgumentException("Unknown operation!"); } }