auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Object execute(final ExecutionEvent event) throws ExecutionException { CustomizeUMLLabelDialog dialog = new CustomizeUMLLabelDialog(Display.getDefault().getActiveShell()); int code = dialog.open(); if (code == Window.OK) { 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; }

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:
public void dispose() { edgeEditParts.clear(); edgeEditParts = null; }

Target:
public void dispose() { edgeEditParts = null; movedBorderNodes = null; }
Source:
public SetClockConfigurationRequestDto(final short timeZoneOffset, final CosemDateTimeDto daylightSavingsBegin, final CosemDateTimeDto daylightSavingsEnd, final byte daylightSavingsDeviation, final boolean daylightSavingsEnabled) { this.timeZoneOffset = timeZoneOffset; this.daylightSavingsBegin = new CosemDateTimeDto(daylightSavingsBegin); this.daylightSavingsEnd = new CosemDateTimeDto(daylightSavingsEnd); this.daylightSavingsDeviation = daylightSavingsDeviation; this.daylightSavingsEnabled = daylightSavingsEnabled; }

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:
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"); nextNodeProp2.setName("marker size (mm)"); nextNodeProp2.setShortDescription("Number to scale current visualization with"); set.put(nextNodeProp2); return defaultSheet; } catch (NoSuchMethodException ex) { Exceptions.printStackTrace(ex); } return defaultSheet; }

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:
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 o : 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); }

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:
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); if (log.isTraceEnabled()) { log.trace("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); } }

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:
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; if (enableVideo == null) { 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; } }

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:
public void uploadAllLocalChanges_throwsOnUiThread() throws InterruptedException { SyncUser user = createTestUser(); Realm realm = Realm.getInstance(configuration); try { SyncManager.getSession(configuration).uploadAllLocalChanges(); } catch (IllegalStateException ignored) { } finally { realm.close(); } }

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:
private ZapMenuItem getMenuImportLocalOpenApi() { if (menuImportLocalOpenApi == null) { menuImportLocalOpenApi = new ZapMenuItem("openapi.topmenu.import.importopenapi"); menuImportLocalOpenApi.setToolTipText( Constant.messages.getString("openapi.topmenu.import.importopenapi.tooltip")); final ExtensionOpenApi shadowCopy = this; 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; }

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:
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); } }

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:
public Pattern getFilePattern() { Pattern p; try{ p = Pattern.compile(fileRegex); } catch(NullPointerException exception){ p = null; } return p; }

Target:
public Pattern getFilePattern() { if (fileRegex == null) { return null; } return Pattern.compile(fileRegex); }
Source:
private void zoom(@NonNull TimeGraphEntry entry, @NonNull IProgressMonitor monitor) { if (getZoomStartTime() <= fStartTime && getZoomEndTime() >= fEndTime) { entry.setZoomedEventList(null); } 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); } } }

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:
public void validateTerms(final Set<ValueIndexTerm> queryTerms) throws IllegalArgumentException { checkInvalidAndRequiredTerms(queryTerms, NAME, new String[]{ LibraryValueProjectRootPathIndexTerm.TERM, null, null }, (t) -> (t instanceof LibraryValueProjectRootPathIndexTerm), (t) -> (t instanceof LibraryValueFileNameIndexTerm), (t) -> (t instanceof LibraryFileExtensionIndexTerm) ); checkTermsSize(3, queryTerms); }

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:
public boolean runInThread(Runnable runnable) { try { executorService.submit(runnable); return true; } catch (RejectedExecutionException e) { log.error("Task rejected due to: " + e.getMessage(), e); return false; } }

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:
public PageTitle(JSONObject json) { this.namespace = json.optString("namespace", null); this.text = json.optString("text", null); this.fragment = json.optString("fragment", null); this.site = new Site(json.optString("site")); this.properties = new PageProperties(json.optJSONObject("properties")); this.thumbUrl = json.optString("thumbUrl", null); this.description = json.optString("description", null); }

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:
protected final JClass getListenerTargetClass(HasPreferences holder) { return holder.usingSupportV7Preference() ? getClasses().SUPPORT_V7_PREFERENCE : getClasses().PREFERENCE; }

Target:
protected final JClass getListenerTargetClass(HasPreferences holder) { return holder.getBasePreferenceClass(); }
Source:
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(convertAccount2(result)); } } catch (SQLException e) { e.printStackTrace(); } finally { closeResultSet(result); } return members; }

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:
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 = resolution.getWidth() / (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; }

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:
protected void setSelectionToWidget(ISelection selection, boolean reveal) { if (selection instanceof ITreeSelection) { ITreeSelection treeSelection = (ITreeSelection) selection; setSelectionToWidget(new ArrayList<Object>(Arrays.asList(treeSelection.getPaths())), reveal); } else { super.setSelectionToWidget(selection, reveal); } }

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:
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) { if ("remote".equals(attributeValue.asString())) { 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); }

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:
void init() throws IngestModuleException { try { currentCase = Case.getOpenCase(); tskCase = currentCase.getSleuthkitCase(); } catch (NoCurrentCaseException ex) { throw new IngestModuleException("Exception while getting open case.", ex); } }

Target:
void init() throws IngestModuleException { try { currentCase = Case.getOpenCase(); tskCase = currentCase.getSleuthkitCase(); } catch (NoCurrentCaseException ex) { throw new IngestModuleException(Bundle.Extract_indexError_message(), ex); } }
Source:
@Override public PerformanceLoggingStopWatch createStopWatch( String tag, Object message ) { return new LoggingStopWatch( tag, message + this.getMessage() ); }

Target:
@Override public PerformanceLoggingStopWatch createStopWatch( String tag, Object message ) { return new LoggingStopWatch( tag, getMessage( String.valueOf( message ) ) ); }
Source:
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, filterText, isMissingResponsesShown, isStatsShown, questionId); }

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:
public String deconstructSearchQuery(String searchQuery) { ArrayList<String> features = new ArrayList<>(); for (SearchQueryFeature f : SearchQueryFeature.values()) { if (f.getPattern().matcher(searchQuery).find()) { 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(); }

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:
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".equalsIgnoreCase(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))); }

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:
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); 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; } }; }

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:
private long handleRailsUpdatedAt(T model) { if (model.hasField("updated_at")) { long oldUpdatedAt = (Long) model.getField("updated_at"); model.setField("updated_at", System.currentTimeMillis()); return oldUpdatedAt; } return 0; }

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:
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 = new IntervalList.IntervalMergerIterator(samFileIterator, true, false, true); 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; }

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; }
Source:
public Map<String, Object> getUsersList(String assetInode, String permission, Map<String, String> params) throws Exception { int start = 0; if (params.containsKey("start")) { start = Integer.parseInt((String) params.get("start")); } int limit = -1; if (params.containsKey("limit")) { limit = Integer.parseInt((String) params.get("limit")); } String query = ""; if (params.containsKey("query")) { query = (String) params.get("query"); } boolean includeAnonymous = false; if (params.containsKey("includeAnonymous")) { includeAnonymous = Boolean.valueOf((String) params.get("includeAnonymous")); } boolean includeDefault = true; if (params.containsKey("includeDefault")) { includeDefault = Boolean.valueOf((String) params.get("includeDefault")); } Map<String, Object> results; if ((InodeUtils.isSet(assetInode) && !assetInode.equals("0")) && (UtilMethods.isSet(permission) && !permission.equals("0"))) { results = processUserListWithPermissionOnInode(assetInode, permission, query, start, limit); } else { results = processUserList(query, start, limit, includeAnonymous, includeDefault); } return results; }

Target:
public Map<String, Object> getUsersList(String assetInode, String permission, Map<String, String> params) throws Exception { final int start = toInt("start", params, 0); final int limit = toInt("limit", params, 100); final String query = getMapValue(params, "query", StringUtils.EMPTY); final boolean includeAnonymous = toBoolean("includeAnonymous", params, false); final boolean includeDefault = toBoolean("includeDefault", params, true); Map<String, Object> results; if ((InodeUtils.isSet(assetInode) && !"0".equals(assetInode)) && (UtilMethods.isSet(permission) && !"0".equals(permission))) { results = processUserListWithPermissionOnInode(assetInode, permission, query, start, limit); } else { results = processUserList(query, start, limit, includeAnonymous, includeDefault); } return results; }
Source:
public void reportError(Throwable error) { Monitor.getMonitor().getEventSender().sendException(new Throwable(delegateClass.getCanonicalName() + " failed to process tuple"), boltService); super.reportError(error); }

Target:
public void reportError(Throwable error) { Monitor.getMonitor().getEventSender().sendException(error, boltService); super.reportError(error); }
Source:
public void onTaskFinished(ObaStopsForLocationResponse response) { if (response.getCode() != ObaApi.OBA_OK) { showErrorMessage(getString(UIHelp.getStopErrorString(this, response.getCode()))); return; } Log.d(TAG, "Found stops."); ObaStop closestStop; closestStop = UIHelp.getClosestStop(this, response.getStops(), mLastKnownLocation); if (closestStop != null) { Log.d(TAG, "Closest stop is: " + closestStop.getName()); mDistanceToStopView.setObaStop(closestStop); mArrowView.setObaStop(closestStop); mProgressMessage.setText(getString(R.string.getting_arrival_times)); Intent i = new Builder(this, closestStop).getIntent(); this.setIntent(i); initLoader(i.getExtras()); } else { Log.e(TAG, "No stops returned"); } }

Target:
public void onTaskFinished(ObaStopsForLocationResponse response) { if (response.getCode() != ObaApi.OBA_OK) { showErrorMessage(getString(UIHelp.getStopErrorString(this, response.getCode()))); return; } Log.d(TAG, "Found stops."); ObaStop closestStop = UIHelp.getClosestStop(this, response.getStops(), mLastKnownLocation); if (closestStop != null) { Log.d(TAG, "Closest stop is: " + closestStop.getName()); mDistanceToStopView.setObaStop(closestStop); mArrowView.setObaStop(closestStop); mProgressMessage.setText(getString(R.string.getting_arrival_times)); Intent i = new Builder(this, closestStop).getIntent(); this.setIntent(i); initLoader(i.getExtras()); } else { Log.e(TAG, "No stops returned"); } }
Source:
public Document createDocument(Iso19115Collection.Document doc) throws GeneratorException { String id = doc.id(); if (doc.contents().trim().isEmpty()) { throw new EmptyDocumentException(); } Document document = new Document(); document.add(new StringField(IndexArgs.ID, id, Field.Store.YES)); document.add(new SortedDocValuesField(IndexArgs.ID, new BytesRef(id))); document.add(new StoredField(IsoField.TITLE.name, doc.getTitle())); document.add(new StoredField(IsoField.ABSTRACT.name, doc.getAbstract())); if (args.storeRaw) { document.add(new StoredField(IndexArgs.RAW, doc.raw())); } FieldType fieldType = new FieldType(); fieldType.setStored(args.storeContents); if (args.storeDocvectors) { fieldType.setStoreTermVectors(true); fieldType.setStoreTermVectorPositions(true); } if (args.storePositions) { fieldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS); } else { fieldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS); } document.add(new Field(IndexArgs.CONTENTS, doc.contents(), fieldType)); return document; }

Target:
public Document createDocument(Iso19115Collection.Document doc) throws GeneratorException { Document document = super.createDocument(doc); document.add(new StoredField(Iso19115Field.TITLE.name, doc.getTitle())); document.add(new StoredField(Iso19115Field.ABSTRACT.name, doc.getAbstract())); return document; }
Source:
private Config(String configPath) { assert configPath != null; assert configPath.endsWith(".properties"); try { config = new PropertiesConfiguration(configPath); } catch (ConfigurationException e) { e.printStackTrace(); } overrideWithEnvironmentVariables(config); assertAllPropertiesPresent(config); }

Target:
private Config(String configPath) { assert configPath != null; assert configPath.endsWith(".properties"); try { config = new PropertiesConfiguration(configPath); } catch (ConfigurationException e) { e.printStackTrace(); } overrideWithEnvironmentVariables(config); assertAllPropertiesPresent(); assertAllPropertiesValid(); }
Source:
public IConnection createOpenshiftConnection(IServer server, ADBInfo adb) { return createOpenshiftConnection(server, adb, true); }

Target:
public IConnection createOpenshiftConnection(IServer server, ADBInfo adb) { return createOpenshiftConnection(server, adb, ConnectionsRegistrySingleton.getInstance()); }
Source:
public void testSetupDiOpenDevRegKey() throws Exception { HANDLE hDevInfoSet = setupApi.SetupDiGetClassDevs(GUID_DEVINTERFACE_COMPORT, null, null, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); assertTrue("For this test we need a valid HANDLE!",hDevInfoSet != INVALID_HANDLE_VALUE); SP_DEVINFO_DATA devInfo = new SP_DEVINFO_DATA(); boolean succeed = setupApi.SetupDiEnumDeviceInfo(hDevInfoSet, 0, devInfo); assertTrue("For this test we need at least one com-port device",succeed); HKEY hDeviceKey = setupApi.SetupDiOpenDevRegKey(hDevInfoSet, devInfo, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_QUERY_VALUE); if (hDeviceKey != INVALID_HANDLE_VALUE) advapi32.RegCloseKey(hDeviceKey); }

Target:
public void testSetupDiOpenDevRegKey() { HANDLE hDevInfoSet = setupApi.SetupDiGetClassDevs(null, null, null, DIGCF_ALLCLASSES); assertTrue(hDevInfoSet != INVALID_HANDLE_VALUE); assertTrue(setupApi.SetupDiEnumDeviceInfo(hDevInfoSet, FIRST_MEMBER, devInfo)); HKEY hDeviceKey = setupApi.SetupDiOpenDevRegKey(hDevInfoSet, devInfo, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_QUERY_VALUE); assertTrue(hDeviceKey != INVALID_HANDLE_VALUE); advapi32.RegCloseKey(hDeviceKey); }
Source:
public List<DataRecord> getMultipleFullRecordsFromQuery(String catalogId, String field, String value, int rows) { loadOPACConfiguration(catalogId); HashMap<String, String> searchFields = new HashMap<>(); searchFields.put(field, value); if (searchFieldMapping.keySet().containsAll(searchFields.keySet())) { LinkedHashMap<String, String> queryParameters = new LinkedHashMap<>(parameters); LinkedHashMap<String, String> searchFieldMap = getSearchFieldMap(searchFields); try { URI queryURL = createQueryURI(queryParameters); String queryString = queryURL.toString() + "&"; if (Objects.nonNull(interfaceType)) { if (Objects.nonNull(interfaceType.getStartRecordString())) { queryString = queryString + interfaceType.getStartRecordString() + equalsOperand + "0&"; } if (Objects.nonNull(interfaceType.getMaxRecordsString())) { queryString = queryString + interfaceType.getMaxRecordsString() + equalsOperand + rows + "&"; } if (Objects.nonNull(interfaceType.getQueryString())) { queryString = queryString + equalsOperand; } } queryString = queryString + createSearchFieldString(searchFieldMap); return performQueryToMultipleRecords(queryString); } catch (URISyntaxException | IOException | ParserConfigurationException | SAXException | TransformerException e) { logger.error(e.getLocalizedMessage()); } } return Collections.emptyList(); }

Target:
public List<DataRecord> getMultipleFullRecordsFromQuery(String catalogId, String field, String value, int rows) { loadOPACConfiguration(catalogId); HashMap<String, String> searchFields = new HashMap<>(); searchFields.put(field, value); if (searchFieldMapping.keySet().containsAll(searchFields.keySet())) { LinkedHashMap<String, String> queryParameters = new LinkedHashMap<>(parameters); LinkedHashMap<String, String> searchFieldMap = getSearchFieldMap(searchFields); try { URI queryURL = createQueryURI(queryParameters); String queryString = queryURL.toString() + "&"; if (Objects.nonNull(interfaceType)) { if (Objects.nonNull(interfaceType.getStartRecordString())) { queryString = queryString + interfaceType.getStartRecordString() + equalsOperand + "0&"; } if (Objects.nonNull(interfaceType.getMaxRecordsString())) { queryString = queryString + interfaceType.getMaxRecordsString() + equalsOperand + rows + "&"; } if (Objects.nonNull(interfaceType.getQueryString())) { queryString = queryString + interfaceType.getQueryString() + equalsOperand; } } queryString = queryString + createSearchFieldString(searchFieldMap); return performQueryToMultipleRecords(queryString); } catch (URISyntaxException | IOException | ParserConfigurationException | SAXException | TransformerException e) { logger.error(e.getLocalizedMessage()); } } return Collections.emptyList(); }
Source:
public int getSSLPort() { return 0; }

Target:
public int getSSLPort() { throw new IllegalStateException("No SSL port exists for localhost"); }
Source:
public List<Item> next() { List<Episode> episodes = episodesIterator.next(); ImmutableList.Builder<Item> items = ImmutableList.builder(); currentEpisodesIterator = episodes.iterator(); ImmutableListMultimap<String, Availability> availabilities = getAvailabilities(episodes); ImmutableListMultimap<String, Broadcast> broadcasts = getBroadcasts(episodes); ImmutableListMultimap<String, Version> versions = getVersions(episodes); while (currentEpisodesIterator.hasNext()) { Episode glycerinEpisode = currentEpisodesIterator.next(); NitroItemSource<Episode> nitroItemSource = NitroItemSource.valueOf( glycerinEpisode, availabilities.get(glycerinEpisode.getPid()), broadcasts.get(glycerinEpisode.getPid()), versions.get(glycerinEpisode.getPid()) ); Item item = itemExtractor.extract(nitroItemSource); List<Clip> clips = getClips(nitroItemSource); item.setClips(clips); items.add(item); } return items.build(); }

Target:
public List<Item> next() { List<Episode> episodes = episodesIterator.next(); ImmutableList.Builder<Item> items = ImmutableList.builder(); ImmutableListMultimap<String, Availability> availabilities = getAvailabilities(episodes); ImmutableListMultimap<String, Broadcast> broadcasts = getBroadcasts(episodes); ImmutableListMultimap<String, Version> versions = getVersions(episodes); for (Episode glycerinEpisode : episodes) { NitroItemSource<Episode> nitroItemSource = NitroItemSource.valueOf( glycerinEpisode, availabilities.get(glycerinEpisode.getPid()), broadcasts.get(glycerinEpisode.getPid()), versions.get(glycerinEpisode.getPid()) ); Item item = itemExtractor.extract(nitroItemSource); List<Clip> clips = getClips(nitroItemSource); item.setClips(clips); items.add(item); } return items.build(); }
Source:
private void sleepForEnqueue(long maxSleepMillis) { synchronized (localTaskNoticeHelper) { try { localTaskNoticeHelper.wait(maxSleepMillis); } catch (InterruptedException ex) { return; } } }

Target:
private void sleepForEnqueue(long maxSleepMillis) { synchronized (localTaskNoticeHelper) { try { localTaskNoticeHelper.wait(maxSleepMillis); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); return; } } }
Source:
public static void createBuckets() throws IOException { rawStorage.createBucket(BUCKET_NAME); }

Target:
public static void createBuckets() throws IOException { GoogleCloudStorage rawStorage = createGoogleCloudStorage(); rawStorage.createBucket(BUCKET_NAME); }
Source:
public String getEvaluatorView(String task) { try { Connection conn = getConnection(); String sql = "SELECT evaluatorTask FROM tasks WHERE name = ?;"; PreparedStatement stmt = conn.prepareStatement(sql); ResultSet evaluatorTaskRS = stmt.executeQuery(); evaluatorTaskRS.first(); String evaluatorTask = evaluatorTaskRS.getString(1); conn.close(); return evaluatorTask; } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public String getEvaluatorView(String task) { try { Connection conn = getConnection(); String sql = "SELECT evaluatorView FROM tasks WHERE name = ?;"; PreparedStatement stmt = conn.prepareStatement(sql); ResultSet evaluatorViewRS = stmt.executeQuery(); evaluatorViewRS.first(); String evaluatorView = evaluatorViewRS.getString(1); conn.close(); return evaluatorView; } catch (Exception e) { throw new RuntimeException(e); } }
Source:
private void importCertificate() { importProviderCertificate(); sourceListModel.setConfirmWindow(null); }

Target:
private void importCertificate() { Frontend.getInstance().runAction(VdcActionType.ImportProviderCertificate, importCertificatesParams(), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { testProviderConnectivity(); } }, null, false); sourceListModel.setConfirmWindow(null); }
Source:
StreamsProducer streamsProducerForTask(final TaskId taskId) { if (threadProducer != null) { throw new IllegalStateException("Producer per thread is used"); } return taskProducers.get(taskId); }

Target:
StreamsProducer streamsProducerForTask(final TaskId taskId) { if (threadProducer != null) { throw new IllegalStateException("Producer per thread is used"); } final StreamsProducer taskProducer = taskProducers.get(taskId); if (taskProducer == null) { throw new IllegalStateException("Unknown TaskId: " + taskId); } return taskProducer; }