auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private View.OnTouchListener getConnectivityIndicatorTouchListener() { return new View.OnTouchListener() { private float initialTouchX; private float initialTouchY; private boolean isDragEvent=false; public boolean onTouch(View v,MotionEvent event) { if((event == null) || (ConnectivityIndicator.this.params == null) || (ConnectivityIndicator.this.windowManager == null)){ return false; } <START> System.out.println(event.getAction() + " , " + event.getRawX() + " , " + event.getRawY()); <END> switch(event.getAction()) { case MotionEvent.ACTION_DOWN: this.initialTouchX = event.getRawX(); this.initialTouchY = event.getRawY(); this.isDragEvent = false; return true; case MotionEvent.ACTION_UP: if(this.isDragEvent) { ConnectivityIndicator.this.currentX = ConnectivityIndicator.this.params.x; ConnectivityIndicator.this.currentY = ConnectivityIndicator.this.params.y; } return true; case MotionEvent.ACTION_MOVE: float diffX = event.getRawX() - this.initialTouchX; float diffY = event.getRawY() - this.initialTouchY; ConnectivityIndicator.this.params.x = (ConnectivityIndicator.this.currentX + (int)diffX); ConnectivityIndicator.this.params.y = (ConnectivityIndicator.this.currentY + (int)diffY); ConnectivityIndicator.this.windowManager.updateViewLayout(ConnectivityIndicator.this, ConnectivityIndicator.this.params); int slop = ViewConfiguration.get(v.getContext()).getScaledTouchSlop(); if((diffX > slop) || (diffY > slop)){ this.isDragEvent = true; } return true; } return false; } }; }</code><technical_language>Remove</technical_language>

Target:
private View.OnTouchListener getConnectivityIndicatorTouchListener() { return new View.OnTouchListener() { private float initialTouchX; private float initialTouchY; private boolean isDragEvent=false; public boolean onTouch(View v,MotionEvent event) { if ((event == null) || (ConnectivityIndicator.this.mParams == null) || (ConnectivityIndicator.this.mWindowManager == null)) { return false; } switch(event.getAction()) { case MotionEvent.ACTION_DOWN: this.initialTouchX = event.getRawX(); this.initialTouchY = event.getRawY(); this.isDragEvent = false; return true; case MotionEvent.ACTION_UP: if(this.isDragEvent) { ConnectivityIndicator.this.mCurrentX = ConnectivityIndicator.this.mParams.x; ConnectivityIndicator.this.mCurrentY = ConnectivityIndicator.this.mParams.y; } return true; case MotionEvent.ACTION_MOVE: float diffX = event.getRawX() - this.initialTouchX; float diffY = event.getRawY() - this.initialTouchY; ConnectivityIndicator.this.mParams.x = (ConnectivityIndicator.this.mCurrentX + (int)diffX); ConnectivityIndicator.this.mParams.y = (ConnectivityIndicator.this.mCurrentY + (int)diffY); ConnectivityIndicator.this.mWindowManager.updateViewLayout(ConnectivityIndicator.this, ConnectivityIndicator.this.mParams); int slop = ViewConfiguration.get(v.getContext()).getScaledTouchSlop(); if((diffX > slop) || (diffY > slop)){ this.isDragEvent = true; } return true; } return false; } }; }
Source:
<code>private void updateShareableDiskEnabled() { StorageDomain storageDomain = getStorageDomain().getSelectedItem(); <START> if (StorageType.GLUSTERFS == storageDomain.getStorageType()) { getVolumeType().setSelectedItem(VolumeType.Preallocated); } <END> if (storageDomain != null && (StorageType.GLUSTERFS == storageDomain.getStorageType() || storageDomain.getStorageType().equals(StorageType.MANAGED_BLOCK_STORAGE))) { getIsShareable().setEntity(false); getIsShareable().setIsChangeable(false, constants.shareableDiskNotSupported()); } else if (getVolumeType().getSelectedItem() == VolumeType.Sparse && storageDomain != null && storageDomain.getStorageType().isBlockDomain()) { getIsShareable().setEntity(false); getIsShareable().setIsChangeable(false, constants.shareableDiskNotSupportedByConfiguration()); } else { getIsShareable().setIsChangeable(isEditEnabled(), constants.shareableDiskNotSupportedOnRunningVM()); } }</code><technical_language>storageDomain null here, check in line 530</technical_language>

Target:
private void updateShareableDiskEnabled() { StorageDomain storageDomain = getStorageDomain().getSelectedItem(); if (storageDomain != null && (StorageType.GLUSTERFS == storageDomain.getStorageType())) { getVolumeType().setSelectedItem(VolumeType.Preallocated); } if (storageDomain != null && (StorageType.GLUSTERFS == storageDomain.getStorageType() || storageDomain.getStorageType().equals(StorageType.MANAGED_BLOCK_STORAGE))) { getIsShareable().setEntity(false); getIsShareable().setIsChangeable(false, constants.shareableDiskNotSupported()); } else if (getVolumeType().getSelectedItem() == VolumeType.Sparse && storageDomain != null && storageDomain.getStorageType().isBlockDomain()) { getIsShareable().setEntity(false); getIsShareable().setIsChangeable(false, constants.shareableDiskNotSupportedByConfiguration()); } else { getIsShareable().setIsChangeable(isEditEnabled(), constants.shareableDiskNotSupportedOnRunningVM()); } }
Source:
<code>private URI createURI(String query, Collection<? extends RequestParam> origParams) { <START> Set<RequestParam> requestParamSet = new HashSet<RequestParam>(origParams); <END> try { final URIBuilder builder = new URIBuilder(baseURL.toURI()); builder.addParameters(new ArrayList<>(convert(requestParamSet))); if (apiAccessKey != null) { builder.addParameter("key", apiAccessKey); } if (!query.isEmpty()) { builder.setPath((builder.getPath() == null? "" : builder.getPath()) + "/" + query); } return builder.build(); } catch (URISyntaxException e) { throw new RedmineInternalError(e); } }</code><technical_language>if this set creation is main reason RequestParam instances considered equal if names equal, is logic right</technical_language>

Target:
private URI createURI(String query, Collection<? extends RequestParam> origParams) { Collection<? extends RequestParam> distinctParams = distinct(origParams); Collection<? extends NameValuePair> nameValueParams = toNameValue(distinctParams); try { final URIBuilder builder = new URIBuilder(baseURL.toURI()); builder.addParameters(new ArrayList<>(nameValueParams)); if (apiAccessKey != null) { builder.addParameter("key", apiAccessKey); } if (!query.isEmpty()) { builder.setPath((builder.getPath() == null? "" : builder.getPath()) + "/" + query); } return builder.build(); } catch (URISyntaxException e) { throw new RedmineInternalError(e); } }
Source:
<code><START> int getMonth() { <END> if (isYearDay() || isLeapDay()) { return 0; } int doy = getDayOfYearAdjusted() - 1; return 1 + (doy / InternationalFixedChronology.DAYS_IN_MONTH); }</code><technical_language>more differentiable other. For thing, more ways get Leap Day</technical_language>

Target:
int getMonth() { return this.month; }
Source:
<code><START> public static void main(String[] args) throws Exception { <END> String repoPath = System.getProperty("git_repo"); if (repoPath == null) { repoPath = "."; System.out.println( "System property 'git_repo' not specified, using current directory: " + new File(repoPath).getAbsolutePath()); } try (Repository db = new FileRepository(repoPath + "/.git")) { for (String cmd : args) { List<String> result = execute(cmd, db); for (String line : result) { System.out.println(line); } } } }</code><technical_language>missing @since tag</technical_language>

Target:
public static void main(String[] args) throws Exception { String workDir = System.getProperty("git_work_tree"); if (workDir == null) { workDir = "."; System.out.println( "System property 'git_work_tree' not specified, using current directory: " + new File(workDir).getAbsolutePath()); } try (Repository db = new FileRepository(workDir + "/.git")) { for (String cmd : args) { List<String> result = execute(cmd, db); for (String line : result) { System.out.println(line); } } } }
Source:
<code>public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId, int reqWidth, int reqHeight, boolean keepAspectRatio, Cache cache) { final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeResource(res, resId, options); <START> options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight, keepAspectRatio); <END> END_INCLUDE (read_bitmap_dimensions) if (Utils.hasHoneycomb()) { addInBitmapOptions(options, cache); } options.inJustDecodeBounds = false; Bitmap bitmap = null; InputStream is = null; try { final TypedValue value = new TypedValue(); is = res.openRawResource(resId, value); bitmap = BitmapFactory.decodeResourceStream(res, value, is, null, options); } catch (Exception e) { } if (bitmap == null && options != null && options.inBitmap != null) { throw new IllegalArgumentException("Problem decoding into existing bitmap"); } ExifInterface ei = getExifInterface(is); return scaleAndRotateBitmap(bitmap, ei, reqWidth, reqHeight, keepAspectRatio); }</code><technical_language>Consider this calculateInSampleSize JS (unify params) write tests</technical_language>

Target:
public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId, int reqWidth, int reqHeight, boolean keepAspectRatio, Cache cache) { final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeResource(res, resId, options); options.inSampleSize = calculateInSampleSize(options.outWidth, options.outHeight, reqWidth, reqHeight); END_INCLUDE (read_bitmap_dimensions) if (Utils.hasHoneycomb()) { addInBitmapOptions(options, cache); } options.inJustDecodeBounds = false; Bitmap bitmap = null; InputStream is = null; try { final TypedValue value = new TypedValue(); is = res.openRawResource(resId, value); bitmap = BitmapFactory.decodeResourceStream(res, value, is, null, options); } catch (Exception e) { } if (bitmap == null && options != null && options.inBitmap != null) { throw new IllegalArgumentException("Problem decoding into existing bitmap"); } ExifInterface ei = getExifInterface(is); return scaleAndRotateBitmap(bitmap, ei, reqWidth, reqHeight, keepAspectRatio); }
Source:
<code><START> public void analyzeBranch( <END> Project project, List<FilePattern> filePatterns, List<SourceCodeFileAnalyzerPlugin> sourceCodeFileAnalyzerPlugins, String branchName) { long projectId = project.getId(); List<Commit> commits = getCommitsInProjectPort.getNonAnalyzedSortedByTimestampAscWithNoParents( projectId, filePatterns, branchName); if (commits.isEmpty() || sourceCodeFileAnalyzerPlugins.isEmpty()) { return; } List<Long> commitIds = new ArrayList<>(); Map<Long, List<MetricValue>> fileMetrics = saveMetricPort.getMetricsForFiles(projectId, branchName); for (int i = 0; i < commits.size() && activeAnalysis.get(projectId); i++) { List<MetricValue> metrics = analyzeCommitUseCase.analyzeCommit( commits.get(i), project, sourceCodeFileAnalyzerPlugins); zeroOutMissingMetrics(commits.get(i), metrics, fileMetrics); if (!metrics.isEmpty()) { saveMetricPort.saveMetricValues(metrics); saveCommitPort.setCommitsWithIDsAsAnalyzed(commitIds); commitIds.clear(); } commitIds.add(commits.get(i).getId()); log(commits.get(i)); } if (!getAvailableMetricsInProjectPort.get(projectId).isEmpty()) { saveCommitPort.setCommitsWithIDsAsAnalyzed(commitIds); } }</code><technical_language>this method private</technical_language>

Target:
private void analyzeBranch( Project project, List<FilePattern> filePatterns, List<SourceCodeFileAnalyzerPlugin> sourceCodeFileAnalyzerPlugins, String branchName) { long projectId = project.getId(); List<Commit> commits = getCommitsInProjectPort.getNonAnalyzedSortedByTimestampAscWithNoParents( projectId, filePatterns, branchName); if (commits.isEmpty() || sourceCodeFileAnalyzerPlugins.isEmpty()) { return; } List<Long> commitIds = new ArrayList<>(); Map<Long, List<MetricValue>> fileMetrics = saveMetricPort.getMetricsForFiles(projectId, branchName); for (int i = 0; i < commits.size() && activeAnalysis.get(projectId); i++) { List<MetricValue> metrics = analyzeCommitUseCase.analyzeCommit( commits.get(i), project, sourceCodeFileAnalyzerPlugins); zeroOutMissingMetrics(commits.get(i), metrics, fileMetrics); if (!metrics.isEmpty()) { saveMetricPort.saveMetricValues(metrics); saveCommitPort.setCommitsWithIDsAsAnalyzed(commitIds); commitIds.clear(); } commitIds.add(commits.get(i).getId()); log(commits.get(i)); } if (!getAvailableMetricsInProjectPort.get(projectId).isEmpty()) { saveCommitPort.setCommitsWithIDsAsAnalyzed(commitIds); } }
Source:
<code>private void verifyLogs(int[][] expectedLogs, List<ActivityLogEntry> actualLogs) { List<String> expectedMsgs = generateExpectedMsgFrom(expectedLogs); assertEquals(expectedMsgs.size(), actualLogs.size()); for (int i = 0; i < expectedMsgs.size(); i++) { String actualMsg = actualLogs.get(i).generateLogMessage(); <START> assertTrue("expecte: " + expectedMsgs.get(i) + "to contain:" + actualMsg, <END> expectedMsgs.get(i).contains(actualMsg)); } }</code><technical_language>is a small typo here. expect :P, change it</technical_language>

Target:
private void verifyLogs(int[][] expectedLogs, List<ActivityLogEntry> actualLogs) { List<String> expectedMsgs = generateExpectedMsgFrom(expectedLogs); assertEquals(expectedMsgs.size(), actualLogs.size()); for (int i = 0; i < expectedMsgs.size(); i++) { String actualMsg = actualLogs.get(i).generateLogMessage(); assertTrue("expect: " + expectedMsgs.get(i) + "to contain:" + actualMsg, expectedMsgs.get(i).contains(actualMsg)); } }
Source:
<code>private boolean propertiesRequiringVmUpdateDeviceWereUpdated() { return (!StringUtils.equals(oldIface.getNetworkName(), getNetworkName())) || oldIface.isLinked() != getInterface().isLinked() <START> || !StringUtils.equals(oldIface.getCustomProperties(), getInterface().getCustomProperties()); <END> }</code><technical_language>mentioned in previous patch, this comparison fail for properties: aaa=bbb, xxx=yyy xxx=yyy, aaa=bbb - condition fail</technical_language>

Target:
private boolean propertiesRequiringVmUpdateDeviceWereUpdated() { return (!StringUtils.equals(oldIface.getNetworkName(), getNetworkName())) || oldIface.isLinked() != getInterface().isLinked() || !ObjectUtils.objectsEqual(oldIface.getCustomProperties(), getInterface().getCustomProperties()); }
Source:
<code>private static HeldLocksToken acquireLock(LockService lockService, LockRequest lockRequest) { int failureCount = 0; while (true) { HeldLocksToken response; try { response = lockService.lockAndGetHeldLocks(LockClient.ANONYMOUS.getClientId(), lockRequest); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } if (response == null) { RuntimeException ex = new LockAcquisitionException( "Failed to lock using the provided lock request: " + lockRequest); <START> switch (lockRequest.getBlockingMode()) { <END> case DO_NOT_BLOCK: log.debug("Could not lock successfully", ex); break; case BLOCK_UNTIL_TIMEOUT: case BLOCK_INDEFINITELY: case BLOCK_INDEFINITELY_THEN_RELEASE: log.warn("Could not lock successfully", ex); break; } ++failureCount; if (failureCount >= NUM_RETRIES) { log.warn("Failing after tries", failureCount, ex); throw ex; } } else { return response; } } }</code><technical_language>nit: Put in a separate method called "handleCouldNotLock"</technical_language>

Target:
private static HeldLocksToken acquireLock(LockService lockService, LockRequest lockRequest) { int failureCount = 0; while (true) { HeldLocksToken response; try { response = lockService.lockAndGetHeldLocks(LockClient.ANONYMOUS.getClientId(), lockRequest); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } if (response == null) { RuntimeException ex = new LockAcquisitionException( "Failed to lock using the provided lock request: " + lockRequest); switch (lockRequest.getBlockingMode()) { case DO_NOT_BLOCK: log.debug("Could not lock successfully", ex); throw ex; case BLOCK_UNTIL_TIMEOUT: case BLOCK_INDEFINITELY: case BLOCK_INDEFINITELY_THEN_RELEASE: log.warn("Could not lock successfully", ex); ++failureCount; if (failureCount >= NUM_RETRIES) { log.warn("Failing after tries", failureCount, ex); throw ex; } break; } } else { return response; } } }
Source:
<code><START> private void checkFeaturesOnNode(int nodeIdx) throws InterruptedException { <END> Ignite ignite = ignite(nodeIdx); ClusterGroup locCluster = ignite.cluster().forNodeIds(Collections.singletonList(ignite.cluster().localNode().id())); IgniteCompute compute = ignite.compute(locCluster); CountDownLatch runLatch = new CountDownLatch(1); compute.broadcast(runLatch::countDown); runLatch.await(); IgniteServices services = ignite.services(locCluster); String svcName = "service-" + nodeIdx; assertNull("Service unexpectedly present before deployment", services.service(svcName)); services.deployClusterSingleton(svcName, new DummyService()); assertNotNull("Service unexpectedly not present", services.service(svcName)); services.cancel(svcName); assertNull("Service unexpectedly present after cancellation", services.service(svcName)); String queueName = "queue-" + nodeIdx; try (IgniteQueue<String> queue = ignite.queue(queueName, 3, new CollectionConfiguration())) { assertTrue("Queue is unexpectedly not empty after creation", queue.isEmpty()); queue.put("1"); queue.put("2"); queue.put("3"); assertEquals("Unexpected queue element", "1", queue.poll()); assertEquals("Unexpected queue element", "2", queue.poll()); assertEquals("Unexpected queue element", "3", queue.poll()); assertTrue("Queue is unexpectedly not empty after polling", queue.isEmpty()); } }</code><technical_language>I this code mess. split this one-per-feature check methods</technical_language>

Target:
private void checkFeaturesOnNode(int nodeIdx) throws InterruptedException { checkComputeOnNode(nodeIdx); checkServicesOnNode(nodeIdx); checkDataStructuresOnNode(nodeIdx); }
Source:
<code>static public junit.framework.Test suite() throws Exception { LocalCluster config; Map<String, String> additionalEnv = new HashMap<>(); String bundleLocation = System.getProperty("user.dir") + "/bundles"; System.out.println("Bundle location is: " + bundleLocation); <START> additionalEnv.put("voltdbbundlelocation", bundleLocation); <END> final MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestImportSuite.class); VoltProjectBuilder project = generateVoltProject(true, false); config = new LocalCluster("import-ddl-cluster-rep.jar", 4, 1, 0, BackendTarget.NATIVE_EE_JNI, LocalCluster.FailureState.ALL_RUNNING, true, false, additionalEnv); config.setHasLocalServer(false); boolean compile = config.compile(project); assertTrue(compile); builder.addServerConfig(config, false); return builder; }</code><technical_language>If making a public static constant for voltdbbundlelocation please it</technical_language>

Target:
static public junit.framework.Test suite() throws Exception { LocalCluster config; Map<String, String> additionalEnv = new HashMap<>(); String bundleLocation = System.getProperty("user.dir") + "/bundles"; System.out.println("Bundle location is: " + bundleLocation); additionalEnv.put(CatalogUtil.VOLTDB_BUNDLE_LOCATION_PROPERTY_NAME, bundleLocation); final MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestImportSuite.class); VoltProjectBuilder project = generateVoltProject(true, false); config = new LocalCluster("import-ddl-cluster-rep.jar", 4, 1, 0, BackendTarget.NATIVE_EE_JNI, LocalCluster.FailureState.ALL_RUNNING, true, false, additionalEnv); config.setHasLocalServer(false); boolean compile = config.compile(project); assertTrue(compile); builder.addServerConfig(config, false); return builder; }
Source:
<code>public String toString() { return <START> String.format("AxisRange[%d, %d]", <END> getLower(), getUpper()); }</code><technical_language>I needs %f for floating point</technical_language>

Target:
public String toString() { return String.format("AxisRange[%f, %f]", getLower(), getUpper()); }
Source:
<code>private void scheduleFilter(CallFilter filter) { CallFilteringResult result = new CallFilteringResult.Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldSilence(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); for (CallFilter dependencyFilter : filter.getDependencies()) { result = result.combine(dependencyFilter.getResult()); } mCurrentResult = result; final CallFilteringResult input = result; CompletableFuture<CallFilteringResult> startFuture = CompletableFuture.completedFuture(input); PostFilterTask postFilterTask = new PostFilterTask(filter); startFuture.thenComposeAsync(filter::startFilterLookup, mExecutor) <START> .whenCompleteAsync((x, <END> e) -> postFilterTask.whenDone(x), mExecutor); }</code><technical_language>If exception previous stage, this thenApplyAsync</technical_language>

Target:
private void scheduleFilter(CallFilter filter) { CallFilteringResult result = new CallFilteringResult.Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldSilence(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); for (CallFilter dependencyFilter : filter.getDependencies()) { result = result.combine(dependencyFilter.getResult()); } mCurrentResult = result; final CallFilteringResult input = result; CompletableFuture<CallFilteringResult> startFuture = CompletableFuture.completedFuture(input); PostFilterTask postFilterTask = new PostFilterTask(filter); startFuture.thenComposeAsync(filter::startFilterLookup, mExecutor) .thenApplyAsync(postFilterTask::whenDone, mExecutor); }
Source:
<code>private static @NonNull Set<@NonNull Entry<String, Set<String>>> getSsNames(SWTBotView bot) { SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(bot.bot()); <START> SWTBotTimeGraphEntry[] traceEntries = timeGraph.getEntries(); <END> SWTBotTimeGraphEntry trace = timeGraph.getEntry("synthetic-trace"); assertEquals("State system explorer should have a single trace entry: " + Arrays.toString(traceEntries), 1, traceEntries.length); SWTBotTimeGraphEntry[] modules = trace.getEntries(); Map<String, Set<String>> modulesToStateSystems = new HashMap<>(); for (SWTBotTimeGraphEntry module : modules) { Set<String> stateSystems = new HashSet<>(); for (SWTBotTimeGraphEntry stateSystem : module.getEntries()) { stateSystems.add(stateSystem.getText()); } modulesToStateSystems.put(module.getText(), stateSystems); } return modulesToStateSystems.entrySet(); }</code><technical_language>if happen safer move this line specific getEntry() a waitUntil</technical_language>

Target:
private static @NonNull Set<@NonNull Entry<String, Set<String>>> getSsNames(SWTBotView bot) { SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(bot.bot()); SWTBotTimeGraphEntry trace = timeGraph.getEntry("synthetic-trace"); SWTBotTimeGraphEntry[] traceEntries = timeGraph.getEntries(); assertEquals("State system explorer should have a single trace entry: " + Arrays.toString(traceEntries), 1, traceEntries.length); SWTBotTimeGraphEntry[] modules = trace.getEntries(); Map<String, Set<String>> modulesToStateSystems = new HashMap<>(); for (SWTBotTimeGraphEntry module : modules) { Set<String> stateSystems = new HashSet<>(); for (SWTBotTimeGraphEntry stateSystem : module.getEntries()) { stateSystems.add(stateSystem.getText()); } modulesToStateSystems.put(module.getText(), stateSystems); } return modulesToStateSystems.entrySet(); }
Source:
<code>private void startPlayback() { if (player != null) { switch (player.getPlaybackState()) { case Player.STATE_IDLE: case Player.STATE_ENDED: initializePlayer(); break; case Player.STATE_BUFFERING: case Player.STATE_READY: if (!player.getPlayWhenReady()) { setPlayWhenReady(true); } break; default: break; } } else { initializePlayer(); } if (!disableFocus) { <START> setKeepScreenOn(true && preventsDisplaySleepDuringVideoPlayback); <END> } }</code><technical_language>remove this true do :)</technical_language>

Target:
private void startPlayback() { if (player != null) { switch (player.getPlaybackState()) { case Player.STATE_IDLE: case Player.STATE_ENDED: initializePlayer(); break; case Player.STATE_BUFFERING: case Player.STATE_READY: if (!player.getPlayWhenReady()) { setPlayWhenReady(true); } break; default: break; } } else { initializePlayer(); } if (!disableFocus) { setKeepScreenOn(preventsDisplaySleepDuringVideoPlayback); } }
Source:
<code>public void registerMessageGroupExpiryCallback(MessageGroupCallback callback) { if (callback instanceof UniqueExpiryCallback) { boolean uniqueExpiryCallbackPresent = this.expiryCallbacks.stream() .anyMatch(UniqueExpiryCallback.class::isInstance); Assert.isTrue(!uniqueExpiryCallbackPresent, "Only one instance of 'UniqueExpiryCallback' can be registered in the 'MessageGroupStore'." + " Use separate 'MessageGroupStore' for each aggregator/resequencer."); <START> } <END> this.expiryCallbacks.add(callback); }</code><technical_language>logger.error() in 5.1 assert in 5.2</technical_language>

Target:
public void registerMessageGroupExpiryCallback(MessageGroupCallback callback) { if (callback instanceof UniqueExpiryCallback) { boolean uniqueExpiryCallbackPresent = this.expiryCallbacks.stream() .anyMatch(UniqueExpiryCallback.class::isInstance); if (!uniqueExpiryCallbackPresent && this.logger.isErrorEnabled()) { this.logger.error("Only one instance of 'UniqueExpiryCallback' can be registered in the " + "'MessageGroupStore'. Use a separate 'MessageGroupStore' for each aggregator/resequencer."); } } this.expiryCallbacks.add(callback); }
Source:
<code><START> public boolean equals(Object obj) { <END> return obj instanceof TypeInInputLibraryLocation && ((TypeInInputLibraryLocation) obj).inputLibLoc.equals(inputLibLoc) && ((TypeInInputLibraryLocation) obj).typeName.equals(typeName); }</code><technical_language>final</technical_language>

Target:
public final boolean equals(Object obj) { return obj instanceof TypeInInputLibraryLocation && ((TypeInInputLibraryLocation) obj).inputLibLoc.equals(inputLibLoc) && ((TypeInInputLibraryLocation) obj).typeName.equals(typeName); }
Source:
<code>public CompilationUnitDeclaration dietParse(ICompilationUnit sourceUnit, CompilationResult compilationResult) { CompilationUnitDeclaration parsedUnit; boolean old = this.diet; try { this.dietInt = 0; this.diet = true; parsedUnit = parse(sourceUnit, compilationResult); } finally { <START> this.diet = old; <END> } return parsedUnit; }</code><technical_language>I dietInt needs reset, too</technical_language>

Target:
public CompilationUnitDeclaration dietParse(ICompilationUnit sourceUnit, CompilationResult compilationResult) { CompilationUnitDeclaration parsedUnit; boolean old = this.diet; int oldInt = this.dietInt; try { this.dietInt = 0; this.diet = true; parsedUnit = parse(sourceUnit, compilationResult); } finally { this.diet = old; this.dietInt = oldInt; } return parsedUnit; }
Source:
<code>public void testPrepareResponse() { try { reservationReportPdfStamperView.prepareResponse(request, response); assertThat(response.getCharacterEncoding(), is( StandardCharsets.UTF_8.name())); } catch (Exception e) { e.printStackTrace(); fail(); } <START> } <END></code><technical_language>[x] checked call super.prepareResponse? <LINK_0></technical_language>

Target:
public void testPrepareResponse() { HttpServletRequest request = new MockHttpServletRequest(); HttpServletResponse response = new MockHttpServletResponse(); reservationReportPdfStamperView.prepareResponse(request, response); assertThat(response.getHeader("Pragma"), is("private")); assertThat(response.getHeader("Cache-Control"), is( "private, must-revalidate")); assertThat(response.getCharacterEncoding(), is(StandardCharsets.UTF_8 .name())); }
Source:
<code>public int hashCode() { <START> return ((int) this.intermediateDataSetID.getLowerPart()) ^ <END> ((int) (this.intermediateDataSetID.getLowerPart() >>> 32)) ^ ((int) this.intermediateDataSetID.getUpperPart()) ^ ((int) (this.intermediateDataSetID.getUpperPart() >>> 32)) ^ (this.partitionNum); }</code><technical_language>consider implement IntermediateResultPartitionID#hashCode(...)</technical_language>

Target:
public int hashCode() { return this.intermediateDataSetID.hashCode() ^ this.partitionNum; }
Source:
<code>public void execute(Task task, TaskActionInformation actionInformation, TaskContext taskContext) throws TaskHandlerException { <START> LOGGER.info("Executing the action with name: from the task with name: {}", actionInformation.getName(), task.getName()); <END> this.keyEvaluator = new KeyEvaluator(taskContext); ActionEvent action = getActionEvent(actionInformation); Map<String, Object> parameters = createParameters(actionInformation, action); if (action.hasService() && bundleContext != null) { if (callActionServiceMethod(action, parameters)) { LOGGER.info("The action with name: from the task with name: was executed", actionInformation.getName(), task.getName()); return; } activityService.addWarning(task, "task.warning.serviceUnavailable", action.getServiceInterface()); } if (!action.hasSubject()) { throw new TaskHandlerException(ACTION, "task.error.cantExecuteAction"); } else { eventRelay.sendEventMessage(new MotechEvent(action.getSubject(), parameters)); } }</code><technical_language>Executing task action task {}</technical_language>

Target:
public void execute(Task task, TaskActionInformation actionInformation, TaskContext taskContext) throws TaskHandlerException { LOGGER.info("Executing task action: from task: {}", actionInformation.getName(), task.getName()); this.keyEvaluator = new KeyEvaluator(taskContext); ActionEvent action = getActionEvent(actionInformation); Map<String, Object> parameters = createParameters(actionInformation, action); LOGGER.debug("Parameters created: for task action: {}", parameters.toString(), action.getName()); if (action.hasService() && bundleContext != null) { if (callActionServiceMethod(action, parameters)) { LOGGER.info("Action: from task: was executed through an OSGi service call", actionInformation.getName(), task.getName()); return; } LOGGER.info("There is no service: {}", action.getServiceInterface()); activityService.addWarning(task, "task.warning.serviceUnavailable", action.getServiceInterface()); } if (!action.hasSubject()) { throw new TaskHandlerException(ACTION, "task.error.cantExecuteAction"); } else { LOGGER.info("Event: was sent", action.getSubject()); eventRelay.sendEventMessage(new MotechEvent(action.getSubject(), parameters)); } }
Source:
<code>public KeyAsyncClient buildAsyncClient() { Configuration buildConfiguration = (configuration == null) ? ConfigurationManager.getConfiguration().clone() : configuration; URL buildEndpoint = getBuildEndpoint(buildConfiguration); if (buildEndpoint == null) { throw new IllegalStateException(KeyVaultErrorCodeStrings.getErrorString(KeyVaultErrorCodeStrings.VAULT_END_POINT_REQUIRED)); } if (pipeline != null) { return new KeyAsyncClient(endpoint, pipeline); } if (credential == null) { throw new IllegalStateException(KeyVaultErrorCodeStrings.getErrorString(KeyVaultErrorCodeStrings.CREDENTIAL_REQUIRED)); } final List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(AzureKeyVaultConfiguration.SDK_NAME, AzureKeyVaultConfiguration.SDK_VERSION, buildConfiguration)); policies.add(retryPolicy); policies.add(new BearerTokenAuthenticationPolicy(credential, KeyAsyncClient.KEY_VAULT_SCOPE)); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogDetailLevel)); <START> <END> HttpPipeline pipeline = HttpPipeline.builder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new KeyAsyncClient(endpoint, pipeline); }</code><technical_language>a 'beforeRetryPolicies' line add</technical_language>

Target:
public KeyAsyncClient buildAsyncClient() { Configuration buildConfiguration = (configuration == null) ? ConfigurationManager.getConfiguration().clone() : configuration; URL buildEndpoint = getBuildEndpoint(buildConfiguration); if (buildEndpoint == null) { throw new IllegalStateException(KeyVaultErrorCodeStrings.getErrorString(KeyVaultErrorCodeStrings.VAULT_END_POINT_REQUIRED)); } if (pipeline != null) { return new KeyAsyncClient(endpoint, pipeline); } if (credential == null) { throw new IllegalStateException(KeyVaultErrorCodeStrings.getErrorString(KeyVaultErrorCodeStrings.CREDENTIAL_REQUIRED)); } final List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(AzureKeyVaultConfiguration.SDK_NAME, AzureKeyVaultConfiguration.SDK_VERSION, buildConfiguration)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new BearerTokenAuthenticationPolicy(credential, KeyAsyncClient.KEY_VAULT_SCOPE)); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogDetailLevel)); HttpPipeline pipeline = new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new KeyAsyncClient(endpoint, pipeline); }
Source:
<code>public Page<WorkflowItemRest> findBySubmitter(@Parameter(value = "uuid") UUID submitterID, Pageable pageable) { List<XmlWorkflowItem> witems = null; try { Context context = obtainContext(); EPerson ep = epersonService.find(context, submitterID); witems = wis.findBySubmitter(context, ep); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } <START> Page<WorkflowItemRest> page = utils.getPage(witems, pageable).map(converter); <END> return page; }</code><technical_language>Instead of retrieving workspace items limiting fact, limit number of items retrieved database</technical_language>

Target:
public Page<WorkflowItemRest> findBySubmitter(@Parameter(value = "uuid") UUID submitterID, Pageable pageable) { List<XmlWorkflowItem> witems = null; int total = 0; try { Context context = obtainContext(); EPerson ep = epersonService.find(context, submitterID); witems = wis.findBySubmitter(context, ep, pageable.getPageNumber(), pageable.getPageSize()); total = wis.countBySubmitter(context, ep); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } Page<WorkflowItemRest> page = new PageImpl<XmlWorkflowItem>(witems, pageable, total).map(converter); return page; }
Source:
<code><START> public Version getVersion() { <END> return version; }</code><technical_language>I return a string here</technical_language>

Target:
public String getVersion() { return version; }
Source:
<code>private static void setBloomFilter(Statistics stats, org.apache.parquet.column.statistics.Statistics statistics) { if (!(statistics instanceof BloomFilterStatistics)) { return; <START> } <END> BloomFilterStatistics bfStatistics = (BloomFilterStatistics) statistics; if (!bfStatistics.isBloomFilterEnabled()) { return; } else { stats.setBloom_filter_enabled(true); } BloomFilterStats bfStats = stats.getBloom_filter_stats(); if (bfStats == null) { bfStats = new BloomFilterStats(bfStatistics.getBitSet(), bfStatistics.getBloomFilter().getNumBits(), bfStatistics.getBloomFilter().getNumHashFunctions()); stats.setBloom_filter_stats(bfStats); return; } if (bfStats.getNumBits() != bfStatistics.getBloomFilter().getBitSize() || bfStats.getNumHashFunctions() != bfStatistics.getBloomFilter().getNumHashFunctions()) { throw new RuntimeException("Inconsistent configuration for bloom filter"); } bfStats.setBitSet(bfStatistics.getBitSet()); }</code><technical_language>I follow need this test define signature of this method this way. convert type other</technical_language>

Target:
private static void setBloomFilter( Statistics stats, org.apache.parquet.column.statistics.Statistics statistics) { if (!(statistics instanceof BloomFilterStatistics) || !((BloomFilterStatistics) statistics) .isBloomFilterEnabled()) { stats.setBloom_filter(null); } else { BloomFilterStatistics bfStatistics = (BloomFilterStatistics) statistics; BloomFilter bfStats = new BloomFilter(serializeLongArray(bfStatistics.getBloomFilter().getBitSet()), bfStatistics.getBloomFilter().getNumBits(), bfStatistics.getBloomFilter().getNumHashFunctions(), BloomFilterStrategy.MURMUR128_32); stats.setBloom_filter(bfStats); } }
Source:
<code>protected LinkedHashSet<Class<? extends BaseTypeChecker>> getImmediateSubcheckerClasses() { LinkedHashSet<Class<? extends BaseTypeChecker>> checkers = super.getImmediateSubcheckerClasses(); <START> AliasAnalysis[] aliasAnalyses = createAliasAnalyses(); <END> for (AliasAnalysis aliasAnalysis : aliasAnalyses) { switch (aliasAnalysis) { case RETURNS_RECEIVER: checkers.add(ReturnsReceiverChecker.class); break; } } return checkers; }</code><technical_language>This is coded if enabling AliasAnalysis require enabling a sub-checker. Is intention? future alias reasoning look. In case, this code clearer for checking if aliasAnalyses contains RETURNS_RECEIVER, looping a switch</technical_language>

Target:
protected LinkedHashSet<Class<? extends BaseTypeChecker>> getImmediateSubcheckerClasses() { LinkedHashSet<Class<? extends BaseTypeChecker>> checkers = super.getImmediateSubcheckerClasses(); if (isEnabled(AliasAnalysis.RETURNS_RECEIVER)) { checkers.add(ReturnsReceiverChecker.class); } return checkers; }
Source:
<code>public void testObservableRemoved() throws CacheException { InfinispanPropertyCache cache = createCache(); CountingObserver observer = new CountingObserver(); cache.addObserver(null, "id1", observer); cache.store(null, new Property<>("id1", 2)); Assert.assertEquals(0, observer.removedCounter.intValue()); cache.store(null, new Property<>("id1", 2)); Assert.assertEquals(0, observer.removedCounter.intValue()); cache.store(null, new Property<>("id1", 111)); Assert.assertEquals(0, observer.removedCounter.intValue()); cache.remove(null, "id1"); Assert.assertEquals(1, observer.removedCounter.intValue()); cache.remove(null, "id1"); Assert.assertEquals(1, observer.removedCounter.intValue()); cache.store(null, new Property<>("id1", 222)); cache.remove(null, "id1"); <START> Assert.assertEquals(1, observer.removedCounter.intValue()); <END> }</code><technical_language>I this 2, possibly moment due removal of property removing observer. is sorted, I this need 2</technical_language>

Target:
public void testObservableRemoved() throws CacheException { CountingObserver observer = new CountingObserver(); propertyCache.addObserver(null, "id1", observer); propertyCache.store(null, new Property<>("id1", 2)); Assert.assertEquals(0, observer.removedCounter.intValue()); propertyCache.store(null, new Property<>("id1", 111)); Assert.assertEquals(0, observer.removedCounter.intValue()); propertyCache.remove(null, "id1"); Assert.assertEquals(1, observer.removedCounter.intValue()); propertyCache.remove(null, "id1"); Assert.assertEquals(1, observer.removedCounter.intValue()); propertyCache.store(null, new Property<>("id1", 222)); propertyCache.remove(null, "id1"); Assert.assertEquals(2, observer.removedCounter.intValue()); }
Source:
<code>private static boolean equals(final RawText a, final int ai, final RawText b, final int bi) { if (a.hashes.get(ai) != b.hashes.get(bi)) return false; int as = a.lines.get(ai); int bs = b.lines.get(bi); int ae = a.lines.get(ai + 1); int be = b.lines.get(bi + 1); as = trimLeadingWhitespace(a.content, as, ae); bs = trimLeadingWhitespace(b.content, bs, be); ae = trimTrailingWhitespace(a.content, as, ae); be = trimTrailingWhitespace(b.content, bs, be); while (as < ae && bs < be) { byte ac = a.content[as]; byte bc = b.content[bs]; while (as < ae - 1 && isWhitespace(ac)) { as++; ac = a.content[as]; } while (bs < be - 1 && isWhitespace(bc)) { bs++; bc = b.content[bs]; } if (ac != bc) return false; as++; bs++; } <START> return true; <END> }</code><technical_language>a is "foo" b is "f"? breaking out early bs == iteration return true, strings equal</technical_language>

Target:
private static boolean equals(final RawText a, final int ai, final RawText b, final int bi) { if (a.hashes.get(ai) != b.hashes.get(bi)) return false; int as = a.lines.get(ai); int bs = b.lines.get(bi); int ae = a.lines.get(ai + 1); int be = b.lines.get(bi + 1); as = trimLeadingWhitespace(a.content, as, ae); bs = trimLeadingWhitespace(b.content, bs, be); ae = trimTrailingWhitespace(a.content, as, ae); be = trimTrailingWhitespace(b.content, bs, be); while (as < ae && bs < be) { byte ac = a.content[as]; byte bc = b.content[bs]; while (as < ae - 1 && isWhitespace(ac)) { as++; ac = a.content[as]; } while (bs < be - 1 && isWhitespace(bc)) { bs++; bc = b.content[bs]; } if (ac != bc) return false; as++; bs++; } return ae - as == be - bs; }
Source:
<code>public boolean nameMatchesAny(List<String> names) { <START> for (String name : names) { <END> if (getName().equals(name)) { return true; } } return false; }</code><technical_language>java return names.contains(getName());</technical_language>

Target:
public boolean nameMatchesAny(List<String> names) { return names.contains(getName()); }
Source:
<code>public static boolean findPatternInFile(final File file, final String pattern) { Pattern regexp = Pattern.compile(pattern); Matcher matcher = regexp.matcher(""); try { <START> for (String line : Files.readAllLines(file.toPath())) { <END> matcher.reset(line); if (matcher.find()) { return true; } } } catch (FileNotFoundException e) { throw new IllegalArgumentException(e); } catch (IOException e) { throw new RuntimeException(e); } return false; }</code><technical_language>this call requires a charset in Java 7. single arg version added in Java 8 is unavailable in master</technical_language>

Target:
public static boolean findPatternInFile(final File file, final String pattern) { Pattern regexp = Pattern.compile(pattern); Matcher matcher = regexp.matcher(""); try { for (String line : Files.readAllLines(file.toPath(), StandardCharsets.UTF_8)) { matcher.reset(line); if (matcher.find()) { return true; } } } catch (FileNotFoundException e) { throw new IllegalArgumentException(e); } catch (IOException e) { throw new RuntimeException(e); } return false; }
Source:
<code>private synchronized void releaseExportBytes(long releaseSeqNo, int tuplesSent) throws IOException { if (!m_committedBuffers.isEmpty() && releaseSeqNo < m_committedBuffers.peek().startSequenceNumber()) { tuplesSent = 0; } if (m_lastReleasedSeqNo == releaseSeqNo) { tuplesSent = 0; } long lastSeqNo = 0; while (!m_committedBuffers.isEmpty() && releaseSeqNo >= m_committedBuffers.peek().startSequenceNumber()) { StreamBlock sb = m_committedBuffers.peek(); <START> if (releaseSeqNo >= sb.startSequenceNumber() + sb.rowCount() - 1) { <END> m_committedBuffers.pop(); try { lastSeqNo = sb.startSequenceNumber() + sb.rowCount() - 1; } finally { sb.discard(); } } else if (releaseSeqNo >= sb.startSequenceNumber()) { sb.releaseTo(releaseSeqNo); lastSeqNo = releaseSeqNo; break; } } m_lastReleasedSeqNo = releaseSeqNo; m_gapTracker.truncate(releaseSeqNo); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncate tracker via ack to:" + releaseSeqNo + " now is " + m_gapTracker.toString()); } if (m_committedBuffers.isEmpty()) { lastSeqNo = releaseSeqNo; } m_firstUnpolledSeqNo = Math.max(m_firstUnpolledSeqNo, lastSeqNo + 1); int pendingCount = m_tuplesPending.get(); m_tuplesPending.set(pendingCount - tuplesSent); return; }</code><technical_language>assign **sb.startSequenceNumber() + sb.rowCount() - 1** a variable is moe nonce. more legible</technical_language>

Target:
private synchronized void releaseExportBytes(long releaseSeqNo, int tuplesSent) throws IOException { if (!m_committedBuffers.isEmpty() && releaseSeqNo < m_committedBuffers.peek().startSequenceNumber()) { tuplesSent = 0; } if (m_lastReleasedSeqNo == releaseSeqNo) { tuplesSent = 0; } long lastSeqNo = 0; while (!m_committedBuffers.isEmpty() && releaseSeqNo >= m_committedBuffers.peek().startSequenceNumber()) { StreamBlock sb = m_committedBuffers.peek(); if (releaseSeqNo >= sb.lastSequenceNumber()) { m_committedBuffers.pop(); try { lastSeqNo = sb.lastSequenceNumber(); } finally { sb.discard(); } } else if (releaseSeqNo >= sb.startSequenceNumber()) { sb.releaseTo(releaseSeqNo); lastSeqNo = releaseSeqNo; break; } } m_lastReleasedSeqNo = releaseSeqNo; if (m_status == StreamStatus.BLOCKED && m_gapTracker.getFirstGap() != null && releaseSeqNo > m_gapTracker.getFirstGap().getSecond()) { setStatus(StreamStatus.ACTIVE); } m_gapTracker.truncate(releaseSeqNo); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncate tracker via ack to:" + releaseSeqNo + " now is " + m_gapTracker.toString()); } if (m_committedBuffers.isEmpty()) { lastSeqNo = releaseSeqNo; } m_firstUnpolledSeqNo = Math.max(m_firstUnpolledSeqNo, lastSeqNo + 1); int pendingCount = m_tuplesPending.get(); m_tuplesPending.set(pendingCount - tuplesSent); return; }
Source:
<code>private static NameSubstitutionStrategy getNameSubstitutionStrategy(GraphConfiguration config) { String className = config.getString(GraphConfiguration.SEARCH_INDEX_PROP_PREFIX + "." + CONFIG_NAME_SUBSTITUTION_STRATEGY_CLASS_NAME, DEFAULT_NAME_SUBSTITUTION_STRATEGY.getName()); NameSubstitutionStrategy strategy = ConfigurationUtils.createProvider(className, config); <START> if (strategy instanceof SimpleNameSubstitutionStrategy) { <END> ((SimpleNameSubstitutionStrategy) strategy).setSubstitutionList(SimpleSubstitutionUtils.getSubstitutionList(config.getConfig())); } return strategy; }</code><technical_language>a method NameSubstitutionStrategy called config setUp takes a configuration map</technical_language>

Target:
private static NameSubstitutionStrategy getNameSubstitutionStrategy(GraphConfiguration config) { String className = config.getString(GraphConfiguration.SEARCH_INDEX_PROP_PREFIX + "." + CONFIG_NAME_SUBSTITUTION_STRATEGY_CLASS_NAME, DEFAULT_NAME_SUBSTITUTION_STRATEGY.getName()); NameSubstitutionStrategy strategy = ConfigurationUtils.createProvider(className, config); strategy.setup(config.getConfig()); return strategy; }
Source:
<code>public String getProbeString() { if (fAddress != null) { return fAddress; } else if (fSymbol != null && fOffset != null) { <START> return fSymbol + "+" + fOffset; END> } return null; }</code><technical_language>avoid sonar warning StringBuffer StringBuilder</technical_language>

Target:
public String getProbeString() { if (fAddress != null) { return fAddress; } else if (fSymbol != null && fOffset != null) { return new StringBuffer(fSymbol).append('+').append(fOffset).toString(); } return null; }
Source:
<code>public void replCommitTxn(CommitTxnRequest rqst) throws LockException { try { if (rqst.isSetReplLastIdInfo()) { <START> lockMgr.clearLocalLockRecords(); <END> stopHeartbeat(); } getMS().replCommitTxn(rqst); } catch (NoSuchTxnException e) { LOG.error("Metastore could not find " + JavaUtils.txnIdToString(rqst.getTxnid())); throw new LockException(e, ErrorMsg.TXN_NO_SUCH_TRANSACTION, JavaUtils.txnIdToString(rqst.getTxnid())); } catch (TxnAbortedException e) { LockException le = new LockException(e, ErrorMsg.TXN_ABORTED, JavaUtils.txnIdToString(rqst.getTxnid()), e.getMessage()); LOG.error(le.getMessage()); throw le; } catch (TException e) { throw new LockException(ErrorMsg.METASTORE_COMMUNICATION_FAILED.getMsg(), e); } finally { if (rqst.isSetReplLastIdInfo()) { txnId = 0; stmtId = -1; numStatements = 0; tableWriteIds.clear(); } } }</code><technical_language>This duplicates resource freeing logic of commitTxn. In future if added new resource free for commitTxn flow, leak for repl operations. a common method frees txn resources call commitTxn replCommitTxn</technical_language>

Target:
public void replCommitTxn(CommitTxnRequest rqst) throws LockException { try { if (rqst.isSetReplLastIdInfo()) { if (!isTxnOpen()) { throw new RuntimeException("Attempt to commit before opening a transaction"); } clearLocksAndHB(); } getMS().replCommitTxn(rqst); } catch (NoSuchTxnException e) { LOG.error("Metastore could not find " + JavaUtils.txnIdToString(rqst.getTxnid())); throw new LockException(e, ErrorMsg.TXN_NO_SUCH_TRANSACTION, JavaUtils.txnIdToString(rqst.getTxnid())); } catch (TxnAbortedException e) { LockException le = new LockException(e, ErrorMsg.TXN_ABORTED, JavaUtils.txnIdToString(rqst.getTxnid()), e.getMessage()); LOG.error(le.getMessage()); throw le; } catch (TException e) { throw new LockException(ErrorMsg.METASTORE_COMMUNICATION_FAILED.getMsg(), e); } finally { if (rqst.isSetReplLastIdInfo()) { resetTxnInfo(); } } }
Source:
<code>public void enterUnionStyleEnum(SwiftParser.UnionStyleEnumContext ctx) { <START> listenerHelper.verifyUnionStyleEnumOpenBraceStyle(ctx); <END> }</code><technical_language>Raw style enum? :stuck_out_tongue:</technical_language>

Target:
public void enterUnionStyleEnum(SwiftParser.UnionStyleEnumContext ctx) { listenerHelper.verifyEnumOpenBraceStyle(ctx); }