auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void generateInsights(final Long accountId, final DateTime accountCreated, final RolloutClient featureFlipper) { final int accountAge = DateTimeUtil.getDateDiffFromNowInDays(accountCreated); if (accountAge < 1) { return; } if (accountAge <= NEW_ACCOUNT_THRESHOLD) { this.generateNewUserInsights(accountId, accountAge); return; } final Optional<DeviceAccountPair> deviceAccountPairOptional = deviceReadDAO.getMostRecentSensePairByAccountId(accountId); if (!deviceAccountPairOptional.isPresent()) { return; } final Long internalDeviceId = deviceAccountPairOptional.get().internalDeviceId; if (featureFlipper.userFeatureActive(FeatureFlipper.DYNAMODB_DEVICE_DATA_INSIGHTS, accountId, Collections.EMPTY_LIST)) { LOGGER.info("Generating insights with DynamoDB for account {}", accountId); try { final String externalDeviceId = deviceAccountPairOptional.get().externalDeviceId; this.generateGeneralInsights(accountId, DeviceId.create(externalDeviceId), deviceDataDAODynamoDB, featureFlipper); return; } catch (Exception ex) { LOGGER.error("Caught exception generating insight for account using DynamoDB {}. {}", accountId, ex); } } if (featureFlipper.userFeatureActive(FeatureFlipper.INSIGHT_SCHEDULE_CBTI_V1, accountId, Collections.EMPTY_LIST)) { this.generateInsightCoach(accountId, DeviceId.create(internalDeviceId), deviceDataDAO); <START> } <END> this.generateGeneralInsights(accountId, DeviceId.create(internalDeviceId), deviceDataDAO, featureFlipper); }</code><technical_language>generating both? If not, put in if (featureflipped) do coach stuff, else do regular stuff</technical_language>

Target:
public void generateInsights(final Long accountId, final DateTime accountCreated, final RolloutClient featureFlipper) { final int accountAge = DateTimeUtil.getDateDiffFromNowInDays(accountCreated); if (accountAge < 1) { return; } if (accountAge <= NEW_ACCOUNT_THRESHOLD) { this.generateNewUserInsights(accountId, accountAge); return; } final Optional<DeviceAccountPair> deviceAccountPairOptional = deviceReadDAO.getMostRecentSensePairByAccountId(accountId); if (!deviceAccountPairOptional.isPresent()) { return; } final Long internalDeviceId = deviceAccountPairOptional.get().internalDeviceId; if (featureFlipper.userFeatureActive(FeatureFlipper.DYNAMODB_DEVICE_DATA_INSIGHTS, accountId, Collections.EMPTY_LIST)) { LOGGER.info("Generating insights with DynamoDB for account {}", accountId); try { final String externalDeviceId = deviceAccountPairOptional.get().externalDeviceId; this.generateGeneralInsights(accountId, DeviceId.create(externalDeviceId), deviceDataDAODynamoDB, featureFlipper); return; } catch (Exception ex) { LOGGER.error("Caught exception generating insight for account using DynamoDB {}. {}", accountId, ex); } } if (featureFlipper.userFeatureActive(FeatureFlipper.INSIGHT_SCHEDULE_CBTI_V1, accountId, Collections.EMPTY_LIST)) { } else { this.generateGeneralInsights(accountId, DeviceId.create(internalDeviceId), deviceDataDAO, featureFlipper); } }
Source:
<code>protected void createClass(BaseClass xclass) { xclass.addTextField(PARAMETER_NAME_PROPERTY, "Parameter name", 30); xclass.addTextAreaField(PARAMETER_DESCRIPTION_PROPERTY, "Parameter description", 40, 5); xclass.addBooleanField(PARAMETER_MANDATORY_PROPERTY, "Parameter mandatory", "yesno"); xclass.addTextField(PARAMETER_DEFAULT_VALUE_PROPERTY, "Parameter default value", 30); <START> xclass.addTextField(PARAMETER_TYPE_PROPERTY, "Parameter type", 30); <END> }</code><technical_language>30 a bit short for a types</technical_language>

Target:
protected void createClass(BaseClass xclass) { xclass.addTextField(PARAMETER_NAME_PROPERTY, "Parameter name", 30); xclass.addTextAreaField(PARAMETER_DESCRIPTION_PROPERTY, "Parameter description", 40, 5); xclass.addBooleanField(PARAMETER_MANDATORY_PROPERTY, "Parameter mandatory", "yesno"); xclass.addTextField(PARAMETER_DEFAULT_VALUE_PROPERTY, "Parameter default value", 30); xclass.addTextField(PARAMETER_TYPE_PROPERTY, "Parameter type", 60); }
Source:
<code>public void execute() throws MojoExecutionException { DockerClient client = null; try { final DefaultDockerClient.Builder builder = DefaultDockerClient.fromEnv() .readTimeoutMillis(NO_TIMEOUT); final String dockerHost = dockerHost(); <START> if (!isNullOrEmpty(dockerHost)) { <END> builder.uri(dockerHost); } client = builder.build(); execute(client); } catch (Exception e) { throw new MojoExecutionException("Exception caught", e); } finally { if (client != null) { client.close(); } } }</code><technical_language>empty if is <dockerHost> in configuration in pom.xml? If is empty, fall default is based DefaultDockerClient.fromEnv()</technical_language>

Target:
public void execute() throws MojoExecutionException { DockerClient client = null; try { final DefaultDockerClient.Builder builder = DefaultDockerClient.fromEnv() .readTimeoutMillis(NO_TIMEOUT); final String dockerHost = rawDockerHost(); if (!isNullOrEmpty(dockerHost)) { builder.uri(dockerHost); } client = builder.build(); execute(client); } catch (Exception e) { throw new MojoExecutionException("Exception caught", e); } finally { if (client != null) { client.close(); } } }
Source:
<code>protected IFile[] locateFiles(IProject p, final String fileName) throws CoreException { final ArrayList<IFile> ret = new ArrayList<IFile>(); <START> if( p != null && p.isAccessible() && p.isOpen()) { <END> p.accept(new IResourceVisitor(){ public boolean visit(IResource resource) throws CoreException { if( resource.getName().toLowerCase().equals(fileName)) { if( resource instanceof IFile) { ret.add((IFile)resource); } } return true; }}); } return (IFile[]) ret.toArray(new IFile[ret.size()]); }</code><technical_language>p.isOpen() is redundant. This is covered isAccessible()</technical_language>

Target:
protected IFile[] locateFiles(IProject p, final String fileName) throws CoreException { final ArrayList<IFile> ret = new ArrayList<IFile>(); if( p != null && p.isAccessible()) { p.accept(new IResourceVisitor(){ public boolean visit(IResource resource) throws CoreException { if( resource.getName().toLowerCase().equals(fileName)) { if( resource instanceof IFile) { ret.add((IFile)resource); } } return true; }}); } return (IFile[]) ret.toArray(new IFile[ret.size()]); }
Source:
<code>public void handle(HttpExchange t) throws IOException { String query = t.getRequestURI().getRawQuery(); String contextPath = t.getHttpContext().getPath(); ByteArrayOutputStream response = this.response.get(); response.reset(); OutputStreamWriter osw = new OutputStreamWriter(response, UTF_8); if ("/-/healthy".equals(contextPath)) { osw.write(HEALTHY_RESPONSE); } else { TextFormat.write004(osw, registry.filteredMetricFamilySamples(parseQuery(query))); } <START> osw.close(); <END> t.getResponseHeaders().set("Content-Type", TextFormat.CONTENT_TYPE_004); if (shouldUseCompression(t)) { t.getResponseHeaders().set("Content-Encoding", "gzip"); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0); final GZIPOutputStream os = new GZIPOutputStream(t.getResponseBody()); try { response.writeTo(os); } finally { os.close(); } } else { t.getResponseHeaders().set("Content-Length", String.valueOf(response.size())); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, response.size()); response.writeTo(t.getResponseBody()); } t.close(); }</code><technical_language>Is safe remove of these</technical_language>

Target:
public void handle(HttpExchange t) throws IOException { String query = t.getRequestURI().getRawQuery(); String contextPath = t.getHttpContext().getPath(); ByteArrayOutputStream response = this.response.get(); response.reset(); OutputStreamWriter osw = new OutputStreamWriter(response, Charset.forName("UTF-8")); if ("/-/healthy".equals(contextPath)) { osw.write(HEALTHY_RESPONSE); } else { TextFormat.write004(osw, registry.filteredMetricFamilySamples(parseQuery(query))); } osw.close(); t.getResponseHeaders().set("Content-Type", TextFormat.CONTENT_TYPE_004); if (shouldUseCompression(t)) { t.getResponseHeaders().set("Content-Encoding", "gzip"); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0); final GZIPOutputStream os = new GZIPOutputStream(t.getResponseBody()); try { response.writeTo(os); } finally { os.close(); } } else { t.getResponseHeaders().set("Content-Length", String.valueOf(response.size())); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, response.size()); response.writeTo(t.getResponseBody()); } t.close(); }
Source:
<code>public Mono<Void> renewSessionLock(String sessionId, Duration maxLockRenewalDuration) { if (isDisposed.get()) { throw logger.logExceptionAsError(new IllegalStateException( String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "getAutoRenewSessionLock"))); } else if (!receiverOptions.isSessionReceiver()) { <START> throw logger.logExceptionAsError(new IllegalStateException( <END> "Cannot renew session lock on a non-session receiver.")); } else if (maxLockRenewalDuration == null) { throw logger.logExceptionAsError(new NullPointerException("'maxLockRenewalDuration' cannot be null.")); } else if (maxLockRenewalDuration.isNegative()) { throw logger.logExceptionAsError(new IllegalArgumentException( "'maxLockRenewalDuration' cannot be negative.")); } else if (Objects.isNull(sessionId)) { throw logger.logExceptionAsError(new NullPointerException("'sessionId' cannot be null.")); } else if (sessionId.isEmpty()) { throw logger.logExceptionAsError(new IllegalArgumentException("'sessionId' cannot be empty.")); } final LockRenewalOperation operation = new LockRenewalOperation(sessionId, maxLockRenewalDuration, true, this::renewSessionLock); renewalContainer.addOrUpdate(sessionId, Instant.now().plus(maxLockRenewalDuration), operation); return operation.getCompletionOperation(); }</code><technical_language>question</technical_language>

Target:
public Mono<Void> renewSessionLock(String sessionId, Duration maxLockRenewalDuration) { if (isDisposed.get()) { return monoError(logger, new IllegalStateException( String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "getAutoRenewSessionLock"))); } else if (!receiverOptions.isSessionReceiver()) { return monoError(logger, new IllegalStateException( "Cannot renew session lock on a non-session receiver.")); } else if (maxLockRenewalDuration == null) { return monoError(logger, new NullPointerException("'maxLockRenewalDuration' cannot be null.")); } else if (maxLockRenewalDuration.isNegative()) { return monoError(logger, new IllegalArgumentException( "'maxLockRenewalDuration' cannot be negative.")); } else if (Objects.isNull(sessionId)) { return monoError(logger, new NullPointerException("'sessionId' cannot be null.")); } else if (sessionId.isEmpty()) { return monoError(logger, new IllegalArgumentException("'sessionId' cannot be empty.")); } final LockRenewalOperation operation = new LockRenewalOperation(sessionId, maxLockRenewalDuration, true, this::renewSessionLock); renewalContainer.addOrUpdate(sessionId, Instant.now().plus(maxLockRenewalDuration), operation); return operation.getCompletionOperation(); }
Source:
<code>public String getDocumentation() { <START> return "?"; <END> }</code><technical_language>@ctsims stab this</technical_language>

Target:
public String getDocumentation() { return getDocHeader() + "Behavior: Returns the current index of the given reference. \n" + "Return: the greatest extant multiplicity of the reference. \n" + "Arguments: The reference to be checked, or none for current position " + "Example: position(/data/repeat) returns '2' if two iterations have been created"; }
Source:
<code><START> public record InputRequireThisRecordAsTopLevel(int x, int y) { <END> private static int i; public InputRequireThisRecordAsTopLevel { method1(); method2(42); method3(); } InputRequireThisRecordAsTopLevel(int x) { this(x,42); method1(); } public static int getI() { return i; } public static void setI(int i) { InputRequireThisRecordAsTopLevel.i = i; } void method1() { setI(3); } void method2(int i) { i++; this.setI(i); method1(); try { this.method1(); } catch (RuntimeException e) { e.toString(); } this.setI(this.getI() - 1); Integer.toString(10); } <T> void method3() { setI(3); } void method4() { this.<String>method3(); } }</code><technical_language>Please add some usages of record components (x y) compact ctor method. record componens passed addInstanceMember method, do changes in this commit</technical_language>

Target:
public record InputRequireThisRecordAsTopLevel(int x, int y) { private static int i; public InputRequireThisRecordAsTopLevel { method1(); method2(42); method3(); int z = x + y + 2; System.out.println(y + x); } InputRequireThisRecordAsTopLevel(int x) { this(x,42); method1(); } public int getIPlusX() { return i + x; } public static void setI(int i) { InputRequireThisRecordAsTopLevel.i = i; } void method1() { i = 3 + y; int w = this.x; } void method2(int i) { i++; this.setI(i); method1(); try { this.method1(); } catch (RuntimeException e) { e.toString(); } this.setI(this.getIPlusX() - 1); Integer.toString(10); } <T> void method3() { setI(3); } void method4() { this.<String>method3(); } }
Source:
<code>public static boolean deleteDirectory(File dir) throws IOException { if (!dir.exists() || !dir.isDirectory()) { throw new IOException("Could not delete directory '" + dir.getAbsolutePath() + "' (not a directory)"); } if (log.isDebugEnabled()) { log.debug("Deleting directory " + dir.getAbsolutePath()); } File[] fileList = dir.listFiles(); <START> if (fielList != null) { <END> for (File f : fileList) { if (f.isDirectory()) { deleteDirectory(f); } boolean success = f.delete(); if (log.isDebugEnabled()) { log.debug(" deleting " + f.getName() + " : " + (success ? "ok" : "failed")); } if (!success) { f.deleteOnExit(); } } } boolean success = dir.delete(); if (!success) { log.warn(" ...could not remove directory: " + dir.getAbsolutePath()); dir.deleteOnExit(); } if (success && log.isDebugEnabled()) { log.debug(" ...and directory itself"); } return success; }</code><technical_language>typo here. Please fix</technical_language>

Target:
public static boolean deleteDirectory(File dir) throws IOException { if (!dir.exists() || !dir.isDirectory()) { throw new IOException("Could not delete directory '" + dir.getAbsolutePath() + "' (not a directory)"); } if (log.isDebugEnabled()) { log.debug("Deleting directory " + dir.getAbsolutePath()); } File[] fileList = dir.listFiles(); if (fileList != null) { for (File f : fileList) { if (f.isDirectory()) { deleteDirectory(f); } boolean success = f.delete(); if (log.isDebugEnabled()) { log.debug(" deleting " + f.getName() + " : " + (success ? "ok" : "failed")); } if (!success) { f.deleteOnExit(); } } } boolean success = dir.delete(); if (!success) { log.warn(" ...could not remove directory: " + dir.getAbsolutePath()); dir.deleteOnExit(); } if (success && log.isDebugEnabled()) { log.debug(" ...and directory itself"); } return success; }
Source:
<code>public void testQueryDefinitionsFromKjar() throws Exception { String containerOne = "container-one"; <START> String containerTwo = "container-two"; <END> KieServerAssert.assertSuccess(client.createContainer(containerOne, new KieContainerResource(containerOne, releaseIdKjarOne))); Map<String, QueryDefinition> queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); Assertions.assertThat(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)).isNull(); KieServerAssert.assertSuccess(client.createContainer(containerTwo, new KieContainerResource(containerTwo, releaseIdKjarTwo))); queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); KieServerAssert.assertSuccess(client.disposeContainer(containerOne)); queriesMap = retrieveQueryDefinitions(); Assertions.assertThat(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)).isNull(); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); KieServerAssert.assertSuccess(client.createContainer(containerOne, new KieContainerResource(containerOne, releaseIdKjarOne))); queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); }</code><technical_language>containers IDs private constants for a class avoid code duplicity in tests</technical_language>

Target:
public void testQueryDefinitionsFromKjar() throws Exception { String containerIdKjarOne = "container-one"; String containerIdKjarTwo = "container-two"; KieServerAssert.assertSuccess(client.createContainer(containerIdKjarOne, new KieContainerResource(containerIdKjarOne, releaseIdKjarOne))); Map<String, QueryDefinition> queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); Assertions.assertThat(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)).isNull(); KieServerAssert.assertSuccess(client.createContainer(containerIdKjarTwo, new KieContainerResource(containerIdKjarTwo, releaseIdKjarTwo))); queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); KieServerAssert.assertSuccess(client.disposeContainer(containerIdKjarOne)); queriesMap = retrieveQueryDefinitions(); Assertions.assertThat(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)).isNull(); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); KieServerAssert.assertSuccess(client.createContainer(containerIdKjarOne, new KieContainerResource(containerIdKjarOne, releaseIdKjarOne))); queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); }
Source:
<code>private void checkUnsupportedIssueStatus(Issue issue) throws AphroditeException { if (issue.getStatus() == IssueStatus.CREATED) { throw new AphroditeException("bugzila not insist on the CREATED status!"); <START> } <END> }</code><technical_language>This error message sense. "Bugzilla issues do support IssueStatus CREATED"</technical_language>

Target:
private void checkUnsupportedIssueStatus(Issue issue) throws AphroditeException { if (issue.getStatus() == IssueStatus.CREATED) { throw new AphroditeException("bugzilla not insist on the CREATED status! it is not found in the bugzilla status"); } }
Source:
<code>public boolean isConnectedToMobileNetwork() { int simState = telephonyManager.getSimState(); <START> if (simState == TelephonyManager.SIM_STATE_READY) { <END> NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); return networkInfo != null && networkInfo.isConnected(); } return false; }</code><technical_language>this is if sim is ready? isConnected is true, isConnectedToWifi false isConnectedToMobileNetwork false</technical_language>

Target:
public boolean isConnectedToMobileNetwork() { NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); return networkInfo != null && networkInfo.isConnected(); }
Source:
<code>protected FormValidation doTestConnection(URL ec2endpoint, boolean useInstanceProfileForCredentials, String credentialsId, String privateKey, String roleArn, String roleSessionName, String region) throws IOException, ServletException { Jenkins.get().checkPermission(Jenkins.ADMINISTER); try { AWSCredentialsProvider credentialsProvider = createCredentialsProvider(useInstanceProfileForCredentials, credentialsId, roleArn, roleSessionName, region); AmazonEC2 ec2 = AmazonEC2Factory.getInstance().connect(credentialsProvider, ec2endpoint); ec2.describeInstances(); if (privateKey == null) <START> return FormValidation.error("Private key is not specified. Please fill up the private key field with a valid one."); <END> if (privateKey.trim().length() > 0) { EC2PrivateKey pk = new EC2PrivateKey(privateKey); if (pk.find(ec2) == null) return FormValidation .error("The EC2 key pair private key isn't registered to this EC2 region (fingerprint is " + pk.getFingerprint() + ")"); } return FormValidation.ok(Messages.EC2Cloud_Success()); } catch (AmazonClientException e) { LOGGER.log(Level.WARNING, "Failed to check EC2 credential", e); return FormValidation.error(e.getMessage()); } }</code><technical_language>suggestion return FormValidation.error("Private key is specified. Please fill private key field a valid one.");</technical_language>

Target:
protected FormValidation doTestConnection(URL ec2endpoint, boolean useInstanceProfileForCredentials, String credentialsId, String privateKey, String roleArn, String roleSessionName, String region) throws IOException, ServletException { Jenkins.get().checkPermission(Jenkins.ADMINISTER); try { AWSCredentialsProvider credentialsProvider = createCredentialsProvider(useInstanceProfileForCredentials, credentialsId, roleArn, roleSessionName, region); AmazonEC2 ec2 = AmazonEC2Factory.getInstance().connect(credentialsProvider, ec2endpoint); ec2.describeInstances(); if (privateKey == null) return FormValidation.error("Private key is not specified. Please fill the private key field with a valid one."); if (privateKey.trim().length() > 0) { EC2PrivateKey pk = new EC2PrivateKey(privateKey); if (pk.find(ec2) == null) return FormValidation .error("The EC2 key pair private key isn't registered to this EC2 region (fingerprint is " + pk.getFingerprint() + ")"); } return FormValidation.ok(Messages.EC2Cloud_Success()); } catch (AmazonClientException e) { LOGGER.log(Level.WARNING, "Failed to check EC2 credential", e); return FormValidation.error(e.getMessage()); } }
Source:
<code>public HashSet<String> getAllHandlesFromIndex() { <START> HashSet<String> handlesFromStoreageIndex = new HashSet<>(); <END> try { String allHandlesStr = get(STORE_KEY_INDEX_OF_HANDLES); logger.debug("All available handles: {}", allHandlesStr); if (allHandlesStr == null) { return handlesFromStoreageIndex; } return gson.fromJson(allHandlesStr, HashSet.class); } catch (RuntimeException storeNotAvailable) { return handlesFromStoreageIndex; } }</code><technical_language>Set<String></technical_language>

Target:
public Set<String> getAllHandlesFromIndex() { Set<String> handlesFromStoreageIndex = new HashSet<>(); try { String allHandlesStr = get(STORE_KEY_INDEX_OF_HANDLES); logger.debug("All available handles: {}", allHandlesStr); if (allHandlesStr == null) { return handlesFromStoreageIndex; } return gson.fromJson(allHandlesStr, HashSet.class); } catch (RuntimeException storeNotAvailable) { return handlesFromStoreageIndex; } }
Source:
<code>public List<String> getSSTablesForKey(String key, boolean hexFormat) { log(" getSSTablesForKey(String key)"); MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>(); queryParams.add("key", key); if (hexFormat) { queryParams.add("hf", "True"); <START> } <END> return client.getListStrValue("column_family/sstables/by_key/" + getCFName(), queryParams); }</code><technical_language>hf? a more descriptive name? "format=text" "format=hex"</technical_language>

Target:
public List<String> getSSTablesForKey(String key, boolean hexFormat) { log(" getSSTablesForKey(String key)"); MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>(); queryParams.add("key", key); if (hexFormat) { queryParams.add("format", "hex"); } return client.getListStrValue("column_family/sstables/by_key/" + getCFName(), queryParams); }
Source:
<code>public void testValidationErrorValue() { SWTBotVSMEditor odesignEditor = openViewpointSpecificationModel(VSM); bot.editorByTitle(VSM).setFocus(); SWTBotTree tree = odesignEditor.bot().tree(); SWTBotTreeItem <START> group = <END> tree.expandNode(ODESIGN); SWTBotUtils.clickContextMenu(tree, "Validate"); bot.button("OK").click(); assertTrue("Empty Name error does not appear in the problems view.", checkProblemValue()); }</code><technical_language>group is unused variable</technical_language>

Target:
public void testValidationErrorValue() { SWTBotVSMEditor odesignEditor = openViewpointSpecificationModel(VSM); bot.editorByTitle(VSM).setFocus(); SWTBotTree tree = odesignEditor.bot().tree(); SWTBotUtils.clickContextMenu(tree, "Validate"); bot.button("OK").click(); checkIconNodeInvalidate(odesignEditor, tree); assertTrue("Empty Name error does not appear in the problems view.", checkProblemValue()); }
Source:
<code>public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if (responses.size() == 0) { return ""; } StringBuilder csv = new StringBuilder(); StringBuilder fragments = new StringBuilder(); List<String> options = constSumOptions; Map<String, List<Integer>> optionPoints = generateOptionPointsMapping(responses); DecimalFormat df = new DecimalFormat("#.##"); for (Entry<String, List<Integer>> entry : optionPoints.entrySet()) { String option; if (distributeToRecipients) { String teamName = bundle.getTeamNameForEmail(entry.getKey()); String recipientName = bundle.getNameForEmail(entry.getKey()); option = Sanitizer.sanitizeForCsv(teamName) + "," + Sanitizer.sanitizeForCsv(recipientName); } else { option = Sanitizer.sanitizeForCsv(options.get(Integer.parseInt(entry.getKey()))); } List<Integer> points = entry.getValue(); double average = computeAverage(points); fragments.append(option).append(',') .append(df.format(average)).append(Const.EOL); } csv.append(distributeToRecipients ? "Team, Recipient" : "Option").append(", Average Points").append(Const.EOL) .append(fragments).append(Const.EOL); <START> return csv.toString(); <END> }</code><technical_language>Similarly for csv variable</technical_language>

Target:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if (responses.isEmpty()) { return ""; } StringBuilder fragments = new StringBuilder(); List<String> options = constSumOptions; Map<String, List<Integer>> optionPoints = generateOptionPointsMapping(responses); DecimalFormat df = new DecimalFormat("#.##"); for (Entry<String, List<Integer>> entry : optionPoints.entrySet()) { String option; if (distributeToRecipients) { String teamName = bundle.getTeamNameForEmail(entry.getKey()); String recipientName = bundle.getNameForEmail(entry.getKey()); option = Sanitizer.sanitizeForCsv(teamName) + "," + Sanitizer.sanitizeForCsv(recipientName); } else { option = Sanitizer.sanitizeForCsv(options.get(Integer.parseInt(entry.getKey()))); } List<Integer> points = entry.getValue(); double average = computeAverage(points); fragments.append(option).append(',').append(df.format(average)).append(Const.EOL); } return (distributeToRecipients ? "Team, Recipient" : "Option") + ", Average Points" + Const.EOL + fragments + Const.EOL; }
Source:
<code>public void execute() { for (Compressor compressor : compressors) { if (compressor.getCompressorNotConnectedFault() || compressor.getCompressorNotConnectedStickyFault() || !compressor.enabled()) { updateStatus(compressor.getName(), SystemStatus.FAIL, new Exception("COMPRESSOR NOT CONNECTED")); } else if (compressor.getCompressorShortedFault() || compressor.getCompressorShortedStickyFault()) { updateStatus(compressor.getName(), SystemStatus.FAIL, new Exception("COMPRESSOR SHORTED")); } else if (compressor.getCompressorCurrentTooHighFault() || compressor.getCompressorCurrentTooHighStickyFault()) { updateStatus(compressor.getName(), SystemStatus.FAIL, new Exception("CURRENT TOO HIGH")); <START> } else if (compressor.getPressureSwitchValue()) { END> updateStatus(compressor.getName(), SystemStatus.FAIL, new Exception("LOW PRESSURE")); } } }</code><technical_language>check this</technical_language>

Target:
public void execute() { for (Compressor compressor : compressors) { if (compressor.getCompressorNotConnectedFault() || compressor.getCompressorNotConnectedStickyFault() || !compressor.enabled()) { updateStatusFail(compressor.getName(), new Exception("COMPRESSOR NOT CONNECTED")); } else if (compressor.getCompressorShortedFault() || compressor.getCompressorShortedStickyFault()) { updateStatusFail(compressor.getName(), new Exception("COMPRESSOR SHORTED")); } else if (compressor.getCompressorCurrentTooHighFault() || compressor.getCompressorCurrentTooHighStickyFault()) { updateStatusFail(compressor.getName(), new Exception("CURRENT TOO HIGH")); } else if (compressor.getPressureSwitchValue()) { updateStatusFail(compressor.getName(), new Exception("LOW PRESSURE")); } } }
Source:
<code>private void setupLoggers() { try { final String logDir = PathManager.getLogPath() + File.separator + "SarosLogs"; final boolean isDebugMode = Boolean.getBoolean("saros.debug"); final Level logLevel = isDebugMode ? Level.ALL : Level.INFO; System.setProperty("log4j.configurationFile", LOG4J2_CONFIG_FILENAME); MainMapLookup.setMainArguments("logDir", logDir, "logLevel", logLevel.name()); <START> LoggerContext context = (LoggerContext) LogManager.getContext(false); <END> context.reconfigure(); } catch (RuntimeException e) { StatusLogger.getLogger().error("initializing loggers failed", e); e.printStackTrace(); } }</code><technical_language>this <LINK_0> call want</technical_language>

Target:
private void setupLoggers() { try { final String logDir = PathManager.getLogPath() + File.separator + "SarosLogs"; final boolean isDebugMode = Boolean.getBoolean("saros.debug"); final Level logLevel = isDebugMode ? Level.ALL : Level.INFO; MainMapLookup.setMainArguments("logDir", logDir, "logLevel", logLevel.name()); Configurator.initialize( null, ConfigurationSource.fromResource( LOG4J2_CONFIG_FILENAME, SarosComponent.class.getClassLoader())); } catch (RuntimeException e) { StatusLogger.getLogger().error("initializing loggers failed", e); e.printStackTrace(); } }
Source:
<code>private boolean hasOutputChanged(ChannelHandlerContext ctx, boolean first) { if (observeOutput) { if (lastChangeCheckTimeStamp != lastWriteTime) { lastChangeCheckTimeStamp = lastWriteTime; if (!first) { return true; } } Channel channel = ctx.channel(); Unsafe unsafe = channel.unsafe(); ChannelOutboundBuffer buf = unsafe.outboundBuffer(); if (buf != null) { int messageHashCode = System.identityHashCode(buf.current()); long pendingWriteBytes = buf.totalPendingWriteBytes(); long flushProgress = buf.currentProgress(); if (messageHashCode != lastMessageHashCode || <START> pendingWriteBytes != lastPendingWriteBytes || flushProgress != lastFlushProgress) { <END> lastMessageHashCode = messageHashCode; lastPendingWriteBytes = pendingWriteBytes; lastFlushProgress = flushProgress; if (!first) { return true; } } } } return false; }</code><technical_language>I perform assignment flushProgress check if expression avoid currentProgress() load happen pendingWriteBytes</technical_language>

Target:
private boolean hasOutputChanged(ChannelHandlerContext ctx, boolean first) { if (observeOutput) { if (lastChangeCheckTimeStamp != lastWriteTime) { lastChangeCheckTimeStamp = lastWriteTime; if (!first) { return true; } } Channel channel = ctx.channel(); Unsafe unsafe = channel.unsafe(); ChannelOutboundBuffer buf = unsafe.outboundBuffer(); if (buf != null) { int messageHashCode = System.identityHashCode(buf.current()); long pendingWriteBytes = buf.totalPendingWriteBytes(); if (messageHashCode != lastMessageHashCode || pendingWriteBytes != lastPendingWriteBytes) { lastMessageHashCode = messageHashCode; lastPendingWriteBytes = pendingWriteBytes; if (!first) { return true; } } long flushProgress = buf.currentProgress(); if (flushProgress != lastFlushProgress) { lastFlushProgress = flushProgress; if (!first) { return true; } } } } return false; }
Source:
<code>static void loadPreference() { final String pref = Preferences.get(PREF_KEY_INTERPOLATION, Nearest.name()); try { ScaleInterpolation.valueOf(pref).menuItem.setSelected(true); } catch (Exception e) { e.printStackTrace(); Nearest.menuItem.setSelected(true); <START> } <END> }</code><technical_language>This is a quibble entire is private class is tiny. separate loading of preference turning a ScaleInterpolation side effect of updating menu selection. other hand I guess this is pure function reads mutable source (Preferences), improvement. Regardless, log exception instead of printing shows in log. critical INFO priority I guess</technical_language>

Target:
static ScaleInterpolation loadPreference() { final String pref = Preferences.get(PREF_KEY_INTERPOLATION, Nearest.name()); try { return ScaleInterpolation.valueOf(pref); } catch (Exception e) { LOGGER.info("Illegal preference found for key " + PREF_KEY_INTERPOLATION + ": \"" + pref + "\". " + "Using Nearest instead."); return Nearest; } }
Source:
<code><START> private boolean applicableWithUncheckedConversion(JavaSymbol.MethodJavaSymbol candidate, JavaType callSite, List<JavaType> typeParams) { <END> return !candidate.isStatic() && isRawTypeOfParametrizedType(callSite) && typeParams.isEmpty(); }</code><technical_language>![MAJOR](<LINK_1> "applicableWithUncheckedConversion" a "static" method. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private static boolean applicableWithUncheckedConversion(JavaSymbol.MethodJavaSymbol candidate, JavaType callSite, List<JavaType> typeParams) { return !candidate.isStatic() && isRawTypeOfParametrizedType(callSite) && typeParams.isEmpty(); }
Source:
<code>public SoulBurn(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{2}{B}"); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); this.getSpellAbility().addEffect(new SoulBurnEffect()); VariableCost variableCost = this.getSpellAbility().getManaCostsToPay().getVariableCosts().get(0); if (variableCost instanceof VariableManaCost) { ((VariableManaCost) variableCost).setFilter(filterBlackOrRed); <START> ((VariableManaCost) variableCost).setFilter(filterBlackOrRed); <END> } }</code><technical_language>Identical statement twice</technical_language>

Target:
public SoulBurn(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{2}{B}"); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); this.getSpellAbility().addEffect(new SoulBurnEffect()); VariableCost variableCost = this.getSpellAbility().getManaCostsToPay().getVariableCosts().get(0); if (variableCost instanceof VariableManaCost) { ((VariableManaCost) variableCost).setFilter(filterBlackOrRed); } }
Source:
<code>public void action() throws Exception { <START> log("Create an remove an empty local node source with cron policy"); <END> createEmptyNodeSource(EMPTY_NODE_SOURCE_NAME); removeNodeSource(EMPTY_NODE_SOURCE_NAME); log("Create a local node source with " + NODES_NUMBER + " nodes with cron policy"); createNodeSource(NODE_SOURCE_NAME); log("Waiting for the cron policy to remove the nodes"); repeater.accept(NODES_NUMBER, () -> this.rmHelper.waitForAnyNodeEvent(RMEventType.NODE_REMOVED)); log("Waiting for the cron policy to add the nodes again"); RMTHelper.waitForNodesToBeUp(NODES_NUMBER, this.monitorsHandler); removeNodeSource(NODE_SOURCE_NAME); }</code><technical_language>"Create remove empty local node" sense</technical_language>

Target:
public void action() throws Exception { log("Create then remove an empty local node source with cron policy"); createEmptyNodeSource(EMPTY_NODE_SOURCE_NAME); removeNodeSource(EMPTY_NODE_SOURCE_NAME); log("Create a local node source with " + NODES_NUMBER + " nodes with cron policy"); createNodeSource(NODE_SOURCE_NAME); log("Waiting for the cron policy to remove the nodes"); repeater.accept(NODES_NUMBER, () -> this.rmHelper.waitForAnyNodeEvent(RMEventType.NODE_REMOVED)); log("Waiting for the cron policy to add the nodes again"); RMTHelper.waitForNodesToBeUp(NODES_NUMBER, this.monitorsHandler); removeNodeSource(NODE_SOURCE_NAME); }
Source:
<code>public String DESCRIPTION() { StringBuilder sb = new StringBuilder(); <START> sb.append("This MassBank record with Accession " + ACCESSION() + " contains the " + MS_TYPE()" mass spectrum" + " of '" + RECORD_TITLE().get(0) + "' with the InChIkey '" + link.getKey("INCHIKEY") + "'." <END> return sb.toString(); }</code><technical_language>This if is "+" missing " contains " + MS_TYPE()" mass spectrum" Yours, Steffen</technical_language>

Target:
public String DESCRIPTION() { StringBuilder sb = new StringBuilder(); sb.append("This MassBank record with Accession " + ACCESSION() + " contains the " + MS_TYPE() + " mass spectrum" + " of '" + RECORD_TITLE().get(0) + "' with the InChIkey '" + link.getKey("INCHIKEY") + "'." return sb.toString(); }
Source:
<code>public void getCondition_shouldFindConditionGivenValidId() { int conditionId = 1; <START> String uuid="2cc6880e-2c46-15e4-9038-a6c5e4d22fb7"; <END> String clinical_status = "INACTIVE"; String verification_status = "PROVISIONAL"; Condition condition = conditionService.getCondition(conditionId); Assert.assertEquals(clinical_status, condition.getClinicalStatus().toString()); Assert.assertEquals(verification_status, condition.getVerificationStatus().toString()); Assert.assertEquals(uuid, condition.getUuid()); }</code><technical_language>If variable once, is need for them. values expected</technical_language>

Target:
public void getCondition_shouldFindConditionGivenValidId() { Condition condition = conditionService.getCondition(1); Assert.assertEquals(ConditionClinicalStatus.INACTIVE, condition.getClinicalStatus()); Assert.assertEquals(ConditionVerificationStatus.PROVISIONAL, condition.getVerificationStatus()); Assert.assertEquals("2cc6880e-2c46-15e4-9038-a6c5e4d22fb7", condition.getUuid()); }
Source:
<code>private static Config loadNeo4jConfig( Path homeDir, Path configDir, String databaseName ) { <START> return fromFile( configDir.resolve( "neo4j.conf" ) ) <END> .withSetting( DatabaseManagementSystemSettings.active_database, databaseName ) .withHome( homeDir ).build(); }</code><technical_language>Constant for default config file name defined in Config class</technical_language>

Target:
private static Config loadNeo4jConfig( Path homeDir, Path configDir, String databaseName ) { return fromFile( configDir.resolve( Config.DEFAULT_CONFIG_FILE_NAME ) ) .withSetting( DatabaseManagementSystemSettings.active_database, databaseName ) .withHome( homeDir ).build(); }
Source:
<code>public Block getBlock(int[] positions, int positionCount) { checkArgument(outputPositionCount > 0, "outputPositionCount must be greater than zero"); checkState(outputRequired, "This stream reader doesn't produce output"); checkState(positionCount <= outputPositionCount, "Not enough values"); <START> if (allNulls) { <END> return new RunLengthEncodedBlock(outputType.createBlockBuilder(null, 1).appendNull().build(), outputPositionCount); } return makeOutputBlock(positions, positionCount, nullsAllowed && presentStream != null); }</code><technical_language>outputRequired implies outputType is null, good checkState(outputType != null, ...)</technical_language>

Target:
public Block getBlock(int[] positions, int positionCount) { checkArgument(outputPositionCount > 0, "outputPositionCount must be greater than zero"); checkState(outputRequired, "This stream reader doesn't produce output"); checkState(positionCount <= outputPositionCount, "Not enough values"); if (allNulls) { return new RunLengthEncodedBlock(outputType.createBlockBuilder(null, 1).appendNull().build(), outputPositionCount); } return buildOutputBlock(positions, positionCount, nullsAllowed && presentStream != null); }
Source:
<code>public ServiceContextImpl serviceContext(String name) { if (!enterBusy()) return null; try { <START> Collection<ServiceContextImpl> ctxs = Optional.ofNullable(lookupDeployedServiceId(name)) <END> .map(locServices::get).orElse(null); if (F.isEmpty(ctxs)) return null; for (ServiceContextImpl ctx : ctxs) { if (ctx.service() != null) return ctx; } return null; } finally { leaveBusy(); } }</code><technical_language>Evil</technical_language>

Target:
@Override public ServiceContextImpl serviceContext(String name) { Collection<ServiceContextImpl> ctxs; synchronized (locSvcs) { ctxs = locSvcs.get(name); } if (ctxs == null) return null; synchronized (ctxs) { if (ctxs.isEmpty()) return null; for (ServiceContextImpl ctx : ctxs) { if (ctx.service() != null) return ctx; } return null; } }
Source:
<code>private L findOrCreateCodelist(@Nonnull String codeList) { Optional<L> optionalCodeList = findCodelist(codeList); Tenant<?> currentTenant = getCurrentTenant(codeList).orElseThrow(this::warnAboutMissingTenant); <START> if (!optionalCodeList.isPresent()) { <END> Extension ext = getCodeListConfig(codeList); L cl = createCodeList(currentTenant, codeList); if (ext != null && !ext.isDefault()) { cl.getCodeListData().setName(ext.get(CONFIG_KEY_NAME).asString()); cl.getCodeListData().setDescription(ext.get(CONFIG_KEY_DESCRIPTION).asString()); cl.getCodeListData().setAutofill(ext.get(CONFIG_KEY_AUTOFILL).asBoolean()); } cl.getMapper().update(cl); return cl; } return optionalCodeList.get(); }</code><technical_language>invert if return immediatelly</technical_language>

Target:
private L findOrCreateCodelist(@Nonnull String codeList) { Optional<L> optionalCodeList = findCodelist(codeList); Tenant<?> currentTenant = getCurrentTenant(codeList).orElseThrow(this::warnAboutMissingTenant); if (optionalCodeList.isPresent()) { return optionalCodeList.get(); } Extension ext = getCodeListConfig(codeList); L cl = createCodeList(currentTenant, codeList); if (ext != null && !ext.isDefault()) { cl.getCodeListData().setName(ext.get(CONFIG_KEY_NAME).asString()); cl.getCodeListData().setDescription(ext.get(CONFIG_KEY_DESCRIPTION).asString()); cl.getCodeListData().setAutofill(ext.get(CONFIG_KEY_AUTOFILL).asBoolean()); } cl.getMapper().update(cl); return cl; }
Source:
<code>void swapTableViewPointer(long handoverTableViewPointer) { try { table = query.importHandoverTableView(handoverTableViewPointer, realm.sharedGroupManager.getNativePointer()); isCompleted = true; } catch (BadVersionException e) { <START> throw new IllegalStateException("Caller and Worker SharedGroup should have been the same version"); <END> } }</code><technical_language>Users a SharedGroup is - know</technical_language>

Target:
void swapTableViewPointer(long handoverTableViewPointer) { try { table = query.importHandoverTableView(handoverTableViewPointer, realm.sharedGroupManager.getNativePointer()); isCompleted = true; } catch (BadVersionException e) { throw new IllegalStateException("Caller and Worker Realm should have been at the same version"); } }
Source:
<code>public void run() { try{ <START> while (fsRunning && shouldCacheCleanerRun && isLeader()) { <END> long lastDeletedEpochSec = HdfsVariables.getRetryCacheCleanerEpoch(); long toBeDeletedEpochSec = lastDeletedEpochSec + 1L; cleanerLog.debug("Current epoch "+(System.currentTimeMillis()/1000)+ " Last deleted epoch is " + lastDeletedEpochSec + " To be deleted epoch "+toBeDeletedEpochSec); if (toBeDeletedEpochSec < ((timer.now() - entryExpiryMillis) / 1000)) { int countDeleted = deleteAllForEpoch(toBeDeletedEpochSec); HdfsVariables.setRetryCacheCleanerEpoch(toBeDeletedEpochSec); cleanerLog.debug("Deleted "+countDeleted+" entries for epoch "+toBeDeletedEpochSec); continue; } else { Thread.sleep(1000); } } } catch (Throwable e) { if (e instanceof InterruptedException) { cleanerLog.warn("RetryCacheCleaner Interrupted"); } else { cleanerLog.error("Exception in RetryCacheCleaner: ", e); } } }</code><technical_language>if NN is leader thread stop inmediatly restarted if NN leader</technical_language>

Target:
public void run() { while (fsRunning && shouldCacheCleanerRun) { try { if (isLeader()) { long lastDeletedEpochSec = HdfsVariables.getRetryCacheCleanerEpoch(); long toBeDeletedEpochSec = lastDeletedEpochSec + 1L; if (toBeDeletedEpochSec < ((timer.now() - entryExpiryMillis) / 1000)) { cleanerLog.debug("Current epoch " + (System.currentTimeMillis() / 1000) + " Last deleted epoch is " + lastDeletedEpochSec + " To be deleted epoch " + toBeDeletedEpochSec); int countDeleted = deleteAllForEpoch(toBeDeletedEpochSec); HdfsVariables.setRetryCacheCleanerEpoch(toBeDeletedEpochSec); cleanerLog.debug("Deleted " + countDeleted + " entries for epoch " + toBeDeletedEpochSec); continue; } } Thread.sleep(1000); } catch (Exception e) { if (e instanceof InterruptedException) { cleanerLog.warn("RetryCacheCleaner Interrupted"); return; } else { cleanerLog.warn("Exception in RetryCacheCleaner: ", e); } } } }
Source:
<code>protected boolean internalUnaryEvaluation(String rawExpression, Object resultValue, Class<?> resultClass, boolean skipEmptyString) { if (rawExpression != null && skipEmptyString && rawExpression.isEmpty()) { return true; } AtomicReference<FEELEvent> errorHolder = new AtomicReference<>(); FEEL feel = newFeelEvaluator(errorHolder); EvaluationContext evaluationContext = newEvaluationContext(); List<UnaryTest> unaryTests = feel.evaluateUnaryTests(rawExpression); FEELEvent errorEvent = errorHolder.get(); <START> if (errorEvent != null) { <END> String detailedError = errorEvent.getMessage(); throw new IllegalArgumentException("Impossible to parse the expression '" + rawExpression + "': " + detailedError); } return unaryTests.stream() .allMatch(unaryTest -> Optional .ofNullable(unaryTest.apply(evaluationContext, resultValue)) .orElse(false)); }</code><technical_language>Do need check SyntaxErrorEvent here? Asking of internalLiteralEvaluation implementation</technical_language>

Target:
protected boolean internalUnaryEvaluation(String rawExpression, Object resultValue, Class<?> resultClass, boolean skipEmptyString) { if (rawExpression != null && skipEmptyString && rawExpression.isEmpty()) { return true; } EvaluationContext evaluationContext = newEvaluationContext(); List<UnaryTest> unaryTests = executeAndVerifyErrors(feel -> feel.evaluateUnaryTests(rawExpression)); return unaryTests.stream() .allMatch(unaryTest -> Optional .ofNullable(unaryTest.apply(evaluationContext, resultValue)) .orElse(false)); }
Source:
<code>public void testAdminLogQuery() { ______TS("Test constructor with parameters"); List<String> versionList = new ArrayList<>(); versionList.add("5-44"); <START> ZonedDateTime startDateTime = LocalDateTime.of(1994, 5, 7, 15, 30, 12).atZone(Const.DEFAULT_TIME_ZONE); <END> long startTime = startDateTime.toInstant().toEpochMilli(); long endTime = startDateTime.plusYears(22).toInstant().toEpochMilli(); AdminLogQuery query = new AdminLogQuery(versionList, startTime, endTime); assertEquals(startTime, query.getStartTime()); assertEquals(endTime, query.getEndTime()); assertNotNull(query.getQuery()); ______TS("Test setTimePeriod"); query = new AdminLogQuery(versionList, null, null); assertEquals(0, query.getStartTime()); assertNotEquals(endTime, query.getStartTime()); query.setTimePeriod(startTime, endTime); assertEquals(startTime, query.getStartTime()); assertEquals(endTime, query.getEndTime()); assertNotNull(query.getQuery()); }</code><technical_language>LocalDateTime.of(int year, Month month, int dayOfMonth, int hour, int minute, int second) instead</technical_language>

Target:
public void testAdminLogQuery() { ______TS("Test constructor with parameters"); List<String> versionList = new ArrayList<>(); versionList.add("5-44"); ZonedDateTime startDateTime = LocalDateTime.of(1994, Month.MAY, 7, 15, 30, 12).atZone(ZoneId.of("UTC")); long startTime = startDateTime.toInstant().toEpochMilli(); long endTime = startDateTime.plusYears(22).toInstant().toEpochMilli(); AdminLogQuery query = new AdminLogQuery(versionList, startTime, endTime); assertEquals(startTime, query.getStartTime()); assertEquals(endTime, query.getEndTime()); assertNotNull(query.getQuery()); ______TS("Test setTimePeriod"); query = new AdminLogQuery(versionList, null, null); assertEquals(0, query.getStartTime()); assertNotEquals(endTime, query.getStartTime()); query.setTimePeriod(startTime, endTime); assertEquals(startTime, query.getStartTime()); assertEquals(endTime, query.getEndTime()); assertNotNull(query.getQuery()); }
Source:
<code>public void testListStandardDrives() throws Exception { Set<String> drives = client.listStandardDrives(); <START> assertNotNull(drives); <END> }</code><technical_language>if non-empty? empty</technical_language>

Target:
public void testListStandardDrives() throws Exception { Set<String> drives = client.listStandardDrives(); assertNotNull(drives); assertFalse(drives.isEmpty(), "standard drive list should not be empty"); }