auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public MessageContext receive() { boolean connectionSuccess = checkAndTryConnect(); if (!connectionSuccess) { throw new SynapseException(idString + "Error while connecting to JMS provider. " + MessageProcessorConstants.STORE_CONNECTION_ERROR); } try { <START> Message message = consumer.receive(500); <END> if (message == null) { return null; } if (!(message instanceof ObjectMessage)) { logger.warn("JMS Consumer " + getId() + " did not receive a javax.jms.ObjectMessage"); message.acknowledge(); return null; } ObjectMessage msg = (ObjectMessage) message; String messageId = msg.getStringProperty(Constants.OriginalMessageID); if (!(msg.getObject() instanceof StorableMessage)) { logger.warn("JMS Consumer " + getId() + " did not receive a valid message."); message.acknowledge(); return null; } StorableMessage storableMessage = (StorableMessage) msg.getObject(); org.apache.axis2.context.MessageContext axis2Mc = store.newAxis2Mc(); MessageContext synapseMc = store.newSynapseMc(axis2Mc); synapseMc = MessageConverter.toMessageContext(storableMessage, axis2Mc, synapseMc); updateCache(message, synapseMc, messageId, false); if (logger.isDebugEnabled()) { logger.debug(getId() + " Received MessageId:" + messageId + " priority:" + message.getJMSPriority()); } return synapseMc; } catch (JMSException e) { logger.error("Cannot fetch messages from Store " + store.getName()); updateCache(null, null, "", true); cleanup(); return receive(); } }</code><technical_language>Do 500 is enough for average environment</technical_language>

Target:
public MessageContext receive() { boolean connectionSuccess = checkAndTryConnect(); if (!connectionSuccess) { throw new SynapseException(idString + "Error while connecting to JMS provider. " + MessageProcessorConstants.STORE_CONNECTION_ERROR); } try { Message message = consumer.receive(5000); if (message == null) { return null; } if (!(message instanceof ObjectMessage)) { logger.warn("JMS Consumer " + getId() + " did not receive a javax.jms.ObjectMessage"); message.acknowledge(); return null; } ObjectMessage msg = (ObjectMessage) message; String messageId = msg.getStringProperty(Constants.OriginalMessageID); if (!(msg.getObject() instanceof StorableMessage)) { logger.warn("JMS Consumer " + getId() + " did not receive a valid message."); message.acknowledge(); return null; } StorableMessage storableMessage = (StorableMessage) msg.getObject(); org.apache.axis2.context.MessageContext axis2Mc = store.newAxis2Mc(); MessageContext synapseMc = store.newSynapseMc(axis2Mc); synapseMc = MessageConverter.toMessageContext(storableMessage, axis2Mc, synapseMc); updateCache(message, synapseMc, messageId, false); if (logger.isDebugEnabled()) { logger.debug(getId() + " Received MessageId:" + messageId + " priority:" + message.getJMSPriority()); } return synapseMc; } catch (JMSException e) { logger.error("Cannot fetch messages from Store " + store.getName()); updateCache(null, null, "", true); cleanup(); return receive(); } }
Source:
<code>private void loadSmooshFileMetadata() { try { byte[] metadata = indexFileSource.readFile(SMOOSH_METADATA_FILE_NAME); BufferedReader in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(metadata))); String line = in.readLine(); if (line == null) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: first line should be version,maxChunkSize,numChunks, got null.")); } String[] splits = line.split(","); if (!"v1".equals(splits[0])) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: unknown version[%s], v1 is all I know.", splits[0])); } if (splits.length != 3) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: wrong number of splits[%d] in line[%s]", splits.length, line)); } numFiles = Integer.valueOf(splits[2]); <START> while ((line = in.readLine()) != null) { <END> splits = line.split(","); if (splits.length != 4) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: wrong number of splits[%d] in line[%s]", splits.length, line)); } columnSmoosh.put(splits[0], new SmooshFileMetadata(Integer.parseInt(splits[1]), Integer.parseInt(splits[2]), Integer.parseInt(splits[3]))); } } catch (IOException e) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, e); } }</code><technical_language>I personally prefer java while (true) { line = in.readLine(); if (line == null) { break; } ...... } personal preference strong opinion :)</technical_language>

Target:
private void loadSmooshFileMetadata() { try { byte[] metadata = indexFileSource.readFile(SMOOSH_METADATA_FILE_NAME); BufferedReader in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(metadata))); String line = in.readLine(); if (line == null) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: first line should be version,maxChunkSize,numChunks, got null.")); } String[] splits = line.split(","); if (!"v1".equals(splits[0])) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: unknown version[%s], v1 is all I know.", splits[0])); } if (splits.length != 3) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: wrong number of splits[%d] in line[%s]", splits.length, line)); } while (true) { line = in.readLine(); if (line == null) { break; } splits = line.split(","); if (splits.length != 4) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: wrong number of splits[%d] in line[%s]", splits.length, line)); } columnSmoosh.put(splits[0], new SmooshFileMetadata(Integer.parseInt(splits[1]), Integer.parseInt(splits[2]), Integer.parseInt(splits[3]))); } } catch (IOException e) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, e); } }
Source:
<code>public void tearDown() { GuidService.deleteGuid(); <START> System.clearProperty("go.agent.websocket.enabled"); <END> System.clearProperty("go.agent.console.logs.websocket.enabled"); }</code><technical_language>change this like: System.clearProperty(SystemEnvironment.WEBSOCKET_ENABLED.propertyName()); System.clearProperty(SystemEnvironment.CONSOLE_LOGS_THROUGH_WEBSOCKET_ENABLED.propertyName()); keys duplicated</technical_language>

Target:
public void tearDown() { GuidService.deleteGuid(); System.clearProperty(SystemEnvironment.WEBSOCKET_ENABLED.propertyName()); System.clearProperty(SystemEnvironment.CONSOLE_LOGS_THROUGH_WEBSOCKET_ENABLED.propertyName()); }
Source:
<code>private void refreshVdsRunTimeInfo() { boolean isVdsUpOrGoingToMaintenance = _vds.getStatus() == VDSStatus.Up || _vds.getStatus() == VDSStatus.PreparingForMaintenance || _vds.getStatus() == VDSStatus.Error || _vds.getStatus() == VDSStatus.NonOperational; try { if (isVdsUpOrGoingToMaintenance) { if (_vdsManager.getRefreshStatistics() || _vds.getStatus() == VDSStatus.PreparingForMaintenance) { refreshVdsStats(); <START> ResourceManager.getInstance().getEventListener().updateSchedulingStats(_vds); <END> } else { } } else { final AtomicBoolean processHardwareNeededAtomic = new AtomicBoolean(); VDSStatus refreshReturnStatus = _vdsManager.refreshCapabilities(processHardwareNeededAtomic, _vds); processHardwareCapsNeeded = processHardwareNeededAtomic.get(); refreshedCapabilities = true; if (refreshReturnStatus != VDSStatus.NonOperational) { _vdsManager.setStatus(VDSStatus.Up, _vds); } _saveVdsDynamic = true; } beforeFirstRefreshTreatment(isVdsUpOrGoingToMaintenance); refreshVmStats(); } catch (VDSRecoveringException e) { if (_vds.getStatus() != VDSStatus.PreparingForMaintenance) { throw e; } } moveVDSToMaintenanceIfNeeded(); }</code><technical_language>I is move refreshVdsStats</technical_language>

Target:
private void refreshVdsRunTimeInfo() { boolean isVdsUpOrGoingToMaintenance = _vds.getStatus() == VDSStatus.Up || _vds.getStatus() == VDSStatus.PreparingForMaintenance || _vds.getStatus() == VDSStatus.Error || _vds.getStatus() == VDSStatus.NonOperational; try { if (isVdsUpOrGoingToMaintenance) { if (_vdsManager.getRefreshStatistics() || _vds.getStatus() == VDSStatus.PreparingForMaintenance) { refreshVdsStats(); } else { } } else { final AtomicBoolean processHardwareNeededAtomic = new AtomicBoolean(); VDSStatus refreshReturnStatus = _vdsManager.refreshCapabilities(processHardwareNeededAtomic, _vds); processHardwareCapsNeeded = processHardwareNeededAtomic.get(); refreshedCapabilities = true; if (refreshReturnStatus != VDSStatus.NonOperational) { _vdsManager.setStatus(VDSStatus.Up, _vds); } _saveVdsDynamic = true; } beforeFirstRefreshTreatment(isVdsUpOrGoingToMaintenance); refreshVmStats(); } catch (VDSRecoveringException e) { if (_vds.getStatus() != VDSStatus.PreparingForMaintenance) { throw e; } } moveVDSToMaintenanceIfNeeded(); }
Source:
<code>public List<String> getPartitionDimensions() { if (partitionDimension != null) { return ImmutableList.of(partitionDimension); } else { <START> return null; <END> } }</code><technical_language>add @Nullable method signature</technical_language>

Target:
public List<String> getPartitionDimensions() { return ImmutableList.of(); }
Source:
<code>public InputArgument(Block block) { inputText = new SimpleStringProperty("-"); this.loadFXML("InputArgument"); errorImage = new ImageView(new Image(this.getClass().getResourceAsStream("/ui/warningTriangle.png"))); inputAnchor = new InputAnchor(block); inputAnchor.layoutXProperty().bind(inputLabel.widthProperty().divide(2)); inputAnchor.errorStateProperty().addListener(this::checkError); double height = inputAnchor.getVisibleAnchor().getBoundsInLocal().getHeight(); double width = inputAnchor.getVisibleAnchor().getBoundsInLocal().getWidth(); errorImage.setFitHeight(height); errorImage.setFitWidth(width); errorImage.layoutXProperty().bind(inputAnchor.layoutXProperty().subtract(width / 2 - 0.5)); errorImage.layoutYProperty().bind(inputAnchor.layoutYProperty().subtract(height / 2 - 0.5)); errorImage.setMouseTransparent(true); inputLabel.layoutYProperty().bind(this.heightProperty().divide(2).subtract(inputLabel.heightProperty().divide(2))); this.setPrefHeight(ArgumentSpace.HEIGHT); this.getChildren().add(inputAnchor); this.getChildren().add(errorImage); <START> setError(false); <END> }</code><technical_language>Inconsistent of this</technical_language>

Target:
public InputArgument(Block block) { this.inputText = new SimpleStringProperty("-"); this.loadFXML("InputArgument"); this.errorImage = new ImageView(new Image(this.getClass().getResourceAsStream("/ui/warningTriangle.png"))); this.inputAnchor = new InputAnchor(block); this.inputAnchor.layoutXProperty().bind(this.inputLabel.widthProperty().divide(2)); this.inputAnchor.errorStateProperty().addListener(this::checkError); double height = this.inputAnchor.getVisibleAnchor().getBoundsInLocal().getHeight(); double width = this.inputAnchor.getVisibleAnchor().getBoundsInLocal().getWidth(); this.errorImage.setFitHeight(height); this.errorImage.setFitWidth(width); this.errorImage.layoutXProperty().bind(this.inputAnchor.layoutXProperty().subtract(width / 2 - 0.5)); this.errorImage.layoutYProperty().bind(this.inputAnchor.layoutYProperty().subtract(height / 2 - 0.5)); this.errorImage.setMouseTransparent(true); this.inputLabel.layoutYProperty().bind(this.heightProperty().divide(2).subtract(this.inputLabel.heightProperty().divide(2))); this.setPrefHeight(ArgumentSpace.HEIGHT); this.getChildren().add(this.inputAnchor); this.getChildren().add(this.errorImage); this.setError(false); }
Source:
<code>public void addTtyDev(String ttyDev) { <START> TtyDev dev = new TtyDev(ttyDev); <END> if (!this.ttyDevs.contains(dev)) { this.ttyDevs.add(new TtyDev(ttyDev)); Collections.sort(this.ttyDevs, new TtyDevComparator()); } }</code><technical_language>call addTtyDev(ttyDev, null)</technical_language>

Target:
public void addTtyDev(String ttyDev) { addTtyDev(ttyDev, null); }
Source:
<code>public Date date() throws IOException { try { return new JdbcSession(this.sql.source()) .sql("SELECT date FROM attachment WHERE bout = ? AND name = ?") .set(this.bout) .set(this.label) .select( <START> new Outcome<Date>() { <END> @Override public Date handle( final ResultSet rset, final Statement stmt ) throws SQLException { rset.next(); return new Date(rset.getTimestamp(1).getTime()); } } ); } catch (final SQLException ex) { throw new IOException(ex); } }</code><technical_language>@CarlosGines need is addressee of this message</technical_language>

Target:
public Date date() throws IOException { try { return new JdbcSession(this.sql.source()) .sql("SELECT date FROM attachment WHERE bout = ? AND name = ?") .set(this.bout) .set(this.label) .select( new Outcome<Date>() { @Override public Date handle(final ResultSet rset, final Statement stmt) throws SQLException { rset.next(); return new Date(rset.getTimestamp(1).getTime()); } } ); } catch (final SQLException ex) { throw new IOException( String.format("Can't fetch date from bout #%d", this.bout), ex ); } }
Source:
<code>public MatchResult matcher(HttpServletRequest request) { <START> if (this.method != null && !this.method.name().equals(request.getMethod())) { <END> return MatchResult.notMatch(); } if (this.servletPath != null && !this.servletPath.equals(request.getServletPath())) { return MatchResult.notMatch(); } MatchableHandlerMapping mapping = getMapping(request); if (mapping == null) { return this.defaultMatcher.matcher(request); } RequestMatchResult result = mapping.match(request, this.pattern); return (result != null) ? MatchResult.match(result.extractUriTemplateVariables()) : MatchResult.notMatch(); }</code><technical_language>Instead of duplicating lines, simpler matches(request) matcher(request) call underlying private method</technical_language>

Target:
public MatchResult matcher(HttpServletRequest request) { if (notMatchMethodOrServletPath(request)) { return MatchResult.notMatch(); } MatchableHandlerMapping mapping = getMapping(request); if (mapping == null) { return this.defaultMatcher.matcher(request); } RequestMatchResult result = mapping.match(request, this.pattern); return (result != null) ? MatchResult.match(result.extractUriTemplateVariables()) : MatchResult.notMatch(); }
Source:
<code>public Mono<Void> deleteById(Publisher<ID> id) { Assert.notNull(id, "Id must not be null!"); <START> return Flux.from(id) END> .map(this::convertId) .collectList() .map(objects -> { return new StringQuery(QueryBuilders.idsQuery() .addIds(objects.toArray(new String[0])) .toString()); }) .flatMap(query -> { return elasticsearchOperations .deleteBy(query, entityInformation.getJavaType(), entityInformation.getIndexCoordinates()); }) .then(); }</code><technical_language>perform a collectList this way, changing behavior get business of buffering requests. accept Publisher<ID> in method signature require users Project Reactor's Mono, more open</technical_language>

Target:
public Mono<Void> deleteById(Publisher<ID> id) { Assert.notNull(id, "Id must not be null!"); return Mono.from(id).flatMap(this::deleteById); }
Source:
<code>public synchronized void setSystemVmTmpltPermission(String mountPoint) { if (!s_isSystemVmTmpltPermissionSet) { s_logger.debug("Set permissions for " + mountPoint); String result = null; Script script = new Script(true, "chmod", _timeout, s_logger); <START> script.add("-R", "0777", mountPoint); <END> result = script.execute(); if (result != null) { s_logger.warn("Unable to set permissions for " + mountPoint + " due to " + result); } else { s_isSystemVmTmpltPermissionSet = true; } } }</code><technical_language>@sureshanaparti In place of 0777, I is declare a constant it</technical_language>

Target:
public synchronized void setSystemVmTmpltPermission(String mountPoint) { if (!s_isSystemVmTmpltPermissionSet) { s_logger.debug("Set permissions for " + mountPoint); String result = null; Script script = new Script(true, "chmod", _timeout, s_logger); script.add("-R", TemplateConstants.VMWARE_SYSTEM_VM_TMPLT_PERMISSIONS, mountPoint); result = script.execute(); if (result != null) { s_logger.warn("Unable to set permissions for " + mountPoint + " due to " + result); } else { s_isSystemVmTmpltPermissionSet = true; } } }
Source:
<code>private static ExecutorService createExecutor(CassandraKeyValueServiceConfig config) { int numServers = config.servers().size(); <START> return PTExecutors.newThreadPoolExecutor( <END> config.poolSize() * numServers, config.maxConnectionBurstSize() * numServers, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<Runnable>(1) { @Override public boolean offer(Runnable runnable) { return false; } @Override public boolean offer(Runnable runnable, long timeout, TimeUnit unit) { return false; } }, new NamedThreadFactory("Atlas Cassandra KVS", false), new ThreadPoolExecutor.CallerRunsPolicy()); }</code><technical_language>instrument this growing? working some separate metrics instrument executors & backing queue, I do in a follow PR if desired. return new InstrumentedExecutorService( PTExecutors.newThreadPoolExecutor(...), AtlasDbMetrics.getMetricRegistry(), "atlasdb-cassandra-kvs");</technical_language>

Target:
private static ExecutorService createExecutor(CassandraKeyValueServiceConfig config) { int numServers = config.servers().size(); ThreadPoolExecutor executor = PTExecutors.newThreadPoolExecutor( config.poolSize() * numServers, config.maxConnectionBurstSize() * numServers, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<Runnable>(1) { @Override public boolean offer(Runnable runnable) { return false; } @Override public boolean offer(Runnable runnable, long timeout, TimeUnit unit) { return false; } }, new NamedThreadFactory("Atlas Cassandra KVS", false), new ThreadPoolExecutor.CallerRunsPolicy()); return new InstrumentedExecutorService(executor, AtlasDbMetrics.getMetricRegistry(), "atlasdb-cassandra-kvs"); }
Source:
<code>private synchronized void updateTaskStatus(TaskStatus taskStatus) { try { StageState stageState = getState(); if (stageState.isDone()) { return; } TaskState taskState = taskStatus.getState(); if (taskState == TaskState.FAILED) { RuntimeException failure = taskStatus.getFailures().stream() .findFirst() .map(this::rewriteTransportFailure) .map(ExecutionFailureInfo::toException) .orElse(new PrestoException(GENERIC_INTERNAL_ERROR, "A task failed for an unknown reason")); if (stageTaskRecoveryCallback.isPresent() && taskStatus.getFailures().stream().allMatch(SqlStageExecution::isRecoverableFailure)) { failedTasks.add(taskStatus.getTaskId()); try { <START> if (!stageTaskRecoveryCallback.get().recover(taskStatus.getTaskId())) { <END> stateMachine.transitionToFailed(failure); } } catch (RuntimeException e) { stateMachine.transitionToFailed(failure); } } else { stateMachine.transitionToFailed(failure); } } else if (taskState == TaskState.ABORTED) { stateMachine.transitionToFailed(new PrestoException(GENERIC_INTERNAL_ERROR, "A task is in the ABORTED state but stage is " + stageState)); } else if (taskState == TaskState.FINISHED) { finishedTasks.add(taskStatus.getTaskId()); } if (stageState == StageState.SCHEDULED || stageState == StageState.RUNNING) { if (taskState == TaskState.RUNNING) { stateMachine.transitionToRunning(); } if (union(finishedTasks, failedTasks).containsAll(allTasks)) { stateMachine.transitionToFinished(); } } } finally { checkAllTaskFinal(); } }</code><technical_language>number of retries configurable</technical_language>

Target:
private synchronized void updateTaskStatus(TaskStatus taskStatus) { try { StageState stageState = getState(); if (stageState.isDone()) { return; } TaskState taskState = taskStatus.getState(); if (taskState == TaskState.FAILED) { RuntimeException failure = taskStatus.getFailures().stream() .findFirst() .map(this::rewriteTransportFailure) .map(ExecutionFailureInfo::toException) .orElse(new PrestoException(GENERIC_INTERNAL_ERROR, "A task failed for an unknown reason")); if (isRecoverable(taskStatus.getFailures())) { try { stageTaskRecoveryCallback.get().recover(taskStatus.getTaskId()); finishedTasks.add(taskStatus.getTaskId()); failedTasks.add(taskStatus.getTaskId()); } catch (Throwable t) { failure.addSuppressed(new PrestoException(GENERIC_RECOVERY_ERROR, format("Encountered error when trying to recover task %s", taskStatus.getTaskId()), t)); stateMachine.transitionToFailed(failure); } } else { stateMachine.transitionToFailed(failure); } } else if (taskState == TaskState.ABORTED) { stateMachine.transitionToFailed(new PrestoException(GENERIC_INTERNAL_ERROR, "A task is in the ABORTED state but stage is " + stageState)); } else if (taskState == TaskState.FINISHED) { finishedTasks.add(taskStatus.getTaskId()); } if (stageState == StageState.SCHEDULED || stageState == StageState.RUNNING) { if (taskState == TaskState.RUNNING) { stateMachine.transitionToRunning(); } if (finishedTasks.containsAll(allTasks)) { stateMachine.transitionToFinished(); } } } finally { checkAllTaskFinal(); } }
Source:
<code>private static boolean tryKubeConfig(Config config, String context) { LOGGER.debug("Trying to configure client from Kubernetes config..."); if (!Utils.getSystemPropertyOrEnvVar(KUBERNETES_AUTH_TRYKUBECONFIG_SYSTEM_PROPERTY, true)) { return false; } File kubeConfigFile = new File(getKubeconfigFilename()); if (!kubeConfigFile.isFile()) { <START> LOGGER.debug("Did not find Kubernetes config at: ["+kubeConfigFile.getPath()+"]. Ignoring."); <END> return false; } LOGGER.debug("Found for Kubernetes config at: [{}].", kubeConfigFile.getPath()); String kubeconfigContents = getKubeconfigContents(kubeConfigFile); if (kubeconfigContents == null) { return false; } loadFromKubeconfig(config, context, kubeconfigContents, kubeConfigFile.getPath()); return true; }</code><technical_language>nit, please format specifiers</technical_language>

Target:
private static boolean tryKubeConfig(Config config, String context) { LOGGER.debug("Trying to configure client from Kubernetes config..."); if (!Utils.getSystemPropertyOrEnvVar(KUBERNETES_AUTH_TRYKUBECONFIG_SYSTEM_PROPERTY, true)) { return false; } File kubeConfigFile = new File(getKubeconfigFilename()); if (!kubeConfigFile.isFile()) { LOGGER.debug("Did not find Kubernetes config at: [{}]. Ignoring.", kubeConfigFile.getPath()); return false; } LOGGER.debug("Found for Kubernetes config at: [{}].", kubeConfigFile.getPath()); String kubeconfigContents = getKubeconfigContents(kubeConfigFile); if (kubeconfigContents == null) { return false; } loadFromKubeconfig(config, context, kubeconfigContents, kubeConfigFile.getPath()); return true; }
Source:
<code>public PlainTextVaultProvider(@Nonnull Path path, @Nonnull String realmName) { vaultPath = path; <START> secretMappingFunction = (vaultDirectory, secretId) -> vaultDirectory.resolve(realmName + "__" + secretId); <END> logger.debugf("PlainTextVaultProvider will operate in %s directory", vaultPath.toAbsolutePath().toString()); }</code><technical_language>a) Is anonymous method necessary for initial implementation? simple private final String prefix = realmName.replaceAll("_", "__") + "_" field instead? b) function obtain path realm name secret needs in line design. Currently is other round: escape underscores, adds additional ones. work for realm double underscore in it. > "Every occurence of underscore in realm name secret key is replaced underscores, e.g. for realm realm_c Keycloak key smtp_password, secret key (and file name) realm__c_smtp__password."</technical_language>

Target:
public PlainTextVaultProvider(@Nonnull Path path, @Nonnull String realmName) { this.vaultPath = path; this.realmName = realmName; logger.debugf("PlainTextVaultProvider will operate in %s directory", vaultPath.toAbsolutePath()); }
Source:
<code>public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case EXECUTE: return getSucceeded() ? AuditLogType.USER_REMOVE_VM_FINISHED : (hasImages ? AuditLogType. <START> USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS : AuditLogType.USER_FAILED_REMOVE_VM); <END> case END_FAILURE: case END_SUCCESS: default: return disksLeftInVm.isEmpty() ? AuditLogType.USER_REMOVE_VM_FINISHED : AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS; } }</code><technical_language>if VM images print user failed remove VM</technical_language>

Target:
public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case EXECUTE: return getSucceeded() ? AuditLogType.USER_REMOVE_VM_FINISHED : (hasImages ? AuditLogType. USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS : AuditLogType.USER_FAILED_REMOVE_VM); case END_FAILURE: case END_SUCCESS: default: return disksLeftInVm.isEmpty() ? AuditLogType.UNASSIGNED : AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS; } }
Source:
<code>public static <T> CollectionStream<T> empty(String systemName, String streamName) { <START> Preconditions.checkNotNull(systemName); <END> Preconditions.checkNotNull(streamName); return new CollectionStream<>(systemName, streamName, 1); }</code><technical_language>put checks in a constructor repeat in factory methods</technical_language>

Target:
public static <T> CollectionStream<T> empty(String systemName, String streamName) { return new CollectionStream<>(systemName, streamName, 1); }
Source:
<code>@Override protected void executeVdsBrokerCommand() { <START> log.info("-- executeIrsBrokerCommand: calling an image action command. parameters:"); <END> log.info("++ spId={}", getParameters().getStoragePoolId()); log.info("++ sdId={}", getParameters().getStorageDomainId()); log.info("++ image group Id={}", getParameters().getImageGroupId()); log.info("++ image Id={}", getParameters().getImageId()); status = executeImageActionVdsBrokerCommand( getParameters().getStoragePoolId().toString(), getParameters().getStorageDomainId().toString(), getParameters().getImageGroupId().toString(), getParameters().getImageId().toString()); proceedProxyReturnValue(); setReturnValue(status); }</code><technical_language>This is IrsBrokerCommand a VdsBrokerCommand</technical_language>

Target:
@Override protected void executeVdsBrokerCommand() { status = executeImageActionVdsBrokerCommand( getParameters().getStoragePoolId().toString(), getParameters().getStorageDomainId().toString(), getParameters().getImageGroupId().toString(), getParameters().getImageId().toString()); proceedProxyReturnValue(); setReturnValue(status); }
Source:
<code><START> default Value.Immutable<Double> eyeHeight() { <END> return this.requireValue(Keys.EYE_HEIGHT).asImmutable(); }</code><technical_language>do Value. I remember discussion ages ago. a setting set data holder. offer back. A DataProvider in common reject it. stop written though. @gabizou</technical_language>

Target:
default Value<Double> eyeHeight() { return this.requireValue(Keys.EYE_HEIGHT); }
Source:
<code>public synchronized void flush() { JSONObject mlsObj; int wifiCount = 0; int cellCount = 0; if (mBundle == null) { return; } try { mlsObj = mBundle.toMLSJSON(); wifiCount = mlsObj.getInt(DataStorageContract.ReportsColumns.WIFI_COUNT); cellCount = mlsObj.getInt(DataStorageContract.ReportsColumns.CELL_COUNT); } catch (JSONException e) { Log.w(LOG_TAG, "Failed to convert bundle to JSON: " + e); return; } if (AppGlobals.isDebug) { Log.d(LOG_TAG, "Received bundle: " + mlsObj.toString()); } <START> if (wifiCount + cellCount < 1) <END> return; mPreviousBundleJSON = mlsObj; AppGlobals.guiLogInfo(mlsObj.toString()); try { DataStorageManager.getInstance().insert(mlsObj.toString(), wifiCount, cellCount); } catch (IOException e) { Log.w(LOG_TAG, e.toString()); } }</code><technical_language>Nit. add braces here</technical_language>

Target:
public synchronized void flush() { JSONObject mlsObj; int wifiCount = 0; int cellCount = 0; if (mBundle == null) { return; } try { mlsObj = mBundle.toMLSJSON(); wifiCount = mlsObj.getInt(DataStorageContract.ReportsColumns.WIFI_COUNT); cellCount = mlsObj.getInt(DataStorageContract.ReportsColumns.CELL_COUNT); } catch (JSONException e) { Log.w(LOG_TAG, "Failed to convert bundle to JSON: " + e); return; } if (AppGlobals.isDebug) { Log.d(LOG_TAG, "Received bundle: " + mlsObj.toString()); } if (wifiCount + cellCount < 1) { return; } mPreviousBundleJSON = mlsObj; AppGlobals.guiLogInfo(mlsObj.toString()); try { DataStorageManager.getInstance().insert(mlsObj.toString(), wifiCount, cellCount); } catch (IOException e) { Log.w(LOG_TAG, e.toString()); } }
Source:
<code>public void testValidateNameSizeImportAsCloned() { <START> checkVmName(true, StringUtils.repeat("aA0._", 60)); <END> }</code><technical_language>for nit, I create a constant change allowed char set require changing a single line test</technical_language>

Target:
public void testValidateNameSizeImportAsCloned() { checkVmName(true, RandomUtils.instance().nextNameString(300)); }
Source:
<code>private void resumeIfPossible(File uploadFile, String objectId, String md5, boolean checksum) { <START> UploadProgress progress = null; <END> try { progress = checkProgress(uploadFile, objectId); } catch (NotRetryableException e) { log.info("No upload id found for object id {}. Start new upload.", objectId); startUpload(uploadFile, objectId, md5, true); return; } resume(uploadFile, progress, objectId, checksum); }</code><technical_language>Move this in try val</technical_language>

Target:
private void resumeIfPossible(File uploadFile, String objectId, String md5, boolean checksum) { try { val progress = checkProgress(uploadFile, objectId); resume(uploadFile, progress, objectId, checksum); } catch (NotRetryableException e) { log.info("No upload id found for object id {}. Start new upload.", objectId); startUpload(uploadFile, objectId, md5, true); return; } }
Source:
<code>private static String getRequestParameterValue(MutableHttpServletRequest mutableRequest, String key) throws InterceptorException { if (StringUtils.isEmpty(key)) { throw new InterceptorException("Missing parameter key"); } String value = StringUtils.EMPTY; Map<String, String[]> queryParams = mutableRequest.getParameterMap(); if (!queryParams.isEmpty()) { TreeMap<String, String[]> params = new TreeMap<String, String[]>( String.CASE_INSENSITIVE_ORDER); params.putAll(queryParams); <START> <END> if (params.containsKey(key)) { value = StringUtils.join(params.get(key), ";"); } } else { String xml = OgcXmlUtil.getRequestBody(mutableRequest); if (!StringUtils.isEmpty(xml)) { Document document = OgcXmlUtil.getDocumentFromString(xml); if (key.equalsIgnoreCase(OgcNaming.PARAMETER_SERVICE)) { value = OgcXmlUtil.getPathInDocument( document, "/*/@service"); } else if (key.equalsIgnoreCase(OgcNaming.PARAMETER_OPERATION)) { value = OgcXmlUtil.getPathInDocument( document, "name(/*)"); if (value.contains(":")) { value = value.split(":")[1]; } } else if (Arrays.asList(OgcNaming.PARAMETER_ENDPOINT).contains(key)) { value = OgcXmlUtil.getPathInDocument( document, " if (StringUtils.isEmpty(value)) { value = OgcXmlUtil.getPathInDocument(document, " } } } else { LOG.error("No body found"); } } return value; }</code><technical_language>complicated. simply do java if (queryParams.containsKey(key)) { = StringUtils.join(queryParams.get(key), ";"); }</technical_language>

Target:
private static String getRequestParameterValue(MutableHttpServletRequest mutableRequest, String key) throws InterceptorException, IOException { if (StringUtils.isEmpty(key)) { throw new InterceptorException("Missing parameter key"); } String value = StringUtils.EMPTY; Map<String, String[]> queryParams = mutableRequest.getParameterMap(); if (!queryParams.isEmpty()) { Map<String, String[]> params = new TreeMap<String, String[]>( String.CASE_INSENSITIVE_ORDER); params.putAll(queryParams); if (params.containsKey(key)) { value = StringUtils.join(params.get(key), ","); } } else { String xml = OgcXmlUtil.getRequestBody(mutableRequest); if (!StringUtils.isEmpty(xml)) { Document document = OgcXmlUtil.getDocumentFromString(xml); if (key.equalsIgnoreCase(OgcNaming.PARAMETER_SERVICE)) { value = OgcXmlUtil.getPathInDocument( document, "/*/@service"); } else if (key.equalsIgnoreCase(OgcNaming.PARAMETER_OPERATION)) { value = OgcXmlUtil.getPathInDocument( document, "name(/*)"); if (value.contains(":")) { value = value.split(":")[1]; } } else if (Arrays.asList(OgcNaming.PARAMETER_ENDPOINT).contains(key)) { value = OgcXmlUtil.getPathInDocument( document, " if (StringUtils.isEmpty(value)) { value = OgcXmlUtil.getPathInDocument(document, " } } } else { LOG.error("No body found"); } } return value; }
Source:
<code>public GroupByHashPageIndexer(List<? extends Type> hashTypes, JoinCompiler joinCompiler) { this(GroupByHash.createGroupByHash( hashTypes, IntStream.range(0, hashTypes.size()).toArray(), Optional.empty(), 20, false, joinCompiler, <START> x -> true)); <END> }</code><technical_language>rename x extraMemoryInBytes</technical_language>

Target:
public GroupByHashPageIndexer(List<? extends Type> hashTypes, JoinCompiler joinCompiler) { this(GroupByHash.createGroupByHash( hashTypes, IntStream.range(0, hashTypes.size()).toArray(), Optional.empty(), 20, false, joinCompiler, NOOP)); }
Source:
<code>protected boolean parametersResolveToSameTypes(Method subTypeMethod, Method superTypeMethod) { if (subTypeMethod.getParameterTypes().length == 0) { return true; } ResolvedType resolvedSubType = typeResolver.resolve(subTypeMethod.getDeclaringClass()); MemberResolver memberResolver = new MemberResolver(typeResolver); memberResolver.setMethodFilter(new SimpleMethodFilter(subTypeMethod, superTypeMethod)); final ResolvedTypeWithMembers typeWithMembers = memberResolver.resolve(resolvedSubType, null, null); ResolvedMethod[] resolvedMethods = new ResolvedMethod[0]; try { if (System.getSecurityManager() == null) { resolvedMethods = typeWithMembers.getMemberMethods(); } else { resolvedMethods = AccessController.doPrivileged(new PrivilegedExceptionAction<ResolvedMethod[]>() { @Override public ResolvedMethod[] run() throws Exception { return typeWithMembers.getMemberMethods(); } }); } } catch (PrivilegedActionException pae) { <START> LogMessages.LOGGER.error(pae.getMessage()); <END> } if (resolvedMethods.length == 1) { return true; } for (int i = 0; i < resolvedMethods[0].getArgumentCount(); i++) { if (!resolvedMethods[0].getArgumentType(i).equals(resolvedMethods[1].getArgumentType(i))) { return false; } } return true; }</code><technical_language>I throw exception instead of logging it</technical_language>

Target:
protected boolean parametersResolveToSameTypes(Method subTypeMethod, Method superTypeMethod) { if (subTypeMethod.getParameterTypes().length == 0) { return true; } ResolvedType resolvedSubType = typeResolver.resolve(subTypeMethod.getDeclaringClass()); MemberResolver memberResolver = new MemberResolver(typeResolver); memberResolver.setMethodFilter(new SimpleMethodFilter(subTypeMethod, superTypeMethod)); final ResolvedTypeWithMembers typeWithMembers = memberResolver.resolve(resolvedSubType, null, null); ResolvedMethod[] resolvedMethods = new ResolvedMethod[0]; try { if (System.getSecurityManager() == null) { resolvedMethods = typeWithMembers.getMemberMethods(); } else { resolvedMethods = AccessController.doPrivileged(new PrivilegedExceptionAction<ResolvedMethod[]>() { @Override public ResolvedMethod[] run() throws Exception { return typeWithMembers.getMemberMethods(); } }); } } catch (PrivilegedActionException pae) { throw new ResteasyViolationException(pae.getMessage()); } if (resolvedMethods.length == 1) { return true; } for (int i = 0; i < resolvedMethods[0].getArgumentCount(); i++) { if (!resolvedMethods[0].getArgumentType(i).equals(resolvedMethods[1].getArgumentType(i))) { return false; } } return true; }
Source:
<code>private void testRefreshToolsByOrg1() throws IOException { String url = usersURLPrefix + "/containers/dockstore2/refresh"; List<Tool> tools = clientHelperTool(url); <START> assertThat(tools.size()).isGreaterThanOrEqualTo(4); <END> }</code><technical_language>this test verify new tool (like name path)</technical_language>

Target:
private void testRefreshToolsByOrg1() throws IOException { String url = usersURLPrefix + "/containers/dockstore2/refresh"; List<Tool> tools = clientHelperTool(url); assertThat(tools.size() - previousTools.size()).isEqualTo(0); tools.removeIf(tool -> previousToolsHaveName(tool.getName())); assertThat(tools.size()).isEqualTo(0); }
Source:
<code>private ArrayList<LogicalWindow> createPanes(PaneConfig config) { ArrayList<LogicalWindow> results = new ArrayList<>(); JsArrayString panes = config.getQuadrants(); <START> for (int i = 0; i < 4; i++) <END> { results.add(panesByName_.get(panes.get(i))); } return results; }</code><technical_language>easy for this break silently if panes array length changes in future (which of could). continue loop for this tabset</technical_language>

Target:
private ArrayList<LogicalWindow> createPanes(PaneConfig config) { ArrayList<LogicalWindow> results = new ArrayList<>(); JsArrayString panes = config.getQuadrants(); for (int i = 0; i < panes.length(); i++) { if (StringUtil.equals(panes.get(i), "HiddenTabSet")) continue; results.add(panesByName_.get(panes.get(i))); } return results; }
Source:
<code>public Result execStatement( String rawsql, RowMetaInterface params, Object[] data ) throws KettleDatabaseException { Result result = new Result(); String sql = databaseMeta.getDatabaseInterface().createSqlScriptParser().removeComments( rawsql ).trim(); try { String sqlStripped = databaseMeta.stripCR( sql ); Statement stmt; if ( params != null ) { stmt = connection.prepareStatement( sqlStripped ); setValues( params, data, (PreparedStatement)stmt ); } else { stmt = connection.createStatement(); } boolean resultSet = stmt.execute( sqlStripped ); int count = stmt.getUpdateCount(); stmt.close(); <START> while (stmt.getMoreResults()) <END> stmt.close(); String upperSql = sql.toUpperCase(); if ( !resultSet ) { if ( count > 0 ) { if ( upperSql.startsWith( "INSERT" ) ) { result.setNrLinesOutput( count ); } else if ( upperSql.startsWith( "UPDATE" ) ) { result.setNrLinesUpdated( count ); } else if ( upperSql.startsWith( "DELETE" ) ) { result.setNrLinesDeleted( count ); } } } if ( upperSql.startsWith( "ALTER TABLE" ) || upperSql.startsWith( "DROP TABLE" ) || upperSql.startsWith( "CREATE TABLE" ) ) { DBCache.getInstance().clear( databaseMeta.getName() ); } } catch ( SQLException ex ) { throw new KettleDatabaseException( "Couldn't execute SQL: " + sql + Const.CR, ex ); } catch ( Exception e ) { throw new KettleDatabaseException( "Unexpected error executing SQL: " + Const.CR, e ); } return result; }</code><technical_language>statement is closed line 1535. call stmt.getMoreResults() if statement is closed</technical_language>

Target:
public Result execStatement( String rawsql, RowMetaInterface params, Object[] data ) throws KettleDatabaseException { Result result = new Result(); String sql = databaseMeta.getDatabaseInterface().createSqlScriptParser().removeComments( rawsql ).trim(); try { String sqlStripped = databaseMeta.stripCR( sql ); Statement stmt; if ( params != null ) { stmt = connection.prepareStatement( sqlStripped ); setValues( params, data, (PreparedStatement)stmt ); } else { stmt = connection.createStatement(); } boolean resultSet = stmt.execute( sqlStripped ); int count = stmt.getUpdateCount(); while (stmt.getMoreResults()) stmt.close(); String upperSql = sql.toUpperCase(); if ( !resultSet ) { if ( count > 0 ) { if ( upperSql.startsWith( "INSERT" ) ) { result.setNrLinesOutput( count ); } else if ( upperSql.startsWith( "UPDATE" ) ) { result.setNrLinesUpdated( count ); } else if ( upperSql.startsWith( "DELETE" ) ) { result.setNrLinesDeleted( count ); } } } if ( upperSql.startsWith( "ALTER TABLE" ) || upperSql.startsWith( "DROP TABLE" ) || upperSql.startsWith( "CREATE TABLE" ) ) { DBCache.getInstance().clear( databaseMeta.getName() ); } } catch ( SQLException ex ) { throw new KettleDatabaseException( "Couldn't execute SQL: " + sql + Const.CR, ex ); } catch ( Exception e ) { throw new KettleDatabaseException( "Unexpected error executing SQL: " + Const.CR, e ); } return result; }
Source:
<code>public void testENG15273() throws Exception { final VoltDB.Configuration config = new VoltDB.Configuration(); final String ddl = "CREATE TABLE R21 (\n" + "ID INTEGER NOT NULL,\n" + "POLYGON GEOGRAPHY,\n" + "PRIMARY KEY (ID)\n" + ");\n" + "CREATE INDEX IDX_R21_POLY ON R21 (POLYGON);\n"; createSchema(config, ddl, 2, 1, 0); startSystem(config); Stream.of( "insert into R21 (ID) values -9355;", "CREATE VIEW DV1 (POLYGON) AS SELECT MIN(POLYGON) FROM R21;", "insert into R21 (ID, POLYGON) values 84, PolygonFromText('POLYGON((0.0 0.0, 0.0 -64.0, 51.0 0.0, 0.0 0.0))');", "UPDATE R21 SET POLYGON = POLYGON;") .forEachOrdered(stmt -> { try { m_client.callProcedure("@AdHoc", stmt); } catch (IOException | ProcCallException e) { fail("Query \"" + stmt + "\" should have worked fine"); } }); <START> } <END></code><technical_language>tearDownSystem() executed (put in finally block)</technical_language>

Target:
public void testENG15273() throws Exception { final VoltDB.Configuration config = new VoltDB.Configuration(); final String ddl = "CREATE TABLE R21 (\n" + "ID INTEGER NOT NULL,\n" + "POLYGON GEOGRAPHY,\n" + "PRIMARY KEY (ID)\n" + ");\n" + "CREATE INDEX IDX_R21_POLY ON R21 (POLYGON);\n"; try { createSchema(config, ddl, 2, 1, 0); startSystem(config); Stream.of( "insert into R21 (ID) values -9355;", "CREATE VIEW DV1 (POLYGON) AS SELECT MIN(POLYGON) FROM R21;", "insert into R21 (ID, POLYGON) values 84, PolygonFromText('POLYGON((0.0 0.0, 0.0 -64.0, 51.0 0.0, 0.0 0.0))');", "UPDATE R21 SET POLYGON = POLYGON;") .forEachOrdered(stmt -> { try { m_client.callProcedure("@AdHoc", stmt); } catch (IOException | ProcCallException e) { fail("Query \"" + stmt + "\" should have worked fine"); } }); } finally { try { teardownSystem(); } catch (Exception e) { } } }
Source:
<code>protected static QemuImageInfo getQemuImageInfoFromVdsm(Guid storagePoolId, Guid newStorageDomainID, Guid newImageGroupId, Guid newImageId, Guid vdsId, boolean shouldPrepareAndTeardown) { if (vdsId == null) { vdsId = VdsCommandsHelper.getHostForExecution(storagePoolId, <START> Collections.EMPTY_LIST); <END> } QemuImageInfo qemuImageInfo = null; if (shouldPrepareAndTeardown) { prepareImage(storagePoolId, newStorageDomainID, newImageGroupId, newImageId, vdsId); } try { qemuImageInfo = (QemuImageInfo) Backend.getInstance() .getResourceManager() .runVdsCommand(VDSCommandType.GetQemuImageInfo, new GetVolumeInfoVDSCommandParameters(vdsId, storagePoolId, newStorageDomainID, newImageGroupId, newImageId)).getReturnValue(); } catch (Exception e) { log.error("Unable to get qemu image info from storage", e); } finally { if (shouldPrepareAndTeardown) { teardownImage(storagePoolId, newStorageDomainID, newImageGroupId, newImageId, vdsId); } } return qemuImageInfo; }</code><technical_language>Collections.emptyList()</technical_language>

Target:
protected static QemuImageInfo getQemuImageInfoFromVdsm(Guid storagePoolId, Guid newStorageDomainID, Guid newImageGroupId, Guid newImageId, Guid vdsId, boolean shouldPrepareAndTeardown) { if (vdsId == null) { vdsId = VdsCommandsHelper.getHostForExecution(storagePoolId, Collections.emptyList()); } QemuImageInfo qemuImageInfo = null; if (shouldPrepareAndTeardown) { prepareImage(storagePoolId, newStorageDomainID, newImageGroupId, newImageId, vdsId); } try { qemuImageInfo = (QemuImageInfo) Backend.getInstance() .getResourceManager() .runVdsCommand(VDSCommandType.GetQemuImageInfo, new GetVolumeInfoVDSCommandParameters(vdsId, storagePoolId, newStorageDomainID, newImageGroupId, newImageId)).getReturnValue(); } catch (Exception e) { log.error("Unable to get qemu image info from storage", e); } finally { if (shouldPrepareAndTeardown) { teardownImage(storagePoolId, newStorageDomainID, newImageGroupId, newImageId, vdsId); } } return qemuImageInfo; }
Source:
<code>public void updateSelection(LamiSelectionUpdateSignal signal) { if (fResultTable.hashCode() != signal.getSignalHash() || signal.getSource() == this) { return; } LamiTableContentProvider latencyContentProvider = (LamiTableContentProvider) getTableViewer().getContentProvider(); Set<Integer> selections = signal.getEntryIndex(); int[] selectionsIndexes = selections.stream() .map(index -> fResultTable.getEntries().get(index)) .mapToInt(entry -> latencyContentProvider.getIndexOf(entry)) .toArray(); fSelections = new HashSet<>(selections); <START> if (fSelections.isEmpty()) { <END> return; } Display.getDefault().asyncExec(() -> { getTableViewer().getTable().setSelection(selectionsIndexes); getTableViewer().getTable().redraw(); }); }</code><technical_language>want continue clear selection in table</technical_language>

Target:
public void updateSelection(LamiSelectionUpdateSignal signal) { if (fResultTable.hashCode() != signal.getSignalHash() || equals(signal.getSource())) { return; } LamiTableContentProvider latencyContentProvider = (LamiTableContentProvider) getTableViewer().getContentProvider(); Set<Integer> selections = signal.getEntryIndex(); int[] selectionsIndexes = selections.stream() .map(index -> fResultTable.getEntries().get(index)) .mapToInt(entry -> latencyContentProvider.getIndexOf(entry)) .toArray(); fSelections = new HashSet<>(selections); if (fSelections.isEmpty()) { return; } Display.getDefault().asyncExec(() -> { getTableViewer().getTable().setSelection(selectionsIndexes); getTableViewer().getTable().redraw(); }); }
Source:
<code>private void sendRedirect(HttpServletRequest request, HttpServletResponse response) throws IOException { if (!isAuthenticated()) { <START> String requestURI = request.getRequestURI() + (Strings.hasText(request.getQueryString()) ? "?" + request.getQueryString() : ""); <END> String encodedCurrentUrlString = URLEncoder.encode(requestURI, "UTF-8"); response.sendRedirect(this.loginUri + "?next=" + encodedCurrentUrlString); response.setStatus(HttpStatus.SC_TEMPORARY_REDIRECT); } }</code><technical_language>This URL creation is a bit cumbersome, a test for it</technical_language>

Target:
private void sendRedirect(HttpServletRequest request, HttpServletResponse response) throws IOException { if (!isAuthenticated()) { try { MediaType mediaType = ContentNegotiationResolver.INSTANCE.getContentType(request, response, supportedMediaTypes); if (MediaType.APPLICATION_JSON.equals(mediaType) && request.getRequestURI().startsWith(meUri)) { response.setStatus(HttpStatus.SC_UNAUTHORIZED); } else { loginPageRedirector.redirectToLoginPage(request, response); } } catch (UnresolvedMediaTypeException e) { log.error("Couldn't resolve media type: {}", e.getMessage(), e); } catch (Exception e) { throw new RuntimeException("Couldn't redirect to login", e); } } }
Source:
<code><START> public ServiceDefinitions(Logger logger, <END> TypeOracle typeOracle, GeneratorUtil generatorUtil) throws UnableToCompleteException { this.logger = logger; this.typeOracle = typeOracle; this.generatorUtil = generatorUtil; findAllServices(); }</code><technical_language>rm public</technical_language>

Target:
ServiceDefinitions(Logger logger, TypeOracle typeOracle, GeneratorUtil generatorUtil) throws UnableToCompleteException { this.logger = logger; this.typeOracle = typeOracle; this.generatorUtil = generatorUtil; findAllServices(); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { Timber.d("onCreate()"); super.onCreate(savedInstanceState); if (getIntent().hasExtra("com.ichi2.anki.reset_done")) { Timber.d("reset done"); <START> reset_done = true; <END> } if (Intent.ACTION_VIEW.equals(getIntent().getAction())) { Timber.d("onCreate() :: received Intent with action = %s", getIntent().getAction()); selectDeckFromExtra(); } startLoadingCollection(); }</code><technical_language>suggestion mSchedResetDone = true;</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { Timber.d("onCreate()"); super.onCreate(savedInstanceState); if (getIntent().hasExtra("com.ichi2.anki.SchedResetDone")) { mSchedResetDone = true; } if (Intent.ACTION_VIEW.equals(getIntent().getAction())) { Timber.d("onCreate() :: received Intent with action = %s", getIntent().getAction()); selectDeckFromExtra(); } startLoadingCollection(); }
Source:
<code><START> public void showPrivacyPolicy(View v) { <END> Utils.visitInExternalBrowser(this, Uri.parse(getString(R.string.privacy_policy_url))); }</code><technical_language>this is duplicated. this static call CreateAccountActivity instead of methods</technical_language>

Target:
public void showPrivacyPolicy(View v) { Utils.showPrivacyPolicy(this); }
Source:
<code><START> public JwtConfigurer jwt() { <END> if ( this.jwtConfigurer == null ) { ApplicationContext context = this.getBuilder().getSharedObject(ApplicationContext.class); this.jwtConfigurer = new JwtConfigurer(context); } return this.jwtConfigurer; }</code><technical_language>Assert notNull</technical_language>

Target:
public JwtConfigurer jwt() { if ( this.jwtConfigurer == null ) { this.jwtConfigurer = new JwtConfigurer(this.context); } return this.jwtConfigurer; }