auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setTicketUsingUpdateDevice() { Map<String, Object> devStruct = new HashMap<>(); devStruct.put("deviceType", "graphics"); devStruct.put("graphicsType", getParameters().getGraphicsType().name().toLowerCase()); devStruct.put("password", getParameters().getTicket()); devStruct.put("ttl", getParameters().getValidTime()); if(getParameters().getClusterCompatibilityVersion().less(new Version(4, 0))) { devStruct.put("existingConnAction", connectionAction); } devStruct.put("disconnectAction", getParameters().getDisconnectAction()); devStruct.put("params", getUidParams()); status = getBroker().vmUpdateDevice(getParameters().getVmId().toString(), devStruct); }

Target:
private void setTicketUsingUpdateDevice() { Map<String, Object> devStruct = new HashMap<>(); devStruct.put("deviceType", "graphics"); devStruct.put("graphicsType", getParameters().getGraphicsType().name().toLowerCase()); devStruct.put("password", getParameters().getTicket()); devStruct.put("ttl", getParameters().getValidTime()); if (getParameters().getCompatibilityVersion().less(Version.v4_0)) { devStruct.put("existingConnAction", connectionAction); } devStruct.put("disconnectAction", getParameters().getDisconnectAction()); devStruct.put("params", getUidParams()); status = getBroker().vmUpdateDevice(getParameters().getVmId().toString(), devStruct); }
Source:
public static UsbPolicy getUsbPolicyOnUpdate(Usb usb, UsbPolicy currentPolicy) { if (usb == null) { return currentPolicy; } if (!usb.isSetEnabled()) { if (usb.isSetType()) { if (currentPolicy == UsbPolicy.DISABLED) { return currentPolicy; } else { UsbType usbType = UsbType.fromValue(usb.getType()); return mapUsbTypeToPolicy(usbType); } } else { return currentPolicy; } } else { if (!usb.isEnabled()) return UsbPolicy.DISABLED; else { if (usb.isSetType()) { UsbType usbType = UsbType.fromValue(usb.getType()); return mapUsbTypeToPolicy(usbType); } else { return currentPolicy == UsbPolicy.DISABLED ? null : currentPolicy; } } } }

Target:
public static UsbPolicy getUsbPolicyOnUpdate(Usb usb, UsbPolicy currentPolicy) { if (usb == null) { return currentPolicy; } if (!usb.isSetEnabled()) { if (usb.isSetType()) { if (currentPolicy == UsbPolicy.DISABLED) { return currentPolicy; } else { return mapUsbTypeToPolicy(UsbType.fromValue(usb.getType())); } } else { return currentPolicy; } } else { if (!usb.isEnabled()) return UsbPolicy.DISABLED; else { if (usb.isSetType()) { return mapUsbTypeToPolicy(UsbType.fromValue(usb.getType())); } else { return currentPolicy == UsbPolicy.DISABLED ? null : currentPolicy; } } } }
Source:
public void prepareRun(BatchSinkContext context) { LOG.debug("tableName = {}; pluginType = {}; pluginName = {}; connectionString = {}; columns = {}; " + "transaction isolation level: {}", dbSinkConfig.tableName, dbSinkConfig.jdbcPluginType, dbSinkConfig.jdbcPluginName, dbSinkConfig.connectionString, dbSinkConfig.columns, dbSinkConfig.transactionIsolationLevel); Class<? extends Driver> driverClass = context.loadPluginClass(getJDBCPluginId()); try { Preconditions.checkArgument( dbManager.tableExists(driverClass, dbSinkConfig.tableName), "Table %s does not exist. Please check that the 'tableName' property " + "has been set correctly, and that the connection string %s points to a valid database.", dbSinkConfig.tableName, dbSinkConfig.connectionString); } finally { DBUtils.cleanup(driverClass); } context.addOutput(Output.of(dbSinkConfig.referenceName, new DBOutputFormatProvider(dbSinkConfig, driverClass))); recordLineage(context, dbSinkConfig.referenceName, Schema.of(Schema.Type.STRING), Arrays.asList(dbSinkConfig.columns.split(","))); }

Target:
public void prepareRun(BatchSinkContext context) { LOG.debug("tableName = {}; pluginType = {}; pluginName = {}; connectionString = {}; columns = {}; " + "transaction isolation level: {}", dbSinkConfig.tableName, dbSinkConfig.jdbcPluginType, dbSinkConfig.jdbcPluginName, dbSinkConfig.connectionString, dbSinkConfig.columns, dbSinkConfig.transactionIsolationLevel); Class<? extends Driver> driverClass = context.loadPluginClass(getJDBCPluginId()); try { Preconditions.checkArgument( dbManager.tableExists(driverClass, dbSinkConfig.tableName), "Table %s does not exist. Please check that the 'tableName' property " + "has been set correctly, and that the connection string %s points to a valid database.", dbSinkConfig.tableName, dbSinkConfig.connectionString); } finally { DBUtils.cleanup(driverClass); } context.addOutput(Output.of(dbSinkConfig.referenceName, new DBOutputFormatProvider(dbSinkConfig, driverClass))); Schema schema = context.getInputSchema(); if (schema != null && schema.getFields() != null) { recordLineage(context, dbSinkConfig.referenceName, schema, schema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList())); } }
Source:
public void init() throws Exception { if (objectName == null) { objectName = getObjectName(); } if (mBeanServer == null) { mBeanServer = ManagementFactory.getPlatformMBeanServer(); } if (mBeanServer != null) { try { mBeanServer.registerMBean(this, objectName); } catch (InstanceAlreadyExistsException iaee) { mBeanServer.unregisterMBean(objectName); mBeanServer.registerMBean(this, objectName); } Object handback = null; listener = getNotificationListener(); filter = getNotificationFilter(); mBeanServer.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, listener, filter, handback); } if (logged.compareAndSet(false, true)) { String text = getVersion(); if (Strings.isNotBlank(text)) { text += " "; } LOG.info("Welcome to hawtio " + text); } }

Target:
public void init() throws Exception { if (objectName == null) { objectName = getObjectName(); } if (mBeanServer == null) { mBeanServer = ManagementFactory.getPlatformMBeanServer(); } if (mBeanServer != null) { try { mBeanServer.registerMBean(this, objectName); } catch (InstanceAlreadyExistsException iaee) { mBeanServer.unregisterMBean(objectName); mBeanServer.registerMBean(this, objectName); } Object handback = null; listener = getNotificationListener(); filter = getNotificationFilter(); mBeanServer.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, listener, filter, handback); } if (logged.compareAndSet(false, true)) { LOG.info("Welcome to hawtio {}", getVersion()); } }
Source:
private void configureStreamGraph(final StreamGraph graph) { checkNotNull(graph); graph.setChaining(chaining); graph.setUserArtifacts(userArtifacts); graph.setTimeCharacteristic(timeCharacteristic); graph.setJobName(jobName); if (shouldExecuteInBatchMode) { if (checkpointConfig.isCheckpointingEnabled()) { LOG.info("Disabled Checkpointing. Checkpointing is not supported when executing jobs in BATCH mode."); checkpointConfig.disableCheckpointing(); } graph.setAllVerticesInSameSlotSharingGroupByDefault(false); graph.setGlobalDataExchangeMode(GlobalDataExchangeMode.POINTWISE_EDGES_PIPELINED); graph.setScheduleMode(ScheduleMode.LAZY_FROM_SOURCES_WITH_BATCH_SLOT_REQUEST); setDefaultBufferTimeout(-1); setBatchStateBackendAndTimerService(graph); } else { graph.setStateBackend(stateBackend); graph.setAllVerticesInSameSlotSharingGroupByDefault(true); graph.setGlobalDataExchangeMode(GlobalDataExchangeMode.ALL_EDGES_PIPELINED); graph.setScheduleMode(ScheduleMode.EAGER); } }

Target:
private void configureStreamGraph(final StreamGraph graph) { checkNotNull(graph); graph.setChaining(chaining); graph.setUserArtifacts(userArtifacts); graph.setTimeCharacteristic(timeCharacteristic); graph.setJobName(jobName); if (shouldExecuteInBatchMode) { if (checkpointConfig.isCheckpointingEnabled()) { LOG.info("Disabled Checkpointing. Checkpointing is not supported and not needed when executing jobs in BATCH mode."); checkpointConfig.disableCheckpointing(); } graph.setAllVerticesInSameSlotSharingGroupByDefault(false); graph.setGlobalDataExchangeMode(GlobalDataExchangeMode.POINTWISE_EDGES_PIPELINED); graph.setScheduleMode(ScheduleMode.LAZY_FROM_SOURCES_WITH_BATCH_SLOT_REQUEST); setDefaultBufferTimeout(-1); setBatchStateBackendAndTimerService(graph); } else { graph.setStateBackend(stateBackend); graph.setAllVerticesInSameSlotSharingGroupByDefault(true); graph.setGlobalDataExchangeMode(GlobalDataExchangeMode.ALL_EDGES_PIPELINED); graph.setScheduleMode(ScheduleMode.EAGER); } }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_site_list, container, false); initializeViews(view); getSitesRequest(); Log.i("ONCREATE", "ONCREATAE"); return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_site_list, container, false); initializeViews(view); getSitesRequest(); return view; }
Source:
public JSONObject getPackageConfigure(String packageName) { try { return mJSONObject.getJSONObject("Packages") .getJSONObject(packageName); } catch (JSONException | NullPointerException configurationFileError) { throw new RuntimeException( "Failed to get configuration for package = " + packageName + " from " + TEST_CONFIGURATION_FILENAME + ".", configurationFileError ); } }

Target:
public JSONObject getPackageConfigure(String packageName) { try { return mJSONObject.getJSONObject("packages") .getJSONObject(packageName); } catch (JSONException | NullPointerException configurationFileError) { throw new RuntimeException( "Failed to get configuration for package = " + packageName + " from " + TEST_CONFIGURATION_FILENAME + ".", configurationFileError ); } }
Source:
private boolean canCopyAllToClipboard() { for (IResource fResource : fResources) { if (!canCopyToClipboard(fResource)) { return false; } } for (IJavaElement fJavaElement : fJavaElements) { if (!canCopyToClipboard(fJavaElement)) { return false; } } for (IJarEntryResource fJarEntryResource : fJarEntryResources) { if (fJarEntryResource == null) { return false; } } return true; }

Target:
private boolean canCopyAllToClipboard() { for (IResource resource : fResources) { if (!canCopyToClipboard(resource)) { return false; } } for (IJavaElement javaElement : fJavaElements) { if (!canCopyToClipboard(javaElement)) { return false; } } for (IJarEntryResource jarEntryResource : fJarEntryResources) { if (jarEntryResource == null) { return false; } } return true; }
Source:
void executeSearch() { Collection<Persona> results = Collections.EMPTY_LIST; try { results = Persona.getPersonaByName(searchField.getText()); } catch (CentralRepoException ex) { Exceptions.printStackTrace(ex); } updateResultsTable(results); }

Target:
private void executeSearch() { Collection<Persona> results = Collections.EMPTY_LIST; try { results = Persona.getPersonaByName(searchField.getText()); } catch (CentralRepoException ex) { Exceptions.printStackTrace(ex); } updateResultsTable(results); }
Source:
protected ViewModel doGet(HttpServletRequest request, HttpServletResponse response) throws Exception { if (isJsonPreferred(request, response)) { response.setStatus(405); return new DefaultViewModel("stormpathJsonView", Collections.EMPTY_MAP); } return super.doGet(request, response); }

Target:
protected ViewModel doGet(HttpServletRequest request, HttpServletResponse response) throws Exception { if (isJsonPreferred(request, response)) { response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED); return new DefaultViewModel("stormpathJsonView", Collections.EMPTY_MAP); } return super.doGet(request, response); }
Source:
public void handleSessionEstablishmentError(Throwable error) throws Exception { LOG.info("=================================================handleSessionEstablishmentError received for processor=" + processorId, error); stop(); }

Target:
public void handleSessionEstablishmentError(Throwable error) throws Exception { LOG.info("handleSessionEstablishmentError received for processor=" + processorId, error); stop(); }
Source:
public static String abbreviate(final String str, final String abbrevMarker, int offset, final int maxWidth) { if (isEmpty(str) && isEmpty(abbrevMarker)) { return str; } else if (isNotEmpty(str) && "".equals(abbrevMarker) && maxWidth>0) { return str.substring(0, maxWidth); } else if (isEmpty(str) || isEmpty(abbrevMarker)) { return str; } final int abbrevMarkerLength = abbrevMarker.length(); final int minAbbrevWidth = abbrevMarkerLength + 1; final int minAbbrevWidthOffset = abbrevMarkerLength + abbrevMarkerLength + 1; if (maxWidth < minAbbrevWidth) { throw new IllegalArgumentException(String.format("Minimum abbreviation width is %d", minAbbrevWidth)); } if (str.length() <= maxWidth) { return str; } if (offset > str.length()) { offset = str.length(); } if (str.length() - offset < maxWidth - abbrevMarkerLength) { offset = str.length() - (maxWidth - abbrevMarkerLength); } if (offset <= abbrevMarkerLength+1) { return str.substring(0, maxWidth - abbrevMarkerLength) + abbrevMarker; } if (maxWidth < minAbbrevWidthOffset) { throw new IllegalArgumentException(String.format("Minimum abbreviation width with offset is %d", minAbbrevWidthOffset)); } if (offset + maxWidth - abbrevMarkerLength < str.length()) { return abbrevMarker + abbreviate(str.substring(offset), abbrevMarker, maxWidth - abbrevMarkerLength); } return abbrevMarker + str.substring(str.length() - (maxWidth - abbrevMarkerLength)); }

Target:
public static String abbreviate(final String str, final String abbrevMarker, int offset, final int maxWidth) { if (isEmpty(str) && isEmpty(abbrevMarker)) { return str; } else if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 0) { return str.substring(0, maxWidth); } else if (isEmpty(str) || isEmpty(abbrevMarker)) { return str; } final int abbrevMarkerLength = abbrevMarker.length(); final int minAbbrevWidth = abbrevMarkerLength + 1; final int minAbbrevWidthOffset = abbrevMarkerLength + abbrevMarkerLength + 1; if (maxWidth < minAbbrevWidth) { throw new IllegalArgumentException(String.format("Minimum abbreviation width is %d", minAbbrevWidth)); } if (str.length() <= maxWidth) { return str; } if (offset > str.length()) { offset = str.length(); } if (str.length() - offset < maxWidth - abbrevMarkerLength) { offset = str.length() - (maxWidth - abbrevMarkerLength); } if (offset <= abbrevMarkerLength+1) { return str.substring(0, maxWidth - abbrevMarkerLength) + abbrevMarker; } if (maxWidth < minAbbrevWidthOffset) { throw new IllegalArgumentException(String.format("Minimum abbreviation width with offset is %d", minAbbrevWidthOffset)); } if (offset + maxWidth - abbrevMarkerLength < str.length()) { return abbrevMarker + abbreviate(str.substring(offset), abbrevMarker, maxWidth - abbrevMarkerLength); } return abbrevMarker + str.substring(str.length() - (maxWidth - abbrevMarkerLength)); }
Source:
private void createPresenterView() { RenderedTemplate renderedTemplate = null; if (presenterConfigModel.getNestedPresenter()) { renderedTemplate = createdNestedPresenterTemplates.getView(); } else if (presenterConfigModel.getPresenterWidget()) { renderedTemplate = createdPresenterWidgetTemplates.getView(); } else if (presenterConfigModel.getPopupPresenter()) { renderedTemplate = createdPopupPresenterTemplates.getView(); } PsiClass createdPsiClass = createPsiClass(createdPresenterPackage, renderedTemplate); createdPsiClass.navigate(true); }

Target:
private void createPresenterView() { RenderedTemplate renderedTemplate = null; if (presenterConfigModel.getNestedPresenter()) { renderedTemplate = createdNestedPresenterTemplates.getView(); } else if (presenterConfigModel.getPresenterWidget()) { renderedTemplate = createdPresenterWidgetTemplates.getView(); } else if (presenterConfigModel.getPopupPresenter()) { renderedTemplate = createdPopupPresenterTemplates.getView(); } PsiClass createdPsiClass = createPsiClass(createdPresenterPackage, renderedTemplate); navigateToClass(createdPsiClass); }
Source:
private void startDownloading(Uri downloadUri, String downloadName) { File file = new File(Environment.getExternalStorageDirectory()+"/"+Environment.DIRECTORY_DOWNLOADS+"/"+downloadName); if(file.exists()); file.delete(); DownloadManager.Request downloadRequest = new DownloadManager.Request(downloadUri) .setDestinationInExternalFilesDir(context, Environment.DIRECTORY_DOWNLOADS, downloadName) .setVisibleInDownloadsUi(false) .setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN); this.downloadId = getDownloadManager(context).enqueue(downloadRequest); }

Target:
private void startDownloading(Uri downloadUri, String downloadName) { File file = new File(context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)+"/"+downloadName); if(file.exists()) file.delete(); DownloadManager.Request downloadRequest = new DownloadManager.Request(downloadUri) .setDestinationInExternalFilesDir(context, Environment.DIRECTORY_DOWNLOADS, downloadName) .setVisibleInDownloadsUi(false) .setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN); this.downloadId = getDownloadManager(context).enqueue(downloadRequest); }
Source:
public void testIterationStateReaperOnClosedConnections() throws InterruptedException { IterationManager iterationManager = server().getIterationManager(); for (int i = 0; i < 10; i++) { hotRodClient.iteratorStart(null, null, null, 10, false); } hotRodClient.stop().await(); assertEquals(0, iterationManager.activeIterations()); }

Target:
public void testIterationStateReaperOnClosedConnections() throws InterruptedException { IterationManager iterationManager = server().getIterationManager(); for (int i = 0; i < 10; i++) { hotRodClient.iteratorStart(null, null, null, 10, false); } assertEquals(10, iterationManager.activeIterations()); hotRodClient.stop().await(); assertEquals(0, iterationManager.activeIterations()); }
Source:
default Map<Long, LearnedAndAcceptedValue> getConsolidatedLocalAndRemoteRecord( NamespaceAndUseCase namespaceAndUseCase) { if (!history().containsKey(namespaceAndUseCase)) { return ImmutableMap.of(); } LearnerAndAcceptorRecords records = history().get(namespaceAndUseCase); long minSeq = records.getMinSequence(); long maxSeq = records.getMaxSequence(); return LongStream.rangeClosed(minSeq, maxSeq).boxed().collect( Collectors.toMap(Function.identity(), seq -> getLearnedAndAcceptedValues(records, seq))); }

Target:
default ConsolidatedLearnerAndAcceptorRecord getConsolidatedLocalAndRemoteRecord( NamespaceAndUseCase namespaceAndUseCase) { if (!history().containsKey(namespaceAndUseCase)) { return ImmutableConsolidatedLearnerAndAcceptorRecord.of(ImmutableMap.of()); } LearnerAndAcceptorRecords records = history().get(namespaceAndUseCase); long minSeq = records.getMinSequence(); long maxSeq = records.getMaxSequence(); return ImmutableConsolidatedLearnerAndAcceptorRecord.of( consolidateRecordsForSequenceRange(records, minSeq, maxSeq)); }
Source:
public Iterator<String> getResponseHeaders(String name) throws IOException { Map<String, List<String>> mapHeader = connection.getHeaderFields(); List<String> listHeaderValues = mapHeader.get(name); if(null == listHeaderValues) { return Collections.<String>emptyList().iterator(); } else { return listHeaderValues.iterator(); } }

Target:
public Iterator<String> getResponseHeaders(String name) throws IOException { Map<String, List<String>> mapHeader = connection.getHeaderFields(); List<String> listHeaderValues = mapHeader.get(name); if (listHeaderValues == null) { return Collections.<String>emptyList().iterator(); } else { return listHeaderValues.iterator(); } }
Source:
public void deliver(WebContext ctx, String objectId, String fileExtension) { try { engine.deliver(ctx, name, objectId, fileExtension, status -> handleHttpError(ctx, objectId, fileExtension, null, status)); } catch (IOException e) { throw Exceptions.handle() .error(e) .to(StorageUtils.LOG) .withSystemErrorMessage( "Storage Layer 1: An error occurred when delivering %s (%s) for %s: %s (%s)", objectId, name, ctx.getRequestedURI()) .handle(); } }

Target:
public void deliver(WebContext ctx, String objectId, String fileExtension) { try { engine.deliver(ctx, name, objectId, fileExtension, status -> handleHttpError(ctx, objectId, fileExtension, null, status)); } catch (IOException e) { throw Exceptions.handle() .error(e) .to(StorageUtils.LOG) .withSystemErrorMessage("Layer 1: An error occurred when delivering %s (%s) for %s: %s (%s)", objectId, name, ctx.getRequestedURI()) .handle(); } }
Source:
public HttpResponse doDoUninstall() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); archive.delete(); Jenkins.getActiveInstance().getPluginManager().resolveDependantPlugins(); return HttpResponses.redirectViaContextPath("/pluginManager/installed"); }

Target:
public HttpResponse doDoUninstall() throws IOException { Jenkins jenkins = Jenkins.getActiveInstance(); jenkins.checkPermission(Jenkins.ADMINISTER); archive.delete(); jenkins.getPluginManager().resolveDependantPlugins(); return HttpResponses.redirectViaContextPath("/pluginManager/installed"); }
Source:
public void testReportForDutyWithEnvironmentEdge() throws Exception { cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtility.randomFreePort()); cluster.getConfiguration().setInt("hbase.procedure.remote.dispatcher.delay.msec", 0); cluster.getConfiguration().setInt("hbase.regionserver.rpc.retry.interval", 0); boolean tablesOnMaster = LoadBalancer.isTablesOnMaster(testUtil.getConfiguration()); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, tablesOnMaster ? 2 : 1); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, tablesOnMaster ? 2 : 1); EnvironmentEdge previousEdge = EnvironmentEdgeManager.getDelegate(); ManualEnvironmentEdge edge = new ManualEnvironmentEdge(); EnvironmentEdgeManager.injectEdge(edge); master = cluster.addMaster(); rs = cluster.addRegionServer(); LOG.debug("Starting master: " + master.getMaster().getServerName()); master.start(); rs.start(); waitForClusterOnline(master); EnvironmentEdgeManager.injectEdge(previousEdge); }

Target:
public void testReportForDutyWithEnvironmentEdge() throws Exception { cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtility.randomFreePort()); cluster.getConfiguration().setInt("hbase.procedure.remote.dispatcher.delay.msec", 0); cluster.getConfiguration().setInt("hbase.regionserver.rpc.retry.interval", 0); boolean tablesOnMaster = LoadBalancer.isTablesOnMaster(testUtil.getConfiguration()); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, tablesOnMaster ? 2 : 1); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, tablesOnMaster ? 2 : 1); ManualEnvironmentEdge edge = new ManualEnvironmentEdge(); EnvironmentEdgeManager.injectEdge(edge); master = cluster.addMaster(); rs = cluster.addRegionServer(); LOG.debug("Starting master: " + master.getMaster().getServerName()); master.start(); rs.start(); waitForClusterOnline(master); }
Source:
public Boolean call() throws InterruptedException{ CallContext callContext = bulkExecCallerImpl.getCallContexts().poll(); if(callContext!=null) bulkExecCallerImpl.processOutput(callContext); if(getPhase() == WorkPhase.COMPLETED && bulkExecCallerImpl.getCallContexts().isEmpty()) { getCallerThreadPoolExecutor().shutdown(); } else if(callContext != null) { bulkExecCallerImpl.getCallContexts().put(callContext); submitTask(this); } return true; }

Target:
public Boolean call() throws InterruptedException{ CallContext callContext = bulkExecCallerImpl.getCallContextQueue().poll(); continueCalling = (callContext == null)? false:bulkExecCallerImpl.processOutput(callContext); if(continueCalling) { bulkExecCallerImpl.getCallContextQueue().put(callContext); submitTask(this); } else if(getPhase() == WorkPhase.COMPLETED && bulkExecCallerImpl.getCallContextQueue().isEmpty()) { getCallerThreadPoolExecutor().shutdown(); } return true; }
Source:
public SpecificSegmentsQuerySegmentWalker add( final DataSegment descriptor, final QueryableIndex index ) { final Segment segment = new QueryableIndexSegment(index, descriptor.getId()); timelines.putIfAbsent(descriptor.getDataSource(), new VersionedIntervalTimeline<>(Ordering.natural())); final VersionedIntervalTimeline<String, Segment> timeline = timelines.get(descriptor.getDataSource()); timeline.add(descriptor.getInterval(), descriptor.getVersion(), descriptor.getShardSpec().createChunk(segment)); segments.add(descriptor); closeables.add(index); return this; }

Target:
public SpecificSegmentsQuerySegmentWalker add( final DataSegment descriptor, final QueryableIndex index ) { final Segment segment = new QueryableIndexSegment(index, descriptor.getId()); timelines.computeIfAbsent(descriptor.getDataSource(), datasource -> new VersionedIntervalTimeline<>(Ordering.natural())); final VersionedIntervalTimeline<String, Segment> timeline = timelines.get(descriptor.getDataSource()); timeline.add(descriptor.getInterval(), descriptor.getVersion(), descriptor.getShardSpec().createChunk(segment)); segments.add(descriptor); closeables.add(index); return this; }
Source:
protected void doNonBlockingAction(final VdcActionType task, final VdcActionParametersBase params) { setCorrelationId(params); setJobOrStepId(params); VdcActionParametersBase sp = sessionize(params); DbUser currentUser = getCurrent().getUser(); VdcActionParametersBase logout = currentUser != null ? sessionize(new VdcActionParametersBase()) : null; try { backend.runAction(VdcActionType.RunAsyncAction, sessionize(new RunAsyncActionParameters(task, sp))); } finally { if (currentUser != null) { backend.logoff(logout); } } }

Target:
protected void doNonBlockingAction(final VdcActionType task, final VdcActionParametersBase params) { setCorrelationId(params); setJobOrStepId(params); backend.runAction(VdcActionType.RunAsyncAction, sessionize(new RunAsyncActionParameters(task, sessionize(params)))); }
Source:
public void serve() throws TException { Subscription sub = conn.subscribe(subject, queue, newRequestHandler()); LOGGER.info("Frugal server running..."); try { shutdown.take(); } catch (InterruptedException ignored) { } LOGGER.info("Frugal server stopping..."); try { sub.unsubscribe(); } catch (IOException ignored) { } }

Target:
public synchronized void serve() throws TException { Subscription sub = conn.subscribe(subject, queue, newRequestHandler()); LOGGER.info("Frugal server running..."); try { shutdown.take(); } catch (InterruptedException ignored) { } LOGGER.info("Frugal server stopping..."); try { sub.unsubscribe(); } catch (IOException e) { LOGGER.warning("Frugal server failed to unsubscribe: " + e.getMessage()); } }
Source:
public Collection<Locator> getLocators(long shard) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_LOCATOR.getName()); try { RowQuery<Long, Locator> query = AstyanaxIO.getKeyspace() .prepareQuery(CassandraModel.CF_METRICS_LOCATOR) .getKey(shard); return query.execute().getResult().getColumnNames(); } catch (NotFoundException e) { Instrumentation.markNotFound(CassandraModel.CF_METRICS_LOCATOR_NAME); return Collections.emptySet(); } catch (ConnectionException ex) { Instrumentation.markReadError(ex); LOG.error("Connection exception during getLocators(" + Long.toString(shard) + " )", ex); throw new IOException("Error reading locators", ex); } finally { ctx.stop(); } }

Target:
public Collection<Locator> getLocators(long shard) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME); try { RowQuery<Long, Locator> query = AstyanaxIO.getKeyspace() .prepareQuery(CassandraModel.CF_METRICS_LOCATOR) .getKey(shard); return query.execute().getResult().getColumnNames(); } catch (NotFoundException e) { Instrumentation.markNotFound(CassandraModel.CF_METRICS_LOCATOR_NAME); return Collections.emptySet(); } catch (ConnectionException ex) { Instrumentation.markReadError(ex); LOG.error("Connection exception during getLocators(" + Long.toString(shard) + " )", ex); throw new IOException("Error reading locators", ex); } finally { ctx.stop(); } }
Source:
private void handleExceptions() { if(!globalExceptions.isEmpty()){ ArrayList<MutationException> mutationExceptions = null; synchronized (globalExceptions) { mutationExceptions = new ArrayList<>(globalExceptions); globalExceptions.clear(); } List<Throwable> problems = new ArrayList<>(mutationExceptions.size()); ArrayList<String> hostnames = new ArrayList<>(mutationExceptions.size()); List<Row> failedMutations = new ArrayList<>(mutationExceptions.size()); for (MutationException mutationException : mutationExceptions) { problems.add(mutationException.throwable); failedMutations.add(mutationException.mutation); hostnames.add(null); } try { RetriesExhaustedWithDetailsException exception = new RetriesExhaustedWithDetailsException( problems, failedMutations, hostnames); exceptionListener.onException(exception, this); } catch (RetriesExhaustedWithDetailsException e) { for (Throwable throwable : e.getCauses()) { throwable.printStackTrace(); } LOG.error("ExceptionListener threw exception", e); } } }

Target:
private void handleExceptions() throws RetriesExhaustedWithDetailsException { if (!hasExceptions.get()) { ArrayList<MutationException> mutationExceptions = null; synchronized (globalExceptions) { mutationExceptions = new ArrayList<>(globalExceptions); globalExceptions.clear(); } if (mutationExceptions.isEmpty()) { return; } List<Throwable> problems = new ArrayList<>(mutationExceptions.size()); ArrayList<String> hostnames = new ArrayList<>(mutationExceptions.size()); List<Row> failedMutations = new ArrayList<>(mutationExceptions.size()); for (MutationException mutationException : mutationExceptions) { problems.add(mutationException.throwable); failedMutations.add(mutationException.mutation); hostnames.add(host.toString()); } RetriesExhaustedWithDetailsException exception = new RetriesExhaustedWithDetailsException( problems, failedMutations, hostnames); exceptionListener.onException(exception, this); } }
Source:
protected void executeCommand() { Guid vmId = getParameters().getVmId(); List<VmNumaNode> vmNumaNodes = getParameters().getVmNumaNodeList(); Guid vdsId = getDedicatedHost(); List<VdsNumaNode> vdsNumaNodes = new ArrayList<>(); if (vdsId != null) { vdsNumaNodes = getVdsNumaNodeDao().getAllVdsNumaNodeByVdsId(vdsId); } List<VdsNumaNode> nodes = new ArrayList<>(); for (VmNumaNode vmNumaNode : vmNumaNodes) { vmNumaNode.setId(Guid.newGuid()); for (Pair<Guid, Pair<Boolean, Integer>> pair : vmNumaNode.getVdsNumaNodeList()) { int index = pair.getSecond().getSecond(); if (pair.getSecond().getFirst()) { for (VdsNumaNode vdsNumaNode : vdsNumaNodes) { if (vdsNumaNode.getIndex() == index) { pair.setFirst(vdsNumaNode.getId()); break; } } } } nodes.add(vmNumaNode); } getVmNumaNodeDao().massSaveNumaNode(nodes, null, vmId); setActionReturnValue(nodes.get(0).getId()); setSucceeded(true); }

Target:
protected void executeCommand() { Guid vmId = getParameters().getVmId(); List<VmNumaNode> vmNumaNodes = getParameters().getVmNumaNodeList(); Guid vdsId = getDedicatedHost(); List<VdsNumaNode> vdsNumaNodes = new ArrayList<>(); if (vdsId != null) { vdsNumaNodes = getVdsNumaNodeDao().getAllVdsNumaNodeByVdsId(vdsId); } List<VdsNumaNode> nodes = new ArrayList<>(); for (VmNumaNode vmNumaNode : vmNumaNodes) { vmNumaNode.setId(Guid.newGuid()); for (Pair<Guid, Pair<Boolean, Integer>> pair : vmNumaNode.getVdsNumaNodeList()) { if (pair.getSecond() != null && pair.getSecond().getSecond() != null) { int index = pair.getSecond().getSecond(); if (pair.getSecond().getFirst()) { for (VdsNumaNode vdsNumaNode : vdsNumaNodes) { if (vdsNumaNode.getIndex() == index) { pair.setFirst(vdsNumaNode.getId()); break; } } } } } nodes.add(vmNumaNode); } getVmNumaNodeDao().massSaveNumaNode(nodes, null, vmId); setActionReturnValue(nodes.get(0).getId()); setSucceeded(true); }
Source:
public FormValidation doCheckWebSocket(@QueryParameter boolean webSocket, @QueryParameter String tunnel) { if (webSocket) { if (!WebSockets.isSupported()) { return FormValidation.error("WebSocket support is not enabled in this Jenkins installation"); } if (Util.fixEmptyAndTrim(tunnel) != null) { return FormValidation.error("Tunneling is not currently supported in WebSocket mode"); } } else { if (Jenkins.get().getTcpSlaveAgentListener() == null) { return FormValidation.error("Either WebSocket mode is selected, or the TCP port for inbound agents must be enabled"); } } return FormValidation.ok(); }

Target:
public FormValidation doCheckWebSocket(@QueryParameter boolean webSocket, @QueryParameter String tunnel) { if (webSocket) { if (!WebSockets.isSupported()) { return FormValidation.error("WebSocket support is not enabled in this Jenkins installation"); } if (Util.fixEmptyAndTrim(tunnel) != null) { return FormValidation.error("Tunneling is not supported in WebSocket mode"); } } else { if (Jenkins.get().getTcpSlaveAgentListener() == null) { return FormValidation.error("Either WebSocket mode is selected, or the TCP port for inbound agents must be enabled"); } } return FormValidation.ok(); }
Source:
public void tradePerformed(Order o, double matchPrice) throws StockMarketExpection { ordersPlaced.remove(o); if(o.getClass() == BuyOrder.class){ this.cashInHand = this.cashInHand - matchPrice*o.getSize(); this.position.add(o); } else{ this.cashInHand = this.cashInHand + matchPrice*o.getSize(); for(Order O: position){ if(O.getStockSymbol().equals(o.getStockSymbol())){ if(o.getSize() < O.getSize()){ O.setSize(O.getSize() - o.getSize()); } else{ this.position.remove(O); } break; } } } }

Target:
public void tradePerformed(Order o, double matchPrice) throws StockMarketExpection { ordersPlaced.remove(o); if(o.getClass() == BuyOrder.class){ this.cashInHand = this.cashInHand - matchPrice*o.getSize(); this.position.add(o); } else{ this.cashInHand = this.cashInHand + matchPrice*o.getSize(); for(Order traderPosition: position){ if(traderPosition.getStockSymbol().equals(o.getStockSymbol())){ if(o.getSize() < traderPosition.getSize()){ traderPosition.setSize(traderPosition.getSize() - o.getSize()); } else{ this.position.remove(traderPosition); } break; } } } }
Source:
public void initialize() { configurator .newConfiguration() .methodName(WS_AGENT_TRACK_CONNECTION_SUBSCRIBE) .noParams() .noResult() .withConsumer(endpointIds::add); configurator .newConfiguration() .methodName(WS_AGENT_TRACK_CONNECTION_UNSUBSCRIBE) .noParams() .noResult() .withConsumer(endpointIds::remove); }

Target:
public void initialize() { configurator .newConfiguration() .methodName(WS_AGENT_TRACK_CONNECTION_SUBSCRIBE) .noParams() .noResult() .withConsumer(endpointIds::add); configurator .newConfiguration() .methodName(WS_AGENT_TRACK_CONNECTION_UNSUBSCRIBE) .noParams() .noResult() .withConsumer(endpointIds::remove); keepingInTouchFuture = heartBeatScheduler.scheduleAtFixedRate( this::sendRequest, 0, WS_AGENT_TRACK_CONNECTION_PERIOD_MILLISECONDS, MILLISECONDS); }
Source:
private void refreshDetails() { if (details!=null && list!=null && !list.getTable().isDisposed()) { if (documents==null) { documents = new DocumentFetcher(); } IStructuredSelection sel = (IStructuredSelection) list.getSelection(); if (sel==null || sel.isEmpty()) { details.setText(""); } else { int numLines = computeLines(); if (numLines > 0) { LineItem item = (LineItem) sel.getFirstElement(); IDocument document = documents.getDocument(item.getFile()); if (document!=null) { try { int line = item.getLineNumber()-1; int start = document.getLineOffset(Math.max(line-(numLines-1)/2, 0)); int end = document.getLength(); try { IRegion lineInfo = document.getLineInformation(line+(numLines-1)/2 + 1); end = lineInfo.getOffset() + lineInfo.getLength(); } catch (BadLocationException e) { } StyledString styledString = highlightMatches(document.get(start, end-start)); details.setText(styledString.getString()); details.setStyleRanges(styledString.getStyleRanges()); return; } catch (BadLocationException e) { } } } } details.setText(""); } }

Target:
private void refreshDetails() { if (details!=null && list!=null && !list.getTable().isDisposed()) { if (documents==null) { documents = new DocumentFetcher(); } IStructuredSelection sel = (IStructuredSelection) list.getSelection(); if (sel==null || sel.isEmpty()) { details.setText(""); } else { int numLines = computeLines(); if (numLines > 0) { LineItem item = (LineItem) sel.getFirstElement(); IDocument document = documents.getDocument(item.getFile()); if (document!=null) { try { int line = item.getLineNumber()-1; int start = document.getLineOffset(Math.max(line-(numLines-1)/2, 0)); int end = document.getLength(); try { IRegion lineInfo = document.getLineInformation(line + numLines/2); end = lineInfo.getOffset() + lineInfo.getLength(); } catch (BadLocationException e) { } StyledString styledString = highlightMatches(document.get(start, end-start)); details.setText(styledString.getString()); details.setStyleRanges(styledString.getStyleRanges()); return; } catch (BadLocationException e) { } } } } details.setText(""); } }
Source:
public void setExpanded(boolean mIsExpanded) { this.mIsExpanded = mIsExpanded; if (mIsExpanded && mClickableView != null) { mClickableView.setRotation(ROTATED_POSITION); } else if (mClickableView != null) { mClickableView.setRotation(INITIAL_POSITION); } }

Target:
public void setExpanded(boolean mIsExpanded) { this.mIsExpanded = mIsExpanded; if (mIsExpanded && mClickableView != null && isHoneycomb()) { mClickableView.setRotation(ROTATED_POSITION); } else if (mClickableView != null && isHoneycomb()) { mClickableView.setRotation(INITIAL_POSITION); } }
Source:
private void throwError(HttpServletResponse resp, int statusCode, String message) throws IOException { String requestId; if (Config.isDevServer()) { requestId = "dummyrequestid"; } else { requestId = String.valueOf(ApiProxy.getCurrentEnvironment().getAttributes() .get("com.google.appengine.runtime.request_log_id")); } JsonResult result = new JsonResult(message, statusCode); result.setRequestId(requestId); result.send(resp); }

Target:
private void throwError(HttpServletResponse resp, int statusCode, String message) throws IOException { JsonResult result = new JsonResult(message, statusCode); result.setRequestId(Config.getRequestId()); result.send(resp); }
Source:
protected void handleSingleSelection(IStructuredSelection selection) { try { disposeDetail(); final Composite compositeToRenderOn = new Composite(detailPanel, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).applyTo(compositeToRenderOn); GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(compositeToRenderOn); final EObject object = (EObject) selection.getFirstElement(); final VView detailView = getView(); final ViewModelContext childContext = getViewModelContext().getChildContext(object, getVElement(), detailView); ecpView = ECPSWTViewRenderer.INSTANCE.render(compositeToRenderOn, childContext); border.layout(true, true); final Point point = detailPanel.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolledComposite.setMinHeight(point.y); } catch (final ECPRendererException ex) { Activator.log(ex); } }

Target:
protected void handleSingleSelection(IStructuredSelection selection) { disposeDetail(); final Composite compositeToRenderOn = new Composite(detailPanel, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).applyTo(compositeToRenderOn); GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(compositeToRenderOn); final EObject object = (EObject) selection.getFirstElement(); final VView detailView = getView(); if (detailView == null) { if (isDebug()) { final Label label = new Label(compositeToRenderOn, SWT.NONE); label.setBackground(compositeToRenderOn.getDisplay().getSystemColor(SWT.COLOR_RED)); label.setText("No Detail View found."); } } else { final ViewModelContext childContext = getViewModelContext().getChildContext(object, getVElement(), detailView); try { ecpView = ECPSWTViewRenderer.INSTANCE.render(compositeToRenderOn, childContext); } catch (final ECPRendererException ex) { Activator.log(ex); } } border.layout(true, true); final Point point = detailPanel.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolledComposite.setMinHeight(point.y); }
Source:
protected boolean isStalemate() { return (battleState.getMaxBattleRounds() > 0 && battleState.getMaxBattleRounds() <= battleState.getBattleRound()) || (getPower(BattleState.Side.OFFENSE) == 0 && getPower(BattleState.Side.DEFENSE) == 0); }

Target:
protected boolean isStalemate() { return battleState.getBattleRoundState().isLastRound() || (getPower(BattleState.Side.OFFENSE) == 0 && getPower(BattleState.Side.DEFENSE) == 0); }
Source:
protected Boolean doInBackground(Void... params) { boolean isError = false; for (Map.Entry<Uri, String> entry : files.entrySet()) { InputStream inputStream = null; FileOutputStream outputStream = null; String outPath = folder.path + entry.getValue(); try { if ((new File(outPath)).isFile()) { ignored++; continue; } inputStream = getContentResolver().openInputStream(entry.getKey()); outputStream = new FileOutputStream(outPath); byte[] buffer = new byte[4096]; int count; while ((count = inputStream.read(buffer)) > 0) { outputStream.write(buffer, 0, count); } copied++; } catch (FileNotFoundException e) { Log.e(TAG, String.format("Can't find input file \"%s\" to copy", entry.getKey()), e); isError = true; } catch (IOException e) { Log.e(TAG, String.format("IO exception during file \"%s\" sharing", entry.getKey()), e); isError = true; } finally { try { if (inputStream != null) inputStream.close(); if (outputStream != null) outputStream.close(); } catch (Exception e) { Log.w(TAG, "Exception on input/output stream close", e); } } } return isError; }

Target:
protected Boolean doInBackground(Void... params) { boolean isError = false; for (Map.Entry<Uri, String> entry : mFiles.entrySet()) { InputStream inputStream = null; String outPath = mFolder.path + entry.getValue(); try { File outFile = new File(outPath); if (outFile.isFile()) { mIgnored++; continue; } inputStream = getContentResolver().openInputStream(entry.getKey()); Files.asByteSink(outFile).writeFrom(inputStream); mCopied++; } catch (FileNotFoundException e) { Log.e(TAG, String.format("Can't find input file \"%s\" to copy", entry.getKey()), e); isError = true; } catch (IOException e) { Log.e(TAG, String.format("IO exception during file \"%s\" sharing", entry.getKey()), e); isError = true; } finally { try { if (inputStream != null) inputStream.close(); } catch (IOException e) { Log.w(TAG, "Exception on input/output stream close", e); } } } return isError; }
Source:
public TransactionToken stage(AccessToken creds, String env) throws TException { checkAccess(creds, null); Transaction existing = transactions.get(creds); if(existing != null) { existing.abort(); } Transaction transaction = getEngine(env).startTransaction(); transactions.put(creds, transaction); return new TransactionToken(); }

Target:
public TransactionToken stage(AccessToken creds, String env) throws TException { checkAccess(creds, null); Transaction existing = transactions.get(creds); if(existing != null) { existing.abort(); } Transaction transaction = getEngine(env).startTransaction(); transactions.put(creds, transaction); Logger.info("Started Transaction {}", transaction); return new TransactionToken(); }
Source:
private void waitForNotTransportState(String state) { if (stateMap.get("TransportState") != null) { long start = System.currentTimeMillis(); while (stateMap.get("TransportState").equals(state)) { try { Thread.sleep(50); if (System.currentTimeMillis() - start > (this.notificationTimeout.longValue() * 1000)) { break; } } catch (InterruptedException e) { logger.error("InterruptedException during playing a notification sound"); } } } }

Target:
private void waitForNotTransportState(String state) { if (stateMap.get("TransportState") != null) { long start = System.currentTimeMillis(); while (stateMap.get("TransportState").equals(state)) { try { Thread.sleep(50); if (System.currentTimeMillis() - start > this.notificationTimeout.longValue() * 1000) { break; } } catch (InterruptedException e) { logger.error("InterruptedException during playing a notification sound"); } } } }
Source:
public CourseStudent create(Course course, Student student, CourseEnrolmentType courseEnrolmentType, CourseParticipationType participationType, Date enrolmentDate, Boolean lodging, CourseOptionality optionality, BillingDetails billingDetails, String organization, String additionalInfo, Room room, BigDecimal lodgingFee, Currency lodgingFeeCurrency, Boolean archived) throws DuplicateCourseStudentException { CourseStudent courseStudent2 = findByCourseAndStudent(course, student); if (courseStudent2 != null) throw new DuplicateCourseStudentException(); CourseStudent courseStudent = new CourseStudent(); courseStudent.setCourse(course); courseStudent.setArchived(archived); courseStudent.setBillingDetails(billingDetails); courseStudent.setCourseEnrolmentType(courseEnrolmentType); courseStudent.setEnrolmentTime(enrolmentDate); courseStudent.setParticipationType(participationType); courseStudent.setLodging(lodging); courseStudent.setOptionality(optionality); courseStudent.setStudent(student); courseStudent.setRoom(room); courseStudent.setLodgingFee(lodgingFee); courseStudent.setLodgingFeeCurrency(lodgingFeeCurrency); courseStudent.setOrganization(organization); courseStudent.setAdditionalInfo(additionalInfo); persist(courseStudent); courseStudentCreatedEvent.fire(new CourseStudentCreatedEvent(courseStudent.getId(), courseStudent.getCourse().getId(), courseStudent.getStudent().getId())); return courseStudent; }

Target:
public CourseStudent create(Course course, Student student, CourseEnrolmentType courseEnrolmentType, CourseParticipationType participationType, Date enrolmentDate, Boolean lodging, CourseOptionality optionality, BillingDetails billingDetails, String organization, String additionalInfo, Room room, BigDecimal lodgingFee, Currency lodgingFeeCurrency, Boolean archived) throws DuplicateCourseStudentException { List<CourseStudent> courseStudents = listByCourseAndStudent(course, student); if (!courseStudents.isEmpty()) throw new DuplicateCourseStudentException(); CourseStudent courseStudent = new CourseStudent(); courseStudent.setCourse(course); courseStudent.setArchived(archived); courseStudent.setBillingDetails(billingDetails); courseStudent.setCourseEnrolmentType(courseEnrolmentType); courseStudent.setEnrolmentTime(enrolmentDate); courseStudent.setParticipationType(participationType); courseStudent.setLodging(lodging); courseStudent.setOptionality(optionality); courseStudent.setStudent(student); courseStudent.setRoom(room); courseStudent.setLodgingFee(lodgingFee); courseStudent.setLodgingFeeCurrency(lodgingFeeCurrency); courseStudent.setOrganization(organization); courseStudent.setAdditionalInfo(additionalInfo); persist(courseStudent); courseStudentCreatedEvent.fire(new CourseStudentCreatedEvent(courseStudent.getId(), courseStudent.getCourse().getId(), courseStudent.getStudent().getId())); return courseStudent; }
Source:
public void newLimitedEntryActionSetColumn() { final LimitedEntryActionSetFieldCol52 column = new LimitedEntryActionSetFieldCol52(); final ActionSetFieldPopup popup = new ActionSetFieldPopup( model, oracle, presenter, new ActionColumnCommand() { public void execute( final ActionCol52 column ) { presenter.appendColumn( column ); } }, column, true, !access.isEditable() ); popup.show(); }

Target:
public void newLimitedEntryActionSetColumn() { final LimitedEntryActionSetFieldCol52 column = new LimitedEntryActionSetFieldCol52(); doNewActionSetColumn( column ); }
Source:
public static void waitForTasksToComplete(final IProject project) { try { final Job waitJob = new Job("Waiting for other tasks...") { @Override protected IStatus run(IProgressMonitor monitor) { return Status.OK_STATUS; } }; waitJob.setRule(project.getWorkspace().getRuleFactory().buildRule()); waitJob.schedule(); waitJob.join(); } catch (InterruptedException e) { e.printStackTrace(); fail("Failed to wait for other jobs to complete: " + e.getMessage()); } }

Target:
public static void waitForTasksToComplete(final IProject project) { try { final TimeLimitedJob waitJob = new TimeLimitedJob(); waitJob.setRule(project.getWorkspace().getRuleFactory().buildRule()); waitJob.scheduleWithTimeout(10*60); waitJob.join(); } catch (InterruptedException e) { e.printStackTrace(); fail("Failed to wait for other jobs to complete: " + e.getMessage()); } }
Source:
public IStatus validate(IProject project, String path) { if( fileExists(path)) { return Status.OK_STATUS; } return new Status(IStatus.ERROR, "Text","File not found: " + path); }

Target:
public IStatus validate(IProject project, String path) { if( fileExists(path)) { return Status.OK_STATUS; } return new Status(IStatus.ERROR, Activator.PLUGIN_ID ,Messages.CustomTrace_FileNotFound + ": " + path); }