auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void serializeHeader(ByteBuffer outputBuffer, long totalSize, int systemMetadataRelativeOffset, int userMetadataRelativeOffset, int dataRelativeOffset) { int startOffset = outputBuffer.position(); <START> outputBuffer.putShort((short)1); <END> outputBuffer.putLong(totalSize); outputBuffer.putInt(systemMetadataRelativeOffset); outputBuffer.putInt(userMetadataRelativeOffset); outputBuffer.putInt(dataRelativeOffset); Crc32 crc = new Crc32(); crc.update(outputBuffer.array(), startOffset, getHeaderSize() - Crc_Size); outputBuffer.putLong(crc.getValue()); }</code><technical_language>constant "Current_Format_Version=1" 1 is a magic number I guess this point "Current_Format_Version=MessageFormat.Message_Header_Version_V1;"</technical_language>

Target:
public static void serializeHeader(ByteBuffer outputBuffer, long totalSize, int systemMetadataRelativeOffset, int userMetadataRelativeOffset, int dataRelativeOffset) { int startOffset = outputBuffer.position(); outputBuffer.putShort(Message_Header_Version_V1); outputBuffer.putLong(totalSize); outputBuffer.putInt(systemMetadataRelativeOffset); outputBuffer.putInt(userMetadataRelativeOffset); outputBuffer.putInt(dataRelativeOffset); Crc32 crc = new Crc32(); crc.update(outputBuffer.array(), startOffset, getHeaderSize() - Crc_Size); outputBuffer.putLong(crc.getValue()); }
Source:
<code>public void processServer(Server server) throws Exception { final ThreadPoolExecutor executor = queryExecutorRepository.getExecutor(server); for (Query query : server.getQueries()) { <START> if(query.getQueryType() != Query.QueryType.NOTIFICATIONS) { <END> ProcessQueryThread pqt = new ProcessQueryThread(resultProcessor, server, query); try { executor.submit(pqt); } catch (RejectedExecutionException ree) { logger.error("Could not submit query {}. You could try to size the 'queryProcessorExecutor' to a larger size.", pqt, ree); } } } }</code><technical_language>if(query.getQueryType() == Query.QueryType.NOTIFICATIONS) { continue; } clearer</technical_language>

Target:
public void processServer(Server server) throws Exception { final ThreadPoolExecutor executor = queryExecutorRepository.getExecutor(server); for (Query query : server.getQueries()) { switch (query.getQueryType()) { case NOTIFICATIONS: SubscribeToNotificationsForQueryThread sqt = new SubscribeToNotificationsForQueryThread(server, query); try { executor.submit(sqt); } catch (RejectedExecutionException ree) { logger.error("Could not submit runnable for periodic subscription check {}. ", sqt, ree); } break; case POLL: ProcessQueryThread pqt = new ProcessQueryThread(resultProcessor, server, query); try { executor.submit(pqt); } catch (RejectedExecutionException ree) { logger.error("Could not submit query {}. You could try to size the 'queryProcessorExecutor' to a larger size.", pqt, ree); } break; } } }
Source:
<code>private void resolveDefault(ObjectNode schema, Property property) { schema.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.getTypeMapping().get(property.getType())); final ArrayNode enumList; final ArrayNode enumNames; <START> if (isStringListClass(property.getType())) { <END> ObjectNode items = schema.putObject(JsonSchemaConstants.TAG_ITEMS); items.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.TYPE_STRING); enumList = items.putArray(JsonSchemaConstants.TAG_ENUM); enumNames = items.putArray(JsonSchemaConstants.TAG_ENUM_NAMES); schema.put(JsonSchemaConstants.TAG_UNIQUE_ITEMS, "true"); } else { enumList = schema.putArray(JsonSchemaConstants.TAG_ENUM); enumNames = schema.putArray(JsonSchemaConstants.TAG_ENUM_NAMES); } addEnumsToProperty(enumList, enumNames, property); }</code><technical_language>I _isStringListClass()_ is required code for List<?>. code changed items.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.getTypeMapping().get(getListInnerClassName(property.getType()))));</technical_language>

Target:
private void resolveDefault(ObjectNode schema, Property property) { final ArrayNode enumList; final ArrayNode enumNames; if (isListClass(property.getType())) { schema.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.getTypeMapping().get(getListType())); ObjectNode items = schema.putObject(JsonSchemaConstants.TAG_ITEMS); items.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.getTypeMapping().get(getListInnerClassName(property.getType()))); enumList = items.putArray(JsonSchemaConstants.TAG_ENUM); enumNames = items.putArray(JsonSchemaConstants.TAG_ENUM_NAMES); } else { schema.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.getTypeMapping().get(property.getType())); enumList = schema.putArray(JsonSchemaConstants.TAG_ENUM); enumNames = schema.putArray(JsonSchemaConstants.TAG_ENUM_NAMES); } addEnumsToProperty(enumList, enumNames, property); }
Source:
<code>public Task fromWithCompletedBy(org.activiti.engine.task.Task internalTask, Task.TaskStatus status, String completedBy) { <START> TaskImpl task = (TaskImpl) from(internalTask, status); <END> task.setCompletedBy(completedBy); return task; }</code><technical_language>wondering if avoid this cast. extract a private method buildFromInternalTask takes org.activiti.engine.task.Task internalTask, Task.TaskStatus status parameters returns TaskImpl instead of Task. This avoid casting fromWithCandidates. do think</technical_language>

Target:
public Task fromWithCompletedBy(org.activiti.engine.task.Task internalTask, Task.TaskStatus status, String completedBy) { TaskImpl task = buildFromInternalTask(internalTask, status); task.setCompletedBy(completedBy); return task; }
Source:
<code>private void getHeaders(String storageId, String repositoryId, String packageId, String packageVersion, HttpServletResponse response) throws IOException, NoSuchAlgorithmException, ProviderImplementationException { Storage storage = configurationManager.getConfiguration().getStorage(storageId); Repository repository = storage.getRepository(repositoryId); if (!repository.isInService()) { logger.error("Repository is not in service..."); response.sendError(HttpStatus.SERVICE_UNAVAILABLE.value(), "The " + storageId + ":" + repositoryId + " repository is currently out of service."); return; } String fileName = String.format("%s.%s.nupkg", packageId, packageVersion); String path = String.format("%s/%s/%s", packageId, packageVersion, fileName); ArtifactInputStream is; try { is = (ArtifactInputStream) getArtifactManagementService().resolve(storageId, repositoryId, path); if (is == null) { logger.debug("Unable to find artifact by path " + path); response.setStatus(NOT_FOUND.value()); return; } } catch (Exception e) { logger.error(String.format("Failed to process Nuget get request: %s:%s:%s:%s", storageId, repositoryId, packageId, packageVersion), e); response.setStatus(INTERNAL_SERVER_ERROR.value()); return; } setHeaders(is, response, storageId, repositoryId, path, fileName); <START> logger.debug("Header Download succeeded."); <END> }</code><technical_language>This logging message removed</technical_language>

Target:
private void getHeaders(String storageId, String repositoryId, String packageId, String packageVersion, HttpServletResponse response) throws IOException, NoSuchAlgorithmException, ProviderImplementationException { Storage storage = configurationManager.getConfiguration().getStorage(storageId); Repository repository = storage.getRepository(repositoryId); if (!repository.isInService()) { logger.error("Repository is not in service..."); response.sendError(HttpStatus.SERVICE_UNAVAILABLE.value(), "The " + storageId + ":" + repositoryId + " repository is currently out of service."); return; } String fileName = String.format("%s.%s.nupkg", packageId, packageVersion); String path = String.format("%s/%s/%s", packageId, packageVersion, fileName); ArtifactInputStream is = getArtifactInputStream(storageId, repositoryId, packageId, packageVersion, response, path, fileName); if(is == null) { return; } setHeaders(is, response, storageId, repositoryId, path, fileName); }
Source:
<code><START> protected static boolean getBoolean(String boolString) { <END> checkBooleanString(boolString); return boolString.equalsIgnoreCase("true"); }</code><technical_language>This Boolean.parseBoolean(string);</technical_language>

Target:
protected static boolean getBoolean(String boolString) { return Boolean.parseBoolean(boolString); }
Source:
<code>public void setEntryCustomUrl(GerritTriggeredEvent event, Run r, String customUrl) { MemoryImprint pb = getMemoryImprint(event); if (pb != null) { Entry entry = pb.getEntry(r.getParent()); if (entry != null) { <START> logger.info("Recording custom URL for {}: {}", event, customUrl); <END> entry.setCustomUrl(customUrl); } } }</code><technical_language>this debug trace fix line 422 while ;)</technical_language>

Target:
public void setEntryCustomUrl(GerritTriggeredEvent event, Run r, String customUrl) { MemoryImprint pb = getMemoryImprint(event); if (pb != null) { Entry entry = pb.getEntry(r.getParent()); if (entry != null) { logger.trace("Recording custom URL for {}: {}", event, customUrl); entry.setCustomUrl(customUrl); } } }
Source:
<code>public ClusterSpecification getClusterSpecification(Configuration configuration) { checkNotNull(configuration); <START> final JobManagerProcessSpec jobManagerProcessSpec = JobManagerProcessUtils.processSpecFromConfig( <END> JobManagerProcessUtils.getConfigurationWithLegacyHeapSizeMappedToNewConfigOption( configuration, JobManagerOptions.TOTAL_PROCESS_MEMORY)); final int taskManagerMemoryMB = TaskExecutorProcessUtils .processSpecFromConfig(TaskExecutorProcessUtils.getConfigurationMapLegacyTaskManagerHeapSizeToConfigOption( configuration, TaskManagerOptions.TOTAL_PROCESS_MEMORY)) .getTotalProcessMemorySize() .getMebiBytes(); int slotsPerTaskManager = configuration.getInteger(TaskManagerOptions.NUM_TASK_SLOTS); return new ClusterSpecification.ClusterSpecificationBuilder() .setMasterProcessSpec(jobManagerProcessSpec) .setTaskManagerMemoryMB(taskManagerMemoryMB) .setSlotsPerTaskManager(slotsPerTaskManager) .createClusterSpecification(); }</code><technical_language>Unrelated: I tracking this method getConfigurationWithLegacyHeapSizeMappedToNewConfigOption lead to, find MemoryBackwardsCompatibilityUtils#getLegacyTaskManagerHeapMemoryIfExplicitlyConfigured is named "TaskManager" for JM & TM</technical_language>

Target:
public ClusterSpecification getClusterSpecification(Configuration configuration) { checkNotNull(configuration); final int jobManagerMemoryMB = JobManagerProcessUtils.processSpecFromConfigWithFallbackForLegacyHeap( configuration, JobManagerOptions.TOTAL_PROCESS_MEMORY) .getTotalProcessMemorySize() .getMebiBytes(); final int taskManagerMemoryMB = TaskExecutorProcessUtils .processSpecFromConfig(TaskExecutorProcessUtils.getConfigurationMapLegacyTaskManagerHeapSizeToConfigOption( configuration, TaskManagerOptions.TOTAL_PROCESS_MEMORY)) .getTotalProcessMemorySize() .getMebiBytes(); int slotsPerTaskManager = configuration.getInteger(TaskManagerOptions.NUM_TASK_SLOTS); return new ClusterSpecification.ClusterSpecificationBuilder() .setMasterMemoryMB(jobManagerMemoryMB) .setTaskManagerMemoryMB(taskManagerMemoryMB) .setSlotsPerTaskManager(slotsPerTaskManager) .createClusterSpecification(); }
Source:
<code>Grid createRow(final HostVLan hostVLan) { HorizontalPanel checkboxPanel = new HorizontalPanel(); checkboxPanel.setWidth("100%"); if (isSelectionAvailable) { checkboxPanel.add(getCheckBox()); } checkboxPanel.add(new Image(resources.splitRotateImage())); checkboxPanel.add(new Label(new HostVLanNameRenderer().render(hostVLan))); Grid row = createVlanRowColumn(checkboxPanel, hostVLan.getInterface().getIsManagement(), hostVLan.getNetworkName(), <START> createSyncPanel(hostVLan.getInterface().getNetworkImplementationDetails().isInSync()), <END> new Label(hostVLan.getAddress())); Style gridStyle = row.getElement().getStyle(); gridStyle.setBorderColor("white"); gridStyle.setBorderWidth(1, Unit.PX); gridStyle.setBorderStyle(BorderStyle.SOLID); return row; }</code><technical_language>strange consider null implementation details. get a situation if a VLAN device is configured host a network it? In case need this throw a null pointer exception. Please verify, if this situation reached, code dealing null implementation details common flows (say extracting createSyncPanel())</technical_language>

Target:
Grid createRow(final HostVLan hostVLan) { HorizontalPanel checkboxPanel = new HorizontalPanel(); checkboxPanel.setWidth("100%"); if (isSelectionAvailable) { checkboxPanel.add(getCheckBox()); } checkboxPanel.add(new Image(resources.splitRotateImage())); checkboxPanel.add(new Label(new HostVLanNameRenderer().render(hostVLan))); Grid row = createBaseVlanRow(checkboxPanel, hostVLan.getInterface().getIsManagement(), hostVLan.getNetworkName(), hostVLan.getInterface(), hostVLan.getAddress()); Style gridStyle = row.getElement().getStyle(); gridStyle.setBorderColor("white"); gridStyle.setBorderWidth(1, Unit.PX); gridStyle.setBorderStyle(BorderStyle.SOLID); return row; }
Source:
<code>public int hashCode() { MessageDigest md = null; try { <START> md = MessageDigest.getInstance("MD5"); <END> return ByteBuffer.wrap(md.digest(this.id)).getInt(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } }</code><technical_language>pretty slow! reason MD5 all? Arrays.hashCode()? If good reason MD5 for hashCode, please calculate in constructor. sure, if a good idea call MessageDigest.getInstance("MD5") for hash. Other crypto getInstance calls lead performance issues</technical_language>

Target:
public int hashCode() { return Arrays.hashCode(id); }
Source:
<code><START> public Set<ParseFailedException> merge(Set<ParseFailedException> a, Set<ParseFailedException> b) { <END> Set<ParseFailedException> ret = new HashSet<>(a); ret.addAll(b); return ret; }</code><technical_language>Guava Sets.union()</technical_language>

Target:
public Set<ParseFailedException> merge(Set<ParseFailedException> a, Set<ParseFailedException> b) { return Sets.union(a, b); }
Source:
<code>public String getGroupNames() { String groupNames = ""; if (groups.isEmpty()) return ""; <START> if (groups.size() == 1) <END> return groups.get(0).getName(); for (Group group: groups) { groupNames += group.getName() + ", "; } return groupNames.substring(0, groupNames.length() - 2); }</code><technical_language>Is this condition required? next block handle this case well</technical_language>

Target:
public String getGroupNames() { String groupNames = ""; if (groups.isEmpty()) return ""; for (Group group: groups) { groupNames += group.getName() + ", "; } return groupNames.substring(0, groupNames.length() - 2); }
Source:
<code>public EventForwarder() { url = Context.getConfig().getString("event.forward.url", "http://localhost/"); header = Context.getConfig().getString("event.forward.header", ""); <START> payloadParamName = Context.getConfig().getString("event.forward.paramMode.payloadParamName", "payload"); <END> additionalParams = Context.getConfig().getString("event.forward.paramMode.additionalParams", ""); }</code><technical_language>Please shorten config keys</technical_language>

Target:
public EventForwarder() { url = Context.getConfig().getString("event.forward.url", "http://localhost/"); header = Context.getConfig().getString("event.forward.header"); }
Source:
<code>private void setupWebView() { URLInterceptorWebViewClient client = new URLInterceptorWebViewClient(this, webview); client.setAllLinksAsExternal(isAllLinksExternal()); client.setActionListener(this); client.setPageStatusListener(this); <START> webview.getSettings().setDomStorageEnabled(true); <END> }</code><technical_language>this enabled in web views? If so, this moved initialization config in EdxWebView. move this start of method separate web view client configuration</technical_language>

Target:
private void setupWebView() { URLInterceptorWebViewClient client = new URLInterceptorWebViewClient(this, webview); client.setAllLinksAsExternal(isAllLinksExternal()); client.setActionListener(this); client.setPageStatusListener(this); }
Source:
<code>public void testReloadSslContextOnKeyStoreChange() throws Throwable { try { execute("select name from sys.nodes"); fail("Unknown certificate in the certificate chain"); } catch (Exception ignored) { } updateKeyStore( keyStoreFile, keyStore -> keyStore.setKeyEntry( "key", trustedCert.key(), EMPTY_PASS, new Certificate[]{trustedCert.cert()})); assertBusy(() -> { try { SQLResponse response = execute("select name from sys.nodes"); assertEquals(1, response.rowCount()); } catch (Exception e) { fail(); } <START> }, 30, TimeUnit.SECONDS); <END> }</code><technical_language>interval configurable in tests require time here</technical_language>

Target:
public void testReloadSslContextOnKeyStoreChange() throws Throwable { try { execute("select name from sys.nodes"); fail("Unknown certificate in the certificate chain"); } catch (Exception ignored) { } updateKeyStore( keyStoreFile, keyStore -> keyStore.setKeyEntry( "key", trustedCert.key(), EMPTY_PASS, new Certificate[]{trustedCert.cert()})); assertBusy(() -> { try { SQLResponse response = execute("select name from sys.nodes"); assertEquals(1, response.rowCount()); } catch (Exception e) { fail(); } }); }
Source:
<code>public List<SqlFunction> listFunctions(Session session) { <START> Collection<FunctionNamespaceManager<?>> managers = SystemSessionProperties.isListNonBuiltInFunctions(session) ? <END> functionNamespaceManagers.values() : ImmutableSet.of(builtInFunctionNamespaceManager); return managers.stream() .flatMap(manager -> manager.listFunctions().stream()) .filter(function -> !function.isHidden()) .collect(toImmutableList()); }</code><technical_language>Is convention static imports here</technical_language>

Target:
public List<SqlFunction> listFunctions(Session session) { Collection<FunctionNamespaceManager<?>> managers = isListBuiltInFunctionsOnly(session) ? ImmutableSet.of(builtInFunctionNamespaceManager) : functionNamespaceManagers.values(); return managers.stream() .flatMap(manager -> manager.listFunctions().stream()) .filter(function -> !function.isHidden()) .collect(toImmutableList()); }
Source:
<code>public Map<String, Object> calculateInputVariables(DelegateExecution execution) { ProcessExtensionModel extensions = processExtensionService.getExtensionsForId(execution.getProcessDefinitionId()); Map<String, Object> constants = calculateConstants(execution, extensions); <START> if (extensions.getExtensionsByProcessDefinitionId(execution.getProcessDefinitionId()).hasEmptyInputsMapping(execution.getCurrentActivityId())) { <END> return constants; } Map<String, Object> inboundVariables; if (!extensions.getExtensionsByProcessDefinitionId(execution.getProcessDefinitionId()).hasMapping(execution.getCurrentActivityId())) { inboundVariables = execution.getVariables(); } else { inboundVariables = calculateInputVariables(execution, extensions); } inboundVariables = expressionResolver.resolveExpressionsMap(new VariableScopeExpressionEvaluator(execution), inboundVariables); inboundVariables.putAll(constants); return inboundVariables; }</code><technical_language>I return Extension instead of ProcessExtensionModel providing process definitionId. modify signature of ProcessExtensionService.getExtensionsForId</technical_language>

Target:
public Map<String, Object> calculateInputVariables(DelegateExecution execution) { Extension extensions = processExtensionService.getExtensionsForId(execution.getProcessDefinitionId()); Map<String, Object> constants = calculateConstants(execution, extensions); if (extensions.hasEmptyInputsMapping(execution.getCurrentActivityId())) { return constants; } Map<String, Object> inboundVariables; if (!extensions.hasMapping(execution.getCurrentActivityId())) { inboundVariables = execution.getVariables(); } else { inboundVariables = calculateInputVariables(execution, extensions); } inboundVariables = expressionResolver.resolveExpressionsMap(new VariableScopeExpressionEvaluator(execution), inboundVariables); inboundVariables.putAll(constants); return inboundVariables; }
Source:
<code>public void getItems(Consumer<List<KieAssetsDropdownItem>> assetListConsumer) { List<KieAssetsDropdownItem> toAccept = new ArrayList<>(); <START> assetListConsumer.accept(toAccept); <END> }</code><technical_language>assetListConsumer.accept(Collections.emptyList())</technical_language>

Target:
public void getItems(Consumer<List<KieAssetsDropdownItem>> assetListConsumer) { assetListConsumer.accept(new ArrayList<>()); }
Source:
<code>private void verifyAppNexussAdIsDisplayed(AdsBaseObject ads){ <START> ads.scrollToSlot(AdsContent.INCONTENT_PLAYER); <END> Assertion.assertTrue(ads.getGptParams(AdsContent.INCONTENT_PLAYER, "data-gpt-slot-params").contains("appnexusAst"), "AppNexus ad param: appnexusAst is not present"); Assertion.assertTrue(ads.getGptParams(AdsContent.INCONTENT_PLAYER, "data-gpt-line-item-id").equals("4406759476"), "AppNexus ad line item id: 4406759476 is not present"); Assertion.assertTrue(ads.getGptParams(AdsContent.INCONTENT_PLAYER, "data-slot-result").equals("success"), "AppNexus slot result: success is not present"); }</code><technical_language>please, move this function (this is a part of verification :) )</technical_language>

Target:
private void verifyAppNexussAdIsDisplayed(AdsBaseObject ads){ ads.verifyLineItemId(AdsContent.INCONTENT_PLAYER, APPNEXUS_LINE_ITEM_ID); ads.verifySlotAttribute(AdsContent.INCONTENT_PLAYER, "data-gpt-slot-params", "appnexusAst"); ads.verifySlotAttribute(AdsContent.INCONTENT_PLAYER, "data-slot-result", "success"); }
Source:
<code>public void testDot() throws Exception { checkConfig.addAttribute("option", "NL"); checkConfig.addAttribute("tokens", "DOT"); final String[] expected = { "31:10: " + getCheckMessage(MSG_LINE_NEW, "."), }; <START> verify(checkConfig, getPath("InputSeparatorWrapAfter3904.java"), expected); <END> }</code><technical_language>Do input file names cryptic. Please rename file state purpose</technical_language>

Target:
public void testDot() throws Exception { checkConfig.addAttribute("option", "NL"); checkConfig.addAttribute("tokens", "DOT"); final String[] expected = { "31:10: " + getCheckMessage(MSG_LINE_NEW, "."), }; verify(checkConfig, getPath("InputSeparatorWrapForTestDot.java"), expected); }
Source:
<code>public Iterable<ConnectorIssue> analyze(MavenProject mavenProject){ List<ConnectorIssue> issues = Lists.newArrayList(super.analyze(mavenProject)); Collection<File> testFiles = FileUtils.listFiles(fileSystem.baseDir(), new WildcardFileFilter(PATH), TrueFileFilter.INSTANCE); if (testFiles.size() > 1) { issues.add(new ConnectorIssue(KEY, "More than one .gitignore file in project.")); } if(issues.isEmpty()){ try { File gitIgnoreFile = Iterables.find(testFiles,Predicates.equalTo(new File(fileSystem.baseDir(), PATH))); String gitIgnoreText = FileUtils.readFileToString(gitIgnoreFile, StandardCharsets.UTF_8); List<String> gitIgnoreElements = ImmutableList.copyOf(StringUtils.split(gitIgnoreText,'\n')); <START> List<String> l = new ArrayList<>(); <END> for (String notIncludedElement : Iterables.filter(REQUIRED_GITIGNORE_FIELDS, Predicates.and(Predicates.notNull(), Predicates.not(Predicates.in(gitIgnoreElements))))) { l.add(notIncludedElement); } if(!l.isEmpty()){ issues.add(new ConnectorIssue(KEY, String.format(".gitignore file in project is missing the following exclusions: '%s'.", l.toString().replaceAll("(^\\[|\\]$)", "")))); } }catch (IOException e) { Throwables.propagate(e); } } return issues; }</code><technical_language>l is a nice name for a variable ;-), purpose of it</technical_language>

Target:
public Iterable<ConnectorIssue> analyze(MavenProject mavenProject) { List<ConnectorIssue> issues = Lists.newArrayList(super.analyze(mavenProject)); if (issues.isEmpty()) { Collection<File> testFiles = FileUtils.listFiles(fileSystem.baseDir(), new WildcardFileFilter(PATH), TrueFileFilter.INSTANCE); if (testFiles.size() > 1) { issues.add(new ConnectorIssue(KEY, "More than one .gitignore file in project.")); } else { try { File gitIgnoreFile = Iterables.getOnlyElement(testFiles); List<String> gitIgnoreElements = FileUtils.readLines(gitIgnoreFile, StandardCharsets.UTF_8); Iterable<String> missingRequiredFields = Iterables.filter(REQUIRED_GITIGNORE_FIELDS, not(in(gitIgnoreElements))); if (!Iterables.isEmpty(missingRequiredFields)) { issues.add(new ConnectorIssue(KEY, String.format(".gitignore file in project is missing the following exclusions: '%s'.", Joiner.on(", ") .join(missingRequiredFields)))); } } catch (IOException e) { Throwables.propagate(e); } } } return issues; }
Source:
<code>public TaskReport run(TaskSource taskSource, Schema schema, int taskIndex, PageOutput output) { final RunnerTask task = taskSource.loadTask(RunnerTask.class); List<DecoderPlugin> decoderPlugins = newDecoderPlugins(task); ParserPlugin parserPlugin = newParserPlugin(task); final TransactionalFileInput fromFileInputPlugin = fileInputPlugin.open(task.getFileInputTaskSource(), taskIndex); TransactionalFileInput tran = PluginWrappers.transactionalFileInput(fromFileInputPlugin); try (CloseResource closer = new CloseResource(tran)) { try (AbortTransactionResource aborter = new AbortTransactionResource(tran)) { FileInput fileInput = Decoders.open(decoderPlugins, task.getDecoderTaskSources(), tran); closer.closeThis(fileInput); parserPlugin.run(task.getParserTaskSource(), schema, fileInput, output); Exec.getLogger(FileInputRunner.class).info( "Loading file with size bytes", fromFileInputPlugin.hintOfInputFileNameForLogging().orElse("-"), fromFileInputPlugin.hintOfInputFileExpectedSize().orElse(new Integer(0).longValue()) <START> ); <END> TaskReport report = tran.commit(); aborter.dontAbort(); return report; } } }</code><technical_language>need is **pass file name information Parser plugins** Parser plugins log parsing errors file names. I need log this line here. (Logging for testing fine. But, users long log messages if log here.)</technical_language>

Target:
public TaskReport run(TaskSource taskSource, Schema schema, int taskIndex, PageOutput output) { final RunnerTask task = taskSource.loadTask(RunnerTask.class); List<DecoderPlugin> decoderPlugins = newDecoderPlugins(task); ParserPlugin parserPlugin = newParserPlugin(task); final TransactionalFileInput tran = PluginWrappers.transactionalFileInput( fileInputPlugin.open(task.getFileInputTaskSource(), taskIndex)); try (CloseResource closer = new CloseResource(tran)) { try (AbortTransactionResource aborter = new AbortTransactionResource(tran)) { FileInput fileInput = Decoders.open(decoderPlugins, task.getDecoderTaskSources(), tran); closer.closeThis(fileInput); parserPlugin.run(task.getParserTaskSource(), schema, fileInput, output); TaskReport report = tran.commit(); aborter.dontAbort(); return report; } } }
Source:
<code>public PusherEvent prepareEvent(String event, String message) { try { Map receivedMessage = GSON.fromJson(message, Map.class); final String decryptedMessage = decryptMessage((String) receivedMessage.get("data")); receivedMessage.replace("data", decryptedMessage); return GSON.fromJson( GSON.toJson(receivedMessage), PusherEvent.class); } catch (AuthenticityException e1) { disposeSecretBoxOpener(); authenticate(); try { Map receivedMessage = GSON.fromJson(message, Map.class); final String decryptedMessage = decryptMessage((String) receivedMessage.get("data")); receivedMessage.replace("data", decryptedMessage); return GSON.fromJson( GSON.toJson(receivedMessage), PusherEvent.class); } catch (AuthenticityException e2) { <START> disposeSecretBoxOpener(); <END> notifyListenersOfDecryptFailure(event); } } return null; }</code><technical_language>happen next event if dispose of secret final attempt</technical_language>

Target:
public PusherEvent prepareEvent(String event, String message) { try { return decryptMessage(message); } catch (AuthenticityException e1) { disposeSecretBoxOpener(); authenticate(); try { return decryptMessage(message); } catch (AuthenticityException e2) { notifyListenersOfDecryptFailure(event, "Failed to decrypt message."); } } return null; }
Source:
<code>public static void doSignIn(String token) { switch (myConfig.getAuthType()) { case HTTP: case HTTP_LDAP: case CLIENT_SSL_CERT_LDAP: case CUSTOM_EXTENSION: Location.assign(loginRedirect(token)); break; case DEVELOPMENT_BECOME_ANY_ACCOUNT: Location.assign(selfRedirect("/become")); break; case OPENID_SSO: <START> singleSignOnPanel.authenticate(SignInMode.SIGN_IN, token); <END> break; case OPENID: new OpenIdSignInDialog(SignInMode.SIGN_IN, token, null).center(); break; case LDAP: case LDAP_BIND: new UserPassSignInDialog(token, null).center(); break; } }</code><technical_language>tab starts this line, spaces indent code</technical_language>

Target:
public static void doSignIn(String token) { switch (myConfig.getAuthType()) { case HTTP: case HTTP_LDAP: case CLIENT_SSL_CERT_LDAP: case CUSTOM_EXTENSION: Location.assign(loginRedirect(token)); break; case DEVELOPMENT_BECOME_ANY_ACCOUNT: Location.assign(selfRedirect("/become")); break; case OPENID_SSO: final RootPanel gBody = RootPanel.get("gerrit_body"); OpenIdSsoPanel singleSignOnPanel = new OpenIdSsoPanel(); gBody.add(singleSignOnPanel); singleSignOnPanel.authenticate(SignInMode.SIGN_IN, token); break; case OPENID: new OpenIdSignInDialog(SignInMode.SIGN_IN, token, null).center(); break; case LDAP: case LDAP_BIND: new UserPassSignInDialog(token, null).center(); break; } }
Source:
<code>public void testCompareWithTrackChanges() throws Exception { <START> TemporaryFolder tempFolder = new TemporaryFolder(); <END> File tmpFile1 = tempFolder.newFile("File1.xml"); File tmpFile2 = tempFolder.newFile("File2.xml"); File diffFile = tempFolder.newFile("Diff.xml"); File scriptFile = tempFolder.newFile("script.vbs"); String content = Lib.fileToString(getClass(), TEST_WORD_EDIT_FILE_NAME); Lib.writeStringToFile(content, tmpFile1); content = content.replace("methods", "functions"); Lib.writeStringToFile(content, tmpFile2); CompareData compareData = new CompareData(diffFile.getAbsolutePath(), scriptFile.getAbsolutePath()); compareData.add(tmpFile1.getAbsolutePath(), tmpFile2.getAbsolutePath()); VbaWordDiffGenerator diff = new VbaWordDiffGenerator(false, false, false, true, false); diff.generate(compareData); String theDiff = Lib.fileToString(diffFile); theDiff = removeDynamicInformation(theDiff); String expected = Lib.fileToString(getClass(), EXPECTED_WORD_DIFF_FILE_NAME); Assert.assertEquals(expected, theDiff); }</code><technical_language>Move this top of class add @Rule annotation. @Rule public TemporaryFolder tempFolder = new TemporaryFolder();</technical_language>

Target:
public void testCompareWithTrackChanges() throws Exception { File tmpFile1 = tempFolder.newFile("File1.xml"); File tmpFile2 = tempFolder.newFile("File2.xml"); File diffFile = tempFolder.newFile("Diff.xml"); File scriptFile = tempFolder.newFile("script.vbs"); String content = Lib.fileToString(getClass(), TEST_WORD_EDIT_FILE_NAME); Lib.writeStringToFile(content, tmpFile1); content = content.replace("methods", "functions"); Lib.writeStringToFile(content, tmpFile2); CompareData compareData = new CompareData(diffFile.getAbsolutePath(), scriptFile.getAbsolutePath()); compareData.add(tmpFile1.getAbsolutePath(), tmpFile2.getAbsolutePath()); VbaWordDiffGenerator diff = new VbaWordDiffGenerator(false, false, false, true, false); diff.generate(compareData); String theDiff = Lib.fileToString(diffFile); theDiff = removeDynamicInformation(theDiff); String expected = Lib.fileToString(getClass(), EXPECTED_WORD_DIFF_FILE_NAME); Assert.assertEquals(expected, theDiff); }
Source:
<code>public void deactivate(final int reason) { setProperlyConfigured(false); <START> logger.info("deactivate executed reason={}", reason); <END> }</code><technical_language>a debug trace</technical_language>

Target:
public void deactivate(final int reason) { setProperlyConfigured(false); logger.debug("deactivate executed reason={}", reason); }
Source:
<code>public static String getConnectionId(Connection connection) { String connectionId = null; try { DatabaseMetaData connectionMetaData = connection.getMetaData(); String productName = connectionMetaData.getDatabaseProductName(); if (connectionMetaData != null) { if (MY_SQL_PRODUCT_NAME.equals(productName)) { connectionId = connectionMetaData.getURL(); } else { connectionId = connectionMetaData.getUserName() + "@" + connectionMetaData.getURL(); } return (connectionMetaData.getUserName() != null ? connectionMetaData.getUserName().split("@")[0] : connectionMetaData.getUserName()) + "@" + connectionMetaData.getURL(); } } catch (SQLException ignore) { <START> log.debug("Failed to construct the connectionId ." + ignore.getMessage()); <END> } return connectionId; }</code><technical_language>this is code, is correct this. change this error log pass exception</technical_language>

Target:
public static String getConnectionId(Connection connection) { String connectionId = null; try { DatabaseMetaData connectionMetaData = connection.getMetaData(); String productName = connectionMetaData.getDatabaseProductName(); if (connectionMetaData != null) { if (MY_SQL_PRODUCT_NAME.equals(productName)) { connectionId = connectionMetaData.getURL(); } else { connectionId = connectionMetaData.getUserName() + "@" + connectionMetaData.getURL(); } return (connectionMetaData.getUserName() != null ? connectionMetaData.getUserName().split("@")[0] : connectionMetaData.getUserName()) + "@" + connectionMetaData.getURL(); } } catch (SQLException e) { log.error("Failed to construct the connectionId.", e); } return connectionId; }
Source:
<code>public void testFileTxnSnapLogMetrics() throws Exception { SyncRequestProcessor.setSnapCount(100); QuorumUtil util = new QuorumUtil(1); util.startAll(); byte[] data = new byte[500]; ZooKeeper zk = ClientBase.createZKClient(util.getConnString()); for (int i=0; i<150; i++){ zk.create("/path" + i, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } <START> Thread.sleep(500); <END> ServerMetrics.resetAll(); int leader = util.getLeaderServer(); util.shutdown(leader); util.start(leader); Map<String, Object> values = ServerMetrics.getAllValues(); Assert.assertEquals(1L, values.get("cnt_startup_txns_loaded")); Assert.assertThat((long)values.get("max_startup_txns_loaded"), greaterThan(0L)); Assert.assertEquals(1L, values.get("cnt_startup_txns_load_time")); Assert.assertThat((long)values.get("max_startup_txns_load_time"), greaterThanOrEqualTo(0L)); Assert.assertEquals(1L, values.get("cnt_startup_snap_load_time")); Assert.assertThat((long)values.get("max_startup_snap_load_time"), greaterThan(0L)); util.shutdownAll(); }</code><technical_language>do need this sleep ? This a flaky test in future, wait for a condition</technical_language>

Target:
public void testFileTxnSnapLogMetrics() throws Exception { SyncRequestProcessor.setSnapCount(100); QuorumUtil util = new QuorumUtil(1); util.startAll(); allCreatedLatch = new CountDownLatch(1); byte[] data = new byte[500]; ZooKeeper zk = ClientBase.createZKClient(util.getConnString()); for (int i=0; i<150; i++){ zk.create("/path" + i, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } if (null == zk.exists("/path149", new MockWatcher())) { allCreatedLatch.await(); } ServerMetrics.getMetrics().resetAll(); int leader = util.getLeaderServer(); util.shutdown(leader); util.start(leader); Map<String, Object> values = MetricsUtils.currentServerMetrics(); LOG.info("txn loaded during start up {}", values.get("max_startup_txns_loaded")); Assert.assertEquals(1L, values.get("cnt_startup_txns_loaded")); Assert.assertThat((long)values.get("max_startup_txns_loaded"), greaterThan(0L)); Assert.assertEquals(1L, values.get("cnt_startup_txns_load_time")); Assert.assertThat((long)values.get("max_startup_txns_load_time"), greaterThanOrEqualTo(0L)); Assert.assertEquals(1L, values.get("cnt_startup_snap_load_time")); Assert.assertThat((long)values.get("max_startup_snap_load_time"), greaterThan(0L)); util.shutdownAll(); }
Source:
<code>public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_USER_ATTR_DEF); <START> attr.setFriendlyName("ipAddresses"); <END> attr.setDisplayName("IP Addresses"); attr.setType(ArrayList.class.getName()); attr.setDescription("List of IP Addresses."); return attr; }</code><technical_language>correct name is 'IPAddresses' upper case for IP part</technical_language>

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_USER_ATTR_DEF); attr.setFriendlyName("IPAddresses"); attr.setDisplayName("IP Addresses"); attr.setType(ArrayList.class.getName()); attr.setDescription("List of IP Addresses."); return attr; }
Source:
<code>public void run() { try { ListenableFuture<LoadTest> clientFuture; NiftyClientChannel.Factory<? extends NiftyClientChannel> channelFactory; if (config.transport == TransportType.FRAMED) { channelFactory = new FramedClientChannel.Factory(); } else if (config.transport == TransportType.UNFRAMED) { channelFactory = new UnframedClientChannel.Factory(); } else { throw new IllegalStateException("Unknown transport"); <START> } <END> clientFuture = clientManager.createClient(HostAndPort.fromParts(config.serverAddress, config.serverPort), LoadTest.class, channelFactory, new Duration(config.connectTimeoutMilliseconds, TimeUnit.SECONDS), new Duration(config.sendTimeoutMilliseconds, TimeUnit.MILLISECONDS), new Duration(config.receiveTimeoutMilliseconds, TimeUnit.MILLISECONDS), "AsyncClientWorker", null); Futures.addCallback(clientFuture, new FutureCallback<LoadTest>() { @Override public void onSuccess(LoadTest result) { logger.info("Worker connected"); client = result; channel = clientManager.getNiftyChannel(client); channel.executeInIoThread(new Runnable() { @Override public void run() { fillRequestPipeline(client); } }); } @Override public void onFailure(Throwable t) { onConnectFailed(t); } }); } catch (Throwable t) { onConnectFailed(t); } }</code><technical_language>This code is repeated in SyncClientWorker also, put in a method</technical_language>

Target:
public void run() { try { ListenableFuture<LoadTest> clientFuture; clientFuture = clientManager.createClient(HostAndPort.fromParts(config.serverAddress, config.serverPort), LoadTest.class, channelFactory, new Duration(config.connectTimeoutMilliseconds, TimeUnit.SECONDS), new Duration(config.sendTimeoutMilliseconds, TimeUnit.MILLISECONDS), new Duration(config.receiveTimeoutMilliseconds, TimeUnit.MILLISECONDS), "AsyncClientWorker", null); Futures.addCallback(clientFuture, new FutureCallback<LoadTest>() { @Override public void onSuccess(LoadTest result) { logger.info("Worker connected"); client = result; channel = clientManager.getNiftyChannel(client); channel.executeInIoThread(new Runnable() { @Override public void run() { fillRequestPipeline(client); } }); } @Override public void onFailure(Throwable t) { onConnectFailed(t); } }); } catch (Throwable t) { onConnectFailed(t); } }
Source:
<code>private static boolean filter(DataFetchingEnvironment environment, EPackage ePackage) { boolean includeDefaultEPackages = Optional.ofNullable(environment.getArgument(INCLUDE_DEFAULT_EPACKAGES_ARG)) .filter(Boolean.class::isInstance) .map(Boolean.class::cast) .orElse(Boolean.FALSE) .booleanValue(); List<String> defaultNsURIs = new ArrayList<>(); defaultNsURIs.add("<LINK_22>"); defaultNsURIs.add("<LINK_0>"); defaultNsURIs.add("<LINK_8>"); defaultNsURIs.add("<LINK_17>"); defaultNsURIs.add("<LINK_5>"); defaultNsURIs.add("<LINK_20>"); defaultNsURIs.add("<LINK_6>"); defaultNsURIs.add("http:/ defaultNsURIs.add("http:/ defaultNsURIs.add("http:/ defaultNsURIs.add("<LINK_10>"); defaultNsURIs.add("<LINK_13>"); defaultNsURIs.add("<LINK_21>"); defaultNsURIs.add("<LINK_9>"); defaultNsURIs.add("<LINK_7>"); defaultNsURIs.add("<LINK_1>"); defaultNsURIs.add("<LINK_19>"); defaultNsURIs.add("<LINK_11>"); defaultNsURIs.add("<LINK_12>"); defaultNsURIs.add("<LINK_18>"); defaultNsURIs.add("<LINK_23>"); defaultNsURIs.add("<LINK_2>"); defaultNsURIs.add("<LINK_15>"); defaultNsURIs.add("<LINK_16>"); defaultNsURIs.add("<LINK_3>"); <START> defaultNsURIs.add("<LINK_14>"); END> defaultNsURIs.add("<LINK_4>"); return includeDefaultEPackages || !defaultNsURIs.contains(ePackage.getNsURI()); }</code><technical_language>defined a constant, a local list re-created invocation. initialized some external source (e.g. plugin.properties) instead of hard-coded</technical_language>

Target:
private static boolean filter(DataFetchingEnvironment environment, EPackage ePackage) { boolean includeDefaultEPackages = Optional.ofNullable(environment.getArgument(INCLUDE_DEFAULT_EPACKAGES_ARG)) .filter(Boolean.class::isInstance) .map(Boolean.class::cast) .orElse(Boolean.FALSE) .booleanValue(); String[] defaultMetamodels = SiriusGraphQLMessages.SiriusGraphQLUserEPackagesField_defaultMetamodels.split(DEFAULT_METAMODELS_SEPARATOR); return includeDefaultEPackages || !Arrays.asList(defaultMetamodels).contains(ePackage.getNsURI()); }
Source:
<code>public void authenticate_shouldAuthenticateUserWithAlternateScheme() { <START> Context.logout(); <END> Authenticated authenticated = Context.authenticate(new TestUsernameCredentials("admin")); Assert.assertEquals("test-scheme", authenticated.getAuthenticationScheme()); Assert.assertEquals(Context.getAuthenticatedUser().getUuid(), authenticated.getUser().getUuid()); Assert.assertEquals("admin", Context.getAuthenticatedUser().getUsername()); }</code><technical_language>Do need line? if get rid of it</technical_language>

Target:
public void authenticate_shouldAuthenticateUserWithAlternateScheme() { Authenticated authenticated = Context.authenticate(new TestUsernameCredentials("admin")); Assert.assertEquals("test-scheme", authenticated.getAuthenticationScheme()); Assert.assertEquals(Context.getAuthenticatedUser().getUuid(), authenticated.getUser().getUuid()); Assert.assertEquals("admin", Context.getAuthenticatedUser().getUsername()); }
Source:
<code>public TableStats getInputStats() { if (iterator != null) { inputStats.reset(); for (SeqScanExec scanner : scanners) { <START> TableStats scannerTableStsts = scanner.getInputStats(); <END> if (scannerTableStsts != null) { inputStats.merge(scannerTableStsts); } } } return inputStats; }</code><technical_language>Please fix errata</technical_language>

Target:
public TableStats getInputStats() { if (iterator != null) { inputStats.reset(); for (SeqScanExec scanner : scanners) { TableStats scannerTableStats = scanner.getInputStats(); if (scannerTableStats != null) { inputStats.merge(scannerTableStats); } } } return inputStats; }
Source:
<code>private String readId(String token, boolean isFloatingPoint) { <START> if (isFloatingPoint) { <END> return Double.valueOf(token).toString() + "d"; } else { return Long.valueOf(token).toString() + "l"; } }</code><technical_language>ditto. ternary isFloating ? ..</technical_language>

Target:
private String readId(String token, boolean isFloatingPoint) { return (isFloatingPoint ? Double.valueOf(token).toString() + "d" : Long.valueOf(token).toString() + "l"); }
Source:
<code>private void addExtraTestJar(LogicalPlan dag) { try { File tmp1 = File.createTempFile("tmp1", null); File tmp2 = File.createTempFile("tmp2", null); tmp1.deleteOnExit(); tmp2.deleteOnExit(); dag.addJarResource(tmp1.getAbsolutePath(), true); dag.addJarResource(tmp2.getAbsolutePath(), false); } catch (IOException e) { <START> LOG.error("Failed to create temporary file.", e); <END> } }</code><technical_language>throw exception instead of logging it? In fact catch Exception, calling function handle</technical_language>

Target:
private void addExtraTestJar(LogicalPlan dag) throws IOException { File tmp1 = File.createTempFile("tmp1", null); File tmp2 = File.createTempFile("tmp2", null); tmp1.deleteOnExit(); tmp2.deleteOnExit(); dag.addJarResource(tmp1.getAbsolutePath(), true); dag.addJarResource(tmp2.getAbsolutePath(), false); }
Source:
<code>private void validatePulse (DonationBackingForm donationBackingForm, Errors errors) { Integer pulse = null; Integer pulseMin = Integer.parseInt(utilController.getGeneralConfigValueByName("donation.donor.pulseMin")); Integer pulseMax = Integer.parseInt(utilController.getGeneralConfigValueByName("donation.donor.pulseMax")); if (donationBackingForm.getDonorPulse() != null) pulse = donationBackingForm.getDonorPulse(); <START> if (pulse != null){ <END> if (pulse == null || !(pulse >= pulseMin && pulse <= pulseMax)) errors.rejectValue("donation.donorPulse", "400", "Enter a value between "+ pulseMin + " to " + pulseMax); } }</code><technical_language>again</technical_language>

Target:
private void validatePulse (DonationBackingForm donationBackingForm, Errors errors) { Integer pulse = null; Integer pulseMin = Integer.parseInt(utilController.getGeneralConfigValueByName("donation.donor.pulseMin")); Integer pulseMax = Integer.parseInt(utilController.getGeneralConfigValueByName("donation.donor.pulseMax")); if (donationBackingForm.getDonorPulse() != null) pulse = donationBackingForm.getDonorPulse(); if (pulse != null && (pulse < pulseMin || pulse > pulseMax)){ errors.rejectValue("donation.donorPulse", "400", "Enter a value between "+ pulseMin + " to " + pulseMax); } }
Source:
<code>public SpongePassengerData setBaseVehicle(Entity value) { <START> this.baseVehicle = value; <END> return this; }</code><technical_language>checkNotNulls everywhere</technical_language>

Target:
public SpongePassengerData setBaseVehicle(Entity value) { this.baseVehicle = checkNotNull(value); return this; }
Source:
<code><START> private AuthenticationResult getTokenWithRefreshToken( <END> final AuthenticationRequest request, final String refreshToken) throws AuthenticationException { Logger.v(TAG, "Process refreshToken for " + request.getLogInfo() + " refreshTokenId:" + getTokenHash(refreshToken)); if (!mConnectionService.isConnectionAvailable()) { AuthenticationException authenticationException = new AuthenticationException( ADALError.DEVICE_CONNECTION_IS_NOT_AVAILABLE, "Connection is not available to refresh token"); Logger.w(TAG, "Connection is not available to refresh token", request.getLogInfo(), ADALError.DEVICE_CONNECTION_IS_NOT_AVAILABLE); throw authenticationException; } AuthenticationResult result = null; try { Oauth2 oauthRequest = new Oauth2(request, mWebRequest, mJWSBuilder); result = oauthRequest.refreshToken(refreshToken); if (result != null && StringExtensions.IsNullOrBlank(result.getRefreshToken())) { Logger.v(TAG, "Refresh token is not returned or empty"); result.setRefreshToken(refreshToken); } } catch (IOException | AuthenticationException exc) { Logger.e(TAG, "Error in refresh token for request:" + request.getLogInfo(), ExceptionExtensions.getExceptionMessage(exc), ADALError.AUTH_FAILED_NO_TOKEN, exc); AuthenticationException authException = new AuthenticationException( ADALError.AUTH_FAILED_NO_TOKEN, ExceptionExtensions.getExceptionMessage(exc), exc); throw authException; } return result; }</code><technical_language>separate original getTokenWithRefreshToken methods? cache update? without? please rename this one? confusing me. update java doc</technical_language>

Target:
private AuthenticationResult getTokenWithRefreshToken( final AuthenticationRequest request, final String refreshToken) throws AuthenticationException { Logger.v(TAG, "Process refreshToken for " + request.getLogInfo() + " refreshTokenId:" + getTokenHash(refreshToken)); if (!mConnectionService.isConnectionAvailable()) { AuthenticationException authenticationException = new AuthenticationException( ADALError.DEVICE_CONNECTION_IS_NOT_AVAILABLE, "Connection is not available to refresh token"); Logger.w(TAG, "Connection is not available to refresh token", request.getLogInfo(), ADALError.DEVICE_CONNECTION_IS_NOT_AVAILABLE); throw authenticationException; } final AuthenticationResult result; try { Oauth2 oauthRequest = new Oauth2(request, mWebRequest, mJWSBuilder); result = oauthRequest.refreshToken(refreshToken); if (result != null && StringExtensions.IsNullOrBlank(result.getRefreshToken())) { Logger.v(TAG, "Refresh token is not returned or empty"); result.setRefreshToken(refreshToken); } } catch (IOException | AuthenticationException exc) { Logger.e(TAG, "Error in refresh token for request:" + request.getLogInfo(), ExceptionExtensions.getExceptionMessage(exc), ADALError.AUTH_FAILED_NO_TOKEN, exc); AuthenticationException authException = new AuthenticationException( ADALError.AUTH_FAILED_NO_TOKEN, ExceptionExtensions.getExceptionMessage(exc), exc); throw authException; } return result; }