auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void process() { if (renderingConfig.isEyeAdaptation()) { PerformanceMonitor.startActivity("rendering/updateExposure"); downSampleSceneInto1x1pixelsBuffer(); writeOnlyPBO.copyFromFBO(downSampledScene[0].fboId, 1, 1, GL12.GL_BGRA, GL11.GL_UNSIGNED_BYTE); pixels = readOnlyPBO.readBackPixels(); <START> swapPBOs(); <END> if (pixels.limit() < 3) { logger.error("Failed to auto-update the exposure value."); return; } currentSceneLuminance = 0.2126f * (pixels.get(2) & 0xFF) / 255.f + 0.7152f * (pixels.get(1) & 0xFF) / 255.f + 0.0722f * (pixels.get(0) & 0xFF) / 255.f; targetExposure = hdrMaxExposure; if (currentSceneLuminance > 0) { targetExposure = hdrTargetLuminance / currentSceneLuminance; } maxExposure = hdrMaxExposure; if (backdropProvider.getDaylight() == 0.0) { maxExposure = hdrMaxExposureNight; } if (targetExposure > maxExposure) { targetExposure = maxExposure; } else if (targetExposure < hdrMinExposure) { targetExposure = hdrMinExposure; } screenGrabber.setExposure(TeraMath.lerp(screenGrabber.getExposure(), targetExposure, hdrExposureAdjustmentSpeed)); PerformanceMonitor.endActivity(); } else { if (backdropProvider.getDaylight() == 0.0) { screenGrabber.setExposure(hdrMaxExposureNight); } else { screenGrabber.setExposure(hdrExposureDefault); } } }</code><technical_language>order of readback swapping operations reversed. Is this intentional? Beacause writeOnlyPBO line copies data writeOnlyPBO. If readback next reading writeOnlyPBO. Alternatively next operation swap readback readOnlyPBO sense. =</technical_language>

Target:
public void process() { if (renderingConfig.isEyeAdaptation()) { PerformanceMonitor.startActivity("rendering/updateExposure"); downSampleSceneInto1x1pixelsBuffer(); writeOnlyPBO.copyFromFBO(downSampledScene[0].fboId, 1, 1, GL12.GL_BGRA, GL11.GL_UNSIGNED_BYTE); swapPBOs(); pixels = readOnlyPBO.readBackPixels(); if (pixels.limit() < 3) { logger.error("Failed to auto-update the exposure value."); return; } currentSceneLuminance = 0.2126f * (pixels.get(2) & 0xFF) / 255.f + 0.7152f * (pixels.get(1) & 0xFF) / 255.f + 0.0722f * (pixels.get(0) & 0xFF) / 255.f; targetExposure = hdrMaxExposure; if (currentSceneLuminance > 0) { targetExposure = hdrTargetLuminance / currentSceneLuminance; } maxExposure = hdrMaxExposure; if (backdropProvider.getDaylight() == 0.0) { maxExposure = hdrMaxExposureNight; } if (targetExposure > maxExposure) { targetExposure = maxExposure; } else if (targetExposure < hdrMinExposure) { targetExposure = hdrMinExposure; } screenGrabber.setExposure(TeraMath.lerp(screenGrabber.getExposure(), targetExposure, hdrExposureAdjustmentSpeed)); PerformanceMonitor.endActivity(); } else { if (backdropProvider.getDaylight() == 0.0) { screenGrabber.setExposure(hdrMaxExposureNight); } else { screenGrabber.setExposure(hdrExposureDefault); } } }
Source:
<code>public T fromString(String string) { try { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); ObjectReader reader = mapper.reader(clazz); return reader.readValue(string); } catch (IOException e) { <START> Throwables.propagate(e); <END> } return null; }</code><technical_language>Exception propagation. need for subsequent return null</technical_language>

Target:
public T fromString(String string) { try { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); ObjectReader reader = mapper.reader(clazz); return reader.readValue(string); } catch (IOException e) { throw Throwables.propagate(e); } }
Source:
<code>public int hashCode() { int hash = 17; <START> hash = hash * 31 + Objects.hashCode(_annotations); <END> hash = hash * 31 + Objects.hashCode(_counterSamples); hash = hash * 31 + Objects.hashCode(_timerSamples); hash = hash * 31 + Objects.hashCode(_gaugeSamples); return hash; }</code><technical_language>Objects.hash(Object... values)</technical_language>

Target:
public int hashCode() { return Objects.hash(_annotations, _counterSamples, _timerSamples, _gaugeSamples); }
Source:
<code>private void postFinish() { User user = User.getLoggedUser(); Session.setUser(user); try { Dhis2Application.getEventBus().post(new SyncProgressStatus()); } catch (Exception e) { <START> e.printStackTrace(); <END> } }</code><technical_language>@ivanarrizabalaga print stack trace is fine in general for this app, I sense show a kind of warning dialog pull process. I this is for of exceptions in pull, right? do think</technical_language>

Target:
private void postFinish() { User user = User.getLoggedUser(); Session.setUser(user); Dhis2Application.getEventBus().post(new SyncProgressStatus()); }
Source:
<code>protected List<OrderedPartitionableRecord<Integer, Long>> getRecords( RecordSupplier<Integer, Long> recordSupplier, TaskToolbox toolbox ) { <START> return null; <END> }</code><technical_language>getRecords() is marked @NotNull, returns null here. throwing UnsupportedOperationException better/clearer too</technical_language>

Target:
protected List<OrderedPartitionableRecord<Integer, Long>> getRecords( RecordSupplier<Integer, Long> recordSupplier, TaskToolbox toolbox ) { throw new UnsupportedOperationException(); }
Source:
<code>protected void sendNotification(String msg, Intent cloudIntent) { mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); String activityName = getString(R.string.liger_main_activity_class); Class<? extends DefaultMainActivity> activityClass = null; activityClass = DefaultMainActivity.class; Intent appIntent = new Intent(this, DefaultMainActivity.class); appIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); appIntent.putExtra("cloudIntent", cloudIntent); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, appIntent, 0); Uri defaultSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.icon_android_notificaiton) <START> .setContentTitle("Reach Push") <END> .setLights(Color.YELLOW, 1, 2) .setAutoCancel(true) .setSound(defaultSound) .setStyle(new NotificationCompat.BigTextStyle() .bigText(msg)) .setContentText(msg); mBuilder.setContentIntent(contentIntent); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build()); }</code><technical_language>need extract this (since apps reach push). get name of app some native API? localized names correct l10n ourselves</technical_language>

Target:
protected void sendNotification(String msg, Intent cloudIntent) { mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); String activityName = getString(R.string.liger_main_activity_class); Class<? extends DefaultMainActivity> activityClass = null; try { activityClass = (Class<? extends DefaultMainActivity>) Class.forName(activityName); } catch (ClassNotFoundException e) { Log.e(LIGER.TAG, "Failed to find class for main activity named " + activityName, e); } catch (ClassCastException e) { Log.e(LIGER.TAG, "Main activity class named " + activityName + " is not an Activity!", e); } Intent appIntent = new Intent(this, activityClass); appIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); appIntent.putExtra("cloudIntent", cloudIntent); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, appIntent, 0); Uri defaultSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.icon_android_notificaiton) .setContentTitle("Reach Push") .setLights(Color.YELLOW, 1, 2) .setAutoCancel(true) .setSound(defaultSound) .setStyle(new NotificationCompat.BigTextStyle() .bigText(msg)) .setContentText(msg); mBuilder.setContentIntent(contentIntent); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build()); }
Source:
<code><START> protected void executeCommand() { <END> boolean isStorageDisconnectSucceeded = disconnectStorage(); if(isStorageDisconnectSucceeded) { String connectionId = getConnection().getid(); if(StringUtils.isNotEmpty(connectionId)) { getDbFacade().getStorageServerConnectionDao().remove(connectionId); setSucceeded(true); } } }</code><technical_language>I understand - perform this command for host connection removed db, perform disconnect for other hosts? load of connection return null..no? care of i guess</technical_language>

Target:
protected void executeCommand() { boolean isStorageDisconnectSucceeded = disconnectStorage(); if(isStorageDisconnectSucceeded) { String connectionId = getConnection().getid(); if(StringUtils.isNotEmpty(connectionId)) { getDbFacade().getStorageServerConnectionDao().remove(connectionId); } setSucceeded(true); } }
Source:
<code>private void handleMinimizedStacks( @UIEventTopic(UIEvents.ApplicationElement.TOPIC_TAGS) Event event) { Object changedObj = event.getProperty(EventTags.ELEMENT); if (!(changedObj instanceof MToolControl)) return; final MToolControl minimizedStack = (MToolControl) changedObj; if (!(minimizedStack.getObject() instanceof TrimStack)) return; TrimStack ts = (TrimStack) minimizedStack.getObject(); <START> if (!(ts.minimizedElement instanceof MPartStack)) <END> return; MPartStack stack = (MPartStack) ts.minimizedElement; MUIElement stackSel = stack.getSelectedElement(); MPart thePart = null; if (stackSel instanceof MPart) { thePart = (MPart) stackSel; } else if (stackSel instanceof MPlaceholder) { MPlaceholder ph = (MPlaceholder) stackSel; if (ph.getRef() instanceof MPart) { thePart = (MPart) ph.getRef(); } } if (thePart == null) return; if (UIEvents.isADD(event)) { if (UIEvents.contains(event, UIEvents.EventTags.NEW_VALUE, TrimStack.MINIMIZED_AND_SHOWING)) { firePartVisible(thePart); } } else if (UIEvents.isREMOVE(event)) { if (UIEvents.contains(event, UIEvents.EventTags.OLD_VALUE, TrimStack.MINIMIZED_AND_SHOWING)) { firePartHidden(thePart); } } }</code><technical_language>ts.getMinimizedElement()</technical_language>

Target:
private void handleMinimizedStacks( @UIEventTopic(UIEvents.ApplicationElement.TOPIC_TAGS) Event event) { Object changedObj = event.getProperty(EventTags.ELEMENT); if (!(changedObj instanceof MToolControl)) return; final MToolControl minimizedStack = (MToolControl) changedObj; if (!(minimizedStack.getObject() instanceof TrimStack)) return; TrimStack ts = (TrimStack) minimizedStack.getObject(); if (!(ts.getMinimizedElement() instanceof MPartStack)) return; MPartStack stack = (MPartStack) ts.getMinimizedElement(); MUIElement stackSel = stack.getSelectedElement(); MPart thePart = null; if (stackSel instanceof MPart) { thePart = (MPart) stackSel; } else if (stackSel instanceof MPlaceholder) { MPlaceholder ph = (MPlaceholder) stackSel; if (ph.getRef() instanceof MPart) { thePart = (MPart) ph.getRef(); } } if (thePart == null) return; if (UIEvents.isADD(event)) { if (UIEvents.contains(event, UIEvents.EventTags.NEW_VALUE, TrimStack.MINIMIZED_AND_SHOWING)) { firePartVisible(thePart); } } else if (UIEvents.isREMOVE(event)) { if (UIEvents.contains(event, UIEvents.EventTags.OLD_VALUE, TrimStack.MINIMIZED_AND_SHOWING)) { firePartHidden(thePart); } } }
Source:
<code>public void onClick(View v) { if ( v != MenuButton && menuIsVisible() ) { hideMenu(true); } if ( v == MenuButton ) { if ( menuIsVisible() ) hideMenu(true); else showMenu(true); } else if ( v == GroupButton ) { int img; if (GroupButton.getTag() == Integer.valueOf(0)) { GroupButton.setTag(Integer.valueOf(1)); img = R.drawable.groupon; } else { GroupButton.setTag(Integer.valueOf(0)); img = R.drawable.groupoff; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { GroupButton.setBackground(getResources().getDrawable(img)); } else { GroupButton.setBackgroundDrawable(getResources().getDrawable(img)); } onGroupButtonTouch(img == R.drawable.groupon); } else if ( v == MiSettings || v == SettingsButton) { showCfg(this); } else if ( v == MiAbout || v == AboutButton ) { showAbout(); } else if ( v == MiAddDevice || v == AddDeviceButton ) { addDevice(); } else if ( v == MiDonate || v == DonateButton ) { donate(); } else if ( v == MiHelp || v == HelpButton ) { openForumpage(); } else if ( v == HomepageButton ) { openHomepage(); <START> } else if ( v == EmptySpaceButton ) { <END> } }</code><technical_language>Is this needed if is code</technical_language>

Target:
public void onClick(View v) { if ( v != MenuButton && menuIsVisible() ) { hideMenu(true); } if ( v == MenuButton ) { if ( menuIsVisible() ) hideMenu(true); else showMenu(true); } else if ( v == GroupButton ) { int img; if (GroupButton.getTag() == Integer.valueOf(0)) { GroupButton.setTag(Integer.valueOf(1)); img = R.drawable.groupon; } else { GroupButton.setTag(Integer.valueOf(0)); img = R.drawable.groupoff; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { GroupButton.setBackground(getResources().getDrawable(img)); } else { GroupButton.setBackgroundDrawable(getResources().getDrawable(img)); } onGroupButtonTouch(img == R.drawable.groupon); } else if ( v == MiSettings || v == SettingsButton) { showCfg(this); } else if ( v == MiAbout || v == AboutButton ) { showAbout(); } else if ( v == MiAddDevice || v == AddDeviceButton ) { addDevice(); } else if ( v == MiDonate || v == DonateButton ) { donate(); } else if ( v == MiHelp || v == HelpButton ) { openForumpage(); } else if ( v == HomepageButton ) { openHomepage(); } }
Source:
<code>public String toString() { return "TITLE(" + getTitle() + "),YAXIS(" + yaxis + "),NUMSERIES(" + CollectionUtils.size(series) + "),GROUP(" + group + "),NUMBUILDS(" + numBuilds + "),RIGHTBUILDNUM(" + getRightBuildNum() + "),HASLEGEND(" + hasLegend() + "),ISLOGARITHMIC(" + isLogarithmic() + "),YAXISMINIMUM(" + yaxisMinimum + "),YAXISMAXIMUM(" + yaxisMaximum + "),FILENAME(" + getCsvFileName() + "),DESCRIPTION" <START> + getDescription() + ")"; <END> }</code><technical_language>Missing opening "(" getDescription()</technical_language>

Target:
public String toString() { return "TITLE(" + getTitle() + "),YAXIS(" + yaxis + "),NUMSERIES(" + CollectionUtils.size(series) + "),GROUP(" + group + "),NUMBUILDS(" + numBuilds + "),RIGHTBUILDNUM(" + getRightBuildNum() + "),HASLEGEND(" + hasLegend() + "),ISLOGARITHMIC(" + isLogarithmic() + "),YAXISMINIMUM(" + yaxisMinimum + "),YAXISMAXIMUM(" + yaxisMaximum + "),FILENAME(" + getCsvFileName() + "),DESCRIPTION(" + getDescription() + ")"; }
Source:
<code>public String getName() { <START> return "HTML Render`er"; <END> }</code><technical_language>Is added intentional</technical_language>

Target:
public String getName() { return "HTML Renderer"; }
Source:
<code>public void testRecoveryIteration() throws Exception { XAResource xaResource_0 = xaResource(0); <START> XAResource xaResource_1 = xaResource(1); <END> remoteTM(0).begin(); remoteCache(0).put("k0", "v"); Xid xid_0 = xid(0); prepare(0); remoteTM(1).begin(); remoteCache(1).put("k1", "v"); Xid xid_1 = xid(1); prepare(1); timeService.advance(9000); assertBeforeTimeoutRecoveryIteration(xaResource_0, xid_0); assertBeforeTimeoutRecoveryIteration(xaResource_1, xid_1); timeService.advance(2000); assertRecoveryIteration(xaResource_0, xid_0, xid_1); assertRecoveryIteration(xaResource_1, xid_1, xid_0); xaResource_1.commit(xid_0, false); xaResource_1.rollback(xid_1); assertEquals("v", remoteCache(0).get("k0")); assertEquals(null, remoteCache(0).get("k1")); xaResource_0.forget(xid_0); xaResource_1.forget(xid_1); }</code><technical_language>Underscore a bit odd</technical_language>

Target:
public void testRecoveryIteration() throws Exception { XAResource xaResource0 = xaResource(0); XAResource xaResource1 = xaResource(1); remoteTM(0).begin(); remoteCache(0).put("k0", "v"); Xid xid0 = xid(0); prepare(0); remoteTM(1).begin(); remoteCache(1).put("k1", "v"); Xid xid1 = xid(1); prepare(1); timeService.advance(9000); assertBeforeTimeoutRecoveryIteration(xaResource0, xid0); assertBeforeTimeoutRecoveryIteration(xaResource1, xid1); timeService.advance(2000); assertRecoveryIteration(xaResource0, xid0, xid1); assertRecoveryIteration(xaResource1, xid1, xid0); xaResource1.commit(xid0, false); xaResource1.rollback(xid1); assertEquals("v", remoteCache(0).get("k0")); assertEquals(null, remoteCache(0).get("k1")); xaResource0.forget(xid0); xaResource1.forget(xid1); }
Source:
<code><START> private static Function<Number, Double> times(final double x) { <END> return new Function<Number,Double>() { @Override public Double apply(Number input) { if (input==null) return null; return x*input.doubleValue(); } }; }</code><technical_language>public, useful in other places</technical_language>

Target:
public static Function<Number, Double> times(final double x) { return MathFunctions.times(x); }
Source:
<code>public Map<Long, EventDefinition> getEventDefs(StreamInput id) { <START> return null; <END> }</code><technical_language>a harsh return null deprecated method work original implementation, right? this method read StreamInputReader get information there</technical_language>

Target:
public Map<Long, EventDefinition> getEventDefs(StreamInput id) { return new HashMap<Long, EventDefinition>(); }
Source:
<code>public void saveContainer(String id) { HashMap<String, String> map = new HashMap<>(); <START> Optional.ofNullable(canvasHandler.getGraphIndex().get(id)).ifPresent(node -> { <END> map.put(DEFAULT_NODE_ID, id); map.put(svgNodeId, id); }); context.saveGroup(map); }</code><technical_language>In this case, Optional give anything. A simple null check exact thing, allocate a new object heap, require a lambda. Also, this readable: String node = canvasHandler.getGraphIndex().get(id); if (canvasHandler.getGraphIndex().get(id) == null) { context.saveGroup(Collections.emptyMap()); } else { HashMap<String, String> map = new HashMap<>(2); map.put(DEFAULT_NODE_ID, id); map.put(svgNodeId, id); context.saveGroup(map); } Overall, this is more efficient original</technical_language>

Target:
public void saveContainer(String id) { HashMap<String, String> map = new HashMap<>(); if (canvasHandler.getGraphIndex().get(id) != null) { map.put(DEFAULT_NODE_ID, id); map.put(svgNodeId, id); } context.saveGroup(map); }
Source:
<code>public MessageDecoder(int messageSize, int skipSize, SelectCumulator cumulator) { this.messageSize = messageSize; this.skipSize = skipSize; switch (cumulator) { case MERGE: setCumulator(MERGE_CUMULATOR); break; case COMPOSITE: setCumulator(COMPOSITE_CUMULATOR); break; case MESSAGE_AWARE_MERGE: setCumulator(new MessageAwareCumulator(messageSize)); break; <START> } <END> }</code><technical_language>nit: add a default case</technical_language>

Target:
MessageDecoder(int messageSize, int skipSize, SelectCumulator cumulator) { this.messageSize = messageSize; this.skipSize = skipSize; switch (cumulator) { case MERGE: setCumulator(MERGE_CUMULATOR); break; case COMPOSITE: setCumulator(COMPOSITE_CUMULATOR); break; case MESSAGE_AWARE_MERGE: setCumulator(new MessageAwareCumulator(messageSize)); break; default: throw new IllegalStateException(); } }
Source:
<code>private String formatRecipient(User user) { Profile profile = user.getProfile(); if (profile != null && profile.getFirstName() != null && profile.getLastName() != null) { return profile.getFirstName() + " " + profile.getLastName(); } <START> return "User"; <END> }</code><technical_language>This sounds pretty dev-like. this email address, turn defined: >Hi Last! undefined: >Hi! easy implement avoids awkward "Hi User"</technical_language>

Target:
private String formatRecipient(User user) { Profile profile = user.getProfile(); if (profile != null && profile.getFirstName() != null && profile.getLastName() != null) { return String.format(" %s %s", profile.getFirstName(), profile.getLastName()); } return ""; }
Source:
<code>public static void unloadFilters(Module module) { for (java.util.Iterator<ModuleFilterMapping> mapIter = moduleFilterMappings.iterator(); mapIter.hasNext();) { ModuleFilterMapping mapping = mapIter.next(); if (module.equals(mapping.getModule())) { mapIter.remove(); log.debug("Removed ModuleFilterMapping: " + mapping); } } Collection<Filter> filters = moduleFilters.get(module); if (filters != null) { try { for (Filter f : filters) { f.destroy(); } } catch (Exception e) { log.warn("An error occurred while trying to destroy and remove module Filter.", e); } log.debug("Module: " + module.getModuleId() + " successfully unloaded " + filters.size() + " filters."); moduleFilters.remove(module); for (Entry<String, Filter> entry: moduleFiltersByName.entrySet()) { Filter filterVal = entry.getValue(); if (filters.contains(filterVal)) { <START> moduleFiltersByName.remove(entry.getKey()); <END> } } } }</code><technical_language>is wrong. remove elements a collection iterate .remove result in a concurrent modification exception. done iterator. Please fix.</technical_language>

Target:
public static void unloadFilters(Module module) { for (java.util.Iterator<ModuleFilterMapping> mapIter = moduleFilterMappings.iterator(); mapIter.hasNext();) { ModuleFilterMapping mapping = mapIter.next(); if (module.equals(mapping.getModule())) { mapIter.remove(); log.debug("Removed ModuleFilterMapping: " + mapping); } } Collection<Filter> filters = moduleFilters.get(module); if (filters != null) { try { for (Filter f : filters) { f.destroy(); } } catch (Exception e) { log.warn("An error occurred while trying to destroy and remove module Filter.", e); } log.debug("Module: " + module.getModuleId() + " successfully unloaded " + filters.size() + " filters."); moduleFilters.remove(module); for (Iterator<String> i = moduleFiltersByName.keySet().iterator(); i.hasNext();) { String filterName = i.next(); Filter filterVal = moduleFiltersByName.get(filterName); if (filters.contains(filterVal)) { i.remove(); } } } }
Source:
<code>public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, long relationFlags) { if (access.canSkip()) { return edgeFlags; } if (!access.isFerry()) { <START> String sacScale = way.getTag("sac_scale"); <END> if (sacScale != null) { accessEnc.setBool(false, edgeFlags, false); accessEnc.setBool(true, edgeFlags, false); } else { speedEncoder.setDecimal(false, edgeFlags, MEAN_SPEED); accessEnc.setBool(false, edgeFlags, true); accessEnc.setBool(true, edgeFlags, true); } } else { double ferrySpeed = getFerrySpeed(way); setSpeed(false, edgeFlags, ferrySpeed); accessEnc.setBool(false, edgeFlags, true); accessEnc.setBool(true, edgeFlags, true); } return edgeFlags; }</code><technical_language>is this required? access.canSkip (see getAccess method)</technical_language>

Target:
public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, long relationFlags) { if (access.canSkip()) { return edgeFlags; } accessEnc.setBool(false, edgeFlags, true); accessEnc.setBool(true, edgeFlags, true); if (!access.isFerry()) { setSpeed(edgeFlags, true, true, MEAN_SPEED); } else { double ferrySpeed = getFerrySpeed(way); setSpeed(edgeFlags, true, true, ferrySpeed); } return edgeFlags; }
Source:
<code>private void setValueForTextInput(WebElement element, String text) { if (text == null || text.isEmpty()) { element.clear(); } else if (fastSetValue) { <START> text = truncateMaxLength(element, text); <END> String error = executeJavaScript( "if (arguments[0].getAttribute('readonly') != undefined) " + " return 'Cannot change value of readonly element';" + "arguments[0].value = arguments[1];" + "return null;", element, text); if (error != null) throw new InvalidStateException(error); events.fireEvent(element, "focus", "keydown", "keypress", "input", "keyup", "change"); } else { element.clear(); element.sendKeys(text); events.fireChangeEvent(element); } }</code><technical_language>@AleksanderPopov Retrieving attribute maxlength is slow. move this truncateMaxLength JS code</technical_language>

Target:
private void setValueForTextInput(WebElement element, String text) { if (text == null || text.isEmpty()) { element.clear(); } else if (fastSetValue) { String error = setValueByJs(element, text); if (error != null) throw new InvalidStateException(error); events.fireEvent(element, "focus", "keydown", "keypress", "input", "keyup", "change"); } else { element.clear(); element.sendKeys(text); events.fireChangeEvent(element); } }
Source:
<code>public boolean isSimCardReady() throws KuraException { boolean simReady = false; String port = null; if (isGpsEnabled() && getAtPort().equals(getGpsPort()) && !getAtPort().equals(getDataPort())) { port = getDataPort(); } else { port = getAtPort(); } synchronized (this.atLock) { s_logger.debug("sendCommand getSimStatus :: command to port {}", QuectelBG96AtCommands.getSimStatus.getCommand(), port); byte[] reply = null; CommConnection commAtConnection = null; try { commAtConnection = openSerialPort(port); if (!isAtReachable(commAtConnection)) { throw new KuraException(KuraErrorCode.NOT_CONNECTED, <START> "Modem not available for AT commands: " + QuectelBG96.class.getName()); <END> } reply = commAtConnection.sendCommand(QuectelBG96AtCommands.getSimStatus.getCommand().getBytes(), 1000, 100); if (reply != null) { String simStatus = getResponseString(reply); String[] simStatusSplit = simStatus.split(","); if (simStatusSplit.length > 1 && Integer.valueOf(simStatusSplit[1]) > 0) { simReady = true; } } if (!simReady) { } } catch (IOException e) { throw new KuraException(KuraErrorCode.UNAVAILABLE_DEVICE, e); } catch (KuraException e) { throw e; } finally { closeSerialPort(commAtConnection); } } return simReady; }</code><technical_language>"Modem available..." message is repeated multiple times, extract in a constant</technical_language>

Target:
public boolean isSimCardReady() throws KuraException { boolean simReady = false; String port = null; if (isGpsEnabled() && getAtPort().equals(getGpsPort()) && !getAtPort().equals(getDataPort())) { port = getDataPort(); } else { port = getAtPort(); } synchronized (this.atLock) { logger.debug("sendCommand getSimStatus :: command to port {}", QuectelBG96AtCommands.getSimStatus.getCommand(), port); byte[] reply = null; CommConnection commAtConnection = null; try { commAtConnection = openSerialPort(port); if (!isAtReachable(commAtConnection)) { throw new KuraException(KuraErrorCode.NOT_CONNECTED, "Modem not available for AT commands: " + QuectelBG96.class.getName()); } reply = commAtConnection.sendCommand(QuectelBG96AtCommands.getSimStatus.getCommand().getBytes(), 1000, 100); if (reply != null) { String simStatus = getResponseString(reply); String[] simStatusSplit = simStatus.split(","); if (simStatusSplit.length > 1 && Integer.valueOf(simStatusSplit[1]) > 0) { simReady = true; } } } catch (IOException e) { throw new KuraException(KuraErrorCode.UNAVAILABLE_DEVICE, e); } catch (KuraException e) { throw e; } finally { closeSerialPort(commAtConnection); } } return simReady; }
Source:
<code>public static Long pingNode(Node node) { <START> final int ATTEMPS = 10; <END> long minPing = Long.MAX_VALUE; for (int i = 0; i < ATTEMPS; i++) { long start = System.nanoTime(); try { node.getNumberOfActiveObjects(); } catch (Exception e) { return (long) -1; } long ping = (System.nanoTime() - start) / 1000; if (ping < minPing) minPing = ping; } return minPing; }</code><technical_language>fire_engine:</technical_language>

Target:
private Long pingNode(Node node) { final int ATTEMPS = 10; long minPing = Long.MAX_VALUE; for (int i = 0; i < ATTEMPS; i++) { long start = System.nanoTime(); try { node.getNumberOfActiveObjects(); } catch (Exception e) { return (long) -1; } long ping = (System.nanoTime() - start) / 1000; if (ping < minPing) minPing = ping; } return minPing; }
Source:
<code>public Query.Builder projection(Query.SelectExpression... expression) { if (expression == null || expression.length == 0) throw new IllegalArgumentException(); if (projection != null) throw new IllegalStateException("Projection already set"); <START> this.projection = Arrays.stream(expression).map(e -> e.attribute).toArray(size -> new String[size]); <END> return this; }</code><technical_language>String[]::new. If add attribute() method SelectExpression, method reference in map, too. Please fields in SelectExpression final</technical_language>

Target:
public Query.Builder projection(Query.SelectExpression... expression) { if (expression == null || expression.length == 0) throw new IllegalArgumentException(); if (projection != null) throw new IllegalStateException("Projection already set"); this.projection = Arrays.stream(expression).map(Query.SelectExpression::attribute).toArray(String[]::new); return this; }
Source:
<code>void initialize() { SchedulerUtilQuartzImpl.getInstance().scheduleACronJob(this, "onTimer", new Class<?>[] {}, new Object[] {}, Config.<String> GetValue(ConfigValues.AutoRecoverySchedule)); <START> interval = buildInterval(); <END> }</code><technical_language>Ah more (and for nagging) call scheduleACronJob statement of initialize, do register a not-yet-initialized object</technical_language>

Target:
void initialize() { prevRunTime = new Date(); SchedulerUtilQuartzImpl.getInstance().scheduleACronJob(this, "onTimer", new Class<?>[] {}, new Object[] {}, Config.<String> GetValue(ConfigValues.AutoRecoverySchedule)); }
Source:
<code><START> private void removeAlwaysOn(IActionSetDescriptor descriptor) { <END> if (descriptor == null) { return; } if (!alwaysOnActionSets.contains(descriptor)) { return; } alwaysOnActionSets.remove(descriptor); if (page != null) { page.perspectiveActionSetChanged(this, descriptor, ActionSetManager.CHANGE_HIDE); } }</code><technical_language>Hard in Gerrit (I pull in change Eclipse) checks done in protected addAlwaysOff method. Is this method called in places checks done</technical_language>

Target:
private void removeAlwaysOn(IActionSetDescriptor descriptor) { if (!alwaysOnActionSets.contains(descriptor)) { return; } alwaysOnActionSets.remove(descriptor); page.perspectiveActionSetChanged(this, descriptor, ActionSetManager.CHANGE_HIDE); }
Source:
<code>public FieldWrapper(HighlightExecutionContext executionContext, HighlighterContext context, BasicQueryWeigher weigher) { this.executionContext = executionContext; this.context = context; this.weigher = weigher; this.positionGap = <START> 1; <END> }</code><technical_language>is a lack of symmetry here. positionGap initialized in ctors</technical_language>

Target:
public FieldWrapper(HighlightExecutionContext executionContext, HighlighterContext context, BasicQueryWeigher weigher) { this.executionContext = executionContext; this.context = context; this.weigher = weigher; }
Source:
<code>public PdpFeedGroupEntry buildPdpFeedGroupEntry(ConcurStandardAccountingExtractDetailLine line) { PdpFeedGroupEntry currentGroup = new PdpFeedGroupEntry(); currentGroup.setPayeeName(buildPayeeName(line.getEmployeeLastName(), line.getEmployeeFirstName(), line.getEmployeeMiddleInitital())); currentGroup.setPayeeId(buildPayeeIdEntry(line)); currentGroup.setPaymentDate(formatDate(line.getBatchDate())); currentGroup.setCombineGroupInd(ConcurConstants.StandardAccountingExtractPdpConstants.COMBINDED_GROUP_INDICATOR); currentGroup.setBankCode(ConcurConstants.StandardAccountingExtractPdpConstants.BANK_CODE); <START> currentGroup.setCustomerInstitutionIdentifier(""); <END> return currentGroup; }</code><technical_language>StringUtils.EMPTY constant a convenience for referencing empty String. (There other areas in this file benefit this.)</technical_language>

Target:
public PdpFeedGroupEntry buildPdpFeedGroupEntry(ConcurStandardAccountingExtractDetailLine line) { PdpFeedGroupEntry currentGroup = new PdpFeedGroupEntry(); currentGroup.setPayeeName(buildPayeeName(line.getEmployeeLastName(), line.getEmployeeFirstName(), line.getEmployeeMiddleInitital())); currentGroup.setPayeeId(buildPayeeIdEntry(line)); currentGroup.setPaymentDate(formatDate(line.getBatchDate())); currentGroup.setCombineGroupInd(ConcurConstants.StandardAccountingExtractPdpConstants.COMBINED_GROUP_INDICATOR); currentGroup.setBankCode(ConcurConstants.StandardAccountingExtractPdpConstants.BANK_CODE); currentGroup.setCustomerInstitutionIdentifier(StringUtils.EMPTY); return currentGroup; }
Source:
<code>public void handle(Request request, Response response) { try (DbSession dbSession = dbClient.openSession(false)) { <START> long conditionId = request.mandatoryParamAsLong(PARAM_ID); <END> OrganizationDto organization = wsSupport.getOrganization(dbSession); userSession.checkPermission(ADMINISTER_QUALITY_GATES, organization); dbClient.gateConditionDao().delete(wsSupport.getCondition(dbSession, conditionId), dbSession); dbSession.commit(); response.noContent(); } }</code><technical_language>done opening a db session - for fail fast</technical_language>

Target:
public void handle(Request request, Response response) { long conditionId = request.mandatoryParamAsLong(PARAM_ID); try (DbSession dbSession = dbClient.openSession(false)) { OrganizationDto organization = wsSupport.getOrganization(dbSession); userSession.checkPermission(ADMINISTER_QUALITY_GATES, organization); dbClient.gateConditionDao().delete(wsSupport.getCondition(dbSession, conditionId), dbSession); dbSession.commit(); response.noContent(); } }
Source:
<code>public ClusterProfile clusterProfile() { <START> Gson gson = new Gson(); <END> Map map = gson.fromJson(clusterProfileMetadata, LinkedHashMap.class); if (map.isEmpty()) { return null; } String pluginId = (String) map.get("pluginId"); String id = (String) map.get("id"); Map<String, String> properties = (Map<String, String>) map.get("properties"); Collection<ConfigurationProperty> configProperties = properties.entrySet().stream().map(entry -> new ConfigurationProperty(new ConfigurationKey(entry.getKey()), new ConfigurationValue(entry.getValue()))).collect(Collectors.toList()); return new ClusterProfile(id, pluginId, configProperties); }</code><technical_language>this a constant? set naming policy case underscore</technical_language>

Target:
public ClusterProfile clusterProfile() { Map map = GSON.fromJson(clusterProfileMetadata, LinkedHashMap.class); if (map.isEmpty()) { return null; } String pluginId = (String) map.get("pluginId"); String id = (String) map.get("id"); Map<String, String> properties = (Map<String, String>) map.get("properties"); Collection<ConfigurationProperty> configProperties = properties.entrySet().stream().map(entry -> new ConfigurationProperty(new ConfigurationKey(entry.getKey()), new ConfigurationValue(entry.getValue()))).collect(Collectors.toList()); return new ClusterProfile(id, pluginId, configProperties); }
Source:
<code>private boolean isOverloadedOperator(String name) { <START> if (!name.startsWith("operator")) END> return false; int operatorCharIndex = 9; if (operatorCharIndex < name.length() && isOperatorChar(name.charAt(operatorCharIndex))) { return true; } return false; }</code><technical_language>sufficient check 'name.startsWith("operator ")' (note space), a valid identifier a space in it</technical_language>

Target:
private boolean isOverloadedOperator(String name) { if (name.startsWith("operator ")) return true; return false; }
Source:
<code>private void refreshDriveList() { List<String> listData = new ArrayList<>(); File[] roots = File.listRoots(); int firstRemovableDrive = -1; int i = 0; for (File root : roots) { if (DriveListUtils.isNetworkDrive(root.toString().replace(":\\", ""))) { continue; } String description = FileSystemView.getFileSystemView().getSystemTypeDescription(root); long spaceInBytes = root.getTotalSpace(); String sizeWithUnit = DriveListUtils.humanReadableByteCount(spaceInBytes, false); String fileSystem = getFileSystemName(root.toString()); <START> listData.add(root + " (" + description + ") (" + sizeWithUnit + ") - " + Bundle.ConfigVisualPanel1_fileSystem() + ": " + fileSystem); <END> if (firstRemovableDrive == -1) { try { FileStore fileStore = Files.getFileStore(root.toPath()); if ((boolean) fileStore.getAttribute("volume:isRemovable")) { firstRemovableDrive = i; } } catch (IOException ignored) { logger.log(Level.INFO, String.format("Unable to select first removable drive found %s", root.toString())); } } i++; } driveList.setListData(listData.toArray(new String[listData.size()])); if (!listData.isEmpty()) { driveList.setSelectedIndex(firstRemovableDrive == -1 ? 0 : firstRemovableDrive); firePropertyChange(UPDATE_UI_EVENT_NAME, false, true); driveList.requestFocusInWindow(); warningLabel.setText(""); } else { warningLabel.setText(Bundle.ConfigVisualPanel1_messageLabel_noExternalDriveFound()); } }</code><technical_language>This cleaner if put Bundle message variables needed</technical_language>

Target:
private void refreshDriveList() { List<String> listData = new ArrayList<>(); File[] roots = File.listRoots(); int firstRemovableDrive = -1; int i = 0; for (File root : roots) { if (DriveListUtils.isNetworkDrive(root.toString().replace(":\\", ""))) { continue; } String description = FileSystemView.getFileSystemView().getSystemTypeDescription(root); long spaceInBytes = root.getTotalSpace(); String sizeWithUnit = DriveListUtils.humanReadableByteCount(spaceInBytes, false); String fileSystem = getFileSystemName(root.toString()); listData.add(Bundle.ConfigVisualPanel1_driveListItem(root, description, sizeWithUnit, fileSystem)); if (firstRemovableDrive == -1) { try { FileStore fileStore = Files.getFileStore(root.toPath()); if ((boolean) fileStore.getAttribute("volume:isRemovable")) { firstRemovableDrive = i; } } catch (IOException ignored) { logger.log(Level.INFO, String.format("Unable to select first removable drive found %s", root.toString())); } } i++; } driveList.setListData(listData.toArray(new String[listData.size()])); if (!listData.isEmpty()) { driveList.setSelectedIndex(firstRemovableDrive == -1 ? 0 : firstRemovableDrive); firePropertyChange(UPDATE_UI_EVENT_NAME, false, true); driveList.requestFocusInWindow(); warningLabel.setText(""); } else { warningLabel.setText(Bundle.ConfigVisualPanel1_messageLabel_noExternalDriveFound()); } }
Source:
<code>private Interval getInterval(DateTime from, DateTime to){ <START> if (from.getYear() > 2100 || to.getYear() > 2100) { <END> throw new IllegalArgumentException("You cannot request schedule for after 2100"); } Interval interval = new Interval(from, to); if (interval.toDuration().isLongerThan(MAX_DURATION)) { throw new IllegalArgumentException("You cannot request more than " + PeriodFormat.getDefault().print(MAX_DURATION.toPeriod()) + " of schedule"); } return interval; }</code><technical_language>2100 a public static final well</technical_language>

Target:
private Interval getInterval(DateTime from, DateTime to){ if (from.getYear() > MAX_ALLOWED_YEAR || to.getYear() > MAX_ALLOWED_YEAR) { throw new IllegalArgumentException("You cannot request schedule for after year "+MAX_ALLOWED_YEAR); } Interval interval = new Interval(from, to); if (interval.toDuration().isLongerThan(MAX_DURATION)) { throw new IllegalArgumentException("You cannot request more than " + PeriodFormat.getDefault().print(MAX_DURATION.toPeriod()) + " of schedule"); } return interval; }
Source:
<code>private ContextMenu setupContextMenu() { markAsReadUnreadMenuItem.setOnAction(e -> { String menuItemText = markAsReadUnreadMenuItem.getText(); if (menuItemText.equals(markAsReadMenuItemText)) { markAsRead(); } else if (menuItemText.equals(markAsUnreadMenuItemText)) { markAsUnread(); } }); changeLabelsMenuItem.setText(changeLabelsMenuItemText); changeLabelsMenuItem.setOnAction(e -> { changeLabels(); }); markAllBelowAsReadMenuItem.setText(markAllAsReadMenuItemText); markAllBelowAsReadMenuItem.setOnAction(e -> { <START> markAllItemsBelow(IS_READ); <END> }); markAllBelowAsUnreadMenuItem.setText(markAllAsUnreadMenuItemText); markAllBelowAsUnreadMenuItem.setOnAction(e -> { markAllItemsBelow(!IS_READ); }); contextMenu.getItems().addAll(markAsReadUnreadMenuItem, markAllBelowAsReadMenuItem, markAllBelowAsUnreadMenuItem, changeLabelsMenuItem); contextMenu.setOnShowing(e -> updateContextMenu(contextMenu)); listView.setContextMenu(contextMenu); return contextMenu; }</code><technical_language>This reads slightly IS_ prefix me</technical_language>

Target:
private ContextMenu setupContextMenu() { markAsReadUnreadMenuItem.setOnAction(e -> { String menuItemText = markAsReadUnreadMenuItem.getText(); if (menuItemText.equals(markAsReadMenuItemText)) { markAsRead(); } else if (menuItemText.equals(markAsUnreadMenuItemText)) { markAsUnread(); } }); changeLabelsMenuItem.setText(changeLabelsMenuItemText); changeLabelsMenuItem.setOnAction(e -> { changeLabels(); }); markAllBelowAsReadMenuItem.setText(markAllAsReadMenuItemText); markAllBelowAsReadMenuItem.setOnAction(e -> { markAllBelowAsRead(); }); markAllBelowAsUnreadMenuItem.setText(markAllAsUnreadMenuItemText); markAllBelowAsUnreadMenuItem.setOnAction(e -> { markAllBelowAsUnread(); }); contextMenu.getItems().addAll(markAsReadUnreadMenuItem, markAllBelowAsReadMenuItem, markAllBelowAsUnreadMenuItem, changeLabelsMenuItem); contextMenu.setOnShowing(e -> updateContextMenu(contextMenu)); listView.setContextMenu(contextMenu); return contextMenu; }
Source:
<code>public boolean didImageTrigger(String imageNameTag) { if (!haveTriggersFired() || imageNameTag == null) return false; <START> ModelNode causes = get(DEPLOYMENTCONFIG_CAUSES); <END> for (ModelNode cause : causes.asList()) { String type = asString(cause, TYPE); if (type.equalsIgnoreCase(IMAGE_CHANGE)) { String triggerName = asString(cause, IMAGE_TRIGGER_FROM_NAME); DockerImageURI uri = new DockerImageURI(triggerName); if (imageNameTag.equals(uri.getNameAndTag())) return true; } } return false; }</code><technical_language>need compare ModelType.UNDEFINED for node doesnt exist</technical_language>

Target:
public boolean didImageTrigger(String imageNameTag) { if (!haveTriggersFired() || imageNameTag == null) return false; ModelNode causes = get(DEPLOYMENTCONFIG_CAUSES); if (causes.getType() == ModelType.UNDEFINED || causes.getType() != ModelType.LIST) return false; for (ModelNode cause : causes.asList()) { String type = asString(cause, TYPE); if (type.equalsIgnoreCase(IMAGE_CHANGE)) { String triggerName = asString(cause, IMAGE_TRIGGER_FROM_NAME); DockerImageURI uri = new DockerImageURI(triggerName); if (imageNameTag.equals(uri.getNameAndTag())) return true; } } return false; }
Source:
<code><START> public boolean equals(Object o) <END> { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } SegmentMetadataQuery that = (SegmentMetadataQuery) o; if (merge != that.merge) { return false; } if (toInclude != null ? !toInclude.equals(that.toInclude) : that.toInclude != null) { return false; } return true; }</code><technical_language>This include new field - regenerate this hashCode IntelliJ</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } SegmentMetadataQuery that = (SegmentMetadataQuery) o; if (merge != that.merge) { return false; } if (usingDefaultInterval != that.usingDefaultInterval) { return false; } return !(toInclude != null ? !toInclude.equals(that.toInclude) : that.toInclude != null); }
Source:
<code>public Class<?> getCellClass(int column) { EditedStyleItem item = myAttributes.get(myRowIndex); String value = item.getValue(); String name = item.getName(); AttributeDefinition attrDefinition = myAttributeDefinitions.getAttrDefByName(name); if (ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Color)) { return Color.class; } ResourceUrl url = ResourceUrl.parse(value); if <START> (item.isAttr()) <END> { item.setValue(value); ItemResourceValue resourceValue = (ItemResourceValue) mySelectedStyle.getConfiguration().getResourceResolver().findResValue(value, false); if (resourceValue == null ) { LOG.error("Unable to resolve " + value); return null; } item = new EditedStyleItem(resourceValue, mySelectedStyle); value = item.getValue(); url = ResourceUrl.parse(value); } ResourceType urlType = null; if (url != null) { urlType = url.type; } if (urlType == ResourceType.COLOR || (value.startsWith("#") && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Color))) { return Color.class; } if (urlType == ResourceType.DRAWABLE) { return DrawableDomElement.class; } if (column == 1) { if (urlType == ResourceType.STYLE) { return ThemeEditorStyle.class; } if (urlType == ResourceType.INTEGER || ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Integer)) { return Integer.class; } if (urlType == ResourceType.BOOL || ((value.equals("true") || value.equals("false")) && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Boolean))) { return Boolean.class; } } return String.class; }</code><technical_language>again, is this check done here? wont resolver resolve this</technical_language>

Target:
public Class<?> getCellClass(int column) { EditedStyleItem item = myAttributes.get(myRowIndex); String name = item.getName(); AttributeDefinition attrDefinition = myAttributeDefinitions.getAttrDefByName(name); ResourceValue resourceValue = mySelectedStyle.getConfiguration().getResourceResolver().resolveResValue(item.getItemResourceValue()); if (resourceValue == null) { LOG.error("Unable to resolve " + item.getValue()); return null; } ResourceType urlType = resourceValue.getResourceType(); if (urlType == ResourceType.STYLE && column == 1) { return ThemeEditorStyle.class; } if (urlType == ResourceType.DRAWABLE) { return DrawableDomElement.class; } String value = resourceValue.getValue(); if (value == null) { return String.class; } if (urlType == ResourceType.COLOR || (value.startsWith("#") && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Color))) { return Color.class; } if (column == 1) { if (urlType == ResourceType.INTEGER || ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Integer)) { return Integer.class; } if (urlType == ResourceType.BOOL || ((value.equals("true") || value.equals("false")) && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Boolean))) { return Boolean.class; } } return String.class; }
Source:
<code>private String replaceLocaleWithUSLocale(String originalString, Locale locale) { return originalString.replaceAll("/"+ locale.toLanguageTag().replaceAll("-", "\\\\-") + "|/" + locale.toString(), <START> "/" + Locale.US.toLanguageTag()); <END> }</code><technical_language>I appreciate if split this in lines some temporary variables more readable</technical_language>

Target:
private String replaceLocaleWithUSLocale(String originalString, Locale locale) { String regex = "/"+ locale.toLanguageTag().replaceAll("-", "\\\\-") + "|/" + locale.toString(); return originalString.replaceAll(regex, "/" + Locale.US.toLanguageTag()); }
Source:
<code>public List<SQLUniqueConstraint> getUniqueConstraints(String db_name, String tbl_name) throws MetaException { try { return getUniqueConstraintsInternal(db_name, tbl_name, true, true); } catch (NoSuchObjectException e) { <START> throw new MetaException(e.getMessage()); <END> } }</code><technical_language>instead of e.getMessage() org.apache.commons.lang.exception.ExceptionUtils.getStackTrace(Throwable) capture full stack trace</technical_language>

Target:
public List<SQLUniqueConstraint> getUniqueConstraints(String db_name, String tbl_name) throws MetaException { try { return getUniqueConstraintsInternal(db_name, tbl_name, true, true); } catch (NoSuchObjectException e) { throw new MetaException(ExceptionUtils.getStackTrace(e)); } }