auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean performNextOperation(int completedChildCount) { if (getParameters().getCommandStep() == null) { getParameters().setCommandStep(RemoveSnapshotSingleDiskStep.EXTEND); getParameters().setChildCommands(new HashMap<>()); } syncChildCommandList(getParameters().getCommandStep(), getParameters().getChildCommands()); Guid currentChildId = getCurrentChildId(getParameters().getCommandStep(), getParameters().getChildCommands()); if (currentChildId != null) { getParameters().setCommandStep(getParameters().getNextCommandStep()); } log.info("Executing Cold Merge command step '{}'", getParameters().getCommandStep()); Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case EXTEND: break; case MERGE: break; case MERGE_STATUS: break; case UNLINK_CHAIN: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; case COMPLETE: getParameters().setDestroyImageCommandComplete(true); setCommandStatus(CommandStatus.SUCCEEDED); break; } persistCommand(getParameters().getParentCommand(), true); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }

Target:
public boolean performNextOperation(int completedChildCount) { syncChildCommandList(getParameters().getCommandStep(), getParameters().getChildCommands()); Guid currentChildId = getCurrentChildId(getParameters().getCommandStep(), getParameters().getChildCommands()); if (currentChildId != null) { getParameters().setCommandStep(getParameters().getNextCommandStep()); } log.info("Executing Cold Merge command step '{}'", getParameters().getCommandStep()); Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case PREPARE_MERGE: break; case MERGE: break; case FINALIZE_MERGE: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; case COMPLETE: getParameters().setDestroyImageCommandComplete(true); setCommandStatus(CommandStatus.SUCCEEDED); break; } persistCommand(getParameters().getParentCommand(), true); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }
Source:
public int hashCode() { return Objects.hash( super.hashCode(), s3ConfigProperties ); }

Target:
public int hashCode() { return Objects.hash(super.hashCode(), s3InputSourceConfig); }
Source:
public Map<StoreKey, MessageInfo> findKeys(List<? extends StoreKey> storeKeys) { Map<StoreKey, MessageInfo> messageInfoMap = new HashMap<>(); for (StoreKey storeKey : storeKeys) { try { messageInfoMap.put(storeKey, findKey(storeKey)); } catch (StoreException stEx) { logger.info("Key %s not found in findKey", storeKey.getID()); } } return messageInfoMap; }

Target:
public Map<StoreKey, MessageInfo> findKeys(List<? extends StoreKey> storeKeys) throws StoreException { Map<StoreKey, MessageInfo> messageInfoMap = new HashMap<>(); for (StoreKey storeKey : storeKeys) { try { messageInfoMap.put(storeKey, findKey(storeKey)); } catch (StoreException e) { logger.error("findKey failed for key with reason {}", storeKey.getID(), e.getErrorCode().toString()); throw e; } } return messageInfoMap; }
Source:
public int[][] getDrops(Item item) { if (item.getTier() >= ItemTool.TIER_WOODEN) { return new int[][]{{Item.CAULDRON, 0, 1}}; } return new int[0][0]; }

Target:
public int[][] getDrops(Item item) { if (item.getTier() >= ItemTool.TIER_WOODEN) { return new int[][]{{Item.HOPPER, 0, 1}}; } return new int[0][0]; }
Source:
return simpleTokenCache.getToken() .map(accessToken -> { String authorization; StringBuilder authorizationBuilder = new StringBuilder() .append(AAD_AUTH_SCHEMA_TYPE_SEGMENT).append("=").append(AAD_AUTH_SCHEMA_TYPE_VALUE) .append(AAD_AUTH_VERSION_SEGMENT).append("=").append(AAD_AUTH_VERSION_VALUE) .append(AAD_AUTH_SIGNATURE_SEGMENT).append("=").append(accessToken.getToken()); try { authorization = URLEncoder.encode(authorizationBuilder.toString(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to encode authorization token.", e); } return authorization; }); } }

Target:
return simpleTokenCache.getToken() .map(accessToken -> { String authorization; String authorizationPayload = AUTH_PREFIX + accessToken.getToken(); try { authorization = URLEncoder.encode(authorizationPayload, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to encode authorization token.", e); } return authorization; }); } }
Source:
public void unblock() { synchronized (lock) { lock.set(true); lock.notifyAll(); } }

Target:
public void unblock() { lock.countDown(); }
Source:
public TupleWriter(ConfFactory confFactory) throws NumberFormatException, HyracksDataException { this.cf = confFactory; Kmer.setGlobalKmerLength(Integer.parseInt(cf.getConf().get(GenomixJobConf.KMER_LENGTH))); }

Target:
public TupleWriter(ConfFactory confFactory) throws NumberFormatException, HyracksDataException { this.cf = confFactory; GenomixJobConf.setGlobalStaticConstants(cf.getConf()); }
Source:
public void removeScreen(SolUiScreen screen, SolApplication solApplication) { screenToRemove.add(screen); List<SolUiControl> controls = screen.getControls(); for (SolUiControl control : controls) { control.blur(); } screen.blurCustom(solApplication); }

Target:
private void removeScreen(SolUiScreen screen, SolApplication solApplication) { screenToRemove.add(screen); List<SolUiControl> controls = screen.getControls(); for (SolUiControl control : controls) { control.blur(); } screen.blurCustom(solApplication); }
Source:
public Header(String name, String value) { this.name = name; this.value = value; }

Target:
public Header(String name, String value) { Objects.requireNonNull(name, "'name' cannot be null."); this.name = name; this.value = value; }
Source:
public Response getFactoryJson(@ApiParam(value = "Workspace ID", required = true) @PathParam("ws-id") String workspace, @ApiParam(value = "Project path") @QueryParam("path") String path) throws ApiException { final UsersWorkspaceImpl usersWorkspace = workspaceManager.getWorkspace(workspace); final String userId = EnvironmentContext.getCurrent().getUser().getId(); if (!usersWorkspace.getOwner().equals(userId)) { throw new ForbiddenException("User '" + userId + "' doesn't have access to '" + usersWorkspace.getId() + "' workspace"); } Factory factory = DtoFactory.newDto(Factory.class) .withWorkspace(asDto(usersWorkspace, path)) .withV("4.0"); return Response.ok(factory, MediaType.APPLICATION_JSON) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=factory.json") .build(); }

Target:
public Response getFactoryJson(@ApiParam(value = "Workspace ID", required = true) @PathParam("ws-id") String workspace, @ApiParam(value = "Project path") @QueryParam("path") String path) throws ApiException { final UsersWorkspaceImpl usersWorkspace = workspaceManager.getWorkspace(workspace); final String userId = EnvironmentContext.getCurrent().getUser().getId(); if (!usersWorkspace.getOwner().equals(userId)) { throw new ForbiddenException("User '" + userId + "' doesn't have access to '" + usersWorkspace.getId() + "' workspace"); } Factory factory = newDto(Factory.class) .withWorkspace(asDto(usersWorkspace, path)) .withV("4.0"); return Response.ok(factory, MediaType.APPLICATION_JSON) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=factory.json") .build(); }
Source:
public String process() throws Exception { String ddl = null; if(this.table.getType().equals(PTableType.TABLE)) { ddl = extractCreateTableDDL(this.table); } else if(this.table.getType().equals(PTableType.INDEX)) { ddl = extractCreateIndexDDL(this.table); } else if(this.table.getType().equals(PTableType.VIEW)) { ddl = extractCreateViewDDL(this.table); } return ddl; }

Target:
public String process() throws Exception { if (ddl != null) { return ddl; } if(this.table.getColumnFamilies().size() > 1 ) { throw new RuntimeException(FEATURE_NOT_SUPPORTED_ON_EXTRACTION_TOOL); } if(this.table.getType().equals(PTableType.TABLE)) { ddl = extractCreateTableDDL(this.table); } else if(this.table.getType().equals(PTableType.INDEX)) { ddl = extractCreateIndexDDL(this.table); } else if(this.table.getType().equals(PTableType.VIEW)) { ddl = extractCreateViewDDL(this.table); } return ddl; }
Source:
private void completeTask(WrappedTask wt) throws InterruptedException { try { long waitTime = wt.endTime - System.currentTimeMillis(); successCallback.accept(wt.callable, wt.future.get(waitTime, TimeUnit.MILLISECONDS)); } catch (InterruptedException e) { throw e; } catch (TimeoutException e) { wt.future.cancel(true); timeoutCallback.accept(wt.callable); } catch (Exception e) { exceptionCallback.accept(wt.callable, e); } wt.hasCompleted = true; }

Target:
private void completeTask(WrappedTask wt) throws InterruptedException { try { handleSuccess(wt); } catch (InterruptedException e) { throw e; } catch (TimeoutException e) { handleTimeout(wt); } catch (Exception e) { handleException(wt, e); } }
Source:
private ConfigurationItem createConfig(MaintenanceRequestItem config) { return new ConfigurationItem.Builder() .setOlderThanPeriod(config.olderThanPeriod) .setBatchSize(config.batchSize) .setWorkflowTypes(ofNullable(config.workflowTypes).orElseGet(Collections::emptySet)) .build(); }

Target:
private ConfigurationItem createConfig(MaintenanceRequestItem config) { return new ConfigurationItem.Builder() .setOlderThanPeriod(config.olderThanPeriod) .setBatchSize(config.batchSize) .setWorkflowTypes(ofNullable(config.workflowTypes).orElse(emptySet())) .build(); }
Source:
public void setNodesChecked(List<ITreeNode> nodes, boolean checked, boolean enabledNodesOnly) { if (!isCheckable()) { return; } List<ITreeNode> changedNodes = new ArrayList<ITreeNode>(); for (ITreeNode node : nodes) { node = resolveNode(node); if (node != null && node.isChecked() != checked && (!enabledNodesOnly || node.isEnabled())) { if (checked) { m_checkedNodes.add(node); } else { m_checkedNodes.remove(node); } changedNodes.add(node); if (checked && !isMultiCheck()) { List<ITreeNode> uncheckedNodes = new ArrayList<ITreeNode>(); Iterator<ITreeNode> checkedNodesIterator = m_checkedNodes.iterator(); while (checkedNodesIterator.hasNext()) { ITreeNode cn = (ITreeNode) checkedNodesIterator.next(); if (cn != node) { m_checkedNodes.remove(cn); uncheckedNodes.add(cn); } } break; } } } if (changedNodes.size() > 0) { if (isAutoCheckChildNodes() && isMultiCheck()) { try { interceptAutoCheckChildNodes(nodes, checked, enabledNodesOnly); } catch (RuntimeException ex) { BEANS.get(ExceptionHandler.class).handle(ex); } } fireNodesChecked(changedNodes); } }

Target:
public void setNodesChecked(List<ITreeNode> nodes, boolean checked, boolean enabledNodesOnly) { if (!isCheckable()) { return; } List<ITreeNode> changedNodes = new ArrayList<ITreeNode>(); for (ITreeNode node : nodes) { node = resolveNode(node); if (node != null && node.isChecked() != checked && (!enabledNodesOnly || node.isEnabled())) { if (checked) { m_checkedNodes.add(node); } else { m_checkedNodes.remove(node); } changedNodes.add(node); if (checked && !isMultiCheck()) { List<ITreeNode> uncheckedNodes = new ArrayList<ITreeNode>(); Iterator<ITreeNode> checkedNodesIterator = m_checkedNodes.iterator(); while (checkedNodesIterator.hasNext()) { ITreeNode cn = checkedNodesIterator.next(); if (cn != node) { m_checkedNodes.remove(cn); uncheckedNodes.add(cn); } } break; } } } if (changedNodes.size() > 0) { if (isAutoCheckChildNodes() && isMultiCheck()) { try { interceptAutoCheckChildNodes(nodes, checked, enabledNodesOnly); } catch (RuntimeException ex) { BEANS.get(ExceptionHandler.class).handle(ex); } } fireNodesChecked(changedNodes); } }
Source:
public String toString(final String indent) { final Map<SourceNode<?, ?>, List<String>> sourceToTopics = new HashMap<>(); for (final Map.Entry<String, SourceNode<?, ?>> sourceNodeEntry : sourcesByTopic.entrySet()) { final String topic = sourceNodeEntry.getKey(); final SourceNode<?, ?> source = sourceNodeEntry.getValue(); sourceToTopics.computeIfAbsent(source, s -> new ArrayList<>()); sourceToTopics.get(source).add(topic); } final StringBuilder sb = new StringBuilder(indent + "ProcessorTopology:\n"); for (final Map.Entry<SourceNode<?, ?>, List<String>> sourceNodeEntry : sourceToTopics.entrySet()) { final SourceNode<?, ?> source = sourceNodeEntry.getKey(); final List<String> topics = sourceNodeEntry.getValue(); sb.append(source.toString(indent + "\t", topics)).append(childrenToString(indent + "\t", source.children())); } return sb.toString(); }

Target:
public String toString(final String indent) { final Map<SourceNode<?, ?>, List<String>> sourceToTopics = new HashMap<>(); for (final Map.Entry<String, SourceNode<?, ?>> sourceNodeEntry : sourceNodesByTopic.entrySet()) { final String topic = sourceNodeEntry.getKey(); final SourceNode<?, ?> source = sourceNodeEntry.getValue(); sourceToTopics.computeIfAbsent(source, s -> new ArrayList<>()); sourceToTopics.get(source).add(topic); } final StringBuilder sb = new StringBuilder(indent + "ProcessorTopology:\n"); for (final Map.Entry<SourceNode<?, ?>, List<String>> sourceNodeEntry : sourceToTopics.entrySet()) { final SourceNode<?, ?> source = sourceNodeEntry.getKey(); final List<String> topics = sourceNodeEntry.getValue(); sb.append(source.toString(indent + "\t")) .append(topicsToString(indent + "\t", topics)) .append(childrenToString(indent + "\t", source.children())); } return sb.toString(); }
Source:
public void run(IAction action) { IWorkbenchWindow workbenchWindow = DebugUIPlugin.getActiveWorkbenchWindow(); IWorkbenchPage activePage = workbenchWindow != null ? workbenchWindow.getActivePage() : null; IViewPart fViewpart = activePage != null ? activePage.findView(IDebugUIConstants.ID_BREAKPOINT_VIEW) : null; WizardExportBreakpoints wiz = new WizardExportBreakpoints(); IViewSite viewSite = fViewpart != null ? fViewpart.getViewSite() : null; ISelectionProvider selectionProvider = viewSite != null ? viewSite.getSelectionProvider() : null; ISelection selection = selectionProvider != null ? selectionProvider.getSelection() : null; wiz.init(DebugUIPlugin.getDefault().getWorkbench(), (IStructuredSelection) selection); WizardDialog wizdialog = new WizardDialog(DebugUIPlugin.getShell(), wiz); wizdialog.setBlockOnOpen(true); wizdialog.open(); }

Target:
public void run(IAction action) { WizardExportBreakpoints wiz = new WizardExportBreakpoints(); wiz.init(DebugUIPlugin.getDefault().getWorkbench(), getSelection()); WizardDialog wizdialog = new WizardDialog(DebugUIPlugin.getShell(), wiz); wizdialog.setBlockOnOpen(true); wizdialog.open(); }
Source:
public boolean ok(T record, RequestScope requestScope, Optional<ChangeSpec> changeSpec) { return changeSpec.isPresent() && changeSpec.get().getOriginal() != null && changeSpec.get().getModified() == null; }

Target:
public boolean ok(T record, RequestScope requestScope, Optional<ChangeSpec> changeSpec) { return changeSpec.map((c) -> { return c.getOriginal() != null && c.getModified() == null; }) .orElse(false); }
Source:
public Module getModule(Configuration configuration) { return new AbstractModule() { @Override protected void configure() { bind(HdfsClient.class).toInstance(createHdfsClient()); bind(RevisionStorage.class).toProvider(RevisionStorageProvider.class).in(Scopes.SINGLETON); bind(HdfsDataSourceWriter.class).to(DefaultHdfsDataSourceWriter.class).in(Scopes.SINGLETON); } private HdfsClient createHdfsClient() { HostAndPort nameNodeHostAndPort = getNameNodeHostAndPort(); String username = configuration.getStringMandatory("hdfs.username"); if (spnegoAuthenticationRequired()) { return createSpnegoHdfsClient(nameNodeHostAndPort, username); } else { return createSimpleHdfsClient(nameNodeHostAndPort, username); } } private HostAndPort getNameNodeHostAndPort() { String nameNodeHost = configuration.getStringMandatory("hdfs.webhdfs.host"); int nameNodePort = configuration.getIntMandatory("hdfs.webhdfs.port"); checkArgument(nameNodePort > 0, "Invalid name node WebHDFS port number: %s", nameNodePort); return HostAndPort.fromParts(nameNodeHost, nameNodePort); } private boolean spnegoAuthenticationRequired() { Optional<String> authentication = configuration.getString("hdfs.webhdfs.authentication"); return authentication.isPresent() && authentication.get().equals(AUTHENTICATION_SPNEGO); } private HdfsClient createSpnegoHdfsClient(HostAndPort nameNodeHostAndPort, String username) { Optional<String> keytab = configuration.getString("hdfs.webhdfs.keytab"); checkState(keytab.isPresent(), "In order to use SPNEGO authenticated HDFS " + "you must specify keytab location with the 'hdfs.webhdfs.keytab' property"); return new SpnegoWebHdfsClient(nameNodeHostAndPort, username, keytab.get()); } private HdfsClient createSimpleHdfsClient(HostAndPort nameNodeHostAndPort, String username) { return new SimpleWebHdfsClient(nameNodeHostAndPort, username); } }; }

Target:
public Module getModule(Configuration configuration) { return new PrivateModule() { @Override protected void configure() { install(httpRequestsExecutorModule()); bind(HdfsClient.class).to(WebHdfsClient.class).in(Scopes.SINGLETON); bind(RevisionStorage.class).toProvider(RevisionStorageProvider.class).in(Scopes.SINGLETON); bind(HdfsDataSourceWriter.class).to(DefaultHdfsDataSourceWriter.class).in(Scopes.SINGLETON); expose(HdfsClient.class); expose(RevisionStorage.class); expose(HdfsDataSourceWriter.class); } private Module httpRequestsExecutorModule() { if (spnegoAuthenticationRequired()) { return new SpnegoHttpRequestsExecutor.Module(); } else { return new SimpleHttpRequestsExecutor.Module(); } } private boolean spnegoAuthenticationRequired() { Optional<String> authentication = configuration.getString("hdfs.webhdfs.authentication"); return authentication.isPresent() && authentication.get().equalsIgnoreCase(AUTHENTICATION_SPNEGO); } @Inject @Provides @Singleton CloseableHttpClient createHttpClient() { HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); httpClientBuilder.setRetryHandler(new DefaultHttpRequestRetryHandler(NUMBER_OF_HTTP_RETRIES, true)); return httpClientBuilder.build(); } }; }
Source:
public void showFirebaseLoginPrompt() { mDialog = new FirebaseLoginDialog(); mDialog .addAuthHelper(mGoogleAuthHelper) .addAuthHelper(mFacebookAuthHelper) .addAuthHelper(mTwitterAuthHelper) .show(getFragmentManager(), ""); }

Target:
public void showFirebaseLoginPrompt() { mDialog.show(getFragmentManager(), ""); }
Source:
public void fileCopied( @NotNull VirtualFileCopyEvent virtualFileCopyEvent) { assert enabled : "the file copied listener was triggered while it was disabled"; VirtualFile copy = virtualFileCopyEvent.getFile(); if (copy.isDirectory()) { LOG.error("Unexpected copying event for directory. This should have" + "been handled by the creation listener."); return; } if (LOG.isTraceEnabled()) { LOG.trace("Reacting to resource copying - original: " + virtualFileCopyEvent.getOriginalFile() + ", copy: " + copy); } SPath copyPath = VirtualFileConverter.convertToSPath(copy); if (copyPath == null || !session.isShared(copyPath.getResource())) { if (LOG.isTraceEnabled()) { LOG.trace("Ignoring non-shared resource copy:" + copy); } return; } User user = session.getLocalUser(); String charset = copy.getCharset().name(); byte[] content = getContent(copy); IActivity activity = new FileActivity(user, Type.CREATED, FileActivity.Purpose.ACTIVITY, copyPath, null, content, charset); fireActivity(activity); }

Target:
public void fileCopied( @NotNull VirtualFileCopyEvent virtualFileCopyEvent) { assert enabled : "the file copied listener was triggered while it was disabled"; VirtualFile copy = virtualFileCopyEvent.getFile(); assert !copy .isDirectory() : "Unexpected copying event for directory. This should have been handled by the creation listener."; if (LOG.isTraceEnabled()) { LOG.trace("Reacting to resource copying - original: " + virtualFileCopyEvent.getOriginalFile() + ", copy: " + copy); } SPath copyPath = VirtualFileConverter.convertToSPath(copy); if (copyPath == null || !session.isShared(copyPath.getResource())) { if (LOG.isTraceEnabled()) { LOG.trace("Ignoring non-shared resource copy: " + copy); } return; } User user = session.getLocalUser(); String charset = copy.getCharset().name(); byte[] content = getContent(copy); IActivity activity = new FileActivity(user, Type.CREATED, FileActivity.Purpose.ACTIVITY, copyPath, null, content, charset); fireActivity(activity); }
Source:
public void setupPreferencesScreen(PreferenceScreen preferenceScreen) { PreferenceCategory preferenceCategory = (PreferenceCategory) preferenceScreen.findPreference( settingsActivity.getResources().getString(R.string.pref_cat_server)); if (preferenceCategory != null) { preferenceCategory.removePreference(preferenceScreen.findPreference( settingsActivity.getResources().getString(R.string.org_unit))); } }

Target:
public void setupPreferencesScreen(PreferenceScreen preferenceScreen) { }
Source:
public synchronized void clear() throws IOException { writeHeader(INITIAL_LENGTH, 0, 0, 0); raf.getChannel().force(true); if (fileLength > INITIAL_LENGTH) raf.setLength(INITIAL_LENGTH); elementCount = 0; first = last = Element.NULL; fileLength = INITIAL_LENGTH; }

Target:
public synchronized void clear() throws IOException { writeHeader(INITIAL_LENGTH, 0, 0, 0); elementCount = 0; first = last = Element.NULL; fileLength = INITIAL_LENGTH; if (fileLength > INITIAL_LENGTH) setLength(INITIAL_LENGTH); }
Source:
public void onEntryEviction(Map<K, InternalCacheEntry<K, V>> evicted) { evictionManager.onEntryEviction(evicted); List<CommandInterceptor> interceptors = interceptorChain.getInterceptorsWhichExtend(CacheMgmtInterceptor.class); if (!interceptors.isEmpty()) { CacheMgmtInterceptor mgmtInterceptor = (CacheMgmtInterceptor) interceptors.get(0); mgmtInterceptor.addEvictions(evicted.size()); } }

Target:
public void onEntryEviction(Map<K, InternalCacheEntry<K, V>> evicted) { evictionManager.onEntryEviction(evicted); }
Source:
public Authorization execute(CommandContext commandContext) { final AuthorizationManager authorizationManager = commandContext.getAuthorizationManager(); authorizationManager.validateResourceCompatibility(authorization); if (isHistoricTaskInstanceResource()) { provideRemovalTime(() -> getHistoricTaskInstance(commandContext)); } String operationType = null; AuthorizationEntity previousValues = null; if(authorization.getId() == null) { authorizationManager.insert(authorization); operationType = UserOperationLogEntry.OPERATION_TYPE_CREATE; } else { previousValues = commandContext.getDbEntityManager().selectById(AuthorizationEntity.class, authorization.getId()); authorizationManager.update(authorization); operationType = UserOperationLogEntry.OPERATION_TYPE_UPDATE; } commandContext.getOperationLogManager().logAuthorizationOperation(operationType, authorization, previousValues); return authorization; }

Target:
public Authorization execute(CommandContext commandContext) { final AuthorizationManager authorizationManager = commandContext.getAuthorizationManager(); authorizationManager.validateResourceCompatibility(authorization); if (isHistoricTaskInstanceResource()) { HistoryEvent historicTaskInstance = getHistoricTaskInstance(commandContext); provideRemovalTime(historicTaskInstance); } String operationType = null; AuthorizationEntity previousValues = null; if(authorization.getId() == null) { authorizationManager.insert(authorization); operationType = UserOperationLogEntry.OPERATION_TYPE_CREATE; } else { previousValues = commandContext.getDbEntityManager().selectById(AuthorizationEntity.class, authorization.getId()); authorizationManager.update(authorization); operationType = UserOperationLogEntry.OPERATION_TYPE_UPDATE; } commandContext.getOperationLogManager().logAuthorizationOperation(operationType, authorization, previousValues); return authorization; }
Source:
public void setNodeDao(NodeDao nodeDao) { this.m_nodeDao = nodeDao; }

Target:
public void setNodeDao(NodeDao nodeDao) { m_nodeDao = nodeDao; }
Source:
public void announce(final ZToolAddress16 senderAddress, final ZToolAddress64 ieeeAddress, final ZToolAddress16 destinationAddress, final int capabilitiesBitmask) { logger.info("Device announcement received - Network Address: #{}, IEEE Address: {}", senderAddress.get16BitValue(), IEEEAddress.toColonNotation(ieeeAddress.getLong())); queue.push(senderAddress, ieeeAddress); final Thread notifyThread = new Thread(new Runnable() { @Override public void run() { ApplicationFrameworkLayer.getAFLayer(zigbeeNetworkManager).getZigBeeNetwork().notifyDiscoveryAnnounced( new ZigBeeNodeImpl(senderAddress.get16BitValue(), ieeeAddress, (short) zigbeeNetworkManager.getCurrentPanId())); } }); notifyThread.start(); }

Target:
public void announce(final ZToolAddress16 senderAddress, final ZToolAddress64 ieeeAddress, final ZToolAddress16 destinationAddress, final int capabilitiesBitmask) { logger.info("Device announcement received - Network Address: #{}, IEEE Address: {}", senderAddress.get16BitValue(), IEEEAddress.toColonNotation(ieeeAddress.getLong())); queue.push(senderAddress, ieeeAddress); new Thread(new Runnable() { @Override public void run() { ApplicationFrameworkLayer.getAFLayer(zigbeeNetworkManager).getZigBeeNetwork().notifyDiscoveryAnnounced( new ZigBeeNodeImpl(senderAddress.get16BitValue(), ieeeAddress, (short) zigbeeNetworkManager.getCurrentPanId())); } }).start(); }
Source:
public void addRule(RedisFirewallRuleImpl rule) { if (!load) { load = true; cacheCollection(); } this.addChildResource(rule); }

Target:
public void addRule(RedisFirewallRuleImpl rule) { ensureCollectionLoaded(); this.addChildResource(rule); }
Source:
public static JobStatus fromString(String symbol) { return stringToEnum.get(symbol); }

Target:
public static JobStatus fromString(String symbol) { return JobStatus.valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, symbol)); }
Source:
public RecoveryManager(Master master) { this.master = master; executor = Executors.newScheduledThreadPool(4, new NamingThreadFactory("Walog sort starter ")); zooCache = new ZooCache(); try { AccumuloConfiguration aconf = master.getConfiguration(); List<String> workIDs = new DistributedWorkQueue(ZooUtil.getRoot(master.getInstance()) + Constants.ZRECOVERY, aconf).getWorkQueued(); sortsQueued.addAll(workIDs); } catch (Exception e) { log.warn(e.getMessage(), e); } }

Target:
public RecoveryManager(Master master) { this.master = master; executor = Executors.newScheduledThreadPool(4, new NamingThreadFactory("Walog sort starter ")); zooCache = new ZooCache(); try { AccumuloConfiguration aconf = master.getConfiguration(); List<String> workIDs = new DistributedWorkQueue(ZooUtil.getRoot(master.getInstance()) + Constants.ZRECOVERY, aconf).getWorkQueued(); sortsQueued.addAll(workIDs); } catch (Exception e) { log.warn("{}", e.getMessage(), e); } }
Source:
default Map<String, Object> getAttributes() { return Collections.emptyMap(); }

Target:
default Map<String, List<Object>> getAttributes() { return Collections.emptyMap(); }
Source:
private static boolean areSelfJoinKeysUnique(RelMetadataQuery mq, RelNode leftRel, RelNode rightRel, RexNode joinFilters) { final JoinInfo joinInfo = JoinInfo.of(leftRel, rightRel, joinFilters); for (IntPair pair : joinInfo.pairs()) { final RelColumnOrigin leftOrigin = mq.getColumnOrigin(leftRel, pair.source); if (leftOrigin == null) { return false; } final RelColumnOrigin rightOrigin = mq.getColumnOrigin(rightRel, pair.target); if (rightOrigin == null) { return false; } if (leftOrigin.getOriginColumnOrdinal() != rightOrigin.getOriginColumnOrdinal()) { return false; } } return RelMdUtil.areColumnsDefinitelyUnique(mq, leftRel, joinInfo.leftSet()); }

Target:
private static boolean areSelfJoinKeysUnique(RelMetadataQuery mq, RelNode leftRel, RelNode rightRel, RexNode joinFilters) { final JoinInfo joinInfo = JoinInfo.of(leftRel, rightRel, joinFilters); for (IntPair pair : joinInfo.pairs()) { final RelColumnOrigin leftOrigin = mq.getColumnOrigin(leftRel, pair.source); if (leftOrigin == null) { return false; } final RelColumnOrigin rightOrigin = mq.getColumnOrigin(rightRel, pair.target); if (rightOrigin == null) { return false; } if (leftOrigin.getOriginColumnOrdinal() != rightOrigin.getOriginColumnOrdinal()) { return false; } } return RelMdUtil.areColumnsDefinitelyUniqueWhenNullsFiltered(mq, leftRel, joinInfo.leftSet()); }
Source:
public static void addShutdownHookWithDelayedForceKill (Runnable func, int numSecs) { Runnable sleepKill = new Runnable() { @Override public void run() { try { LOG.info("Halting after " + numSecs + " seconds"); Time.sleepSecs(numSecs); LOG.warn("Forcing Halt..."); Runtime.getRuntime().halt(20); } catch (Exception e) { LOG.warn("Exception in the ShutDownHook", e); } } }; Runtime.getRuntime().addShutdownHook(new Thread(func)); Runtime.getRuntime().addShutdownHook(new Thread(sleepKill)); }

Target:
public static void addShutdownHookWithDelayedForceKill (Runnable func, int numSecs) { Runnable sleepKill = new Runnable() { @Override public void run() { try { LOG.info("Halting after seconds", numSecs); Time.sleepSecs(numSecs); LOG.warn("Forcing Halt..."); Runtime.getRuntime().halt(20); } catch (Exception e) { LOG.warn("Exception in the ShutDownHook", e); } } }; Runtime.getRuntime().addShutdownHook(new Thread(func)); Runtime.getRuntime().addShutdownHook(new Thread(sleepKill)); }
Source:
private Session getSessionFromSrmResource(Resource srmResource) { Resource airdResource = new EObjectQuery(srmResource.getContents().get(0)).getDAnalysis().eResource(); return getSessionFromAirdResource(airdResource); }

Target:
private Session getSessionFromSrmResource(Resource srmResource) { return Optional.ofNullable(new EObjectQuery(srmResource.getContents().get(0)).getDAnalysis()).map(EObject::eResource).map(res -> getSessionFromAirdResource(res)).orElse(null); }
Source:
public PredefinedScopeHibernateValidatorConfiguration initializeLocales(Set<Locale> localesToInitialize) { Contracts.assertNotNull( localesToInitialize, MESSAGES.parameterMustNotBeNull( "localesToInitialize" ) ); this.localesToInitialize = localesToInitialize; return thisAsT(); }

Target:
public PredefinedScopeHibernateValidatorConfiguration initializeLocales(Set<Locale> localesToInitialize) { Contracts.assertNotNull( localesToInitialize, MESSAGES.parameterMustNotBeNull( "localesToInitialize" ) ); locales( localesToInitialize ); return thisAsT(); }
Source:
public int compare(Viewer compareViewer, Object o1, Object o2) { long date1 = getModificationDate(o1); long date2 = getModificationDate(o2); int result = 0; if (date1 == -1 || date2 == -1) { result = super.compare(compareViewer, o1, o2); } else { for (int element : SORT_ORDERS_BY_COLUMN[columnNumber]) { result = compareColumnValue(element, date1, date2); if (result != 0) break; } } if (reversed) result = -result; return result; }

Target:
public int compare(Viewer compareViewer, Object o1, Object o2) { long date1 = getModificationDate(o1); long date2 = getModificationDate(o2); int result = 0; if (date1 == -1 || date2 == -1) { result = super.compare(compareViewer, o1, o2); } else { for (int columnSortOrder : SORT_ORDERS_BY_COLUMN[columnNumber]) { result = compareColumnValue(columnSortOrder, date1, date2); if (result != 0) break; } } if (reversed) result = -result; return result; }
Source:
private void performSimilarSegmentMergingStep(final ACNVModeller modeller) { logger.info("Initial number of segments before similar-segment merging: " + modeller.getACNVModeledSegments().size()); int prevNumSegments; for (int numIterations = 1; numIterations <= maxNumSimilarSegmentMergingIterations; numIterations++) { logger.info("Similar-segment merging iteration: " + numIterations); prevNumSegments = modeller.getACNVModeledSegments().size(); modeller.performSimilarSegmentMergingIteration(intervalThresholdCopyRatio, intervalThresholdAlleleFraction); if (modeller.getACNVModeledSegments().size() == prevNumSegments) { break; } final File modeledSegmentsFile = new File(outputPrefix + "-" + INTERMEDIATE_SEG_FILE_TAG + "-" + numIterations + ".seg"); modeller.writeACNVModeledSegmentFile(modeledSegmentsFile); } logger.info("Final number of segments after similar-segment merging: " + modeller.getACNVModeledSegments().size()); }

Target:
private void performSimilarSegmentMergingStep(final ACNVModeller modeller) { logger.info("Initial number of segments before similar-segment merging: " + modeller.getACNVModeledSegments().size()); for (int numIterations = 1; numIterations <= maxNumSimilarSegmentMergingIterations; numIterations++) { logger.info("Similar-segment merging iteration: " + numIterations); final int prevNumSegments = modeller.getACNVModeledSegments().size(); modeller.performSimilarSegmentMergingIteration(intervalThresholdCopyRatio, intervalThresholdAlleleFraction); if (modeller.getACNVModeledSegments().size() == prevNumSegments) { break; } final File modeledSegmentsFile = new File(outputPrefix + "-" + INTERMEDIATE_SEG_FILE_TAG + "-" + numIterations + ".seg"); modeller.writeACNVModeledSegmentFile(modeledSegmentsFile); } logger.info("Final number of segments after similar-segment merging: " + modeller.getACNVModeledSegments().size()); }
Source:
public int loadTable(String namespace, String tablename, int numItems, int batchSize) { verifyNamespaceAndTablename(namespace, tablename); CorfuStore store = new CorfuStore(runtime); try { TableOptions.TableOptionsBuilder<Object, Object> optionsBuilder = TableOptions.builder(); if (diskPath != null) { optionsBuilder.persistentDataPath(Paths.get(diskPath)); } store.openTable(namespace, tablename, TableName.getDefaultInstance().getClass(), TableName.getDefaultInstance().getClass(), TableName.getDefaultInstance().getClass(), optionsBuilder.build()); TableName dummyVal = TableName.newBuilder().setNamespace(namespace).setTableName(tablename).build(); log.info("Loading items in batchSized transactions into {}${}", numItems, batchSize, namespace, tablename); while (numItems > 0) { log.info("loadTable: Items left {}", numItems); TxBuilder tx = store.tx(namespace); for (int j = batchSize; j > 0 && numItems > 0; j--, numItems--) { TableName dummyKey = TableName.newBuilder().setNamespace(Integer.toString(numItems)) .setTableName(Integer.toString(j)).build(); tx.update(tablename, dummyKey, dummyVal, dummyVal); } tx.commit(); } } catch (Exception e) { log.error("loadTable: failed.", namespace, tablename, numItems, batchSize, e); } return numItems/batchSize; }

Target:
public int loadTable(String namespace, String tablename, int numItems, int batchSize) { verifyNamespaceAndTablename(namespace, tablename); CorfuStore store = new CorfuStore(runtime); try { TableOptions.TableOptionsBuilder<Object, Object> optionsBuilder = TableOptions.builder(); if (diskPath != null) { optionsBuilder.persistentDataPath(Paths.get(diskPath)); } store.openTable(namespace, tablename, TableName.getDefaultInstance().getClass(), TableName.getDefaultInstance().getClass(), TableName.getDefaultInstance().getClass(), optionsBuilder.build()); TableName dummyVal = TableName.newBuilder().setNamespace(namespace).setTableName(tablename).build(); log.info("Loading items in batchSized transactions into {}${}", numItems, batchSize, namespace, tablename); int itemsRemaining = numItems; while (itemsRemaining > 0) { log.info("loadTable: Items left {}", itemsRemaining); TxBuilder tx = store.tx(namespace); for (int j = batchSize; j > 0 && itemsRemaining > 0; j--, itemsRemaining--) { TableName dummyKey = TableName.newBuilder() .setNamespace(Integer.toString(itemsRemaining)) .setTableName(Integer.toString(j)).build(); tx.update(tablename, dummyKey, dummyVal, dummyVal); } tx.commit(); } } catch (Exception e) { log.error("loadTable: failed.", namespace, tablename, numItems, batchSize, e); } return (int)(Math.ceil((double)numItems/batchSize)); }
Source:
public Resolver getResolver(String input) { if (input == null) { return null; } if (input.startsWith(SYSTEM_VARIABLE_PREFIX)) { Matcher matcher = rePattern.matcher(input); Resolver resolverObject = null; if (matcher.find()) { Class<? extends Resolver> resolverClass = resolverMap.get(matcher.group(RESOLVER_INDEX).toLowerCase()); if (resolverClass != null) { try { resolverObject = resolverClass.newInstance(); resolverObject.setVariable(matcher.group(3)); return resolverObject; } catch (IllegalAccessException | InstantiationException e) { throw new ResolverException("Resolver could not be found"); } } else { throw new ResolverException("Resolver could not be found"); } } } else if(input.startsWith(FILE_PROPERTY_VARIABLE_PREFIX)){ Matcher matcher = rePattern.matcher(input); Resolver resolverObject = null; if (matcher.find()){ Class<? extends Resolver> resolverClass = resolverMap.get(matcher.group(RESOLVER_INDEX).toLowerCase()); if (resolverClass != null) { try { resolverObject = resolverClass.newInstance(); resolverObject.setVariable(matcher.group(3)); return resolverObject; } catch (IllegalAccessException | InstantiationException e) { throw new ResolverException("Resolver could not be found"); } } else { throw new ResolverException("Resolver could not be found"); } } } Resolver resolver = new DefaultResolver(); resolver.setVariable(input); return resolver; }

Target:
public Resolver getResolver(String input) { if (input == null) { return null; } if (input.startsWith(SYSTEM_VARIABLE_PREFIX)) { Matcher matcher = rePattern.matcher(input); Resolver resolverObject = null; if (matcher.find()) { Class<? extends Resolver> resolverClass = resolverMap.get(matcher.group(RESOLVER_INDEX).toLowerCase()); if (resolverClass != null) { try { resolverObject = resolverClass.newInstance(); resolverObject.setVariable(matcher.group(3)); return resolverObject; } catch (IllegalAccessException | InstantiationException e) { throw new ResolverException("Resolver could not be found"); } } else { throw new ResolverException("Resolver could not be found"); } } } else if(input.startsWith(FILE_PROPERTY_VARIABLE_PREFIX)){ Matcher matcher = rePattern.matcher(input); Resolver resolverObject = null; if (matcher.find()){ Class<? extends Resolver> resolverClass = resolverMap.get(matcher.group(RESOLVER_INDEX).toLowerCase()); if (resolverClass != null) { try { resolverObject = resolverClass.newInstance(); resolverObject.setVariable(matcher.group(3)); return resolverObject; } catch (IllegalAccessException | InstantiationException e) { throw new ResolverException("Resolver could not be initialized", e); } } else { throw new ResolverException("Resolver could not be found"); } } } Resolver resolver = new DefaultResolver(); resolver.setVariable(input); return resolver; }
Source:
public void generateOutputSchema(Database db) { if (m_outputSchema == null) { m_outputSchema = new NodeSchema(); } else { assert(getOutputSchema().size() == 0); } assert(m_children.size() == 1); m_children.get(0).generateOutputSchema(db); NodeSchema inputSchema = m_children.get(0).getOutputSchema(); TupleValueExpression tve = new TupleValueExpression(AbstractParsedStmt.TEMP_TABLE_NAME, AbstractParsedStmt.TEMP_TABLE_NAME, AbstractParsedStmt.WINDOWED_AGGREGATE_COLUMN_NAME, AbstractParsedStmt.WINDOWED_AGGREGATE_COLUMN_NAME, 0); tve.setExpressionType(ExpressionType.VALUE_TUPLE); tve.setValueType(m_windowedExpression.getValueType()); tve.setValueSize(m_windowedExpression.getValueSize()); tve.setColumnIndex(0); SchemaColumn aggCol = new SchemaColumn(tve.getTableName(), tve.getTableAlias(), tve.getColumnName(), tve.getColumnAlias(), tve); getOutputSchema().addColumn(aggCol); for (SchemaColumn col : inputSchema.getColumns()) { getOutputSchema().addColumn(col.clone()); } m_hasSignificantOutputSchema = true; }

Target:
public void generateOutputSchema(Database db) { if (m_outputSchema == null) { m_outputSchema = new NodeSchema(); } else { assert(getOutputSchema().size() == 0); } assert(m_children.size() == 1); m_children.get(0).generateOutputSchema(db); NodeSchema inputSchema = m_children.get(0).getOutputSchema(); TupleValueExpression tve = m_windowedExpression.getDisplayListExpression(); SchemaColumn aggCol = new SchemaColumn(tve.getTableName(), tve.getTableAlias(), tve.getColumnName(), tve.getColumnAlias(), tve); getOutputSchema().addColumn(aggCol); for (SchemaColumn col : inputSchema.getColumns()) { getOutputSchema().addColumn(col.clone()); } m_hasSignificantOutputSchema = true; }
Source:
private InputStream doLoadMetadataStreamByDiagramPath( final Path dPath ) { org.uberfire.java.nio.file.Path path = null; try { path = getDiagramsPath().resolve( getMetadataFileName( dPath.getFileName() ) ); } catch ( org.uberfire.java.nio.file.NoSuchFileException e ) { return null; } if ( null != path ) { try { return loadPath( path ); } catch ( Exception e ) { LOG.warn( "Cannot load metadata for [" + dPath.toString() + "].", e ); } } return null; }

Target:
private InputStream doLoadMetadataStreamByDiagramPath( final Path dPath ) { org.uberfire.java.nio.file.Path path = getDiagramsPath().resolve( getMetadataFileName( dPath.getFileName() ) ); if ( null != path ) { try { return loadPath( path ); } catch ( Exception e ) { LOG.warn( "Cannot load metadata for [" + dPath.toString() + "].", e ); } } return null; }
Source:
public ObservableList<Theme> getThemes() { return themes; }

Target:
public ObservableList<Theme> getThemes() { return this.themes; }
Source:
public void testFtpService() throws IOException { PreferenceManager.getDefaultSharedPreferences(service).edit() .putBoolean(FtpService.KEY_PREFERENCE_SECURE, false).commit(); service.onStartCommand(new Intent(FtpService.ACTION_START_FTPSERVER) .setPackage("com.amaze.filemanager") .putExtra(FtpService.TAG_STARTED_BY_TILE, false), 0, 0); assertTrue(FtpService.isRunning()); waitForServer(); FTPClient ftpClient = new FTPClient(); loginAndVerifyWith(ftpClient); testUploadWith(ftpClient); testDownloadWith(ftpClient); }

Target:
public void testFtpService() throws IOException { PreferenceManager.getDefaultSharedPreferences(service).edit() .putBoolean(FtpService.KEY_PREFERENCE_SECURE, false).commit(); service.onStartCommand(new Intent(FtpService.ACTION_START_FTPSERVER) .putExtra(FtpService.TAG_STARTED_BY_TILE, false), 0, 0); assertTrue(FtpService.isRunning()); waitForServer(); FTPClient ftpClient = new FTPClient(); loginAndVerifyWith(ftpClient); testUploadWith(ftpClient); testDownloadWith(ftpClient); }
Source:
public void initialize(Server server, Injector injector) { final ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS); root.addServlet(new ServletHolder(new DefaultServlet()), "/*"); final AuthConfig authConfig = injector.getInstance(AuthConfig.class); final ObjectMapper jsonMapper = injector.getInstance(Key.get(ObjectMapper.class, Json.class)); final AuthenticatorMapper authenticatorMapper = injector.getInstance(AuthenticatorMapper.class); AuthenticationUtils.addSecuritySanityCheckFilter(root, jsonMapper); AuthenticationUtils.addNoopAuthorizationFilters(root, UNSECURED_PATHS); AuthenticationUtils.addNoopAuthorizationFilters(root, authConfig.getUnsecuredPaths()); List<Authenticator> authenticators = authenticatorMapper.getAuthenticatorChain(); AuthenticationUtils.addAuthenticationFilterChain(root, authenticators); AuthenticationUtils.addAllowOptionsFilter(root, authConfig.isAllowUnauthenticatedHttpOptions()); JettyServerInitUtils.addExtensionFilters(root, injector); AuthenticationUtils.addPreResponseAuthorizationCheckFilter( root, authenticators, jsonMapper ); root.addFilter(GuiceFilter.class, "/*", null); final HandlerList handlerList = new HandlerList(); handlerList.setHandlers( new Handler[]{ JettyServerInitUtils.getJettyRequestLogHandler(), JettyServerInitUtils.wrapWithDefaultGzipHandler( root, serverConfig.getInflateBufferSize(), serverConfig.getCompressionLevel() ), new DefaultHandler() } ); server.setHandler(handlerList); }

Target:
public void initialize(Server server, Injector injector) { final ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS); root.addServlet(new ServletHolder(new DefaultServlet()), "/*"); final AuthConfig authConfig = injector.getInstance(AuthConfig.class); final ObjectMapper jsonMapper = injector.getInstance(Key.get(ObjectMapper.class, Json.class)); final AuthenticatorMapper authenticatorMapper = injector.getInstance(AuthenticatorMapper.class); AuthenticationUtils.addSecuritySanityCheckFilter(root, jsonMapper); AuthenticationUtils.addNoopAuthorizationFilters(root, UNSECURED_PATHS); AuthenticationUtils.addNoopAuthorizationFilters(root, authConfig.getUnsecuredPaths()); final List<Authenticator> authenticators = authenticatorMapper.getAuthenticatorChain(); AuthenticationUtils.addAuthenticationFilterChain(root, authenticators); AuthenticationUtils.addAllowOptionsFilter(root, authConfig.isAllowUnauthenticatedHttpOptions()); JettyServerInitUtils.addExtensionFilters(root, injector); AuthenticationUtils.addPreResponseAuthorizationCheckFilter( root, authenticators, jsonMapper ); root.addFilter(GuiceFilter.class, "/*", null); final HandlerList handlerList = new HandlerList(); handlerList.setHandlers( new Handler[]{ JettyServerInitUtils.getJettyRequestLogHandler(), JettyServerInitUtils.wrapWithDefaultGzipHandler( root, serverConfig.getInflateBufferSize(), serverConfig.getCompressionLevel() ), new DefaultHandler() } ); server.setHandler(handlerList); }
Source:
public IStatus run(IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, fTraceBoundsToUpdate.size()); TmfTraceElement tElement = null; while (fTraceBoundsToUpdate.isEmpty()) { tElement = fTraceBoundsToUpdate.remove(); subMonitor.setTaskName(getName()); if (subMonitor.isCanceled()) { return Status.CANCEL_STATUS; } ITmfTimestamp start = tElement.getStartTime(); ITmfTimestamp end = tElement.getEndTime(); if (start != null && end != null) { subMonitor.worked(1); continue; } IFolder folder = tElement.getTraceSupplementaryFolder(tElement.getSupplementaryFolderPath()); tElement.refreshSupplementaryFolder(); File f = folder.getFile(BOUNDS_FILE_NAME).getLocation().toFile(); tryReadBoundsFile(tElement, f); start = tElement.getStartTime(); end = tElement.getEndTime(); if (start == null || end == null) { extractBoundsFromTrace(tElement); tryWriteBoundsFile(subMonitor.newChild(1), tElement, folder, f); } else { subMonitor.worked(1); } } return Status.OK_STATUS; }

Target:
public IStatus run(IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, fTraceBoundsToUpdate.size()); TmfTraceElement tElement = null; while (!fTraceBoundsToUpdate.isEmpty()) { tElement = fTraceBoundsToUpdate.remove(); subMonitor.setTaskName(getName()); if (subMonitor.isCanceled()) { return Status.CANCEL_STATUS; } ITmfTimestamp start = tElement.getStartTime(); ITmfTimestamp end = tElement.getEndTime(); if (start != null && end != null) { subMonitor.worked(1); continue; } IFolder folder = tElement.getTraceSupplementaryFolder(tElement.getSupplementaryFolderPath()); tElement.refreshSupplementaryFolder(); File f = folder.getFile(BOUNDS_FILE_NAME).getLocation().toFile(); tryReadBoundsFile(tElement, f); start = tElement.getStartTime(); end = tElement.getEndTime(); if (start == null || end == null) { extractBoundsFromTrace(tElement); tryWriteBoundsFile(subMonitor.newChild(1), tElement, folder, f); } else { subMonitor.worked(1); } } return Status.OK_STATUS; }
Source:
public void inflateSubmissionDate() { mfDatePicker = MFDatePicker.newInsance(this); tvSubmissionDate.setText(MFDatePicker.getDatePickedAsString()); setSubmissionDate(); tvSubmissionDate.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mfDatePicker.show(getActivity().getSupportFragmentManager(), FragmentConstants .DFRAG_DATE_PICKER); } }); }

Target:
public void inflateSubmissionDate() { mfDatePicker = MFDatePicker.newInsance(this); tvSubmissionDate.setText(MFDatePicker.getDatePickedAsString()); setSubmissionDate(); }
Source:
public BatchSelectTableSink(TableSchema tableSchema) { this.tableSchema = SelectTableSinkSchemaConverter.convertTimeAttributeToRegularTimestamp( SelectTableSinkSchemaConverter.changeDefaultConversionClass(tableSchema)); TypeSerializer<Row> typeSerializer = (TypeSerializer<Row>) TypeInfoDataTypeConverter .fromDataTypeToTypeInfo(this.tableSchema.toRowDataType()) .createSerializer(new ExecutionConfig()); String accumulatorName = "tableResultCollect_" + UUID.randomUUID(); this.factory = new CollectSinkOperatorFactory<>(typeSerializer, accumulatorName); CollectSinkOperator<Row> operator = (CollectSinkOperator<Row>) factory.getOperator(); this.iterator = new CollectResultIterator<>(operator.getOperatorIdFuture(), typeSerializer, accumulatorName); }

Target:
public BatchSelectTableSink(TableSchema tableSchema) { super(tableSchema); }
Source:
public void registerJar(final URL url) { }

Target:
public void registerJar(final URL url) { throw new RuntimeException("Functionality not supported in this engine"); }