auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void setMaximizedControl(Control control){ checkWidget(); if (control == null) { if (maxControl != null) { this.maxControl = null; layout(false); for (Sash <START> sashe : <END> sashes) { sashe.setVisible(true); } } return; } for (Sash sashe : sashes) { sashe.setVisible(false); } maxControl = control; layout(false); }</code><technical_language>rename sash</technical_language>

Target:
public void setMaximizedControl(Control control){ checkWidget(); if (control == null) { if (maxControl != null) { this.maxControl = null; layout(false); for (Sash sashe : sashes) { sashe.setVisible(true); } } return; } for (Sash sash : sashes) { sash.setVisible(false); } maxControl = control; layout(false); }
Source:
<code>private void fillEdges(SPTEntry currEdge, PriorityQueue<SPTEntry> prioQueue, IntObjectMap<SPTEntry> bestWeightMap, RoutingCHEdgeExplorer explorer, boolean reverse) { RoutingCHEdgeIterator iter = explorer.setBaseNode(currEdge.adjNode); while (iter.next()) { if (!accept(iter, currEdge, reverse)) continue; final double weight = calcWeight(iter, currEdge, reverse); if (Double.isInfinite(weight)) { continue; } final int origEdgeId = getOrigEdgeId(iter, reverse); final int traversalId = getTraversalId(iter, origEdgeId, reverse); SPTEntry entry = bestWeightMap.get(traversalId); if (entry == null) { entry = createEntry(iter, origEdgeId, weight, currEdge, reverse); bestWeightMap.put(traversalId, entry); prioQueue.add(entry); } else if (entry.getWeightOfVisitedPath() > weight) { prioQueue.remove(entry); updateEntry(entry, iter, origEdgeId, weight, currEdge, reverse); prioQueue.add(entry); } else continue; if (updateBestPath) { double edgeWeight = traversalMode.isEdgeBased() ? calcWeight(iter, reverse, NO_EDGE) : Double.POSITIVE_INFINITY; <START> updateBestPath(edgeWeight, entry, origEdgeId, traversalId, reverse); <END> } } }</code><technical_language>calcWeight operation is done happen search entry weight is used. related (not likely): > query speed decrease 10%, I find out this is, BTW: this slowdown occur for edge- node-based queries</technical_language>

Target:
private void fillEdges(SPTEntry currEdge, PriorityQueue<SPTEntry> prioQueue, IntObjectMap<SPTEntry> bestWeightMap, RoutingCHEdgeExplorer explorer, boolean reverse) { RoutingCHEdgeIterator iter = explorer.setBaseNode(currEdge.adjNode); while (iter.next()) { if (!accept(iter, currEdge, reverse)) continue; final double weight = calcWeight(iter, currEdge, reverse); if (Double.isInfinite(weight)) { continue; } final int origEdgeId = getOrigEdgeId(iter, reverse); final int traversalId = getTraversalId(iter, origEdgeId, reverse); SPTEntry entry = bestWeightMap.get(traversalId); if (entry == null) { entry = createEntry(iter, origEdgeId, weight, currEdge, reverse); bestWeightMap.put(traversalId, entry); prioQueue.add(entry); } else if (entry.getWeightOfVisitedPath() > weight) { prioQueue.remove(entry); updateEntry(entry, iter, origEdgeId, weight, currEdge, reverse); prioQueue.add(entry); } else continue; if (updateBestPath) { updateBestPath(Double.POSITIVE_INFINITY, entry, origEdgeId, traversalId, reverse); } } }
Source:
<code>public static RequestControlAdminRequest readFrom(DataInputStream stream, AdminRequest adminRequest) throws IOException { Short versionId = stream.readShort(); if (!versionId.equals(VERSION_V1)) { throw new IllegalStateException("Unrecognized version for RequestControlAdminRequest: " + VERSION_V1); } RequestOrResponseType requestType = RequestOrResponseType.values()[stream.readShort()]; <START> boolean enable = stream.readByte() == 1; <END> return new RequestControlAdminRequest(requestType, enable, adminRequest); }</code><technical_language>Define a constant for 1</technical_language>

Target:
public static RequestControlAdminRequest readFrom(DataInputStream stream, AdminRequest adminRequest) throws IOException { Short versionId = stream.readShort(); if (!versionId.equals(VERSION_V1)) { throw new IllegalStateException("Unrecognized version for RequestControlAdminRequest: " + versionId); } RequestOrResponseType requestType = RequestOrResponseType.values()[stream.readShort()]; boolean enable = stream.readByte() == 1; return new RequestControlAdminRequest(requestType, enable, adminRequest); }
Source:
<code>public void init(StreamGraph graph, Config config) { try { BiFunction<String, String, String> messageBuilder = (key, msg) -> { String result = ""; try { TestKafkaEvent incomingMessage = TestKafkaEvent.fromSerializedString(msg); if (appLifeCycleListener != null) { appLifeCycleListener.onMessageReceived(incomingMessage); } result = incomingMessage.toString(); } catch (Exception e) { LOGGER.error("Exception when processing message in TestStreamApplication: ", e); <START> appLifeCycleListener.onExceptionOccurred(e); <END> } if (processedMessagesLatch != null) { processedMessagesLatch.countDown(); } return result; }; MessageStream<String> inputStream = graph.getInputStream(inputTopic, messageBuilder); OutputStream<String, String, String> outputStream = graph.getOutputStream(outputTopic, event -> null, event -> event); inputStream.sendTo(outputStream); } catch (Exception e) { if (appLifeCycleListener != null) { appLifeCycleListener.onExceptionOccurred(e); } } }</code><technical_language>This is a "lifecycle listener", a callback</technical_language>

Target:
public void init(StreamGraph graph, Config config) { MessageStream<String> inputStream = graph.getInputStream(inputTopic, (key, msg) -> { TestKafkaEvent incomingMessage = TestKafkaEvent.fromString((String) msg); if (streamApplicationCallback != null) { streamApplicationCallback.onMessageReceived(incomingMessage); } if (processedMessagesLatch != null) { processedMessagesLatch.countDown(); } if (kafkaEventsConsumedLatch != null) { kafkaEventsConsumedLatch.countDown(); } return incomingMessage.toString(); }); OutputStream<String, String, String> outputStream = graph.getOutputStream(outputTopic, event -> null, event -> event); inputStream.sendTo(outputStream); }
Source:
<code>private static List<File> getAllFiles(File dir) { final List<File> result = new ArrayList<>(); dir.listFiles(file -> { if (file.isDirectory()) { result.addAll(getAllFiles(file)); } else if (file.getName().endsWith(".java") && !file.getName().endsWith("InputGrammar.java") && !file.getName().endsWith("InputPackageDeclarationWithCommentOnly.java") && !file.getName().endsWith("InputSingleSpaceSeparatorEmpty.java") && !file.getName().endsWith("InputNoCodeInFile1.java") && !file.getName().endsWith("InputNoCodeInFile2.java") <START> && !file.getName().endsWith("InputNoCodeInFile3.java")) { <END> result.add(file); } return false; }); return result; }</code><technical_language>is extract endings some list iterate it, more readable</technical_language>

Target:
private static List<File> getAllFiles(File dir) { final List<File> result = new ArrayList<>(); dir.listFiles(file -> { if (file.isDirectory()) { result.addAll(getAllFiles(file)); } else if (file.getName().endsWith(".java") && !NO_ROOT_FILES.contains(file.getName())) { result.add(file); } return false; }); return result; }
Source:
<code>public void load(List<FormStatus> forms, BriefcasePreferences preferences) { this.forms = forms; this.lastPullCursorsByFormId = forms.stream() <START> .map(form -> Pair.of(form.getFormId(), preferences.nullSafeGet(form.getFormId() + "-last-cursor"))) <END> .filter(pair -> pair.getRight().isPresent()) .map(pair -> pair.map(identity(), Optional::get)) .collect(toMap(Pair::getLeft, Pair::getRight)); triggerOnChange(); }</code><technical_language>"-last-cursor" appears in places. consider making a constant</technical_language>

Target:
public void load(List<FormStatus> forms, BriefcasePreferences preferences) { this.forms = forms; this.lastPullCursorsByFormId = forms.stream() .map(form -> Pair.of(form.getFormId(), preferences.nullSafeGet(form.getFormId() + LAST_CURSOR_PREFERENCE_KEY_SUFFIX))) .filter(pair -> pair.getRight().isPresent()) .map(pair -> pair.map(identity(), Optional::get)) .collect(toMap(Pair::getLeft, Pair::getRight)); triggerOnChange(); }
Source:
<code>public boolean setupTable() { <START> log.debug("setting up table {}, policy={}}", tableName, policy); <END> if (policy.equals(CREATE_TABLE_POLICY_NEVER)) { log.debug("policy='{}', skipping setup", CREATE_TABLE_POLICY_NEVER); return false; } synchronized (DIRECTORY_INIT_LOCK) { boolean tableExists = tableExists(); if (policy.equals(CREATE_TABLE_POLICY_ON_MISSING_COLUMNS) && tableExists) { if (hasMatchingColumns()) { log.debug("policy='{}' and all column matched, skipping data load", CREATE_TABLE_POLICY_ON_MISSING_COLUMNS); } else { log.debug("policy='{}' and some columns are missing", CREATE_TABLE_POLICY_ON_MISSING_COLUMNS); addMissingColumns(); } return false; } try { createTable(tableExists); } catch (ConcurrentUpdateException e) { } return true; } }</code><technical_language>}</technical_language>

Target:
public boolean setupTable() { log.debug("setting up table {}, policy={}", tableName, policy); if (policy.equals(CREATE_TABLE_POLICY_NEVER)) { log.debug("policy='{}', skipping setup", CREATE_TABLE_POLICY_NEVER); return false; } synchronized (DIRECTORY_INIT_LOCK) { boolean tableExists = tableExists(); if (policy.equals(CREATE_TABLE_POLICY_ON_MISSING_COLUMNS) && tableExists) { if (hasMatchingColumns()) { log.debug("policy='{}' and all column matched, skipping data load", CREATE_TABLE_POLICY_ON_MISSING_COLUMNS); } else { log.debug("policy='{}' and some columns are missing", CREATE_TABLE_POLICY_ON_MISSING_COLUMNS); addMissingColumns(); } return false; } try { createTable(tableExists); } catch (ConcurrentUpdateException e) { } return true; } }
Source:
<code>protected List<String> getClasspathElements() throws Exception { final List<String> back = project.getCompileClasspathElements(); back.remove(project.getBuild().getOutputDirectory()); if (additionalDependencies != null) { for (Dependency dependency : additionalDependencies) { addToClasspath(factory.createDependencyArtifact(dependency), back, false); } <START> } <END> if (classpath != null && classpath.getAdd() != null) { getLog().warn("using 'classpath' is deprecated, use 'additionalDependencies' instead"); for (File f : classpath.getAdd()) { back.add(f.getAbsolutePath()); } } back.addAll(TychoUtilities.addOsgiClasspathElements(project)); return back; }</code><technical_language>move this in ScalaMojoSupport parent avoid code duplication</technical_language>

Target:
protected Set<String> getClasspathElements() throws Exception { final Set<String> back = new HashSet<>(project.getCompileClasspathElements()); back.remove(project.getBuild().getOutputDirectory()); addAdditionalDependencies(back); if (classpath != null && classpath.getAdd() != null) { getLog().warn("using 'classpath' is deprecated, use 'additionalDependencies' instead"); for (File f : classpath.getAdd()) { back.add(f.getAbsolutePath()); } } back.addAll(TychoUtilities.addOsgiClasspathElements(project)); return back; }
Source:
<code>public IntegrationFlow ftpInboundFlow() { IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(Ftp.inboundAdapter(FtpSource.this.ftpSessionFactory) .preserveTimestamp(config.isPreserveTimestamp()) .remoteDirectory(config.getRemoteDir()) .patternFilter(config.getFilenamePattern()) .remoteFileSeparator(config.getRemoteFileSeparator()) .localDirectory(config.getLocalDir()) .autoCreateLocalDirectory(config.isAutoCreateLocalDir()) .temporaryFileSuffix(config.getTmpFileSuffix()) .deleteRemoteFiles(config.isDeleteRemoteFiles()) , new Consumer<SourcePollingChannelAdapterSpec>() { @Override public void accept(SourcePollingChannelAdapterSpec sourcePollingChannelAdapterSpec) { sourcePollingChannelAdapterSpec.poller(poller()); } }); switch (fileConsumerConfig.getMode()) { case contents: flowBuilder.enrichHeaders(Collections.singletonMap(MessageHeaders.CONTENT_TYPE, "application/octet-stream")) .transform(new FileToByteArrayTransformer()); break; case lines: flowBuilder.enrichHeaders(Collections.singletonMap(MessageHeaders.CONTENT_TYPE, "text/plain")) .split(new FileSplitter(true, fileConsumerConfig.getWithMarkers()), null); <START> default: <END> break; } if (fileConsumerConfig.getMode().equals(FileReadingMode.contents)) { } return flowBuilder.channel(source.output()).get(); }</code><technical_language>Please explicit 3rd case (ref) throw exception in default</technical_language>

Target:
public IntegrationFlow ftpInboundFlow() { IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(Ftp.inboundAdapter(FtpSource.this.ftpSessionFactory) .preserveTimestamp(config.isPreserveTimestamp()) .remoteDirectory(config.getRemoteDir()) .patternFilter(config.getFilenamePattern()) .remoteFileSeparator(config.getRemoteFileSeparator()) .localDirectory(config.getLocalDir()) .autoCreateLocalDirectory(config.isAutoCreateLocalDir()) .temporaryFileSuffix(config.getTmpFileSuffix()) .deleteRemoteFiles(config.isDeleteRemoteFiles()) , new Consumer<SourcePollingChannelAdapterSpec>() { @Override public void accept(SourcePollingChannelAdapterSpec sourcePollingChannelAdapterSpec) { sourcePollingChannelAdapterSpec .autoStartup(false) .poller(poller()); } }); switch (fileConsumerConfig.getMode()) { case contents: flowBuilder.enrichHeaders(Collections.<String, Object>singletonMap(MessageHeaders.CONTENT_TYPE, "application/octet-stream")) .transform(new FileToByteArrayTransformer()); break; case lines: flowBuilder.enrichHeaders(Collections.<String, Object>singletonMap(MessageHeaders.CONTENT_TYPE, "text/plain")) .split(new FileSplitter(true, fileConsumerConfig.getWithMarkers()), null); case ref: break; default: throw new IllegalArgumentException(fileConsumerConfig.getMode().name() + " is not a supported file reading mode."); } return flowBuilder.channel(source.output()).get(); }
Source:
<code><START> public static void sleep(long millis) { <END> try { Thread.sleep(millis); } catch (InterruptedException e) { throw Throwables.propagate(e); } }</code><technical_language>This method is bad! mark thread interrupted again, propagating exception (but this pull request's fault). a RuntimeInterruptedException Peter added: creating of automatically set current thread interrupted</technical_language>

Target:
public static void sleep(long millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { throw Exceptions.propagate(e); } }
Source:
<code>public void setWindingOrder(EnumWindingOrderTypes windingOrderType) { <START> setParameter(PARAM_UNIFY_WINDING_ORDER, Value.of(windingOrderType)); <END> }</code><technical_language>Note do enum returns name in toString(). is OK treated a simple value</technical_language>

Target:
public void setWindingOrder(EnumWindingOrderTypes windingOrderType) { setParameter(PARAM_UNIFY_WINDING_ORDER, Value.of(windingOrderType.toString())); }
Source:
<code>public void triggerRoleRefresh(ApiClient client, String clusterName, String serviceName, String roleName) { LOGGER.info("Attempting to trigger role refresh on clusterName = {}, serviceName = {}, roleName = {}", clusterName, serviceName, roleName); ApiRoleNameList roleNameList = new ApiRoleNameList(); roleNameList.addItemsItem(roleName); RoleCommandsResourceApi roleCommandsResourceApi = clouderaManagerApiFactory.getRoleCommandsResourceApi(client); try { <START> ApiBulkCommandList bulkResponse = roleCommandsResourceApi.refreshCommand(clusterName, serviceName, roleNameList); <END> ApiCommand response = Iterables.getOnlyElement(bulkResponse.getItems()); LOGGER.info("ApiCommand response for role refresh = {}", response); if (response != null && (response.getActive() || response.getSuccess())) { LOGGER.info("Successfully triggered role refresh"); } else { LOGGER.debug("Failed to trigger role refresh"); throw new RangerCloudIdentitySyncException("Role refresh was not successfully trigerred"); } } catch (ApiException e) { throw new RangerCloudIdentitySyncException("Encountered ApiException on role refresh", e); } }</code><technical_language>this a synchronous call me, DL service wait finished. if I check chain me, this call freeipa is synchronous, freeipa hang this returns. I this is a good idea. bbe converted async. RangerCloudIdentityService#setAzureCloudIdentityMapping</technical_language>

Target:
private void triggerRoleRefresh(ApiClient client, String clusterName, String serviceName, String roleName) { LOGGER.info("Attempting to trigger role refresh on clusterName = {}, serviceName = {}, roleName = {}", clusterName, serviceName, roleName); ApiRoleNameList roleNameList = new ApiRoleNameList(); roleNameList.addItemsItem(roleName); RoleCommandsResourceApi roleCommandsResourceApi = clouderaManagerApiFactory.getRoleCommandsResourceApi(client); try { ApiBulkCommandList bulkResponse = roleCommandsResourceApi.refreshCommand(clusterName, serviceName, roleNameList); ApiCommand response = Iterables.getOnlyElement(bulkResponse.getItems()); LOGGER.info("ApiCommand response for role refresh = {}", response); if (response != null && (response.getActive() || response.getSuccess())) { LOGGER.info("Successfully triggered role refresh"); } else { LOGGER.debug("Failed to trigger role refresh"); throw new RangerCloudIdentitySyncException("Role refresh was not successfully trigerred"); } } catch (ApiException e) { LOGGER.error("Encountered ApiException on role refresh", e); throw new RangerCloudIdentitySyncException("Encountered ApiException on role refresh", e); } }
Source:
<code>private void stopConfiguration() throws Exception { if (configuration == null) { if (progress == null) { progress = new ScriptProgress(newSequential(0, 0), ""); } RegionInfo scriptInfo = progress.getScriptInfo(); progress.addScriptFailure(scriptInfo); } else { for (ServerBootstrapResolver serverResolver : configuration.getServerResolvers()) { ServerBootstrap server = serverResolver.resolve(); server.setPipelineFactory(pipelineFactory(pipeline(closeOnExceptionHandler))); } for (ClientBootstrapResolver clientResolver : configuration.getClientResolvers()) { try { ClientBootstrap client = clientResolver.resolve(); client.setPipelineFactory(pipelineFactory(pipeline(closeOnExceptionHandler))); <START> } catch (RuntimeException e) { <END> LOGGER.warn("Exception caught while trying to stop client pipelies: " + e); } } for (ChannelPipeline pipeline : configuration.getClientAndServerPipelines()) { stopStream(pipeline); } for (ChannelFuture bindFuture : bindFutures) { bindFuture.cancel(); } for (ChannelFuture connectFuture : connectFutures) { if (connectFuture.cancel()) { LOGGER.debug("Cancelled connect future: " + connectFuture.getChannel().getRemoteAddress()); } } } }</code><technical_language>this throw exception ? Also, do require for server resolvers</technical_language>

Target:
private void stopConfiguration() throws Exception { if (configuration == null) { if (progress == null) { progress = new ScriptProgress(newSequential(0, 0), ""); } RegionInfo scriptInfo = progress.getScriptInfo(); progress.addScriptFailure(scriptInfo); } else { for (ServerBootstrapResolver serverResolver : configuration.getServerResolvers()) { try { ServerBootstrap server = serverResolver.resolve(); server.setPipelineFactory(pipelineFactory(pipeline(closeOnExceptionHandler))); } catch (RuntimeException e) { LOGGER.warn("Exception caught while trying to stop server pipelies", e); } } for (ClientBootstrapResolver clientResolver : configuration.getClientResolvers()) { try { ClientBootstrap client = clientResolver.resolve(); client.setPipelineFactory(pipelineFactory(pipeline(closeOnExceptionHandler))); } catch (RuntimeException e) { LOGGER.warn("Exception caught while trying to stop client pipelies", e); } } for (ChannelPipeline pipeline : configuration.getClientAndServerPipelines()) { stopStream(pipeline); } for (ChannelFuture bindFuture : bindFutures) { bindFuture.cancel(); } for (ChannelFuture connectFuture : connectFutures) { if (connectFuture.cancel()) { LOGGER.debug("Cancelled connect future: " + connectFuture.getChannel().getRemoteAddress()); } } } }
Source:
<code>private static String getFilePath(String line, int strip, Path outputDirectory) { String file = null; line = line.split("\t")[0]; if (line.length() > 4) { file = stripPath(line.substring(4), strip); <START> file = outputDirectory.getRelative(file).getPathString(); <END> } return file; }</code><technical_language>approach break for patches generating removing files, name description --- /dev/null +++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/PatchUtil.java</technical_language>

Target:
private static Path getFilePath(String line, int strip, Path outputDirectory) { String file = null; line = line.split("\t")[0]; if (line.length() > 4) { if (line.substring(4).trim().equals("/dev/null")) { return null; } file = stripPath(line.substring(4), strip); if (!file.isEmpty()) { return outputDirectory.getRelative(file); } } return null; }
Source:
<code>private ArrayList<ArrayList> loadFromEf(int efType) { ArrayList<ArrayList> results = new ArrayList<ArrayList>(); List<AdnRecord> adnRecords = null; AdnComparator adnComparator = new AdnComparator(); if (DBG) log("loadFromEf: efType=" + efType); try { IIccPhoneBook iccIpb = IIccPhoneBook.Stub.asInterface( ServiceManager.getService("simphonebook")); if (iccIpb != null) { adnRecords = iccIpb.getAdnRecordsInEf(efType); } } catch (RemoteException ex) { } catch (SecurityException ex) { if (DBG) log(ex.toString()); } if (adnRecords != null) { int N = adnRecords.size(); if (DBG) log("adnRecords.size=" + N); List<AdnRecord> newAdn = new ArrayList<AdnRecord>(); <START> for (int i = 0; i < N; i++) { <END> AdnRecord record = adnRecords.get(i); if (!record.isEmpty()) { newAdn.add(record); } } Collections.sort(newAdn, adnComparator); if (DBG) log("loadFromEf: results =" + newAdn); N = newAdn.size(); for (int i = 0; i < N; i++) { loadRecord((AdnRecord) newAdn.get(i), results); } } else { Log.w(TAG, "Cannot load ADN records"); results.clear(); } if (DBG) log("loadFromEf: return results"); return results; }</code><technical_language>I code simpler if a for-each loop is below. In addition, N needed. for(AdnRecord record : andRecords)</technical_language>

Target:
private ArrayList<ArrayList> loadFromEf(int efType) { ArrayList<ArrayList> results = new ArrayList<ArrayList>(); List<AdnRecord> adnRecords = null; AdnComparator adnComparator = new AdnComparator(); if (DBG) log("loadFromEf: efType=" + efType); try { IIccPhoneBook iccIpb = IIccPhoneBook.Stub.asInterface( ServiceManager.getService("simphonebook")); if (iccIpb != null) { adnRecords = iccIpb.getAdnRecordsInEf(efType); } } catch (RemoteException ex) { } catch (SecurityException ex) { if (DBG) log(ex.toString()); } if (adnRecords != null) { List<AdnRecord> newAdn = new ArrayList<AdnRecord>(); for (AdnRecord record : adnRecords) { if (!record.isEmpty()) { newAdn.add(record); } } Collections.sort(newAdn, adnComparator); if (DBG) log("loadFromEf: results =" + newAdn); for (AdnRecord record : newAdn) { loadRecord(record, results); } } else { Log.w(TAG, "Cannot load ADN records"); results.clear(); } if (DBG) log("loadFromEf: return results"); return results; }
Source:
<code>public void setViewStartY(int viewStartY) { if (viewStartY > mMaxViewStartY) { mViewStartY = mMaxViewStartY; } else if (viewStartY < 0) { mViewStartY = 0; } else { mViewStartY = viewStartY; } <START> if (DEBUG_SCROLLING) Log.e(TAG, "setViewStartY 1099: mViewStartY=" + mViewStartY); <END> computeFirstHour(); invalidate(); }</code><technical_language>sense leave debug code in there</technical_language>

Target:
public void setViewStartY(int viewStartY) { if (viewStartY > mMaxViewStartY) { mViewStartY = mMaxViewStartY; } else if (viewStartY < 0) { mViewStartY = 0; } else { mViewStartY = viewStartY; } computeFirstHour(); invalidate(); }
Source:
<code>public Format getFormat() { return new Format(){ private final Format delegateFormat = delegate.getFormat(); @Override public ParameterValueGroup getWriteParameters() { return delegateFormat.getWriteParameters(); } @Override public String getVersion() { return delegateFormat.getVersion(); } @Override public String getVendor() { return delegateFormat.getVendor(); } @Override public ParameterValueGroup getReadParameters() { HashMap<String, String> info = new HashMap<String, String>(); info.put("name", getName()); info.put("description", getDescription()); info.put("vendor", getVendor()); info.put("docURL", getDocURL()); info.put("version", getVersion()); <START> return new ParameterGroup( <END> new DefaultParameterDescriptorGroup( info, new GeneralParameterDescriptor[] { AbstractGridFormat.BANDS })); } @Override public String getName() { return delegateFormat.getName(); } @Override public String getDocURL() { return delegateFormat.getDocURL(); } @Override public String getDescription() { return delegateFormat.getDescription(); } }; }</code><technical_language>This read delegate reads a wrapped format, expose wrapped read params, band one, band one</technical_language>

Target:
public Format getFormat() { return new Format(){ private final Format delegateFormat = delegate.getFormat(); @Override public ParameterValueGroup getWriteParameters() { return delegateFormat.getWriteParameters(); } @Override public String getVersion() { return delegateFormat.getVersion(); } @Override public String getVendor() { return delegateFormat.getVendor(); } @Override public ParameterValueGroup getReadParameters() { HashMap<String, String> info = new HashMap<String, String>(); info.put("name", getName()); info.put("description", getDescription()); info.put("vendor", getVendor()); info.put("docURL", getDocURL()); info.put("version", getVersion()); List<GeneralParameterDescriptor> delegateFormatParams = new ArrayList<GeneralParameterDescriptor>(); delegateFormatParams.addAll( delegateFormat.getReadParameters().getDescriptor().descriptors()); delegateFormatParams.add(AbstractGridFormat.BANDS); return new ParameterGroup(new DefaultParameterDescriptorGroup( info, delegateFormatParams.toArray( new GeneralParameterDescriptor[delegateFormatParams.size()]))); } @Override public String getName() { return delegateFormat.getName(); } @Override public String getDocURL() { return delegateFormat.getDocURL(); } @Override public String getDescription() { return delegateFormat.getDescription(); } }; }
Source:
<code>public void joinAsGuest(BorderPane gameBox, String nickname) { if (nickname.length() == 0) { <START> nickname = "Anon"; <END> } try { clientPlayer = new Player(ibs.newGuest(nickname)); joinGame(gameBox); } catch (RemoteException e) { e.printStackTrace(); } }</code><technical_language>throw exception instead</technical_language>

Target:
public void joinAsGuest(BorderPane gameBox, String nickname) { try { clientPlayer = new Player(ibs.newGuest(nickname)); joinGame(gameBox); } catch (RemoteException e) { e.printStackTrace(); } }
Source:
<code>public void setUp() throws IOException { <START> af = File.createTempFile("AtomicFileWriter", ".tmp"); <END> afw = new AtomicFileWriter(af, Charset.defaultCharset()); }</code><technical_language>java @Rule TemporaryFolder tmp = new TemporaryFolder(); need bother tearDown</technical_language>

Target:
public void setUp() throws IOException { af = tmp.newFile(); afw = new AtomicFileWriter(af.toPath(), Charset.defaultCharset()); }
Source:
<code>protected Set<Pair<MetricNameDto, List<PlotDatasetDto>>> fetchData(List<MetricNameDto> metricNames) { if (metricNames.isEmpty()) { return Collections.emptySet(); } Collection<MetricRawData> allRawData = getAllRawData(metricNames); if (allRawData.isEmpty()) { log.warn("No plot data found for metrics : {}", metricNames); return Collections.emptySet(); } Map<Long, Multimap<String, MetricRawData>> taskIdMetricIdRawMap = createMappedPlotDatasets(metricNames); for (MetricRawData rawData : allRawData) { String metricId = rawData.getMetricId(); Long taskId = rawData.getWorkloadTaskDataId(); taskIdMetricIdRawMap.get(taskId).put(metricId, rawData); } Multimap<MetricNameDto, PlotDatasetDto> metricNamePlotMap = ArrayListMultimap.create(); for (MetricNameDto metricName : metricNames) { for (Long taskId : metricName.getTaskIds()) { Collection<MetricRawData> rawDatas; try { rawDatas = taskIdMetricIdRawMap.get(taskId).get(metricName.getMetricName()); if (rawDatas.isEmpty()) { continue; } <START> } catch (NullPointerException e) { <END> continue; } metricNamePlotMap.put(metricName, assemble(metricName, rawDatas)); } } Set<Pair<MetricNameDto, List<PlotDatasetDto>>> resultSet = new HashSet<Pair<MetricNameDto, List<PlotDatasetDto>>>(metricNames.size()); for (MetricNameDto metricName : metricNamePlotMap.keySet()) { List<PlotDatasetDto> plotDatasetDtoList = new ArrayList<PlotDatasetDto>(metricNamePlotMap.get(metricName)); resultSet.add( Pair.of( metricName, plotDatasetDtoList )); } return resultSet; }</code><technical_language>filter null values if - catching NullPointerException is a bullshit</technical_language>

Target:
protected Set<Pair<MetricNameDto, List<PlotDatasetDto>>> fetchData(List<MetricNameDto> metricNames) { if (metricNames.isEmpty()) { return Collections.emptySet(); } Collection<MetricRawData> allRawData = getAllRawData(metricNames); if (allRawData.isEmpty()) { log.warn("No plot data found for metrics : {}", metricNames); return Collections.emptySet(); } Map<Long, Multimap<String, MetricRawData>> taskIdMetricIdRawMap = createMappedPlotDatasets(metricNames); for (MetricRawData rawData : allRawData) { String metricId = rawData.getMetricId(); Long taskId = rawData.getWorkloadTaskDataId(); taskIdMetricIdRawMap.get(taskId).put(metricId, rawData); } Multimap<MetricNameDto, PlotDatasetDto> metricNamePlotMap = ArrayListMultimap.create(); for (MetricNameDto metricName : metricNames) { for (Long taskId : metricName.getTaskIds()) { Collection<MetricRawData> rawDatas; Multimap<String, MetricRawData> multimap = taskIdMetricIdRawMap.get(taskId); if (multimap == null) { continue; } rawDatas = multimap.get(metricName.getMetricName()); if (rawDatas == null || rawDatas.isEmpty()) { continue; } metricNamePlotMap.put(metricName, assemble(metricName, rawDatas)); } } Set<Pair<MetricNameDto, List<PlotDatasetDto>>> resultSet = new HashSet<Pair<MetricNameDto, List<PlotDatasetDto>>>(metricNames.size()); for (MetricNameDto metricName : metricNamePlotMap.keySet()) { List<PlotDatasetDto> plotDatasetDtoList = new ArrayList<PlotDatasetDto>(metricNamePlotMap.get(metricName)); resultSet.add( Pair.of( metricName, plotDatasetDtoList )); } return resultSet; }
Source:
<code>public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { try { HttpServletRequest httpReq = (HttpServletRequest) req; String requestURI = httpReq.getRequestURI(); if (!Context.isAuthenticated()) { if ("GET".equalsIgnoreCase(httpReq.getMethod()) && !requestURI.contains("login.")) { if (req.getAttribute(OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR) == null) { String queryParams = httpReq.getQueryString(); String redirectUrl = requestURI + (StringUtils.isNotBlank(queryParams) ? "?" + queryParams : ""); httpReq.getSession().setAttribute(OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, redirectUrl); <START> if (log.isDebugEnabled()) { log.debug("Set " + OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR + " = " + redirectUrl); } <END> } } } } catch (Exception e) { } chain.doFilter(req, res); }</code><technical_language>suggestion log.debug("Set = {}", OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, redirectUrl);</technical_language>

Target:
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { try { HttpServletRequest httpReq = (HttpServletRequest) req; String requestURI = httpReq.getRequestURI(); if (!Context.isAuthenticated()) { if ("GET".equalsIgnoreCase(httpReq.getMethod()) && !requestURI.contains("login.")) { HttpSession session = httpReq.getSession(false); if (session != null && session.getAttribute(OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR) == null) { String queryParams = httpReq.getQueryString(); String redirectUrl = requestURI + (StringUtils.isNotBlank(queryParams) ? "?" + queryParams : ""); httpReq.getSession().setAttribute(OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, redirectUrl); if (log.isDebugEnabled()) { log.debug("Set = {}", OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, redirectUrl); } } } } } catch (Exception e) { log.warn("An error occurred while setting session attribute " + OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, e); } chain.doFilter(req, res); }
Source:
<code>private void doCancelTest(String sql) { Response response = null; Boolean isQueryCancelled; int statusCode; ExecutorService executor = Executors.newFixedThreadPool(2); Future<Boolean> executeQueryThread = executor.submit(new executeQuery(sql)); Future<Response> cancelQueryThread = executor.submit(new cancelQuery(sql)); try { isQueryCancelled = executeQueryThread.get(1, TimeUnit.MINUTES); } catch (InterruptedException | ExecutionException e) { <START> e.printStackTrace(); <END> throw new RuntimeException("error in query execution thread"); } catch (TimeoutException e) { e.printStackTrace(); executeQueryThread.cancel(true); throw new RuntimeException("query execution timelimit exceeded"); } if (!isQueryCancelled) { throw new RuntimeException("failed to cancel the query"); } try { response = cancelQueryThread.get(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("error in cancel query thread"); } if (response == null) { throw new RuntimeException("error in cancel query thread"); } statusCode = response.getStatusCode(); if (statusCode != HttpStatus.OK.code() && statusCode != HttpStatus.ACCEPTED.code() && statusCode != HttpStatus.NO_CONTENT.code()) { throw new RuntimeException("unexpected error code " + statusCode + "; reason=" + response.getStatusMessage()); } }</code><technical_language>print exception inlined new RuntimeException("..", e); instead of printStackTrace. below</technical_language>

Target:
private void doCancelTest(String sql) throws Exception { Future<Void> executeQueryThread = executor.submit(new SqlExecuteCallable(sql)); Future<Response> cancelQueryThread = executor.submit(new SqlCancelCallable(sql)); try { executeQueryThread.get(2, TimeUnit.MINUTES); } catch (TimeoutException e) { executeQueryThread.cancel(true); throw new RuntimeException("Query execution time limit exceeded", e); } Response response = cancelQueryThread.get(); assertNotNull(response, "Error in cancel query thread"); if (response.getStatusCode() != HttpStatus.OK.code() && response.getStatusCode() != HttpStatus.ACCEPTED.code() && response.getStatusCode() != HttpStatus.NO_CONTENT.code()) { fail("Unexpected error code " + response.getStatusCode() + "; reason=" + response.getStatusMessage()); } }
Source:
<code>public Boolean call() throws IOException, InterruptedException { boolean moved = false; int count = 0; int retries = admin.getConfiguration() .getInt(RegionMover.MOVE_RETRIES_MAX_KEY, RegionMover.DEFAULT_MOVE_RETRIES_MAX); int maxWaitInSeconds = admin.getConfiguration() .getInt(RegionMover.MOVE_WAIT_MAX_KEY, RegionMover.DEFAULT_MOVE_WAIT_MAX); long startTime = EnvironmentEdgeManager.currentTime(); boolean sameServer = true; isSuccessfulScan(region); LOG .info("Moving region: from to {}", region.getEncodedName(), sourceServer, targetServer); while (count < retries && sameServer) { if (count > 0) { LOG.info("Retry " + count + " of maximum " + retries); } count = count + 1; admin.move(region.getEncodedNameAsBytes(), targetServer); long maxWait = startTime + (maxWaitInSeconds * 1000); while (EnvironmentEdgeManager.currentTime() < maxWait) { sameServer = isSameServer(region, sourceServer); if (!sameServer) { break; } <START> Thread.sleep(100); <END> } } if (sameServer) { LOG.error("Region: stuck on ,newServer={}", region.getRegionNameAsString(), this.sourceServer, this.targetServer); } else { isSuccessfulScan(region); LOG.info("Moved Region " + region.getRegionNameAsString() + " cost:" + String .format("%.3f", (float) (EnvironmentEdgeManager.currentTime() - startTime) / 1000)); moved = true; movedRegions.add(region); } return moved; }</code><technical_language>interval a bit longer maxWait is in seconds</technical_language>

Target:
public Boolean call() throws IOException, InterruptedException { boolean moved = false; int count = 0; int retries = admin.getConfiguration() .getInt(RegionMover.MOVE_RETRIES_MAX_KEY, RegionMover.DEFAULT_MOVE_RETRIES_MAX); int maxWaitInSeconds = admin.getConfiguration() .getInt(RegionMover.MOVE_WAIT_MAX_KEY, RegionMover.DEFAULT_MOVE_WAIT_MAX); long startTime = EnvironmentEdgeManager.currentTime(); boolean sameServer = true; isSuccessfulScan(region); LOG.info("Moving region: from to {}", region.getRegionNameAsString(), sourceServer, targetServer); while (count < retries && sameServer) { if (count > 0) { LOG.debug("Retry of maximum for region: {}", count, retries, region.getRegionNameAsString()); } count = count + 1; admin.move(region.getEncodedNameAsBytes(), targetServer); long maxWait = startTime + (maxWaitInSeconds * 1000); while (EnvironmentEdgeManager.currentTime() < maxWait) { sameServer = isSameServer(region, sourceServer); if (!sameServer) { break; } Thread.sleep(1000); } } if (sameServer) { LOG.error("Region: stuck on for sec , newServer={}", region.getRegionNameAsString(), this.sourceServer, getTimeDiffInSec(startTime), this.targetServer); } else { isSuccessfulScan(region); LOG.info("Moved Region , cost (sec): {}", region.getRegionNameAsString(), getTimeDiffInSec(startTime)); moved = true; movedRegions.add(region); } return moved; }
Source:
<code>public AMQPMessage setAddress(String address) { internalSetAddress(address); <START> setProtonAddress(address); <END> return this; }</code><technical_language>this create simple string invoke setAddress(simplestring) , needing new methods logic encapsulated in setAddress(simplestring)</technical_language>

Target:
public AMQPMessage setAddress(String address) { setAddress(cachedAddressSimpleString(address)); return this; }
Source:
<code>public boolean store() throws OseeCoreException { <START> if (artifacts.size() > 0) { <END> for (Artifact artifact : artifacts) { artifact.setSoleAttributeValue(attributeType, dialog.getToggleState()); if (persist) { artifact.persist(getClass().getSimpleName()); } } if (persist) { SkynetTransaction transaction = TransactionManager.createTransaction(artifacts.iterator().next().getBranch(), "Prompt change boolean"); transaction.execute(); } } return true; }</code><technical_language>I a bug (code created a transaction in it). I code is intended: if (persist) { SkynetTransaction transaction = TransactionManager.createTransaction(artifacts.iterator().next().getBranch(), "Prompt change boolean"); for (Artifact artifact : artifacts) { artifact.setSoleAttributeValue(attributeType, dialog.getToggleState()); artifact.persist(transaction); } transaction.execute(); } else { for (Artifact artifact : artifacts) { artifact.setSoleAttributeValue(attributeType, dialog.getToggleState()); } }</technical_language>

Target:
public boolean store() throws OseeCoreException { if (persist) { SkynetTransaction transaction = TransactionManager.createTransaction(artifacts.iterator().next().getBranch(), "Prompt change boolean"); for (Artifact artifact : artifacts) { artifact.setSoleAttributeValue(attributeType, dialog.getToggleState()); artifact.persist(transaction); } transaction.execute(); } else { for (Artifact artifact : artifacts) { artifact.setSoleAttributeValue(attributeType, dialog.getToggleState()); } } return true; }
Source:
<code>protected void setQcowCompatByQemuImageInfo(Guid storagePoolId, Guid newImageGroupId, Guid newImageId, Guid newStorageDomainID, DiskImage diskImage) { Guid hostIdToExecuteQemuImageInfo = null; List<Pair<VM, VmDevice>> attachedVmsInfo = vmDao.getVmsWithPlugInfo(diskImage.getId()); <START> Optional<Pair<VM, VmDevice>> pair = attachedVmsInfo.stream().findFirst(); if (pair.isPresent()) { VM vm = pair.get().getFirst(); if (Boolean.TRUE.equals(pair.get().getSecond().isPlugged())) { <END> if (!vm.isDown()) { hostIdToExecuteQemuImageInfo = vm.getRunOnVds(); } } } setQcowCompat(diskImage.getImage(), storagePoolId, newImageGroupId, newImageId, newStorageDomainID, hostIdToExecuteQemuImageInfo); }</code><technical_language>If improve code comaptible java8, in command (Something this)? Guid hostIdToExecuteQemuImageInfo = vmDao.getVmsWithPlugInfo(diskImage.getId()) .stream() .filter(p -> p.getFirst().getStatus() != VMStatus.Down) .filter(p -> p.getSecond().isPlugged()).map(p -> p.getFirst().getRunOnVds()) .findFirst().orElse(null);</technical_language>

Target:
protected void setQcowCompatByQemuImageInfo(Guid storagePoolId, Guid newImageGroupId, Guid newImageId, Guid newStorageDomainID, DiskImage diskImage) { Guid hostIdToExecuteQemuImageInfo = vmDao.getVmsWithPlugInfo(diskImage.getId()) .stream() .filter(p -> !p.getFirst().isDown()) .filter(p -> p.getSecond().isPlugged()) .map(p -> p.getFirst().getRunOnVds()) .findFirst() .orElse(null); setQcowCompat(diskImage.getImage(), storagePoolId, newImageGroupId, newImageId, newStorageDomainID, hostIdToExecuteQemuImageInfo); }
Source:
<code>public boolean isIdProperty() { <START> if (isAnnotationPresent(Id.class) || super.isIdProperty()){ <END> return true; } if(getField() != null && this.getFieldName().toLowerCase(Locale.ROOT).equals("id")){ return true; } return false; }</code><technical_language>This check simplified to: java if (super.isIdProperty()) { return true; }</technical_language>

Target:
public boolean isIdProperty() { if (super.isIdProperty()){ return true; } if(getName().equals("id")){ return true; } return false; }
Source:
<code>public ContainerSpecData getContainersByContainerSpec(final String serverTemplateId, final String containerSpecId) { final ServerTemplate serverTemplate = loadServerTemplate(serverTemplateId); <START> ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecId); <END> List<Container> containers = getKieServerInstanceManager().getContainers(serverTemplate, containerSpec); return new ContainerSpecData(containerSpec, containers); }</code><technical_language>(sorry for ~the bikeshedding~ strict) ..but personally, I a PR final, I expect field a final a final. Feel free is</technical_language>

Target:
public ContainerSpecData getContainersByContainerSpec(final String serverTemplateId, final String containerSpecId) { final ServerTemplate serverTemplate = loadServerTemplate(serverTemplateId); final ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecId); final List<Container> containers = getKieServerInstanceManager().getContainers(serverTemplate, containerSpec); return new ContainerSpecData(containerSpec, containers); }
Source:
<code>public void cherryPickToSameBranchWithRebase() throws Exception { createChange(); PushOneCommit push = pushFactory.create(db, admin.getIdent(), PushOneCommit.SUBJECT, "another_file.txt", "another content"); <START> PushOneCommit.Result r = push.to(git, "refs/for/master"); <END> CherryPickInput in = new CherryPickInput(); in.destination = "master"; in.message = "it generates a new patch set\n\nChange-Id: " + r.getChangeId(); ChangeApi orig = gApi.changes() .id("p~master~" + r.getChangeId()); ChangeApi cherry = orig.revision(r.getCommit().name()) .cherryPick(in); ChangeInfo cherryInfo = cherry.get(); assertThat((Iterable<?>)cherryInfo.messages).hasSize(2); Iterator<ChangeMessageInfo> cherryIt = cherryInfo.messages.iterator(); assertThat(cherryIt.next().message).isEqualTo("Uploaded patch set 1."); assertThat(cherryIt.next().message).isEqualTo("Uploaded patch set 2."); }</code><technical_language>Assert change is parent of change</technical_language>

Target:
public void cherryPickToSameBranchWithRebase() throws Exception { PushOneCommit.Result baseChange = createChange(); RevisionApi baseRevision = gApi.changes().id("p~master~" + baseChange.getChangeId()).current(); baseRevision.review(ReviewInput.approve()); baseRevision.submit(); PushOneCommit.Result r1 = createChange(); String subject = "Test change\n\n" + "Change-Id: Ideadbeefdeadbeefdeadbeefdeadbeefdeadbeef"; PushOneCommit push = pushFactory.create(db, admin.getIdent(), subject, "another_file.txt", "another content"); PushOneCommit.Result r2 = push.to(git, "refs/for/master"); assertThat(r2.getCommit().getParents()[0].name()) .isEqualTo(r1.getCommit().name()); ChangeApi orig = gApi.changes().id("p~master~" + r2.getChangeId()); CherryPickInput in = new CherryPickInput(); in.destination = "master"; in.message = subject; ChangeApi cherry = orig.revision(r2.getCommit().name()).cherryPick(in); ChangeInfo cherryInfo = cherry.get(); assertThat((Iterable<?>)cherryInfo.messages).hasSize(2); Iterator<ChangeMessageInfo> cherryIt = cherryInfo.messages.iterator(); assertThat(cherryIt.next().message).isEqualTo("Uploaded patch set 1."); assertThat(cherryIt.next().message).isEqualTo("Uploaded patch set 2."); String newParent = cherryInfo.revisions.get(cherryInfo.currentRevision) .commit.parents.get(0).commit; assertThat(newParent).isEqualTo(baseChange.getCommit().name()); }
Source:
<code><START> default ColumnValueSelector makeColumnValueSelector(ReadableOffset offset) <END> { return new ObjectColumnSelector() { @Nullable @Override public Object getObject() { return getRowValue(offset.getOffset()); } @Override public Class classOfObject() { return getClazz(); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("column", ComplexColumn.this); } }; }</code><technical_language>remove wildcard</technical_language>

Target:
default ColumnValueSelector<?> makeColumnValueSelector(ReadableOffset offset) { return new ObjectColumnSelector() { @Nullable @Override public Object getObject() { return getRowValue(offset.getOffset()); } @Override public Class classOfObject() { return getClazz(); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("column", ComplexColumn.this); } }; }
Source:
<code>private void startRecording() { mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setOutputFile(FileUtils.getPath(this, mOutputUri)); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); try { mRecorder.prepare(); } catch (IOException e) { <START> } <END> mRecorder.start(); mVolumeChecker.run(); }</code><technical_language>Fails silently</technical_language>

Target:
private void startRecording() { mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setOutputFile(FileUtils.getPath(this, mOutputUri)); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); try { mRecorder.prepare(); } catch (IOException e) { Utils.d("Error writing file: "+e.toString()); Toast.makeText(getApplicationContext(), "An error occured at recorder preparations.", Toast.LENGTH_LONG) .show(); } mRecorder.start(); mVolumeChecker.run(); }
Source:
<code>public void setName(Context context, String name) throws SQLException { if (!permanent) getGroupService().setMetadataSingleValue(context, this, <START> MetadataSchema.DC_SCHEMA, "title", null, null, name); <END> }</code><technical_language>suggest log/throw error if attempt rename a permanent group. if UI layer (or caller) attempt, receive error message in return, instead of response</technical_language>

Target:
void setName(Context context, String name) throws SQLException { getGroupService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "title", null, null, name); }
Source:
<code>public BigDecimal getExchangeRateForBuy(String cryptoCurrency, String fiatCurrency) { if (isExchangeRateExist(cryptoCurrency, fiatCurrency)) { log.warn("{}-{} pair not supported", cryptoCurrency, fiatCurrency); return null; } try { <START> log.info("{}-{} pair SET getExchangeRateLast", cryptoCurrency, fiatCurrency); <END> setTicker(cryptoCurrency, fiatCurrency); return rateInfo.getHighestBid(); } catch (Exception e) { log.error("", e); } return null; }</code><technical_language>this trace level</technical_language>

Target:
public BigDecimal getExchangeRateForBuy(String cryptoCurrency, String fiatCurrency) { if (isExchangeRateExist(cryptoCurrency, fiatCurrency)) { log.warn("{}-{} pair not supported", cryptoCurrency, fiatCurrency); return null; } try { log.info("{}-{} pair SET getExchangeRateLast", cryptoCurrency, fiatCurrency); setTicker(cryptoCurrency, fiatCurrency); return bitKubRateInfo.getHighestBid(); } catch (Exception e) { log.error("", e); } return null; }