idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,069,656 | private boolean checkBounds(Unifier unifier, Inliner inliner, Warner warner) throws CouldNotResolveImportException {<NEW_LINE>Types types = unifier.types();<NEW_LINE>ListBuffer<Type> varsBuffer = new ListBuffer<>();<NEW_LINE>ListBuffer<Type> bindingsBuffer = new ListBuffer<>();<NEW_LINE>for (UTypeVar typeVar : typeVariables(unifier.getContext())) {<NEW_LINE>varsBuffer.add(inliner.inlineAsVar(typeVar));<NEW_LINE>bindingsBuffer.add(unifier.getBinding(typeVar.key()).type());<NEW_LINE>}<NEW_LINE>List<Type> vars = varsBuffer.toList();<NEW_LINE>List<Type> bindings = bindingsBuffer.toList();<NEW_LINE>for (UTypeVar typeVar : typeVariables(unifier.getContext())) {<NEW_LINE>List<Type> bounds = types.getBounds<MASK><NEW_LINE>bounds = types.subst(bounds, vars, bindings);<NEW_LINE>if (!types.isSubtypeUnchecked(unifier.getBinding(typeVar.key()).type(), bounds, warner)) {<NEW_LINE>logger.log(FINE, String.format("%s is not a subtype of %s", inliner.getBinding(typeVar.key()), bounds));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | (inliner.inlineAsVar(typeVar)); |
1,690,581 | protected Query doToQuery(SearchExecutionContext context) throws IOException {<NEW_LINE>Settings newSettings = new Settings(settings);<NEW_LINE>final Map<String, Float> resolvedFieldsAndWeights;<NEW_LINE>boolean isAllField;<NEW_LINE>if (fieldsAndWeights.isEmpty() == false) {<NEW_LINE>resolvedFieldsAndWeights = QueryParserHelper.resolveMappingFields(context, fieldsAndWeights);<NEW_LINE>isAllField = QueryParserHelper.hasAllFieldsWildcard(fieldsAndWeights.keySet());<NEW_LINE>} else {<NEW_LINE>List<String> defaultFields = context.defaultFields();<NEW_LINE>resolvedFieldsAndWeights = QueryParserHelper.resolveMappingFields(context<MASK><NEW_LINE>isAllField = QueryParserHelper.hasAllFieldsWildcard(defaultFields);<NEW_LINE>}<NEW_LINE>if (isAllField) {<NEW_LINE>newSettings.lenient(lenientSet ? settings.lenient() : true);<NEW_LINE>}<NEW_LINE>final SimpleQueryStringQueryParser sqp;<NEW_LINE>if (analyzer == null) {<NEW_LINE>sqp = new SimpleQueryStringQueryParser(resolvedFieldsAndWeights, flags, newSettings, context);<NEW_LINE>} else {<NEW_LINE>Analyzer luceneAnalyzer = context.getIndexAnalyzers().get(analyzer);<NEW_LINE>if (luceneAnalyzer == null) {<NEW_LINE>throw new QueryShardException(context, "[" + SimpleQueryStringBuilder.NAME + "] analyzer [" + analyzer + "] not found");<NEW_LINE>}<NEW_LINE>sqp = new SimpleQueryStringQueryParser(luceneAnalyzer, resolvedFieldsAndWeights, flags, newSettings, context);<NEW_LINE>}<NEW_LINE>sqp.setDefaultOperator(defaultOperator.toBooleanClauseOccur());<NEW_LINE>Query query = sqp.parse(queryText);<NEW_LINE>return Queries.maybeApplyMinimumShouldMatch(query, minimumShouldMatch);<NEW_LINE>} | , QueryParserHelper.parseFieldsAndWeights(defaultFields)); |
1,401,757 | private RatpackAdapter createAdapter(JavaExec task, ServiceRegistry services) {<NEW_LINE>Object builder;<NEW_LINE>if (gradleVersion.compareTo(V2_13) < 0) {<NEW_LINE>builder = Invoker.invokeParamless(Factory.class, getWorkerProcessBuilderFactory(services), "create");<NEW_LINE>Invoker.of("org.gradle.process.internal.worker.WorkerProcessBuilder", "worker", Action.class).invoke(builder, createServer(task));<NEW_LINE>} else {<NEW_LINE>Class<?> factoryClass;<NEW_LINE>if (gradleVersion.compareTo(V2_14) < 0) {<NEW_LINE>factoryClass = loadClass(getClass().getClassLoader(), "org.gradle.process.internal.WorkerProcessFactory");<NEW_LINE>} else {<NEW_LINE>factoryClass = loadClass(getClass().getClassLoader(), "org.gradle.process.internal.worker.WorkerProcessFactory");<NEW_LINE>}<NEW_LINE>builder = Invoker.of(factoryClass, "create", Action.class).invoke(getWorkerProcessBuilderFactory(services), createServer(task));<NEW_LINE>}<NEW_LINE>Class<?> workerProcessBuilderClass = loadClass(getClass().getClassLoader(), "org.gradle.process.internal.worker.WorkerProcessBuilder");<NEW_LINE>configureWorkerProcessBuilder(workerProcessBuilderClass, builder, task);<NEW_LINE>Object process = Invoker.invokeParamless(workerProcessBuilderClass, builder, "build");<NEW_LINE>Invoker.invokeParamless("org.gradle.process.internal.worker.WorkerProcess", process, "start");<NEW_LINE>Object connection = Invoker.<MASK><NEW_LINE>final RatpackAdapter adapter = (RatpackAdapter) Invoker.of("org.gradle.internal.remote.ObjectConnection", "addOutgoing", Class.class).invoke(connection, RatpackAdapter.class);<NEW_LINE>final Signal signal = new DefaultSignal();<NEW_LINE>Invoker.of("org.gradle.internal.remote.ObjectConnection", "addIncoming", Class.class, Object.class).invoke(connection, Signal.class, signal);<NEW_LINE>Invoker.invokeParamless("org.gradle.internal.remote.ObjectConnection", connection, "connect");<NEW_LINE>return new RatpackAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void start() {<NEW_LINE>adapter.start();<NEW_LINE>signal.await();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void reload() {<NEW_LINE>adapter.reload();<NEW_LINE>signal.await();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void buildError(Throwable throwable) {<NEW_LINE>adapter.buildError(throwable);<NEW_LINE>signal.await();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isRunning() {<NEW_LINE>boolean running = adapter.isRunning();<NEW_LINE>signal.await();<NEW_LINE>return running;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stop() {<NEW_LINE>adapter.stop();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | invokeParamless("org.gradle.process.internal.worker.WorkerProcess", process, "getConnection"); |
668,731 | final DBClusterParameterGroup executeCopyDBClusterParameterGroup(CopyDBClusterParameterGroupRequest copyDBClusterParameterGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(copyDBClusterParameterGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CopyDBClusterParameterGroupRequest> request = null;<NEW_LINE>Response<DBClusterParameterGroup> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CopyDBClusterParameterGroupRequestMarshaller().marshall(super.beforeMarshalling(copyDBClusterParameterGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CopyDBClusterParameterGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBClusterParameterGroup> responseHandler = new StaxResponseHandler<DBClusterParameterGroup>(new DBClusterParameterGroupStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,672,077 | final ImportApiResult executeImportApi(ImportApiRequest importApiRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(importApiRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ImportApiRequest> request = null;<NEW_LINE>Response<ImportApiResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ImportApiRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(importApiRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ImportApi");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ImportApiResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ImportApiResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
749,321 | ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>List<String> applicationIds = emc.ids(Application.class);<NEW_LINE>List<String> processIds = emc.ids(Process.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setProcessList(emc.fetch(this.listOrphanProcess(business, applicationIds), WoProcess.copier));<NEW_LINE>wo.setAgentList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoAgent.<MASK><NEW_LINE>wo.setBeginList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoBegin.copier), WoBegin.copier));<NEW_LINE>wo.setCancelList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoCancel.copier), WoCancel.copier));<NEW_LINE>wo.setChoiceList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoChoice.copier), WoChoice.copier));<NEW_LINE>wo.setDelayList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoDelay.copier), WoDelay.copier));<NEW_LINE>wo.setEmbedList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoEmbed.copier), WoEmbed.copier));<NEW_LINE>wo.setEndList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoEnd.copier), WoEnd.copier));<NEW_LINE>wo.setInvokeList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoInvoke.copier), WoInvoke.copier));<NEW_LINE>wo.setManualList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoManual.copier), WoManual.copier));<NEW_LINE>wo.setMergeList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoMerge.copier), WoMerge.copier));<NEW_LINE>wo.setParallelList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoParallel.copier), WoParallel.copier));<NEW_LINE>wo.setServiceList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoService.copier), WoService.copier));<NEW_LINE>wo.setSplitList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoSplit.copier), WoSplit.copier));<NEW_LINE>wo.setRouteList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoRoute.copier), WoRoute.copier));<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | copier), WoAgent.copier)); |
1,842,456 | public static NdConstant create(Nd nd, Constant constant) {<NEW_LINE>if (constant == Constant.NotAConstant) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>switch(constant.typeID()) {<NEW_LINE>case TypeIds.T_boolean:<NEW_LINE>return NdConstantBoolean.create(nd, constant.booleanValue());<NEW_LINE>case TypeIds.T_byte:<NEW_LINE>return NdConstantByte.create(nd, constant.byteValue());<NEW_LINE>case TypeIds.T_char:<NEW_LINE>return NdConstantChar.create(<MASK><NEW_LINE>case TypeIds.T_double:<NEW_LINE>return NdConstantDouble.create(nd, constant.doubleValue());<NEW_LINE>case TypeIds.T_float:<NEW_LINE>return NdConstantFloat.create(nd, constant.floatValue());<NEW_LINE>case TypeIds.T_int:<NEW_LINE>return NdConstantInt.create(nd, constant.intValue());<NEW_LINE>case TypeIds.T_long:<NEW_LINE>return NdConstantLong.create(nd, constant.longValue());<NEW_LINE>case TypeIds.T_short:<NEW_LINE>return NdConstantShort.create(nd, constant.shortValue());<NEW_LINE>case TypeIds.T_JavaLangString:<NEW_LINE>return NdConstantString.create(nd, constant.stringValue());<NEW_LINE>default:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>throw new IllegalArgumentException("Unknown typeID() " + constant.typeID());<NEW_LINE>}<NEW_LINE>} | nd, constant.charValue()); |
574,023 | public void domainObjectRestored(DataTypeManagerDomainObject domainObject) {<NEW_LINE>boolean reload = true;<NEW_LINE>String objectType = "domain object";<NEW_LINE>if (domainObject instanceof Program) {<NEW_LINE>objectType = "program";<NEW_LINE>} else if (domainObject instanceof DataTypeArchive) {<NEW_LINE>objectType = "data type archive";<NEW_LINE>}<NEW_LINE>DataTypeManager dtm = ((StackEditorModel) model).getOriginalDataTypeManager();<NEW_LINE>Composite originalDt = ((<MASK><NEW_LINE>if (originalDt instanceof StackFrameDataType) {<NEW_LINE>StackFrameDataType sfdt = (StackFrameDataType) originalDt;<NEW_LINE>Function function = sfdt.getFunction();<NEW_LINE>if (function.isDeleted()) {<NEW_LINE>// Cancel Editor.<NEW_LINE>provider.dispose();<NEW_LINE>PluginTool tool = ((StackEditorProvider) provider).getPlugin().getTool();<NEW_LINE>tool.setStatusInfo("Stack Editor was closed for " + provider.getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StackFrame stack = function.getStackFrame();<NEW_LINE>StackFrameDataType newSfdt = new StackFrameDataType(stack, dtm);<NEW_LINE>if (!newSfdt.equals(((StackEditorModel) model).getViewComposite())) {<NEW_LINE>originalDt = newSfdt;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>((StackEditorModel) model).updateAndCheckChangeState();<NEW_LINE>if (model.hasChanges()) {<NEW_LINE>String name = ((StackEditorModel) model).getTypeName();<NEW_LINE>// The user has modified the structure so prompt for whether or<NEW_LINE>// not to reload the structure.<NEW_LINE>String question = "The " + objectType + " \"" + domainObject.getName() + "\" has been restored.\n" + "\"" + model.getCompositeName() + "\" may have changed outside the editor.\n" + "Discard edits & reload the " + name + " Editor?";<NEW_LINE>String title = "Reload " + name + " Editor?";<NEW_LINE>int response = OptionDialog.showYesNoDialogWithNoAsDefaultButton(this, title, question);<NEW_LINE>if (response != 1) {<NEW_LINE>reload = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (reload) {<NEW_LINE>cancelCellEditing();<NEW_LINE>// TODO<NEW_LINE>// boolean lockState = model.isLocked(); // save the lock state<NEW_LINE>// reload the structure<NEW_LINE>model.load(originalDt);<NEW_LINE>// model.setLocked(lockState); // restore the lock state<NEW_LINE>model.updateAndCheckChangeState();<NEW_LINE>} else {<NEW_LINE>((StackEditorModel) model).refresh();<NEW_LINE>}<NEW_LINE>} | StackEditorModel) model).getOriginalComposite(); |
1,240,105 | public Object rebuild(java.util.List<Editable> editables) throws UpdateFailedException {<NEW_LINE>Backup backup = new Backup();<NEW_LINE>//<NEW_LINE>// Fix-up _descriptor if necessary<NEW_LINE>//<NEW_LINE>if (_descriptor.template.length() > 0) {<NEW_LINE>TemplateDescriptor templateDescriptor = getRoot().findServiceTemplateDescriptor(_descriptor.template);<NEW_LINE>java.util.Set<String> parameters = new java.util.HashSet<>(templateDescriptor.parameters);<NEW_LINE>if (!parameters.equals(_descriptor.parameterValues.keySet())) {<NEW_LINE>backup.parameterValues = _descriptor.parameterValues;<NEW_LINE>_descriptor.parameterValues = Editor.makeParameterValues(<MASK><NEW_LINE>editables.add(getEnclosingEditable());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Communicator communicator = (Communicator) _parent;<NEW_LINE>Communicator.Services services = communicator.getServices();<NEW_LINE>ServiceInstance newService = null;<NEW_LINE>try {<NEW_LINE>newService = (ServiceInstance) services.createChild(_descriptor);<NEW_LINE>} catch (UpdateFailedException e) {<NEW_LINE>if (backup.parameterValues != null) {<NEW_LINE>_descriptor.parameterValues = backup.parameterValues;<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>backup.clone = (ServiceInstance) clone();<NEW_LINE>} catch (CloneNotSupportedException e) {<NEW_LINE>assert false;<NEW_LINE>}<NEW_LINE>reset(newService);<NEW_LINE>if (backup.parameterValues != null) {<NEW_LINE>editables.add(getEnclosingEditable());<NEW_LINE>}<NEW_LINE>getRoot().getTreeModel().nodeChanged(this);<NEW_LINE>return backup;<NEW_LINE>} | _descriptor.parameterValues, templateDescriptor.parameters); |
477,012 | // Treat Emacs profile specially in order to fix #191895<NEW_LINE>private void emacsProfileFix(final JTextComponent incSearchTextField) {<NEW_LINE>class JumpOutOfSearchAction extends AbstractAction {<NEW_LINE><NEW_LINE>private final String actionName;<NEW_LINE><NEW_LINE>public JumpOutOfSearchAction(String n) {<NEW_LINE>actionName = n;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>looseFocus();<NEW_LINE>if (getActualTextComponent() != null) {<NEW_LINE>ActionEvent ev = new ActionEvent(getActualTextComponent(), e.getID(), e.getActionCommand(), e.getModifiers());<NEW_LINE>Action action = getActualTextComponent().getActionMap().get(actionName);<NEW_LINE>action.actionPerformed(ev);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>String actionName = "caret-begin-line";<NEW_LINE>Action a1 = new JumpOutOfSearchAction(actionName);<NEW_LINE>incSearchTextField.getActionMap().put(actionName, a1);<NEW_LINE>// NOI18N<NEW_LINE>actionName = "caret-end-line";<NEW_LINE>Action a2 = new JumpOutOfSearchAction(actionName);<NEW_LINE>incSearchTextField.getActionMap().put(actionName, a2);<NEW_LINE>// NOI18N<NEW_LINE>incSearchTextField.getInputMap().// NOI18N<NEW_LINE>put(// NOI18N<NEW_LINE>KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_MASK, false), "caret-up-alt");<NEW_LINE>// NOI18N<NEW_LINE>actionName = "caret-up";<NEW_LINE>Action a3 = new JumpOutOfSearchAction(actionName);<NEW_LINE>// NOI18N<NEW_LINE>incSearchTextField.getActionMap().put("caret-up-alt", a3);<NEW_LINE>// NOI18N<NEW_LINE>incSearchTextField.getInputMap().// NOI18N<NEW_LINE>put(// NOI18N<NEW_LINE>KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK, false), "caret-down-alt");<NEW_LINE>// NOI18N<NEW_LINE>actionName = "caret-down";<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>incSearchTextField.getActionMap().put("caret-down-alt", a4);<NEW_LINE>} | Action a4 = new JumpOutOfSearchAction(actionName); |
345,184 | public boolean applyTo(DomainObject obj, TaskMonitor monitor) {<NEW_LINE>monitor.setMessage("ApplyDiffTask starting...");<NEW_LINE>applied = false;<NEW_LINE>final ProgramLocation origLocation = plugin.getProgramLocation();<NEW_LINE>if (!plugin.isTaskInProgress()) {<NEW_LINE>plugin.setTaskInProgress(true);<NEW_LINE>String statusMsg = "One or more differences couldn't be applied.";<NEW_LINE>title = "Program Diff: One or more differences couldn't be applied.";<NEW_LINE>applyMsg = null;<NEW_LINE>setStatusMsg(null);<NEW_LINE>try {<NEW_LINE>AutoAnalysisManager autoAnalysisManager = AutoAnalysisManager.getAnalysisManager(plugin.getFirstProgram());<NEW_LINE>boolean merged = autoAnalysisManager.scheduleWorker(this, null, false, monitor);<NEW_LINE>if (merged) {<NEW_LINE>statusMsg = "Apply differences has finished." + " If your expected change didn't occur, check your Diff Apply Settings.";<NEW_LINE>title = "Program Diff: Apply differences has finished.";<NEW_LINE>applied = true;<NEW_LINE>} else {<NEW_LINE>applyMsg = diffControl.getApplyMessage();<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>applyMsg = "Unexpected InterruptedException\n" + diffControl.getApplyMessage();<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>Throwable t = e.getCause();<NEW_LINE>String message = "";<NEW_LINE>// Protect against dereferencing the getCause call above, which may return null.<NEW_LINE>if (t != null) {<NEW_LINE>String excMessage = t.getMessage();<NEW_LINE>if (excMessage != null && excMessage.length() > 0) {<NEW_LINE>message = excMessage + "\n";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Msg.showError(this, plugin.getListingPanel(), "Error Applying Diff", "An error occurred while applying differences.\n" + "Only some of the differences may have been applied.", (t != null) ? t : e);<NEW_LINE>applyMsg = message + diffControl.getApplyMessage();<NEW_LINE>} catch (CancelledException e) {<NEW_LINE>statusMsg = "User cancelled \"Apply Differences\". " + "Differences were only partially applied.";<NEW_LINE>applyMsg = diffControl.getApplyMessage();<NEW_LINE>} finally {<NEW_LINE>setStatusMsg(statusMsg);<NEW_LINE>plugin.getTool().setStatusInfo(statusMsg);<NEW_LINE>plugin.setTaskInProgress(false);<NEW_LINE>Runnable r = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>plugin.adjustDiffDisplay();<NEW_LINE>plugin.firePluginEvent(new ProgramSelectionPluginEvent(plugin.getName(), plugin.getCurrentSelection(), plugin.getCurrentProgram()));<NEW_LINE>plugin.programLocationChanged(origLocation, null);<NEW_LINE>if (applyMsg != null && applyMsg.length() > 0) {<NEW_LINE>ReadTextDialog detailsDialog <MASK><NEW_LINE>plugin.getTool().showDialog(detailsDialog, plugin.getListingPanel());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// // The events were disabled while doing apply Diff. Now re-enable them by firing object restored event.<NEW_LINE>// ((DomainObjectAdapter)currentProgram).fireEvent(new DomainObjectChangeRecord(<NEW_LINE>// DomainObject.DO_OBJECT_RESTORED));<NEW_LINE>// ((DomainObjectAdapter)currentProgram).flushEvents();<NEW_LINE>if (!monitor.isCancelled()) {<NEW_LINE>SwingUtilities.invokeLater(r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return applied;<NEW_LINE>} | = new ReadTextDialog(title, applyMsg); |
1,743,171 | public TrieMap<K, V> putChildTrie(Iterable<K> key, TrieMap<K, V> child) {<NEW_LINE>TrieMap<K, V> parentTrie = null;<NEW_LINE>TrieMap<K, V> curTrie = this;<NEW_LINE>Iterator<K> keyIter = key.iterator();<NEW_LINE>// go through each element<NEW_LINE>while (keyIter.hasNext()) {<NEW_LINE>K element = keyIter.next();<NEW_LINE>boolean isLast = !keyIter.hasNext();<NEW_LINE>if (curTrie.children == null) {<NEW_LINE>// Generics.newConcurrentHashMap();<NEW_LINE>curTrie.children = new ConcurrentHashMap<>();<NEW_LINE>}<NEW_LINE>parentTrie = curTrie;<NEW_LINE>curTrie = curTrie.children.get(element);<NEW_LINE>if (isLast) {<NEW_LINE>parentTrie.<MASK><NEW_LINE>} else if (curTrie == null) {<NEW_LINE>parentTrie.children.put(element, curTrie = new TrieMap<>());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (parentTrie == null) {<NEW_LINE>throw new IllegalArgumentException("Cannot put a child trie with no keys");<NEW_LINE>}<NEW_LINE>return curTrie;<NEW_LINE>} | children.put(element, child); |
517,120 | public MaryData process(MaryData d) throws Exception {<NEW_LINE>String phoneString = d.getPlainText();<NEW_LINE>MaryData result = new MaryData(getOutputType(), d.getLocale(), true);<NEW_LINE>Document doc = result.getDocument();<NEW_LINE>Element root = doc.getDocumentElement();<NEW_LINE>root.setAttribute("xml:lang", MaryUtils.locale2xmllang(d.getLocale()));<NEW_LINE>Element insertHere = root;<NEW_LINE>Voice defaultVoice = d.getDefaultVoice();<NEW_LINE>if (defaultVoice != null) {<NEW_LINE>Element voiceElement = MaryXML.createElement(doc, MaryXML.VOICE);<NEW_LINE>voiceElement.setAttribute("name", defaultVoice.getName());<NEW_LINE>root.appendChild(voiceElement);<NEW_LINE>insertHere = voiceElement;<NEW_LINE>}<NEW_LINE>int cumulDur = 0;<NEW_LINE>boolean isFirst = true;<NEW_LINE>StringTokenizer stTokens = new StringTokenizer(phoneString);<NEW_LINE>while (stTokens.hasMoreTokens()) {<NEW_LINE>Element token = MaryXML.createElement(doc, MaryXML.TOKEN);<NEW_LINE>insertHere.appendChild(token);<NEW_LINE>String tokenPhonemes = stTokens.nextToken();<NEW_LINE>token.setAttribute("ph", tokenPhonemes);<NEW_LINE>StringTokenizer stSyllables = new StringTokenizer(tokenPhonemes, "-_");<NEW_LINE>while (stSyllables.hasMoreTokens()) {<NEW_LINE>Element syllable = MaryXML.createElement(doc, MaryXML.SYLLABLE);<NEW_LINE>token.appendChild(syllable);<NEW_LINE>String syllablePhonemes = stSyllables.nextToken();<NEW_LINE>syllable.setAttribute("ph", syllablePhonemes);<NEW_LINE>int stress = 0;<NEW_LINE>if (syllablePhonemes.startsWith("'"))<NEW_LINE>stress = 1;<NEW_LINE>else if (syllablePhonemes.startsWith(","))<NEW_LINE>stress = 2;<NEW_LINE>if (stress != 0) {<NEW_LINE>// Simplified: Give a "pressure accent" do stressed syllables<NEW_LINE>syllable.setAttribute("accent", "*");<NEW_LINE>token.setAttribute("accent", "*");<NEW_LINE>}<NEW_LINE>Allophone[] phones = allophoneSet.splitIntoAllophones(syllablePhonemes);<NEW_LINE>for (int i = 0; i < phones.length; i++) {<NEW_LINE>Element ph = MaryXML.createElement(doc, MaryXML.PHONE);<NEW_LINE>ph.setAttribute("p", phones[i].name());<NEW_LINE>int dur = 70;<NEW_LINE>if (phones[i].isVowel()) {<NEW_LINE>dur = 100;<NEW_LINE>if (stress == 1)<NEW_LINE>dur *= 1.5;<NEW_LINE>else if (stress == 2)<NEW_LINE>dur *= 1.2;<NEW_LINE>}<NEW_LINE>ph.setAttribute("d"<MASK><NEW_LINE>cumulDur += dur;<NEW_LINE>ph.setAttribute("end", String.valueOf(cumulDur));<NEW_LINE>syllable.appendChild(ph);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Element boundary = MaryXML.createElement(doc, MaryXML.BOUNDARY);<NEW_LINE>boundary.setAttribute("bi", "4");<NEW_LINE>boundary.setAttribute("duration", "400");<NEW_LINE>insertHere.appendChild(boundary);<NEW_LINE>return result;<NEW_LINE>} | , String.valueOf(dur)); |
216,723 | private void generateFastIsSuperclassFunction(String className) {<NEW_LINE>List<TagRegistry.Range> ranges = tagRegistry.getRanges(className);<NEW_LINE>if (ranges.isEmpty()) {<NEW_LINE>codeWriter.println("return INT32_C(0);");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String tagName = context.getNames().forMemberField(new FieldReference(RuntimeClass.class<MASK><NEW_LINE>codeWriter.println("int32_t tag = cls->" + tagName + ";");<NEW_LINE>int lower = ranges.get(0).lower;<NEW_LINE>int upper = ranges.get(ranges.size() - 1).upper;<NEW_LINE>codeWriter.println("if (tag < " + lower + " || tag >= " + upper + ") return INT32_C(0);");<NEW_LINE>for (int i = 1; i < ranges.size(); ++i) {<NEW_LINE>lower = ranges.get(i - 1).upper;<NEW_LINE>upper = ranges.get(i).lower;<NEW_LINE>codeWriter.println("if (tag >= " + lower + " && tag < " + upper + ") return INT32_C(0);");<NEW_LINE>}<NEW_LINE>codeWriter.println("return INT32_C(1);");<NEW_LINE>} | .getName(), "tag")); |
261,124 | public void verifyGqrViewComment(FeedbackQuestionAttributes question, FeedbackResponseCommentAttributes comment, FeedbackResponseAttributes response, Collection<InstructorAttributes> instructors, Collection<StudentAttributes> students, boolean isGroupedByTeam) {<NEW_LINE>selectViewType(GQR_VIEW);<NEW_LINE>FeedbackParticipantType giverType = question.getGiverType();<NEW_LINE>WebElement giverPanel = getUserPanel(giverType, response.getGiver(), instructors, students, isGroupedByTeam, true);<NEW_LINE>WebElement questionPanel = getQuestionPanel(giverPanel, question.getQuestionNumber());<NEW_LINE>String recipientTeam = getTeam(question.getRecipientType(), response.getRecipient(), students);<NEW_LINE>String recipientName = getName(question.getRecipientType(), response.<MASK><NEW_LINE>WebElement responseRow = getResponseRow(questionPanel, recipientTeam, recipientName);<NEW_LINE>verifyResponseRowComment(responseRow, comment, instructors, students);<NEW_LINE>} | getRecipient(), instructors, students); |
1,589,355 | public void testTimerReferencesSurvivePassivation() {<NEW_LINE>final String method = "testTimerReferencesSurvivePassivation";<NEW_LINE>if (svLogger.isLoggable(Level.FINEST)) {<NEW_LINE>svLogger.logp(Level.FINEST, CLASSNAME, method, "creating 4 timers via SFSB");<NEW_LINE>}<NEW_LINE>// create a bunch of timers<NEW_LINE>Timer timer1 = ivBean.createTimer("timer1");<NEW_LINE>Timer timer2 = ivBean.createTimer("timer2");<NEW_LINE>Timer timer3 = ivBean.createTimer("timer3");<NEW_LINE>Timer timer4 = ivBean.createTimer("timer4");<NEW_LINE>assertEquals("Problem occurred while creating timers", 4, ivBean.getAllTimers().size());<NEW_LINE>// for the heck of it, cancel one of them - this will also verify<NEW_LINE>// passivation occurred<NEW_LINE>ivBean.resetPassivationFlag();<NEW_LINE>ivBean.cancelTimer("timer3");<NEW_LINE>if (svLogger.isLoggable(Level.FINEST)) {<NEW_LINE>svLogger.logp(Level.FINEST, CLASSNAME, method, "canceled 1 timer via SFSB, leaving 3");<NEW_LINE>}<NEW_LINE>assertTrue("Did not passivate", ivBean.hasBeenPassivated());<NEW_LINE>// verify that the timer collection and current timer are correct<NEW_LINE>Timer curTimer = ivBean.getCurrentTimer();<NEW_LINE>Collection<Timer> timers = ivBean.getAllTimers();<NEW_LINE>if (svLogger.isLoggable(Level.FINEST)) {<NEW_LINE>svLogger.logp(Level.FINEST, CLASSNAME, method, "SFSB.ivCurrentTimer == " + curTimer);<NEW_LINE>svLogger.logp(Level.FINEST, CLASSNAME, method, "Timer collection returned from SFSB after passivation:");<NEW_LINE>for (Timer t : timers) {<NEW_LINE>svLogger.logp(Level.FINEST, CLASSNAME, method, "\ttimer: {0}", new Object[] { t });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assertEquals("SFSB Current timer is incorrect", timer4, curTimer);<NEW_LINE>assertEquals("Unexpected number of timers in SFSB timer collection.", 3, timers.size());<NEW_LINE>assertTrue("SFSB did not maintain reference to timer1."<MASK><NEW_LINE>assertTrue("SFSB did not maintain reference to timer2.", timers.contains(timer2));<NEW_LINE>assertFalse("SFSB maintained reference to timer3, when it should have been removed.", timers.contains(timer3));<NEW_LINE>assertTrue("SFSB did not maintain reference to timer4.", timers.contains(timer4));<NEW_LINE>} | , timers.contains(timer1)); |
203,889 | private void statInit() {<NEW_LINE>labelValue.setText(Msg.getMsg(Env.getCtx(), "Value"));<NEW_LINE>fieldValue.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldValue.addActionListener(this);<NEW_LINE>labelName.setText(Msg.getMsg(Env.getCtx(), "Name"));<NEW_LINE>fieldName.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldName.addActionListener(this);<NEW_LINE>// start: metas: c.ghita@metas.ro : 01436<NEW_LINE>labelName2.setText(Msg.getMsg(Env.getCtx(), "Name2"));<NEW_LINE>fieldName2.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldName2.addActionListener(this);<NEW_LINE>// end: metas: c.ghita@metas.ro : 01436<NEW_LINE>labelContact.setText(Msg.getMsg(Env.getCtx(), "Contact"));<NEW_LINE>fieldContact.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldContact.addActionListener(this);<NEW_LINE>labelEMail.setText(Msg.getMsg(Env.getCtx(), "EMail"));<NEW_LINE>fieldEMail.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldEMail.addActionListener(this);<NEW_LINE>labelPostal.setText(Msg.getMsg(Env.getCtx(), "Postal"));<NEW_LINE>fieldPostal.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldPostal.addActionListener(this);<NEW_LINE>labelPhone.setText(Msg.translate(Env.getCtx(), "Phone"));<NEW_LINE>fieldPhone.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldPhone.addActionListener(this);<NEW_LINE>labelSearch.setText(Msg.translate(Env.getCtx(), "search"));<NEW_LINE>fieldSearch.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldSearch.addActionListener(this);<NEW_LINE>// metas<NEW_LINE>// labelSponsorNo.setText(Msg.translate(Env.getCtx(), "Sponsor"));<NEW_LINE>// fieldSponsorNo.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>// fieldSponsorNo.addActionListener(this);<NEW_LINE>// metas end<NEW_LINE>checkAND.setText(Msg.getMsg(Env.getCtx(), "SearchAND"));<NEW_LINE>checkAND.setToolTipText(Msg.getMsg(Env.getCtx(), "SearchANDInfo"));<NEW_LINE>checkAND.setSelected(true);<NEW_LINE>checkAND.addActionListener(this);<NEW_LINE>if (m_isSOTrx) {<NEW_LINE>checkCustomer.setText(Msg.getMsg(Env.getCtx(), "OnlyCustomers"));<NEW_LINE>} else {<NEW_LINE>checkCustomer.setText(Msg.getMsg(Env.getCtx(), "OnlyVendors"));<NEW_LINE>}<NEW_LINE>checkCustomer.setSelected(true);<NEW_LINE>checkCustomer.setFocusable(false);<NEW_LINE>checkCustomer.setRequestFocusEnabled(false);<NEW_LINE>checkCustomer.addActionListener(this);<NEW_LINE>//<NEW_LINE>parameterPanel.setLayout(new ALayout());<NEW_LINE>parameterPanel.setPreferredSize(<MASK><NEW_LINE>//<NEW_LINE>parameterPanel.add(labelValue, new ALayoutConstraint(0, 0));<NEW_LINE>parameterPanel.add(fieldValue, null);<NEW_LINE>parameterPanel.add(labelContact, null);<NEW_LINE>parameterPanel.add(fieldContact, null);<NEW_LINE>parameterPanel.add(labelPhone, null);<NEW_LINE>parameterPanel.add(fieldPhone, null);<NEW_LINE>parameterPanel.add(checkCustomer, null);<NEW_LINE>//<NEW_LINE>parameterPanel.add(labelName, new ALayoutConstraint(1, 0));<NEW_LINE>parameterPanel.add(fieldName, null);<NEW_LINE>// start: metas: c.ghita@metas.ro : 01436<NEW_LINE>parameterPanel.add(labelName2, null);<NEW_LINE>parameterPanel.add(fieldName2, null);<NEW_LINE>// end: metas: c.ghita@metas.ro : 01436<NEW_LINE>parameterPanel.add(labelEMail, null);<NEW_LINE>parameterPanel.add(fieldEMail, null);<NEW_LINE>parameterPanel.add(checkAND, null);<NEW_LINE>// metas-2009_0017_AP1_G42<NEW_LINE>InfoBPartner_RadiusSearch.customize(this);<NEW_LINE>parameterPanel.add(labelPostal, new ALayoutConstraint(3, 0));<NEW_LINE>parameterPanel.add(fieldPostal, null);<NEW_LINE>parameterPanel.add(labelSearch, null);<NEW_LINE>parameterPanel.add(fieldSearch, null);<NEW_LINE>} | new Dimension(1200, 100)); |
1,571,180 | public WorkflowExportResponseRef exportRef(WorkflowExportRequestRef workflowExportRequestRef) throws ExternalOperationFailedException {<NEW_LINE>String userName = workflowExportRequestRef.getUserName();<NEW_LINE>// todo<NEW_LINE>long flowId = workflowExportRequestRef.getAppId();<NEW_LINE>Long projectId = workflowExportRequestRef.getProjectId();<NEW_LINE>String projectName = workflowExportRequestRef.getProjectName();<NEW_LINE>RequestExportWorkflow requestExportWorkflow = new RequestExportWorkflow(userName, flowId, projectId, projectName, BDPJettyServerHelper.gson().toJson(workflowExportRequestRef.getWorkspace()), workflowExportRequestRef.getDSSLabels());<NEW_LINE>ResponseExportWorkflow responseExportWorkflow = null;<NEW_LINE>try {<NEW_LINE>Sender sender = DSSSenderServiceFactory.getOrCreateServiceInstance().getWorkflowSender(workflowExportRequestRef.getDSSLabels());<NEW_LINE>responseExportWorkflow = (ResponseExportWorkflow) sender.ask(requestExportWorkflow);<NEW_LINE>} catch (final Exception t) {<NEW_LINE>DSSExceptionUtils.dealErrorException(60025, "failed to get rpc message", t, ExternalOperationFailedException.class);<NEW_LINE>}<NEW_LINE>if (null != responseExportWorkflow) {<NEW_LINE>WorkflowExportResponseRef workflowExportResponseRef = new WorkflowExportResponseRef();<NEW_LINE>workflowExportResponseRef.setFlowID(responseExportWorkflow.flowID());<NEW_LINE>workflowExportResponseRef.setResourceId(responseExportWorkflow.resourceId());<NEW_LINE>workflowExportResponseRef.setVersion(responseExportWorkflow.version());<NEW_LINE>workflowExportResponseRef.addResponse("resourceId", responseExportWorkflow.resourceId());<NEW_LINE>workflowExportResponseRef.addResponse("version", responseExportWorkflow.version());<NEW_LINE>workflowExportResponseRef.addResponse("flowID", responseExportWorkflow.flowID());<NEW_LINE>return workflowExportResponseRef;<NEW_LINE>} else {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>} | ExternalOperationFailedException(100085, "Error ask workflow to export!", null); |
1,636,512 | private static AbstractConfigObject createValueUnderPath(Path path, AbstractConfigValue value) {<NEW_LINE>// for path foo.bar, we are creating<NEW_LINE>// { "foo" : { "bar" : value } }<NEW_LINE>List<String> keys = new ArrayList<>();<NEW_LINE>String key = path.first();<NEW_LINE>Path remaining = path.remainder();<NEW_LINE>while (key != null) {<NEW_LINE>keys.add(key);<NEW_LINE>if (remaining == null) {<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>key = remaining.first();<NEW_LINE>remaining = remaining.remainder();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// the withComments(null) is to ensure comments are only<NEW_LINE>// on the exact leaf node they apply to.<NEW_LINE>// a comment before "foo.bar" applies to the full setting<NEW_LINE>// "foo.bar" not also to "foo"<NEW_LINE>ListIterator<String> i = keys.<MASK><NEW_LINE>String deepest = i.previous();<NEW_LINE>AbstractConfigObject o = new SimpleConfigObject(value.origin().withComments(null), Collections.singletonMap(deepest, value));<NEW_LINE>while (i.hasPrevious()) {<NEW_LINE>Map<String, AbstractConfigValue> m = Collections.singletonMap(i.previous(), o);<NEW_LINE>o = new SimpleConfigObject(value.origin().withComments(null), m);<NEW_LINE>}<NEW_LINE>return o;<NEW_LINE>} | listIterator(keys.size()); |
1,544,583 | public ContentLayoutData layoutContent(@NotNull final C c, @NotNull final D d, @NotNull final Rectangle bounds) {<NEW_LINE>final ContentLayoutData layoutData = new ContentLayoutData(5);<NEW_LINE>final boolean ltr = isLeftToRight(c, d);<NEW_LINE>final int gap = getGap();<NEW_LINE>final Dimension lps = getPreferredSize(c, d, new Dimension(bounds.width, bounds.height), LEADING);<NEW_LINE>final Dimension tps = getPreferredSize(c, d, new Dimension(Math.max(0, bounds.width - lps.width - gap), bounds.height), TRAILING);<NEW_LINE>final Dimension ops = getPreferredSize(c, d, new Dimension(Math.max(0, bounds.width - lps.width - gap - tps.width - gap), bounds.height), OVERFLOW);<NEW_LINE>int x = ltr ? bounds.x : Math.max(bounds.x, bounds.x + bounds.width - lps.width - gap - ops.width - gap - tps.width);<NEW_LINE>final int y = bounds.y;<NEW_LINE>int width = Math.min(bounds.width, lps.width + gap + ops.width + gap + tps.width);<NEW_LINE>final int height = bounds.height;<NEW_LINE>if (!isEmpty(c, d, LEADING)) {<NEW_LINE>layoutData.put(LEADING, new Rectangle(x, y, lps.width, height));<NEW_LINE>x += lps.width + gap;<NEW_LINE>width -= lps.width + gap;<NEW_LINE>}<NEW_LINE>if (!isEmpty(c, d, TRAILING)) {<NEW_LINE>final int tx = Math.max(x, x + width - tps.width);<NEW_LINE>layoutData.put(TRAILING, new Rectangle(tx, y, tps.width, height));<NEW_LINE>width -= tps.width + gap;<NEW_LINE>}<NEW_LINE>if (!isEmpty(c, d, OVERFLOW)) {<NEW_LINE>layoutData.put(OVERFLOW, new Rectangle(x<MASK><NEW_LINE>}<NEW_LINE>return layoutData;<NEW_LINE>} | , y, width, height)); |
20,920 | private void loadNode454() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Write_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Write_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Write_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Write_InputArguments, Identifiers.HasProperty, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Write.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>FileHandle</Name><DataType><Identifier>i=7</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>Data</Name><DataType><Identifier>i=15</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
1,631,135 | public com.amazonaws.services.eventbridge.model.InvalidStateException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.eventbridge.model.InvalidStateException invalidStateException = new com.amazonaws.services.eventbridge.model.InvalidStateException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return invalidStateException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
185,164 | private boolean saveAsRocksim(File file) {<NEW_LINE>if (prefs.getShowRockSimFormatWarning()) {<NEW_LINE>// Show Rocksim format warning<NEW_LINE>JPanel panel = <MASK><NEW_LINE>panel.add(new StyledLabel(trans.get("SaveRktWarningDialog.txt1")), "wrap");<NEW_LINE>final JCheckBox check = new JCheckBox(trans.get("SaveRktWarningDialog.donotshow"));<NEW_LINE>check.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>prefs.setShowRockSimFormatWarning(!check.isSelected());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>panel.add(check);<NEW_LINE>int sel = // title<NEW_LINE>JOptionPane.// title<NEW_LINE>showOptionDialog(// title<NEW_LINE>null, // title<NEW_LINE>panel, // icon<NEW_LINE>"", // icon<NEW_LINE>JOptionPane.OK_CANCEL_OPTION, // icon<NEW_LINE>JOptionPane.WARNING_MESSAGE, // options<NEW_LINE>null, // default option<NEW_LINE>null, null);<NEW_LINE>if (sel == 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StorageOptions options = new StorageOptions();<NEW_LINE>options.setFileType(StorageOptions.FileType.ROCKSIM);<NEW_LINE>return saveRocksimFile(file, options);<NEW_LINE>} | new JPanel(new MigLayout()); |
1,300,417 | private void registerHandlers(RaftServerProtocol protocol) {<NEW_LINE>protocol.registerOpenSessionHandler(request -> runOnContextIfReady(() -> role.onOpenSession(request), OpenSessionResponse::builder));<NEW_LINE>protocol.registerCloseSessionHandler(request -> runOnContextIfReady(() -> role.onCloseSession(request), CloseSessionResponse::builder));<NEW_LINE>protocol.registerKeepAliveHandler(request -> runOnContextIfReady(() -> role.onKeepAlive(request), KeepAliveResponse::builder));<NEW_LINE>protocol.registerMetadataHandler(request -> runOnContextIfReady(() -> role.onMetadata(request), MetadataResponse::builder));<NEW_LINE>protocol.registerConfigureHandler(request -> runOnContext(() -> role.onConfigure(request)));<NEW_LINE>protocol.registerInstallHandler(request -> runOnContext(() -> role.onInstall(request)));<NEW_LINE>protocol.registerJoinHandler(request -> runOnContext(() -> role.onJoin(request)));<NEW_LINE>protocol.registerReconfigureHandler(request -> runOnContext(() -> role.onReconfigure(request)));<NEW_LINE>protocol.registerLeaveHandler(request -> runOnContext(() -> role.onLeave(request)));<NEW_LINE>protocol.registerTransferHandler(request -> runOnContext(() -> role.onTransfer(request)));<NEW_LINE>protocol.registerAppendHandler(request -> runOnContext(() -> role.onAppend(request)));<NEW_LINE>protocol.registerPollHandler(request -> runOnContext(() -> role.onPoll(request)));<NEW_LINE>protocol.registerVoteHandler(request -> runOnContext(() -> <MASK><NEW_LINE>protocol.registerCommandHandler(request -> runOnContextIfReady(() -> role.onCommand(request), CommandResponse::builder));<NEW_LINE>protocol.registerQueryHandler(request -> runOnContextIfReady(() -> role.onQuery(request), QueryResponse::builder));<NEW_LINE>} | role.onVote(request))); |
1,598,658 | public void startOneIndividualStreamRecording(Session session, Participant participant) {<NEW_LINE>Recording recording = this.sessionsRecordings.get(session.getSessionId());<NEW_LINE>if (recording == null) {<NEW_LINE>recording = this.sessionsRecordingsStarting.get(session.getSessionId());<NEW_LINE>if (recording == null) {<NEW_LINE>log.error("Cannot start recording of new stream {}. Session {} is not being recorded", participant.getPublisherStreamId(), session.getSessionId());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (OutputMode.INDIVIDUAL.equals(recording.getOutputMode())) {<NEW_LINE>// Start new RecorderEndpoint for this stream<NEW_LINE>log.info("Starting new RecorderEndpoint in session {} for new stream of participant {}", session.getSessionId(), participant.getParticipantPublicId());<NEW_LINE>MediaProfileSpecType profile = null;<NEW_LINE>try {<NEW_LINE>profile = this.singleStreamRecordingService.generateMediaProfile(<MASK><NEW_LINE>} catch (OpenViduException e) {<NEW_LINE>log.error("Cannot start single stream recorder for stream {} in session {}: {}", participant.getPublisherStreamId(), session.getSessionId(), e.getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.singleStreamRecordingService.startRecorderEndpointForPublisherEndpoint(recording.getId(), profile, participant, new CountDownLatch(1));<NEW_LINE>} else if (RecordingUtils.IS_COMPOSED(recording.getOutputMode()) && !recording.hasVideo()) {<NEW_LINE>// Connect this stream to existing Composite recorder<NEW_LINE>log.info("Joining PublisherEndpoint to existing Composite in session {} for new stream of participant {}", session.getSessionId(), participant.getParticipantPublicId());<NEW_LINE>this.composedRecordingService.joinPublisherEndpointToComposite(session, recording.getId(), participant);<NEW_LINE>}<NEW_LINE>} | recording.getRecordingProperties(), participant); |
1,396,610 | public static DynamicConfigAddMapConfigCodec.RequestParameters decodeRequest(ClientMessage clientMessage) {<NEW_LINE>ClientMessage.ForwardFrameIterator iterator = clientMessage.frameIterator();<NEW_LINE>RequestParameters request = new RequestParameters();<NEW_LINE>ClientMessage.Frame initialFrame = iterator.next();<NEW_LINE>request.backupCount = decodeInt(initialFrame.content, REQUEST_BACKUP_COUNT_FIELD_OFFSET);<NEW_LINE>request.asyncBackupCount = decodeInt(initialFrame.content, REQUEST_ASYNC_BACKUP_COUNT_FIELD_OFFSET);<NEW_LINE>request.timeToLiveSeconds = decodeInt(initialFrame.content, REQUEST_TIME_TO_LIVE_SECONDS_FIELD_OFFSET);<NEW_LINE>request.maxIdleSeconds = decodeInt(initialFrame.content, REQUEST_MAX_IDLE_SECONDS_FIELD_OFFSET);<NEW_LINE>request.readBackupData = decodeBoolean(initialFrame.content, REQUEST_READ_BACKUP_DATA_FIELD_OFFSET);<NEW_LINE>request.mergeBatchSize = decodeInt(initialFrame.content, REQUEST_MERGE_BATCH_SIZE_FIELD_OFFSET);<NEW_LINE>request.statisticsEnabled = decodeBoolean(initialFrame.content, REQUEST_STATISTICS_ENABLED_FIELD_OFFSET);<NEW_LINE>request.metadataPolicy = <MASK><NEW_LINE>if (initialFrame.content.length >= REQUEST_PER_ENTRY_STATS_ENABLED_FIELD_OFFSET + BOOLEAN_SIZE_IN_BYTES) {<NEW_LINE>request.perEntryStatsEnabled = decodeBoolean(initialFrame.content, REQUEST_PER_ENTRY_STATS_ENABLED_FIELD_OFFSET);<NEW_LINE>request.isPerEntryStatsEnabledExists = true;<NEW_LINE>} else {<NEW_LINE>request.isPerEntryStatsEnabledExists = false;<NEW_LINE>}<NEW_LINE>request.name = StringCodec.decode(iterator);<NEW_LINE>request.evictionConfig = CodecUtil.decodeNullable(iterator, EvictionConfigHolderCodec::decode);<NEW_LINE>request.cacheDeserializedValues = StringCodec.decode(iterator);<NEW_LINE>request.mergePolicy = StringCodec.decode(iterator);<NEW_LINE>request.inMemoryFormat = StringCodec.decode(iterator);<NEW_LINE>request.listenerConfigs = ListMultiFrameCodec.decodeNullable(iterator, ListenerConfigHolderCodec::decode);<NEW_LINE>request.partitionLostListenerConfigs = ListMultiFrameCodec.decodeNullable(iterator, ListenerConfigHolderCodec::decode);<NEW_LINE>request.splitBrainProtectionName = CodecUtil.decodeNullable(iterator, StringCodec::decode);<NEW_LINE>request.mapStoreConfig = CodecUtil.decodeNullable(iterator, MapStoreConfigHolderCodec::decode);<NEW_LINE>request.nearCacheConfig = CodecUtil.decodeNullable(iterator, NearCacheConfigHolderCodec::decode);<NEW_LINE>request.wanReplicationRef = CodecUtil.decodeNullable(iterator, WanReplicationRefCodec::decode);<NEW_LINE>request.indexConfigs = ListMultiFrameCodec.decodeNullable(iterator, IndexConfigCodec::decode);<NEW_LINE>request.attributeConfigs = ListMultiFrameCodec.decodeNullable(iterator, AttributeConfigCodec::decode);<NEW_LINE>request.queryCacheConfigs = ListMultiFrameCodec.decodeNullable(iterator, QueryCacheConfigHolderCodec::decode);<NEW_LINE>request.partitioningStrategyClassName = CodecUtil.decodeNullable(iterator, StringCodec::decode);<NEW_LINE>request.partitioningStrategyImplementation = CodecUtil.decodeNullable(iterator, DataCodec::decode);<NEW_LINE>request.hotRestartConfig = CodecUtil.decodeNullable(iterator, HotRestartConfigCodec::decode);<NEW_LINE>request.eventJournalConfig = CodecUtil.decodeNullable(iterator, EventJournalConfigCodec::decode);<NEW_LINE>request.merkleTreeConfig = CodecUtil.decodeNullable(iterator, MerkleTreeConfigCodec::decode);<NEW_LINE>return request;<NEW_LINE>} | decodeInt(initialFrame.content, REQUEST_METADATA_POLICY_FIELD_OFFSET); |
1,090,633 | public CompletableFuture<FetchedValue> fetchValue(ExecutionContext executionContext, Object source, Object localContext, MergedField sameFields, ExecutionStepInfo executionInfo) {<NEW_LINE>Field field = sameFields.getSingleField();<NEW_LINE>GraphQLFieldDefinition fieldDef = executionInfo.getFieldDefinition();<NEW_LINE>GraphQLCodeRegistry codeRegistry = executionContext.getGraphQLSchema().getCodeRegistry();<NEW_LINE>GraphQLFieldsContainer parentType = getFieldsContainer(executionInfo);<NEW_LINE>Supplier<Map<String, Object>> argumentValues = FpKit.intraThreadMemoize(() -> valuesResolver.getArgumentValues(codeRegistry, fieldDef.getArguments(), field.getArguments(), executionContext.getVariables()));<NEW_LINE>QueryDirectivesImpl queryDirectives = new QueryDirectivesImpl(sameFields, executionContext.getGraphQLSchema(), executionContext.getVariables());<NEW_LINE>GraphQLOutputType fieldType = fieldDef.getType();<NEW_LINE>Supplier<ExecutableNormalizedOperation> normalizedQuery = executionContext.getNormalizedQueryTree();<NEW_LINE>Supplier<ExecutableNormalizedField> normalisedField = () -> normalizedQuery.get().getNormalizedField(sameFields, executionInfo.getObjectType(), executionInfo.getPath());<NEW_LINE>DataFetchingFieldSelectionSet selectionSet = DataFetchingFieldSelectionSetImpl.newCollector(executionContext.getGraphQLSchema(), fieldType, normalisedField);<NEW_LINE>DataFetchingEnvironment environment = newDataFetchingEnvironment(executionContext).source(source).localContext(localContext).arguments(argumentValues).fieldDefinition(fieldDef).mergedField(sameFields).fieldType(fieldType).executionStepInfo(executionInfo).parentType(parentType).selectionSet(selectionSet).queryDirectives(queryDirectives).build();<NEW_LINE><MASK><NEW_LINE>ResultPath path = executionInfo.getPath();<NEW_LINE>return callDataFetcher(codeRegistry, parentType, fieldDef, environment, executionId, path).thenApply(rawFetchedValue -> FetchedValue.newFetchedValue().fetchedValue(rawFetchedValue).rawFetchedValue(rawFetchedValue).build()).exceptionally(exception -> handleExceptionWhileFetching(field, path, exception)).thenApply(result -> unboxPossibleDataFetcherResult(sameFields, path, result, localContext)).thenApply(this::unboxPossibleOptional);<NEW_LINE>} | ExecutionId executionId = executionContext.getExecutionId(); |
1,639,185 | final DescribeRulesetResult executeDescribeRuleset(DescribeRulesetRequest describeRulesetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRulesetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRulesetRequest> request = null;<NEW_LINE>Response<DescribeRulesetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRulesetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRulesetRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeRuleset");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeRulesetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRulesetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "DataBrew"); |
712,654 | public void testPersistTaskWithNonSerializableResult(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>String taskName = "TaskWithNonSerializableResult-" + VNEXT;<NEW_LINE>NonSerializableResultTask task = new NonSerializableResultTask();<NEW_LINE>TaskStatus<ThreadGroup> status = executor.submit(task);<NEW_LINE>long taskId = status.getTaskId();<NEW_LINE>// wait for task to fail<NEW_LINE>for (long start = System.nanoTime(); !status.hasResult() && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(POLL_INTERVAL)) status = executor.getStatus(taskId);<NEW_LINE>if (!status.isDone())<NEW_LINE>throw new Exception("Task did not execute within allotted interval. " + status);<NEW_LINE>try {<NEW_LINE>ThreadGroup result = status.get();<NEW_LINE><MASK><NEW_LINE>} catch (Exception x) {<NEW_LINE>if (!(x.getCause() instanceof NotSerializableException))<NEW_LINE>throw new Exception("Unexpected failure. See cause.", x);<NEW_LINE>}<NEW_LINE>saveTaskEntry(executor, taskId, taskName);<NEW_LINE>} | throw new Exception("Unexpected result: " + result); |
905,575 | public static JPanel createProgressBarPanel(JProgressBar progressBar, int space, boolean indeterimate) {<NEW_LINE>JPanel panel = new JPanel(new BorderLayout());<NEW_LINE>if (isMac()) {<NEW_LINE>// default native progress bar on mac ignores color settings, use a custom ui to get green/red<NEW_LINE>progressBar<MASK><NEW_LINE>}<NEW_LINE>progressBar.setValue(0);<NEW_LINE>progressBar.setStringPainted(true);<NEW_LINE>progressBar.setString("");<NEW_LINE>progressBar.setIndeterminate(indeterimate);<NEW_LINE>if (isMac()) {<NEW_LINE>progressBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, Color.LIGHT_GRAY));<NEW_LINE>Border compound = BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(space, space, space, space, MAC_PROGRESSBAR_MATTE_BORDER_COLOR), BorderFactory.createLineBorder(MAC_PROGRESSBAR_LINE_BORDER_COLOR));<NEW_LINE>panel.setBorder(compound);<NEW_LINE>panel.setBackground(MAC_PROGRESSBAR_BACKGROUND_COLOR);<NEW_LINE>} else {<NEW_LINE>progressBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, Color.LIGHT_GRAY));<NEW_LINE>panel.setBorder(BorderFactory.createEmptyBorder(space, space, space, space));<NEW_LINE>}<NEW_LINE>panel.add(progressBar, BorderLayout.CENTER);<NEW_LINE>return panel;<NEW_LINE>} | .setUI(new BasicProgressBarUI()); |
1,646,931 | private void doExperiment(Comparable[] originalArray) {<NEW_LINE>int[] cutoffSizes <MASK><NEW_LINE>List<double[]> allSubArraySizes = new ArrayList<>();<NEW_LINE>for (int cutoffSize : cutoffSizes) {<NEW_LINE>Comparable[] array = new Comparable[originalArray.length];<NEW_LINE>System.arraycopy(originalArray, 0, array, 0, originalArray.length);<NEW_LINE>double[] subArraySizesHistogram = new double[NUMBER_OF_BUCKETS];<NEW_LINE>quickSortWithCutoff(array, cutoffSize, subArraySizesHistogram);<NEW_LINE>allSubArraySizes.add(subArraySizesHistogram);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < cutoffSizes.length; i++) {<NEW_LINE>histogram(allSubArraySizes.get(i), cutoffSizes[i]);<NEW_LINE>try {<NEW_LINE>Thread.sleep(5000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>if (i != cutoffSizes.length - 1) {<NEW_LINE>StdDraw.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = { 10, 20, 50 }; |
556,150 | private void workflowHistoryChanges() throws SQLException, DotDataException {<NEW_LINE>String dropInode = "";<NEW_LINE>DotConnect dc = new DotConnect();<NEW_LINE>if (DbConnectionFactory.isMySql()) {<NEW_LINE>dropInode = "ALTER TABLE workflow_history DROP FOREIGN KEY fk933334145fb51eb;" + "drop index fk933334145fb51eb on workflow_history;" + "ALTER TABLE workflow_history change inode id varchar(36);";<NEW_LINE>} else if (DbConnectionFactory.isOracle()) {<NEW_LINE>dropInode = "ALTER TABLE workflow_history DROP CONSTRAINT fk933334145fb51eb;" + "ALTER TABLE workflow_history add id varchar2(36);" + "UPDATE workflow_history set id = cast(inode as varchar2(36));" + "ALTER TABLE workflow_history drop column inode;" + "ALTER TABLE workflow_history MODIFY (id NOT NULL);" + "ALTER TABLE workflow_history ADD CONSTRAINT workflow_history_pkey PRIMARY KEY(id);";<NEW_LINE>} else if (DbConnectionFactory.isMsSql()) {<NEW_LINE>dropInode = "ALTER TABLE workflow_history DROP CONSTRAINT fk933334145fb51eb;" + "ALTER TABLE workflow_history DROP CONSTRAINT pk_workflow_history;" + "ALTER TABLE workflow_history add new_inode varchar(36);" + "UPDATE workflow_history set new_inode = cast(inode as varchar(36));" + "ALTER TABLE workflow_history drop column inode;" + "EXEC SP_RENAME 'dbo.workflow_history.new_inode','id','COLUMN';" + "ALTER TABLE workflow_history ALTER column id varchar(36) not null;" + "ALTER TABLE workflow_history ADD CONSTRAINT workflow_history_pkey PRIMARY KEY(id);";<NEW_LINE>} else {<NEW_LINE>dropInode = "ALTER TABLE workflow_history DROP CONSTRAINT fk933334145fb51eb;" + "ALTER TABLE workflow_history add id varchar(36);" + "UPDATE workflow_history set id = cast(inode as varchar(36));" + "ALTER TABLE workflow_history drop column inode;" + "ALTER TABLE workflow_history ALTER COLUMN id SET NOT NULL;" + "ALTER TABLE workflow_history ADD CONSTRAINT workflow_history_pkey PRIMARY KEY(id);";<NEW_LINE>}<NEW_LINE>String addWorkFlowHistoryFK = "alter table workflow_history add workflowtask_id varchar(36);" + "alter table workflow_history add constraint wf_id_history_FK foreign key (workflowtask_id) references workflow_task(id)";<NEW_LINE>if (DbConnectionFactory.isOracle())<NEW_LINE>addWorkFlowHistoryFK = <MASK><NEW_LINE>String workflowtask_workflowhistory_relations = "Select child,parent from tree where parent in(select id from workflow_task) and child in(select id from workflow_history)";<NEW_LINE>String deleteFromTree = "Delete from tree where parent in(select id from workflow_task) and child in(select id from workflow_history)";<NEW_LINE>List<String> queries = SQLUtil.tokenize(dropInode + addWorkFlowHistoryFK);<NEW_LINE>for (String query : queries) {<NEW_LINE>try {<NEW_LINE>dc.executeStatement(query);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Logger.warn(this, ex.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dc.setSQL(workflowtask_workflowhistory_relations);<NEW_LINE>List<Map<String, String>> relations = dc.loadResults();<NEW_LINE>for (Map<String, String> relation : relations) {<NEW_LINE>String workflowHistoryInode = relation.get("child");<NEW_LINE>String workflowTaskInode = relation.get("parent");<NEW_LINE>dc.setSQL("UPDATE workflow_history set workflowtask_id = ? where id = ?");<NEW_LINE>dc.addParam(workflowTaskInode);<NEW_LINE>dc.addParam(workflowHistoryInode);<NEW_LINE>dc.loadResult();<NEW_LINE>}<NEW_LINE>dc.executeStatement(deleteFromTree);<NEW_LINE>} | addWorkFlowHistoryFK.replaceAll("varchar\\(", "varchar2\\("); |
477,056 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<Wo> <MASK><NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>SerialNumber o = emc.find(id, SerialNumber.class);<NEW_LINE>if (null == o) {<NEW_LINE>throw new ExceptionSerialNumberNotExist(id);<NEW_LINE>}<NEW_LINE>Application application = business.application().pick(o.getApplication());<NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionApplicationNotExist(o.getApplication());<NEW_LINE>}<NEW_LINE>if (!business.canManageApplication(effectivePerson, application)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson);<NEW_LINE>}<NEW_LINE>emc.beginTransaction(SerialNumber.class);<NEW_LINE>Wi.copier.copy(wi, o);<NEW_LINE>emc.check(o, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(o.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | result = new ActionResult<>(); |
537,718 | private PropertyNode createDefaultClassConstructor(int classLineNumber, long classToken, long lastToken, IdentNode className, boolean subclass) {<NEW_LINE>final int ctorFinish = finish;<NEW_LINE>final List<Statement> statements;<NEW_LINE>final List<IdentNode> parameters;<NEW_LINE>final long identToken = Token.recast(classToken, TokenType.IDENT);<NEW_LINE>if (subclass) {<NEW_LINE>IdentNode superIdent = createIdentNode(identToken, ctorFinish, SUPER.getName()).setIsDirectSuper();<NEW_LINE>IdentNode argsIdent = createIdentNode(identToken, ctorFinish, "args").setIsRestParameter();<NEW_LINE>Expression spreadArgs = new UnaryNode(Token.recast(classToken, TokenType.SPREAD_ARGUMENT), argsIdent);<NEW_LINE>CallNode superCall = new CallNode(classLineNumber, classToken, ctorFinish, superIdent, Collections.singletonList(spreadArgs), false);<NEW_LINE>statements = Collections.singletonList(new ExpressionStatement(classLineNumber, classToken, ctorFinish, superCall));<NEW_LINE>parameters = Collections.singletonList(argsIdent);<NEW_LINE>} else {<NEW_LINE>statements = Collections.emptyList();<NEW_LINE>parameters = Collections.emptyList();<NEW_LINE>}<NEW_LINE>Block body = new Block(classToken, ctorFinish, Block.IS_BODY, statements);<NEW_LINE>IdentNode ctorName = className != null ? className : createIdentNode(identToken, ctorFinish, "constructor");<NEW_LINE>ParserContextFunctionNode function = createParserContextFunctionNode(ctorName, classToken, FunctionNode.Kind.NORMAL, classLineNumber, parameters);<NEW_LINE>function.setLastToken(lastToken);<NEW_LINE>function.setFlag(FunctionNode.IS_METHOD);<NEW_LINE>function.setFlag(FunctionNode.IS_CLASS_CONSTRUCTOR);<NEW_LINE>if (subclass) {<NEW_LINE>function.setFlag(FunctionNode.IS_SUBCLASS_CONSTRUCTOR);<NEW_LINE>function.setFlag(FunctionNode.HAS_DIRECT_SUPER);<NEW_LINE>}<NEW_LINE>if (className == null) {<NEW_LINE>function.setFlag(FunctionNode.IS_ANONYMOUS);<NEW_LINE>}<NEW_LINE>PropertyNode constructor = new PropertyNode(classToken, ctorFinish, ctorName, createFunctionNode(function, classToken, ctorName, parameters, FunctionNode.Kind.NORMAL, classLineNumber, body), <MASK><NEW_LINE>return constructor;<NEW_LINE>} | null, null, false, false); |
673,554 | public void onEvent(Event event) throws Exception {<NEW_LINE>if (event.getTarget() == bRefresh) {<NEW_LINE>loadTable();<NEW_LINE>renderListBox();<NEW_LINE>updateFooter();<NEW_LINE>} else if (event.getName() == Events.ON_OPEN) {<NEW_LINE>OpenEvent openEvt = (OpenEvent) event;<NEW_LINE>WEditorPopupMenu popup = (WEditorPopupMenu) openEvt.getTarget();<NEW_LINE><MASK><NEW_LINE>popup.setAttribute("ref", referencedComponent);<NEW_LINE>} else if (event.getName() == Events.ON_CLICK) {<NEW_LINE>if (event.getTarget() instanceof Menuitem) {<NEW_LINE>Component menuItem = event.getTarget();<NEW_LINE>Component popup = menuItem.getParent();<NEW_LINE>Component referencedComponent = (Component) popup.getAttribute("ref");<NEW_LINE>openReport(referencedComponent);<NEW_LINE>} else if (event.getTarget().equals(bCancel))<NEW_LINE>SessionManager.getAppDesktop().closeActiveWindow();<NEW_LINE>else if (event.getTarget().equals(bExportExcel)) {<NEW_LINE>exportXLS();<NEW_LINE>}<NEW_LINE>} else if (event.getName() == Events.ON_SELECT) {<NEW_LINE>updateFooter();<NEW_LINE>}<NEW_LINE>} | Component referencedComponent = openEvt.getReference(); |
1,195,203 | private InitiateProfilingCommand createInitiateInstrumnetation(int instrType, String[] classNames, boolean instrSpawnedThreads, boolean startProfilingPointsActive) {<NEW_LINE>RuntimeProfilingPoint[<MASK><NEW_LINE>String[] profilingPointHandlers = new String[points.length];<NEW_LINE>String[] profilingPointInfos = new String[points.length];<NEW_LINE>int[] profilingPointIDs = new int[points.length];<NEW_LINE>// ProfilerRuntime uses Arrays.binarySearch<NEW_LINE>Arrays.sort(points);<NEW_LINE>for (int i = 0; i < points.length; i++) {<NEW_LINE>RuntimeProfilingPoint point = points[i];<NEW_LINE>profilingPointIDs[i] = point.getId();<NEW_LINE>profilingPointHandlers[i] = point.getServerHandlerClass();<NEW_LINE>profilingPointInfos[i] = point.getServerInfo();<NEW_LINE>}<NEW_LINE>return new InitiateProfilingCommand(instrType, classNames, profilingPointIDs, profilingPointHandlers, profilingPointInfos, instrSpawnedThreads, startProfilingPointsActive);<NEW_LINE>} | ] points = settings.getRuntimeProfilingPoints(); |
1,733,552 | private static void checksumResourceFilePath(final PwmDomain pwmDomain, final CrcChecksumOutputStream checksumStream) {<NEW_LINE>if (pwmDomain.getPwmApplication().getPwmEnvironment().getContextManager() != null) {<NEW_LINE>try {<NEW_LINE>final Optional<File> webInfPath = pwmDomain.getPwmApplication().getPwmEnvironment().getContextManager().locateWebInfFilePath();<NEW_LINE>if (webInfPath.isPresent() && webInfPath.get().exists()) {<NEW_LINE>final File basePath = webInfPath<MASK><NEW_LINE>if (basePath != null && basePath.exists()) {<NEW_LINE>final File resourcePath = new File(basePath.getAbsolutePath() + File.separator + "public" + File.separator + "resources");<NEW_LINE>if (resourcePath.exists()) {<NEW_LINE>final Iterator<FileSystemUtility.FileSummaryInformation> iter = FileSystemUtility.readFileInformation(Collections.singletonList(resourcePath));<NEW_LINE>{<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>final FileSystemUtility.FileSummaryInformation fileSummaryInformation = iter.next();<NEW_LINE>checksumStream.write(JavaHelper.longToBytes(fileSummaryInformation.getChecksum()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.error(() -> "unable to generate resource path nonce: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .get().getParentFile(); |
1,617,768 | final PutRegistryPolicyResult executePutRegistryPolicy(PutRegistryPolicyRequest putRegistryPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putRegistryPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutRegistryPolicyRequest> request = null;<NEW_LINE>Response<PutRegistryPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutRegistryPolicyRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ECR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutRegistryPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutRegistryPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutRegistryPolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(putRegistryPolicyRequest)); |
406,537 | public void splitRemarkReferenceWithWeakReferenceSplitBug(GCLogTrace trace, String line) {<NEW_LINE>GCLogTrace remarkTrace = REMARK_CLAUSE.parse(line);<NEW_LINE>Pattern durationGroupPattern = Pattern.compile(".* " + PAUSE_TIME);<NEW_LINE>Matcher matcher = durationGroupPattern.matcher(line);<NEW_LINE>double duration = 0.0d;<NEW_LINE>if (matcher.find()) {<NEW_LINE>duration = Double.parseDouble(matcher.group(matcher.groupCount()));<NEW_LINE>}<NEW_LINE>CMSRemark collection = new CMSRemark(getClock(), GCCause.CMS_FINAL_REMARK, duration);<NEW_LINE>MemoryPoolSummary tenured = getTotalOccupancyWithTotalHeapSizeSummary(remarkTrace, 1);<NEW_LINE>MemoryPoolSummary heap = getTotalOccupancyWithTotalHeapSizeSummary(remarkTrace, 5);<NEW_LINE>collection.add(heap.minus(tenured), tenured, heap);<NEW_LINE>recordRescanStepTimes(collection, line);<NEW_LINE>collection.addReferenceGCSummary(extractPrintReferenceGC(line));<NEW_LINE>GCLogTrace <MASK><NEW_LINE>if (weakReferenceFragment != null) {<NEW_LINE>collection.getReferenceGCSummary().addWeakReferences(trace.getDateTimeStamp(4), 0, weakReferenceFragment.getPauseTime());<NEW_LINE>}<NEW_LINE>collection.add(extractCPUSummary(line));<NEW_LINE>record(collection);<NEW_LINE>remarkTimeStamp = null;<NEW_LINE>} | weakReferenceFragment = weakReferenceFragmentRule.parse(line); |
569,399 | public KinesisParameters unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>KinesisParameters kinesisParameters = new KinesisParameters();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("PartitionKeyPath", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>kinesisParameters.setPartitionKeyPath(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return kinesisParameters;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,838,941 | protected void executeParse(BpmnParse bpmnParse, IntermediateCatchEvent event) {<NEW_LINE>ActivityImpl nestedActivity = null;<NEW_LINE>EventDefinition eventDefinition = null;<NEW_LINE>if (!event.getEventDefinitions().isEmpty()) {<NEW_LINE>eventDefinition = event.getEventDefinitions().get(0);<NEW_LINE>}<NEW_LINE>if (eventDefinition == null) {<NEW_LINE>nestedActivity = createActivityOnCurrentScope(bpmnParse, event, BpmnXMLConstants.ELEMENT_EVENT_CATCH);<NEW_LINE>nestedActivity.setAsync(event.isAsynchronous());<NEW_LINE>nestedActivity.setExclusive<MASK><NEW_LINE>} else {<NEW_LINE>ScopeImpl scope = bpmnParse.getCurrentScope();<NEW_LINE>String eventBasedGatewayId = getPrecedingEventBasedGateway(bpmnParse, event);<NEW_LINE>if (eventBasedGatewayId != null) {<NEW_LINE>ActivityImpl gatewayActivity = scope.findActivity(eventBasedGatewayId);<NEW_LINE>nestedActivity = createActivityOnScope(bpmnParse, event, BpmnXMLConstants.ELEMENT_EVENT_CATCH, gatewayActivity);<NEW_LINE>} else {<NEW_LINE>nestedActivity = createActivityOnScope(bpmnParse, event, BpmnXMLConstants.ELEMENT_EVENT_CATCH, scope);<NEW_LINE>}<NEW_LINE>nestedActivity.setAsync(event.isAsynchronous());<NEW_LINE>nestedActivity.setExclusive(!event.isNotExclusive());<NEW_LINE>// Catch event behavior is the same for all types<NEW_LINE>nestedActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateCatchEventActivityBehavior(event));<NEW_LINE>if (eventDefinition instanceof TimerEventDefinition || eventDefinition instanceof SignalEventDefinition || eventDefinition instanceof MessageEventDefinition) {<NEW_LINE>bpmnParse.getBpmnParserHandlers().parseElement(bpmnParse, eventDefinition);<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Unsupported intermediate catch event type for event {}", event.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (!event.isNotExclusive()); |
418,528 | public static Map<String, AttributeValue> toAttributeValueMap(Onboarding onboarding) {<NEW_LINE>Map<String, AttributeValue> <MASK><NEW_LINE>item.put("id", AttributeValue.builder().s(onboarding.getId().toString()).build());<NEW_LINE>if (onboarding.getCreated() != null) {<NEW_LINE>item.put("created", AttributeValue.builder().s(onboarding.getCreated().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)).build());<NEW_LINE>}<NEW_LINE>if (onboarding.getModified() != null) {<NEW_LINE>item.put("modified", AttributeValue.builder().s(onboarding.getModified().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)).build());<NEW_LINE>}<NEW_LINE>if (onboarding.getStatus() != null) {<NEW_LINE>item.put("status", AttributeValue.builder().s(onboarding.getStatus().toString()).build());<NEW_LINE>}<NEW_LINE>if (onboarding.getTenantId() != null) {<NEW_LINE>item.put("tenant_id", AttributeValue.builder().s(onboarding.getTenantId().toString()).build());<NEW_LINE>}<NEW_LINE>if (Utils.isNotBlank(onboarding.getTenantName())) {<NEW_LINE>item.put("tenant_name", AttributeValue.builder().s(onboarding.getTenantName()).build());<NEW_LINE>}<NEW_LINE>if (Utils.isNotBlank(onboarding.getStackId())) {<NEW_LINE>item.put("stack_id", AttributeValue.builder().s(onboarding.getStackId()).build());<NEW_LINE>}<NEW_LINE>return item;<NEW_LINE>} | item = new HashMap<>(); |
1,022,591 | public int loadConnections(InputStream in, long delta) throws IOException {<NEW_LINE>boolean clear = true;<NEW_LINE>int count = 0;<NEW_LINE>long startNanos = ClockUtil.nanoRealtime();<NEW_LINE>DataStreamReader reader = new DataStreamReader(in);<NEW_LINE>long progressNanos = startNanos;<NEW_LINE>try {<NEW_LINE>Connection connection;<NEW_LINE>while ((connection = Connection.fromReader(reader, delta)) != null) {<NEW_LINE>long lastUpdate = connection.getLastMessageNanos();<NEW_LINE>if (lastUpdate - startNanos > 0) {<NEW_LINE>WARN_FILTER.warn("{}read {} ts is after {} (future)", tag, lastUpdate, startNanos);<NEW_LINE>}<NEW_LINE>LOGGER.trace("{}read {} ts, {}s", tag, lastUpdate, TimeUnit.NANOSECONDS.toSeconds(startNanos - lastUpdate));<NEW_LINE>restore(connection);<NEW_LINE>++count;<NEW_LINE><MASK><NEW_LINE>if ((now - progressNanos) > TimeUnit.SECONDS.toNanos(2)) {<NEW_LINE>LOGGER.info("{}read {} connections", tag, count);<NEW_LINE>progressNanos = now;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>clear = false;<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>LOGGER.warn("{}reading failed after {} connections", tag, count, ex);<NEW_LINE>clear();<NEW_LINE>throw ex;<NEW_LINE>} finally {<NEW_LINE>if (clear) {<NEW_LINE>clear();<NEW_LINE>count = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return count;<NEW_LINE>} | long now = ClockUtil.nanoRealtime(); |
279,270 | protected AssemblyResolution solveLeftSide(PatternExpression lexp, MaskedLong rval, MaskedLong goal, Map<String, Long> vals, AssemblyResolvedPatterns cur, Set<SolverHint> hints, String description) throws NeedsBackfillException, SolverException {<NEW_LINE>// Try the usual case first<NEW_LINE>ResultTracker tracker = new ResultTracker();<NEW_LINE>AssemblyResolution sol = tracker.trySolverFunc(() -> {<NEW_LINE>return super.solveLeftSide(lexp, rval, goal, vals, cur, hints, description);<NEW_LINE>});<NEW_LINE>if (sol != null) {<NEW_LINE>return sol;<NEW_LINE>}<NEW_LINE>if (hints.contains(DefaultSolverHint.GUESSING_REPETITION)) {<NEW_LINE>return tracker.returnBest(rval, goal);<NEW_LINE>}<NEW_LINE>// Handle case of using multiplication for repeating fields<NEW_LINE>int unksToRight = Long.numberOfTrailingZeros(goal.msk);<NEW_LINE>int unksToLeft = Long.numberOfLeadingZeros(goal.msk);<NEW_LINE>int numBitsKnown = Long.SIZE - unksToRight - unksToLeft;<NEW_LINE>if (Long.bitCount(goal.msk) == numBitsKnown) {<NEW_LINE>// All bits counted<NEW_LINE>Set<SolverHint> hintsWithRepetition = SolverHint.with(hints, DefaultSolverHint.GUESSING_REPETITION);<NEW_LINE>// Assume right truncation<NEW_LINE>// Need to fill all bits to the right in order to divide<NEW_LINE>int reps = (unksToRight + numBitsKnown - 1) / numBitsKnown;<NEW_LINE>long repMsk = goal.msk;<NEW_LINE>long repVal = goal.val;<NEW_LINE>for (int i = 0; i < reps; i++) {<NEW_LINE>repMsk = (repMsk >>> numBitsKnown) | repMsk;<NEW_LINE>repVal = (repVal >>> numBitsKnown) | repVal;<NEW_LINE>}<NEW_LINE>if (reps > 0) {<NEW_LINE>MaskedLong repRightGoal = MaskedLong.fromMaskAndValue(repMsk, repVal);<NEW_LINE>sol = tracker.trySolverFunc(() -> {<NEW_LINE>return tryRep(lexp, rval, repRightGoal, goal, vals, cur, hintsWithRepetition, description);<NEW_LINE>});<NEW_LINE>if (sol != null) {<NEW_LINE>return sol;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Assume right and left truncation<NEW_LINE>// Fill value bits all the way to left, then try adding one mask bit at a time<NEW_LINE>reps = (unksToLeft + numBitsKnown - 1) / numBitsKnown;<NEW_LINE>for (int i = 0; i < reps; i++) {<NEW_LINE>repVal = (repVal << numBitsKnown) | repVal;<NEW_LINE>}<NEW_LINE>for (int i = unksToLeft - 1; i >= 0; i--) {<NEW_LINE>repMsk = -1L >>> i;<NEW_LINE>MaskedLong repLeftGoal = MaskedLong.fromMaskAndValue(repMsk, repVal);<NEW_LINE>sol = tracker.trySolverFunc(() -> {<NEW_LINE>return tryRep(lexp, rval, repLeftGoal, goal, <MASK><NEW_LINE>});<NEW_LINE>if (sol != null) {<NEW_LINE>return sol;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tracker.returnBest(rval, goal);<NEW_LINE>} | vals, cur, hintsWithRepetition, description); |
674,275 | public <V> FileContentCache<V> newCache(String name, int normalizedCacheSize, final Calculator<? extends V> calculator, Serializer<V> serializer) {<NEW_LINE>PersistentIndexedCacheParameters<HashCode, V> parameters = PersistentIndexedCacheParameters.of(name, hashCodeSerializer, serializer).withCacheDecorator(inMemoryCacheDecoratorFactory<MASK><NEW_LINE>PersistentIndexedCache<HashCode, V> store = cache.createCache(parameters);<NEW_LINE>DefaultFileContentCache<V> cache = Cast.uncheckedCast(caches.get(name));<NEW_LINE>if (cache == null) {<NEW_LINE>cache = new DefaultFileContentCache<>(name, fileSystemAccess, store, calculator);<NEW_LINE>DefaultFileContentCache<V> existing = Cast.uncheckedCast(caches.putIfAbsent(name, cache));<NEW_LINE>if (existing == null) {<NEW_LINE>listenerManager.addListener(cache);<NEW_LINE>} else {<NEW_LINE>cache = existing;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cache.assertStoredIn(store);<NEW_LINE>return cache;<NEW_LINE>} | .decorator(normalizedCacheSize, true)); |
737,516 | public static Bitmap drawable2Bitmap(@Nullable final Drawable drawable) {<NEW_LINE>if (drawable == null)<NEW_LINE>return null;<NEW_LINE>if (drawable instanceof BitmapDrawable) {<NEW_LINE>BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;<NEW_LINE>if (bitmapDrawable.getBitmap() != null) {<NEW_LINE>return bitmapDrawable.getBitmap();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Bitmap bitmap;<NEW_LINE>if (drawable.getIntrinsicWidth() <= 0 || drawable.getIntrinsicHeight() <= 0) {<NEW_LINE>bitmap = Bitmap.createBitmap(1, 1, drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);<NEW_LINE>} else {<NEW_LINE>bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);<NEW_LINE>}<NEW_LINE>Canvas canvas = new Canvas(bitmap);<NEW_LINE>drawable.setBounds(0, 0, canvas.getWidth(<MASK><NEW_LINE>drawable.draw(canvas);<NEW_LINE>return bitmap;<NEW_LINE>} | ), canvas.getHeight()); |
1,451,522 | public static void updateReadFilter(Context context, FeedSet fs, ReadFilter newFilter) {<NEW_LINE>if (fs.isAllNormal()) {<NEW_LINE>setReadFilterForFolder(<MASK><NEW_LINE>} else if (fs.getSingleFeed() != null) {<NEW_LINE>setReadFilterForFeed(context, fs.getSingleFeed(), newFilter);<NEW_LINE>} else if (fs.getMultipleFeeds() != null) {<NEW_LINE>setReadFilterForFolder(context, fs.getFolderName(), newFilter);<NEW_LINE>} else if (fs.isAllSocial()) {<NEW_LINE>setReadFilterForFolder(context, PrefConstants.ALL_SHARED_STORIES_FOLDER_NAME, newFilter);<NEW_LINE>} else if (fs.getSingleSocialFeed() != null) {<NEW_LINE>setReadFilterForFeed(context, fs.getSingleSocialFeed().getKey(), newFilter);<NEW_LINE>} else if (fs.getMultipleSocialFeeds() != null) {<NEW_LINE>setReadFilterForFolder(context, fs.getFolderName(), newFilter);<NEW_LINE>} else if (fs.isAllRead()) {<NEW_LINE>throw new IllegalArgumentException("read filter not applicable to this type of feedset");<NEW_LINE>} else if (fs.isAllSaved()) {<NEW_LINE>throw new IllegalArgumentException("read filter not applicable to this type of feedset");<NEW_LINE>} else if (fs.getSingleSavedTag() != null) {<NEW_LINE>throw new IllegalArgumentException("read filter not applicable to this type of feedset");<NEW_LINE>} else if (fs.isGlobalShared()) {<NEW_LINE>setReadFilterForFolder(context, PrefConstants.GLOBAL_SHARED_STORIES_FOLDER_NAME, newFilter);<NEW_LINE>} else if (fs.isInfrequent()) {<NEW_LINE>setReadFilterForFolder(context, PrefConstants.INFREQUENT_FOLDER_NAME, newFilter);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("unknown type of feed set");<NEW_LINE>}<NEW_LINE>} | context, PrefConstants.ALL_STORIES_FOLDER_NAME, newFilter); |
46,979 | final CompleteSnapshotResult executeCompleteSnapshot(CompleteSnapshotRequest completeSnapshotRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(completeSnapshotRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CompleteSnapshotRequest> request = null;<NEW_LINE>Response<CompleteSnapshotResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CompleteSnapshotRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(completeSnapshotRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EBS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CompleteSnapshot");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CompleteSnapshotResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CompleteSnapshotResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,740,959 | final DescribeAnomalyDetectorsResult executeDescribeAnomalyDetectors(DescribeAnomalyDetectorsRequest describeAnomalyDetectorsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAnomalyDetectorsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAnomalyDetectorsRequest> request = null;<NEW_LINE>Response<DescribeAnomalyDetectorsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeAnomalyDetectorsRequestMarshaller().marshall(super.beforeMarshalling(describeAnomalyDetectorsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudWatch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAnomalyDetectors");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeAnomalyDetectorsResult> responseHandler = new StaxResponseHandler<DescribeAnomalyDetectorsResult>(new DescribeAnomalyDetectorsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
971,140 | public ApplicationMap build(LinkDataDuplexMap linkDataDuplexMap, long timeoutMillis) {<NEW_LINE>Objects.requireNonNull(linkDataDuplexMap, "linkDataDuplexMap");<NEW_LINE>logger.info("Building application map");<NEW_LINE>NodeType nodeType = this.nodeType;<NEW_LINE>if (nodeType == null) {<NEW_LINE>nodeType = NodeType.DETAILED;<NEW_LINE>}<NEW_LINE>LinkType linkType = this.linkType;<NEW_LINE>if (linkType == null) {<NEW_LINE>linkType = LinkType.DETAILED;<NEW_LINE>}<NEW_LINE>NodeList nodeList = NodeListFactory.createNodeList(nodeType, linkDataDuplexMap);<NEW_LINE>LinkList linkList = LinkListFactory.createLinkList(linkType, nodeList, linkDataDuplexMap, range);<NEW_LINE>NodeHistogramFactory nodeHistogramFactory = this.nodeHistogramFactory;<NEW_LINE>if (nodeHistogramFactory == null) {<NEW_LINE>nodeHistogramFactory = new EmptyNodeHistogramFactory();<NEW_LINE>}<NEW_LINE>NodeHistogramAppender nodeHistogramAppender = nodeHistogramAppenderFactory.create(nodeHistogramFactory);<NEW_LINE>final TimeoutWatcher timeoutWatcher = new TimeoutWatcher(timeoutMillis);<NEW_LINE>nodeHistogramAppender.appendNodeHistogram(range, nodeList, <MASK><NEW_LINE>ServerInstanceListFactory serverInstanceListFactory = this.serverInstanceListFactory;<NEW_LINE>if (serverInstanceListFactory == null) {<NEW_LINE>serverInstanceListFactory = new EmptyServerInstanceListFactory();<NEW_LINE>}<NEW_LINE>ServerInfoAppender serverInfoAppender = serverInfoAppenderFactory.create(serverInstanceListFactory);<NEW_LINE>serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutWatcher.remainingTimeMillis());<NEW_LINE>MetricInfoAppender metricInfoAppender = metricInfoAppenderFactory.create();<NEW_LINE>metricInfoAppender.appendMetricInfo(range, nodeList, linkDataDuplexMap);<NEW_LINE>return new DefaultApplicationMap(range, nodeList, linkList);<NEW_LINE>} | linkList, timeoutWatcher.remainingTimeMillis()); |
939,786 | public static ListTransitRouterPeerAttachmentsResponse unmarshall(ListTransitRouterPeerAttachmentsResponse listTransitRouterPeerAttachmentsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listTransitRouterPeerAttachmentsResponse.setRequestId(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.RequestId"));<NEW_LINE>listTransitRouterPeerAttachmentsResponse.setNextToken(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.NextToken"));<NEW_LINE>listTransitRouterPeerAttachmentsResponse.setTotalCount(_ctx.integerValue("ListTransitRouterPeerAttachmentsResponse.TotalCount"));<NEW_LINE>listTransitRouterPeerAttachmentsResponse.setMaxResults(_ctx.integerValue("ListTransitRouterPeerAttachmentsResponse.MaxResults"));<NEW_LINE>List<TransitRouterAttachment> transitRouterAttachments = new ArrayList<TransitRouterAttachment>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments.Length"); i++) {<NEW_LINE>TransitRouterAttachment transitRouterAttachment = new TransitRouterAttachment();<NEW_LINE>transitRouterAttachment.setCreationTime(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].CreationTime"));<NEW_LINE>transitRouterAttachment.setStatus(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].Status"));<NEW_LINE>transitRouterAttachment.setTransitRouterAttachmentId(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].TransitRouterAttachmentId"));<NEW_LINE>transitRouterAttachment.setBandwidthType(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].BandwidthType"));<NEW_LINE>transitRouterAttachment.setCenBandwidthPackageId(_ctx.stringValue<MASK><NEW_LINE>transitRouterAttachment.setTransitRouterAttachmentDescription(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].TransitRouterAttachmentDescription"));<NEW_LINE>transitRouterAttachment.setRegionId(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].RegionId"));<NEW_LINE>transitRouterAttachment.setPeerTransitRouterId(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].PeerTransitRouterId"));<NEW_LINE>transitRouterAttachment.setBandwidthPackageId(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].BandwidthPackageId"));<NEW_LINE>transitRouterAttachment.setTransitRouterId(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].TransitRouterId"));<NEW_LINE>transitRouterAttachment.setPeerTransitRouterRegionId(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].PeerTransitRouterRegionId"));<NEW_LINE>transitRouterAttachment.setResourceType(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].ResourceType"));<NEW_LINE>transitRouterAttachment.setBandwidth(_ctx.integerValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].Bandwidth"));<NEW_LINE>transitRouterAttachment.setGeographicSpanId(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].GeographicSpanId"));<NEW_LINE>transitRouterAttachment.setPeerTransitRouterOwnerId(_ctx.longValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].PeerTransitRouterOwnerId"));<NEW_LINE>transitRouterAttachment.setAutoPublishRouteEnabled(_ctx.booleanValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].AutoPublishRouteEnabled"));<NEW_LINE>transitRouterAttachment.setTransitRouterAttachmentName(_ctx.stringValue("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].TransitRouterAttachmentName"));<NEW_LINE>transitRouterAttachments.add(transitRouterAttachment);<NEW_LINE>}<NEW_LINE>listTransitRouterPeerAttachmentsResponse.setTransitRouterAttachments(transitRouterAttachments);<NEW_LINE>return listTransitRouterPeerAttachmentsResponse;<NEW_LINE>} | ("ListTransitRouterPeerAttachmentsResponse.TransitRouterAttachments[" + i + "].CenBandwidthPackageId")); |
1,544,593 | public DoubleFunction1D multiply(DoubleFunction1D f) {<NEW_LINE>ArgChecker.notNull(f, "function");<NEW_LINE>if (f instanceof RealPolynomialFunction1D) {<NEW_LINE>RealPolynomialFunction1D p1 = (RealPolynomialFunction1D) f;<NEW_LINE>double[] c = _coefficients;<NEW_LINE>double[] c1 = p1.getCoefficients();<NEW_LINE>int m = c1.length;<NEW_LINE>double[] newC = new double[_n + m - 1];<NEW_LINE>for (int i = 0; i < newC.length; i++) {<NEW_LINE>newC[i] = 0;<NEW_LINE>for (int j = Math.max(0, i + 1 - m); j < Math.min(_n, i + 1); j++) {<NEW_LINE>newC[i] += c[j] * c1[i - j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new RealPolynomialFunction1D(newC);<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>} | DoubleFunction1D.super.multiply(f); |
950,995 | public void marshall(Job job, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (job == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(job.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getLogUri(), LOGURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getRole(), ROLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getCreatedOn(), CREATEDON_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getLastModifiedOn(), LASTMODIFIEDON_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getExecutionProperty(), EXECUTIONPROPERTY_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getCommand(), COMMAND_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(job.getNonOverridableArguments(), NONOVERRIDABLEARGUMENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getConnections(), CONNECTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getMaxRetries(), MAXRETRIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getAllocatedCapacity(), ALLOCATEDCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getTimeout(), TIMEOUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getMaxCapacity(), MAXCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getWorkerType(), WORKERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getNumberOfWorkers(), NUMBEROFWORKERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getSecurityConfiguration(), SECURITYCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getNotificationProperty(), NOTIFICATIONPROPERTY_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getGlueVersion(), GLUEVERSION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | job.getDefaultArguments(), DEFAULTARGUMENTS_BINDING); |
1,476,985 | private static BuildInfo readBuildPropertiesClass(Class<?> clazz, BuildInfo upstreamBuildInfo, Overrides overrides) {<NEW_LINE>String <MASK><NEW_LINE>String build = readStaticStringField(clazz, "BUILD");<NEW_LINE>String revision = readStaticStringField(clazz, "REVISION");<NEW_LINE>String distribution = readStaticStringField(clazz, "DISTRIBUTION");<NEW_LINE>String commitId = readStaticStringField(clazz, "COMMIT_ID");<NEW_LINE>revision = checkMissingExpressionValue(revision, "${git.commit.id.abbrev}");<NEW_LINE>commitId = checkMissingExpressionValue(commitId, "${git.commit.id}");<NEW_LINE>int buildNumber = Integer.parseInt(build);<NEW_LINE>boolean enterprise = !"Hazelcast".equals(distribution);<NEW_LINE>String serialVersionString = readStaticStringField(clazz, "SERIALIZATION_VERSION");<NEW_LINE>byte serialVersion = Byte.parseByte(serialVersionString);<NEW_LINE>return overrides.apply(version, build, revision, buildNumber, enterprise, serialVersion, commitId, upstreamBuildInfo);<NEW_LINE>} | version = readStaticStringField(clazz, "VERSION"); |
1,015,761 | public void afterPropertiesSet() throws Exception {<NEW_LINE>if (this.workingDir == null) {<NEW_LINE>String <MASK><NEW_LINE>if (apacheWorkDir == null) {<NEW_LINE>apacheWorkDir = createTempDirectory("apacheds-spring-security-");<NEW_LINE>}<NEW_LINE>setWorkingDirectory(new File(apacheWorkDir));<NEW_LINE>}<NEW_LINE>Assert.isTrue(!this.ldapOverSslEnabled || this.keyStoreFile != null, "When LdapOverSsl is enabled, the keyStoreFile property must be set.");<NEW_LINE>this.server = new LdapServer();<NEW_LINE>this.server.setDirectoryService(this.service);<NEW_LINE>// AbstractLdapIntegrationTests assume IPv4, so we specify the same here<NEW_LINE>this.transport = new TcpTransport(this.port);<NEW_LINE>if (this.ldapOverSslEnabled) {<NEW_LINE>this.transport.setEnableSSL(true);<NEW_LINE>this.server.setKeystoreFile(this.keyStoreFile.getAbsolutePath());<NEW_LINE>this.server.setCertificatePassword(this.certificatePassord);<NEW_LINE>}<NEW_LINE>this.server.setTransports(this.transport);<NEW_LINE>start();<NEW_LINE>} | apacheWorkDir = System.getProperty("apacheDSWorkDir"); |
39,687 | protected Node createControl() {<NEW_LINE>sourceView = new SourceView();<NEW_LINE>Calendar meetings = new Calendar("Meetings");<NEW_LINE>Calendar training = new Calendar("Training");<NEW_LINE>Calendar customers = new Calendar("Customers");<NEW_LINE>Calendar holidays = new Calendar("Holidays");<NEW_LINE>meetings.setStyle(Style.STYLE2);<NEW_LINE>training.setStyle(Style.STYLE3);<NEW_LINE>customers.setStyle(Style.STYLE4);<NEW_LINE><MASK><NEW_LINE>workCalendarSource = new CalendarSource("Work");<NEW_LINE>workCalendarSource.getCalendars().addAll(meetings, training, customers, holidays);<NEW_LINE>Calendar birthdays = new Calendar("Birthdays");<NEW_LINE>Calendar katja = new Calendar("Katja");<NEW_LINE>Calendar dirk = new Calendar("Dirk");<NEW_LINE>Calendar philip = new Calendar("Philip");<NEW_LINE>Calendar jule = new Calendar("Jule");<NEW_LINE>Calendar armin = new Calendar("Armin");<NEW_LINE>familyCalendarSource = new CalendarSource("Family");<NEW_LINE>familyCalendarSource.getCalendars().addAll(birthdays, katja, dirk, philip, jule, armin);<NEW_LINE>sourceView.getCalendarSources().addAll(workCalendarSource, familyCalendarSource);<NEW_LINE>return sourceView;<NEW_LINE>} | holidays.setStyle(Style.STYLE5); |
430,272 | public int compareTo(loadTablet_args other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTinfo(), other.isSetTinfo());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTinfo()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tinfo, other.tinfo);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetCredentials(), other.isSetCredentials());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetCredentials()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credentials, other.credentials);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetLock(), other.isSetLock());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetLock()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lock, other.lock);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetExtent(), other.isSetExtent());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetExtent()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | this.extent, other.extent); |
969,152 | public Schema resolve(AnnotatedType type) {<NEW_LINE>AnnotatedType aType = OptionalUtils.unwrapOptional(type);<NEW_LINE>if (aType != null) {<NEW_LINE>return resolve(aType);<NEW_LINE>}<NEW_LINE>if (processedTypes.contains(type)) {<NEW_LINE>return modelByType.get(type);<NEW_LINE>} else {<NEW_LINE>processedTypes.add(type);<NEW_LINE>}<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug(String.format("resolve %s", type.getType()));<NEW_LINE>}<NEW_LINE>Iterator<ModelConverter> converters = this.getConverters();<NEW_LINE>Schema resolved = null;<NEW_LINE>if (converters.hasNext()) {<NEW_LINE>ModelConverter converter = converters.next();<NEW_LINE>LOGGER.trace("trying extension {}", converter);<NEW_LINE>resolved = converter.<MASK><NEW_LINE>}<NEW_LINE>if (resolved != null) {<NEW_LINE>modelByType.put(type, resolved);<NEW_LINE>Schema resolvedImpl = resolved;<NEW_LINE>if (resolvedImpl.getName() != null) {<NEW_LINE>modelByName.put(resolvedImpl.getName(), resolved);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>processedTypes.remove(type);<NEW_LINE>}<NEW_LINE>return resolved;<NEW_LINE>} | resolve(type, this, converters); |
124,159 | public static ExtendedDateTime fromPackedLong(long packed, DateTimeZone tz) {<NEW_LINE>// TODO: As for JDBC behavior, it can be configured to "round" or "toNull"<NEW_LINE>// for now we didn't pass in session so we do a toNull behavior<NEW_LINE>if (packed == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>long ymdhms = packed >> 24;<NEW_LINE>long ymd = ymdhms >> 17;<NEW_LINE>int day = (int) (ymd & ((1 << 5) - 1));<NEW_LINE>long ym = ymd >> 5;<NEW_LINE>int month = (int) (ym % 13);<NEW_LINE>int year = (int) (ym / 13);<NEW_LINE>int hms = (int) (ymdhms & ((1 << 17) - 1));<NEW_LINE>int second = hms & ((1 << 6) - 1);<NEW_LINE>int minute = (hms >> 6) & ((1 << 6) - 1);<NEW_LINE>int hour = hms >> 12;<NEW_LINE>int microsec = (int) (packed % (1 << 24));<NEW_LINE>return createExtendedDateTime(tz, year, month, day, <MASK><NEW_LINE>} | hour, minute, second, microsec); |
1,516,420 | private static String findConfiguredHosts(ProtocolConfig protocolConfig, ProviderConfig provider, Map<String, String> map) {<NEW_LINE>boolean anyhost = false;<NEW_LINE>String hostToBind = getValueFromConfig(protocolConfig, DUBBO_IP_TO_BIND);<NEW_LINE>if (hostToBind != null && hostToBind.length() > 0 && isInvalidLocalHost(hostToBind)) {<NEW_LINE>throw new IllegalArgumentException("Specified invalid bind ip from property:" + DUBBO_IP_TO_BIND + ", value:" + hostToBind);<NEW_LINE>}<NEW_LINE>// if bind ip is not found in environment, keep looking up<NEW_LINE>if (StringUtils.isEmpty(hostToBind)) {<NEW_LINE>hostToBind = protocolConfig.getHost();<NEW_LINE>if (provider != null && StringUtils.isEmpty(hostToBind)) {<NEW_LINE>hostToBind = provider.getHost();<NEW_LINE>}<NEW_LINE>if (isInvalidLocalHost(hostToBind)) {<NEW_LINE>anyhost = true;<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.info("No valid ip found from environment, try to get local host.");<NEW_LINE>}<NEW_LINE>hostToBind = getLocalHost();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>map.put(BIND_IP_KEY, hostToBind);<NEW_LINE>// registry ip is not used for bind ip by default<NEW_LINE>String hostToRegistry = getValueFromConfig(protocolConfig, DUBBO_IP_TO_REGISTRY);<NEW_LINE>if (StringUtils.isNotEmpty(hostToRegistry) && isInvalidLocalHost(hostToRegistry)) {<NEW_LINE>throw new IllegalArgumentException("Specified invalid registry ip from property:" + DUBBO_IP_TO_REGISTRY + ", value:" + hostToRegistry);<NEW_LINE>} else if (StringUtils.isEmpty(hostToRegistry)) {<NEW_LINE>// bind ip is used as registry ip by default<NEW_LINE>hostToRegistry = hostToBind;<NEW_LINE>}<NEW_LINE>map.put(ANYHOST_KEY<MASK><NEW_LINE>return hostToRegistry;<NEW_LINE>} | , String.valueOf(anyhost)); |
1,692,637 | protected List<String> splitStatements(String sql) {<NEW_LINE>List<String> <MASK><NEW_LINE>SimpleCharStream stream = new SimpleCharStream(new StringReader(sql)) {<NEW_LINE><NEW_LINE>{<NEW_LINE>super.setTabSize(1);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// this lexer will automatically filter comments<NEW_LINE>SqlDdlParserImplTokenManager tm = new SqlDdlParserImplTokenManager(stream);<NEW_LINE>int pos = 0;<NEW_LINE>boolean hasToken = false;<NEW_LINE>while (true) {<NEW_LINE>Token token = tm.getNextToken();<NEW_LINE>if (token.kind == SqlDdlParserImplTokenManager.EOF) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>hasToken = true;<NEW_LINE>if (token.kind == SqlDdlParserImplTokenManager.SEMICOLON) {<NEW_LINE>int e = 1 + posToIndex(sql, token.beginLine, token.beginColumn);<NEW_LINE>stmts.add(sql.substring(pos, e));<NEW_LINE>pos = e;<NEW_LINE>hasToken = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if the last part has no token, we discard it<NEW_LINE>if (pos < sql.length() && hasToken) {<NEW_LINE>// TODO(lhw) find a better way than modify original SQL statements<NEW_LINE>// At this point, if the last char == ';', it must be in a comment,<NEW_LINE>// in case the parser report an error at this commented ';'<NEW_LINE>// we replace this ';' to ' ' (still keep it's length).<NEW_LINE>// It's a problem when parser stop at a commented ';' because we think ';'<NEW_LINE>// as separator of statements, so we may falsely accept this query.<NEW_LINE>// Fortunately, there is only one case it will happen, that is the last<NEW_LINE>// char in a query is ';' AND is commented AND is where error reported (<NEW_LINE>// actually, the parser is stopping at EOF, but the error will be reported<NEW_LINE>// at ';')<NEW_LINE>// Example: 'SELECT -- comment ;'<NEW_LINE>String lastStmt = sql.substring(pos);<NEW_LINE>lastStmt = lastStmt.replaceAll(";$", " ");<NEW_LINE>stmts.add(lastStmt);<NEW_LINE>}<NEW_LINE>return stmts;<NEW_LINE>} | stmts = new LinkedList<>(); |
743,112 | protected void initializeDataExtends(Relation<NumberVector> relation, int dim, double[] min, double[] extend) {<NEW_LINE>assert (min.length == <MASK><NEW_LINE>// if no parameter for min max compute min max values for each dimension<NEW_LINE>// from dataset<NEW_LINE>if (minima == null || maxima == null || minima.length == 0 || maxima.length == 0) {<NEW_LINE>double[][] minmax = RelationUtil.computeMinMax(relation);<NEW_LINE>final double[] dmin = minmax[0], dmax = minmax[1];<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>min[d] = dmin[d];<NEW_LINE>extend[d] = dmax[d] - dmin[d];<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (minima.length == dim) {<NEW_LINE>System.arraycopy(minima, 0, min, 0, dim);<NEW_LINE>} else if (minima.length == 1) {<NEW_LINE>Arrays.fill(min, minima[0]);<NEW_LINE>} else {<NEW_LINE>throw new AbortException("Invalid minima specified: expected " + dim + " got minima dimensionality: " + minima.length);<NEW_LINE>}<NEW_LINE>if (maxima.length == dim) {<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>extend[d] = maxima[d] - min[d];<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} else if (maxima.length == 1) {<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>extend[d] = maxima[0] - min[d];<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>throw new AbortException("Invalid maxima specified: expected " + dim + " got maxima dimensionality: " + maxima.length);<NEW_LINE>}<NEW_LINE>} | dim && extend.length == dim); |
9,101 | private static Point index2point(Point index) {<NEW_LINE>int indexPos = index.x;<NEW_LINE>int indexLevel = index.y;<NEW_LINE>if (indexPos < indexLevel) {<NEW_LINE>return new Point(indexLevel, indexPos);<NEW_LINE>} else if (indexPos < 3 * indexLevel) {<NEW_LINE>return new Point(indexLevel - (indexPos - indexLevel), indexLevel);<NEW_LINE>} else if (indexPos < 5 * indexLevel) {<NEW_LINE>return new Point(-indexLevel, indexLevel - <MASK><NEW_LINE>} else if (indexPos < 7 * indexLevel) {<NEW_LINE>return new Point((indexPos - 5 * indexLevel) - indexLevel, -indexLevel);<NEW_LINE>} else if (indexPos < 8 * indexLevel) {<NEW_LINE>return new Point(indexLevel, (indexPos - 7 * indexLevel) - indexLevel);<NEW_LINE>}<NEW_LINE>throw new InternalError("Index: " + indexPos);<NEW_LINE>} | (indexPos - 3 * indexLevel)); |
1,451,328 | public void handle(Context ctx) throws IOException, ServletException {<NEW_LINE>boolean isTraceMode = Cat.getManager().isTraceMode();<NEW_LINE>HttpServletRequest req = ctx.getRequest();<NEW_LINE>HttpServletResponse res = ctx.getResponse();<NEW_LINE>MessageProducer producer = Cat.getProducer();<NEW_LINE>int mode = ctx.getMode();<NEW_LINE>switch(mode) {<NEW_LINE>case 0:<NEW_LINE>ctx.setId(producer.createMessageId());<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>ctx.setRootId(req.getHeader("X-CAT-ROOT-ID"));<NEW_LINE>ctx.setParentId(req.getHeader("X-CAT-PARENT-ID"));<NEW_LINE>ctx.setId(req.getHeader("X-CAT-ID"));<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>ctx.setRootId(producer.createMessageId());<NEW_LINE>ctx.setParentId(ctx.getRootId());<NEW_LINE>ctx.setId(producer.createMessageId());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException(String.format("Internal Error: unsupported mode(%s)!", mode));<NEW_LINE>}<NEW_LINE>if (isTraceMode) {<NEW_LINE>MessageTree tree = Cat.getManager().getThreadLocalMessageTree();<NEW_LINE>tree.setMessageId(ctx.getId());<NEW_LINE>tree.setParentMessageId(ctx.getParentId());<NEW_LINE>tree.setRootMessageId(ctx.getRootId());<NEW_LINE>res.<MASK><NEW_LINE>switch(mode) {<NEW_LINE>case 0:<NEW_LINE>res.setHeader("X-CAT-ROOT-ID", ctx.getId());<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>res.setHeader("X-CAT-ROOT-ID", ctx.getRootId());<NEW_LINE>res.setHeader("X-CAT-PARENT-ID", ctx.getParentId());<NEW_LINE>res.setHeader("X-CAT-ID", ctx.getId());<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>res.setHeader("X-CAT-ROOT-ID", ctx.getRootId());<NEW_LINE>res.setHeader("X-CAT-PARENT-ID", ctx.getParentId());<NEW_LINE>res.setHeader("X-CAT-ID", ctx.getId());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ctx.handle();<NEW_LINE>} | setHeader("X-CAT-SERVER", getCatServer()); |
1,340,914 | public static Scriptable jsConstructor(final Context cx, final Object[] args, final Function ctorObj, final boolean inNewExpr) {<NEW_LINE>final PointerEvent event = new PointerEvent();<NEW_LINE>if (args.length != 0) {<NEW_LINE>event.setType(Context.toString(args[0]));<NEW_LINE>event.setBubbles(false);<NEW_LINE>event.setCancelable(false);<NEW_LINE>event.width_ = 1;<NEW_LINE>event.height_ = 1;<NEW_LINE>}<NEW_LINE>if (args.length > 1) {<NEW_LINE>final NativeObject object <MASK><NEW_LINE>event.setBubbles((boolean) getValue(object, "bubbles", event.isBubbles()));<NEW_LINE>event.pointerId_ = (int) getValue(object, "pointerId", event.pointerId_);<NEW_LINE>event.width_ = (int) getValue(object, "width", event.width_);<NEW_LINE>event.height_ = (int) getValue(object, "height", event.height_);<NEW_LINE>event.pressure_ = (double) getValue(object, "pressure", event.pressure_);<NEW_LINE>event.tiltX_ = (int) getValue(object, "tiltX", event.tiltX_);<NEW_LINE>event.tiltY_ = (int) getValue(object, "tiltY", event.tiltY_);<NEW_LINE>event.pointerType_ = (String) getValue(object, "pointerType", event.pointerType_);<NEW_LINE>event.isPrimary_ = (boolean) getValue(object, "isPrimary", event.isPrimary_);<NEW_LINE>}<NEW_LINE>return event;<NEW_LINE>} | = (NativeObject) args[1]; |
1,800,991 | private void displayFile(AvroFileStoreConnector connector) {<NEW_LINE>try {<NEW_LINE>System.out.println("===============================");<NEW_LINE>System.out.println("Accessing file: " + fileName);<NEW_LINE>File file = connector.getFile();<NEW_LINE>System.out.println("File: " + file.getName());<NEW_LINE>System.out.println(<MASK><NEW_LINE>System.out.println("------------------------------------------------------------------------");<NEW_LINE>ConnectedAssetProperties assetProperties = connector.getConnectedAssetProperties(clientUserId);<NEW_LINE>if (assetProperties != null) {<NEW_LINE>System.out.println(assetProperties.toString());<NEW_LINE>} else {<NEW_LINE>System.out.println("No asset properties ...");<NEW_LINE>}<NEW_LINE>} catch (FileException error) {<NEW_LINE>System.out.println("The connector is unable to retrieve the requested record because the file is not valid.");<NEW_LINE>} catch (Throwable exception) {<NEW_LINE>System.out.println("Exception " + exception.getMessage());<NEW_LINE>}<NEW_LINE>} | "Path: " + file.getPath()); |
1,532,171 | public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {<NEW_LINE>final String[] indices = Strings.splitStringByCommaToArray(request.param("index"));<NEW_LINE>final String[] fields = Strings.splitStringByCommaToArray(request.param("fields"));<NEW_LINE>if (request.getRestApiVersion() == RestApiVersion.V_7) {<NEW_LINE>if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY);<NEW_LINE>final String[] types = request.paramAsStringArrayOrEmptyIfAll("type");<NEW_LINE>if (includeTypeName == false && types.length > 0) {<NEW_LINE>throw new IllegalArgumentException("Types cannot be specified unless include_type_name" + " is set to true.");<NEW_LINE>}<NEW_LINE>if (request.hasParam("local")) {<NEW_LINE>request.param("local");<NEW_LINE>deprecationLogger.compatibleCritical("get_field_mapping_local", "Use [local] in get field mapping requests is deprecated. " + "The parameter will be removed in the next major version");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>GetFieldMappingsRequest getMappingsRequest = new GetFieldMappingsRequest();<NEW_LINE>getMappingsRequest.indices(indices).fields(fields).includeDefaults(request.paramAsBoolean("include_defaults", false));<NEW_LINE>getMappingsRequest.indicesOptions(IndicesOptions.fromRequest(request, getMappingsRequest.indicesOptions()));<NEW_LINE>return channel -> client.admin().indices().getFieldMappings(getMappingsRequest, new RestBuilderListener<>(channel) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public RestResponse buildResponse(GetFieldMappingsResponse response, XContentBuilder builder) throws Exception {<NEW_LINE>Map<String, Map<String, FieldMappingMetadata>> mappingsByIndex = response.mappings();<NEW_LINE>RestStatus status = OK;<NEW_LINE>if (mappingsByIndex.isEmpty() && fields.length > 0) {<NEW_LINE>status = NOT_FOUND;<NEW_LINE>}<NEW_LINE>response.toXContent(builder, request);<NEW_LINE>return new BytesRestResponse(status, builder);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | deprecationLogger.compatibleCritical("get_field_mapping_with_types", INCLUDE_TYPE_DEPRECATION_MESSAGE); |
1,183,682 | private boolean processUnsafeStore(RawStoreNode store, PEReadEliminationBlockState state, GraphEffectList effects) {<NEW_LINE>if (store.ordersMemoryAccesses()) {<NEW_LINE>state.killReadCache();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ResolvedJavaType type = StampTool.typeOrNull(store.object());<NEW_LINE>if (type != null && type.isArray()) {<NEW_LINE>JavaKind accessKind = store.accessKind();<NEW_LINE>JavaKind componentKind = type.getComponentType().getJavaKind();<NEW_LINE>LocationIdentity <MASK><NEW_LINE>if (store.offset().isConstant()) {<NEW_LINE>long offset = store.offset().asJavaConstant().asLong();<NEW_LINE>boolean overflowAccess = isOverflowAccess(accessKind, componentKind);<NEW_LINE>int index = overflowAccess ? -1 : VirtualArrayNode.entryIndexForOffset(tool.getMetaAccess(), offset, accessKind, type.getComponentType(), Integer.MAX_VALUE);<NEW_LINE>if (index != -1) {<NEW_LINE>return processStore(store, store.object(), location, index, accessKind, overflowAccess, store.value(), state, effects);<NEW_LINE>} else {<NEW_LINE>state.killReadCache(location, index);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>processIdentity(state, location);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>state.killReadCache();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | location = NamedLocationIdentity.getArrayLocation(componentKind); |
68,110 | public List<MechanicalPipe> adoptTransmittersAndAcceptorsFrom(FluidNetwork net) {<NEW_LINE>float oldScale = currentScale;<NEW_LINE>long oldCapacity = getCapacity();<NEW_LINE>List<MechanicalPipe> transmittersToUpdate = super.adoptTransmittersAndAcceptorsFrom(net);<NEW_LINE>// Merge the fluid scales<NEW_LINE>long capacity = getCapacity();<NEW_LINE>currentScale = Math.min(1, capacity == 0 ? 0 : (currentScale * oldCapacity + net.currentScale <MASK><NEW_LINE>if (isRemote()) {<NEW_LINE>if (fluidTank.isEmpty() && !net.fluidTank.isEmpty()) {<NEW_LINE>fluidTank.setStack(net.getBuffer());<NEW_LINE>net.fluidTank.setEmpty();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!net.fluidTank.isEmpty()) {<NEW_LINE>if (fluidTank.isEmpty()) {<NEW_LINE>fluidTank.setStack(net.getBuffer());<NEW_LINE>} else if (fluidTank.isFluidEqual(net.fluidTank.getFluid())) {<NEW_LINE>int amount = net.fluidTank.getFluidAmount();<NEW_LINE>MekanismUtils.logMismatchedStackSize(fluidTank.growStack(amount, Action.EXECUTE), amount);<NEW_LINE>} else {<NEW_LINE>Mekanism.logger.error("Incompatible fluid networks merged.");<NEW_LINE>}<NEW_LINE>net.fluidTank.setEmpty();<NEW_LINE>}<NEW_LINE>if (oldScale != currentScale) {<NEW_LINE>// We want to make sure we update to the scale change<NEW_LINE>needsUpdate = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return transmittersToUpdate;<NEW_LINE>} | * net.capacity) / capacity); |
669,664 | public void rename(final Map<Path, Path> selected) {<NEW_LINE>final DefaultMainAction action = new DefaultMainAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final SessionPool pool = parent.getSession();<NEW_LINE>final MoveWorker move = new MoveWorker(selected, pool.getHost().getProtocol().getStatefulness() == Protocol.Statefulness.stateful ? SessionPoolFactory.create(parent, pool.getHost()) : pool, cache, parent, LoginCallbackFactory.get(parent)) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void cleanup(final Map<Path, Path> result) {<NEW_LINE>final List<Path> <MASK><NEW_LINE>changed.addAll(selected.keySet());<NEW_LINE>changed.addAll(selected.values());<NEW_LINE>parent.reload(parent.workdir(), changed, new ArrayList<>(selected.values()));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>parent.background(new WorkerBackgroundAction<Map<Path, Path>>(parent, parent.getSession(), move));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>this.rename(selected, action);<NEW_LINE>} | changed = new ArrayList<>(); |
1,140,058 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>activity = (SettingsActivity) requireActivity();<NEW_LINE>view.findViewById(R.id.export_internal).setOnClickListener(v -> {<NEW_LINE>final String fileName = "app_manager_rules_export-" + DateUtils.formatDateTime(System.currentTimeMillis()) + ".am.tsv";<NEW_LINE>exportRules.launch(fileName);<NEW_LINE>});<NEW_LINE>view.findViewById(R.id.import_internal).setOnClickListener(v -> importRules.launch(MIME_TSV));<NEW_LINE>view.findViewById(R.id.import_existing).setOnClickListener(v -> new MaterialAlertDialogBuilder(activity).setTitle(R.string.pref_import_existing).setMessage(R.string.apply_to_system_apps_question).setPositiveButton(R.string.no, (dialog, which) -> importExistingRules(false)).setNegativeButton(R.string.yes, ((dialog, which) -> importExistingRules(true<MASK><NEW_LINE>view.findViewById(R.id.import_watt).setOnClickListener(v -> importFromWatt.launch(MIME_XML));<NEW_LINE>view.findViewById(R.id.import_blocker).setOnClickListener(v -> importFromBlocker.launch(MIME_JSON));<NEW_LINE>} | ))).show()); |
1,064,408 | public QuranRow fromBookmark(Context context, Bookmark bookmark, Long tagId) {<NEW_LINE>final QuranRow.Builder <MASK><NEW_LINE>if (bookmark.isPageBookmark()) {<NEW_LINE>final int sura = quranInfo.getSuraNumberFromPage(bookmark.getPage());<NEW_LINE>builder.withText(quranDisplayData.getSuraNameString(context, bookmark.getPage())).withMetadata(quranDisplayData.getPageSubtitle(context, bookmark.getPage())).withType(QuranRow.PAGE_BOOKMARK).withBookmark(bookmark).withDate(bookmark.getTimestamp()).withSura(sura).withImageResource(R.drawable.ic_favorite);<NEW_LINE>} else {<NEW_LINE>String ayahText = bookmark.getAyahText();<NEW_LINE>final String title;<NEW_LINE>final String metadata;<NEW_LINE>if (ayahText == null) {<NEW_LINE>title = quranDisplayData.getAyahString(bookmark.getSura(), bookmark.getAyah(), context);<NEW_LINE>metadata = quranDisplayData.getPageSubtitle(context, bookmark.getPage());<NEW_LINE>} else {<NEW_LINE>title = ayahText;<NEW_LINE>metadata = quranDisplayData.getAyahMetadata(bookmark.getSura(), bookmark.getAyah(), bookmark.getPage(), context);<NEW_LINE>}<NEW_LINE>builder.withText(title).withMetadata(metadata).withType(QuranRow.AYAH_BOOKMARK).withBookmark(bookmark).withDate(bookmark.getTimestamp()).withImageResource(R.drawable.ic_favorite).withImageOverlayColor(ContextCompat.getColor(context, R.color.ayah_bookmark_color));<NEW_LINE>}<NEW_LINE>if (tagId != null) {<NEW_LINE>builder.withTagId(tagId);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | builder = new QuranRow.Builder(); |
1,331,714 | private void dfsVisit(int node) {<NEW_LINE>int i;<NEW_LINE><MASK><NEW_LINE>if (this.s2.isEmpty()) {<NEW_LINE>this.s1.push(node);<NEW_LINE>this.s2.push(node, node, x[f[node]].getUB());<NEW_LINE>i = 0;<NEW_LINE>while (xyGraph[node][i] != -1) {<NEW_LINE>if (dfsNodes[xyGraph[node][i]] == 0) {<NEW_LINE>this.dfsVisit(xyGraph[node][i]);<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>while (this.s2.peek(this.recupStack) && this.recupStack[2] < y[node].getLB()) {<NEW_LINE>// the topmost component cannot reach "node".<NEW_LINE>while ((i = this.s1.pop()) != this.recupStack[0]) {<NEW_LINE>this.sccNumbers[i] = currentSccNumber;<NEW_LINE>}<NEW_LINE>this.sccNumbers[i] = currentSccNumber;<NEW_LINE>this.s2.pop();<NEW_LINE>currentSccNumber++;<NEW_LINE>}<NEW_LINE>this.s1.push(node);<NEW_LINE>this.recupStack[0] = node;<NEW_LINE>this.recupStack[1] = node;<NEW_LINE>this.recupStack[2] = this.x[this.f[node]].getUB();<NEW_LINE>this.mergeStack(node);<NEW_LINE>i = 0;<NEW_LINE>while (xyGraph[node][i] != -1) {<NEW_LINE>if (dfsNodes[xyGraph[node][i]] == 0) {<NEW_LINE>this.dfsVisit(xyGraph[node][i]);<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.dfsNodes[node] = 2;<NEW_LINE>} | this.dfsNodes[node] = 1; |
286,171 | public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) {<NEW_LINE>final RelNode buildInput;<NEW_LINE>final RelNode streamInput;<NEW_LINE>streamInput = left;<NEW_LINE>buildInput = right;<NEW_LINE>final double streamRowCount = mq.getRowCount(streamInput);<NEW_LINE>final double buildRowCount = mq.getRowCount(buildInput);<NEW_LINE>if (Double.isInfinite(streamRowCount) || Double.isInfinite(buildRowCount)) {<NEW_LINE>return planner.getCostFactory().makeHugeCost();<NEW_LINE>}<NEW_LINE>double buildWeight = CostModelWeight.INSTANCE.getBuildWeight();<NEW_LINE>double probeWeight = CostModelWeight.INSTANCE.getProbeWeight();<NEW_LINE>double rowCount = streamRowCount + buildRowCount;<NEW_LINE>double cpu = buildWeight * buildRowCount + probeWeight * streamRowCount;<NEW_LINE>double memory = MemoryEstimator.estimateRowSizeInHashTable(buildInput.getRowType()) * buildRowCount;<NEW_LINE>return planner.getCostFactory().makeCost(rowCount, <MASK><NEW_LINE>} | cpu, memory, 0, 0); |
350,517 | // @see com.biglybt.ui.swt.views.table.TableCellSWTPaintListener#cellPaint(org.eclipse.swt.graphics.GC, com.biglybt.ui.swt.views.table.TableCellSWT)<NEW_LINE>@Override<NEW_LINE>public void cellPaint(GC gcImage, TableCellSWT cell) {<NEW_LINE>int percentDone = getPercentDone(cell);<NEW_LINE>Rectangle bounds = cell.getBounds();<NEW_LINE>int yOfs = (bounds.height - 13) / 2;<NEW_LINE>int x1 = bounds.width - borderWidth - 2;<NEW_LINE>int y1 = bounds.height - 3 - yOfs;<NEW_LINE>if (x1 < 10 || y1 < 3) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int textYofs = 0;<NEW_LINE>if (y1 >= 28) {<NEW_LINE>yOfs = 2;<NEW_LINE>y1 = 16;<NEW_LINE>// textYofs = yOfs;<NEW_LINE>}<NEW_LINE>mapCellLastPercentDone.put(cell, new Integer(percentDone));<NEW_LINE>ImageLoader imageLoader = ImageLoader.getInstance();<NEW_LINE>Image <MASK><NEW_LINE>Image img0 = imageLoader.getImage("dl_bar_0");<NEW_LINE>Image img1 = imageLoader.getImage(percentDone < 1000 ? "dl_bar_1" : "dl_bar_1g");<NEW_LINE>// draw begining and end<NEW_LINE>if (!imgEnd.isDisposed()) {<NEW_LINE>gcImage.drawImage(imgEnd, bounds.x, bounds.y + yOfs);<NEW_LINE>gcImage.drawImage(imgEnd, bounds.x + x1 + 1, bounds.y + yOfs);<NEW_LINE>}<NEW_LINE>// draw border<NEW_LINE>// Color fg = gcImage.getForeground();<NEW_LINE>// gcImage.setForeground(Colors.grey);<NEW_LINE>// gcImage.drawRectangle(bounds.x, bounds.y + yOfs, x1 + 1, y1 + 1);<NEW_LINE>// gcImage.setForeground(fg);<NEW_LINE>int limit = (x1 * percentDone) / 1000;<NEW_LINE>if (!img1.isDisposed() && limit > 0) {<NEW_LINE>Rectangle imgBounds = img1.getBounds();<NEW_LINE>gcImage.drawImage(img1, 0, 0, imgBounds.width, imgBounds.height, bounds.x + 1, bounds.y + yOfs, limit, imgBounds.height);<NEW_LINE>}<NEW_LINE>if (percentDone < 1000 && !img0.isDisposed()) {<NEW_LINE>Rectangle imgBounds = img0.getBounds();<NEW_LINE>gcImage.drawImage(img0, 0, 0, imgBounds.width, imgBounds.height, bounds.x + limit + 1, bounds.y + yOfs, x1 - limit, imgBounds.height);<NEW_LINE>}<NEW_LINE>imageLoader.releaseImage("dl_bar_end");<NEW_LINE>imageLoader.releaseImage("dl_bar_0");<NEW_LINE>imageLoader.releaseImage("dl_bar_1");<NEW_LINE>// gcImage.setBackground(Colors.blues[Colors.BLUES_DARKEST]);<NEW_LINE>// gcImage.fillRectangle(bounds.x + 1, bounds.y + 1 + yOfs, limit, y1);<NEW_LINE>// if (limit < x1) {<NEW_LINE>// gcImage.setBackground(Colors.blues[Colors.BLUES_LIGHTEST]);<NEW_LINE>// gcImage.fillRectangle(bounds.x + limit + 1, bounds.y + 1 + yOfs, x1<NEW_LINE>// - limit, y1);<NEW_LINE>// }<NEW_LINE>if (textColor == null) {<NEW_LINE>textColor = ColorCache.getColor(gcImage.getDevice(), "#005ACF");<NEW_LINE>}<NEW_LINE>// if (textYofs == 0) {<NEW_LINE>// if (fontText == null) {<NEW_LINE>// fontText = Utils.getFontWithHeight(gcImage.getFont(), gcImage, y1);<NEW_LINE>// }<NEW_LINE>// gcImage.setFont(fontText);<NEW_LINE>gcImage.setForeground(textColor);<NEW_LINE>// }<NEW_LINE>String sPercent = DisplayFormatters.formatPercentFromThousands(percentDone);<NEW_LINE>GCStringPrinter.printString(gcImage, sPercent, new Rectangle(bounds.x + 4, bounds.y + yOfs, bounds.width - 4, 13), true, false, SWT.CENTER);<NEW_LINE>} | imgEnd = imageLoader.getImage("dl_bar_end"); |
855,680 | public void deleteById(String id) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>String resourceName = Utils.getValueFromIdByName(id, "digitalTwinsInstances");<NEW_LINE>if (resourceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'digitalTwinsInstances'.", id)));<NEW_LINE>}<NEW_LINE>String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections");<NEW_LINE>if (privateEndpointConnectionName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(resourceGroupName, resourceName, privateEndpointConnectionName, Context.NONE);<NEW_LINE>} | format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); |
1,750,971 | public void drawViewFinderBorder(Canvas canvas) {<NEW_LINE>Rect framingRect = getFramingRect();<NEW_LINE>// Top-left corner<NEW_LINE>Path path = new Path();<NEW_LINE>path.moveTo(framingRect.left, framingRect.top + mBorderLineLength);<NEW_LINE>path.lineTo(framingRect.left, framingRect.top);<NEW_LINE>path.lineTo(framingRect.left + mBorderLineLength, framingRect.top);<NEW_LINE>canvas.drawPath(path, mBorderPaint);<NEW_LINE>// Top-right corner<NEW_LINE>path.moveTo(framingRect.right, framingRect.top + mBorderLineLength);<NEW_LINE>path.lineTo(framingRect.right, framingRect.top);<NEW_LINE>path.lineTo(framingRect.right - mBorderLineLength, framingRect.top);<NEW_LINE>canvas.drawPath(path, mBorderPaint);<NEW_LINE>// Bottom-right corner<NEW_LINE>path.moveTo(framingRect.right, framingRect.bottom - mBorderLineLength);<NEW_LINE>path.lineTo(framingRect.right, framingRect.bottom);<NEW_LINE>path.lineTo(framingRect.right - mBorderLineLength, framingRect.bottom);<NEW_LINE>canvas.drawPath(path, mBorderPaint);<NEW_LINE>// Bottom-left corner<NEW_LINE>path.moveTo(framingRect.left, framingRect.bottom - mBorderLineLength);<NEW_LINE>path.lineTo(framingRect.left, framingRect.bottom);<NEW_LINE>path.lineTo(framingRect.left + mBorderLineLength, framingRect.bottom);<NEW_LINE><MASK><NEW_LINE>} | canvas.drawPath(path, mBorderPaint); |
1,606,811 | void paint() {<NEW_LINE>// loadContentIcon may return a null image<NEW_LINE>if (image != null) {<NEW_LINE>image.paintIcon(comp, graphics, 0, 0);<NEW_LINE>}<NEW_LINE>// turn anti-aliasing on for the splash text<NEW_LINE>graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);<NEW_LINE>if (versionBox != null) {<NEW_LINE>String <MASK><NEW_LINE>versionBox.layout(NbBundle.getMessage(TopLogging.class, "currentVersion", buildNumber), graphics);<NEW_LINE>}<NEW_LINE>if (text != null) {<NEW_LINE>statusBox.layout(text, graphics);<NEW_LINE>}<NEW_LINE>// Draw progress bar if applicable<NEW_LINE>if (!noBar && maxSteps > 0) /* && barLength > 0*/<NEW_LINE>{<NEW_LINE>graphics.setColor(color_bar);<NEW_LINE>graphics.fillRect(bar.x, bar.y, barStart + barLength, bar.height);<NEW_LINE>if (!color_bar.equals(color_corner)) {<NEW_LINE>graphics.setColor(color_corner);<NEW_LINE>graphics.drawLine(bar.x, bar.y, bar.x, bar.y + bar.height);<NEW_LINE>graphics.drawLine(bar.x + barStart + barLength, bar.y, bar.x + barStart + barLength, bar.y + bar.height);<NEW_LINE>}<NEW_LINE>if (!color_bar.equals(color_edge)) {<NEW_LINE>graphics.setColor(color_edge);<NEW_LINE>graphics.drawLine(bar.x, bar.y + bar.height / 2, bar.x, bar.y + bar.height / 2);<NEW_LINE>graphics.drawLine(bar.x + barStart + barLength, bar.y + bar.height / 2, bar.x + barStart + barLength, bar.y + bar.height / 2);<NEW_LINE>}<NEW_LINE>barStart += barLength;<NEW_LINE>barLength = 0;<NEW_LINE>}<NEW_LINE>} | buildNumber = System.getProperty("netbeans.buildnumber"); |
1,061,724 | void bindTags(Map<TagKey<T>, List<Holder<T>>> newTags) {<NEW_LINE>Map<Holder.Reference<T>, List<TagKey<T>>> holderToTag = new IdentityHashMap<>();<NEW_LINE>this.holdersByName.values().forEach(v -> holderToTag.put(v, new ArrayList<>()));<NEW_LINE>newTags.forEach((name, values) -> values.forEach(holder -> addTagToHolder(holderToTag, name, holder)));<NEW_LINE>Set<TagKey<T>> set = Sets.difference(this.tags.keySet(<MASK><NEW_LINE>if (!set.isEmpty())<NEW_LINE>LOGGER.warn("Not all defined tags for registry {} are present in data pack: {}", this.self.key(), set.stream().map(k -> k.location().toString()).sorted().collect(Collectors.joining(", \n\t")));<NEW_LINE>Map<TagKey<T>, HolderSet.Named<T>> tmpTags = new IdentityHashMap<>(this.tags);<NEW_LINE>newTags.forEach((k, v) -> tmpTags.computeIfAbsent(k, this::createTag).bind(v));<NEW_LINE>Set<TagKey<T>> defaultedTags = Sets.difference(this.optionalTags.keySet(), newTags.keySet());<NEW_LINE>defaultedTags.forEach(name -> {<NEW_LINE>List<Holder<T>> defaults = this.optionalTags.get(name).stream().map(valueSupplier -> getHolder(valueSupplier.get()).orElse(null)).filter(Objects::nonNull).distinct().toList();<NEW_LINE>defaults.forEach(holder -> addTagToHolder(holderToTag, name, holder));<NEW_LINE>tmpTags.computeIfAbsent(name, this::createTag).bind(defaults);<NEW_LINE>});<NEW_LINE>holderToTag.forEach(Holder.Reference::bindTags);<NEW_LINE>this.tags = tmpTags;<NEW_LINE>this.owner.onBindTags(this.tags, defaultedTags);<NEW_LINE>} | ), newTags.keySet()); |
1,197,924 | public int compareTo(compactionFailed_args other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTinfo(), other.isSetTinfo());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTinfo()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetCredentials(), other.isSetCredentials());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetCredentials()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credentials, other.credentials);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetExternalCompactionId(), other.isSetExternalCompactionId());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetExternalCompactionId()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.externalCompactionId, other.externalCompactionId);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetExtent(), other.isSetExtent());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetExtent()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extent, other.extent);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | this.tinfo, other.tinfo); |
903,537 | private static String formatJson(String json_path) {<NEW_LINE>String ret = "";<NEW_LINE>String reg = ".(\\d{1,3}).{0,1}";<NEW_LINE>Boolean change_flag = false;<NEW_LINE>Matcher m1 = Pattern.compile<MASK><NEW_LINE>String newStr = "";<NEW_LINE>int rest = 0;<NEW_LINE>String tail = "";<NEW_LINE>while (m1.find()) {<NEW_LINE>int start = m1.start();<NEW_LINE>int end = m1.end() - 1;<NEW_LINE>if (json_path.charAt(start) != '.' || json_path.charAt(end) != '.') {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>newStr += json_path.substring(rest, m1.start()) + "[" + json_path.substring(start + 1, end) + "].";<NEW_LINE>rest = m1.end();<NEW_LINE>tail = json_path.substring(m1.end());<NEW_LINE>change_flag = true;<NEW_LINE>}<NEW_LINE>if (change_flag) {<NEW_LINE>ret = newStr + tail;<NEW_LINE>} else {<NEW_LINE>ret = json_path;<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | (reg).matcher(json_path); |
185,718 | public Builder mergeFrom(org.apache.jena.riot.protobuf.wire.PB_RDF.RDF_Graph other) {<NEW_LINE>if (other == org.apache.jena.riot.protobuf.wire.PB_RDF.RDF_Graph.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (tripleBuilder_ == null) {<NEW_LINE>if (!other.triple_.isEmpty()) {<NEW_LINE>if (triple_.isEmpty()) {<NEW_LINE>triple_ = other.triple_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureTripleIsMutable();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.triple_.isEmpty()) {<NEW_LINE>if (tripleBuilder_.isEmpty()) {<NEW_LINE>tripleBuilder_.dispose();<NEW_LINE>tripleBuilder_ = null;<NEW_LINE>triple_ = other.triple_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>tripleBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getTripleFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>tripleBuilder_.addAllMessages(other.triple_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>} | triple_.addAll(other.triple_); |
851,119 | public AppInstanceStreamingConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AppInstanceStreamingConfiguration appInstanceStreamingConfiguration = new AppInstanceStreamingConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AppInstanceDataType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>appInstanceStreamingConfiguration.setAppInstanceDataType(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("ResourceArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>appInstanceStreamingConfiguration.setResourceArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return appInstanceStreamingConfiguration;<NEW_LINE>} | class).unmarshall(context)); |
735,391 | private void initCastFunc() {<NEW_LINE>if (targetType.equals(Types.DOUBLE)) {<NEW_LINE>castFunc = x -> {<NEW_LINE>if (x == null) {<NEW_LINE>return null;<NEW_LINE>} else if (x instanceof String) {<NEW_LINE>return Double.parseDouble((String) x);<NEW_LINE>} else {<NEW_LINE>return ((Number) x).doubleValue();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else if (targetType.equals(Types.LONG)) {<NEW_LINE>castFunc = x -> {<NEW_LINE>if (x == null) {<NEW_LINE>return null;<NEW_LINE>} else if (x instanceof String) {<NEW_LINE>return Long.parseLong((String) x);<NEW_LINE>} else {<NEW_LINE>return ((Number) x).longValue();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else if (targetType.equals(Types.INT)) {<NEW_LINE>castFunc = x -> {<NEW_LINE>if (x == null) {<NEW_LINE>return null;<NEW_LINE>} else if (x instanceof String) {<NEW_LINE>return Integer.parseInt((String) x);<NEW_LINE>} else {<NEW_LINE>return ((Number) x).intValue();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else if (targetType.equals(Types.FLOAT)) {<NEW_LINE>castFunc = x -> {<NEW_LINE>if (x == null) {<NEW_LINE>return null;<NEW_LINE>} else if (x instanceof String) {<NEW_LINE>return Float<MASK><NEW_LINE>} else {<NEW_LINE>return ((Number) x).floatValue();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unsupported target type:" + targetType.getTypeClass().getCanonicalName());<NEW_LINE>}<NEW_LINE>} | .parseFloat((String) x); |
449,982 | public static byte[] addDependenciesToManifest(ByteArrayInputStream manifestStream, List<Dependency> deps) {<NEW_LINE>Map<String, Object> toml = new Toml().<MASK><NEW_LINE>Map<String, Object> dependencies = new LinkedHashMap<>();<NEW_LINE>if (toml.containsKey("dependencies")) {<NEW_LINE>Object tomlDepsAsObject = toml.get("dependencies");<NEW_LINE>Map<String, Object> updatedDependencies = new HashMap<>();<NEW_LINE>if (tomlDepsAsObject instanceof HashMap) {<NEW_LINE>// taking care of double quoted dependency names<NEW_LINE>Map<String, Object> tomlDeps = (HashMap<String, Object>) tomlDepsAsObject;<NEW_LINE>for (Map.Entry<String, Object> dep : tomlDeps.entrySet()) {<NEW_LINE>updatedDependencies.put(dep.getKey().replaceAll("^\"|\"$", ""), dep.getValue());<NEW_LINE>}<NEW_LINE>dependencies = updatedDependencies;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Dependency dep : deps) {<NEW_LINE>dependencies.put(dep.getOrgName() + "/" + dep.getModuleName(), dep.getMetadata().getVersion());<NEW_LINE>}<NEW_LINE>toml.put("dependencies", dependencies);<NEW_LINE>TomlWriter writer = new TomlWriter();<NEW_LINE>String tomlContent = writer.write(toml);<NEW_LINE>return tomlContent.getBytes(Charset.defaultCharset());<NEW_LINE>} | read(manifestStream).toMap(); |
710,654 | public Node cloneNode(Document doc, Node eold) {<NEW_LINE>Node enew = null;<NEW_LINE>if (eold instanceof Element) {<NEW_LINE>Element e = (Element) eold;<NEW_LINE>if (e.getTagName().equals(SVGConstants.SVG_IMAGE_TAG)) {<NEW_LINE>String url = e.getAttributeNS(SVGConstants.XLINK_NAMESPACE_URI, SVGConstants.XLINK_HREF_ATTRIBUTE);<NEW_LINE>ParsedURL urldata = new ParsedURL(url);<NEW_LINE>if (ThumbnailRegistryEntry.isCompatibleURLStatic(urldata)) {<NEW_LINE>enew = inlineThumbnail(doc, urldata, eold);<NEW_LINE>} else if ("file".equals(urldata.getProtocol())) {<NEW_LINE>enew = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (enew != null) {<NEW_LINE>return enew;<NEW_LINE>}<NEW_LINE>return super.cloneNode(doc, eold);<NEW_LINE>} | inlineExternal(doc, urldata, eold); |
1,578,305 | public void initialize(@Nullable View view) {<NEW_LINE>Objects.requireNonNull(view);<NEW_LINE>BookmarkManager.INSTANCE.setElevationActivePointChangedListener(this);<NEW_LINE>BookmarkManager.INSTANCE.setElevationCurrentPositionChangedListener(this);<NEW_LINE>final <MASK><NEW_LINE>mChart = view.findViewById(R.id.elevation_profile_chart);<NEW_LINE>mFloatingMarkerView = view.findViewById(R.id.floating_marker);<NEW_LINE>mCurrentLocationMarkerView = new CurrentLocationMarkerView(mContext);<NEW_LINE>mFloatingMarkerView.setChartView(mChart);<NEW_LINE>mCurrentLocationMarkerView.setChartView(mChart);<NEW_LINE>mMaxAltitude = view.findViewById(R.id.highest_altitude);<NEW_LINE>mMinAltitude = view.findViewById(R.id.lowest_altitude);<NEW_LINE>mChart.setBackgroundColor(ThemeUtils.getColor(mContext, R.attr.cardBackground));<NEW_LINE>mChart.setTouchEnabled(true);<NEW_LINE>mChart.setOnChartValueSelectedListener(this);<NEW_LINE>mChart.setDrawGridBackground(false);<NEW_LINE>mChart.setScaleXEnabled(true);<NEW_LINE>mChart.setScaleYEnabled(false);<NEW_LINE>mChart.setExtraTopOffset(0);<NEW_LINE>int sideOffset = resources.getDimensionPixelSize(R.dimen.margin_base);<NEW_LINE>int topOffset = 0;<NEW_LINE>mChart.setViewPortOffsets(sideOffset, topOffset, sideOffset, resources.getDimensionPixelSize(R.dimen.margin_base_plus_quarter));<NEW_LINE>mChart.getDescription().setEnabled(false);<NEW_LINE>mChart.setDrawBorders(false);<NEW_LINE>Legend l = mChart.getLegend();<NEW_LINE>l.setEnabled(false);<NEW_LINE>initAxises();<NEW_LINE>} | Resources resources = mContext.getResources(); |
3,735 | public void renderButton(PoseStack matrices, int mouseX, int mouseY, float partialTicks) {<NEW_LINE>RenderUtils.setup(this.backgroundLocation);<NEW_LINE>if (this.visible) {<NEW_LINE>this.isHovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;<NEW_LINE>if (this.pressed) {<NEW_LINE>this.pressedGui.draw(matrices, this.x, this.y);<NEW_LINE>} else if (this.isHovered) {<NEW_LINE>this.hoverGui.draw(matrices, <MASK><NEW_LINE>} else {<NEW_LINE>this.normalGui.draw(matrices, this.x, this.y);<NEW_LINE>}<NEW_LINE>// this.drawIcon(matrices, Minecraft.getInstance());<NEW_LINE>TinkerStationScreen.renderIcon(matrices, layout.getIcon(), this.x + 1, this.y + 1);<NEW_LINE>}<NEW_LINE>} | this.x, this.y); |
620,688 | public Boolean visitAsSetsMatchingRanges(AsSetsMatchingRanges asSetsMatchingRanges, AsPath arg) {<NEW_LINE>List<Range<Long><MASK><NEW_LINE>List<AsSet> asSets = arg.getAsSets();<NEW_LINE>int numRanges = asRanges.size();<NEW_LINE>int numAsSets = arg.length();<NEW_LINE>if (numAsSets < numRanges) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean anchorStart = asSetsMatchingRanges.getAnchorStart();<NEW_LINE>boolean anchorEnd = asSetsMatchingRanges.getAnchorEnd();<NEW_LINE>if (anchorStart) {<NEW_LINE>if (anchorEnd && numAsSets != numRanges) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return tryMatchRanges(asRanges, asSets.subList(0, numRanges));<NEW_LINE>} else if (anchorEnd) {<NEW_LINE>return tryMatchRanges(asRanges, asSets.subList(numAsSets - numRanges, numAsSets));<NEW_LINE>} else {<NEW_LINE>// no anchor<NEW_LINE>for (int i = 0; i <= numAsSets - numRanges; i++) {<NEW_LINE>if (tryMatchRanges(asRanges, asSets.subList(i, i + numRanges))) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | > asRanges = asSetsMatchingRanges.getAsRanges(); |
1,127,399 | public SRenderEnginePluginConfiguration convertToSObject(RenderEnginePluginConfiguration input) {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SRenderEnginePluginConfiguration result = new SRenderEnginePluginConfiguration();<NEW_LINE>result.setOid(input.getOid());<NEW_LINE>result.setUuid(input.getUuid());<NEW_LINE>result.setRid(input.getRid());<NEW_LINE>result.<MASK><NEW_LINE>result.setEnabled(input.getEnabled());<NEW_LINE>result.setDescription(input.getDescription());<NEW_LINE>PluginDescriptor pluginDescriptorVal = input.getPluginDescriptor();<NEW_LINE>result.setPluginDescriptorId(pluginDescriptorVal == null ? -1 : pluginDescriptorVal.getOid());<NEW_LINE>ObjectType settingsVal = input.getSettings();<NEW_LINE>result.setSettingsId(settingsVal == null ? -1 : settingsVal.getOid());<NEW_LINE>List<Long> listserializers = new ArrayList<Long>();<NEW_LINE>for (SerializerPluginConfiguration v : input.getSerializers()) {<NEW_LINE>listserializers.add(v.getOid());<NEW_LINE>}<NEW_LINE>result.setSerializers(listserializers);<NEW_LINE>UserSettings userSettingsVal = input.getUserSettings();<NEW_LINE>result.setUserSettingsId(userSettingsVal == null ? -1 : userSettingsVal.getOid());<NEW_LINE>return result;<NEW_LINE>} | setName(input.getName()); |
1,177,865 | private String generateServerPhaseTimeCostSpan(RpcInvokeContext context) {<NEW_LINE>TreeMap<String, String> resultMap = new TreeMap<>();<NEW_LINE>Long reqDeSerializeTime = (Long) context.get(RpcConstants.INTERNAL_KEY_REQ_DESERIALIZE_TIME_NANO);<NEW_LINE>Long respSerializeTime = (Long) context.get(RpcConstants.INTERNAL_KEY_RESP_SERIALIZE_TIME_NANO);<NEW_LINE>Long bizWaitTime = (Long) context.get(RpcConstants.INTERNAL_KEY_PROCESS_WAIT_TIME_NANO);<NEW_LINE>Long bizProcessTime = (Long) context.get(RpcConstants.INTERNAL_KEY_IMPL_ELAPSE_NANO);<NEW_LINE>Long ambushTime = (Long) context.get(RpcConstants.INTERNAL_KEY_SERVER_AMBUSH_TIME_NANO);<NEW_LINE>Long filterTime = (Long) context.get(RpcConstants.INTERNAL_KEY_SERVER_FILTER_TIME_NANO);<NEW_LINE>Long netWaitTime = (Long) context.get(RpcConstants.INTERNAL_KEY_SERVER_NET_WAIT_NANO);<NEW_LINE>resultMap.put(TracerRecord.R6.toString(), appendResult(calculateNanoTime(reqDeSerializeTime).toString(), calculateNanoTime(respSerializeTime).toString()));<NEW_LINE>resultMap.put(TracerRecord.R7.toString(), calculateNanoTime(bizWaitTime).toString());<NEW_LINE>resultMap.put(TracerRecord.R8.toString(), calculateNanoTime(bizProcessTime).toString());<NEW_LINE>resultMap.put(TracerRecord.R9.toString(), calculateNanoTime<MASK><NEW_LINE>resultMap.put(TracerRecord.R10.toString(), calculateNanoTime(filterTime).toString());<NEW_LINE>resultMap.put(TracerRecord.R11.toString(), calculateNanoTime(netWaitTime).toString());<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (Map.Entry<String, String> entry : resultMap.entrySet()) {<NEW_LINE>sb.append(entry.getKey());<NEW_LINE>sb.append("=");<NEW_LINE>sb.append(entry.getValue());<NEW_LINE>sb.append("&");<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | (ambushTime).toString()); |
1,831,992 | static void store(List<HistoryItem> history) {<NEW_LINE>Preferences _prefs = getPrefs();<NEW_LINE>for (int i = 0; i < history.size(); i++) {<NEW_LINE>HistoryItem hi = history.get(i);<NEW_LINE>if ((hi.id != i) && (hi.id >= history.size())) {<NEW_LINE>_prefs.remove(PROP_URL_PREFIX + hi.id);<NEW_LINE>_prefs.remove(PROP_ICON_PREFIX + hi.id);<NEW_LINE>}<NEW_LINE>hi.id = i;<NEW_LINE>_prefs.put(PROP_URL_PREFIX + i, hi.getPath());<NEW_LINE>if (hi.getIconBytes() == null) {<NEW_LINE>_prefs.remove(PROP_ICON_PREFIX + i);<NEW_LINE>} else {<NEW_LINE>_prefs.putByteArray(PROP_ICON_PREFIX + i, hi.getIconBytes());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.<MASK><NEW_LINE>} | log(Level.FINE, "Stored"); |
410,975 | // The tested exceptions cause FFDC so we have to allow for this.<NEW_LINE>@AllowedFFDC<NEW_LINE>public void runFreshMainBranchTck() throws Exception {<NEW_LINE>File repoParent = new File(GIT_REPO_PARENT_DIR);<NEW_LINE>File repo = new File(repoParent, GIT_REPO_NAME);<NEW_LINE>MvnUtils.mvnCleanInstall(repo);<NEW_LINE>String apiJar = findAPIJar();<NEW_LINE>server.copyFileToLibertyServerRoot(API_JAR_DIR_REL_PATH, "lib", apiJar);<NEW_LINE>server.startServer();<NEW_LINE>HashMap<String, String> addedProps = new HashMap<String, String>();<NEW_LINE>String apiVersion = MvnUtils.getApiSpecVersionAfterClone(repo);<NEW_LINE>System.out.println("Queried api.version is : " + apiVersion);<NEW_LINE>addedProps.put(MvnUtils.API_VERSION, apiVersion);<NEW_LINE>String tckVersion = MvnUtils.getTckVersionAfterClone(repo);<NEW_LINE>System.out.println("Queried tck.version is : " + tckVersion);<NEW_LINE>addedProps.put(MvnUtils.TCK_VERSION, tckVersion);<NEW_LINE>// A command line -Dprop=value actually gets to here as a environment variable...<NEW_LINE>String implVersion = System.getenv("impl.version");<NEW_LINE>System.<MASK><NEW_LINE>addedProps.put(MvnUtils.IMPL_VERSION, implVersion);<NEW_LINE>// We store a set of keys that we want the system to add "1.1" or "1.2" etc to<NEW_LINE>// depending on the pom.xml contents.<NEW_LINE>HashSet<String> versionedLibraries = new HashSet<>(Arrays.asList("org.eclipse.microprofile.reactive.messaging"));<NEW_LINE>// Used if there is no impl matching the spec/pom.xml <version> AND impl.version is not set<NEW_LINE>String backStopImpl = "1.0";<NEW_LINE>addedProps.put(MvnUtils.BACKSTOP_VERSION, backStopImpl);<NEW_LINE>MvnUtils.runTCKMvnCmd(server, "org.eclipse.microprofile.reactive.messaging.tck", this.getClass() + ":launchReactiveMessagingTCK", MvnUtils.DEFAULT_SUITE_FILENAME, addedProps, versionedLibraries);<NEW_LINE>Map<String, String> resultInfo = MvnUtils.getResultInfo(server);<NEW_LINE>resultInfo.put("results_type", "MicroProfile");<NEW_LINE>resultInfo.put("feature_name", "Reactive Messaging");<NEW_LINE>resultInfo.put("feature_version", "1.0");<NEW_LINE>MvnUtils.preparePublicationFile(resultInfo);<NEW_LINE>;<NEW_LINE>} | out.println("Passed in impl.version is : " + implVersion); |
559,385 | final GetConnectivityInfoResult executeGetConnectivityInfo(GetConnectivityInfoRequest getConnectivityInfoRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getConnectivityInfoRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetConnectivityInfoRequest> request = null;<NEW_LINE>Response<GetConnectivityInfoResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetConnectivityInfoRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getConnectivityInfoRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetConnectivityInfo");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetConnectivityInfoResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetConnectivityInfoResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,397,929 | public synchronized TypeMember createStructureMember(final BaseType containingType, final BaseType memberType, final String memberName, int memberOffset) throws CouldntSaveDataException {<NEW_LINE>Preconditions.checkNotNull(containingType, "Error: containing type argument can not be null");<NEW_LINE>Preconditions.checkNotNull(memberType, "Error: member type can not be null");<NEW_LINE><MASK><NEW_LINE>Preconditions.checkArgument(!memberName.isEmpty(), "Error: name argument can not be empty");<NEW_LINE>Preconditions.checkArgument(memberOffset >= 0, "Error: argument index argument can not be smaller than zero");<NEW_LINE>if (typesContainer.willTypeCreateCyclicReference(containingType, memberType)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// We need to determine the original type sizes before doing any changes to the type system!<NEW_LINE>final ImmutableMap<BaseType, Integer> originalTypeSizes = captureTypeSizesState(typesContainer.getAffectedTypes(containingType));<NEW_LINE>// We need to check if there is space in the struct for our new member.<NEW_LINE>final ImmutableList<TypeMember> subsequentMembers = containingType.getSubsequentMembersInclusive(memberOffset);<NEW_LINE>if (!subsequentMembers.isEmpty()) {<NEW_LINE>final int moveDelta = (memberOffset + memberType.getBitSize()) - subsequentMembers.get(0).getBitOffset().get();<NEW_LINE>if (moveDelta > 0) {<NEW_LINE>for (final TypeMember member : subsequentMembers) {<NEW_LINE>final int newOffset = member.getBitOffset().get() + moveDelta;<NEW_LINE>backend.updateStructureMember(member, member.getBaseType(), member.getName(), newOffset);<NEW_LINE>member.setOffset(Optional.of(newOffset));<NEW_LINE>notifyMemberUpdated(member);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final TypeMember member = backend.createStructureMember(containingType, memberType, memberName, memberOffset);<NEW_LINE>final ImmutableSet<BaseType> affectedTypes = typesContainer.addMember(member);<NEW_LINE>notifyMemberCreation(member, affectedTypes);<NEW_LINE>final Set<BaseType> inconsistentTypes = Sets.newHashSet(affectedTypes);<NEW_LINE>inconsistentTypes.remove(containingType);<NEW_LINE>ensureConsistencyAfterTypeUpdate(affectedTypes, inconsistentTypes, originalTypeSizes);<NEW_LINE>return member;<NEW_LINE>} | Preconditions.checkNotNull(memberName, "Error: name argument can not be null"); |
820,355 | public static Uri findFileUri(Context context, Uri folderUri, String fileNameToFind) {<NEW_LINE>final ContentResolver resolver = context.getContentResolver();<NEW_LINE>final Uri childrenUri = DocumentsContract.buildChildDocumentsUriUsingTree(folderUri, DocumentsContract.getDocumentId(folderUri));<NEW_LINE>try {<NEW_LINE>Cursor c = resolver.query(childrenUri, new String[] { DocumentsContract.Document.COLUMN_DOCUMENT_ID }, null, null, null);<NEW_LINE>while (c.moveToNext()) {<NEW_LINE>String documentID = c.getString(0);<NEW_LINE>String fileName = getFileNameFromDocumentID(documentID);<NEW_LINE>if (fileName.equals(fileNameToFind)) {<NEW_LINE>Uri uri = <MASK><NEW_LINE>c.close();<NEW_LINE>return uri;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>c.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e("EasyRPG", "Failed query: " + e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | DocumentsContract.buildDocumentUriUsingTree(folderUri, documentID); |
838,156 | public JSDynamicObject createPrototype(JSRealm realm, JSFunctionObject constructor) {<NEW_LINE>JSContext ctx = realm.getContext();<NEW_LINE>JSObject prototype = JSObjectUtil.createOrdinaryPrototypeObject(realm);<NEW_LINE>JSObjectUtil.putConstructorProperty(ctx, prototype, constructor);<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, YEARS, realm.lookupAccessor(TemporalDurationPrototypeBuiltins.BUILTINS, YEARS));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, MONTHS, realm.lookupAccessor(TemporalDurationPrototypeBuiltins.BUILTINS, MONTHS));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, WEEKS, realm.lookupAccessor(TemporalDurationPrototypeBuiltins.BUILTINS, WEEKS));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, DAYS, realm.lookupAccessor(TemporalDurationPrototypeBuiltins.BUILTINS, DAYS));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, HOURS, realm.lookupAccessor(TemporalDurationPrototypeBuiltins.BUILTINS, HOURS));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, MINUTES, realm.lookupAccessor(TemporalDurationPrototypeBuiltins.BUILTINS, MINUTES));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, SECONDS, realm.lookupAccessor(TemporalDurationPrototypeBuiltins.BUILTINS, SECONDS));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, MILLISECONDS, realm.lookupAccessor(TemporalDurationPrototypeBuiltins.BUILTINS, MILLISECONDS));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, MICROSECONDS, realm.lookupAccessor(TemporalDurationPrototypeBuiltins.BUILTINS, MICROSECONDS));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, NANOSECONDS, realm.lookupAccessor<MASK><NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, SIGN, realm.lookupAccessor(TemporalDurationPrototypeBuiltins.BUILTINS, SIGN));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, BLANK, realm.lookupAccessor(TemporalDurationPrototypeBuiltins.BUILTINS, BLANK));<NEW_LINE>JSObjectUtil.putFunctionsFromContainer(realm, prototype, TemporalDurationPrototypeBuiltins.BUILTINS);<NEW_LINE>JSObjectUtil.putToStringTag(prototype, TO_STRING_TAG);<NEW_LINE>return prototype;<NEW_LINE>} | (TemporalDurationPrototypeBuiltins.BUILTINS, NANOSECONDS)); |
1,525,331 | public void run(Publisher<T> pub) throws InterruptedException {<NEW_LINE>ManualSubscriber<T> <MASK><NEW_LINE>ManualSubscriber<T> sub2 = env.newManualSubscriber(pub);<NEW_LINE>ManualSubscriber<T> sub3 = env.newManualSubscriber(pub);<NEW_LINE>sub1.request(1);<NEW_LINE>T x1 = sub1.nextElement(String.format("Publisher %s did not produce the requested 1 element on 1st subscriber", pub));<NEW_LINE>sub2.request(2);<NEW_LINE>List<T> y1 = sub2.nextElements(2, String.format("Publisher %s did not produce the requested 2 elements on 2nd subscriber", pub));<NEW_LINE>sub1.request(1);<NEW_LINE>T x2 = sub1.nextElement(String.format("Publisher %s did not produce the requested 1 element on 1st subscriber", pub));<NEW_LINE>sub3.request(3);<NEW_LINE>List<T> z1 = sub3.nextElements(3, String.format("Publisher %s did not produce the requested 3 elements on 3rd subscriber", pub));<NEW_LINE>sub3.request(1);<NEW_LINE>T z2 = sub3.nextElement(String.format("Publisher %s did not produce the requested 1 element on 3rd subscriber", pub));<NEW_LINE>sub3.request(1);<NEW_LINE>T z3 = sub3.nextElement(String.format("Publisher %s did not produce the requested 1 element on 3rd subscriber", pub));<NEW_LINE>sub3.requestEndOfStream(String.format("Publisher %s did not complete the stream as expected on 3rd subscriber", pub));<NEW_LINE>sub2.request(3);<NEW_LINE>List<T> y2 = sub2.nextElements(3, String.format("Publisher %s did not produce the requested 3 elements on 2nd subscriber", pub));<NEW_LINE>sub2.requestEndOfStream(String.format("Publisher %s did not complete the stream as expected on 2nd subscriber", pub));<NEW_LINE>sub1.request(2);<NEW_LINE>List<T> x3 = sub1.nextElements(2, String.format("Publisher %s did not produce the requested 2 elements on 1st subscriber", pub));<NEW_LINE>sub1.request(1);<NEW_LINE>T x4 = sub1.nextElement(String.format("Publisher %s did not produce the requested 1 element on 1st subscriber", pub));<NEW_LINE>sub1.requestEndOfStream(String.format("Publisher %s did not complete the stream as expected on 1st subscriber", pub));<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<T> r = new ArrayList<T>(Arrays.asList(x1, x2));<NEW_LINE>r.addAll(x3);<NEW_LINE>r.addAll(Collections.singleton(x4));<NEW_LINE>List<T> check1 = new ArrayList<T>(y1);<NEW_LINE>check1.addAll(y2);<NEW_LINE>// noinspection unchecked<NEW_LINE>List<T> check2 = new ArrayList<T>(z1);<NEW_LINE>check2.add(z2);<NEW_LINE>check2.add(z3);<NEW_LINE>assertEquals(r, check1, String.format("Publisher %s did not produce the same element sequence for subscribers 1 and 2", pub));<NEW_LINE>assertEquals(r, check2, String.format("Publisher %s did not produce the same element sequence for subscribers 1 and 3", pub));<NEW_LINE>} | sub1 = env.newManualSubscriber(pub); |
1,581,352 | protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>String sentence = (String) msg;<NEW_LINE>Parser parser = new Parser(PATTERN, sentence);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.set(Position.KEY_SATELLITES, parser.nextInt());<NEW_LINE>position.setValid(true);<NEW_LINE>position.setTime(parser.nextDateTime());<NEW_LINE>position.setLatitude(parser.nextDouble());<NEW_LINE>position.setLongitude(parser.nextDouble());<NEW_LINE>position.setSpeed(UnitsConverter.knotsFromMps(parser.nextDouble()));<NEW_LINE>position.setCourse(parser.nextDouble());<NEW_LINE>if (parser.hasNext(3)) {<NEW_LINE>int input = parser.nextHexInt();<NEW_LINE>position.set(Position.KEY_IGNITION, !BitUtil<MASK><NEW_LINE>position.set(Position.PREFIX_IN + 1, !BitUtil.check(input, 1));<NEW_LINE>position.set(Position.PREFIX_IN + 2, !BitUtil.check(input, 2));<NEW_LINE>position.set(Position.KEY_EVENT, parser.nextInt());<NEW_LINE>position.set(Position.KEY_ODOMETER, parser.nextInt());<NEW_LINE>}<NEW_LINE>position.set(Position.PREFIX_ADC + 1, parser.nextInt());<NEW_LINE>position.set(Position.KEY_BATTERY, parser.nextInt() * 0.01);<NEW_LINE>int index = sentence.lastIndexOf('+');<NEW_LINE>if (index > 0 && channel instanceof DatagramChannel) {<NEW_LINE>channel.writeAndFlush(new NetworkMessage("ACK," + sentence.substring(index + 1) + "#", remoteAddress));<NEW_LINE>}<NEW_LINE>return position;<NEW_LINE>} | .check(input, 0)); |
262,684 | public boolean hasPrevious() throws IOException {<NEW_LINE>synchronized (db) {<NEW_LINE>if (modCount != expectedModCount) {<NEW_LINE>reset();<NEW_LINE>}<NEW_LINE>if (!hasPrev) {<NEW_LINE>if (bufferId < 0 || keyIndex < 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Check previous key index<NEW_LINE>int prevIndex = keyIndex - 1;<NEW_LINE>try {<NEW_LINE>// Process previous leaf if needed<NEW_LINE>FieldKeyRecordNode leaf = (FieldKeyRecordNode) getFieldKeyNode(bufferId);<NEW_LINE>if (prevIndex < 0) {<NEW_LINE>leaf = leaf.getPreviousLeaf();<NEW_LINE>if (leaf == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>prevIndex <MASK><NEW_LINE>Field prevKey = leaf.getKeyField(prevIndex);<NEW_LINE>if (minKey != null && prevKey.compareTo(minKey) < 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>bufferId = leaf.getBufferId();<NEW_LINE>key = prevKey;<NEW_LINE>keyIndex = prevIndex;<NEW_LINE>hasNext = false;<NEW_LINE>hasPrev = true;<NEW_LINE>} else // else, use keys cache<NEW_LINE>{<NEW_LINE>Field prevKey = leaf.getKeyField(prevIndex);<NEW_LINE>hasPrev = minKey == null ? true : (prevKey.compareTo(minKey) >= 0);<NEW_LINE>if (hasPrev) {<NEW_LINE>key = prevKey;<NEW_LINE>keyIndex = prevIndex;<NEW_LINE>hasNext = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>nodeMgr.releaseNodes();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hasPrev;<NEW_LINE>}<NEW_LINE>} | = leaf.getKeyCount() - 1; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.