auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String checkpoint() throws IOException { try (LockResource lr = mMasterContext.getStateLockManager().lockExclusive(StateLockOptions.defaults())) { mJournalSystem.checkpoint(); return NetworkAddressUtils.getConnectHost(NetworkAddressUtils.ServiceType.MASTER_RPC, ServerConfiguration.global()); } catch (Exception e) { <START> throw new IOException("Failed to take a checkpoint", e); <END> } }</code><technical_language>more information in this message</technical_language>

Target:
public String checkpoint() throws IOException { try (LockResource lr = mMasterContext.getStateLockManager().lockExclusive(StateLockOptions.defaults())) { mJournalSystem.checkpoint(); return NetworkAddressUtils.getConnectHost(NetworkAddressUtils.ServiceType.MASTER_RPC, ServerConfiguration.global()); } catch (Exception e) { throw new IOException("Failed to take a checkpoint.", e); } }
Source:
<code>protected EmbeddedCacheManager createCacheManager() throws Exception { MarshallerRegistration.registerMarshallers(SerializationContextHolder.getSerializationContext()); MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext()); ConfigurationBuilder builder = hotRodCacheConfiguration(); <START> builder.dataContainer().keyEquivalence(AnyEquivalence.getInstance()); END> builder.dataContainer().valueEquivalence(AnyEquivalence.getInstance()); builder.transaction() .transactionMode(TransactionMode.TRANSACTIONAL) .indexing().enable() .indexLocalOnly(false) .addProperty("default.directory_provider", "ram") .addProperty("lucene_version", "LUCENE_CURRENT"); cacheManager = TestCacheManagerFactory.createCacheManager(builder); cache = cacheManager.getCache(); hotRodServer = TestHelper.startHotRodServer(cacheManager); Properties hotrodClientConf = new Properties(); hotrodClientConf.put("infinispan.client.hotrod.server_list", "localhost:" + hotRodServer.getPort()); hotrodClientConf.put("infinispan.client.hotrod.marshaller", ProtoStreamMarshaller.class.getName()); remoteCacheManager = new RemoteCacheManager(hotrodClientConf); remoteCache = remoteCacheManager.getCache(); return cacheManager; }</code><technical_language>do need this</technical_language>

Target:
protected EmbeddedCacheManager createCacheManager() throws Exception { MarshallerRegistration.registerMarshallers(SerializationContextHolder.getSerializationContext()); MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext()); ConfigurationBuilder builder = hotRodCacheConfiguration(); builder.transaction() .indexing().enable() .indexLocalOnly(false) .addProperty("default.directory_provider", "ram") .addProperty("lucene_version", "LUCENE_CURRENT"); builder.dataContainer().valueEquivalence(AnyEquivalence.getInstance()); cacheManager = TestCacheManagerFactory.createCacheManager(builder); cache = cacheManager.getCache(); hotRodServer = TestHelper.startHotRodServer(cacheManager); org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder(); clientBuilder.addServer().host("127.0.0.1").port(hotRodServer.getPort()); clientBuilder.marshaller(new ProtoStreamMarshaller()); remoteCacheManager = new RemoteCacheManager(clientBuilder.build()); remoteCache = remoteCacheManager.getCache(); return cacheManager; }
Source:
<code>public void testSTDifference() throws Exception <START> { <END> assertQuery("select ST_AsText(ST_Difference(ST_GeometryFromText('Polygon ((1 1, 1 4, 4 4, 4 1))'), ST_GeometryFromText('Polygon ((2 2, 2 5, 5 5, 5 2))')))", "select 'POLYGON ((1 1, 4 1, 4 2, 2 2, 2 4, 1 4, 1 1))'"); }</code><technical_language>nit: test LINESTRING EMPTY</technical_language>

Target:
public void testSTDifference() throws Exception { assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('POINT (50 100)'), ST_GeometryFromText('POINT (150 150)')))", VARCHAR, "POINT (50 100)"); assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('MULTIPOINT (50 100, 50 200)'), ST_GeometryFromText('POINT (50 100)')))", VARCHAR, "POINT (50 200)"); assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('LINESTRING (50 100, 50 200)'), ST_GeometryFromText('LINESTRING (50 50, 50 150)')))", VARCHAR, "LINESTRING (50 150, 50 200)"); assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('MULTILINESTRING ((1 1, 5 1), (2 4, 4 4))'), ST_GeometryFromText('MULTILINESTRING ((2 1, 4 1), (3 3, 7 3))')))", VARCHAR, "MULTILINESTRING ((1 1, 2 1), (4 1, 5 1), (2 4, 4 4))"); assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('POLYGON ((1 1, 1 4, 4 4, 4 1))'), ST_GeometryFromText('POLYGON ((2 2, 2 5, 5 5, 5 2))')))", VARCHAR, "POLYGON ((1 1, 4 1, 4 2, 2 2, 2 4, 1 4, 1 1))"); assertFunction("ST_AsText(ST_Difference(ST_GeometryFromText('MULTIPOLYGON (((1 1, 1 3, 3 3, 3 1)), ((0 0, 0 2, 2 2, 2 0)))'), ST_GeometryFromText('POLYGON ((0 1, 3 1, 3 3, 0 3, 0 1))')))", VARCHAR, "POLYGON ((1 1, 0 1, 0 0, 2 0, 2 1, 1 1))"); }
Source:
<code>private IndexValue(long size, Offset offset, byte flags, long expiresAtMs, long originalMessageOffset, long operationTimeInMs, short serviceId, short containerId) { this.size = size; this.offset = offset; this.flags = flags; int expiryInSecs = (int) (expiresAtMs / Time.MsPerSec); this.expiresAtMs = expiresAtMs != Utils.Infinite_Time ? expiryInSecs * Time.MsPerSec : Utils.Infinite_Time; this.originalMessageOffset = originalMessageOffset; int operationTimeInSecs = (int) (operationTimeInMs / Time.MsPerSec); this.operationTimeInMs = <START> operationTimeInMs != Utils.Infinite_Time ? operationTimeInSecs * Time.MsPerSec : Utils.Infinite_Time; <END> this.serviceId = serviceId; this.containerId = containerId; version = PersistentIndex.VERSION_1; }</code><technical_language>worth writing a function for this do in a lot of places</technical_language>

Target:
private IndexValue(long size, Offset offset, byte flags, long expiresAtMs, long originalMessageOffset, long operationTimeInMs, short serviceId, short containerId) { this.size = size; this.offset = offset; this.flags = flags; this.expiresAtMs = Utils.getTimeInMsToTheNearestSec(expiresAtMs); this.originalMessageOffset = originalMessageOffset; this.operationTimeInMs = Utils.getTimeInMsToTheNearestSec(operationTimeInMs); this.serviceId = serviceId; this.containerId = containerId; version = PersistentIndex.CURRENT_VERSION; }
Source:
<code>public void defaultMainThreadSchedulerIsInitializedLazily() { final Function<Callable<Scheduler>, Scheduler> safeOverride = new Function<Callable<Scheduler>, Scheduler>() { <START> @Override public Scheduler apply(Callable<Scheduler> __) { <END> return new EmptyScheduler(); } }; final Callable<Scheduler> unsafeDefault = new Callable<Scheduler>() { @Override public Scheduler call() throws Exception { throw new AssertionError( "Default Scheduler instance should not have been evaluated"); } }; try { RxAndroidPlugins.setInitMainThreadSchedulerHandler(safeOverride); RxAndroidPlugins.initMainThreadScheduler(unsafeDefault); } finally { RxAndroidPlugins.reset(); } }</code><technical_language>__ -> scheduler</technical_language>

Target:
public void defaultMainThreadSchedulerIsInitializedLazily() { Function<Callable<Scheduler>, Scheduler> safeOverride = new Function<Callable<Scheduler>, Scheduler>() { @Override public Scheduler apply(Callable<Scheduler> scheduler) { return new EmptyScheduler(); } }; Callable<Scheduler> unsafeDefault = new Callable<Scheduler>() { @Override public Scheduler call() throws Exception { throw new AssertionError(); } }; RxAndroidPlugins.setInitMainThreadSchedulerHandler(safeOverride); RxAndroidPlugins.initMainThreadScheduler(unsafeDefault); }
Source:
<code>public boolean canMaintain(Object dataObject, Person user) { if (!super.canMaintain(dataObject, user)) { return false; } WebServiceCredential webServiceCredential = (WebServiceCredential) dataObject; <START> ParameterEvaluator parameterEvaluator = SpringContext.getBean(ParameterEvaluatorService.class).getParameterEvaluator( <END> WebServiceCredential.class, CUKFSParameterKeyConstants.NON_EDITABLE_CREDENTIAL_VALUES, webServiceCredential.getCredentialGroupCode(), webServiceCredential.getCredentialKey() ); return !parameterEvaluator.evaluationSucceeds(); }</code><technical_language>I move ParameterEvaluatorService a getter setter, spring conect in getter in local variable for ParameterEvaluatorService set</technical_language>

Target:
public boolean canMaintain(Object dataObject, Person user) { if (!super.canMaintain(dataObject, user)) { return false; } WebServiceCredential webServiceCredential = (WebServiceCredential) dataObject; ParameterEvaluator parameterEvaluator = getParameterEvaluatorService().getParameterEvaluator( WebServiceCredential.class, CUKFSParameterKeyConstants.NON_EDITABLE_CREDENTIAL_VALUES, webServiceCredential.getCredentialGroupCode(), webServiceCredential.getCredentialKey() ); return !parameterEvaluator.evaluationSucceeds(); }
Source:
<code>public String getLogMessage() { <START> return String.format("Processed Pool with id %d", poolProgressStep.getInput().getId()); <END> }</code><technical_language>Log messages more descriptive specific workflow. e.g. "Selected Pool {alias} ({name})" Prompt message similar. is user "inputting a pool?"</technical_language>

Target:
public String getLogMessage() { Pool pool = poolProgressStep.getInput(); return String.format("Selected Pool %s (%s)", pool.getAlias(), pool.getName()); }
Source:
<code>public Object execute(final ExecutionEvent event) throws ExecutionException { CustomizeUMLLabelDialog dialog = new CustomizeUMLLabelDialog(Display.getDefault().getActiveShell()); int code = dialog.open(); <START> if (code == Window.OK) { <END> Object[] result = dialog.getResult(); if (0 < result.length && result[0] instanceof Map) { Map map = (Map<String, String>) result[0]; IPreferenceStore store = Activator.getDefault().getPreferenceStore(); store.setValue(CustomizableLabelPreferences.CUSTOMIZED_TYPES, map.get(CustomizableLabelPreferences.CUSTOMIZED_TYPES).toString()); store.setValue(CustomizableLabelPreferences.CUSTOMIZED_STYLES, map.get(CustomizableLabelPreferences.CUSTOMIZED_STYLES).toString()); } IWorkbenchPart activePart = HandlerUtil.getActivePart(event); if (activePart instanceof ModelExplorerPageBookView) { IViewPart page = ((ModelExplorerPageBookView) activePart).getActiveView(); if (page instanceof CommonNavigator) { ((CommonNavigator) page).getCommonViewer().refresh(); } } } return null; }</code><technical_language>PLease invert operande</technical_language>

Target:
public Object execute(final ExecutionEvent event) throws ExecutionException { CustomizeUMLLabelDialog dialog = new CustomizeUMLLabelDialog(Display.getDefault().getActiveShell()); int code = dialog.open(); if (Window.OK == code) { Object[] result = dialog.getResult(); if (0 < result.length && result[0] instanceof Map) { Map map = (Map<String, String>) result[0]; IPreferenceStore store = Activator.getDefault().getPreferenceStore(); store.setValue(CustomizableLabelPreferences.CUSTOMIZED_TYPES, map.get(CustomizableLabelPreferences.CUSTOMIZED_TYPES).toString()); store.setValue(CustomizableLabelPreferences.CUSTOMIZED_STYLES, map.get(CustomizableLabelPreferences.CUSTOMIZED_STYLES).toString()); } IWorkbenchPart activePart = HandlerUtil.getActivePart(event); if (activePart instanceof ModelExplorerPageBookView) { IViewPart page = ((ModelExplorerPageBookView) activePart).getActiveView(); if (page instanceof CommonNavigator) { ((CommonNavigator) page).getCommonViewer().refresh(); } } } return null; }
Source:
<code>public void dispose() { <START> edgeEditParts.clear(); edgeEditParts = null; <END> }</code><technical_language>* need clear if set null right after. * movedBorderNodes set null</technical_language>

Target:
public void dispose() { edgeEditParts = null; movedBorderNodes = null; }
Source:
<code>public SetClockConfigurationRequestDto(final short timeZoneOffset, final CosemDateTimeDto daylightSavingsBegin, final CosemDateTimeDto daylightSavingsEnd, final byte daylightSavingsDeviation, final boolean daylightSavingsEnabled) { this.timeZoneOffset = timeZoneOffset; <START> this.daylightSavingsBegin = new CosemDateTimeDto(daylightSavingsBegin); <END> this.daylightSavingsEnd = new CosemDateTimeDto(daylightSavingsEnd); this.daylightSavingsDeviation = daylightSavingsDeviation; this.daylightSavingsEnabled = daylightSavingsEnabled; }</code><technical_language>I CosemDateTimeDto is immutable, is need create a new one. changes, fact exists a copy constructor (new CosemDateTimeDto(CosemDateTimeDto) iffy)</technical_language>

Target:
public SetClockConfigurationRequestDto(final short timeZoneOffset, final CosemDateTimeDto daylightSavingsBegin, final CosemDateTimeDto daylightSavingsEnd, final byte daylightSavingsDeviation, final boolean daylightSavingsEnabled) { this.timeZoneOffset = timeZoneOffset; this.daylightSavingsBegin = daylightSavingsBegin; this.daylightSavingsEnd = daylightSavingsEnd; this.daylightSavingsDeviation = daylightSavingsDeviation; this.daylightSavingsEnabled = daylightSavingsEnabled; }
Source:
<code>public Sheet createSheet() { Sheet defaultSheet = super.createSheet(); try { Sheet.Set set = defaultSheet.get(Sheet.PROPERTIES); PropertySupport.Reflection nextNodeProp = new PropertySupport.Reflection(this, Color.class, "getColor", "setColorUI"); nextNodeProp.setName("marker color"); set.put(nextNodeProp); PropertySupport.Reflection nextNodeProp2= new PropertySupport.Reflection(this, double.class, "getMarkerSize", "setMarkerSizeUI"); <START> nextNodeProp2.setName("marker size (mm)"); <END> nextNodeProp2.setShortDescription("Number to scale current visualization with"); set.put(nextNodeProp2); return defaultSheet; } catch (NoSuchMethodException ex) { Exceptions.printStackTrace(ex); } return defaultSheet; }</code><technical_language>more clear if this "marker radius" (like preference)</technical_language>

Target:
public Sheet createSheet() { Sheet defaultSheet = super.createSheet(); try { Sheet.Set set = defaultSheet.get(Sheet.PROPERTIES); PropertySupport.Reflection nextNodeProp = new PropertySupport.Reflection(this, Color.class, "getColor", "setColorUI"); nextNodeProp.setName("marker color"); set.put(nextNodeProp); PropertySupport.Reflection nextNodeProp2= new PropertySupport.Reflection(this, double.class, "getMarkerRadius", "setMarkerRadiusUI"); nextNodeProp2.setName("marker radius (mm)"); nextNodeProp2.setShortDescription("Number to scale current visualization with"); set.put(nextNodeProp2); return defaultSheet; } catch (NoSuchMethodException ex) { Exceptions.printStackTrace(ex); } return defaultSheet; }
Source:
<code>public void trade() { ArrayList<Order> fulfilledSells = new ArrayList<Order>(); ArrayList<Order> fulfilledBuys = new ArrayList<Order>(); for(String key : buyOrders.keySet()) { ArrayList<Order> pendingBuyOrders = buyOrders.get(key); <START> for(Order o : <END> pendingBuyOrders) { Order match = null; try{ match = findMatchingSellOrder(o); } catch(StockMarketExpection e) { e.printStackTrace(); } if(match == null) { continue; } else { if(o.getSize() > match.getSize()) { updateOrderSize(o, match, false); fulfilledSells.add(match); } else if(o.getSize() < match.getSize()) { updateOrderSize(match, o, true); fulfilledBuys.add(o); ; } else { fulfilledBuys.add(o); fulfilledSells.add(match); } try{ o.getTrader().tradePerformed(o, match.getPrice()); match.getTrader().tradePerformed(match, match.getPrice()); } catch (StockMarketExpection e) { e.printStackTrace(); } } } } deleteOrders(fulfilledBuys, fulfilledSells); }</code><technical_language>Vague variable name, consider more descriptive "order"</technical_language>

Target:
public void trade() { ArrayList<Order> fulfilledSells = new ArrayList<Order>(); ArrayList<Order> fulfilledBuys = new ArrayList<Order>(); for(String key : buyOrders.keySet()) { ArrayList<Order> pendingBuyOrders = buyOrders.get(key); for(Order findMatchOrder : pendingBuyOrders) { Order match = null; try{ match = findMatchingSellOrder(findMatchOrder); } catch(StockMarketExpection e) { e.printStackTrace(); } if(match == null) { continue; } else { if(findMatchOrder.getSize() > match.getSize()) { updateOrderSize(findMatchOrder, match, false); fulfilledSells.add(match); } else if(findMatchOrder.getSize() < match.getSize()) { updateOrderSize(match, findMatchOrder, true); fulfilledBuys.add(findMatchOrder); ; } else { fulfilledBuys.add(findMatchOrder); fulfilledSells.add(match); } try{ findMatchOrder.getTrader().tradePerformed(findMatchOrder, match.getPrice()); match.getTrader().tradePerformed(match, match.getPrice()); } catch (StockMarketExpection e) { e.printStackTrace(); } } } } deleteOrders(fulfilledBuys, fulfilledSells); }
Source:
<code>public void process(WatchedEvent event) { if (log.isTraceEnabled()) { log.trace("{}", event); } switch (event.getType()) { case NodeChildrenChanged: if (event.getPath().endsWith("conf")) { Matcher confDirMatcher = TABLE_CONFIG_DIR_PATTERN.matcher(event.getPath()); if (confDirMatcher.matches()) { try { clear(event.getPath()); getZooKeeper().exists(event.getPath(), watcher); <START> if (log.isTraceEnabled()) { log.trace("NodeChildrenChanged: resetting watcher for " + event.getPath()); } <END> } catch (KeeperException | InterruptedException e) { log.error("could not reset watcher on parent node: " + event.getPath()); } } } case NodeDataChanged: case NodeCreated: case NodeDeleted: remove(event.getPath()); break; case None: switch (event.getState()) { case Disconnected: if (log.isTraceEnabled()) { log.trace("Zoo keeper connection disconnected, clearing cache"); } clear(); break; case SyncConnected: break; case Expired: if (log.isTraceEnabled()) { log.trace("Zoo keeper connection expired, clearing cache"); } clear(); break; default: log.warn("Unhandled: {}", event); break; } break; default: log.warn("Unhandled: {}", event); break; } if (externalWatcher != null) { externalWatcher.process(event); } }</code><technical_language>In slf4j, accomplish need for checking log.isTraceEnabled(): java log.trace("NodeChildrenChanged: resetting watcher for {}", event.getPath());</technical_language>

Target:
public void process(WatchedEvent event) { if (log.isTraceEnabled()) { log.trace("{}", event); } switch (event.getType()) { case NodeChildrenChanged: if (event.getPath().endsWith("conf")) { Matcher confDirMatcher = TABLE_CONFIG_DIR_PATTERN.matcher(event.getPath()); if (confDirMatcher.matches()) { try { clear(event.getPath()); getZooKeeper().exists(event.getPath(), watcher); log.info("NodeChildrenChanged: resetting watcher for " + event.getPath()); } catch (KeeperException | InterruptedException e) { log.error("Could not reset watcher on parent node: " + event.getPath()); } } } case NodeDataChanged: case NodeCreated: case NodeDeleted: remove(event.getPath()); break; case None: switch (event.getState()) { case Disconnected: if (log.isTraceEnabled()) { log.trace("Zoo keeper connection disconnected, clearing cache"); } clear(); break; case SyncConnected: break; case Expired: if (log.isTraceEnabled()) { log.trace("Zoo keeper connection expired, clearing cache"); } clear(); break; default: log.warn("Unhandled: {}", event); break; } break; default: log.warn("Unhandled: {}", event); break; } if (externalWatcher != null) { externalWatcher.process(event); } }
Source:
<code>public RCConnection connect(Map<String, Object> parameters, RCConnectionListener listener) { RCLogger.i(TAG, "connect(): " + parameters.toString()); if (DeviceImpl.checkReachability(RCClient.getContext()) == RCDeviceListener.RCConnectivityStatus.RCConnectivityStatusNone) { RCLogger.e(TAG, "connect(): No reachability"); return null; } if (state == DeviceState.READY) { RCLogger.i(TAG, "RCDevice.connect(), with connectivity"); Boolean enableVideo = (Boolean)parameters.get("video-enabled"); RCConnection connection = new RCConnection(listener); connection.incoming = false; connection.state = RCConnection.ConnectionState.PENDING; DeviceImpl.GetInstance().sipuaConnectionListener = connection; <START> if (enableVideo == null) { <END> enableVideo = false; } HashMap<String, String> sipHeaders = null; if (parameters.containsKey("sip-headers")) { sipHeaders = (HashMap<String, String>)parameters.get("sip-headers"); } connection.setupWebrtcAndCall((String)parameters.get("username"), sipHeaders, enableVideo.booleanValue()); state = DeviceState.BUSY; return connection; } else { return null; } }</code><technical_language>@mehturt: assignment is casting Boolean effect. issues that</technical_language>

Target:
public RCConnection connect(Map<String, Object> parameters, RCConnectionListener listener) { RCLogger.i(TAG, "connect(): " + parameters.toString()); if (DeviceImpl.checkReachability(RCClient.getContext()) == RCDeviceListener.RCConnectivityStatus.RCConnectivityStatusNone) { RCLogger.e(TAG, "connect(): No reachability"); return null; } if (state == DeviceState.READY) { RCLogger.i(TAG, "RCDevice.connect(), with connectivity"); Boolean enableVideo = (Boolean)parameters.get(Prefs.VIDEO_ENABLED); RCConnection connection = new RCConnection(listener); connection.incoming = false; connection.state = RCConnection.ConnectionState.PENDING; DeviceImpl.GetInstance().sipuaConnectionListener = connection; if (enableVideo == null) { enableVideo = false; } HashMap<String, String> sipHeaders = null; if (parameters.containsKey(Prefs.SIP_HEADERS)) { sipHeaders = (HashMap<String, String>)parameters.get(Prefs.SIP_HEADERS); } if (connection.setupWebrtcAndCall((String)parameters.get("username"), sipHeaders, enableVideo) == RCConnection.Status.FAIL) { state = DeviceState.READY; return null; } state = DeviceState.BUSY; return connection; } else { return null; } }
Source:
<code>public void uploadAllLocalChanges_throwsOnUiThread() throws InterruptedException { SyncUser user = createTestUser(); Realm realm = Realm.getInstance(configuration); try { <START> SyncManager.getSession(configuration).uploadAllLocalChanges(); <END> } catch (IllegalStateException ignored) { } finally { realm.close(); } }</code><technical_language>Assertion missing</technical_language>

Target:
public void uploadAllLocalChanges_throwsOnUiThread() throws InterruptedException { Realm realm = Realm.getInstance(configuration); try { SyncManager.getSession(configuration).uploadAllLocalChanges(); fail("Should throw an IllegalStateException on Ui Thread"); } catch (IllegalStateException ignored) { } finally { realm.close(); } }
Source:
<code>private ZapMenuItem getMenuImportLocalOpenApi() { if (menuImportLocalOpenApi == null) { menuImportLocalOpenApi = new ZapMenuItem("openapi.topmenu.import.importopenapi"); menuImportLocalOpenApi.setToolTipText( Constant.messages.getString("openapi.topmenu.import.importopenapi.tooltip")); <START> final ExtensionOpenApi shadowCopy = this; <END> menuImportLocalOpenApi.addActionListener( new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { SwingUtilities.invokeLater( new Runnable() { @Override public void run() { new ImportFromFileDialog( View.getSingleton().getMainFrame(), shadowCopy); } }); } }); } return menuImportLocalOpenApi; }</code><technical_language>This variable name meaningful</technical_language>

Target:
private ZapMenuItem getMenuImportLocalOpenApi() { if (menuImportLocalOpenApi == null) { menuImportLocalOpenApi = new ZapMenuItem("openapi.topmenu.import.importopenapi"); menuImportLocalOpenApi.setToolTipText( Constant.messages.getString("openapi.topmenu.import.importopenapi.tooltip")); menuImportLocalOpenApi.addActionListener( new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { new ImportFromFileDialog( View.getSingleton().getMainFrame(), ExtensionOpenApi.this); } }); } return menuImportLocalOpenApi; }
Source:
<code>public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == SPEECH_REQUEST_CODE) { String searchInput = SpeechUtil.processSpeechResult(resultCode, data, getActivity()); <START> if (searchInput != null) <END> newNameInput.setText(searchInput); } }</code><technical_language>nit: Please add brackets for consistency. suggestion if (searchInput != null) {</technical_language>

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == SPEECH_REQUEST_CODE) { String searchInput = SpeechUtil.processSpeechResult(resultCode, data, getActivity()); if (searchInput != null){ newNameInput.setText(searchInput); } } }
Source:
<code>public Pattern getFilePattern() { <START> Pattern p; <END> try{ p = Pattern.compile(fileRegex); } catch(NullPointerException exception){ p = null; } return p; }</code><technical_language>Simply do a null check is better. java if (fileRegex == null) { return null; } return Pattern.compile(fileRegex);</technical_language>

Target:
public Pattern getFilePattern() { if (fileRegex == null) { return null; } return Pattern.compile(fileRegex); }
Source:
<code>private void zoom(@NonNull TimeGraphEntry entry, @NonNull IProgressMonitor monitor) { if (getZoomStartTime() <= fStartTime && getZoomEndTime() >= fEndTime) { <START> entry.setZoomedEventList(null); <END> } else { List<ITimeEvent> zoomedEventList = getEventList(entry, getZoomStartTime(), getZoomEndTime(), getResolution(), monitor); if (zoomedEventList != null) { entry.setZoomedEventList(zoomedEventList); } } redraw(); for (ITimeGraphEntry child : entry.getChildren()) { if (monitor.isCanceled()) { return; } if (child instanceof TimeGraphEntry) { zoom((TimeGraphEntry) child, monitor); } } }</code><technical_language>Do need wrap this in applyResults()</technical_language>

Target:
private void zoom(@NonNull TimeGraphEntry entry, @NonNull IProgressMonitor monitor) { if (getZoomStartTime() <= fStartTime && getZoomEndTime() >= fEndTime) { applyResults(() -> { entry.setZoomedEventList(null); }); } else { List<ITimeEvent> zoomedEventList = getEventList(entry, getZoomStartTime(), getZoomEndTime(), getResolution(), monitor); if (zoomedEventList != null) { applyResults(() -> { entry.setZoomedEventList(zoomedEventList); }); } } redraw(); for (ITimeGraphEntry child : entry.getChildren()) { if (monitor.isCanceled()) { return; } if (child instanceof TimeGraphEntry) { zoom((TimeGraphEntry) child, monitor); } } }
Source:
<code>public void validateTerms(final Set<ValueIndexTerm> queryTerms) throws IllegalArgumentException { checkInvalidAndRequiredTerms(queryTerms, NAME, <START> new String[]{ <END> LibraryValueProjectRootPathIndexTerm.TERM, null, null }, (t) -> (t instanceof LibraryValueProjectRootPathIndexTerm), (t) -> (t instanceof LibraryValueFileNameIndexTerm), (t) -> (t instanceof LibraryFileExtensionIndexTerm) ); checkTermsSize(3, queryTerms); }</code><technical_language>enough pass snippet below? java new String[]{LibraryValueProjectRootPathIndexTerm.TERM}</technical_language>

Target:
public void validateTerms(final Set<ValueIndexTerm> queryTerms) throws IllegalArgumentException { checkInvalidAndRequiredTerms(queryTerms, NAME, new String[]{ LibraryValueModuleRootPathIndexTerm.TERM, null, null }, (t) -> (t instanceof LibraryValueModuleRootPathIndexTerm), (t) -> (t instanceof LibraryValueFileNameIndexTerm), (t) -> (t instanceof LibraryFileExtensionIndexTerm) ); checkTermsSize(3, queryTerms); }
Source:
<code>public boolean runInThread(Runnable runnable) { try { executorService.submit(runnable); return true; } catch (RejectedExecutionException e) { <START> log.error("Task rejected due to: " + e.getMessage(), e); <END> return false; } }</code><technical_language>exception tracktrace logged debug mode</technical_language>

Target:
public boolean runInThread(Runnable runnable) { try { executorService.submit(runnable); return true; } catch (RejectedExecutionException e) { log.error("Task rejected due to: ", e); return false; } }
Source:
<code>public PageTitle(JSONObject json) { this.namespace = json.optString("namespace", null); this.text = json.optString("text", null); this.fragment = json.optString("fragment", null); <START> this.site = new Site(json.optString("site")); <END> this.properties = new PageProperties(json.optJSONObject("properties")); this.thumbUrl = json.optString("thumbUrl", null); this.description = json.optString("description", null); }</code><technical_language>This a new change Site's constructor handle a null String</technical_language>

Target:
public PageTitle(JSONObject json) { this.namespace = json.optString("namespace", null); this.text = json.optString("text", null); this.fragment = json.optString("fragment", null); this.site = json.has("site") ? new Site(json.optString("site")) : null; this.properties = json.has("properties") ? new PageProperties(json.optJSONObject("properties")) : null; this.thumbUrl = json.optString("thumbUrl", null); this.description = json.optString("description", null); }
Source:
<code>protected final JClass getListenerTargetClass(HasPreferences holder) { <START> return holder.usingSupportV7Preference() ? getClasses().SUPPORT_V7_PREFERENCE : getClasses().PREFERENCE; <END> }</code><technical_language>This code : java holder.usingSupportV7Preference() ? getClasses().SUPPORT_V7_PREFERENCE : getClasses().PREFERENCE; is repeated times in code. add a method JClass getPreferenceClass() in HasPreferences</technical_language>

Target:
protected final JClass getListenerTargetClass(HasPreferences holder) { return holder.getBasePreferenceClass(); }
Source:
<code>public ArrayList<AccountObject> getProjectMembers(long id) { MySQLQuerySet valueSet = new MySQLQuerySet(); valueSet.addTableName(ProjectRoleEnum.TABLE_NAME); valueSet.addEqualCondition(ProjectRoleEnum.PROJECT_ID, id); valueSet.addCrossJoinMultiCondition(AccountEnum.TABLE_NAME, ProjectRoleEnum.ACCOUNT_ID, AccountEnum.TABLE_NAME + '.' + AccountEnum.ID, AccountEnum.ENABLE, "1"); String query = valueSet.getSelectQuery(); ResultSet result = mControl.executeQuery(query); ArrayList<AccountObject> members = new ArrayList<AccountObject>(); try { while (result.next()) { <START> members.add(convertAccount2(result)); <END> } } catch (SQLException e) { e.printStackTrace(); } finally { closeResultSet(result); } return members; }</code><technical_language>convertAccount2</technical_language>

Target:
public ArrayList<AccountObject> getProjectMembers(long id) { MySQLQuerySet valueSet = new MySQLQuerySet(); valueSet.addTableName(ProjectRoleEnum.TABLE_NAME); valueSet.addEqualCondition(ProjectRoleEnum.PROJECT_ID, id); valueSet.addCrossJoinMultiCondition(AccountEnum.TABLE_NAME, ProjectRoleEnum.ACCOUNT_ID, AccountEnum.TABLE_NAME + '.' + AccountEnum.ID, AccountEnum.ENABLE, "1"); String query = valueSet.getSelectQuery(); ResultSet result = mControl.executeQuery(query); ArrayList<AccountObject> members = new ArrayList<AccountObject>(); try { while (result.next()) { members.add(convertAccountUseAccountId(result)); } } catch (SQLException e) { e.printStackTrace(); } finally { closeResultSet(result); } return members; }
Source:
<code>private boolean hasMatchingAspectRatio(Size resolution, Rational aspectRatio) { boolean isMatch; if (aspectRatio == null) { isMatch = false; } else if (aspectRatio.equals( new Rational(resolution.getWidth(), resolution.getHeight()))) { isMatch = true; } else { double scale = <START> resolution.getWidth() / <END> (double) aspectRatio.getNumerator(); int scaleHeight = (int) (aspectRatio.getDenominator() * scale); int ceilAlignedHeight = ALIGN16 * (int) Math.ceil(scaleHeight / (double) ALIGN16); int floorAlignedHeight = ALIGN16 * (int) Math.floor(scaleHeight / (double) ALIGN16); isMatch = resolution.getHeight() == ceilAlignedHeight || resolution.getHeight() == floorAlignedHeight; } return isMatch; }</code><technical_language>I sufficient width for 'scale' here. For instance, get isMatch == true for 1080 x 1088 1:1 aspect ratio, get isMatch == false for 1088 x 1080</technical_language>

Target:
private boolean hasMatchingAspectRatio(Size resolution, Rational aspectRatio) { boolean isMatch; if (aspectRatio == null) { isMatch = false; } else if (aspectRatio.equals( new Rational(resolution.getWidth(), resolution.getHeight()))) { isMatch = true; } else { if (resolution.getHeight() % 16 == 0) { isMatch = checkAspectRatioAlignedMod16(resolution, aspectRatio); } else if (resolution.getWidth() % 16 == 0) { isMatch = checkAspectRatioAlignedMod16( new Size(resolution.getHeight(), resolution.getWidth()), new Rational(aspectRatio.getDenominator(), aspectRatio.getNumerator())); } else { isMatch = false; } } return isMatch; }
Source:
<code>protected void setSelectionToWidget(ISelection selection, boolean reveal) { if (selection instanceof ITreeSelection) { ITreeSelection treeSelection = (ITreeSelection) selection; <START> setSelectionToWidget(new ArrayList<Object>(Arrays.asList(treeSelection.getPaths())), reveal); <END> } else { super.setSelectionToWidget(selection, reveal); } }</code><technical_language>this change needed create 2 lists, array-to-list conversion is needed</technical_language>

Target:
protected void setSelectionToWidget(ISelection selection, boolean reveal) { if (selection instanceof ITreeSelection) { ITreeSelection treeSelection = (ITreeSelection) selection; setSelectionToWidget(Arrays.asList(treeSelection.getPaths()), reveal); } else { super.setSelectionToWidget(selection, reveal); } }
Source:
<code>private void buildTransformers_3_0(ResourceTransformationDescriptionBuilder builder) { builder.addChildResource(RemotingEndpointResource.ENDPOINT_PATH) .getAttributeBuilder().setValueConverter(new AttributeConverter.DefaultAttributeConverter() { @Override protected void convertAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { <START> if ("remote".equals(attributeValue.asString())) { <END> attributeValue.set("remoting"); } } }, "sasl-protocol") ; builder.addChildResource(ConnectorResource.PATH).getAttributeBuilder() .setDiscard(DiscardAttributeChecker.UNDEFINED, ConnectorCommon.SASL_AUTHENTICATION_FACTORY, ConnectorResource.SSL_CONTEXT) .addRejectCheck(RejectAttributeChecker.DEFINED, ConnectorCommon.SASL_AUTHENTICATION_FACTORY, ConnectorResource.SSL_CONTEXT) ; builder.addChildResource(HttpConnectorResource.PATH).getAttributeBuilder() .setDiscard(DiscardAttributeChecker.UNDEFINED, ConnectorCommon.SASL_AUTHENTICATION_FACTORY) .addRejectCheck(RejectAttributeChecker.DEFINED, ConnectorCommon.SASL_AUTHENTICATION_FACTORY); builder.addChildResource(RemoteOutboundConnectionResourceDefinition.ADDRESS).getAttributeBuilder() .setDiscard(DiscardAttributeChecker.UNDEFINED, ConnectorCommon.SASL_AUTHENTICATION_FACTORY) .addRejectCheck(RejectAttributeChecker.DEFINED, RemoteOutboundConnectionResourceDefinition.AUTHENTICATION_CONTEXT); }</code><technical_language>I spoken @dmlloyd 'remote' 'remoting' separate implementations, replace this scenes. Instead, I a) reject this if is expression b) introduce 'remote' converter if attribute is **undefined** If 'remote' is a valid 6.2 - 7.0 need do else :)</technical_language>

Target:
private void buildTransformers_3_0(ResourceTransformationDescriptionBuilder builder) { builder.addChildResource(ConnectorResource.PATH).getAttributeBuilder() .setDiscard(DiscardAttributeChecker.UNDEFINED, ConnectorCommon.SASL_AUTHENTICATION_FACTORY, ConnectorResource.SSL_CONTEXT) .addRejectCheck(RejectAttributeChecker.DEFINED, ConnectorCommon.SASL_AUTHENTICATION_FACTORY, ConnectorResource.SSL_CONTEXT) ; builder.addChildResource(RemotingEndpointResource.ENDPOINT_PATH).getAttributeBuilder() .setValueConverter(new AttributeConverter.DefaultAttributeConverter() { @Override protected void convertAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { if (!attributeValue.isDefined()) { attributeValue.set("remoting"); } } }, RemotingEndpointResource.SASL_PROTOCOL); builder.addChildResource(HttpConnectorResource.PATH).getAttributeBuilder() .setDiscard(DiscardAttributeChecker.UNDEFINED, ConnectorCommon.SASL_AUTHENTICATION_FACTORY) .addRejectCheck(RejectAttributeChecker.DEFINED, ConnectorCommon.SASL_AUTHENTICATION_FACTORY); builder.addChildResource(RemoteOutboundConnectionResourceDefinition.ADDRESS).getAttributeBuilder() .setDiscard(DiscardAttributeChecker.UNDEFINED, ConnectorCommon.SASL_AUTHENTICATION_FACTORY) .addRejectCheck(RejectAttributeChecker.DEFINED, RemoteOutboundConnectionResourceDefinition.AUTHENTICATION_CONTEXT); }
Source:
<code>void init() throws IngestModuleException { try { currentCase = Case.getOpenCase(); tskCase = currentCase.getSleuthkitCase(); } catch (NoCurrentCaseException ex) { <START> throw new IngestModuleException("Exception while getting open case.", ex); <END> } }</code><technical_language>IngestModuleExceptions messages created Message annotations displayed users</technical_language>

Target:
void init() throws IngestModuleException { try { currentCase = Case.getOpenCase(); tskCase = currentCase.getSleuthkitCase(); } catch (NoCurrentCaseException ex) { throw new IngestModuleException(Bundle.Extract_indexError_message(), ex); } }
Source:
<code>@Override public PerformanceLoggingStopWatch createStopWatch( String tag, Object message ) { <START> return new LoggingStopWatch( tag, message + this.getMessage() ); <END> }</code><technical_language>Instead of string + string, pass "message" object "getMessage" method format in operation. format string "%s sessionid[%s] userid[%s] requestid[%s]" dont intend a one-space padding, two-space padding 3 space padding format string either</technical_language>

Target:
@Override public PerformanceLoggingStopWatch createStopWatch( String tag, Object message ) { return new LoggingStopWatch( tag, getMessage( String.valueOf( message ) ) ); }
Source:
<code>public String getFeedbackSessionResultSummaryAsCsv(String courseId, String feedbackSessionName, String instructorEmail, String filterText, boolean isMissingResponsesShown, boolean isStatsShown, <START> String questionId) <END> throws EntityDoesNotExistException, ExceedingRangeException { Assumption.assertNotNull(ERROR_NULL_PARAMETER, courseId); Assumption.assertNotNull(ERROR_NULL_PARAMETER, feedbackSessionName); return feedbackSessionsLogic.getFeedbackSessionResultsSummaryAsCsv( feedbackSessionName, courseId, instructorEmail, filterText, isMissingResponsesShown, isStatsShown, questionId); }</code><technical_language>good if update Method description @param questionId is nullable, else confusing original method description requires non-null for param</technical_language>

Target:
public String getFeedbackSessionResultSummaryAsCsv( String courseId, String feedbackSessionName, String instructorEmail, String filterText, boolean isMissingResponsesShown, boolean isStatsShown, String questionId) throws EntityDoesNotExistException, ExceedingRangeException { Assumption.assertNotNull(ERROR_NULL_PARAMETER, courseId); Assumption.assertNotNull(ERROR_NULL_PARAMETER, feedbackSessionName); return feedbackSessionsLogic.getFeedbackSessionResultsSummaryAsCsv( feedbackSessionName, courseId, instructorEmail, questionId, filterText, isMissingResponsesShown, isStatsShown); }
Source:
<code>public String deconstructSearchQuery(String searchQuery) { ArrayList<String> features = new ArrayList<>(); for (SearchQueryFeature f : SearchQueryFeature.values()) { <START> if (f.getPattern().matcher(searchQuery).find()) { <END> features.add(f.getDescription()); } } int doubleQuotesCount = 0; for (int i = 0; i < searchQuery.length(); i++) { if (searchQuery.substring(i, i + 1).contains("\"")) { doubleQuotesCount++; } } if (doubleQuotesCount > 0) { if (doubleQuotesCount == 1) { features.add("has one double quote"); } features.add((doubleQuotesCount % 2) == 0 ? "has even double quotes" : "has odd double quotes"); } if (features.size() == 0) { features.add("is simple"); } return features.toString(); }</code><technical_language>worth checking input function is null/empty run pattterns</technical_language>

Target:
public String deconstructSearchQuery(String searchQuery) { ArrayList<String> features = new ArrayList<>(); if (searchQuery.isEmpty()) { features.add("is null"); return features.toString(); } switch(searchQuery) { case "": features.add("is empty"); break; case "*": features.add("is just *"); break; case "?": features.add("is just ?"); break; case "~": features.add("is just ~"); break; case "searchTerms": features.add("is searchTerms"); break; } if (features.size() > 0) { return features.toString(); } if (searchQuery.contains("@")) { features.add("has @"); } if (searchQuery.contains("prefix:")) { features.add("is prefix"); } if (searchQuery.contains("insource:")) { features.add("is insource"); } if (searchQuery.contains("incategory:")) { features.add("is incategory"); } if (searchQuery.contains("intitle:")) { features.add("is intitle"); } if (searchQuery.substring(0, 1).equals("~")) { features.add("forces search results"); } if (searchQuery.substring(searchQuery.length() - 1).equals("?")) { features.add("ends with ?"); } for (SearchQueryFeatureRegex f : SearchQueryFeatureRegex.values()) { if (f.getPattern().matcher(searchQuery).find()) { features.add(f.getDescription()); } } int doubleQuotesCount = searchQuery.length() - searchQuery.replace("\"", "").length(); if (doubleQuotesCount > 0) { if (doubleQuotesCount == 1) { features.add("has one double quote"); } features.add((doubleQuotesCount % 2) == 0 ? "has even double quotes" : "has odd double quotes"); } if (features.size() == 0) { features.add("is simple"); } return features.toString(); }
Source:
<code>public Optional<Argument> build(Type type, Object value, ConfigRegistry config) { if (String.class.equals(type)) { return Optional.empty(); } String nullableJson = value == null ? null : config.get(JsonConfig.class).getJsonMapper().toJson(type, value, config); <START> String json = "null".equalsIgnoreCase(nullableJson) ? null : nullableJson; END> Arguments a = config.get(Arguments.class); return Optional.of(JdbiOptionals.findFirstPresent( () -> a.findFor(QualifiedType.of(String.class).with(Json.class), json), () -> a.findFor(String.class, json)) .orElseThrow(() -> new UnableToCreateStatementException(JSON_NOT_STORABLE))); }</code><technical_language>lowercase null is valid JSON here--equalsIgnoreCase is overkill</technical_language>

Target:
public Optional<Argument> build(Type type, Object value, ConfigRegistry config) { if (String.class.equals(type)) { return Optional.empty(); } String nullableJson = value == null ? null : config.get(JsonConfig.class).getJsonMapper().toJson(type, value, config); String json = "null".equals(nullableJson) ? null : nullableJson; Arguments a = config.get(Arguments.class); return Optional.of(JdbiOptionals.findFirstPresent( () -> a.findFor(QualifiedType.of(String.class).with(Json.class), json), () -> a.findFor(String.class, json)) .orElseThrow(() -> new UnableToCreateStatementException(JSON_NOT_STORABLE))); }
Source:
<code>private Provider<StreamlineProcessor> createRulesProcessorProvider(final RuleExtractor ruleExtractor) { return new Provider<StreamlineProcessor>() { @Override public StreamlineProcessor create(TopologyComponent component) { RulesProcessor processor = new RulesProcessor(); ObjectMapper objectMapper = new ObjectMapper(); Set<Stream> outputStreams = createOutputStreams((TopologyOutputComponent) component); processor.addOutputStreams(outputStreams); <START> boolean processAll = component.getConfig().getBoolean(RulesProcessor.CONFIG_PROCESS_ALL); <END> processor.setProcessAll(processAll); Object ruleList = component.getConfig().getAny(RulesProcessor.CONFIG_KEY_RULES); List<Long> ruleIds = objectMapper.convertValue(ruleList, new TypeReference<List<Long>>() { }); try { List<Rule> rules = new ArrayList<>(); for (Long ruleId : ruleIds) { rules.add(ruleExtractor.getRule(ruleId)); } processor.setRules(rules); } catch (Exception ex) { throw new RuntimeException(ex); } return processor; } }; }</code><technical_language>I processAll flag explicitly handled anywhere. exposed user? is expectation UI set true in config json adds a BRANCH processor topology</technical_language>

Target:
private Provider<StreamlineProcessor> createRulesProcessorProvider(final RuleExtractor ruleExtractor) { return new Provider<StreamlineProcessor>() { @Override public StreamlineProcessor create(TopologyComponent component) { RulesProcessor processor = new RulesProcessor(); ObjectMapper objectMapper = new ObjectMapper(); Set<Stream> outputStreams = createOutputStreams((TopologyOutputComponent) component); processor.addOutputStreams(outputStreams); boolean processAll = component.getConfig().getBoolean(RulesProcessor.CONFIG_PROCESS_ALL, true); processor.setProcessAll(processAll); Object ruleList = component.getConfig().getAny(RulesProcessor.CONFIG_KEY_RULES); List<Long> ruleIds = objectMapper.convertValue(ruleList, new TypeReference<List<Long>>() { }); try { List<Rule> rules = new ArrayList<>(); for (Long ruleId : ruleIds) { rules.add(ruleExtractor.getRule(ruleId)); } processor.setRules(rules); } catch (Exception ex) { throw new RuntimeException(ex); } return processor; } }; }
Source:
<code>private long handleRailsUpdatedAt(T model) { <START> if (model.hasField("updated_at")) { <END> long oldUpdatedAt = (Long) model.getField("updated_at"); model.setField("updated_at", System.currentTimeMillis()); return oldUpdatedAt; } return 0; }</code><technical_language>Is field exists is a long? this fail it</technical_language>

Target:
private long handleRailsUpdatedAt(T model) { if (model.hasField("updated_at") && model.getField("updated_at").getClass().equals(Long.class)) { long oldUpdatedAt = (Long) model.getField("updated_at"); model.setField("updated_at", System.currentTimeMillis()); return oldUpdatedAt; } return 0; }
Source:
<code>protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); try (VCFFileReader vcfReader = new VCFFileReader(INPUT.toPath(), false)) { final Iterator<Interval> samFileIterator = VCFFileReader.toIntervals(vcfReader, INCLUDE_FILTERED); try (IntervalListWriter writer = new IntervalListWriter(OUTPUT.toPath(), new SAMFileHeader(vcfReader.getFileHeader().getSequenceDictionary()))) { final IntervalList.IntervalMergerIterator mergingIterator = <START> new IntervalList.IntervalMergerIterator(samFileIterator, true, false, true); <END> for (final Interval interval : new IterableAdapter<>(mergingIterator)){ writer.write(interval); } } catch (IOException e) { if(!OUTPUT.renameTo(new File(OUTPUT.getAbsolutePath() + "incomplete"))){ OUTPUT.delete(); }; throw new PicardException("Trouble writing IntervalList. Renamed <OUTPUT> to <OUTPUT>.incomplete to avoid misuse.", e); } } return 0; }</code><technical_language>nice expose command line option concatenate merged interval names. In case prompted this, a TON of sites (think genome gvcf bp resolution) merged a single interval, outrageously long concatenated name. concatenated names carry useful information, resulting interval list extremely large</technical_language>

Target:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); final boolean concatenate_ids = (VARIANT_ID_METHOD == VARIANT_ID_TYPES.CONCAT_ALL); try (VCFFileReader vcfReader = new VCFFileReader(INPUT.toPath(), false)) { final Iterator<Interval> samFileIterator = VCFFileReader.toIntervals(vcfReader, INCLUDE_FILTERED); try (IntervalListWriter writer = new IntervalListWriter(OUTPUT.toPath(), new SAMFileHeader(vcfReader.getFileHeader().getSequenceDictionary()))) { final IntervalList.IntervalMergerIterator mergingIterator = new IntervalList.IntervalMergerIterator(samFileIterator, true, false, concatenate_ids); for (final Interval interval : new IterableAdapter<>(mergingIterator)){ writer.write(interval); } } catch (IOException e) { if(!OUTPUT.renameTo(new File(OUTPUT.getAbsolutePath() + ".incomplete"))){ OUTPUT.delete(); } throw new PicardException("Trouble writing IntervalList. Renamed <OUTPUT> to <OUTPUT>.incomplete to avoid misuse.", e); } } return 0; }