auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testInvalidConnUpdateCacheFrequencyShouldThrow() throws Exception { Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES); ArrayList<String> invalidUCF = new ArrayList<>(); invalidUCF.add("GIBBERISH"); invalidUCF.add("10000.6"); for (String connLevelUCF : invalidUCF) { props.put(QueryServices.DEFAULT_UPDATE_CACHE_FREQUENCY_ATRRIB, connLevelUCF); try { DriverManager.getConnection(getUrl(), props); fail(); } catch (IllegalArgumentException e) { <START> assertEquals("Connection's phoenix.default.update.cache.frequency can only be set to 'ALWAYS', 'NEVER' or a millisecond numeric value.", <END> e.getMessage()); } } }</code><technical_language>comparing message string here</technical_language>

Target:
public void testInvalidConnUpdateCacheFrequencyShouldThrow() throws Exception { Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES); ArrayList<String> invalidUCF = new ArrayList<>(); invalidUCF.add("GIBBERISH"); invalidUCF.add("10000.6"); for (String connLevelUCF : invalidUCF) { props.put(QueryServices.DEFAULT_UPDATE_CACHE_FREQUENCY_ATRRIB, connLevelUCF); try { DriverManager.getConnection(getUrl(), props); fail(); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().contains("Connection's " + QueryServices.DEFAULT_UPDATE_CACHE_FREQUENCY_ATRRIB)); } } }
Source:
<code>public void testMultipartUploadMultiplePartsKnownETag() throws Exception { BlobStore blobStore = view.getBlobStore(); String container = getContainerName(); <START> String expectedETag = "\"84462a16f6a60478d50148808aa609c1-2\""; <END> int partSize = 5 * (int) Math.pow(2, 20); try { String name = "blob-name"; BlobBuilder blobBuilder = blobStore.blobBuilder(name); Blob blob = blobBuilder.build(); MultipartUpload mpu = blobStore.initiateMultipartUpload(container, blob.getMetadata(), new PutOptions()); byte[] content = new byte[partSize]; Arrays.fill(content, (byte) 'b'); Payload payload = Payloads.newByteArrayPayload(content); payload.getContentMetadata().setContentLength((long) partSize); MultipartPart part1 = blobStore.uploadMultipartPart(mpu, 1, payload); MultipartPart part2 = blobStore.uploadMultipartPart(mpu, 2, payload); List<MultipartPart> parts = blobStore.listMultipartUpload(mpu); assertThat(parts).hasSize(2); assertThat(parts.get(0).partNumber()).isEqualTo(part1.partNumber()); assertThat(parts.get(0).partSize()).isEqualTo(part1.partSize()); assertThat(parts.get(0).partETag()).isEqualTo(part1.partETag()); assertThat(parts.get(1).partNumber()).isEqualTo(part2.partNumber()); assertThat(parts.get(1).partSize()).isEqualTo(part2.partSize()); assertThat(parts.get(1).partETag()).isEqualTo(part2.partETag()); blobStore.completeMultipartUpload(mpu, ImmutableList.of(part1, part2)); BlobMetadata newBlobMetadata = blobStore.blobMetadata(container, name); assertThat(newBlobMetadata.getETag()).isEqualTo(expectedETag); } finally { returnContainer(container); } }</code><technical_language>double-checking S3 returns is want here, filesystem provider. Assuming worth it, able verify other providers produce value</technical_language>

Target:
public void testMultipartUploadMultiplePartsKnownETag() throws Exception { BlobStore blobStore = view.getBlobStore(); String container = getContainerName(); String expectedETag = "\"84462a16f6a60478d50148808aa609c1-2\""; int partSize = 5 * 1024 * 1024; try { String name = "blob-name"; BlobBuilder blobBuilder = blobStore.blobBuilder(name); Blob blob = blobBuilder.build(); MultipartUpload mpu = blobStore.initiateMultipartUpload(container, blob.getMetadata(), new PutOptions()); byte[] content = new byte[partSize]; Arrays.fill(content, (byte) 'b'); Payload payload = Payloads.newByteArrayPayload(content); payload.getContentMetadata().setContentLength((long) partSize); MultipartPart part1 = blobStore.uploadMultipartPart(mpu, 1, payload); MultipartPart part2 = blobStore.uploadMultipartPart(mpu, 2, payload); blobStore.completeMultipartUpload(mpu, ImmutableList.of(part1, part2)); BlobMetadata newBlobMetadata = blobStore.blobMetadata(container, name); assertThat(newBlobMetadata.getETag()).isEqualTo(expectedETag); } finally { returnContainer(container); } }
Source:
<code>public static Path unpack(Path zipFilePath, Path destDirPath) throws IOException{ if (Files.exists(destDirPath)) { Files.delete(destDirPath); } Files.createDirectory(destDirPath); byte[] buffer = new byte[1024]; ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFilePath.toFile())); ZipEntry zipEntry = zipInputStream.getNextEntry(); while (zipEntry != null) { <START> File newFile = new File(destDirPath.toFile(), zipEntry.getName()); newFile.toPath().getParent().toFile().mkdirs(); FileOutputStream fos = new FileOutputStream(newFile); int len; while ((len = zipInputStream.read(buffer)) > 0) { fos.write(buffer, 0, len); } fos.close(); <END> zipEntry = zipInputStream.getNextEntry(); } zipInputStream.closeEntry(); zipInputStream.close(); return destDirPath; }</code><technical_language>This replaceable suggestion Path newFile = destDirPath.resolve(zipEntry.getName()); Files.createDirectories(newFile.getParent()); Files.copy(zipInputStream, newFile);</technical_language>

Target:
public static Path unpack(Path zipFilePath, Path destDirPath) throws IOException { if (Files.exists(destDirPath)) { Files.delete(destDirPath); } Files.createDirectory(destDirPath); ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFilePath.toFile())); ZipEntry zipEntry = zipInputStream.getNextEntry(); while (zipEntry != null) { Path newFile = destDirPath.resolve(zipEntry.getName()); Files.createDirectories(newFile.getParent()); Files.copy(zipInputStream, newFile); zipEntry = zipInputStream.getNextEntry(); } zipInputStream.closeEntry(); zipInputStream.close(); return destDirPath; }
Source:
<code>private boolean contains(T item, ListDataProvider<T> dataProvider) { <START> return contains(item, dataProvider, getItems()); <END> }</code><technical_language>I get feeling this method is adding more methods add line. I code refactored include logic properly in correct method instead of split methods small methods is harder follow code flow</technical_language>

Target:
private boolean contains(T item, ListDataProvider<T> dataProvider) { final Object itemIdentifier = getIdentifier(item, dataProvider::getId); return getItems().anyMatch(i -> itemIdentifier.equals( getIdentifier(i, dataProvider::getId))); }
Source:
<code>ClientDMNType getDMNType(final Map<String, JSITItemDefinition> allDefinitions, final JSITItemDefinition itemDefinition, final String namespace, final Map<String, ClientDMNType> dmnTypesMap) { final Map<String, ClientDMNType> fields = new HashMap<>(); boolean isCollection = itemDefinition.getIsCollection(); if (itemDefinition.getTypeRef() != null) { final ClientDMNType clientDmnType = getOrCreateDMNType(allDefinitions, itemDefinition.getTypeRef(), namespace, dmnTypesMap); if (clientDmnType != null) { if (clientDmnType.isComposite()) { fields.putAll(clientDmnType.getFields()); } isCollection = clientDmnType.isCollection() || isCollection; } else { throw new IllegalStateException( "Item: " + itemDefinition.getName() + " refers to typeRef: " + itemDefinition.getTypeRef() <START> + " which can't be found. The item can be missing or required items sort is wrong"); <END> } } final List<JSITItemDefinition> itemComponent = itemDefinition.getItemComponent(); return new ClientDMNType(namespace, itemDefinition.getName(), itemDefinition.getId(), isCollection, itemComponent != null && !itemComponent.isEmpty(), fields, null); }</code><technical_language>@danielzhe I this error message is more consistent, considering sorting of items is more present</technical_language>

Target:
ClientDMNType getDMNType(final Map<String, JSITItemDefinition> allDefinitions, final JSITItemDefinition itemDefinition, final String namespace, final Map<String, ClientDMNType> dmnTypesMap) { final Map<String, ClientDMNType> fields = new HashMap<>(); boolean isCollection = itemDefinition.getIsCollection(); if (itemDefinition.getTypeRef() != null) { final ClientDMNType clientDmnType = getOrCreateDMNType(allDefinitions, itemDefinition.getTypeRef(), namespace, dmnTypesMap); if (clientDmnType != null) { if (clientDmnType.isComposite()) { fields.putAll(clientDmnType.getFields()); } isCollection = clientDmnType.isCollection() || isCollection; } else { throw new IllegalStateException( "Item: " + itemDefinition.getName() + " refers to typeRef: " + itemDefinition.getTypeRef() + " which can't be found."); } } final List<JSITItemDefinition> itemComponent = itemDefinition.getItemComponent(); return new ClientDMNType(namespace, itemDefinition.getName(), itemDefinition.getId(), isCollection, itemComponent != null && !itemComponent.isEmpty(), fields, null); }
Source:
<code>public void onErrorDownloadTranslations() { <START> Snackbar <END> .make(mTranslationLayout, R.string.error_getting_translation_list, Snackbar.LENGTH_SHORT) .show(); }</code><technical_language>excellent idea, do this instead of toasts random error messages</technical_language>

Target:
public void onErrorDownloadTranslations() { Snackbar .make(translationRecycler, R.string.error_getting_translation_list, Snackbar.LENGTH_SHORT) .show(); }
Source:
<code>public void call(final Subscriber<? super T> o) { final Iterator<? extends T> it; boolean b; try { it = is.iterator(); b = it.hasNext(); } catch (Throwable ex) { Exceptions.throwOrReport(ex, o); return; } if (!b && !o.isUnsubscribed()) { o.onCompleted(); } else { <START> o.setProducer(new IterableProducer<T>(o, it)); <END> } }</code><technical_language>Do need allocate set producer if unsubscribed? check enclose this if/else block</technical_language>

Target:
public void call(final Subscriber<? super T> o) { final Iterator<? extends T> it; boolean b; try { it = is.iterator(); b = it.hasNext(); } catch (Throwable ex) { Exceptions.throwOrReport(ex, o); return; } if (!o.isUnsubscribed()) { if (!b) { o.onCompleted(); } else { o.setProducer(new IterableProducer<T>(o, it)); } } }
Source:
<code>public static String parseProcessingFailureResponse(InputStream responseStream) { try { KXmlParser baseParser = ElementParser.instantiateParser(responseStream); ElementParser<String> responseParser = new ElementParser<String>(baseParser) { @Override public String parse() throws InvalidStructureException, IOException, XmlPullParserException, UnfullfilledRequirementsException { checkNode("OpenRosaResponse"); nextTag("message"); String natureOfResponse = parser.getAttributeValue(null, "nature"); if ("processing_failure".equals(natureOfResponse)) { return parser.nextText(); } return ""; } }; return responseParser.parse(); } catch (IOException | InvalidStructureException | XmlPullParserException | UnfullfilledRequirementsException e) { <START> Log.e(TAG, "Error while parsing form upload response"); <END> e.printStackTrace(); } return ""; }</code><technical_language>I Logger.exception() for this track wren't able process hte response. Also: I thought explicitly required response a 422 *and* a valid openrosa response payload in order for quarantine result, swallowing this silently feels dangerous me. I misremembering</technical_language>

Target:
public static String parseProcessingFailureResponse(InputStream responseStream) throws IOException, InvalidStructureException, UnfullfilledRequirementsException, XmlPullParserException { KXmlParser baseParser = ElementParser.instantiateParser(responseStream); ElementParser<String> responseParser = new ElementParser<String>(baseParser) { @Override public String parse() throws InvalidStructureException, IOException, XmlPullParserException, UnfullfilledRequirementsException { checkNode("OpenRosaResponse"); nextTag("message"); String natureOfResponse = parser.getAttributeValue(null, "nature"); if ("processing_failure".equals(natureOfResponse)) { return parser.nextText(); } else { throw new UnfullfilledRequirementsException( "<message> for 422 response did not contain expected content", CommCareElementParser.SEVERITY_UNKOWN); } } }; return responseParser.parse(); }
Source:
<code>private List<ExtMap> searchDirectoryUsers(QueryData data) { log.debug("Entered searchDirectoryUsers"); ExtensionProxy authz = AuthenticationUtils.getExtensionProfileByAuthzName(ssoContext, data.getAuthz()).getAuthz(); List<ExtMap> results = new ArrayList<>(); <START> for (String namespace : getNamespaces(data)) { <END> results.addAll(DirectoryUtils.findDirectoryUsersByQuery(authz, namespace, data.getQuery())); } log.debug("DirectoryUtils.findDirectoryUsersByQuery returned users in authz for query {}", results.size(), data.getAuthz(), data.getQuery()); return results; }</code><technical_language>replaced stream.map.collect</technical_language>

Target:
private List<ExtMap> searchDirectoryUsers(QueryData data) { log.debug("Entered searchDirectoryUsers"); ExtensionProxy authz = AuthenticationUtils.getExtensionProfileByAuthzName(ssoContext, data.getAuthz()).getAuthz(); List<ExtMap> results = new ArrayList<>(); getNamespaces(data).forEach((namespace) -> results.addAll(DirectoryUtils.findDirectoryUsersByQuery(authz, namespace, data.getQuery()))); log.debug("DirectoryUtils.findDirectoryUsersByQuery returned users in authz for query {}", results.size(), data.getAuthz(), data.getQuery()); return results; }
Source:
<code>public Response intercept(Chain chain) throws IOException { try { return chain.proceed(chain.request()); } catch (Throwable t) { if (t instanceof IOException) { throw (IOException) t; } <START> throw new IOException("Caught a non-IOException while executing a call. " <END> + "This is a serious bug and requires investigation. Rethrowing " + "as an IOException in order to avoid blocking a thread", t); } }</code><technical_language>please SafeIOException here</technical_language>

Target:
public Response intercept(Chain chain) throws IOException { try { return chain.proceed(chain.request()); } catch (Throwable t) { if (t instanceof IOException) { throw (IOException) t; } throw new SafeIoException("Caught a non-IOException. " + "This is a serious bug and requires investigation. Rethrowing " + "as an IOException in order to avoid blocking a Dispatcher thread", t); } }
Source:
<code>private int getAmOrPmKeyCode(int amOrPm) { if (mAmKeyCode == -1 || mPmKeyCode == -1) { KeyCharacterMap kcm = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD); char amChar; char pmChar; for (int i = 0; i < Math.max(mAmText.length(), mPmText.length()); i++) { amChar = mAmText.toLowerCase(Locale.getDefault()).charAt(i); pmChar = mPmText.toLowerCase(Locale.getDefault()).charAt(i); if (amChar != pmChar) { KeyEvent[] events = kcm.getEvents(new char[]{amChar, pmChar}); <START> if (events.length == 4) { <END> mAmKeyCode = events[0].getKeyCode(); mPmKeyCode = events[2].getKeyCode(); } else { Log.e(TAG, "Unable to find keycodes for AM and PM."); } break; } } } if (amOrPm == AM) { return mAmKeyCode; } else if (amOrPm == PM) { return mPmKeyCode; } return -1; }</code><technical_language>stated <LINK_0>[]) events possibly null, I remove null check safety belt</technical_language>

Target:
private int getAmOrPmKeyCode(int amOrPm) { if (mAmKeyCode == -1 || mPmKeyCode == -1) { KeyCharacterMap kcm = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD); char amChar; char pmChar; for (int i = 0; i < Math.max(mAmText.length(), mPmText.length()); i++) { amChar = mAmText.toLowerCase(Locale.getDefault()).charAt(i); pmChar = mPmText.toLowerCase(Locale.getDefault()).charAt(i); if (amChar != pmChar) { KeyEvent[] events = kcm.getEvents(new char[]{amChar, pmChar}); if (events != null && events.length == 4) { mAmKeyCode = events[0].getKeyCode(); mPmKeyCode = events[2].getKeyCode(); } else { Log.e(TAG, "Unable to find keycodes for AM and PM."); } break; } } } if (amOrPm == AM) { return mAmKeyCode; } else if (amOrPm == PM) { return mPmKeyCode; } return -1; }
Source:
<code>public void stopContainer(String containerId, int killWait) throws DockerAccessException { try { String url = urlBuilder.stopContainer(containerId, killWait); <START> log.verbose(Logger.LogVerboseCategory.API,"POSTing %s", url); <END> delegate.post(url, HTTP_NO_CONTENT, HTTP_NOT_MODIFIED); } catch (IOException e) { throw new DockerAccessException(e, "Unable to stop container id [%s]", containerId); } }</code><technical_language>suggestion log.verbose(Logger.LogVerboseCategory.API,"POST %s", url);</technical_language>

Target:
public void stopContainer(String containerId, int killWait) throws DockerAccessException { try { String url = urlBuilder.stopContainer(containerId, killWait); log.verbose(Logger.LogVerboseCategory.API,"POST %s", url); delegate.post(url, HTTP_NO_CONTENT, HTTP_NOT_MODIFIED); } catch (IOException e) { throw new DockerAccessException(e, "Unable to stop container id [%s]", containerId); } }
Source:
<code>private static void runPersistentWorker() throws Exception { ByteArrayOutputStream buf = new ByteArrayOutputStream(); <START> PrintStream ps = new PrintStream(buf); <END> PrintStream realStdOut = System.out; PrintStream realStdErr = System.err; try { System.setOut(ps); System.setErr(ps); while (true) { try { WorkRequest request = WorkRequest.parseDelimitedFrom(System.in); if (request == null) { break; } int exitCode = processRequest(request.getArgumentsList()); ps.flush(); WorkResponse.newBuilder() .setExitCode(exitCode) .setOutput(buf.toString()) .build() .writeDelimitedTo(realStdOut); realStdOut.flush(); buf.reset(); } catch (IOException e) { logger.severe(e.getMessage()); e.printStackTrace(realStdErr); } } } finally { System.setOut(realStdOut); System.setErr(realStdErr); } }</code><technical_language>I want enable autoFlush 'ps' well, avoid including stdout chars in a stderr line vice versa</technical_language>

Target:
private static int runPersistentWorker() throws Exception { ByteArrayOutputStream buf = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(buf, true); PrintStream realStdOut = System.out; PrintStream realStdErr = System.err; try { System.setOut(ps); System.setErr(ps); while (true) { try { WorkRequest request = WorkRequest.parseDelimitedFrom(System.in); if (request == null) { break; } int exitCode = processRequest(request.getArgumentsList()); ps.flush(); WorkResponse.newBuilder() .setExitCode(exitCode) .setOutput(buf.toString()) .build() .writeDelimitedTo(realStdOut); realStdOut.flush(); buf.reset(); } catch (IOException e) { logger.severe(e.getMessage()); e.printStackTrace(realStdErr); return 1; } } } finally { System.setOut(realStdOut); System.setErr(realStdErr); } return 0; }
Source:
<code>public void reset() { <START> Schedulers.io().scheduleDirect(() -> { <END> DataStore.clearTrailHistory(); history.clear(); }); }</code><technical_language>suggestion Schedulers.io().scheduleDirect(new Runnable() {</technical_language>

Target:
public void reset() { Schedulers.io().scheduleDirect(new Runnable() { @Override public void run() { DataStore.clearTrailHistory(); history.clear(); } }); }
Source:
<code>public void handle(final TypedMessage typedMessage) throws MessageHandlingException { try { final String messageType = typedMessage.getType(); logger.debug("Handling: " + messageType); for (final EventHandler<E> eventHandler : eventHandlers.get(messageType)) { final E event = AbstractEvent.newEvent(eventHandler.getEventClass(), typedMessage.getPayload()); if (!eventHandler.getEventClass().isAssignableFrom(event.getClass())) { throw new IllegalStateException("Event of type " + event.getClass() + " is not compatible with " + eventHandler.getEventClass() + " in event handler"); } <START> eventHandler.handle(event); <END> } } catch (final Exception e) { throw new MessageHandlingException(e.getMessage(), e); } }</code><technical_language>i guess a risk handler completes throws exception, is deemed acceptable risk</technical_language>

Target:
public void handle(final TypedMessage typedMessage) throws MessageHandlingException { try { final String messageType = typedMessage.getType(); logger.debug("Handling: " + messageType); for (final EventHandler<E> eventHandler : eventHandlers.get(messageType)) { try { final E event = AbstractEvent.newEvent(eventHandler.getEventClass(), typedMessage.getPayload()); if (!eventHandler.getEventClass().isAssignableFrom(event.getClass())) { throw new IllegalStateException("Event of type " + event.getClass() + " is not compatible with " + eventHandler.getEventClass() + " in event handler"); } eventHandler.handle(event); } catch (final Exception e) { logger.error("Error handling message: " + typedMessage, e); } } } catch (final Exception e) { throw new MessageHandlingException(e.getMessage(), e); } }
Source:
<code>public com.google.gwtorm.client.Key<?>[] members() { <START> return new com.google.gwtorm.client.Key<?>[] {accountId, patchKey}; <END> }</code><technical_language>If override accountId parentKey is automatically a member, this needs include patchKey</technical_language>

Target:
public com.google.gwtorm.client.Key<?>[] members() { return new com.google.gwtorm.client.Key<?>[] {patchKey}; }
Source:
<code>public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { try { Object stage; if (!readNeedsLock(ctx, command)) { stage = invokeNext(ctx, command); } else { Collection<?> keys = command.getKeys(); if (!needRemoteLocks(ctx, keys, command)) { acquireLocalLocks(ctx, command, keys); stage = invokeNext(ctx, command); } else { final TxInvocationContext txContext = (TxInvocationContext) ctx; LockControlCommand lcc = cf.buildLockControlCommand(keys, command.getFlagsBitSet(), txContext.getGlobalTransaction()); stage = invokeNextThenApply(ctx, lcc, (rCtx, rLockCommand, rv) -> { acquireLocalLocks(rCtx, command, keys); return invokeNext(rCtx, command); }); } } <START> return makeStage(stage).andFinally(ctx, command, (rCtx, rCommand, rv, t) -> { <END> if (t != null) { releaseLocksOnFailureBeforePrepare(rCtx); } }); } catch (Throwable t) { releaseLocksOnFailureBeforePrepare(ctx); throw t; } }</code><technical_language>andExceptionally more appropriate</technical_language>

Target:
public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { try { Object stage; if (!readNeedsLock(ctx, command)) { stage = invokeNext(ctx, command); } else { Collection<?> keys = command.getKeys(); if (!needRemoteLocks(ctx, keys, command)) { acquireLocalLocks(ctx, command, keys); stage = invokeNext(ctx, command); } else { final TxInvocationContext txContext = (TxInvocationContext) ctx; LockControlCommand lcc = cf.buildLockControlCommand(keys, command.getFlagsBitSet(), txContext.getGlobalTransaction()); stage = invokeNextThenApply(ctx, lcc, (rCtx, rLockCommand, rv) -> { acquireLocalLocks(rCtx, command, keys); return invokeNext(rCtx, command); }); } } return makeStage(stage).andExceptionally(ctx, command, (rCtx, rCommand, t) -> { releaseLocksOnFailureBeforePrepare(rCtx); throw t; }); } catch (Throwable t) { releaseLocksOnFailureBeforePrepare(ctx); throw t; } }
Source:
<code>public int getMinExposureCompensation() { <START> return 0; <END> }</code><technical_language>do numbers from</technical_language>

Target:
public int getMinExposureCompensation() { return -6; }
Source:
<code>void pause() { <START> if (downloadBatchStatus.status() == PAUSED || downloadBatchStatus.status() == DOWNLOADED) { <END> return; } downloadBatchStatus.markAsPaused(downloadsBatchPersistence); notifyCallback(downloadBatchStatus); for (DownloadFile downloadFile : downloadFiles) { downloadFile.pause(); } }</code><technical_language>Yeah good one, this solves lots of issues library is checking current download statuses, pausing a paused download</technical_language>

Target:
void pause() { DownloadBatchStatus.Status status = downloadBatchStatus.status(); if (status == PAUSED || status == DOWNLOADED) { return; } downloadBatchStatus.markAsPaused(downloadsBatchPersistence); notifyCallback(downloadBatchStatus); for (DownloadFile downloadFile : downloadFiles) { downloadFile.pause(); } }
Source:
<code>public static Collection getParameters() { List<Object[]> combinations = new ArrayList<>(); combinations.add(new Object[]{SNAPSHOT, TWO_SIX_THREE, TWO_SIX_THREE}); <START> return combinations; <END> }</code><technical_language>test older versions, 2.0 versions</technical_language>

Target:
public static Collection getParameters() { List<Object[]> combinations = new ArrayList<>(); combinations.add(new Object[]{SNAPSHOT, TWO_SIX_THREE, TWO_SIX_THREE}); combinations.add(new Object[]{SNAPSHOT, TWO_ZERO, TWO_ZERO}); combinations.add(new Object[]{SNAPSHOT, TWO_ONE, TWO_ONE}); combinations.add(new Object[]{SNAPSHOT, TWO_FOUR, TWO_FOUR}); return combinations; }
Source:
<code>public JCheckBox getInverseCheckbox() { if (inverseCheckbox == null) { inverseCheckbox = new JCheckBox(Constant.messages.getString("websocket.filter.label.regex.inverse")); <START> inverseCheckbox.setSelected(false); <END> } return inverseCheckbox; }</code><technical_language>removed, default</technical_language>

Target:
public JCheckBox getInverseCheckbox() { if (inverseCheckbox == null) { inverseCheckbox = new JCheckBox(Constant.messages.getString("websocket.filter.label.regex.inverse")); } return inverseCheckbox; }
Source:
<code>public boolean isLaunched(Agent agent, InstanceProcess process, Instance machine) throws MachineException { Server server = machine.getRuntime().getServers().get(exposedPort); if (server != null) { try { <START> LOG.error("Ping ssh agent"); <END> String[] hostPort = server.getAddress().split(":"); try (@SuppressWarnings("unused") Socket socket = new Socket(hostPort[0], Integer.parseInt(hostPort[1]))) { return true; } } catch (Exception ignored) { } } return false; }</code><technical_language>I this is debug info</technical_language>

Target:
public boolean isLaunched(Agent agent, InstanceProcess process, Instance machine) throws MachineException { Server server = machine.getRuntime().getServers().get(exposedPort); if (server != null) { try { String[] hostPort = server.getAddress().split(":"); try (@SuppressWarnings("unused") Socket socket = new Socket(hostPort[0], Integer.parseInt(hostPort[1]))) { return true; } } catch (Exception ignored) { } } return false; }
Source:
<code>public void run(StreamApplication app) { SystemAdmins systemAdmins = null; try { <START> systemAdmins = buildAndStartSystemAdmins(); <END> StreamManager streamManager = buildStreamManager(systemAdmins); ExecutionPlan plan = getExecutionPlan(app, streamManager); String executionPlanJson = plan.getPlanAsJson(); writePlanJsonFile(executionPlanJson); LOG.info("Execution Plan: \n" + executionPlanJson); String planId = String.valueOf(executionPlanJson.hashCode()); createStreams(planId, plan.getIntermediateStreams(), streamManager); if (plan.getJobConfigs().isEmpty()) { throw new SamzaException("No jobs to run."); } plan.getJobConfigs().forEach(jobConfig -> { LOG.debug("Starting job StreamProcessor with config {}", jobConfig.getName(), jobConfig); LocalStreamProcessorLifeCycleListener listener = new LocalStreamProcessorLifeCycleListener(); StreamProcessor processor = createStreamProcessor(jobConfig, graphSpec, listener); listener.setProcessor(processor); processors.add(processor); }); numProcessorsToStart.set(processors.size()); processors.forEach(StreamProcessor::start); } catch (Throwable throwable) { appStatus = ApplicationStatus.unsuccessfulFinish(throwable); shutdownLatch.countDown(); throw new SamzaException(String.format("Failed to start application: %s.", app), throwable); } finally { if (systemAdmins != null) { systemAdmins.stop(); } } }</code><technical_language>this lines in a places. I suggest hiding systemAdmins streamManager, add add start(), stop() in streamManager invoke life cycle methods of systemAdmins. this, streamManager a member in abstract runner avoid constructing everywhere</technical_language>

Target:
public void run(StreamApplication app) { StreamManager streamManager = null; try { streamManager = buildAndStartStreamManager(); ExecutionPlan plan = getExecutionPlan(app, streamManager); String executionPlanJson = plan.getPlanAsJson(); writePlanJsonFile(executionPlanJson); LOG.info("Execution Plan: \n" + executionPlanJson); String planId = String.valueOf(executionPlanJson.hashCode()); createStreams(planId, plan.getIntermediateStreams(), streamManager); if (plan.getJobConfigs().isEmpty()) { throw new SamzaException("No jobs to run."); } plan.getJobConfigs().forEach(jobConfig -> { LOG.debug("Starting job StreamProcessor with config {}", jobConfig.getName(), jobConfig); LocalStreamProcessorLifeCycleListener listener = new LocalStreamProcessorLifeCycleListener(); StreamProcessor processor = createStreamProcessor(jobConfig, graphSpec, listener); listener.setProcessor(processor); processors.add(processor); }); numProcessorsToStart.set(processors.size()); processors.forEach(StreamProcessor::start); } catch (Throwable throwable) { appStatus = ApplicationStatus.unsuccessfulFinish(throwable); shutdownLatch.countDown(); throw new SamzaException(String.format("Failed to start application: %s.", app), throwable); } finally { if (streamManager != null) { streamManager.stop(); } } }
Source:
<code>public OperationFuture<ServerRef> removePublicIp(ServerRef serverRef) { ServerMetadata serverMetadata = findByRef(serverRef); List<JobFuture> jobFutures = new ArrayList<>(); serverMetadata.getDetails().getIpAddresses() .stream() .map(IpAddress::getPublicIp) .filter(notNull()) <START> .forEach(address -> jobFutures.add(removePublicIp(serverRef, address).jobFuture())); <END> return new OperationFuture<>( serverRef, new ParallelJobsFuture(jobFutures) ); }</code><technical_language>replace forEach map operation if difficult</technical_language>

Target:
public OperationFuture<ServerRef> removePublicIp(ServerRef serverRef) { ServerMetadata serverMetadata = findByRef(serverRef); List<JobFuture> jobFutures = serverMetadata.getDetails().getIpAddresses() .stream() .map(IpAddress::getPublicIp) .filter(notNull()) .map(address -> removePublicIp(serverRef, address).jobFuture()) .collect(toList()); return new OperationFuture<>( serverRef, new ParallelJobsFuture(jobFutures) ); }
Source:
<code>public List<Currency> getCurrencyForName(final String name) { List<Currency> list = _namesToCurrency.get(name); <START> if (list == null) { <END> return new ArrayList<>(); } return _namesToCurrency.get(name); }</code><technical_language>null checks disappear if a multimap</technical_language>

Target:
public List<Currency> getCurrencyForName(final String name) { return _namesToCurrency.get(name); }
Source:
<code>public void run(InputStream inputStream) { Scanner scanner = new Scanner(inputStream); while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (line.equalsIgnoreCase("stop")) { commandSender.print("Stopping!"); break; } if (line.startsWith("save")) { <START> String[] bits = line.split(" "); <END> if (bits.length == 0) { commandSender.print("Usage: save <filename>"); continue; } World world = platform.getWorlds().get(0); if (world instanceof ClipboardWorld) { File file; if (bits.length >= 2) { file = new File(bits[1]); } else { file = commandSender.openFileSaveDialog(new String[]{"schem"}); } if (file == null) { commandSender.printError("Please choose a file."); continue; } try(ClipboardWriter writer = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream(file))) { writer.write((Clipboard) world); commandSender.print("Saved to file"); } catch (IOException e) { e.printStackTrace(); } } continue; } WorldEdit.getInstance().getEventBus().post(new CommandEvent( commandSender, line )); } scanner.close(); }</code><technical_language>I prefer if allowed quoting escaping here, for user-friendliness</technical_language>

Target:
public void run(InputStream inputStream) { try (Scanner scanner = new Scanner(inputStream)) { while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (line.equals("stop")) { commandSender.print("Stopping!"); break; } CommandEvent event = new CommandEvent(commandSender, line); WorldEdit.getInstance().getEventBus().post(event); if (!event.isCancelled()) { commandSender.printError("Unknown command!"); } else { saveAllWorlds(false); } } } finally { saveAllWorlds(false); } }
Source:
<code>public void verifyZoomingByGesture (PerformTouchAction touchAction, String zoomMethod) { Shooter shooter = new Shooter(); ImageComparison ic = new ImageComparison(); File beforeZooming = shooter.capturePage(driver); switch (zoomMethod) { case "gesture": touchAction.zoomInOutPointXY(50, 50, 50, 100, PerformTouchAction.ZOOM_WAY_IN, 3000); break; case "tap": touchAction.tapOnPointXY(50, 50, 140, 0); touchAction.tapOnPointXY(50, 50, 140, 3000); break; default: break; } File afterZoomIn = shooter.capturePage(driver); <START> if (!ic.areFilesTheSame(beforeZooming, afterZoomIn)) { <END> PageObjectLogging.log("verifyZoomingByGesture", "Zoom in by " + zoomMethod + " works", true); } else { PageObjectLogging.log("verifyZoomingByGesture", "Zoom in by " + zoomMethod + " doesn't work", false); } switch (zoomMethod) { case "gesture": touchAction.zoomInOutPointXY(50, 50, 50, 140, PerformTouchAction.ZOOM_WAY_OUT, 3000); break; case "tap": touchAction.tapOnPointXY(50, 50, 140, 0); touchAction.tapOnPointXY(50, 50, 140, 3000); break; default: break; } File afterZoomOut = shooter.capturePage(driver); if (ic.areFilesTheSame(beforeZooming, afterZoomOut)) { PageObjectLogging.log("verifyZoomingByGesture", "Zoom out by " + zoomMethod + " works", true); } else { PageObjectLogging.log("verifyZoomingByGesture", "Zoom out by " + zoomMethod + " doesn't work", false); } }</code><technical_language>Please switch if else avoid negation '!' for readability</technical_language>

Target:
public void verifyZoomingByGesture (PerformTouchAction touchAction, String zoomMethod) { Shooter shooter = new Shooter(); ImageComparison ic = new ImageComparison(); File beforeZooming = shooter.capturePage(driver); switch (zoomMethod) { case "gesture": touchAction.zoomInOutPointXY(50, 50, 50, 100, PerformTouchAction.ZOOM_WAY_IN, 3000); break; case "tap": touchAction.tapOnPointXY(50, 50, 140, 0); touchAction.tapOnPointXY(50, 50, 140, 3000); break; default: break; } File afterZoomIn = shooter.capturePage(driver); if (ic.areFilesTheSame(beforeZooming, afterZoomIn)) { PageObjectLogging.log("verifyZoomingByGesture", "Zoom in by " + zoomMethod + " doesn't work", false); } else { PageObjectLogging.log("verifyZoomingByGesture", "Zoom in by " + zoomMethod + " works", true); } switch (zoomMethod) { case "gesture": touchAction.zoomInOutPointXY(50, 50, 50, 140, PerformTouchAction.ZOOM_WAY_OUT, 3000); break; case "tap": touchAction.tapOnPointXY(50, 50, 140, 0); touchAction.tapOnPointXY(50, 50, 140, 3000); break; default: break; } File afterZoomOut = shooter.capturePage(driver); if (ic.areFilesTheSame(beforeZooming, afterZoomOut)) { PageObjectLogging.log("verifyZoomingByGesture", "Zoom out by " + zoomMethod + " works", true); } else { PageObjectLogging.log("verifyZoomingByGesture", "Zoom out by " + zoomMethod + " doesn't work", false); } }
Source:
<code><START> private void analyzeCoreContext(JavaContentAssistInvocationContext context, <END> CompletionContext coreContext) { final ICompilationUnit cu= context.getCompilationUnit(); final CompletionProposalCollector collector= new CompletionProposalCollector(cu) { @Override public void acceptContext(final CompletionContext c) { super.acceptContext(c); updateTemplateEngine(c); } }; collector.setInvocationContext(context); collector.setRequireExtendedContext(true); try { cu.codeComplete(context.getInvocationOffset(), collector); } catch (JavaModelException e) { e.printStackTrace(); } }</code><technical_language>original code checked if coreContext extended called updateTemplateEngine() directly. this removed</technical_language>

Target:
private void analyzeCoreContext(JavaContentAssistInvocationContext context, CompletionContext coreContext) { if (coreContext.isExtended()) { updateTemplateEngine(coreContext); } else { final ICompilationUnit cu= context.getCompilationUnit(); final CompletionProposalCollector collector= new CompletionProposalCollector(cu) { @Override public void acceptContext(final CompletionContext c) { super.acceptContext(c); updateTemplateEngine(c); } }; collector.setInvocationContext(context); collector.setRequireExtendedContext(true); try { cu.codeComplete(context.getInvocationOffset(), collector); } catch (JavaModelException e) { e.printStackTrace(); } } }
Source:
<code>private Response getSchema() { ByteArrayOutputStream baos = null; InputStream is = null; byte[] buffer = new byte[4096]; try { baos = new ByteArrayOutputStream(); is = Thread.currentThread().getContextClassLoader().getResourceAsStream(API_SCHEMA); int count; while ((count = is.read(buffer)) != -1) { baos.write(buffer, 0, count); } baos.flush(); return Response.ok(baos.toByteArray(), MediaType.APPLICATION_OCTET_STREAM) .header("content-disposition", "attachment; filename = " + SCHEMA_NAME) .build(); } catch (IOException e) { LOG.error("Loading api.xsd file failed.", e); return Response.serverError().build(); } finally { try { if (baos != null) baos.close(); if (is != null) is.close(); } catch (IOException e) { <START> log.error("cannot close a resource", e); <END> } } }</code><technical_language>Note in 3.5 branch member is called LOG</technical_language>

Target:
private Response getSchema() { ByteArrayOutputStream baos = null; InputStream is = null; byte[] buffer = new byte[4096]; try { baos = new ByteArrayOutputStream(); is = Thread.currentThread().getContextClassLoader().getResourceAsStream(API_SCHEMA); int count; while ((count = is.read(buffer)) != -1) { baos.write(buffer, 0, count); } baos.flush(); return Response.ok(baos.toByteArray(), MediaType.APPLICATION_OCTET_STREAM) .header("content-disposition", "attachment; filename = " + SCHEMA_NAME) .build(); } catch (IOException e) { LOG.error("Loading api.xsd file failed.", e); return Response.serverError().build(); } finally { try { if (baos != null) baos.close(); if (is != null) is.close(); } catch (IOException e) { LOG.error("cannot close a resource", e); } } }
Source:
<code>public void waitUntilReceived(long seconds) { logger.info("Expecting to receive messages", expectedMessages.size()); await().atMost(adjust(new Duration(seconds, TimeUnit.SECONDS))).until(() -> receivedRequests.size() == expectedMessages.size()); <START> synchronized (receivedRequests) { <END> assertThat(receivedRequests.stream().map(LoggedRequest::getBodyAsString).collect(toList())).containsAll(expectedMessages); } }</code><technical_language>synchronized blocks needed</technical_language>

Target:
public void waitUntilReceived(long seconds) { logger.info("Expecting to receive messages", expectedMessages.size()); await().atMost(adjust(new Duration(seconds, TimeUnit.SECONDS))).until(() -> assertThat(receivedRequests.size()).isGreaterThanOrEqualTo(expectedMessages.size())); synchronized (receivedRequests) { assertThat(receivedRequests.stream().map(LoggedRequest::getBodyAsString).collect(toList())).containsAll(expectedMessages); } }
Source:
<code>public Map<String, String> unwrap(final ExpressionResolver context, final ModelNode model) throws OperationFailedException { <START> ModelNode modelProps = model.get(getName()); <END> return unwrapModel(context, modelProps); }</code><technical_language>This mutate 'model' if model.has(...) return false. a big deal, more robust to</technical_language>

Target:
public Map<String, String> unwrap(final ExpressionResolver context, final ModelNode model) throws OperationFailedException { if (!model.hasDefined(getName())){ return Collections.emptyMap(); } ModelNode modelProps = model.get(getName()); return unwrapModel(context, modelProps); }
Source:
<code>public URI visit(AstLocationExpression value, ELContext environment) throws Exception { Object location; try { synchronized (environment) { ValueExpression expression = value.getValue(); location = expression.getValue(environment); } <START> } catch (javax.el.PropertyNotFoundException e) { <END> LOGGER.warn(e.getMessage()); location = null; } if (location == null) { throw new NullPointerException("Location expression result is null"); } return (URI) location; }</code><technical_language>add import for PropertyNotFoundException</technical_language>

Target:
public URI visit(AstLocationExpression value, ELContext environment) throws Exception { Object location; try { synchronized (environment) { ValueExpression expression = value.getValue(); location = expression.getValue(environment); } } catch (PropertyNotFoundException e) { LOGGER.warn(e.getMessage(), e); location = null; } if (location == null) { throw new NullPointerException("Location expression result is null"); } return (URI) location; }
Source:
<code>public void testRebaseInteractiveSquashFirstCommitShouldFail() throws Exception { writeTrashFile(FILE1, FILE1); git.add().addFilepattern(FILE1).call(); git.commit().setMessage("Add file1\nnew line").call(); assertTrue(new File(db.getWorkTree(), FILE1).exists()); writeTrashFile("file2", "file2"); git.add().addFilepattern("file2").call(); git.commit().setMessage("Add file2\nnew line").call(); assertTrue(new File(db.getWorkTree(), "file2").exists()); git.rebase().setUpstream("HEAD~1") .runInteractively(new InteractiveHandler() { public void prepareSteps(List<RebaseTodoLine> steps) { steps.get(0).setAction(Action.SQUASH); } public String modifyCommitMessage(String commit) { <START> fail("No callback to modify commit message expected for single fixup"); <END> return commit; } }).call(); }</code><technical_language>Yes, this copy paste. I remove line. Additionally I add a new Exception type this situation is internal exception of JGit, a wrong usage of API</technical_language>

Target:
public void testRebaseInteractiveSquashFirstCommitShouldFail() throws Exception { writeTrashFile(FILE1, FILE1); git.add().addFilepattern(FILE1).call(); git.commit().setMessage("Add file1\nnew line").call(); assertTrue(new File(db.getWorkTree(), FILE1).exists()); writeTrashFile("file2", "file2"); git.add().addFilepattern("file2").call(); git.commit().setMessage("Add file2\nnew line").call(); assertTrue(new File(db.getWorkTree(), "file2").exists()); git.rebase().setUpstream("HEAD~1") .runInteractively(new InteractiveHandler() { public void prepareSteps(List<RebaseTodoLine> steps) { steps.get(0).setAction(Action.SQUASH); } public String modifyCommitMessage(String commit) { return commit; } }).call(); }
Source:
<code>protected void addClassPathEntries() throws MalformedURLException { String internalLib = System.getProperty("carbon.internal.lib.dir.path"); if (internalLib == null) { <START> addFileUrl(new File(ROOT + File.separator + "lib" + File.separator)); <END> addJarFileUrls(new File(ROOT + File.separator + "lib")); } else { addFileUrl(new File(internalLib + File.separator)); addJarFileUrls(new File(internalLib)); } }</code><technical_language>Instead of File.separator, paths.get() for occurrences</technical_language>

Target:
protected void addClassPathEntries() throws MalformedURLException { String internalLib = System.getProperty(INTERNAL_CARBON_LIB_DIR_PATH); if (internalLib == null) { File libFile = Paths.get(ROOT, "lib").toFile(); addFileUrl(libFile); addJarFileUrls(libFile); } else { addFileUrl(new File(internalLib)); addJarFileUrls(new File(internalLib)); } }
Source:
<code><START> private List<WorkerSlot> toSlots(Offer offer, double cpu, double mem, boolean supervisorExists) { <END> double executorCpuDemand = supervisorExists ? 0 : MesosCommon.executorCpu(_conf); double executorMemDemand = supervisorExists ? 0 : MesosCommon.executorMem(_conf); OfferResources resources = getResources( offer, executorCpuDemand, executorMemDemand, cpu, mem); List<WorkerSlot> ret = new ArrayList<WorkerSlot>(); int availableSlots = Math.min(resources.cpuSlots, resources.memSlots); availableSlots = Math.min(availableSlots, resources.ports.size() - 1); for (int i = 0; i < availableSlots; i++) { ret.add(new WorkerSlot(offer.getHostname(), resources.ports.get(i))); } return ret; }</code><technical_language>Do combine offers if received multiple offers agent</technical_language>

Target:
private List<WorkerSlot> toSlots(Offer offer, double cpu, double mem, boolean supervisorExists) { double executorCpuDemand = supervisorExists ? 0 : MesosCommon.executorCpu(_conf); double executorMemDemand = supervisorExists ? 0 : MesosCommon.executorMem(_conf); OfferResources resources = getResources( offer, executorCpuDemand, executorMemDemand, cpu, mem); List<WorkerSlot> ret = new ArrayList<WorkerSlot>(); int availableSlots = Math.min(resources.cpuSlots, resources.memSlots); availableSlots = Math.min(availableSlots, resources.ports.size()); for (int i = 0; i < availableSlots; i++) { ret.add(new WorkerSlot(offer.getHostname(), resources.ports.get(i))); } return ret; }
Source:
<code><START> public ParseQuery<T> whereContainsAllStartsWith(String key, Collection<String> values) { <END> checkIfRunning(); ArrayList<Pattern> regexValues = new ArrayList<>(); for (String value : values) { regexValues.add(Pattern.compile(buildStartsWithRegex(value))); } return whereContainsAll(key, regexValues); }</code><technical_language>suggestions for a name? This obscure first</technical_language>

Target:
public ParseQuery<T> whereContainsAllStartsWith(String key, Collection<String> values) { ArrayList<KeyConstraints> startsWithConstraints = new ArrayList<>(); for (String value : values) { KeyConstraints keyConstraints = new KeyConstraints(); keyConstraints.put("$regex", buildStartsWithRegex(value)); startsWithConstraints.add(keyConstraints); } return whereContainsAll(key, startsWithConstraints); }
Source:
<code><START> private ITokenCacheStore wrapCache(@NonNull final ITokenCacheStore originalCache) { <END> return new ITokenCacheStore() { @Override public TokenCacheItem getItem(final String key) { return originalCache.getItem(key); } @Override public Iterator<TokenCacheItem> getAll() { return originalCache.getAll(); } @Override public boolean contains(final String key) { return originalCache.contains(key); } @Override public void setItem(final String key, final TokenCacheItem item) { originalCache.setItem(key, item); } @Override public void removeItem(final String key) { originalCache.removeItem(key); } @Override public void removeAll() { originalCache.removeAll(); getMsalOAuth2TokenCache(mContext).clearAll(); } }; }</code><technical_language>Do need do this? removeAll special. missing</technical_language>

Target:
private ITokenCacheStore wrapCache(@NonNull final ITokenCacheStore originalCache) { return new ITokenCacheStore() { @Override public synchronized TokenCacheItem getItem(final String key) { return originalCache.getItem(key); } @Override public synchronized Iterator<TokenCacheItem> getAll() { return originalCache.getAll(); } @Override public synchronized boolean contains(final String key) { return originalCache.contains(key); } @Override public synchronized void setItem(final String key, final TokenCacheItem item) { originalCache.setItem(key, item); } @Override public synchronized void removeItem(final String key) { originalCache.removeItem(key); } @Override public synchronized void removeAll() { originalCache.removeAll(); getMsalOAuth2TokenCache(mContext).clearAll(); } }; }
Source:
<code><START> private void setCloudEnabled(boolean enabled) { <END> _record.setBooleanField(CloudConfigProperty.CLOUD_ENABLED.name(), enabled); }</code><technical_language>methods are/can place. Instead of removing all, some of public ones. need leave room user change some of fields, cloudenable, source fields. For validation purpose, constructors private creating Builder</technical_language>

Target:
public void setCloudEnabled(boolean enabled) { _record.setBooleanField(CloudConfigProperty.CLOUD_ENABLED.name(), enabled); }
Source:
<code>public String getDiscriminatingValue(ILoggingEvent o) { <START> return Thread.currentThread().getName().equals(PERSISTENCE_THREAD) <END> ? "jclouds-persister" : "jclouds"; }</code><technical_language>Do want startsWith equals? If is a thread name, return new Thread(r, "brooklyn-persister") thread name a number suffix. case for running tests multiple management contexts</technical_language>

Target:
public String getDiscriminatingValue(ILoggingEvent o) { return Thread.currentThread().getName().startsWith(PERSISTENCE_THREAD) ? "persistence" : "jclouds"; }